2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
11 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
14 AliEMCAL * emcal = (AliEMCAL*) rl->GetAliRun()->GetDetector("EMCAL");
15 AliEMCALGeometry * geom = emcal->GetGeometry();
17 rl->LoadDigits("EMCAL");
18 TTree* dt = rl->GetTreeD("EMCAL", kFALSE);
20 gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root");
21 TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
23 TGeoBBox* bbbox = (TGeoBBox*) node->GetDaughter(0) ->GetVolume()->GetShape();
25 TGeoBBox* sbbox = (TGeoBBox*) node->GetDaughter(10)->GetVolume()->GetShape();
28 TEveElementList* l = new TEveElementList("EMCAL");
29 l->SetTitle("Tooltip");
32 TEveFrameBox* frame_big = new TEveFrameBox();
33 frame_big->SetAABoxCenterHalfSize(0, 0, 0, bbbox->GetDX(), bbbox->GetDY(), bbbox->GetDZ());
35 TEveFrameBox* frame_sml = new TEveFrameBox();
36 frame_sml->SetAABoxCenterHalfSize(0, 0, 0, sbbox->GetDX(), sbbox->GetDY(), sbbox->GetDZ());
38 gStyle->SetPalette(1, 0);
39 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
40 pal->SetLimits(0, 1024);
42 TEveQuadSet* smodules[12];
44 for (Int_t sm=0; sm<12; ++sm)
46 TEveQuadSet* q = new TEveQuadSet(Form("SM %d", sm+1));
48 q->Reset(TEveQuadSet::kQT_RectangleYZFixedDimX, kFALSE, 32);
49 q->SetDefWidth (geom->GetPhiTileSize());
50 q->SetDefHeight(geom->GetEtaTileSize());
52 q->RefHMTrans().SetFrom(*node->GetDaughter(sm)->GetMatrix());
54 q->SetFrame(sm < 10 ? frame_big : frame_sml);
57 gEve->AddElement(q, l);
61 TClonesArray *digits = 0;
62 dt->SetBranchAddress("EMCAL", &digits);
64 Int_t nEnt = digits->GetEntriesFast();
79 for (Int_t idig = 0; idig < nEnt; ++idig)
81 dig = static_cast<AliEMCALDigit *>(digits->At(idig));
84 id = dig->GetId() ; //cell (digit) label
85 amp = dig->GetAmp(); //amplitude in cell (digit)
86 time = dig->GetTime();//time of creation of digit after collision
88 cout<<"Cell ID "<<id<<" Amp "<<amp<<endl;//" time "<<time<<endl;
91 geom->GetCellIndex(id,iSupMod,iTower,iIphi,iIeta);
92 //Gives SuperModule and Tower numbers
93 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
94 iIphi, iIeta,iphi,ieta);
95 //Gives label of cell in eta-phi position per each supermodule
97 cout<< "SModule "<<iSupMod<<"; Tower "<<iTower
98 <<"; Eta "<<iIeta<<"; Phi "<<iIphi
99 <<"; Cell Eta "<<ieta<<"; Cell Phi "<<iphi<<endl;
101 geom->RelPosCellInSModule(id, x, y, z);
102 cout << x <<" "<< y <<" "<< z <<endl;
104 TEveQuadSet* q = smodules[iSupMod];
109 cout<<"Digit pointer 0x0"<<endl;
113 for (Int_t sm = 0; sm < 12; ++sm)
115 smodules[iSupMod]->RefitPlex();