17 #if !defined(__CINT__) || defined(__MAKECINT__) 20 #include <Riostream.h> 24 #include <TParticle.h> 25 #include <TRefArray.h> 59 TH1F * hEta = (TH1F*)
new TH1F(
"hEta",
"reco #eta",1000, -0.71,0.71);
60 TH1F * hPhi = (TH1F*)
new TH1F(
"hPhi",
"reco #phi",360, 0,360);
61 TH1F * hE = (TH1F*)
new TH1F(
"hE" ,
"reco e",300, 0,30);
62 TH1F * hTime = (TH1F*)
new TH1F(
"hTime" ,
"reco time",1000, 0,1000);
63 hEta ->SetXTitle(
"#eta");
64 hPhi ->SetXTitle(
"#phi (deg)");
65 hE ->SetXTitle(
"E (GeV)");
66 hTime->SetXTitle(
"time (ns)");
69 TH1F * hMCEta = (TH1F*)
new TH1F(
"hMCEta",
"MC #eta",1000, -0.71,0.71);
70 TH1F * hMCPhi = (TH1F*)
new TH1F(
"hMCPhi",
"MC #phi",360, 0,360);
71 TH1F * hMCE = (TH1F*)
new TH1F(
"hMCE" ,
"MC e",300, 0,30);
72 hMCEta->SetXTitle(
"#eta");
73 hMCPhi->SetXTitle(
"#phi (deg)");
74 hMCE ->SetXTitle(
"E (GeV)");
77 TH1F * hMCDEta = (TH1F*)
new TH1F(
"hMCDEta",
" #eta cluster - #eta MC",500, -0.05,0.05);
78 TH1F * hMCDPhi = (TH1F*)
new TH1F(
"hMCDPhi",
" #phi cluster - #phi MC",500, -0.05,0.05);
79 TH1F * hMCDE = (TH1F*)
new TH1F(
"hMCDE" ,
"e cluster - e MC",200, -10,10);
80 hMCDEta->SetXTitle(
"#eta_{reco}-#eta_{MC}");
81 hMCDPhi->SetXTitle(
"#phi_{reco}-#phi_{MC} (rad)");
82 hMCDE ->SetXTitle(
"E_{reco}-E_{MC} (GeV)");
85 TH1F * hTMDEta = (TH1F*)
new TH1F(
"hTMDEta",
" #eta cluster - eta track",500, -0.05,0.05);
86 TH1F * hTMDPhi = (TH1F*)
new TH1F(
"hTMDPhi",
" #phi cluster - phi track",500, -0.05,0.05);
89 TH1F * hTMResEta = (TH1F*)
new TH1F(
"hTMResEta",
" Residual #eta cluster - eta track",500, -0.05,0.05);
90 TH1F * hTMResPhi = (TH1F*)
new TH1F(
"hTMResPhi",
" Residual #phi cluster - phi track",500, -0.05,0.05);
91 hTMDEta ->SetXTitle(
"#eta_{cluster}-#eta_{track}");
92 hTMDPhi ->SetXTitle(
"#phi_{cluster}-#phi_{track} (rad)");
96 TH1F * hTMEOverP = (TH1F*)
new TH1F(
"hTMEOverP",
" E_{cluster}/ p_{Track}",100,0,2);
98 hTMEOverP ->SetXTitle(
"E_{cluster}/ p_{Track}");
102 TH2I * hEGAPatch =
new TH2I(
"hEGAPatch",
"EGA trigger",51,-0.5,50.5,65,-0.5,64.5);
103 TH2I * hEJEPatch =
new TH2I(
"hEJEPatch",
"EJE trigger",51,-0.5,50.5,65,-0.5,64.5);
104 hEGAPatch->SetXTitle(
"column (#eta direction)");
105 hEGAPatch->SetYTitle(
"row (#phi direction)");
106 hEJEPatch->SetXTitle(
"column (#eta direction)");
107 hEJEPatch->SetYTitle(
"row (#phi direction)");
110 TFile*
f =
new TFile(
"AliAOD.root");
111 TTree* aodTree = (TTree*)f->Get(
"aodTree");
128 TRefArray* caloClusters =
new TRefArray();
130 Int_t nEvt = aodTree->GetEntries();
132 for(Int_t iev = 0; iev < nEvt; iev++)
134 cout <<
"<<<< Event: " << iev+1 <<
"/" << nEvt <<
" >>>>";
138 aodTree->GetEvent(iev);
155 for (Int_t icell= 0; icell < nTotalCells; icell++)
157 cout<<
"Cell : " <<icell<<
"/"<<nTotalCells <<
" - ID: "<<cells.
GetCellNumber(icell)<<
"; High Gain? "<<cells.
GetHighGain(icell);
181 if (col > -1 && row > -1)
190 Bool_t isEGA1 = ((bit>> bitEGA ) & 0x1);
191 Bool_t isEGA2 = ((bit>> (bitEGA+1)) & 0x1);
192 Bool_t isEJE1 = ((bit>> bitEJE ) & 0x1);
193 Bool_t isEJE2 = ((bit>> (bitEJE+1)) & 0x1);
197 printf(
"Bit %d (G1 %d,G2 %d,J1 %d,J2 %d), cell in patch position (ieta,iphi)=(%d,%d), L1 amplitude %d\n ",
198 bit, isEGA1, isEGA2, isEJE1, isEJE2, col, row, ts);
199 if(bit>10) hEJEPatch->Fill(col,row);
200 else hEGAPatch->Fill(col,row);
214 Int_t nclus = caloClusters->GetEntries();
215 for (Int_t icl = 0; icl < nclus; icl++)
218 Float_t energy = clus->
E();
220 TVector3 vpos(pos[0],pos[1],pos[2]);
228 Double_t cphi = vpos.Phi();
229 if(cphi < 0) cphi +=TMath::TwoPi();
230 Double_t ceta = vpos.Eta();
235 Int_t labelIndex = clus->
GetLabel();
241 hPhi ->Fill(cphi*TMath::RadToDeg());
243 hTime->Fill(clus->
GetTOF()*1e9);
248 cout <<
"Cluster: " << icl+1 <<
"/" << nclus <<
" Energy: " << energy <<
"; Phi: " 249 << cphi*TMath::RadToDeg() <<
"; Eta: " << ceta
250 <<
"; NCells: " << nCells <<
"; NLM: " << nlm
251 <<
"; #Labels: " << nLabels <<
" Index: " << labelIndex
252 <<
"; Time "<<clus->
GetTOF()*1e9<<
" ns "<<endl;
258 printf(
"\t N matches %d, Residual phi %2.4f, eta %2.4f\n",
268 TClonesArray * arr =
dynamic_cast<TClonesArray*
>(aod->
FindListObject(
"mcparticles")) ;
271 if(labelIndex >= 0 && labelIndex < arr->GetEntriesFast())
276 hMCEta ->Fill(particle->
Eta());
277 hMCPhi ->Fill(particle->
Phi()*TMath::RadToDeg());
278 hMCE ->Fill(particle->
E());
279 hMCDEta ->Fill(ceta-particle->
Eta());
280 hMCDPhi ->Fill(cphi-particle->
Phi());
281 hMCDE ->Fill(energy-particle->
E());
284 cout<<
" MC More contributing primary: "<<particle->GetName()<<
"; with kinematics: "<<endl;
285 cout<<
" \t Energy: "<<particle->
E()<<
"; Phi: "<<particle->
Phi()*TMath::RadToDeg()<<
"; Eta: "<<particle->
Eta()<<endl;
286 cout<<
" \t dE: "<<energy-particle->
E()<<
"; dPhi: "<<(cphi-particle->
Phi())*TMath::RadToDeg()<<
"; dEta: "<<ceta-particle->
Eta()<<endl;
289 for(Int_t i = 1; i < nLabels; i++)
297 printf(
"\t \t MC particle not found!!!\n");
301 printf(
"\t \t Other contributing primary: %s; Energy %2.2f; deposited E_frac %2.2f \n",
305 else if( labelIndex >= arr->GetEntriesFast())
306 cout <<
"PROBLEM, label is too large : "<<labelIndex<<
" >= particles in stack "<< arr->GetEntriesFast() <<endl;
308 cout<<
"Negative label!!! : "<<labelIndex<<endl;
319 Double_t tphi = track->
Phi();
320 Double_t teta = track->
Eta();
321 Double_t tmom = track->
P();
323 Double_t deta = teta - ceta;
324 Double_t dphi = tphi - cphi;
326 if(dphi > TMath::Pi()) dphi -= 2*TMath::Pi();
327 if(dphi < -TMath::Pi()) dphi += 2*TMath::Pi();
329 Double_t dR = sqrt(dphi*dphi + deta*deta);
331 Double_t pOverE = tmom/energy;
333 cout <<
"\t Track Momentum : " << tmom <<
" phi: " << tphi <<
" eta: " << teta << endl;
335 hTMEOverP->Fill(pOverE);
336 hTMDEta ->Fill(deta);
337 hTMDPhi ->Fill(dphi);
369 else printf(
"!!! NO TRACK !!!\n");
376 printf(
"PID weights: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f, hadrons: pion %0.2f, kaon %0.2f, proton %0.2f , neutron %0.2f, kaon %0.2f \n",
390 for(Int_t i = 0; i < nCells ; i++)
392 Int_t absId = index[i];
393 Double_t ampFract = fraction[i];
398 cout<<
"\t Cluster Cell: AbsID : "<< absId <<
" == "<<clus->
GetCellAbsId(i) <<
"; Amplitude "<< amp;
399 cout<<
"; Fraction "<<ampFract<<
"; Time " <<time*1e9<<
"; High Gain? "<<hg<<endl;
407 printf(
"\t \t cell MC label index %d, cell MC deposited energy map %d: p1 %2.2f, p2 %2.2f, p3 %2.2f p4 %2.2f\n",
408 cells.
GetCellMCLabel(absId),map,eDepFrac[0],eDepFrac[1],eDepFrac[2],eDepFrac[3]);
424 iIphi, iIeta,iphi,ieta);
432 cout<<
" SModule "<<iSupMod<<
"; Tower "<<iTower <<
"; Eta "<<iIeta
433 <<
"; Phi "<<iIphi<<
"; Index: Cell Eta "<<ieta<<
"; Cell Phi "<<iphi
437 if ( i == 0 ) sm = iSupMod ;
438 else if ( sm != iSupMod)
printf(
" ******CLUSTER SHARED BY 2 SuperModules!!!!\n");
447 TFile * fhisto = (TFile*)
new TFile(
"histos.root",
"recreate");
void GetTriggerBits(Int_t &bits) const
Get the trigger bits for a given fastor position.
AliAODCaloTrigger * GetCaloTrigger(TString calo) const
void ReadFromTree(TTree *tree, Option_t *opt="")
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
virtual void GetCellMCEdepFractionArray(Int_t, Float_t *) const
virtual UShort_t * GetClusterMCEdepFraction() const
virtual Double_t * GetCellsAmplitudeFraction()
virtual Double_t E() const
virtual Double_t GetCellTime(Short_t cellNumber)=0
virtual Double_t P() const
virtual Short_t GetCellNumber(Short_t pos) const =0
Bool_t kPrintClusterCells
Print cells in clusters information.
virtual Short_t GetNumberOfCells() const =0
virtual Double_t E() const
virtual Int_t GetNTracksMatched() const
void GetPosition(Int_t &col, Int_t &row) const
Access to position of the current fastor channel.
Virtual class for calorimeter cell data handling.
Bool_t kPrintTrackMatches
Print cluster-track matching information.
virtual Bool_t Next()
Forward to next trigger entry (fastor / L0 patch)
Container with calorimeter trigger information in the AOD event.
virtual Int_t GetCellMCLabel(Short_t cellNumber)=0
virtual Double_t GetTrackDz(void) const
virtual UShort_t * GetCellsAbsId()
Virtual class for calorimeter cluster data handling.
TString GetFiredTriggerClasses() const
virtual Double_t Phi() const
void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta, Int_t &iphi, Int_t &ieta) const
Bool_t kPrintClusterPID
Print clusters PID (bayesian) weights.
virtual Int_t GetMCLabel(Short_t pos) const =0
virtual Double_t Eta() const
Bool_t kPrintKine
Print MC related information. Do not use for raw data.
virtual Double_t GetAmplitude(Short_t pos) const =0
virtual Bool_t GetCellHighGain(Short_t cellNumber)=0
Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nModule, Int_t &nIphi, Int_t &nIeta) const
TObject * FindListObject(const char *objName) const
virtual Int_t * GetLabels() const
virtual Double_t Eta() const
virtual Double_t GetCellAmplitude(Short_t cellNumber)=0
virtual Double_t GetTime(Short_t pos) const =0
virtual const Double_t * GetPID() const
virtual Double_t GetTrackDx(void) const
Bool_t kPrintCaloCluster
Print cluster parameters.
virtual UInt_t GetNLabels() const
virtual Int_t GetLabel() const
virtual Double_t GetTOF() const
virtual UChar_t GetNExMax() const
virtual Double_t GetEFraction(Short_t pos) const =0
virtual UInt_t * GetCellsMCEdepFractionMap() const
virtual Double_t Phi() const
AliAODCaloCells * GetEMCALCells() const
virtual TObject * GetTrackMatched(Int_t) const
Only for AODs.
static AliEMCALGeometry * GetInstance()
virtual Int_t GetNCells() const
virtual Bool_t GetHighGain(Short_t pos) const =0
void GetL1TimeSum(Int_t ×um) const
Get the L1 time sums (L1 ADC values) for the current fastor.
Int_t GetEMCALClusters(TRefArray *clusters) const
Bool_t kPrintCaloCells
Print cells parameters.
EMCal geometry, singleton.
virtual Int_t GetCellAbsId(Int_t) const
Bool_t kPrintCaloTrigger
Print trigger patches information.
virtual void GetPosition(Float_t *) const