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 **************************************************************************/
12 AliRunLoader* rl = AliEveEventManager::AssertRunLoader();
15 AliEMCAL * emcal = (AliEMCAL*) rl->GetAliRun()->GetDetector("EMCAL");
16 AliEMCALGeometry * geom = emcal->GetGeometry();
18 rl->LoadDigits("EMCAL");
19 TTree* dt = rl->GetTreeD("EMCAL", kFALSE);
21 gGeoManager = gEve->GetGeometry("$REVESYS/alice-data/alice_fullgeo.root");
22 TGeoNode* node = gGeoManager->GetTopVolume()->FindNode("XEN1_1");
24 TGeoBBox* bbbox = (TGeoBBox*) node->GetDaughter(0) ->GetVolume()->GetShape();
26 TGeoBBox* sbbox = (TGeoBBox*) node->GetDaughter(10)->GetVolume()->GetShape();
29 TEveElementList* l = new TEveElementList("EMCAL");
30 l->SetTitle("Tooltip");
33 TEveFrameBox* frame_big = new TEveFrameBox();
34 frame_big->SetAABoxCenterHalfSize(0, 0, 0, bbbox->GetDX(), bbbox->GetDY(), bbbox->GetDZ());
36 TEveFrameBox* frame_sml = new TEveFrameBox();
37 frame_sml->SetAABoxCenterHalfSize(0, 0, 0, sbbox->GetDX(), sbbox->GetDY(), sbbox->GetDZ());
39 gStyle->SetPalette(1, 0);
40 TEveRGBAPalette* pal = new TEveRGBAPalette(0, 512);
41 pal->SetLimits(0, 1024);
43 TEveQuadSet* smodules[12];
45 for (Int_t sm=0; sm<12; ++sm)
47 TEveQuadSet* q = new TEveQuadSet(Form("SM %d", sm+1));
49 q->Reset(TEveQuadSet::kQT_RectangleYZFixedDimX, kFALSE, 32);
50 q->SetDefWidth (geom->GetPhiTileSize());
51 q->SetDefHeight(geom->GetEtaTileSize());
53 q->RefMainTrans().SetFrom(*node->GetDaughter(sm)->GetMatrix());
55 q->SetFrame(sm < 10 ? frame_big : frame_sml);
58 gEve->AddElement(q, l);
62 TClonesArray *digits = 0;
63 dt->SetBranchAddress("EMCAL", &digits);
65 Int_t nEnt = digits->GetEntriesFast();
80 for (Int_t idig = 0; idig < nEnt; ++idig)
82 dig = static_cast<AliEMCALDigit *>(digits->At(idig));
85 id = dig->GetId() ; //cell (digit) label
86 amp = dig->GetAmp(); //amplitude in cell (digit)
87 time = dig->GetTime();//time of creation of digit after collision
89 cout<<"Cell ID "<<id<<" Amp "<<amp<<endl;//" time "<<time<<endl;
92 geom->GetCellIndex(id,iSupMod,iTower,iIphi,iIeta);
93 //Gives SuperModule and Tower numbers
94 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
95 iIphi, iIeta,iphi,ieta);
96 //Gives label of cell in eta-phi position per each supermodule
98 cout<< "SModule "<<iSupMod<<"; Tower "<<iTower
99 <<"; Eta "<<iIeta<<"; Phi "<<iIphi
100 <<"; Cell Eta "<<ieta<<"; Cell Phi "<<iphi<<endl;
102 geom->RelPosCellInSModule(id, x, y, z);
103 cout << x <<" "<< y <<" "<< z <<endl;
105 TEveQuadSet* q = smodules[iSupMod];
110 cout<<"Digit pointer 0x0"<<endl;
114 for (Int_t sm = 0; sm < 12; ++sm)
116 smodules[iSupMod]->RefitPlex();