3 // Test Macro, shows how to load Digits and Geometry, and how can we get
4 // some of the parameters and variables.
5 // Author: Gustavo Conesa
10 // Getting EMCAL Detector and Geometry.
12 AliRunLoader *rl = AliRunLoader::Open("galice.root",AliConfig::GetDefaultEventFolderName(),
16 cout<<"Can not instatiate the Run Loader"<<endl;
18 rl->LoadgAlice();//Needed to get geometry
20 AliEMCALLoader *emcalLoader = dynamic_cast<AliEMCALLoader*>
21 (rl->GetDetectorLoader("EMCAL"));
23 //AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance();
24 //AliEMCALGeometry *geom = dynamic_cast<AliEMCAL*>(rl->GetAliRun()->GetDetector("EMCAL"))->GetGeometry();
26 AliRun * alirun = rl->GetAliRun(); // Needed to get Geometry
27 AliEMCAL * emcal = (AliEMCAL*)alirun->GetDetector("EMCAL");
28 AliEMCALGeometry * geom = emcal->GetGeometry();
31 cout<<"Did not get geometry from EMCALLoader"<<endl;
34 rl->LoadDigits("EMCAL");
36 //Get maximum number of events
37 Int_t maxevent = rl->GetNumberOfEvents();
38 cout<<"Number of events "<<maxevent<<endl;
55 for ( iEvent=0; iEvent<maxevent; iEvent++)
57 cout << " ======> Event " << iEvent << endl ;
61 //Fill array of digits
62 TClonesArray *digits = emcalLoader->Digits();
64 //Get digits from the list
65 for(Int_t idig = 0; idig< digits->GetEntries();idig++){
66 //cout<<">> idig "<<idig<<endl;
67 dig = static_cast<AliEMCALDigit *>(digits->At(idig)) ;
70 id = dig->GetId() ; //cell (digit) label
71 amp = dig->GetAmp(); //amplitude in cell (digit)
72 time = dig->GetTime();//time of creation of digit after collision
74 cout<<"Cell ID "<<id<<" Amp "<<amp<<endl;//" time "<<time<<endl;
77 geom->GetCellIndex(id,iSupMod,iTower,iIphi,iIeta);
78 //Gives SuperModule and Tower numbers
79 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,
80 iIphi, iIeta,iphi,ieta);
81 //Gives label of cell in eta-phi position per each supermodule
83 cout<< "SModule "<<iSupMod<<"; Tower "<<iTower
84 <<"; Eta "<<iIeta<<"; Phi "<<iIphi
85 <<"; Cell Eta "<<ieta<<"; Cell Phi "<<iphi<<endl;
88 cout<<"Digit pointer 0x0"<<endl;