1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //_________________________________________________________________________
17 // Class for the analysis of high pT pi0 event by event
18 // Pi0/Eta identified by one of the following:
19 // -Invariant mass of 2 cluster in calorimeter
20 // -Shower shape analysis in calorimeter
21 // -Invariant mass of one cluster in calorimeter and one photon reconstructed in CTS
23 // -- Author: Gustavo Conesa (LNF-INFN) & Raphaelle Ichou (SUBATECH)
24 //////////////////////////////////////////////////////////////////////////////
27 // --- ROOT system ---
29 #include <TClonesArray.h>
30 #include <TObjString.h>
32 // --- Analysis system ---
33 #include "AliAnaPi0EbE.h"
34 #include "AliCaloTrackReader.h"
35 #include "AliIsolationCut.h"
36 #include "AliNeutralMesonSelection.h"
37 #include "AliCaloPID.h"
38 #include "AliMCAnalysisUtils.h"
40 #include "AliFiducialCut.h"
41 #include "TParticle.h"
42 #include "AliVCluster.h"
43 #include "AliESDEvent.h"
44 #include "AliAODEvent.h"
45 #include "AliAODMCParticle.h"
47 ClassImp(AliAnaPi0EbE)
49 //____________________________
50 AliAnaPi0EbE::AliAnaPi0EbE() :
51 AliAnaCaloTrackCorrBaseClass(),fAnaType(kIMCalo), fCalorimeter(""),
52 fMinDist(0.),fMinDist2(0.), fMinDist3(0.),
53 fNLMCutMin(-1), fNLMCutMax(10),
54 fTimeCutMin(-10000), fTimeCutMax(10000),
55 fRejectTrackMatch(kTRUE),
56 fFillPileUpHistograms(0),
57 fFillWeightHistograms(kFALSE), fFillTMHisto(0),
58 fFillSelectClHisto(0), fFillOnlySimpleSSHisto(1), fFillEMCALBCHistograms(0),
59 fInputAODGammaConvName(""),
63 fhPtEta(0), fhPtPhi(0), fhEtaPhi(0),
64 fhEtaPhiEMCALBC0(0), fhEtaPhiEMCALBC1(0), fhEtaPhiEMCALBCN(0),
65 fhPtCentrality(), fhPtEventPlane(0),
66 fhPtReject(0), fhEReject(0),
67 fhEEtaReject(0), fhEPhiReject(0), fhEtaPhiReject(0),
68 fhMass(0), fhMassPt(0), fhMassSplitPt(0),
69 fhSelectedMass(0), fhSelectedMassPt(0), fhSelectedMassSplitPt(0),
70 fhAsymmetry(0), fhSelectedAsymmetry(0),
71 fhSplitE(0), fhSplitPt(0),
72 fhSplitPtEta(0), fhSplitPtPhi(0),
74 fhPtDecay(0), fhEDecay(0),
75 // Shower shape histos
76 fhEDispersion(0), fhELambda0(0), fhELambda1(0),
77 fhELambda0NoTRD(0), fhELambda0FracMaxCellCut(0),
78 fhEFracMaxCell(0), fhEFracMaxCellNoTRD(0),
79 fhENCells(0), fhETime(0), fhEPairDiffTime(0),
80 fhDispEtaE(0), fhDispPhiE(0),
81 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
82 fhDispEtaPhiDiffE(0), fhSphericityE(0),
87 fhMCEReject(), fhMCPtReject(),
89 fhMCPi0PtGenRecoFraction(0), fhMCEtaPtGenRecoFraction(0),
90 fhMCPi0DecayPt(0), fhMCPi0DecayPtFraction(0),
91 fhMCEtaDecayPt(0), fhMCEtaDecayPtFraction(0),
93 fhMassPairMCPi0(0), fhMassPairMCEta(0),
94 fhAnglePairMCPi0(0), fhAnglePairMCEta(0),
96 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
97 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
98 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
99 fhTrackMatchedMCParticleE(0),
100 fhTrackMatchedMCParticleDEta(0), fhTrackMatchedMCParticleDPhi(0),
101 fhdEdx(0), fhEOverP(0), fhEOverPNoTRD(0),
102 // Number of local maxima in cluster
103 fhNLocMaxE(0), fhNLocMaxPt(0),
105 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
106 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
107 fhTimeNPileUpVertContributors(0),
108 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0)
112 for(Int_t i = 0; i < 6; i++)
116 fhMCNLocMaxPt [i] = 0;
119 fhMCPtCentrality [i] = 0;
123 fhMCSplitPtPhi [i] = 0;
124 fhMCSplitPtEta [i] = 0;
125 fhMCNLocMaxSplitPt [i] = 0;
127 fhEMCLambda0 [i] = 0;
128 fhEMCLambda0NoTRD [i] = 0;
129 fhEMCLambda0FracMaxCellCut[i]= 0;
130 fhEMCFracMaxCell [i] = 0;
131 fhEMCLambda1 [i] = 0;
132 fhEMCDispersion [i] = 0;
134 fhMCEDispEta [i] = 0;
135 fhMCEDispPhi [i] = 0;
136 fhMCESumEtaPhi [i] = 0;
137 fhMCEDispEtaPhiDiff[i] = 0;
138 fhMCESphericity [i] = 0;
139 fhMCEAsymmetry [i] = 0;
142 fhMCMassSplitPt [i]=0;
143 fhMCSelectedMassPt [i]=0;
144 fhMCSelectedMassSplitPt[i]=0;
146 for(Int_t j = 0; j < 7; j++)
148 fhMCLambda0DispEta [j][i] = 0;
149 fhMCLambda0DispPhi [j][i] = 0;
150 fhMCDispEtaDispPhi [j][i] = 0;
151 fhMCAsymmetryLambda0 [j][i] = 0;
152 fhMCAsymmetryDispEta [j][i] = 0;
153 fhMCAsymmetryDispPhi [j][i] = 0;
157 for(Int_t j = 0; j < 7; j++)
159 fhLambda0DispEta [j] = 0;
160 fhLambda0DispPhi [j] = 0;
161 fhDispEtaDispPhi [j] = 0;
162 fhAsymmetryLambda0 [j] = 0;
163 fhAsymmetryDispEta [j] = 0;
164 fhAsymmetryDispPhi [j] = 0;
166 fhPtPi0PileUp [j] = 0;
169 for(Int_t i = 0; i < 3; i++)
171 fhELambda0LocMax [i] = 0;
172 fhELambda1LocMax [i] = 0;
173 fhEDispersionLocMax [i] = 0;
174 fhEDispEtaLocMax [i] = 0;
175 fhEDispPhiLocMax [i] = 0;
176 fhESumEtaPhiLocMax [i] = 0;
177 fhEDispEtaPhiDiffLocMax[i] = 0;
178 fhESphericityLocMax [i] = 0;
179 fhEAsymmetryLocMax [i] = 0;
183 for(Int_t i =0; i < 14; i++){
184 fhLambda0ForW0[i] = 0;
185 //fhLambda1ForW0[i] = 0;
186 if(i<8)fhMassPairLocMax[i] = 0;
189 for(Int_t i = 0; i < 12; i++)
191 fhEtaPhiTriggerEMCALBC[i] = 0 ;
192 fhTimeTriggerEMCALBC [i] = 0 ;
195 //Initialize parameters
200 //_______________________________________________________________________________
201 void AliAnaPi0EbE::FillPileUpHistograms(const Float_t energy, const Float_t time)
203 // Fill some histograms to understand pile-up
204 if(!fFillPileUpHistograms) return;
206 //printf("E %f, time %f\n",energy,time);
207 AliVEvent * event = GetReader()->GetInputEvent();
209 fhTimeENoCut->Fill(energy,time);
210 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
211 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
213 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
215 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
216 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
218 // N pile up vertices
219 Int_t nVerticesSPD = -1;
220 Int_t nVerticesTracks = -1;
224 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
225 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
230 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
231 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
234 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
235 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
237 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
238 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
241 Float_t z1 = -1, z2 = -1;
243 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
247 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
248 ncont=pv->GetNContributors();
249 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
251 diamZ = esdEv->GetDiamondZ();
255 AliAODVertex *pv=aodEv->GetVertex(iVert);
256 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
257 ncont=pv->GetNContributors();
258 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
260 diamZ = aodEv->GetDiamondZ();
263 Double_t distZ = TMath::Abs(z2-z1);
264 diamZ = TMath::Abs(z2-diamZ);
266 fhTimeNPileUpVertContributors ->Fill(time,ncont);
267 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
268 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
274 //___________________________________________________________________________________________
275 void AliAnaPi0EbE::FillRejectedClusterHistograms(const TLorentzVector mom, const Int_t mctag)
277 // Fill histograms that do not pass the identification (SS case only)
279 Float_t ener = mom.E();
280 Float_t pt = mom.Pt();
281 Float_t phi = mom.Phi();
282 if(phi < 0) phi+=TMath::TwoPi();
283 Float_t eta = mom.Eta();
285 fhPtReject ->Fill(pt);
286 fhEReject ->Fill(ener);
288 fhEEtaReject ->Fill(ener,eta);
289 fhEPhiReject ->Fill(ener,phi);
290 fhEtaPhiReject ->Fill(eta,phi);
294 Int_t mcIndex = GetMCIndex(mctag);
295 fhMCEReject [mcIndex] ->Fill(ener);
296 fhMCPtReject [mcIndex] ->Fill(pt);
300 //_____________________________________________________________________________________
301 void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster,
306 // Fill shower shape, timing and other histograms for selected clusters from decay
308 Float_t e = cluster->E();
309 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
310 Float_t l0 = cluster->GetM02();
311 Float_t l1 = cluster->GetM20();
312 Int_t nSM = GetModuleNumber(cluster);
315 if (e < 2 ) ebin = 0;
316 else if (e < 4 ) ebin = 1;
317 else if (e < 6 ) ebin = 2;
318 else if (e < 10) ebin = 3;
319 else if (e < 15) ebin = 4;
320 else if (e < 20) ebin = 5;
324 if (nMaxima==1) indexMax = 0 ;
325 else if(nMaxima==2) indexMax = 1 ;
329 AliVCaloCells * cell = 0x0;
330 if(fCalorimeter == "PHOS")
331 cell = GetPHOSCells();
333 cell = GetEMCALCells();
335 Float_t maxCellFraction = 0;
336 GetCaloUtils()->GetMaxEnergyCell(cell, cluster, maxCellFraction);
337 fhEFracMaxCell->Fill(e,maxCellFraction);
339 FillWeightHistograms(cluster);
341 fhEDispersion->Fill(e, disp);
342 fhELambda0 ->Fill(e, l0 );
343 fhELambda1 ->Fill(e, l1 );
345 Float_t ll0 = 0., ll1 = 0.;
346 Float_t dispp= 0., dEta = 0., dPhi = 0.;
347 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
348 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
350 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
351 ll0, ll1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
353 fhDispEtaE -> Fill(e,dEta);
354 fhDispPhiE -> Fill(e,dPhi);
355 fhSumEtaE -> Fill(e,sEta);
356 fhSumPhiE -> Fill(e,sPhi);
357 fhSumEtaPhiE -> Fill(e,sEtaPhi);
358 fhDispEtaPhiDiffE -> Fill(e,dPhi-dEta);
359 if(dEta+dPhi>0)fhSphericityE -> Fill(e,(dPhi-dEta)/(dEta+dPhi));
361 fhDispEtaDispPhi[ebin]->Fill(dEta,dPhi);
362 fhLambda0DispEta[ebin]->Fill(l0 ,dEta);
363 fhLambda0DispPhi[ebin]->Fill(l0 ,dPhi);
365 if (fAnaType==kSSCalo)
367 // Asymmetry histograms
368 fhAsymmetryLambda0[ebin]->Fill(l0 ,asy);
369 fhAsymmetryDispEta[ebin]->Fill(dEta,asy);
370 fhAsymmetryDispPhi[ebin]->Fill(dPhi,asy);
374 fhNLocMaxE ->Fill(e ,nMaxima);
376 fhELambda0LocMax [indexMax]->Fill(e,l0);
377 fhELambda1LocMax [indexMax]->Fill(e,l1);
378 fhEDispersionLocMax[indexMax]->Fill(e,disp);
380 if(fCalorimeter=="EMCAL" && !fFillOnlySimpleSSHisto)
382 fhEDispEtaLocMax [indexMax]-> Fill(e,dEta);
383 fhEDispPhiLocMax [indexMax]-> Fill(e,dPhi);
384 fhESumEtaPhiLocMax [indexMax]-> Fill(e,sEtaPhi);
385 fhEDispEtaPhiDiffLocMax[indexMax]-> Fill(e,dPhi-dEta);
386 if(dEta+dPhi>0) fhESphericityLocMax[indexMax]->Fill(e,(dPhi-dEta)/(dEta+dPhi));
387 if(fAnaType==kSSCalo) fhEAsymmetryLocMax [indexMax]->Fill(e ,asy);
391 if(fCalorimeter=="EMCAL" && nSM < 6)
393 fhELambda0NoTRD->Fill(e, l0 );
394 fhEFracMaxCellNoTRD->Fill(e,maxCellFraction);
397 if(maxCellFraction < 0.5)
398 fhELambda0FracMaxCellCut->Fill(e, l0 );
400 fhETime ->Fill(e, cluster->GetTOF()*1.e9);
401 fhENCells->Fill(e, cluster->GetNCells());
403 // Fill Track matching control histograms
406 Float_t dZ = cluster->GetTrackDz();
407 Float_t dR = cluster->GetTrackDx();
409 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
411 dR = 2000., dZ = 2000.;
412 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
414 //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
416 if(fhTrackMatchedDEta && TMath::Abs(dR) < 999)
418 fhTrackMatchedDEta->Fill(e,dZ);
419 fhTrackMatchedDPhi->Fill(e,dR);
420 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
423 // Check dEdx and E/p of matched clusters
425 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
427 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
431 Float_t dEdx = track->GetTPCsignal();
432 fhdEdx->Fill(e, dEdx);
434 Float_t eOverp = e/track->P();
435 fhEOverP->Fill(e, eOverp);
437 if(fCalorimeter=="EMCAL" && nSM < 6) fhEOverPNoTRD->Fill(e, eOverp);
441 // printf("AliAnaPi0EbE::FillSelectedClusterHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
448 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
450 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
451 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) mctag = 2.5 ;
452 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) mctag = 0.5 ;
453 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) mctag = 1.5 ;
459 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
460 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) mctag = 6.5 ;
461 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) mctag = 4.5 ;
462 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) mctag = 5.5 ;
466 fhTrackMatchedMCParticleE ->Fill(e , mctag);
467 fhTrackMatchedMCParticleDEta->Fill(dZ, mctag);
468 fhTrackMatchedMCParticleDPhi->Fill(dR, mctag);
472 }// Track matching histograms
476 Int_t mcIndex = GetMCIndex(tag);
478 fhEMCLambda0[mcIndex] ->Fill(e, l0);
479 fhEMCLambda1[mcIndex] ->Fill(e, l1);
480 fhEMCDispersion[mcIndex] ->Fill(e, disp);
481 fhEMCFracMaxCell[mcIndex]->Fill(e,maxCellFraction);
483 if(fCalorimeter=="EMCAL" && nSM < 6)
484 fhEMCLambda0NoTRD[mcIndex]->Fill(e, l0 );
486 if(maxCellFraction < 0.5)
487 fhEMCLambda0FracMaxCellCut[mcIndex]->Fill(e, l0 );
489 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
491 fhMCEDispEta [mcIndex]-> Fill(e,dEta);
492 fhMCEDispPhi [mcIndex]-> Fill(e,dPhi);
493 fhMCESumEtaPhi [mcIndex]-> Fill(e,sEtaPhi);
494 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(e,dPhi-dEta);
495 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(e,(dPhi-dEta)/(dEta+dPhi));
497 if (fAnaType==kSSCalo)
499 fhMCAsymmetryLambda0[ebin][mcIndex]->Fill(l0 ,asy);
500 fhMCAsymmetryDispEta[ebin][mcIndex]->Fill(dEta,asy);
501 fhMCAsymmetryDispPhi[ebin][mcIndex]->Fill(dPhi,asy);
504 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta,dPhi);
505 fhMCLambda0DispEta[ebin][mcIndex]->Fill(l0 ,dEta);
506 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(l0 ,dPhi);
514 //________________________________________________________
515 void AliAnaPi0EbE::FillWeightHistograms(AliVCluster *clus)
517 // Calculate weights and fill histograms
519 if(!fFillWeightHistograms || GetMixedEvent()) return;
521 AliVCaloCells* cells = 0;
522 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
523 else cells = GetPHOSCells();
525 // First recalculate energy in case non linearity was applied
528 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
531 Int_t id = clus->GetCellsAbsId()[ipos];
533 //Recalibrate cell energy if needed
534 Float_t amp = cells->GetCellAmplitude(id);
535 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
546 printf("AliAnaPi0EbE::WeightHistograms()- Wrong calculated energy %f\n",energy);
550 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
551 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
553 //Get the ratio and log ratio to all cells in cluster
554 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
556 Int_t id = clus->GetCellsAbsId()[ipos];
558 //Recalibrate cell energy if needed
559 Float_t amp = cells->GetCellAmplitude(id);
560 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
562 fhECellClusterRatio ->Fill(energy,amp/energy);
563 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
566 //Recalculate shower shape for different W0
567 if(fCalorimeter=="EMCAL"){
569 Float_t l0org = clus->GetM02();
570 Float_t l1org = clus->GetM20();
571 Float_t dorg = clus->GetDispersion();
573 for(Int_t iw = 0; iw < 14; iw++)
575 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
576 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
578 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
579 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
583 // Set the original values back
586 clus->SetDispersion(dorg);
591 //__________________________________________
592 TObjString * AliAnaPi0EbE::GetAnalysisCuts()
594 //Save parameters used for analysis
595 TString parList ; //this will be list of parameters used for this analysis.
596 const Int_t buffersize = 255;
597 char onePar[buffersize] ;
599 snprintf(onePar,buffersize,"--- AliAnaPi0EbE ---\n") ;
601 snprintf(onePar,buffersize,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ;
604 if(fAnaType == kSSCalo)
606 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
608 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
610 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
612 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
616 //Get parameters set in base class.
617 parList += GetBaseParametersList() ;
619 //Get parameters set in PID class.
620 if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ;
622 return new TObjString(parList) ;
625 //_____________________________________________
626 TList * AliAnaPi0EbE::GetCreateOutputObjects()
628 // Create histograms to be saved in output file and
629 // store them in outputContainer
630 TList * outputContainer = new TList() ;
631 outputContainer->SetName("Pi0EbEHistos") ;
633 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
634 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
635 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
636 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
637 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
638 Int_t tbins = GetHistogramRanges()->GetHistoTimeBins() ; Float_t tmax = GetHistogramRanges()->GetHistoTimeMax(); Float_t tmin = GetHistogramRanges()->GetHistoTimeMin();
639 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
641 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
642 Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
643 Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
645 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
646 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
647 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
648 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
649 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
650 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
652 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
653 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
654 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
655 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
656 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
657 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
659 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();
660 Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();
661 Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
663 TString nlm[] ={"1 Local Maxima","2 Local Maxima", "NLM > 2"};
664 TString ptype[] ={"#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"};
665 TString pname[] ={"Photon","Conversion", "Pi0", "Eta", "Electron","Hadron"};
666 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins
668 fhPt = new TH1F("hPt","Number of identified #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
669 fhPt->SetYTitle("N");
670 fhPt->SetXTitle("p_{T} (GeV/c)");
671 outputContainer->Add(fhPt) ;
673 fhE = new TH1F("hE","Number of identified #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
675 fhE->SetXTitle("E (GeV)");
676 outputContainer->Add(fhE) ;
679 ("hEPhi","Selected #pi^{0} (#eta) pairs: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
680 fhEPhi->SetYTitle("#phi (rad)");
681 fhEPhi->SetXTitle("E (GeV)");
682 outputContainer->Add(fhEPhi) ;
685 ("hEEta","Selected #pi^{0} (#eta) pairs: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
686 fhEEta->SetYTitle("#eta");
687 fhEEta->SetXTitle("E (GeV)");
688 outputContainer->Add(fhEEta) ;
691 ("hPtPhi","Selected #pi^{0} (#eta) pairs: p_{T} vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
692 fhPtPhi->SetYTitle("#phi (rad)");
693 fhPtPhi->SetXTitle("p_{T} (GeV/c)");
694 outputContainer->Add(fhPtPhi) ;
697 ("hPtEta","Selected #pi^{0} (#eta) pairs: p_{T} vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
698 fhPtEta->SetYTitle("#eta");
699 fhPtEta->SetXTitle("p_{T} (GeV/c)");
700 outputContainer->Add(fhPtEta) ;
703 ("hEtaPhi","Selected #pi^{0} (#eta) pairs: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
704 fhEtaPhi->SetYTitle("#phi (rad)");
705 fhEtaPhi->SetXTitle("#eta");
706 outputContainer->Add(fhEtaPhi) ;
708 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
710 fhEtaPhiEMCALBC0 = new TH2F
711 ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
712 fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
713 fhEtaPhiEMCALBC0->SetXTitle("#eta");
714 outputContainer->Add(fhEtaPhiEMCALBC0) ;
716 fhEtaPhiEMCALBC1 = new TH2F
717 ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
718 fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
719 fhEtaPhiEMCALBC1->SetXTitle("#eta");
720 outputContainer->Add(fhEtaPhiEMCALBC1) ;
722 fhEtaPhiEMCALBCN = new TH2F
723 ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
724 fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
725 fhEtaPhiEMCALBCN->SetXTitle("#eta");
726 outputContainer->Add(fhEtaPhiEMCALBCN) ;
728 for(Int_t i = 0; i < 12; i++)
730 fhEtaPhiTriggerEMCALBC[i] = new TH2F
731 (Form("hEtaPhiTriggerEMCALBC%d",i-5),
732 Form("cluster,E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
733 netabins,etamin,etamax,nphibins,phimin,phimax);
734 fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
735 fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
736 outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
738 fhTimeTriggerEMCALBC[i] = new TH2F
739 (Form("hTimeTriggerEMCALBC%d",i-5),
740 Form("time of cluster vs E of clusters, Trigger EMCAL-BC=%d",i-5),
741 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
742 fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
743 fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
744 outputContainer->Add(fhTimeTriggerEMCALBC[i]);
746 fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
747 (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-5),
748 Form("time of cluster vs E of clusters, Trigger EMCAL-BC=%d",i-5),
749 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
750 fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
751 fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
752 outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
756 fhPtCentrality = new TH2F("hPtCentrality","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
757 fhPtCentrality->SetYTitle("centrality");
758 fhPtCentrality->SetXTitle("p_{T}(GeV/c)");
759 outputContainer->Add(fhPtCentrality) ;
761 fhPtEventPlane = new TH2F("hPtEventPlane","event plane angle vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
762 fhPtEventPlane->SetYTitle("Event plane angle (rad)");
763 fhPtEventPlane->SetXTitle("p_{T} (GeV/c)");
764 outputContainer->Add(fhPtEventPlane) ;
766 if(fAnaType == kSSCalo)
768 fhPtReject = new TH1F("hPtReject","Number of rejected as #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
769 fhPtReject->SetYTitle("N");
770 fhPtReject->SetXTitle("p_{T} (GeV/c)");
771 outputContainer->Add(fhPtReject) ;
773 fhEReject = new TH1F("hEReject","Number of rejected as #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
774 fhEReject->SetYTitle("N");
775 fhEReject->SetXTitle("E (GeV)");
776 outputContainer->Add(fhEReject) ;
778 fhEPhiReject = new TH2F
779 ("hEPhiReject","Rejected #pi^{0} (#eta) cluster: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
780 fhEPhiReject->SetYTitle("#phi (rad)");
781 fhEPhiReject->SetXTitle("E (GeV)");
782 outputContainer->Add(fhEPhiReject) ;
784 fhEEtaReject = new TH2F
785 ("hEEtaReject","Rejected #pi^{0} (#eta) cluster: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
786 fhEEtaReject->SetYTitle("#eta");
787 fhEEtaReject->SetXTitle("E (GeV)");
788 outputContainer->Add(fhEEtaReject) ;
790 fhEtaPhiReject = new TH2F
791 ("hEtaPhiReject","Rejected #pi^{0} (#eta) cluster: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
792 fhEtaPhiReject->SetYTitle("#phi (rad)");
793 fhEtaPhiReject->SetXTitle("#eta");
794 outputContainer->Add(fhEtaPhiReject) ;
798 ("hMass","all pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
799 fhMass->SetYTitle("mass (GeV/c^{2})");
800 fhMass->SetXTitle("E (GeV)");
801 outputContainer->Add(fhMass) ;
803 fhSelectedMass = new TH2F
804 ("hSelectedMass","Selected #pi^{0} (#eta) pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
805 fhSelectedMass->SetYTitle("mass (GeV/c^{2})");
806 fhSelectedMass->SetXTitle("E (GeV)");
807 outputContainer->Add(fhSelectedMass) ;
810 ("hMassPt","all pairs mass: p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
811 fhMassPt->SetYTitle("mass (GeV/c^{2})");
812 fhMassPt->SetXTitle("p_{T} (GeV/c)");
813 outputContainer->Add(fhMassPt) ;
815 fhSelectedMassPt = new TH2F
816 ("hSelectedMassPt","Selected #pi^{0} (#eta) pairs mass: p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
817 fhSelectedMassPt->SetYTitle("mass (GeV/c^{2})");
818 fhSelectedMassPt->SetXTitle("p_{T} (GeV/c)");
819 outputContainer->Add(fhSelectedMassPt) ;
821 if(fAnaType != kSSCalo)
823 fhPtDecay = new TH1F("hPtDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
824 fhPtDecay->SetYTitle("N");
825 fhPtDecay->SetXTitle("p_{T} (GeV/c)");
826 outputContainer->Add(fhPtDecay) ;
828 fhEDecay = new TH1F("hEDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
829 fhEDecay->SetYTitle("N");
830 fhEDecay->SetXTitle("E (GeV)");
831 outputContainer->Add(fhEDecay) ;
836 if( fFillSelectClHisto )
839 fhEDispersion = new TH2F
840 ("hEDispersion","Selected #pi^{0} (#eta) pairs: E vs dispersion",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
841 fhEDispersion->SetYTitle("D^{2}");
842 fhEDispersion->SetXTitle("E (GeV)");
843 outputContainer->Add(fhEDispersion) ;
845 fhELambda0 = new TH2F
846 ("hELambda0","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
847 fhELambda0->SetYTitle("#lambda_{0}^{2}");
848 fhELambda0->SetXTitle("E (GeV)");
849 outputContainer->Add(fhELambda0) ;
851 fhELambda1 = new TH2F
852 ("hELambda1","Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
853 fhELambda1->SetYTitle("#lambda_{1}^{2}");
854 fhELambda1->SetXTitle("E (GeV)");
855 outputContainer->Add(fhELambda1) ;
857 fhELambda0FracMaxCellCut = new TH2F
858 ("hELambda0FracMaxCellCut","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy < 0.5",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
859 fhELambda0FracMaxCellCut->SetYTitle("#lambda_{0}^{2}");
860 fhELambda0FracMaxCellCut->SetXTitle("E (GeV)");
861 outputContainer->Add(fhELambda0FracMaxCellCut) ;
863 fhEFracMaxCell = new TH2F
864 ("hEFracMaxCell","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy",nptbins,ptmin,ptmax,100,0,1);
865 fhEFracMaxCell->SetYTitle("Fraction");
866 fhEFracMaxCell->SetXTitle("E (GeV)");
867 outputContainer->Add(fhEFracMaxCell) ;
869 if(fCalorimeter=="EMCAL")
871 fhELambda0NoTRD = new TH2F
872 ("hELambda0NoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, not behind TRD",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
873 fhELambda0NoTRD->SetYTitle("#lambda_{0}^{2}");
874 fhELambda0NoTRD->SetXTitle("E (GeV)");
875 outputContainer->Add(fhELambda0NoTRD) ;
877 fhEFracMaxCellNoTRD = new TH2F
878 ("hEFracMaxCellNoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy, not behind TRD",nptbins,ptmin,ptmax,100,0,1);
879 fhEFracMaxCellNoTRD->SetYTitle("Fraction");
880 fhEFracMaxCellNoTRD->SetXTitle("E (GeV)");
881 outputContainer->Add(fhEFracMaxCellNoTRD) ;
883 if(!fFillOnlySimpleSSHisto)
885 fhDispEtaE = new TH2F ("hDispEtaE","#sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
886 fhDispEtaE->SetXTitle("E (GeV)");
887 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
888 outputContainer->Add(fhDispEtaE);
890 fhDispPhiE = new TH2F ("hDispPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
891 fhDispPhiE->SetXTitle("E (GeV)");
892 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
893 outputContainer->Add(fhDispPhiE);
895 fhSumEtaE = new TH2F ("hSumEtaE","#sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
896 fhSumEtaE->SetXTitle("E (GeV)");
897 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
898 outputContainer->Add(fhSumEtaE);
900 fhSumPhiE = new TH2F ("hSumPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
901 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
902 fhSumPhiE->SetXTitle("E (GeV)");
903 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
904 outputContainer->Add(fhSumPhiE);
906 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
907 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
908 fhSumEtaPhiE->SetXTitle("E (GeV)");
909 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
910 outputContainer->Add(fhSumEtaPhiE);
912 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
913 nptbins,ptmin,ptmax,200, -10,10);
914 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
915 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
916 outputContainer->Add(fhDispEtaPhiDiffE);
918 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
919 nptbins,ptmin,ptmax, 200, -1,1);
920 fhSphericityE->SetXTitle("E (GeV)");
921 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
922 outputContainer->Add(fhSphericityE);
924 for(Int_t i = 0; i < 7; i++)
926 fhDispEtaDispPhi[i] = new TH2F (Form("hDispEtaDispPhi_EBin%d",i),Form("#sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
927 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
928 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
929 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
930 outputContainer->Add(fhDispEtaDispPhi[i]);
932 fhLambda0DispEta[i] = new TH2F (Form("hLambda0DispEta_EBin%d",i),Form("#lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",bin[i],bin[i+1]),
933 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
934 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
935 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
936 outputContainer->Add(fhLambda0DispEta[i]);
938 fhLambda0DispPhi[i] = new TH2F (Form("hLambda0DispPhi_EBin%d",i),Form("#lambda^{2}_{0}} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",bin[i],bin[i+1]),
939 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
940 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
941 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
942 outputContainer->Add(fhLambda0DispPhi[i]);
948 fhNLocMaxE = new TH2F("hNLocMaxE","Number of local maxima in cluster",
949 nptbins,ptmin,ptmax,10,0,10);
950 fhNLocMaxE ->SetYTitle("N maxima");
951 fhNLocMaxE ->SetXTitle("E (GeV)");
952 outputContainer->Add(fhNLocMaxE) ;
954 if(fAnaType == kSSCalo)
956 fhNLocMaxPt = new TH2F("hNLocMaxPt","Number of local maxima in cluster",
957 nptbins,ptmin,ptmax,10,0,10);
958 fhNLocMaxPt ->SetYTitle("N maxima");
959 fhNLocMaxPt ->SetXTitle("p_{T} (GeV/c)");
960 outputContainer->Add(fhNLocMaxPt) ;
963 for (Int_t i = 0; i < 3; i++)
965 fhELambda0LocMax[i] = new TH2F(Form("hELambda0LocMax%d",i+1),
966 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, %s",nlm[i].Data()),
967 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
968 fhELambda0LocMax[i]->SetYTitle("#lambda_{0}^{2}");
969 fhELambda0LocMax[i]->SetXTitle("E (GeV)");
970 outputContainer->Add(fhELambda0LocMax[i]) ;
972 fhELambda1LocMax[i] = new TH2F(Form("hELambda1LocMax%d",i+1),
973 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}, %s",nlm[i].Data()),
974 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
975 fhELambda1LocMax[i]->SetYTitle("#lambda_{1}^{2}");
976 fhELambda1LocMax[i]->SetXTitle("E (GeV)");
977 outputContainer->Add(fhELambda1LocMax[i]) ;
979 fhEDispersionLocMax[i] = new TH2F(Form("hEDispersionLocMax%d",i+1),
980 Form("Selected #pi^{0} (#eta) pairs: E vs dispersion^{2}, %s",nlm[i].Data()),
981 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
982 fhEDispersionLocMax[i]->SetYTitle("dispersion^{2}");
983 fhEDispersionLocMax[i]->SetXTitle("E (GeV)");
984 outputContainer->Add(fhEDispersionLocMax[i]) ;
986 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
988 fhEDispEtaLocMax[i] = new TH2F(Form("hEDispEtaLocMax%d",i+1),
989 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #eta}, %s",nlm[i].Data()),
990 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
991 fhEDispEtaLocMax[i]->SetYTitle("#sigma_{#eta #eta}");
992 fhEDispEtaLocMax[i]->SetXTitle("E (GeV)");
993 outputContainer->Add(fhEDispEtaLocMax[i]) ;
995 fhEDispPhiLocMax[i] = new TH2F(Form("hEDispPhiLocMax%d",i+1),
996 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi}, %s",nlm[i].Data()),
997 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
998 fhEDispPhiLocMax[i]->SetYTitle("#sigma_{#phi #phi}");
999 fhEDispPhiLocMax[i]->SetXTitle("E (GeV)");
1000 outputContainer->Add(fhEDispPhiLocMax[i]) ;
1002 fhESumEtaPhiLocMax[i] = new TH2F(Form("hESumEtaPhiLocMax%d",i+1),
1003 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #phi}, %s",nlm[i].Data()),
1004 nptbins,ptmin,ptmax,2*ssbins,-ssmax,ssmax);
1005 fhESumEtaPhiLocMax[i]->SetYTitle("#sigma_{#eta #phi}");
1006 fhESumEtaPhiLocMax[i]->SetXTitle("E (GeV)");
1007 outputContainer->Add(fhESumEtaPhiLocMax[i]) ;
1009 fhEDispEtaPhiDiffLocMax[i] = new TH2F(Form("hEDispEtaPhiDiffLocMax%d",i+1),
1010 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta}, %s",nlm[i].Data()),
1011 nptbins,ptmin,ptmax,200, -10,10);
1012 fhEDispEtaPhiDiffLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta}");
1013 fhEDispEtaPhiDiffLocMax[i]->SetXTitle("E (GeV)");
1014 outputContainer->Add(fhEDispEtaPhiDiffLocMax[i]) ;
1016 fhESphericityLocMax[i] = new TH2F(Form("hESphericityLocMax%d",i+1),
1017 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta}), %s",nlm[i].Data()),
1018 nptbins,ptmin,ptmax,200, -1,1);
1019 fhESphericityLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta})");
1020 fhESphericityLocMax[i]->SetXTitle("E (GeV)");
1021 outputContainer->Add(fhESphericityLocMax[i]) ;
1026 fhENCells = new TH2F ("hENCells","N cells in cluster vs E ", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1027 fhENCells->SetXTitle("E (GeV)");
1028 fhENCells->SetYTitle("# of cells in cluster");
1029 outputContainer->Add(fhENCells);
1031 fhETime = new TH2F("hETime","cluster time vs pair E",nptbins,ptmin,ptmax, tbins,tmin,tmax);
1032 fhETime->SetXTitle("E (GeV)");
1033 fhETime->SetYTitle("t (ns)");
1034 outputContainer->Add(fhETime);
1039 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs E",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
1040 fhEPairDiffTime->SetXTitle("E_{pair} (GeV)");
1041 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
1042 outputContainer->Add(fhEPairDiffTime);
1044 if(fAnaType == kIMCalo)
1046 TString combiName [] = {"1LocMax","2LocMax","NLocMax","1LocMax2LocMax","1LocMaxNLocMax","2LocMaxNLocMax","1LocMaxSSBad","NLocMaxSSGood"};
1047 TString combiTitle[] = {"1 Local Maxima in both clusters","2 Local Maxima in both clusters","more than 2 Local Maxima in both clusters",
1048 "1 Local Maxima paired with 2 Local Maxima","1 Local Maxima paired with more than 2 Local Maxima",
1049 "2 Local Maxima paired with more than 2 Local Maxima",
1050 "1 Local Maxima paired with #lambda_{0}^{2}>0.3","N Local Maxima paired with 0.1<#lambda_{0}^{2}<0.3"};
1052 for (Int_t i = 0; i < 8 ; i++)
1055 if (fAnaType == kIMCaloTracks && i > 2 ) continue ;
1057 fhMassPairLocMax[i] = new TH2F
1058 (Form("MassPairLocMax%s",combiName[i].Data()),
1059 Form("Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}, %s", combiTitle[i].Data()),
1060 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1061 fhMassPairLocMax[i]->SetYTitle("Mass (MeV/c^{2})");
1062 fhMassPairLocMax[i]->SetXTitle("E_{pair} (GeV)");
1063 outputContainer->Add(fhMassPairLocMax[i]) ;
1069 fhTrackMatchedDEta = new TH2F
1070 ("hTrackMatchedDEta",
1071 "d#eta of cluster-track vs cluster energy",
1072 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1073 fhTrackMatchedDEta->SetYTitle("d#eta");
1074 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
1076 fhTrackMatchedDPhi = new TH2F
1077 ("hTrackMatchedDPhi",
1078 "d#phi of cluster-track vs cluster energy",
1079 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1080 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
1081 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
1083 fhTrackMatchedDEtaDPhi = new TH2F
1084 ("hTrackMatchedDEtaDPhi",
1085 "d#eta vs d#phi of cluster-track vs cluster energy",
1086 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1087 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
1088 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
1090 outputContainer->Add(fhTrackMatchedDEta) ;
1091 outputContainer->Add(fhTrackMatchedDPhi) ;
1092 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
1094 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1095 fhdEdx->SetXTitle("E (GeV)");
1096 fhdEdx->SetYTitle("<dE/dx>");
1097 outputContainer->Add(fhdEdx);
1099 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1100 fhEOverP->SetXTitle("E (GeV)");
1101 fhEOverP->SetYTitle("E/p");
1102 outputContainer->Add(fhEOverP);
1104 if(fCalorimeter=="EMCAL")
1106 fhEOverPNoTRD = new TH2F ("hEOverPNoTRD","matched track E/p vs cluster E, SM not behind TRD ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1107 fhEOverPNoTRD->SetXTitle("E (GeV)");
1108 fhEOverPNoTRD->SetYTitle("E/p");
1109 outputContainer->Add(fhEOverPNoTRD);
1112 if(IsDataMC() && fFillTMHisto)
1114 fhTrackMatchedMCParticleE = new TH2F
1115 ("hTrackMatchedMCParticleE",
1116 "Origin of particle vs energy",
1117 nptbins,ptmin,ptmax,8,0,8);
1118 fhTrackMatchedMCParticleE->SetXTitle("E (GeV)");
1119 //fhTrackMatchedMCParticleE->SetYTitle("Particle type");
1121 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(1 ,"Photon");
1122 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(2 ,"Electron");
1123 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1124 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(4 ,"Rest");
1125 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1126 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1127 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1128 fhTrackMatchedMCParticleE->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1130 outputContainer->Add(fhTrackMatchedMCParticleE);
1132 fhTrackMatchedMCParticleDEta = new TH2F
1133 ("hTrackMatchedMCParticleDEta",
1134 "Origin of particle vs #eta residual",
1135 nresetabins,resetamin,resetamax,8,0,8);
1136 fhTrackMatchedMCParticleDEta->SetXTitle("#Delta #eta");
1137 //fhTrackMatchedMCParticleDEta->SetYTitle("Particle type");
1139 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(1 ,"Photon");
1140 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(2 ,"Electron");
1141 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1142 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(4 ,"Rest");
1143 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1144 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1145 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1146 fhTrackMatchedMCParticleDEta->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1148 outputContainer->Add(fhTrackMatchedMCParticleDEta);
1150 fhTrackMatchedMCParticleDPhi = new TH2F
1151 ("hTrackMatchedMCParticleDPhi",
1152 "Origin of particle vs #phi residual",
1153 nresphibins,resphimin,resphimax,8,0,8);
1154 fhTrackMatchedMCParticleDPhi->SetXTitle("#Delta #phi");
1155 //fhTrackMatchedMCParticleDPhi->SetYTitle("Particle type");
1157 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(1 ,"Photon");
1158 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(2 ,"Electron");
1159 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1160 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(4 ,"Rest");
1161 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1162 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1163 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1164 fhTrackMatchedMCParticleDPhi->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1166 outputContainer->Add(fhTrackMatchedMCParticleDPhi);
1172 if(fFillWeightHistograms)
1174 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1175 nptbins,ptmin,ptmax, 100,0,1.);
1176 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1177 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
1178 outputContainer->Add(fhECellClusterRatio);
1180 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1181 nptbins,ptmin,ptmax, 100,-10,0);
1182 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1183 fhECellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1184 outputContainer->Add(fhECellClusterLogRatio);
1186 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1187 nptbins,ptmin,ptmax, 100,0,1.);
1188 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1189 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
1190 outputContainer->Add(fhEMaxCellClusterRatio);
1192 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1193 nptbins,ptmin,ptmax, 100,-10,0);
1194 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1195 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1196 outputContainer->Add(fhEMaxCellClusterLogRatio);
1198 for(Int_t iw = 0; iw < 14; iw++)
1200 fhLambda0ForW0[iw] = new TH2F (Form("hLambda0ForW0%d",iw),Form("shower shape, #lambda^{2}_{0} vs E, w0 = %1.1f, for selected decay photons from neutral meson",1+0.5*iw),
1201 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1202 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
1203 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
1204 outputContainer->Add(fhLambda0ForW0[iw]);
1206 // fhLambda1ForW0[iw] = new TH2F (Form("hLambda1ForW0%d",iw),Form("shower shape, #lambda^{2}_{1} vs E, w0 = %1.1f, for selected decay photons from neutral meson",0.5+0.5*iw),
1207 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1208 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
1209 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
1210 // outputContainer->Add(fhLambda1ForW0[iw]);
1217 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC && fAnaType==kSSCalo)
1219 fhMCPi0PtGenRecoFraction = new TH2F("hMCPi0PtGenRecoFraction","Number of clusters from #pi^{0} (2 #gamma) identified as #pi^{0} (#eta), pT versus E primary #pi^{0} / E reco",
1220 nptbins,ptmin,ptmax,200,0,2);
1221 fhMCPi0PtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1222 fhMCPi0PtGenRecoFraction->SetYTitle("E^{ #pi^{0} mother} / E^{rec}");
1223 outputContainer->Add(fhMCPi0PtGenRecoFraction) ;
1225 fhMCEtaPtGenRecoFraction = new TH2F("hMCEtaPtGenRecoFraction","Number of clusters from #eta (2 #gamma) identified as #pi^{0} (#eta),pT versus E primary #eta / E reco",
1226 nptbins,ptmin,ptmax,200,0,2);
1227 fhMCEtaPtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1228 fhMCEtaPtGenRecoFraction->SetYTitle("E^{ #eta mother} / E^{rec}");
1229 outputContainer->Add(fhMCEtaPtGenRecoFraction) ;
1231 fhMCPi0DecayPt = new TH1F("hMCPi0DecayPt","Number of #gamma from #pi^{0} decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1232 fhMCPi0DecayPt->SetYTitle("N");
1233 fhMCPi0DecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1234 outputContainer->Add(fhMCPi0DecayPt) ;
1236 fhMCPi0DecayPtFraction = new TH2F("hMCPi0DecayPtFraction","Number of #gamma from #pi^{0} decay identified as #pi^{0} (#eta), pT versus E primary #gamma / E primary #pi^{0}",
1237 nptbins,ptmin,ptmax,100,0,1);
1238 fhMCPi0DecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1239 fhMCPi0DecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1240 outputContainer->Add(fhMCPi0DecayPtFraction) ;
1242 fhMCEtaDecayPt = new TH1F("hMCEtaDecayPt","Number of #gamma from #eta decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1243 fhMCEtaDecayPt->SetYTitle("N");
1244 fhMCEtaDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1245 outputContainer->Add(fhMCEtaDecayPt) ;
1247 fhMCEtaDecayPtFraction = new TH2F("hMCEtaDecayPtFraction","Number of #gamma from #eta decay identified as #pi^{0} (#eta), pT versus E primary #gamma / E primary #eta",
1248 nptbins,ptmin,ptmax,100,0,1);
1249 fhMCEtaDecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1250 fhMCEtaDecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1251 outputContainer->Add(fhMCEtaDecayPtFraction) ;
1253 fhMCOtherDecayPt = new TH1F("hMCOtherDecayPt","Number of #gamma decay (not #eta or #pi^{0}) identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1254 fhMCOtherDecayPt->SetYTitle("N");
1255 fhMCOtherDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1256 outputContainer->Add(fhMCOtherDecayPt) ;
1260 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
1261 GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1264 fhAnglePairMCPi0 = new TH2F
1266 "Angle between decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,250,0,0.5);
1267 fhAnglePairMCPi0->SetYTitle("#alpha (rad)");
1268 fhAnglePairMCPi0->SetXTitle("E_{pair} (GeV)");
1269 outputContainer->Add(fhAnglePairMCPi0) ;
1271 if (fAnaType!= kSSCalo)
1273 fhAnglePairMCEta = new TH2F
1275 "Angle between decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,250,0,0.5);
1276 fhAnglePairMCEta->SetYTitle("#alpha (rad)");
1277 fhAnglePairMCEta->SetXTitle("E_{pair} (GeV)");
1278 outputContainer->Add(fhAnglePairMCEta) ;
1280 fhMassPairMCPi0 = new TH2F
1282 "Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1283 fhMassPairMCPi0->SetYTitle("Mass (MeV/c^{2})");
1284 fhMassPairMCPi0->SetXTitle("E_{pair} (GeV)");
1285 outputContainer->Add(fhMassPairMCPi0) ;
1287 fhMassPairMCEta = new TH2F
1289 "Mass for decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1290 fhMassPairMCEta->SetYTitle("Mass (MeV/c^{2})");
1291 fhMassPairMCEta->SetXTitle("E_{pair} (GeV)");
1292 outputContainer->Add(fhMassPairMCEta) ;
1295 for(Int_t i = 0; i < 6; i++)
1299 (Form("hE_MC%s",pname[i].Data()),
1300 Form("Identified as #pi^{0} (#eta), cluster from %s",
1302 nptbins,ptmin,ptmax);
1303 fhMCE[i]->SetYTitle("N");
1304 fhMCE[i]->SetXTitle("E (GeV)");
1305 outputContainer->Add(fhMCE[i]) ;
1307 fhMCPt[i] = new TH1F
1308 (Form("hPt_MC%s",pname[i].Data()),
1309 Form("Identified as #pi^{0} (#eta), cluster from %s",
1311 nptbins,ptmin,ptmax);
1312 fhMCPt[i]->SetYTitle("N");
1313 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1314 outputContainer->Add(fhMCPt[i]) ;
1316 fhMCPtCentrality[i] = new TH2F
1317 (Form("hPtCentrality_MC%s",pname[i].Data()),
1318 Form("Identified as #pi^{0} (#eta), cluster from %s",
1320 nptbins,ptmin,ptmax, 100,0,100);
1321 fhMCPtCentrality[i]->SetYTitle("centrality");
1322 fhMCPtCentrality[i]->SetXTitle("p_{T} (GeV/c)");
1323 outputContainer->Add(fhMCPtCentrality[i]) ;
1325 if(fAnaType == kSSCalo)
1328 fhMCNLocMaxPt[i] = new TH2F
1329 (Form("hNLocMaxPt_MC%s",pname[i].Data()),
1330 Form("cluster from %s, pT of cluster, for NLM",ptype[i].Data()),
1331 nptbins,ptmin,ptmax,10,0,10);
1332 fhMCNLocMaxPt[i] ->SetYTitle("N maxima");
1333 fhMCNLocMaxPt[i] ->SetXTitle("p_{T} (GeV/c)");
1334 outputContainer->Add(fhMCNLocMaxPt[i]) ;
1336 fhMCEReject[i] = new TH1F
1337 (Form("hEReject_MC%s",pname[i].Data()),
1338 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1340 nptbins,ptmin,ptmax);
1341 fhMCEReject[i]->SetYTitle("N");
1342 fhMCEReject[i]->SetXTitle("E (GeV)");
1343 outputContainer->Add(fhMCEReject[i]) ;
1345 fhMCPtReject[i] = new TH1F
1346 (Form("hPtReject_MC%s",pname[i].Data()),
1347 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1349 nptbins,ptmin,ptmax);
1350 fhMCPtReject[i]->SetYTitle("N");
1351 fhMCPtReject[i]->SetXTitle("p_{T} (GeV/c)");
1352 outputContainer->Add(fhMCPtReject[i]) ;
1355 fhMCPhi[i] = new TH2F
1356 (Form("hPhi_MC%s",pname[i].Data()),
1357 Form("Identified as #pi^{0} (#eta), cluster from %s",ptype[i].Data()),
1358 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1359 fhMCPhi[i]->SetYTitle("#phi");
1360 fhMCPhi[i]->SetXTitle("p_{T} (GeV/c)");
1361 outputContainer->Add(fhMCPhi[i]) ;
1363 fhMCEta[i] = new TH2F
1364 (Form("hEta_MC%s",pname[i].Data()),
1365 Form("Identified as #pi^{0} (#eta), cluster from %s",
1366 ptype[i].Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
1367 fhMCEta[i]->SetYTitle("#eta");
1368 fhMCEta[i]->SetXTitle("p_{T} (GeV/c)");
1369 outputContainer->Add(fhMCEta[i]) ;
1371 fhMCMassPt[i] = new TH2F
1372 (Form("hMassPt_MC%s",pname[i].Data()),
1373 Form("all pairs mass: p_{T} vs massfrom %s",ptype[i].Data()),
1374 nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1375 fhMCMassPt[i]->SetYTitle("mass (GeV/c^{2})");
1376 fhMCMassPt[i]->SetXTitle("p_{T} (GeV/c)");
1377 outputContainer->Add(fhMCMassPt[i]) ;
1379 fhMCSelectedMassPt[i] = new TH2F
1380 (Form("hSelectedMassPt_MC%s",pname[i].Data()),
1381 Form("Selected #pi^{0} (#eta) pairs mass: p_{T} vs massfrom %s",ptype[i].Data()),
1382 nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1383 fhMCSelectedMassPt[i]->SetYTitle("mass (GeV/c^{2})");
1384 fhMCSelectedMassPt[i]->SetXTitle("p_{T} (GeV/c)");
1385 outputContainer->Add(fhMCSelectedMassPt[i]) ;
1388 if( fFillSelectClHisto )
1390 fhEMCLambda0[i] = new TH2F(Form("hELambda0_MC%s",pname[i].Data()),
1391 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}",ptype[i].Data()),
1392 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1393 fhEMCLambda0[i]->SetYTitle("#lambda_{0}^{2}");
1394 fhEMCLambda0[i]->SetXTitle("E (GeV)");
1395 outputContainer->Add(fhEMCLambda0[i]) ;
1397 fhEMCLambda1[i] = new TH2F(Form("hELambda1_MC%s",pname[i].Data()),
1398 Form("Selected pair, cluster from %s : E vs #lambda_{1}^{2}",ptype[i].Data()),
1399 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1400 fhEMCLambda1[i]->SetYTitle("#lambda_{1}^{2}");
1401 fhEMCLambda1[i]->SetXTitle("E (GeV)");
1402 outputContainer->Add(fhEMCLambda1[i]) ;
1404 fhEMCDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pname[i].Data()),
1405 Form("Selected pair, cluster from %s : E vs dispersion^{2}",ptype[i].Data()),
1406 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1407 fhEMCDispersion[i]->SetYTitle("D^{2}");
1408 fhEMCDispersion[i]->SetXTitle("E (GeV)");
1409 outputContainer->Add(fhEMCDispersion[i]) ;
1411 if(fCalorimeter=="EMCAL")
1413 fhEMCLambda0NoTRD[i] = new TH2F(Form("hELambda0NoTRD_MC%s",pname[i].Data()),
1414 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, NoTRD",ptype[i].Data()),
1415 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1416 fhEMCLambda0NoTRD[i]->SetYTitle("#lambda_{0}^{2}");
1417 fhEMCLambda0NoTRD[i]->SetXTitle("E (GeV)");
1418 outputContainer->Add(fhEMCLambda0NoTRD[i]) ;
1420 if(!fFillOnlySimpleSSHisto)
1422 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pname[i].Data()),
1423 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptype[i].Data()),
1424 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1425 fhMCEDispEta[i]->SetXTitle("E (GeV)");
1426 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1427 outputContainer->Add(fhMCEDispEta[i]);
1429 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pname[i].Data()),
1430 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptype[i].Data()),
1431 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1432 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
1433 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1434 outputContainer->Add(fhMCEDispPhi[i]);
1436 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pname[i].Data()),
1437 Form("cluster from %s : #delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",ptype[i].Data()),
1438 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1439 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
1440 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
1441 outputContainer->Add(fhMCESumEtaPhi[i]);
1443 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pname[i].Data()),
1444 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptype[i].Data()),
1445 nptbins,ptmin,ptmax,200,-10,10);
1446 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
1447 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1448 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
1450 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pname[i].Data()),
1451 Form("cluster from %s : (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",ptype[i].Data()),
1452 nptbins,ptmin,ptmax, 200,-1,1);
1453 fhMCESphericity[i]->SetXTitle("E (GeV)");
1454 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1455 outputContainer->Add(fhMCESphericity[i]);
1457 for(Int_t ie = 0; ie < 7; ie++)
1459 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1460 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1461 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1462 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1463 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1464 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
1466 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pname[i].Data()),
1467 Form("cluster from %s : #lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1468 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1469 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
1470 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1471 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
1473 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1474 Form("cluster from %s :#lambda^{2}_{0} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1475 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1476 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
1477 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1478 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
1484 fhEMCLambda0FracMaxCellCut[i] = new TH2F(Form("hELambda0FracMaxCellCut_MC%s",pname[i].Data()),
1485 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, Max cell fraction of energy < 0.5 ",ptype[i].Data()),
1486 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1487 fhEMCLambda0FracMaxCellCut[i]->SetYTitle("#lambda_{0}^{2}");
1488 fhEMCLambda0FracMaxCellCut[i]->SetXTitle("E (GeV)");
1489 outputContainer->Add(fhEMCLambda0FracMaxCellCut[i]) ;
1491 fhEMCFracMaxCell[i] = new TH2F(Form("hEFracMaxCell_MC%s",pname[i].Data()),
1492 Form("Selected pair, cluster from %s : E vs Max cell fraction of energy",ptype[i].Data()),
1493 nptbins,ptmin,ptmax,100,0,1);
1494 fhEMCFracMaxCell[i]->SetYTitle("Fraction");
1495 fhEMCFracMaxCell[i]->SetXTitle("E (GeV)");
1496 outputContainer->Add(fhEMCFracMaxCell[i]) ;
1499 } // shower shape histo
1504 if(fAnaType==kSSCalo)
1506 fhAsymmetry = new TH2F ("hAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1507 nptbins,ptmin,ptmax, 200, -1,1);
1508 fhAsymmetry->SetXTitle("E (GeV)");
1509 fhAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1510 outputContainer->Add(fhAsymmetry);
1512 fhSelectedAsymmetry = new TH2F ("hSelectedAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1513 nptbins,ptmin,ptmax, 200, -1,1);
1514 fhSelectedAsymmetry->SetXTitle("E (GeV)");
1515 fhSelectedAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1516 outputContainer->Add(fhSelectedAsymmetry);
1519 ("hSplitE","Selected #pi^{0} (#eta) pairs energy sum of split sub-clusters",nptbins,ptmin,ptmax);
1520 fhSplitE->SetYTitle("counts");
1521 fhSplitE->SetXTitle("E (GeV)");
1522 outputContainer->Add(fhSplitE) ;
1524 fhSplitPt = new TH1F
1525 ("hSplitPt","Selected #pi^{0} (#eta) pairs pT sum of split sub-clusters",nptbins,ptmin,ptmax);
1526 fhSplitPt->SetYTitle("counts");
1527 fhSplitPt->SetXTitle("p_{T} (GeV/c)");
1528 outputContainer->Add(fhSplitPt) ;
1531 fhSplitPtPhi = new TH2F
1532 ("hSplitPtPhi","Selected #pi^{0} (#eta) pairs: sum split sub-cluster p_{T} vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
1533 fhSplitPtPhi->SetYTitle("#phi (rad)");
1534 fhSplitPtPhi->SetXTitle("p_{T} (GeV/c)");
1535 outputContainer->Add(fhSplitPtPhi) ;
1537 fhSplitPtEta = new TH2F
1538 ("hSplitPtEta","Selected #pi^{0} (#eta) pairs: sum split sub-cluster p_{T} vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1539 fhSplitPtEta->SetYTitle("#eta");
1540 fhSplitPtEta->SetXTitle("p_{T} (GeV/c)");
1541 outputContainer->Add(fhSplitPtEta) ;
1544 fhNLocMaxSplitPt = new TH2F("hNLocMaxSplitPt","Number of local maxima in cluster",
1545 nptbins,ptmin,ptmax,10,0,10);
1546 fhNLocMaxSplitPt ->SetYTitle("N maxima");
1547 fhNLocMaxSplitPt ->SetXTitle("p_{T} (GeV/c)");
1548 outputContainer->Add(fhNLocMaxSplitPt) ;
1551 fhMassSplitPt = new TH2F
1552 ("hMassSplitPt","all pairs mass: sum split sub-cluster p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1553 fhMassSplitPt->SetYTitle("mass (GeV/c^{2})");
1554 fhMassSplitPt->SetXTitle("p_{T} (GeV/c)");
1555 outputContainer->Add(fhMassSplitPt) ;
1557 fhSelectedMassSplitPt = new TH2F
1558 ("hSelectedMassSplitPt","Selected #pi^{0} (#eta) pairs mass: sum split sub-cluster p_{T} vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1559 fhSelectedMassSplitPt->SetYTitle("mass (GeV/c^{2})");
1560 fhSelectedMassSplitPt->SetXTitle("p_{T} (GeV/c)");
1561 outputContainer->Add(fhSelectedMassSplitPt) ;
1567 for(Int_t i = 0; i< 6; i++)
1569 fhMCEAsymmetry[i] = new TH2F (Form("hEAsymmetry_MC%s",pname[i].Data()),
1570 Form("cluster from %s : A = ( E1 - E2 ) / ( E1 + E2 ) vs E",ptype[i].Data()),
1571 nptbins,ptmin,ptmax, 200,-1,1);
1572 fhMCEAsymmetry[i]->SetXTitle("E (GeV)");
1573 fhMCEAsymmetry[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1574 outputContainer->Add(fhMCEAsymmetry[i]);
1576 fhMCSplitE[i] = new TH1F
1577 (Form("hSplitE_MC%s",pname[i].Data()),
1578 Form("cluster from %s, energy sum of split sub-clusters",ptype[i].Data()),
1579 nptbins,ptmin,ptmax);
1580 fhMCSplitE[i]->SetYTitle("counts");
1581 fhMCSplitE[i]->SetXTitle("E (GeV)");
1582 outputContainer->Add(fhMCSplitE[i]) ;
1584 fhMCSplitPt[i] = new TH1F
1585 (Form("hSplitPt_MC%s",pname[i].Data()),
1586 Form("cluster from %s, pT sum of split sub-clusters",ptype[i].Data()),
1587 nptbins,ptmin,ptmax);
1588 fhMCSplitPt[i]->SetYTitle("counts");
1589 fhMCSplitPt[i]->SetXTitle("p_{T} (GeV/c)");
1590 outputContainer->Add(fhMCSplitPt[i]) ;
1593 fhMCSplitPtPhi[i] = new TH2F
1594 (Form("hSplitPtPhi_MC%s",pname[i].Data()),
1595 Form("Identified as #pi^{0} (#eta), cluster from %s",ptype[i].Data()),
1596 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1597 fhMCSplitPtPhi[i]->SetYTitle("#phi");
1598 fhMCSplitPtPhi[i]->SetXTitle("p_{T} (GeV/c)");
1599 outputContainer->Add(fhMCSplitPtPhi[i]) ;
1601 fhMCSplitPtEta[i] = new TH2F
1602 (Form("hSplitPtEta_MC%s",pname[i].Data()),
1603 Form("Identified as #pi^{0} (#eta), cluster from %s",
1604 ptype[i].Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
1605 fhMCSplitPtEta[i]->SetYTitle("#eta");
1606 fhMCSplitPtEta[i]->SetXTitle("p_{T} (GeV/c)");
1607 outputContainer->Add(fhMCSplitPtEta[i]) ;
1610 fhMCNLocMaxSplitPt[i] = new TH2F
1611 (Form("hNLocMaxSplitPt_MC%s",pname[i].Data()),
1612 Form("cluster from %s, pT sum of split sub-clusters, for NLM",ptype[i].Data()),
1613 nptbins,ptmin,ptmax,10,0,10);
1614 fhMCNLocMaxSplitPt[i] ->SetYTitle("N maxima");
1615 fhMCNLocMaxSplitPt[i] ->SetXTitle("p_{T} (GeV/c)");
1616 outputContainer->Add(fhMCNLocMaxSplitPt[i]) ;
1618 fhMCMassSplitPt[i] = new TH2F
1619 (Form("hMassSplitPt_MC%s",pname[i].Data()),
1620 Form("all pairs mass: split p_{T} vs mass from %s",ptype[i].Data()),
1621 nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1622 fhMCMassSplitPt[i]->SetYTitle("mass (GeV/c^{2})");
1623 fhMCMassSplitPt[i]->SetXTitle("p_{T} (GeV/c)");
1624 outputContainer->Add(fhMCMassSplitPt[i]) ;
1626 fhMCSelectedMassSplitPt[i] = new TH2F
1627 (Form("hSelectedMassSplitPt_MC%s",pname[i].Data()),
1628 Form("Selected #pi^{0} (#eta) pairs mass: split p_{T} vs mass from %s",ptype[i].Data()),
1629 nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
1630 fhMCSelectedMassSplitPt[i]->SetYTitle("mass (GeV/c^{2})");
1631 fhMCSelectedMassSplitPt[i]->SetXTitle("p_{T} (GeV/c)");
1632 outputContainer->Add(fhMCSelectedMassSplitPt[i]) ;
1638 if(fAnaType==kSSCalo && fFillSelectClHisto && !fFillOnlySimpleSSHisto )
1642 for(Int_t i = 0; i< 3; i++)
1644 fhEAsymmetryLocMax[i] = new TH2F(Form("hEAsymmetryLocMax%d",i+1),
1645 Form("Selected #pi^{0} (#eta) pairs: E vs A = ( E1 - E2 ) / ( E1 + E2 ), %s",nlm[i].Data()),
1646 nptbins,ptmin,ptmax,200, -1,1);
1647 fhEAsymmetryLocMax[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1648 fhEAsymmetryLocMax[i]->SetXTitle("E (GeV)");
1649 outputContainer->Add(fhEAsymmetryLocMax[i]) ;
1652 for(Int_t ie = 0; ie< 7; ie++)
1655 fhAsymmetryLambda0[ie] = new TH2F (Form("hAsymmetryLambda0_EBin%d",ie),
1656 Form("#lambda_{0}^{2} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1657 ssbins,ssmin,ssmax , 200,-1,1);
1658 fhAsymmetryLambda0[ie]->SetXTitle("#lambda_{0}^{2}");
1659 fhAsymmetryLambda0[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1660 outputContainer->Add(fhAsymmetryLambda0[ie]);
1662 fhAsymmetryDispEta[ie] = new TH2F (Form("hAsymmetryDispEta_EBin%d",ie),
1663 Form("#sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1664 ssbins,ssmin,ssmax , 200,-1,1);
1665 fhAsymmetryDispEta[ie]->SetXTitle("#sigma^{2}_{#eta #eta}");
1666 fhAsymmetryDispEta[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1667 outputContainer->Add(fhAsymmetryDispEta[ie]);
1669 fhAsymmetryDispPhi[ie] = new TH2F (Form("hAsymmetryDispPhi_EBin%d",ie),
1670 Form("#sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1671 ssbins,ssmin,ssmax , 200,-1,1);
1672 fhAsymmetryDispPhi[ie]->SetXTitle("#sigma^{2}_{#phi #phi}");
1673 fhAsymmetryDispPhi[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1674 outputContainer->Add(fhAsymmetryDispPhi[ie]);
1680 for(Int_t i = 0; i< 6; i++)
1682 for(Int_t ie = 0; ie < 7; ie++)
1684 fhMCAsymmetryLambda0[ie][i] = new TH2F (Form("hMCAsymmetryLambda0_EBin%d_MC%s",ie,pname[i].Data()),
1685 Form("cluster from %s : #lambda_{0}^{2} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1686 ssbins,ssmin,ssmax , 200,-1,1);
1687 fhMCAsymmetryLambda0[ie][i]->SetXTitle("#lambda_{0}^{2}");
1688 fhMCAsymmetryLambda0[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1689 outputContainer->Add(fhMCAsymmetryLambda0[ie][i]);
1691 fhMCAsymmetryDispEta[ie][i] = new TH2F (Form("hMCAsymmetryDispEta_EBin%d_MC%s",ie,pname[i].Data()),
1692 Form("cluster from %s : #sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1693 ssbins,ssmin,ssmax , 200,-1,1);
1694 fhMCAsymmetryDispEta[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1695 fhMCAsymmetryDispEta[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1696 outputContainer->Add(fhMCAsymmetryDispEta[ie][i]);
1698 fhMCAsymmetryDispPhi[ie][i] = new TH2F (Form("hMCAsymmetryDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1699 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1700 ssbins,ssmin,ssmax , 200,-1,1);
1701 fhMCAsymmetryDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#phi #phi}");
1702 fhMCAsymmetryDispPhi[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1703 outputContainer->Add(fhMCAsymmetryDispPhi[ie][i]);
1709 if(fFillPileUpHistograms)
1712 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1714 for(Int_t i = 0 ; i < 7 ; i++)
1716 fhPtPi0PileUp[i] = new TH1F(Form("hPtPi0PileUp%s",pileUpName[i].Data()),
1717 Form("Selected #pi^{0} (#eta) p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
1718 fhPtPi0PileUp[i]->SetXTitle("p_{T} (GeV/c)");
1719 outputContainer->Add(fhPtPi0PileUp[i]);
1722 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1723 fhTimeENoCut->SetXTitle("E (GeV)");
1724 fhTimeENoCut->SetYTitle("time (ns)");
1725 outputContainer->Add(fhTimeENoCut);
1727 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1728 fhTimeESPD->SetXTitle("E (GeV)");
1729 fhTimeESPD->SetYTitle("time (ns)");
1730 outputContainer->Add(fhTimeESPD);
1732 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1733 fhTimeESPDMulti->SetXTitle("E (GeV)");
1734 fhTimeESPDMulti->SetYTitle("time (ns)");
1735 outputContainer->Add(fhTimeESPDMulti);
1737 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1738 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
1739 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
1740 outputContainer->Add(fhTimeNPileUpVertSPD);
1742 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
1743 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
1744 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
1745 outputContainer->Add(fhTimeNPileUpVertTrack);
1747 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1748 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
1749 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
1750 outputContainer->Add(fhTimeNPileUpVertContributors);
1752 fhTimePileUpMainVertexZDistance = new TH2F ("hTime_PileUpMainVertexZDistance","time of cluster vs distance in Z pile-up SPD vertex - main SPD vertex",ntimebins,timemin,timemax,100,0,50);
1753 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
1754 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
1755 outputContainer->Add(fhTimePileUpMainVertexZDistance);
1757 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
1758 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
1759 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
1760 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
1764 //Keep neutral meson selection histograms if requiered
1765 //Setting done in AliNeutralMesonSelection
1767 if(fAnaType!=kSSCalo && GetNeutralMesonSelection())
1769 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
1771 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
1772 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
1777 return outputContainer ;
1781 //_____________________________________________
1782 Int_t AliAnaPi0EbE::GetMCIndex(const Int_t tag)
1785 // Assign mc index depending on MC bit set
1787 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1791 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
1795 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
1796 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1798 return kmcConversion ;
1799 }//conversion photon
1800 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) )
1803 }//photon no conversion
1804 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
1806 return kmcElectron ;
1815 //__________________________________________________________________
1816 void AliAnaPi0EbE::HasPairSameMCMother(AliAODPWG4Particle * photon1,
1817 AliAODPWG4Particle * photon2,
1818 Int_t & label, Int_t & tag)
1820 // Check the labels of pare in case mother was same pi0 or eta
1821 // Set the new AOD accordingly
1823 Int_t label1 = photon1->GetLabel();
1824 Int_t label2 = photon2->GetLabel();
1826 if(label1 < 0 || label2 < 0 ) return ;
1828 //Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader());
1829 //Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader());
1830 Int_t tag1 = photon1->GetTag();
1831 Int_t tag2 = photon2->GetTag();
1833 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
1834 if( (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
1835 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay) ) ||
1836 (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCEtaDecay) &&
1837 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCEtaDecay) )
1841 //Check if pi0/eta mother is the same
1842 if(GetReader()->ReadStack())
1846 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
1847 label1 = mother1->GetFirstMother();
1848 //mother1 = GetMCStack()->Particle(label1);//pi0
1852 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
1853 label2 = mother2->GetFirstMother();
1854 //mother2 = GetMCStack()->Particle(label2);//pi0
1857 else if(GetReader()->ReadAODMCParticles())
1858 {//&& (input > -1)){
1861 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label1);//photon in kine tree
1862 label1 = mother1->GetMother();
1863 //mother1 = GetMCStack()->Particle(label1);//pi0
1867 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label2);//photon in kine tree
1868 label2 = mother2->GetMother();
1869 //mother2 = GetMCStack()->Particle(label2);//pi0
1873 //printf("mother1 %d, mother2 %d\n",label1,label2);
1874 if( label1 == label2 && label1>=0 )
1879 TLorentzVector mom1 = *(photon1->Momentum());
1880 TLorentzVector mom2 = *(photon2->Momentum());
1882 Double_t angle = mom2.Angle(mom1.Vect());
1883 Double_t mass = (mom1+mom2).M();
1884 Double_t epair = (mom1+mom2).E();
1886 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay))
1888 fhMassPairMCPi0 ->Fill(epair,mass);
1889 fhAnglePairMCPi0->Fill(epair,angle);
1890 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
1894 fhMassPairMCEta ->Fill(epair,mass);
1895 fhAnglePairMCEta->Fill(epair,angle);
1896 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCEta);
1900 } // both from eta or pi0 decay
1904 //____________________________________________________________________________
1905 void AliAnaPi0EbE::Init()
1909 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
1910 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
1913 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
1914 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
1920 //____________________________________________________________________________
1921 void AliAnaPi0EbE::InitParameters()
1923 //Initialize the parameters of the analysis.
1924 AddToHistogramsName("AnaPi0EbE_");
1926 fInputAODGammaConvName = "PhotonsCTS" ;
1927 fAnaType = kIMCalo ;
1928 fCalorimeter = "EMCAL" ;
1933 fNLMECutMin[0] = 10.;
1934 fNLMECutMin[1] = 6. ;
1935 fNLMECutMin[2] = 6. ;
1939 //__________________________________________________________________
1940 void AliAnaPi0EbE::MakeAnalysisFillAOD()
1942 //Do analysis and fill aods
1947 MakeInvMassInCalorimeter();
1951 MakeShowerShapeIdentification();
1955 MakeInvMassInCalorimeterAndCTS();
1961 //____________________________________________
1962 void AliAnaPi0EbE::MakeInvMassInCalorimeter()
1964 //Do analysis and fill aods
1965 //Search for the photon decay in calorimeters
1966 //Read photon list from AOD, produced in class AliAnaPhoton
1967 //Check if 2 photons have the mass of the pi0.
1969 TLorentzVector mom1;
1970 TLorentzVector mom2;
1971 TLorentzVector mom ;
1976 if(!GetInputAODBranch()){
1977 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
1981 //Get shower shape information of clusters
1982 TObjArray *clusters = 0;
1983 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1984 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1986 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast()-1; iphoton++){
1987 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1989 //Vertex cut in case of mixed events
1990 Int_t evtIndex1 = 0 ;
1992 evtIndex1 = GetMixedEvent()->EventIndexForCaloCluster(photon1->GetCaloLabel(0)) ;
1993 if(TMath::Abs(GetVertex(evtIndex1)[2]) > GetZvertexCut()) continue ; //vertex cut
1994 mom1 = *(photon1->Momentum());
1996 //Get original cluster, to recover some information
1998 AliVCluster *cluster1 = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
2001 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - First cluster not found\n");
2005 for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast(); jphoton++)
2007 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(jphoton));
2009 Int_t evtIndex2 = 0 ;
2011 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
2013 if(GetMixedEvent() && (evtIndex1 == evtIndex2))
2016 if(TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut()) continue ; //vertex cut
2018 mom2 = *(photon2->Momentum());
2020 //Get original cluster, to recover some information
2022 AliVCluster *cluster2 = FindCluster(clusters,photon2->GetCaloLabel(0),iclus2,iclus+1);
2026 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Second cluster not found\n");
2030 Float_t e1 = photon1->E();
2031 Float_t e2 = photon2->E();
2033 //Select clusters with good time window difference
2034 Float_t tof1 = cluster1->GetTOF()*1e9;;
2035 Float_t tof2 = cluster2->GetTOF()*1e9;;
2036 Double_t t12diff = tof1-tof2;
2037 fhEPairDiffTime->Fill(e1+e2, t12diff);
2038 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
2040 //Play with the MC stack if available
2041 if(IsDataMC()) HasPairSameMCMother(photon1, photon2, label, tag) ;
2043 // Check the invariant mass for different selection on the local maxima
2044 // Name of AOD method TO BE FIXED
2045 Int_t nMaxima1 = photon1->GetFiducialArea();
2046 Int_t nMaxima2 = photon2->GetFiducialArea();
2048 Double_t mass = (mom1+mom2).M();
2049 Double_t epair = (mom1+mom2).E();
2051 if(nMaxima1==nMaxima2)
2053 if (nMaxima1==1) fhMassPairLocMax[0]->Fill(epair,mass);
2054 else if(nMaxima1==2) fhMassPairLocMax[1]->Fill(epair,mass);
2055 else fhMassPairLocMax[2]->Fill(epair,mass);
2057 else if(nMaxima1==1 || nMaxima2==1)
2059 if (nMaxima1==2 || nMaxima2==2) fhMassPairLocMax[3]->Fill(epair,mass);
2060 else fhMassPairLocMax[4]->Fill(epair,mass);
2063 fhMassPairLocMax[5]->Fill(epair,mass);
2065 // combinations with SS axis cut and NLM cut
2066 if(nMaxima1 == 1 && cluster2->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
2067 if(nMaxima2 == 1 && cluster1->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
2068 if(nMaxima1 > 1 && cluster2->GetM02() < 0.3 && cluster2->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
2069 if(nMaxima2 > 1 && cluster1->GetM02() < 0.3 && cluster1->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
2071 //Skip events with too few or too many NLM
2072 if((nMaxima1 < fNLMCutMin || nMaxima1 > fNLMCutMax) || (nMaxima2 < fNLMCutMin || nMaxima2 > fNLMCutMax)) continue ;
2074 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - NLM of out of range: cluster1 %d, cluster2 %d \n",nMaxima1, nMaxima2);
2077 fhMass->Fill(epair,(mom1+mom2).M());
2079 //Select good pair (good phi, pt cuts, aperture and invariant mass)
2080 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
2083 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Selected gamma pair: pt %f, phi %f, eta%f \n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta());
2085 //Fill some histograms about shower shape
2086 if(fFillSelectClHisto && clusters && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2088 FillSelectedClusterHistograms(cluster1, nMaxima1, photon1->GetTag());
2089 FillSelectedClusterHistograms(cluster2, nMaxima2, photon2->GetTag());
2092 // Tag both photons as decay
2093 photon1->SetTagged(kTRUE);
2094 photon2->SetTagged(kTRUE);
2096 fhPtDecay->Fill(photon1->Pt());
2097 fhEDecay ->Fill(photon1->E() );
2099 fhPtDecay->Fill(photon2->Pt());
2100 fhEDecay ->Fill(photon2->E() );
2102 //Create AOD for analysis
2105 //Mass of selected pairs
2106 fhSelectedMass->Fill(epair,mom.M());
2108 // Fill histograms to undertand pile-up before other cuts applied
2109 // Remember to relax time cuts in the reader
2110 FillPileUpHistograms(mom.E(),((cluster1->GetTOF()+cluster2->GetTOF())*1e9) /2);
2112 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
2114 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
2115 pi0.SetDetector(photon1->GetDetector());
2118 pi0.SetLabel(label);
2121 //Set the indeces of the original caloclusters
2122 pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0));
2123 //pi0.SetInputFileIndex(input);
2125 AddAODParticle(pi0);
2133 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - End fill AODs \n");
2137 //__________________________________________________
2138 void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
2140 //Do analysis and fill aods
2141 //Search for the photon decay in calorimeters
2142 //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion
2143 //Check if 2 photons have the mass of the pi0.
2145 TLorentzVector mom1;
2146 TLorentzVector mom2;
2147 TLorentzVector mom ;
2152 // Check calorimeter input
2153 if(!GetInputAODBranch()){
2154 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data());
2158 // Get the array with conversion photons
2159 TClonesArray * inputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName);
2160 if(!inputAODGammaConv) {
2162 inputAODGammaConv = (TClonesArray *) GetReader()->GetInputEvent()->FindListObject(fInputAODGammaConvName);
2164 if(!inputAODGammaConv) {
2165 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input gamma conversions in AOD branch with name < %s >\n",fInputAODGammaConvName.Data());
2171 //Get shower shape information of clusters
2172 TObjArray *clusters = 0;
2173 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
2174 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
2176 Int_t nCTS = inputAODGammaConv->GetEntriesFast();
2177 Int_t nCalo = GetInputAODBranch()->GetEntriesFast();
2178 if(nCTS<=0 || nCalo <=0)
2180 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - nCalo %d, nCTS %d, cannot loop\n",nCalo,nCTS);
2185 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Number of conversion photons %d\n",nCTS);
2187 // Do the loop, first calo, second CTS
2188 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){
2189 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
2190 mom1 = *(photon1->Momentum());
2192 //Get original cluster, to recover some information
2194 AliVCluster *cluster = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
2196 for(Int_t jphoton = 0; jphoton < nCTS; jphoton++){
2197 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (inputAODGammaConv->At(jphoton));
2199 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
2200 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
2202 mom2 = *(photon2->Momentum());
2204 Double_t mass = (mom1+mom2).M();
2205 Double_t epair = (mom1+mom2).E();
2207 Int_t nMaxima = photon1->GetFiducialArea();
2208 if (nMaxima==1) fhMassPairLocMax[0]->Fill(epair,mass);
2209 else if(nMaxima==2) fhMassPairLocMax[1]->Fill(epair,mass);
2210 else fhMassPairLocMax[2]->Fill(epair,mass);
2212 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) continue ;
2213 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - NLM %d of out of range \n",nMaxima);
2215 //Play with the MC stack if available
2218 Int_t label2 = photon2->GetLabel();
2219 if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader()));
2221 HasPairSameMCMother(photon1, photon2, label, tag) ;
2224 //Mass of selected pairs
2225 fhMass->Fill(epair,(mom1+mom2).M());
2227 //Select good pair (good phi, pt cuts, aperture and invariant mass)
2228 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
2230 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Selected gamma pair: pt %f, phi %f, eta%f\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta());
2232 //Fill some histograms about shower shape
2233 if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2235 FillSelectedClusterHistograms(cluster, nMaxima, photon1->GetTag());
2238 // Tag both photons as decay
2239 photon1->SetTagged(kTRUE);
2240 photon2->SetTagged(kTRUE);
2242 fhPtDecay->Fill(photon1->Pt());
2243 fhEDecay ->Fill(photon1->E() );
2245 //Create AOD for analysis
2249 //Mass of selected pairs
2250 fhSelectedMass->Fill(epair,mom.M());
2252 // Fill histograms to undertand pile-up before other cuts applied
2253 // Remember to relax time cuts in the reader
2254 if(cluster)FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);
2256 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
2258 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
2259 pi0.SetDetector(photon1->GetDetector());
2262 pi0.SetLabel(label);
2265 //Set the indeces of the original tracks or caloclusters
2266 pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1);
2267 pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1));
2268 //pi0.SetInputFileIndex(input);
2270 AddAODParticle(pi0);
2277 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - End fill AODs \n");
2282 //_________________________________________________
2283 void AliAnaPi0EbE::MakeShowerShapeIdentification()
2285 //Search for pi0 in fCalorimeter with shower shape analysis
2287 TObjArray * pl = 0x0;
2288 AliVCaloCells * cells = 0x0;
2289 //Select the Calorimeter of the photon
2290 if (fCalorimeter == "PHOS" )
2292 pl = GetPHOSClusters();
2293 cells = GetPHOSCells();
2295 else if (fCalorimeter == "EMCAL")
2297 pl = GetEMCALClusters();
2298 cells = GetEMCALCells();
2303 Info("MakeShowerShapeIdentification","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2307 TLorentzVector mom ;
2308 for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++)
2310 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2312 Int_t evtIndex = 0 ;
2313 if (GetMixedEvent())
2315 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2318 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
2320 //Get Momentum vector,
2321 Double_t vertex[]={0,0,0};
2322 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2324 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
2325 }//Assume that come from vertex in straight line
2328 calo->GetMomentum(mom,vertex) ;
2331 //If too small or big pt, skip it
2332 if(mom.E() < GetMinEnergy() || mom.E() > GetMaxEnergy() ) continue ;
2334 //Check acceptance selection
2335 if(IsFiducialCutOn())
2337 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2338 if(! in ) continue ;
2342 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Min pt cut and fiducial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",mom.Pt(),mom.Phi(),mom.Eta());
2344 //Check Distance to Bad channel, set bit.
2345 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2346 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
2347 if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
2350 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
2352 //.......................................
2353 // TOF cut, BE CAREFUL WITH THIS CUT
2354 Double_t tof = calo->GetTOF()*1e9;
2355 if(tof < fTimeCutMin || tof > fTimeCutMax) continue ;
2357 //Play with the MC stack if available
2358 //Check origin of the candidates
2362 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
2363 //GetMCAnalysisUtils()->CheckMultipleOrigin(calo->GetLabels(),calo->GetNLabels(), GetReader(), aodpi0.GetInputFileIndex(), tag);
2364 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",tag);
2367 //Skip matched clusters with tracks
2368 if(fRejectTrackMatch && IsTrackMatched(calo, GetReader()->GetInputEvent()))
2370 FillRejectedClusterHistograms(mom,tag);
2375 //PID selection or bit setting
2377 Double_t mass = 0 , angle = 0;
2378 TLorentzVector l1, l2;
2379 Int_t absId1 = -1; Int_t absId2 = -1;
2381 Int_t idPartType = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(calo,cells,GetCaloUtils(),
2382 GetVertex(evtIndex),nMaxima,
2383 mass,angle,l1,l2,absId1,absId2) ;
2385 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",idPartType);
2388 //Skip events with too few or too many NLM
2389 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax)
2391 FillRejectedClusterHistograms(mom,tag);
2395 if(nMaxima == 1 && fNLMECutMin[0] > mom.E()) continue;
2396 if(nMaxima == 2 && fNLMECutMin[1] > mom.E()) continue;
2397 if(nMaxima > 2 && fNLMECutMin[2] > mom.E()) continue;
2400 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - NLM %d accepted \n",nMaxima);
2402 Float_t e1 = l1.Energy();
2403 Float_t e2 = l2.Energy();
2404 TLorentzVector l12 = l1+l2;
2405 Float_t ptSplit = l12.Pt();
2406 Float_t eSplit = e1+e2;
2407 Int_t mcIndex = GetMCIndex(tag);
2409 //mass of all clusters
2410 fhMass ->Fill(mom.E(),mass);
2411 fhMassPt ->Fill(mom.Pt(),mass);
2412 fhMassSplitPt->Fill(ptSplit,mass);
2416 fhMCMassPt[mcIndex] ->Fill(mom.Pt(),mass);
2417 fhMCMassSplitPt[mcIndex]->Fill(ptSplit,mass);
2420 // Asymmetry of all clusters
2423 if(e1+e2 > 0) asy = (e1-e2) / (e1+e2);
2424 fhAsymmetry->Fill(mom.E(),asy);
2429 fhMCEAsymmetry[mcIndex]->Fill(mom.E(),asy);
2432 // If cluster does not pass pid, not pi0/eta, skip it.
2433 if (GetOutputAODName().Contains("Pi0") && idPartType != AliCaloPID::kPi0)
2435 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Pi0\n");
2436 FillRejectedClusterHistograms(mom,tag);
2440 else if(GetOutputAODName().Contains("Eta") && idPartType != AliCaloPID::kEta)
2442 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Eta\n");
2443 FillRejectedClusterHistograms(mom,tag);
2448 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
2449 mom.Pt(), idPartType);
2451 //Mass and asymmetry of selected pairs
2452 fhSelectedAsymmetry ->Fill(mom.E() ,asy );
2453 fhSelectedMass ->Fill(mom.E() ,mass);
2454 fhSelectedMassPt ->Fill(mom.Pt(),mass);
2455 fhSelectedMassSplitPt->Fill(ptSplit ,mass);
2457 fhSplitE ->Fill( eSplit);
2458 fhSplitPt ->Fill(ptSplit);
2459 Float_t phi = mom.Phi();
2460 if(phi<0) phi+=TMath::TwoPi();
2461 fhSplitPtPhi ->Fill(ptSplit,phi);
2462 fhSplitPtEta ->Fill(ptSplit,mom.Eta());
2463 fhNLocMaxSplitPt->Fill(ptSplit ,nMaxima);
2464 fhNLocMaxPt ->Fill(mom.Pt(),nMaxima);
2466 //Check split-clusters with good time window difference
2467 Double_t tof1 = cells->GetCellTime(absId1);
2468 GetCaloUtils()->RecalibrateCellTime(tof1, fCalorimeter, absId1,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2471 Double_t tof2 = cells->GetCellTime(absId2);
2472 GetCaloUtils()->RecalibrateCellTime(tof2, fCalorimeter, absId2,GetReader()->GetInputEvent()->GetBunchCrossNumber());
2475 Double_t t12diff = tof1-tof2;
2476 fhEPairDiffTime->Fill(e1+e2, t12diff);
2480 fhMCSplitE [mcIndex]->Fill( eSplit);
2481 fhMCSplitPt [mcIndex]->Fill(ptSplit);
2482 fhMCSplitPtPhi [mcIndex]->Fill(ptSplit,phi);
2483 fhMCSplitPtEta [mcIndex]->Fill(ptSplit,mom.Eta());
2484 fhMCNLocMaxSplitPt[mcIndex]->Fill(ptSplit ,nMaxima);
2485 fhMCNLocMaxPt [mcIndex]->Fill(mom.Pt(),nMaxima);
2487 fhMCSelectedMassPt [mcIndex]->Fill(mom.Pt(),mass);
2488 fhMCSelectedMassSplitPt[mcIndex]->Fill(ptSplit,mass);
2492 //-----------------------
2493 //Create AOD for analysis
2495 AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
2496 aodpi0.SetLabel(calo->GetLabel());
2498 //Set the indeces of the original caloclusters
2499 aodpi0.SetCaloLabel(calo->GetID(),-1);
2500 aodpi0.SetDetector(fCalorimeter);
2502 if (distBad > fMinDist3) aodpi0.SetDistToBad(2) ;
2503 else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ;
2504 else aodpi0.SetDistToBad(0) ;
2506 // Check if cluster is pi0 via cluster splitting
2507 aodpi0.SetIdentifiedParticleType(idPartType);
2509 // Add number of local maxima to AOD, method name in AOD to be FIXED
2510 aodpi0.SetFiducialArea(nMaxima);
2514 //Fill some histograms about shower shape
2515 if(fFillSelectClHisto && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2517 FillSelectedClusterHistograms(calo, nMaxima, tag, asy);
2520 // Fill histograms to undertand pile-up before other cuts applied
2521 // Remember to relax time cuts in the reader
2522 Double_t tofcluster = calo->GetTOF()*1e9;
2523 Double_t tofclusterUS = TMath::Abs(tofcluster);
2525 FillPileUpHistograms(calo->E(),tofcluster);
2527 if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL")
2529 Float_t phicluster = aodpi0.Phi();
2530 if(phicluster < 0) phicluster+=TMath::TwoPi();
2534 if (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(aodpi0.Eta(), phicluster);
2535 else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(aodpi0.Eta(), phicluster);
2536 else fhEtaPhiEMCALBCN->Fill(aodpi0.Eta(), phicluster);
2539 Int_t bc = GetReader()->IsPileUpClusterTriggeredEvent();
2540 if(bc > -7 && bc < 8)
2542 if(calo->E() > 2) fhEtaPhiTriggerEMCALBC[bc+5]->Fill(aodpi0.Eta(), phicluster);
2543 fhTimeTriggerEMCALBC[bc+5]->Fill(calo->E(), tofcluster);
2544 if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[bc+5]->Fill(calo->E(), tofcluster);
2546 else printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Trigger BC not expected = %d\n",bc);
2549 //Add AOD with pi0 object to aod branch
2550 AddAODParticle(aodpi0);
2554 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
2557 //______________________________________________
2558 void AliAnaPi0EbE::MakeAnalysisFillHistograms()
2560 //Do analysis and fill histograms
2562 if(!GetOutputAODBranch())
2564 printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
2567 //Loop on stored AOD pi0
2568 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2569 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2571 Float_t cen = GetEventCentrality();
2572 Float_t ep = GetEventPlaneAngle();
2574 for(Int_t iaod = 0; iaod < naod ; iaod++)
2577 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2578 Int_t pdg = pi0->GetIdentifiedParticleType();
2580 if(IsCaloPIDOn() && pdg != AliCaloPID::kPi0) continue;
2582 //Fill pi0 histograms
2583 Float_t ener = pi0->E();
2584 Float_t pt = pi0->Pt();
2585 Float_t phi = pi0->Phi();
2586 if(phi < 0) phi+=TMath::TwoPi();
2587 Float_t eta = pi0->Eta();
2592 fhEEta ->Fill(ener,eta);
2593 fhEPhi ->Fill(ener,phi);
2594 fhPtEta ->Fill(pt ,eta);
2595 fhPtPhi ->Fill(pt ,phi);
2596 fhEtaPhi ->Fill(eta ,phi);
2598 fhPtCentrality ->Fill(pt,cen) ;
2599 fhPtEventPlane ->Fill(pt,ep ) ;
2601 if(fFillPileUpHistograms)
2603 if(GetReader()->IsPileUpFromSPD()) fhPtPi0PileUp[0]->Fill(pt);
2604 if(GetReader()->IsPileUpFromEMCal()) fhPtPi0PileUp[1]->Fill(pt);
2605 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPi0PileUp[2]->Fill(pt);
2606 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPi0PileUp[3]->Fill(pt);
2607 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPi0PileUp[4]->Fill(pt);
2608 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPi0PileUp[5]->Fill(pt);
2609 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPi0PileUp[6]->Fill(pt);
2615 Int_t tag = pi0->GetTag();
2616 Int_t mcIndex = GetMCIndex(tag);
2618 fhMCE [mcIndex] ->Fill(ener);
2619 fhMCPt [mcIndex] ->Fill(pt);
2620 fhMCPhi[mcIndex] ->Fill(pt,phi);
2621 fhMCEta[mcIndex] ->Fill(pt,eta);
2623 fhMCPtCentrality[mcIndex]->Fill(pt,cen);
2625 if((mcIndex==kmcPhoton || mcIndex==kmcPi0 || mcIndex==kmcEta) && fAnaType==kSSCalo)
2627 Float_t efracMC = 0;
2628 Int_t label = pi0->GetLabel();
2631 TLorentzVector mom = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2634 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
2636 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2637 if(grandmom.E() > 0 && ok)
2639 efracMC = grandmom.E()/ener;
2640 fhMCPi0PtGenRecoFraction ->Fill(pt,efracMC);
2643 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
2645 fhMCPi0DecayPt->Fill(pt);
2646 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2647 if(grandmom.E() > 0 && ok)
2649 efracMC = mom.E()/grandmom.E();
2650 fhMCPi0DecayPtFraction ->Fill(pt,efracMC);
2653 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
2655 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2656 if(grandmom.E() > 0 && ok)
2658 efracMC = grandmom.E()/ener;
2659 fhMCEtaPtGenRecoFraction ->Fill(pt,efracMC);
2662 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
2664 fhMCEtaDecayPt->Fill(pt);
2665 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2666 if(grandmom.E() > 0 && ok)
2668 efracMC = mom.E()/grandmom.E();
2669 fhMCEtaDecayPtFraction ->Fill(pt,efracMC);
2672 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
2674 fhMCOtherDecayPt->Fill(pt);
2679 }//Histograms with MC
2685 //__________________________________________________________________
2686 void AliAnaPi0EbE::Print(const Option_t * opt) const
2688 //Print some relevant parameters set for the analysis
2692 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2693 AliAnaCaloTrackCorrBaseClass::Print("");
2694 printf("Analysis Type = %d \n", fAnaType) ;
2695 if(fAnaType == kSSCalo){
2696 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2697 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2698 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2699 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);