<commit_before>// @(#)root/eve:$Id$
// Author: <NAME>

// Calorimeter detailed view by using TEveCaloDataVec as data-source.
// Demonstrantes how to plot calorimiter data with irregular bins.

#include "calorimeters.C"

void calo_detail()
{
   //gROOT->LoadMacro("calorimeters.C");
   TEveManager::Create();

   // data
   TEveCaloDataVec* data = MakeVecData(20);
   data->IncDenyDestroy(); // don't delete if zero parent

   // frames
   TEveWindowSlot* slot =
      TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
   TEveWindowPack* packH = slot->MakePack();
   packH->SetElementName("Projections");
   packH->SetHorizontal();
   packH->SetShowTitleBar(kFALSE);

   slot = packH->NewSlot();
   TEveWindowPack* pack0 = slot->MakePack();
   pack0->SetShowTitleBar(kFALSE);
   TEveWindowSlot*  slotLeftTop   = pack0->NewSlot();
   TEveWindowSlot* slotLeftBottom = pack0->NewSlot();

   slot = packH->NewSlot();
   TEveWindowPack* pack1 = slot->MakePack();
   pack1->SetShowTitleBar(kFALSE);
   TEveWindowSlot* slotRightTop    = pack1->NewSlot();
   TEveWindowSlot* slotRightBottom = pack1->NewSlot();

   // viewers ans scenes in second tab
   Float_t maxH = 300;
   TEveCalo3D* calo3d = MakeCalo3D(data, slotRightTop);
   calo3d->SetMaxTowerH(maxH);

   TEveCalo2D* calo2d;
   calo2d = MakeCalo2D(calo3d, slotLeftTop, TEveProjection::kPT_RPhi);
   calo2d->SetMaxTowerH(maxH);
   calo2d = MakeCalo2D(calo3d, slotLeftBottom, TEveProjection::kPT_RhoZ);
   calo2d->SetMaxTowerH(maxH);

   TEveCaloLego* lego = MakeCaloLego(data, slotRightBottom);
   lego->SetAutoRebin(kFALSE);
   lego->Set2DMode(TEveCaloLego::kValSizeOutline);

   gEve->AddElement(lego);
   gEve->GetDefaultGLViewer()->SetCurrentCamera(TGLViewer::kCameraPerspXOY);

   gEve->GetBrowser()->GetTabRight()->SetTab(1);
   gEve->FullRedraw3D(kTRUE);

}

//______________________________________________________________________________
TEveCaloDataVec* MakeVecData(Int_t ncells=0)
{
   // Example how to fill data when bins can be iregular.
   // If ncells = 0 (default) whole histogram is taken,
   // otherwise just ncells cells around the maximum.

   TFile::SetCacheFileDir(".");
   TFile* hf = TFile::Open(histFile, "CACHEREAD");
   TH2F* h1 = (TH2F*)hf->Get("ecalLego");
   TH2F* h2 = (TH2F*)hf->Get("hcalLego");

   TEveCaloDataVec* data = new TEveCaloDataVec(2);
   data->RefSliceInfo(0).Setup("ECAL", 0.3, kRed);
   data->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);

   TAxis *ax =  h1->GetXaxis();<commit_msg>Revert the last modification - when LoadMacro is implemented, calo_detail.C<commit_after>// @(#)root/eve:$Id$
// Author: <NAME>

// Calorimeter detailed view by using TEveCaloDataVec as data-source.
// Demonstrantes how to plot calorimiter data with irregular bins.

TEveCaloDataVec* MakeVecData(Int_t ncells=0);

void calo_detail()
{
   gROOT->LoadMacro("calorimeters.C");
   TEveManager::Create();

   // data
   TEveCaloDataVec* data = MakeVecData(20);
   data->IncDenyDestroy(); // don't delete if zero parent

   // frames
   TEveWindowSlot* slot =
      TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight());
   TEveWindowPack* packH = slot->MakePack();
   packH->SetElementName("Projections");
   packH->SetHorizontal();
   packH->SetShowTitleBar(kFALSE);

   slot = packH->NewSlot();
   TEveWindowPack* pack0 = slot->MakePack();
   pack0->SetShowTitleBar(kFALSE);
   TEveWindowSlot*  slotLeftTop   = pack0->NewSlot();
   TEveWindowSlot* slotLeftBottom = pack0->NewSlot();

   slot = packH->NewSlot();
   TEveWindowPack* pack1 = slot->MakePack();
   pack1->SetShowTitleBar(kFALSE);
   TEveWindowSlot* slotRightTop    = pack1->NewSlot();
   TEveWindowSlot* slotRightBottom = pack1->NewSlot();

   // viewers ans scenes in second tab
   Float_t maxH = 300;
   TEveCalo3D* calo3d = MakeCalo3D(data, slotRightTop);
   calo3d->SetMaxTowerH(maxH);

   TEveCalo2D* calo2d;
   calo2d = MakeCalo2D(calo3d, slotLeftTop, TEveProjection::kPT_RPhi);
   calo2d->SetMaxTowerH(maxH);
   calo2d = MakeCalo2D(calo3d, slotLeftBottom, TEveProjection::kPT_RhoZ);
   calo2d->SetMaxTowerH(maxH);

   TEveCaloLego* lego = MakeCaloLego(data, slotRightBottom);
   lego->SetAutoRebin(kFALSE);
   lego->Set2DMode(TEveCaloLego::kValSizeOutline);

   gEve->AddElement(lego);
   gEve->GetDefaultGLViewer()->SetCurrentCamera(TGLViewer::kCameraPerspXOY);

   gEve->GetBrowser()->GetTabRight()->SetTab(1);
   gEve->FullRedraw3D(kTRUE);

}

//______________________________________________________________________________
TEveCaloDataVec* MakeVecData(Int_t ncells)
{
   // Example how to fill data when bins can be iregular.
   // If ncells = 0 (default) whole histogram is taken,
   // otherwise just ncells cells around the maximum.

   TFile::SetCacheFileDir(".");
   TFile* hf = TFile::Open(histFile, "CACHEREAD");
   TH2F* h1 = (TH2F*)hf->Get("ecalLego");
   TH2F* h2 = (TH2F*)hf->Get("hcalLego");

   TEveCaloDataVec* data = new TEveCaloDataVec(2);
   data->RefSliceInfo(0).Setup("ECAL", 0.3, kRed);
   data->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);

   TAxis *ax =  h1->GetXaxis();
{'fraction_non_alphanumeric': 0.1430544593528019, 'fraction_numerical': 0.018153117600631413, 'mean_word_length': 4.670022371364653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3368036', 'n_tokens_mistral': 1921, 'n_tokens_neox': 1854, 'n_words': 326}