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 fFillPileUpHistograms(0),
56 fFillWeightHistograms(kFALSE), fFillTMHisto(0),
57 fFillSelectClHisto(0), fFillOnlySimpleSSHisto(1),
58 fInputAODGammaConvName(""),
61 fhEEta(0), fhEPhi(0), fhEtaPhi(0),
62 fhPtCentrality(), fhPtEventPlane(0),
63 fhPtReject(0), fhEReject(0),
64 fhEEtaReject(0), fhEPhiReject(0), fhEtaPhiReject(0),
65 fhMass(0), fhAsymmetry(0),
66 fhSelectedMass(0), fhSelectedAsymmetry(0),
67 fhPtDecay(0), fhEDecay(0),
68 // Shower shape histos
69 fhEDispersion(0), fhELambda0(0), fhELambda1(0),
70 fhELambda0NoTRD(0), fhELambda0FracMaxCellCut(0),
71 fhEFracMaxCell(0), fhEFracMaxCellNoTRD(0),
72 fhENCells(0), fhETime(0), fhEPairDiffTime(0),
73 fhDispEtaE(0), fhDispPhiE(0),
74 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
75 fhDispEtaPhiDiffE(0), fhSphericityE(0),
80 fhMCEReject(), fhMCPtReject(),
81 fhMCPi0PtGenRecoFraction(0), fhMCEtaPtGenRecoFraction(0),
82 fhMCPi0DecayPt(0), fhMCPi0DecayPtFraction(0),
83 fhMCEtaDecayPt(0), fhMCEtaDecayPtFraction(0),
85 fhMassPairMCPi0(0), fhMassPairMCEta(0),
86 fhAnglePairMCPi0(0), fhAnglePairMCEta(0),
88 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
89 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
90 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
91 fhTrackMatchedMCParticle(0), fhdEdx(0),
92 fhEOverP(0), fhEOverPNoTRD(0),
93 // Number of local maxima in cluster
96 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
97 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
98 fhTimeNPileUpVertContributors(0),
99 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0)
103 for(Int_t i = 0; i < 6; i++)
109 fhEMCLambda0 [i] = 0;
110 fhEMCLambda0NoTRD [i] = 0;
111 fhEMCLambda0FracMaxCellCut[i]= 0;
112 fhEMCFracMaxCell [i] = 0;
113 fhEMCLambda1 [i] = 0;
114 fhEMCDispersion [i] = 0;
116 fhMCEDispEta [i] = 0;
117 fhMCEDispPhi [i] = 0;
118 fhMCESumEtaPhi [i] = 0;
119 fhMCEDispEtaPhiDiff[i] = 0;
120 fhMCESphericity [i] = 0;
121 fhMCEAsymmetry [i] = 0;
123 for(Int_t j = 0; j < 7; j++)
125 fhMCLambda0DispEta [j][i] = 0;
126 fhMCLambda0DispPhi [j][i] = 0;
127 fhMCDispEtaDispPhi [j][i] = 0;
128 fhMCAsymmetryLambda0 [j][i] = 0;
129 fhMCAsymmetryDispEta [j][i] = 0;
130 fhMCAsymmetryDispPhi [j][i] = 0;
134 for(Int_t j = 0; j < 7; j++)
136 fhLambda0DispEta [j] = 0;
137 fhLambda0DispPhi [j] = 0;
138 fhDispEtaDispPhi [j] = 0;
139 fhAsymmetryLambda0 [j] = 0;
140 fhAsymmetryDispEta [j] = 0;
141 fhAsymmetryDispPhi [j] = 0;
143 fhPtPi0PileUp [j] = 0;
146 for(Int_t i = 0; i < 3; i++)
148 fhELambda0LocMax [i] = 0;
149 fhELambda1LocMax [i] = 0;
150 fhEDispersionLocMax [i] = 0;
151 fhEDispEtaLocMax [i] = 0;
152 fhEDispPhiLocMax [i] = 0;
153 fhESumEtaPhiLocMax [i] = 0;
154 fhEDispEtaPhiDiffLocMax[i] = 0;
155 fhESphericityLocMax [i] = 0;
156 fhEAsymmetryLocMax [i] = 0;
160 for(Int_t i =0; i < 14; i++){
161 fhLambda0ForW0[i] = 0;
162 //fhLambda1ForW0[i] = 0;
163 if(i<8)fhMassPairLocMax[i] = 0;
166 //Initialize parameters
171 //_______________________________________________________________________________
172 void AliAnaPi0EbE::FillPileUpHistograms(const Float_t energy, const Float_t time)
174 // Fill some histograms to understand pile-up
175 if(!fFillPileUpHistograms) return;
177 //printf("E %f, time %f\n",energy,time);
178 AliVEvent * event = GetReader()->GetInputEvent();
180 fhTimeENoCut->Fill(energy,time);
181 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
182 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
184 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
186 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
187 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
189 // N pile up vertices
190 Int_t nVerticesSPD = -1;
191 Int_t nVerticesTracks = -1;
195 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
196 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
201 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
202 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
205 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
206 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
208 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
209 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
212 Float_t z1 = -1, z2 = -1;
214 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
218 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
219 ncont=pv->GetNContributors();
220 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
222 diamZ = esdEv->GetDiamondZ();
226 AliAODVertex *pv=aodEv->GetVertex(iVert);
227 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
228 ncont=pv->GetNContributors();
229 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
231 diamZ = aodEv->GetDiamondZ();
234 Double_t distZ = TMath::Abs(z2-z1);
235 diamZ = TMath::Abs(z2-diamZ);
237 fhTimeNPileUpVertContributors ->Fill(time,ncont);
238 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
239 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
245 //___________________________________________________________________________________________
246 void AliAnaPi0EbE::FillRejectedClusterHistograms(const TLorentzVector mom, const Int_t mctag)
248 // Fill histograms that do not pass the identification (SS case only)
250 Float_t ener = mom.E();
251 Float_t pt = mom.Pt();
252 Float_t phi = mom.Phi();
253 if(phi < 0) phi+=TMath::TwoPi();
254 Float_t eta = mom.Eta();
256 fhPtReject ->Fill(pt);
257 fhEReject ->Fill(ener);
259 fhEEtaReject ->Fill(ener,eta);
260 fhEPhiReject ->Fill(ener,phi);
261 fhEtaPhiReject ->Fill(eta,phi);
265 Int_t mcIndex = GetMCIndex(mctag);
266 fhMCEReject [mcIndex] ->Fill(ener);
267 fhMCPtReject [mcIndex] ->Fill(pt);
271 //_____________________________________________________________________________________
272 void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster,
277 // Fill shower shape, timing and other histograms for selected clusters from decay
279 Float_t e = cluster->E();
280 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
281 Float_t l0 = cluster->GetM02();
282 Float_t l1 = cluster->GetM20();
283 Int_t nSM = GetModuleNumber(cluster);
286 if (e < 2 ) ebin = 0;
287 else if (e < 4 ) ebin = 1;
288 else if (e < 6 ) ebin = 2;
289 else if (e < 10) ebin = 3;
290 else if (e < 15) ebin = 4;
291 else if (e < 20) ebin = 5;
295 if (nMaxima==1) indexMax = 0 ;
296 else if(nMaxima==2) indexMax = 1 ;
300 AliVCaloCells * cell = 0x0;
301 if(fCalorimeter == "PHOS")
302 cell = GetPHOSCells();
304 cell = GetEMCALCells();
306 Float_t maxCellFraction = 0;
307 GetCaloUtils()->GetMaxEnergyCell(cell, cluster, maxCellFraction);
308 fhEFracMaxCell->Fill(e,maxCellFraction);
310 FillWeightHistograms(cluster);
312 fhEDispersion->Fill(e, disp);
313 fhELambda0 ->Fill(e, l0 );
314 fhELambda1 ->Fill(e, l1 );
316 Float_t ll0 = 0., ll1 = 0.;
317 Float_t dispp= 0., dEta = 0., dPhi = 0.;
318 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
319 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
321 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
322 ll0, ll1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
324 fhDispEtaE -> Fill(e,dEta);
325 fhDispPhiE -> Fill(e,dPhi);
326 fhSumEtaE -> Fill(e,sEta);
327 fhSumPhiE -> Fill(e,sPhi);
328 fhSumEtaPhiE -> Fill(e,sEtaPhi);
329 fhDispEtaPhiDiffE -> Fill(e,dPhi-dEta);
330 if(dEta+dPhi>0)fhSphericityE -> Fill(e,(dPhi-dEta)/(dEta+dPhi));
332 fhDispEtaDispPhi[ebin]->Fill(dEta,dPhi);
333 fhLambda0DispEta[ebin]->Fill(l0 ,dEta);
334 fhLambda0DispPhi[ebin]->Fill(l0 ,dPhi);
336 if (fAnaType==kSSCalo)
338 // Asymmetry histograms
339 fhAsymmetryLambda0[ebin]->Fill(l0 ,asy);
340 fhAsymmetryDispEta[ebin]->Fill(dEta,asy);
341 fhAsymmetryDispPhi[ebin]->Fill(dPhi,asy);
345 fhNLocMax->Fill(e,nMaxima);
347 fhELambda0LocMax [indexMax]->Fill(e,l0);
348 fhELambda1LocMax [indexMax]->Fill(e,l1);
349 fhEDispersionLocMax[indexMax]->Fill(e,disp);
351 if(fCalorimeter=="EMCAL" && !fFillOnlySimpleSSHisto)
353 fhEDispEtaLocMax [indexMax]-> Fill(e,dEta);
354 fhEDispPhiLocMax [indexMax]-> Fill(e,dPhi);
355 fhESumEtaPhiLocMax [indexMax]-> Fill(e,sEtaPhi);
356 fhEDispEtaPhiDiffLocMax[indexMax]-> Fill(e,dPhi-dEta);
357 if(dEta+dPhi>0) fhESphericityLocMax[indexMax]->Fill(e,(dPhi-dEta)/(dEta+dPhi));
358 if(fAnaType==kSSCalo) fhEAsymmetryLocMax [indexMax]->Fill(e ,asy);
362 if(fCalorimeter=="EMCAL" && nSM < 6)
364 fhELambda0NoTRD->Fill(e, l0 );
365 fhEFracMaxCellNoTRD->Fill(e,maxCellFraction);
368 if(maxCellFraction < 0.5)
369 fhELambda0FracMaxCellCut->Fill(e, l0 );
371 fhETime ->Fill(e, cluster->GetTOF()*1.e9);
372 fhENCells->Fill(e, cluster->GetNCells());
374 // Fill Track matching control histograms
377 Float_t dZ = cluster->GetTrackDz();
378 Float_t dR = cluster->GetTrackDx();
380 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
382 dR = 2000., dZ = 2000.;
383 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
385 //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
387 if(fhTrackMatchedDEta && TMath::Abs(dR) < 999)
389 fhTrackMatchedDEta->Fill(e,dZ);
390 fhTrackMatchedDPhi->Fill(e,dR);
391 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
394 // Check dEdx and E/p of matched clusters
396 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
398 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
402 Float_t dEdx = track->GetTPCsignal();
403 fhdEdx->Fill(e, dEdx);
405 Float_t eOverp = e/track->P();
406 fhEOverP->Fill(e, eOverp);
408 if(fCalorimeter=="EMCAL" && nSM < 6) fhEOverPNoTRD->Fill(e, eOverp);
412 // printf("AliAnaPi0EbE::FillSelectedClusterHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
418 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
420 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
421 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 2.5 );
422 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 0.5 );
423 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 1.5 );
424 else fhTrackMatchedMCParticle->Fill(e, 3.5 );
429 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
430 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 6.5 );
431 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 4.5 );
432 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 5.5 );
433 else fhTrackMatchedMCParticle->Fill(e, 7.5 );
437 }// Track matching histograms
441 Int_t mcIndex = GetMCIndex(tag);
443 fhEMCLambda0[mcIndex] ->Fill(e, l0);
444 fhEMCLambda1[mcIndex] ->Fill(e, l1);
445 fhEMCDispersion[mcIndex] ->Fill(e, disp);
446 fhEMCFracMaxCell[mcIndex]->Fill(e,maxCellFraction);
448 if(fCalorimeter=="EMCAL" && nSM < 6)
449 fhEMCLambda0NoTRD[mcIndex]->Fill(e, l0 );
451 if(maxCellFraction < 0.5)
452 fhEMCLambda0FracMaxCellCut[mcIndex]->Fill(e, l0 );
454 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
456 fhMCEDispEta [mcIndex]-> Fill(e,dEta);
457 fhMCEDispPhi [mcIndex]-> Fill(e,dPhi);
458 fhMCESumEtaPhi [mcIndex]-> Fill(e,sEtaPhi);
459 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(e,dPhi-dEta);
460 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(e,(dPhi-dEta)/(dEta+dPhi));
462 if (fAnaType==kSSCalo)
464 fhMCAsymmetryLambda0[ebin][mcIndex]->Fill(l0 ,asy);
465 fhMCAsymmetryDispEta[ebin][mcIndex]->Fill(dEta,asy);
466 fhMCAsymmetryDispPhi[ebin][mcIndex]->Fill(dPhi,asy);
469 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta,dPhi);
470 fhMCLambda0DispEta[ebin][mcIndex]->Fill(l0 ,dEta);
471 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(l0 ,dPhi);
479 //________________________________________________________
480 void AliAnaPi0EbE::FillWeightHistograms(AliVCluster *clus)
482 // Calculate weights and fill histograms
484 if(!fFillWeightHistograms || GetMixedEvent()) return;
486 AliVCaloCells* cells = 0;
487 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
488 else cells = GetPHOSCells();
490 // First recalculate energy in case non linearity was applied
493 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
496 Int_t id = clus->GetCellsAbsId()[ipos];
498 //Recalibrate cell energy if needed
499 Float_t amp = cells->GetCellAmplitude(id);
500 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
511 printf("AliAnaPi0EbE::WeightHistograms()- Wrong calculated energy %f\n",energy);
515 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
516 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
518 //Get the ratio and log ratio to all cells in cluster
519 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
521 Int_t id = clus->GetCellsAbsId()[ipos];
523 //Recalibrate cell energy if needed
524 Float_t amp = cells->GetCellAmplitude(id);
525 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
527 fhECellClusterRatio ->Fill(energy,amp/energy);
528 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
531 //Recalculate shower shape for different W0
532 if(fCalorimeter=="EMCAL"){
534 Float_t l0org = clus->GetM02();
535 Float_t l1org = clus->GetM20();
536 Float_t dorg = clus->GetDispersion();
538 for(Int_t iw = 0; iw < 14; iw++)
540 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
541 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
543 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
544 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
548 // Set the original values back
551 clus->SetDispersion(dorg);
556 //__________________________________________
557 TObjString * AliAnaPi0EbE::GetAnalysisCuts()
559 //Save parameters used for analysis
560 TString parList ; //this will be list of parameters used for this analysis.
561 const Int_t buffersize = 255;
562 char onePar[buffersize] ;
564 snprintf(onePar,buffersize,"--- AliAnaPi0EbE ---\n") ;
566 snprintf(onePar,buffersize,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ;
569 if(fAnaType == kSSCalo)
571 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
573 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
575 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
577 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
581 //Get parameters set in base class.
582 parList += GetBaseParametersList() ;
584 //Get parameters set in PID class.
585 if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ;
587 return new TObjString(parList) ;
590 //_____________________________________________
591 TList * AliAnaPi0EbE::GetCreateOutputObjects()
593 // Create histograms to be saved in output file and
594 // store them in outputContainer
595 TList * outputContainer = new TList() ;
596 outputContainer->SetName("Pi0EbEHistos") ;
598 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
599 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
600 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
601 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
602 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
603 Int_t tbins = GetHistogramRanges()->GetHistoTimeBins() ; Float_t tmax = GetHistogramRanges()->GetHistoTimeMax(); Float_t tmin = GetHistogramRanges()->GetHistoTimeMin();
604 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
606 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
607 Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
608 Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
610 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
611 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
612 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
613 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
614 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
615 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
617 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
618 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
619 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
620 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
621 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
622 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
624 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();
625 Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();
626 Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
628 TString nlm[] ={"1 Local Maxima","2 Local Maxima", "NLM > 2"};
629 TString ptype[] ={"#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"};
630 TString pname[] ={"Photon","Conversion", "Pi0", "Eta", "Electron","Hadron"};
631 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins
633 fhPt = new TH1F("hPt","Number of identified #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
634 fhPt->SetYTitle("N");
635 fhPt->SetXTitle("p_{T} (GeV/c)");
636 outputContainer->Add(fhPt) ;
638 fhE = new TH1F("hE","Number of identified #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
640 fhE->SetXTitle("E (GeV)");
641 outputContainer->Add(fhE) ;
644 ("hEPhi","Selected #pi^{0} (#eta) pairs: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
645 fhEPhi->SetYTitle("#phi (rad)");
646 fhEPhi->SetXTitle("E (GeV)");
647 outputContainer->Add(fhEPhi) ;
650 ("hEEta","Selected #pi^{0} (#eta) pairs: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
651 fhEEta->SetYTitle("#eta");
652 fhEEta->SetXTitle("E (GeV)");
653 outputContainer->Add(fhEEta) ;
656 ("hEtaPhi","Selected #pi^{0} (#eta) pairs: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
657 fhEtaPhi->SetYTitle("#phi (rad)");
658 fhEtaPhi->SetXTitle("#eta");
659 outputContainer->Add(fhEtaPhi) ;
661 fhPtCentrality = new TH2F("hPtCentrality","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
662 fhPtCentrality->SetYTitle("centrality");
663 fhPtCentrality->SetXTitle("p_{T}(GeV/c)");
664 outputContainer->Add(fhPtCentrality) ;
666 fhPtEventPlane = new TH2F("hPtEventPlane","event plane angle vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
667 fhPtEventPlane->SetYTitle("Event plane angle (rad)");
668 fhPtEventPlane->SetXTitle("p_{T} (GeV/c)");
669 outputContainer->Add(fhPtEventPlane) ;
671 if(fAnaType == kSSCalo)
673 fhPtReject = new TH1F("hPtReject","Number of rejected as #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
674 fhPtReject->SetYTitle("N");
675 fhPtReject->SetXTitle("p_{T} (GeV/c)");
676 outputContainer->Add(fhPtReject) ;
678 fhEReject = new TH1F("hEReject","Number of rejected as #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
679 fhEReject->SetYTitle("N");
680 fhEReject->SetXTitle("E (GeV)");
681 outputContainer->Add(fhEReject) ;
683 fhEPhiReject = new TH2F
684 ("hEPhiReject","Rejected #pi^{0} (#eta) cluster: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
685 fhEPhiReject->SetYTitle("#phi (rad)");
686 fhEPhiReject->SetXTitle("E (GeV)");
687 outputContainer->Add(fhEPhiReject) ;
689 fhEEtaReject = new TH2F
690 ("hEEtaReject","Rejected #pi^{0} (#eta) cluster: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
691 fhEEtaReject->SetYTitle("#eta");
692 fhEEtaReject->SetXTitle("E (GeV)");
693 outputContainer->Add(fhEEtaReject) ;
695 fhEtaPhiReject = new TH2F
696 ("hEtaPhiReject","Rejected #pi^{0} (#eta) cluster: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
697 fhEtaPhiReject->SetYTitle("#phi (rad)");
698 fhEtaPhiReject->SetXTitle("#eta");
699 outputContainer->Add(fhEtaPhiReject) ;
703 ("hMass","all pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
704 fhMass->SetYTitle("mass (GeV/c^{2})");
705 fhMass->SetXTitle("E (GeV)");
706 outputContainer->Add(fhMass) ;
708 fhSelectedMass = new TH2F
709 ("hSelectedMass","Selected #pi^{0} (#eta) pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
710 fhSelectedMass->SetYTitle("mass (GeV/c^{2})");
711 fhSelectedMass->SetXTitle("E (GeV)");
712 outputContainer->Add(fhSelectedMass) ;
714 if(fAnaType != kSSCalo)
716 fhPtDecay = new TH1F("hPtDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
717 fhPtDecay->SetYTitle("N");
718 fhPtDecay->SetXTitle("p_{T} (GeV/c)");
719 outputContainer->Add(fhPtDecay) ;
721 fhEDecay = new TH1F("hEDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
722 fhEDecay->SetYTitle("N");
723 fhEDecay->SetXTitle("E (GeV)");
724 outputContainer->Add(fhEDecay) ;
729 if( fFillSelectClHisto )
732 fhEDispersion = new TH2F
733 ("hEDispersion","Selected #pi^{0} (#eta) pairs: E vs dispersion",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
734 fhEDispersion->SetYTitle("D^{2}");
735 fhEDispersion->SetXTitle("E (GeV)");
736 outputContainer->Add(fhEDispersion) ;
738 fhELambda0 = new TH2F
739 ("hELambda0","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
740 fhELambda0->SetYTitle("#lambda_{0}^{2}");
741 fhELambda0->SetXTitle("E (GeV)");
742 outputContainer->Add(fhELambda0) ;
744 fhELambda1 = new TH2F
745 ("hELambda1","Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
746 fhELambda1->SetYTitle("#lambda_{1}^{2}");
747 fhELambda1->SetXTitle("E (GeV)");
748 outputContainer->Add(fhELambda1) ;
750 fhELambda0FracMaxCellCut = new TH2F
751 ("hELambda0FracMaxCellCut","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy < 0.5",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
752 fhELambda0FracMaxCellCut->SetYTitle("#lambda_{0}^{2}");
753 fhELambda0FracMaxCellCut->SetXTitle("E (GeV)");
754 outputContainer->Add(fhELambda0FracMaxCellCut) ;
756 fhEFracMaxCell = new TH2F
757 ("hEFracMaxCell","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy",nptbins,ptmin,ptmax,100,0,1);
758 fhEFracMaxCell->SetYTitle("Fraction");
759 fhEFracMaxCell->SetXTitle("E (GeV)");
760 outputContainer->Add(fhEFracMaxCell) ;
762 if(fCalorimeter=="EMCAL")
764 fhELambda0NoTRD = new TH2F
765 ("hELambda0NoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, not behind TRD",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
766 fhELambda0NoTRD->SetYTitle("#lambda_{0}^{2}");
767 fhELambda0NoTRD->SetXTitle("E (GeV)");
768 outputContainer->Add(fhELambda0NoTRD) ;
770 fhEFracMaxCellNoTRD = new TH2F
771 ("hEFracMaxCellNoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy, not behind TRD",nptbins,ptmin,ptmax,100,0,1);
772 fhEFracMaxCellNoTRD->SetYTitle("Fraction");
773 fhEFracMaxCellNoTRD->SetXTitle("E (GeV)");
774 outputContainer->Add(fhEFracMaxCellNoTRD) ;
776 if(!fFillOnlySimpleSSHisto)
778 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);
779 fhDispEtaE->SetXTitle("E (GeV)");
780 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
781 outputContainer->Add(fhDispEtaE);
783 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);
784 fhDispPhiE->SetXTitle("E (GeV)");
785 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
786 outputContainer->Add(fhDispPhiE);
788 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);
789 fhSumEtaE->SetXTitle("E (GeV)");
790 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
791 outputContainer->Add(fhSumEtaE);
793 fhSumPhiE = new TH2F ("hSumPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
794 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
795 fhSumPhiE->SetXTitle("E (GeV)");
796 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
797 outputContainer->Add(fhSumPhiE);
799 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
800 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
801 fhSumEtaPhiE->SetXTitle("E (GeV)");
802 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
803 outputContainer->Add(fhSumEtaPhiE);
805 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
806 nptbins,ptmin,ptmax,200, -10,10);
807 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
808 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
809 outputContainer->Add(fhDispEtaPhiDiffE);
811 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
812 nptbins,ptmin,ptmax, 200, -1,1);
813 fhSphericityE->SetXTitle("E (GeV)");
814 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
815 outputContainer->Add(fhSphericityE);
817 for(Int_t i = 0; i < 7; i++)
819 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]),
820 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
821 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
822 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
823 outputContainer->Add(fhDispEtaDispPhi[i]);
825 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]),
826 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
827 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
828 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
829 outputContainer->Add(fhLambda0DispEta[i]);
831 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]),
832 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
833 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
834 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
835 outputContainer->Add(fhLambda0DispPhi[i]);
841 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
842 nptbins,ptmin,ptmax,10,0,10);
843 fhNLocMax ->SetYTitle("N maxima");
844 fhNLocMax ->SetXTitle("E (GeV)");
845 outputContainer->Add(fhNLocMax) ;
847 for (Int_t i = 0; i < 3; i++)
849 fhELambda0LocMax[i] = new TH2F(Form("hELambda0LocMax%d",i+1),
850 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, %s",nlm[i].Data()),
851 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
852 fhELambda0LocMax[i]->SetYTitle("#lambda_{0}^{2}");
853 fhELambda0LocMax[i]->SetXTitle("E (GeV)");
854 outputContainer->Add(fhELambda0LocMax[i]) ;
856 fhELambda1LocMax[i] = new TH2F(Form("hELambda1LocMax%d",i+1),
857 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}, %s",nlm[i].Data()),
858 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
859 fhELambda1LocMax[i]->SetYTitle("#lambda_{1}^{2}");
860 fhELambda1LocMax[i]->SetXTitle("E (GeV)");
861 outputContainer->Add(fhELambda1LocMax[i]) ;
863 fhEDispersionLocMax[i] = new TH2F(Form("hEDispersionLocMax%d",i+1),
864 Form("Selected #pi^{0} (#eta) pairs: E vs dispersion^{2}, %s",nlm[i].Data()),
865 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
866 fhEDispersionLocMax[i]->SetYTitle("dispersion^{2}");
867 fhEDispersionLocMax[i]->SetXTitle("E (GeV)");
868 outputContainer->Add(fhEDispersionLocMax[i]) ;
870 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
872 fhEDispEtaLocMax[i] = new TH2F(Form("hEDispEtaLocMax%d",i+1),
873 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #eta}, %s",nlm[i].Data()),
874 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
875 fhEDispEtaLocMax[i]->SetYTitle("#sigma_{#eta #eta}");
876 fhEDispEtaLocMax[i]->SetXTitle("E (GeV)");
877 outputContainer->Add(fhEDispEtaLocMax[i]) ;
879 fhEDispPhiLocMax[i] = new TH2F(Form("hEDispPhiLocMax%d",i+1),
880 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi}, %s",nlm[i].Data()),
881 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
882 fhEDispPhiLocMax[i]->SetYTitle("#sigma_{#phi #phi}");
883 fhEDispPhiLocMax[i]->SetXTitle("E (GeV)");
884 outputContainer->Add(fhEDispPhiLocMax[i]) ;
886 fhESumEtaPhiLocMax[i] = new TH2F(Form("hESumEtaPhiLocMax%d",i+1),
887 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #phi}, %s",nlm[i].Data()),
888 nptbins,ptmin,ptmax,2*ssbins,-ssmax,ssmax);
889 fhESumEtaPhiLocMax[i]->SetYTitle("#sigma_{#eta #phi}");
890 fhESumEtaPhiLocMax[i]->SetXTitle("E (GeV)");
891 outputContainer->Add(fhESumEtaPhiLocMax[i]) ;
893 fhEDispEtaPhiDiffLocMax[i] = new TH2F(Form("hEDispEtaPhiDiffLocMax%d",i+1),
894 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta}, %s",nlm[i].Data()),
895 nptbins,ptmin,ptmax,200, -10,10);
896 fhEDispEtaPhiDiffLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta}");
897 fhEDispEtaPhiDiffLocMax[i]->SetXTitle("E (GeV)");
898 outputContainer->Add(fhEDispEtaPhiDiffLocMax[i]) ;
900 fhESphericityLocMax[i] = new TH2F(Form("hESphericityLocMax%d",i+1),
901 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta}), %s",nlm[i].Data()),
902 nptbins,ptmin,ptmax,200, -1,1);
903 fhESphericityLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta})");
904 fhESphericityLocMax[i]->SetXTitle("E (GeV)");
905 outputContainer->Add(fhESphericityLocMax[i]) ;
910 fhENCells = new TH2F ("hENCells","N cells in cluster vs E ", nptbins,ptmin,ptmax, nbins,nmin,nmax);
911 fhENCells->SetXTitle("E (GeV)");
912 fhENCells->SetYTitle("# of cells in cluster");
913 outputContainer->Add(fhENCells);
915 fhETime = new TH2F("hETime","cluster time vs pair E",nptbins,ptmin,ptmax, tbins,tmin,tmax);
916 fhETime->SetXTitle("E (GeV)");
917 fhETime->SetYTitle("t (ns)");
918 outputContainer->Add(fhETime);
922 if(fAnaType == kIMCalo)
924 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs E",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
925 fhEPairDiffTime->SetXTitle("E_{pair} (GeV)");
926 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
927 outputContainer->Add(fhEPairDiffTime);
929 TString combiName [] = {"1LocMax","2LocMax","NLocMax","1LocMax2LocMax","1LocMaxNLocMax","2LocMaxNLocMax","1LocMaxSSBad","NLocMaxSSGood"};
930 TString combiTitle[] = {"1 Local Maxima in both clusters","2 Local Maxima in both clusters","more than 2 Local Maxima in both clusters",
931 "1 Local Maxima paired with 2 Local Maxima","1 Local Maxima paired with more than 2 Local Maxima",
932 "2 Local Maxima paired with more than 2 Local Maxima",
933 "1 Local Maxima paired with #lambda_{0}^{2}>0.3","N Local Maxima paired with 0.1<#lambda_{0}^{2}<0.3"};
935 for (Int_t i = 0; i < 8 ; i++)
938 if (fAnaType == kIMCaloTracks && i > 2 ) continue ;
940 fhMassPairLocMax[i] = new TH2F
941 (Form("MassPairLocMax%s",combiName[i].Data()),
942 Form("Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}, %s", combiTitle[i].Data()),
943 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
944 fhMassPairLocMax[i]->SetYTitle("Mass (MeV/c^{2})");
945 fhMassPairLocMax[i]->SetXTitle("E_{pair} (GeV)");
946 outputContainer->Add(fhMassPairLocMax[i]) ;
952 fhTrackMatchedDEta = new TH2F
953 ("hTrackMatchedDEta",
954 "d#eta of cluster-track vs cluster energy",
955 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
956 fhTrackMatchedDEta->SetYTitle("d#eta");
957 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
959 fhTrackMatchedDPhi = new TH2F
960 ("hTrackMatchedDPhi",
961 "d#phi of cluster-track vs cluster energy",
962 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
963 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
964 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
966 fhTrackMatchedDEtaDPhi = new TH2F
967 ("hTrackMatchedDEtaDPhi",
968 "d#eta vs d#phi of cluster-track vs cluster energy",
969 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
970 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
971 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
973 outputContainer->Add(fhTrackMatchedDEta) ;
974 outputContainer->Add(fhTrackMatchedDPhi) ;
975 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
977 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
978 fhdEdx->SetXTitle("E (GeV)");
979 fhdEdx->SetYTitle("<dE/dx>");
980 outputContainer->Add(fhdEdx);
982 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
983 fhEOverP->SetXTitle("E (GeV)");
984 fhEOverP->SetYTitle("E/p");
985 outputContainer->Add(fhEOverP);
987 if(fCalorimeter=="EMCAL")
989 fhEOverPNoTRD = new TH2F ("hEOverPNoTRD","matched track E/p vs cluster E, SM not behind TRD ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
990 fhEOverPNoTRD->SetXTitle("E (GeV)");
991 fhEOverPNoTRD->SetYTitle("E/p");
992 outputContainer->Add(fhEOverPNoTRD);
995 if(IsDataMC() && fFillTMHisto)
997 fhTrackMatchedMCParticle = new TH2F
998 ("hTrackMatchedMCParticle",
999 "Origin of particle vs energy",
1000 nptbins,ptmin,ptmax,8,0,8);
1001 fhTrackMatchedMCParticle->SetXTitle("E (GeV)");
1002 //fhTrackMatchedMCParticle->SetYTitle("Particle type");
1004 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(1 ,"Photon");
1005 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(2 ,"Electron");
1006 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1007 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(4 ,"Rest");
1008 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1009 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1010 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1011 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1013 outputContainer->Add(fhTrackMatchedMCParticle);
1017 if(fFillWeightHistograms)
1019 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1020 nptbins,ptmin,ptmax, 100,0,1.);
1021 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1022 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
1023 outputContainer->Add(fhECellClusterRatio);
1025 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1026 nptbins,ptmin,ptmax, 100,-10,0);
1027 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1028 fhECellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1029 outputContainer->Add(fhECellClusterLogRatio);
1031 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1032 nptbins,ptmin,ptmax, 100,0,1.);
1033 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1034 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
1035 outputContainer->Add(fhEMaxCellClusterRatio);
1037 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1038 nptbins,ptmin,ptmax, 100,-10,0);
1039 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1040 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1041 outputContainer->Add(fhEMaxCellClusterLogRatio);
1043 for(Int_t iw = 0; iw < 14; iw++)
1045 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),
1046 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1047 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
1048 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
1049 outputContainer->Add(fhLambda0ForW0[iw]);
1051 // 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),
1052 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1053 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
1054 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
1055 // outputContainer->Add(fhLambda1ForW0[iw]);
1062 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC && fAnaType==kSSCalo)
1064 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",
1065 nptbins,ptmin,ptmax,200,0,2);
1066 fhMCPi0PtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1067 fhMCPi0PtGenRecoFraction->SetYTitle("E^{ #pi^{0} mother} / E^{rec}");
1068 outputContainer->Add(fhMCPi0PtGenRecoFraction) ;
1070 fhMCEtaPtGenRecoFraction = new TH2F("hMCEtaPtGenRecoFraction","Number of clusters from #eta (2 #gamma) identified as #pi^{0} (#eta),pT versus E primary #eta / E reco",
1071 nptbins,ptmin,ptmax,200,0,2);
1072 fhMCEtaPtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1073 fhMCEtaPtGenRecoFraction->SetYTitle("E^{ #eta mother} / E^{rec}");
1074 outputContainer->Add(fhMCEtaPtGenRecoFraction) ;
1076 fhMCPi0DecayPt = new TH1F("hMCPi0DecayPt","Number of #gamma from #pi^{0} decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1077 fhMCPi0DecayPt->SetYTitle("N");
1078 fhMCPi0DecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1079 outputContainer->Add(fhMCPi0DecayPt) ;
1081 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}",
1082 nptbins,ptmin,ptmax,100,0,1);
1083 fhMCPi0DecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1084 fhMCPi0DecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1085 outputContainer->Add(fhMCPi0DecayPtFraction) ;
1087 fhMCEtaDecayPt = new TH1F("hMCEtaDecayPt","Number of #gamma from #eta decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1088 fhMCEtaDecayPt->SetYTitle("N");
1089 fhMCEtaDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1090 outputContainer->Add(fhMCEtaDecayPt) ;
1092 fhMCEtaDecayPtFraction = new TH2F("hMCEtaDecayPtFraction","Number of #gamma from #eta decay identified as #pi^{0} (#eta), pT versus E primary #gamma / E primary #eta",
1093 nptbins,ptmin,ptmax,100,0,1);
1094 fhMCEtaDecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1095 fhMCEtaDecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1096 outputContainer->Add(fhMCEtaDecayPtFraction) ;
1098 fhMCOtherDecayPt = new TH1F("hMCOtherDecayPt","Number of #gamma decay (not #eta or #pi^{0}) identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1099 fhMCOtherDecayPt->SetYTitle("N");
1100 fhMCOtherDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1101 outputContainer->Add(fhMCOtherDecayPt) ;
1105 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
1106 GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1109 fhAnglePairMCPi0 = new TH2F
1111 "Angle between decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,250,0,0.5);
1112 fhAnglePairMCPi0->SetYTitle("#alpha (rad)");
1113 fhAnglePairMCPi0->SetXTitle("E_{pair} (GeV)");
1114 outputContainer->Add(fhAnglePairMCPi0) ;
1116 if (fAnaType!= kSSCalo)
1118 fhAnglePairMCEta = new TH2F
1120 "Angle between decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,250,0,0.5);
1121 fhAnglePairMCEta->SetYTitle("#alpha (rad)");
1122 fhAnglePairMCEta->SetXTitle("E_{pair} (GeV)");
1123 outputContainer->Add(fhAnglePairMCEta) ;
1125 fhMassPairMCPi0 = new TH2F
1127 "Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1128 fhMassPairMCPi0->SetYTitle("Mass (MeV/c^{2})");
1129 fhMassPairMCPi0->SetXTitle("E_{pair} (GeV)");
1130 outputContainer->Add(fhMassPairMCPi0) ;
1132 fhMassPairMCEta = new TH2F
1134 "Mass for decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1135 fhMassPairMCEta->SetYTitle("Mass (MeV/c^{2})");
1136 fhMassPairMCEta->SetXTitle("E_{pair} (GeV)");
1137 outputContainer->Add(fhMassPairMCEta) ;
1140 for(Int_t i = 0; i < 6; i++)
1144 (Form("hE_MC%s",pname[i].Data()),
1145 Form("Identified as #pi^{0} (#eta), cluster from %s",
1147 nptbins,ptmin,ptmax);
1148 fhMCE[i]->SetYTitle("N");
1149 fhMCE[i]->SetXTitle("E (GeV)");
1150 outputContainer->Add(fhMCE[i]) ;
1152 fhMCPt[i] = new TH1F
1153 (Form("hPt_MC%s",pname[i].Data()),
1154 Form("Identified as #pi^{0} (#eta), cluster from %s",
1156 nptbins,ptmin,ptmax);
1157 fhMCPt[i]->SetYTitle("N");
1158 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1159 outputContainer->Add(fhMCPt[i]) ;
1161 if(fAnaType == kSSCalo)
1163 fhMCEReject[i] = new TH1F
1164 (Form("hEReject_MC%s",pname[i].Data()),
1165 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1167 nptbins,ptmin,ptmax);
1168 fhMCEReject[i]->SetYTitle("N");
1169 fhMCEReject[i]->SetXTitle("E (GeV)");
1170 outputContainer->Add(fhMCEReject[i]) ;
1172 fhMCPtReject[i] = new TH1F
1173 (Form("hPtReject_MC%s",pname[i].Data()),
1174 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1176 nptbins,ptmin,ptmax);
1177 fhMCPtReject[i]->SetYTitle("N");
1178 fhMCPtReject[i]->SetXTitle("p_{T} (GeV/c)");
1179 outputContainer->Add(fhMCPtReject[i]) ;
1182 fhMCPhi[i] = new TH2F
1183 (Form("hPhi_MC%s",pname[i].Data()),
1184 Form("Identified as #pi^{0} (#eta), cluster from %s",ptype[i].Data()),
1185 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1186 fhMCPhi[i]->SetYTitle("#phi");
1187 fhMCPhi[i]->SetXTitle("p_{T} (GeV/c)");
1188 outputContainer->Add(fhMCPhi[i]) ;
1190 fhMCEta[i] = new TH2F
1191 (Form("hEta_MC%s",pname[i].Data()),
1192 Form("Identified as #pi^{0} (#eta), cluster from %s",
1193 ptype[i].Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
1194 fhMCEta[i]->SetYTitle("#eta");
1195 fhMCEta[i]->SetXTitle("p_{T} (GeV/c)");
1196 outputContainer->Add(fhMCEta[i]) ;
1199 if( fFillSelectClHisto )
1201 fhEMCLambda0[i] = new TH2F(Form("hELambda0_MC%s",pname[i].Data()),
1202 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}",ptype[i].Data()),
1203 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1204 fhEMCLambda0[i]->SetYTitle("#lambda_{0}^{2}");
1205 fhEMCLambda0[i]->SetXTitle("E (GeV)");
1206 outputContainer->Add(fhEMCLambda0[i]) ;
1208 fhEMCLambda1[i] = new TH2F(Form("hELambda1_MC%s",pname[i].Data()),
1209 Form("Selected pair, cluster from %s : E vs #lambda_{1}^{2}",ptype[i].Data()),
1210 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1211 fhEMCLambda1[i]->SetYTitle("#lambda_{1}^{2}");
1212 fhEMCLambda1[i]->SetXTitle("E (GeV)");
1213 outputContainer->Add(fhEMCLambda1[i]) ;
1215 fhEMCDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pname[i].Data()),
1216 Form("Selected pair, cluster from %s : E vs dispersion^{2}",ptype[i].Data()),
1217 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1218 fhEMCDispersion[i]->SetYTitle("D^{2}");
1219 fhEMCDispersion[i]->SetXTitle("E (GeV)");
1220 outputContainer->Add(fhEMCDispersion[i]) ;
1222 if(fCalorimeter=="EMCAL")
1224 fhEMCLambda0NoTRD[i] = new TH2F(Form("hELambda0NoTRD_MC%s",pname[i].Data()),
1225 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, NoTRD",ptype[i].Data()),
1226 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1227 fhEMCLambda0NoTRD[i]->SetYTitle("#lambda_{0}^{2}");
1228 fhEMCLambda0NoTRD[i]->SetXTitle("E (GeV)");
1229 outputContainer->Add(fhEMCLambda0NoTRD[i]) ;
1231 if(!fFillOnlySimpleSSHisto)
1233 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pname[i].Data()),
1234 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptype[i].Data()),
1235 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1236 fhMCEDispEta[i]->SetXTitle("E (GeV)");
1237 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1238 outputContainer->Add(fhMCEDispEta[i]);
1240 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pname[i].Data()),
1241 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptype[i].Data()),
1242 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1243 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
1244 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1245 outputContainer->Add(fhMCEDispPhi[i]);
1247 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pname[i].Data()),
1248 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()),
1249 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1250 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
1251 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
1252 outputContainer->Add(fhMCESumEtaPhi[i]);
1254 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pname[i].Data()),
1255 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptype[i].Data()),
1256 nptbins,ptmin,ptmax,200,-10,10);
1257 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
1258 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1259 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
1261 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pname[i].Data()),
1262 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()),
1263 nptbins,ptmin,ptmax, 200,-1,1);
1264 fhMCESphericity[i]->SetXTitle("E (GeV)");
1265 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1266 outputContainer->Add(fhMCESphericity[i]);
1268 for(Int_t ie = 0; ie < 7; ie++)
1270 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1271 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]),
1272 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1273 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1274 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1275 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
1277 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pname[i].Data()),
1278 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]),
1279 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1280 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
1281 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1282 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
1284 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1285 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]),
1286 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1287 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
1288 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1289 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
1295 fhEMCLambda0FracMaxCellCut[i] = new TH2F(Form("hELambda0FracMaxCellCut_MC%s",pname[i].Data()),
1296 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, Max cell fraction of energy < 0.5 ",ptype[i].Data()),
1297 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1298 fhEMCLambda0FracMaxCellCut[i]->SetYTitle("#lambda_{0}^{2}");
1299 fhEMCLambda0FracMaxCellCut[i]->SetXTitle("E (GeV)");
1300 outputContainer->Add(fhEMCLambda0FracMaxCellCut[i]) ;
1302 fhEMCFracMaxCell[i] = new TH2F(Form("hEFracMaxCell_MC%s",pname[i].Data()),
1303 Form("Selected pair, cluster from %s : E vs Max cell fraction of energy",ptype[i].Data()),
1304 nptbins,ptmin,ptmax,100,0,1);
1305 fhEMCFracMaxCell[i]->SetYTitle("Fraction");
1306 fhEMCFracMaxCell[i]->SetXTitle("E (GeV)");
1307 outputContainer->Add(fhEMCFracMaxCell[i]) ;
1310 } // shower shape histo
1315 if(fAnaType==kSSCalo)
1317 fhAsymmetry = new TH2F ("hAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1318 nptbins,ptmin,ptmax, 200, -1,1);
1319 fhAsymmetry->SetXTitle("E (GeV)");
1320 fhAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1321 outputContainer->Add(fhAsymmetry);
1323 fhSelectedAsymmetry = new TH2F ("hSelectedAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1324 nptbins,ptmin,ptmax, 200, -1,1);
1325 fhSelectedAsymmetry->SetXTitle("E (GeV)");
1326 fhSelectedAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1327 outputContainer->Add(fhSelectedAsymmetry);
1331 for(Int_t i = 0; i< 6; i++)
1333 fhMCEAsymmetry[i] = new TH2F (Form("hEAsymmetry_MC%s",pname[i].Data()),
1334 Form("cluster from %s : A = ( E1 - E2 ) / ( E1 + E2 ) vs E",ptype[i].Data()),
1335 nptbins,ptmin,ptmax, 200,-1,1);
1336 fhMCEAsymmetry[i]->SetXTitle("E (GeV)");
1337 fhMCEAsymmetry[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1338 outputContainer->Add(fhMCEAsymmetry[i]);
1343 if(fAnaType==kSSCalo && fFillSelectClHisto && !fFillOnlySimpleSSHisto )
1347 for(Int_t i = 0; i< 3; i++)
1349 fhEAsymmetryLocMax[i] = new TH2F(Form("hEAsymmetryLocMax%d",i+1),
1350 Form("Selected #pi^{0} (#eta) pairs: E vs A = ( E1 - E2 ) / ( E1 + E2 ), %s",nlm[i].Data()),
1351 nptbins,ptmin,ptmax,200, -1,1);
1352 fhEAsymmetryLocMax[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1353 fhEAsymmetryLocMax[i]->SetXTitle("E (GeV)");
1354 outputContainer->Add(fhEAsymmetryLocMax[i]) ;
1357 for(Int_t ie = 0; ie< 7; ie++)
1360 fhAsymmetryLambda0[ie] = new TH2F (Form("hAsymmetryLambda0_EBin%d",ie),
1361 Form("#lambda_{0}^{2} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1362 ssbins,ssmin,ssmax , 200,-1,1);
1363 fhAsymmetryLambda0[ie]->SetXTitle("#lambda_{0}^{2}");
1364 fhAsymmetryLambda0[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1365 outputContainer->Add(fhAsymmetryLambda0[ie]);
1367 fhAsymmetryDispEta[ie] = new TH2F (Form("hAsymmetryDispEta_EBin%d",ie),
1368 Form("#sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1369 ssbins,ssmin,ssmax , 200,-1,1);
1370 fhAsymmetryDispEta[ie]->SetXTitle("#sigma^{2}_{#eta #eta}");
1371 fhAsymmetryDispEta[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1372 outputContainer->Add(fhAsymmetryDispEta[ie]);
1374 fhAsymmetryDispPhi[ie] = new TH2F (Form("hAsymmetryDispPhi_EBin%d",ie),
1375 Form("#sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1376 ssbins,ssmin,ssmax , 200,-1,1);
1377 fhAsymmetryDispPhi[ie]->SetXTitle("#sigma^{2}_{#phi #phi}");
1378 fhAsymmetryDispPhi[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1379 outputContainer->Add(fhAsymmetryDispPhi[ie]);
1385 for(Int_t i = 0; i< 6; i++)
1387 for(Int_t ie = 0; ie < 7; ie++)
1389 fhMCAsymmetryLambda0[ie][i] = new TH2F (Form("hMCAsymmetryLambda0_EBin%d_MC%s",ie,pname[i].Data()),
1390 Form("cluster from %s : #lambda_{0}^{2} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1391 ssbins,ssmin,ssmax , 200,-1,1);
1392 fhMCAsymmetryLambda0[ie][i]->SetXTitle("#lambda_{0}^{2}");
1393 fhMCAsymmetryLambda0[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1394 outputContainer->Add(fhMCAsymmetryLambda0[ie][i]);
1396 fhMCAsymmetryDispEta[ie][i] = new TH2F (Form("hMCAsymmetryDispEta_EBin%d_MC%s",ie,pname[i].Data()),
1397 Form("cluster from %s : #sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1398 ssbins,ssmin,ssmax , 200,-1,1);
1399 fhMCAsymmetryDispEta[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1400 fhMCAsymmetryDispEta[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1401 outputContainer->Add(fhMCAsymmetryDispEta[ie][i]);
1403 fhMCAsymmetryDispPhi[ie][i] = new TH2F (Form("hMCAsymmetryDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1404 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1405 ssbins,ssmin,ssmax , 200,-1,1);
1406 fhMCAsymmetryDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#phi #phi}");
1407 fhMCAsymmetryDispPhi[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1408 outputContainer->Add(fhMCAsymmetryDispPhi[ie][i]);
1414 if(fFillPileUpHistograms)
1417 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1419 for(Int_t i = 0 ; i < 7 ; i++)
1421 fhPtPi0PileUp[i] = new TH1F(Form("hPtPi0PileUp%s",pileUpName[i].Data()),
1422 Form("Selected #pi^{0} (#eta) p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
1423 fhPtPi0PileUp[i]->SetXTitle("p_{T} (GeV/c)");
1424 outputContainer->Add(fhPtPi0PileUp[i]);
1427 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1428 fhTimeENoCut->SetXTitle("E (GeV)");
1429 fhTimeENoCut->SetYTitle("time (ns)");
1430 outputContainer->Add(fhTimeENoCut);
1432 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1433 fhTimeESPD->SetXTitle("E (GeV)");
1434 fhTimeESPD->SetYTitle("time (ns)");
1435 outputContainer->Add(fhTimeESPD);
1437 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1438 fhTimeESPDMulti->SetXTitle("E (GeV)");
1439 fhTimeESPDMulti->SetYTitle("time (ns)");
1440 outputContainer->Add(fhTimeESPDMulti);
1442 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1443 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
1444 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
1445 outputContainer->Add(fhTimeNPileUpVertSPD);
1447 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
1448 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
1449 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
1450 outputContainer->Add(fhTimeNPileUpVertTrack);
1452 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1453 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
1454 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
1455 outputContainer->Add(fhTimeNPileUpVertContributors);
1457 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);
1458 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
1459 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
1460 outputContainer->Add(fhTimePileUpMainVertexZDistance);
1462 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
1463 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
1464 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
1465 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
1469 //Keep neutral meson selection histograms if requiered
1470 //Setting done in AliNeutralMesonSelection
1472 if(fAnaType!=kSSCalo && GetNeutralMesonSelection())
1474 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
1476 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
1477 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
1482 return outputContainer ;
1486 //_____________________________________________
1487 Int_t AliAnaPi0EbE::GetMCIndex(const Int_t tag)
1490 // Assign mc index depending on MC bit set
1492 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1496 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
1500 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
1501 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1503 return kmcConversion ;
1504 }//conversion photon
1505 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) )
1508 }//photon no conversion
1509 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
1511 return kmcElectron ;
1520 //__________________________________________________________________
1521 void AliAnaPi0EbE::HasPairSameMCMother(AliAODPWG4Particle * photon1,
1522 AliAODPWG4Particle * photon2,
1523 Int_t & label, Int_t & tag)
1525 // Check the labels of pare in case mother was same pi0 or eta
1526 // Set the new AOD accordingly
1528 Int_t label1 = photon1->GetLabel();
1529 Int_t label2 = photon2->GetLabel();
1531 if(label1 < 0 || label2 < 0 ) return ;
1533 //Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader());
1534 //Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader());
1535 Int_t tag1 = photon1->GetTag();
1536 Int_t tag2 = photon2->GetTag();
1538 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
1539 if( (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
1540 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay) ) ||
1541 (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCEtaDecay) &&
1542 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCEtaDecay) )
1546 //Check if pi0/eta mother is the same
1547 if(GetReader()->ReadStack())
1551 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
1552 label1 = mother1->GetFirstMother();
1553 //mother1 = GetMCStack()->Particle(label1);//pi0
1557 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
1558 label2 = mother2->GetFirstMother();
1559 //mother2 = GetMCStack()->Particle(label2);//pi0
1562 else if(GetReader()->ReadAODMCParticles())
1563 {//&& (input > -1)){
1566 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label1);//photon in kine tree
1567 label1 = mother1->GetMother();
1568 //mother1 = GetMCStack()->Particle(label1);//pi0
1572 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label2);//photon in kine tree
1573 label2 = mother2->GetMother();
1574 //mother2 = GetMCStack()->Particle(label2);//pi0
1578 //printf("mother1 %d, mother2 %d\n",label1,label2);
1579 if( label1 == label2 && label1>=0 )
1584 TLorentzVector mom1 = *(photon1->Momentum());
1585 TLorentzVector mom2 = *(photon2->Momentum());
1587 Double_t angle = mom2.Angle(mom1.Vect());
1588 Double_t mass = (mom1+mom2).M();
1589 Double_t epair = (mom1+mom2).E();
1591 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay))
1593 fhMassPairMCPi0 ->Fill(epair,mass);
1594 fhAnglePairMCPi0->Fill(epair,angle);
1595 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
1599 fhMassPairMCEta ->Fill(epair,mass);
1600 fhAnglePairMCEta->Fill(epair,angle);
1601 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCEta);
1605 } // both from eta or pi0 decay
1609 //____________________________________________________________________________
1610 void AliAnaPi0EbE::Init()
1614 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
1615 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
1618 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
1619 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
1625 //____________________________________________________________________________
1626 void AliAnaPi0EbE::InitParameters()
1628 //Initialize the parameters of the analysis.
1629 AddToHistogramsName("AnaPi0EbE_");
1631 fInputAODGammaConvName = "PhotonsCTS" ;
1632 fAnaType = kIMCalo ;
1633 fCalorimeter = "EMCAL" ;
1640 //__________________________________________________________________
1641 void AliAnaPi0EbE::MakeAnalysisFillAOD()
1643 //Do analysis and fill aods
1648 MakeInvMassInCalorimeter();
1652 MakeShowerShapeIdentification();
1656 MakeInvMassInCalorimeterAndCTS();
1662 //____________________________________________
1663 void AliAnaPi0EbE::MakeInvMassInCalorimeter()
1665 //Do analysis and fill aods
1666 //Search for the photon decay in calorimeters
1667 //Read photon list from AOD, produced in class AliAnaPhoton
1668 //Check if 2 photons have the mass of the pi0.
1670 TLorentzVector mom1;
1671 TLorentzVector mom2;
1672 TLorentzVector mom ;
1677 if(!GetInputAODBranch()){
1678 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
1682 //Get shower shape information of clusters
1683 TObjArray *clusters = 0;
1684 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1685 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1687 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast()-1; iphoton++){
1688 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1690 //Vertex cut in case of mixed events
1691 Int_t evtIndex1 = 0 ;
1693 evtIndex1 = GetMixedEvent()->EventIndexForCaloCluster(photon1->GetCaloLabel(0)) ;
1694 if(TMath::Abs(GetVertex(evtIndex1)[2]) > GetZvertexCut()) continue ; //vertex cut
1695 mom1 = *(photon1->Momentum());
1697 //Get original cluster, to recover some information
1699 AliVCluster *cluster1 = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1702 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - First cluster not found\n");
1706 for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast(); jphoton++)
1708 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(jphoton));
1710 Int_t evtIndex2 = 0 ;
1712 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1714 if(GetMixedEvent() && (evtIndex1 == evtIndex2))
1717 if(TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut()) continue ; //vertex cut
1719 mom2 = *(photon2->Momentum());
1721 //Get original cluster, to recover some information
1723 AliVCluster *cluster2 = FindCluster(clusters,photon2->GetCaloLabel(0),iclus2,iclus+1);
1727 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Second cluster not found\n");
1731 Float_t e1 = photon1->E();
1732 Float_t e2 = photon2->E();
1734 //Select clusters with good time window difference
1735 Float_t tof1 = cluster1->GetTOF()*1e9;;
1736 Float_t tof2 = cluster2->GetTOF()*1e9;;
1737 Double_t t12diff = tof1-tof2;
1738 fhEPairDiffTime->Fill(e1+e2, t12diff);
1739 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
1741 //Play with the MC stack if available
1742 if(IsDataMC()) HasPairSameMCMother(photon1, photon2, label, tag) ;
1744 // Check the invariant mass for different selection on the local maxima
1745 // Name of AOD method TO BE FIXED
1746 Int_t nMaxima1 = photon1->GetFiducialArea();
1747 Int_t nMaxima2 = photon2->GetFiducialArea();
1749 Double_t mass = (mom1+mom2).M();
1750 Double_t epair = (mom1+mom2).E();
1752 if(nMaxima1==nMaxima2)
1754 if (nMaxima1==1) fhMassPairLocMax[0]->Fill(epair,mass);
1755 else if(nMaxima1==2) fhMassPairLocMax[1]->Fill(epair,mass);
1756 else fhMassPairLocMax[2]->Fill(epair,mass);
1758 else if(nMaxima1==1 || nMaxima2==1)
1760 if (nMaxima1==2 || nMaxima2==2) fhMassPairLocMax[3]->Fill(epair,mass);
1761 else fhMassPairLocMax[4]->Fill(epair,mass);
1764 fhMassPairLocMax[5]->Fill(epair,mass);
1766 // combinations with SS axis cut and NLM cut
1767 if(nMaxima1 == 1 && cluster2->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1768 if(nMaxima2 == 1 && cluster1->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1769 if(nMaxima1 > 1 && cluster2->GetM02() < 0.3 && cluster2->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1770 if(nMaxima2 > 1 && cluster1->GetM02() < 0.3 && cluster1->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1772 //Skip events with too few or too many NLM
1773 if((nMaxima1 < fNLMCutMin || nMaxima1 > fNLMCutMax) || (nMaxima2 < fNLMCutMin || nMaxima2 > fNLMCutMax)) continue ;
1775 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - NLM of out of range: cluster1 %d, cluster2 %d \n",nMaxima1, nMaxima2);
1778 fhMass->Fill(epair,(mom1+mom2).M());
1780 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1781 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1784 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());
1786 //Fill some histograms about shower shape
1787 if(fFillSelectClHisto && clusters && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1789 FillSelectedClusterHistograms(cluster1, nMaxima1, photon1->GetTag());
1790 FillSelectedClusterHistograms(cluster2, nMaxima2, photon2->GetTag());
1793 // Tag both photons as decay
1794 photon1->SetTagged(kTRUE);
1795 photon2->SetTagged(kTRUE);
1797 fhPtDecay->Fill(photon1->Pt());
1798 fhEDecay ->Fill(photon1->E() );
1800 fhPtDecay->Fill(photon2->Pt());
1801 fhEDecay ->Fill(photon2->E() );
1803 //Create AOD for analysis
1806 //Mass of selected pairs
1807 fhSelectedMass->Fill(epair,mom.M());
1809 // Fill histograms to undertand pile-up before other cuts applied
1810 // Remember to relax time cuts in the reader
1811 FillPileUpHistograms(mom.E(),((cluster1->GetTOF()+cluster2->GetTOF())*1e9) /2);
1813 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1815 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1816 pi0.SetDetector(photon1->GetDetector());
1819 pi0.SetLabel(label);
1822 //Set the indeces of the original caloclusters
1823 pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0));
1824 //pi0.SetInputFileIndex(input);
1826 AddAODParticle(pi0);
1834 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - End fill AODs \n");
1838 //__________________________________________________
1839 void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
1841 //Do analysis and fill aods
1842 //Search for the photon decay in calorimeters
1843 //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion
1844 //Check if 2 photons have the mass of the pi0.
1846 TLorentzVector mom1;
1847 TLorentzVector mom2;
1848 TLorentzVector mom ;
1853 // Check calorimeter input
1854 if(!GetInputAODBranch()){
1855 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data());
1859 // Get the array with conversion photons
1860 TClonesArray * inputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName);
1861 if(!inputAODGammaConv) {
1863 inputAODGammaConv = (TClonesArray *) GetReader()->GetInputEvent()->FindListObject(fInputAODGammaConvName);
1865 if(!inputAODGammaConv) {
1866 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input gamma conversions in AOD branch with name < %s >\n",fInputAODGammaConvName.Data());
1872 //Get shower shape information of clusters
1873 TObjArray *clusters = 0;
1874 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1875 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1877 Int_t nCTS = inputAODGammaConv->GetEntriesFast();
1878 Int_t nCalo = GetInputAODBranch()->GetEntriesFast();
1879 if(nCTS<=0 || nCalo <=0)
1881 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - nCalo %d, nCTS %d, cannot loop\n",nCalo,nCTS);
1886 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Number of conversion photons %d\n",nCTS);
1888 // Do the loop, first calo, second CTS
1889 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){
1890 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1891 mom1 = *(photon1->Momentum());
1893 //Get original cluster, to recover some information
1895 AliVCluster *cluster = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1897 for(Int_t jphoton = 0; jphoton < nCTS; jphoton++){
1898 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (inputAODGammaConv->At(jphoton));
1900 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1901 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
1903 mom2 = *(photon2->Momentum());
1905 Double_t mass = (mom1+mom2).M();
1906 Double_t epair = (mom1+mom2).E();
1908 Int_t nMaxima = photon1->GetFiducialArea();
1909 if (nMaxima==1) fhMassPairLocMax[0]->Fill(epair,mass);
1910 else if(nMaxima==2) fhMassPairLocMax[1]->Fill(epair,mass);
1911 else fhMassPairLocMax[2]->Fill(epair,mass);
1913 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) continue ;
1914 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - NLM %d of out of range \n",nMaxima);
1916 //Play with the MC stack if available
1919 Int_t label2 = photon2->GetLabel();
1920 if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader()));
1922 HasPairSameMCMother(photon1, photon2, label, tag) ;
1925 //Mass of selected pairs
1926 fhMass->Fill(epair,(mom1+mom2).M());
1928 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1929 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1931 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());
1933 //Fill some histograms about shower shape
1934 if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1936 FillSelectedClusterHistograms(cluster, nMaxima, photon1->GetTag());
1939 // Tag both photons as decay
1940 photon1->SetTagged(kTRUE);
1941 photon2->SetTagged(kTRUE);
1943 fhPtDecay->Fill(photon1->Pt());
1944 fhEDecay ->Fill(photon1->E() );
1946 //Create AOD for analysis
1950 //Mass of selected pairs
1951 fhSelectedMass->Fill(epair,mom.M());
1953 // Fill histograms to undertand pile-up before other cuts applied
1954 // Remember to relax time cuts in the reader
1955 if(cluster)FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);
1957 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1959 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1960 pi0.SetDetector(photon1->GetDetector());
1963 pi0.SetLabel(label);
1966 //Set the indeces of the original tracks or caloclusters
1967 pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1);
1968 pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1));
1969 //pi0.SetInputFileIndex(input);
1971 AddAODParticle(pi0);
1978 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - End fill AODs \n");
1983 //_________________________________________________
1984 void AliAnaPi0EbE::MakeShowerShapeIdentification()
1986 //Search for pi0 in fCalorimeter with shower shape analysis
1988 TObjArray * pl = 0x0;
1989 AliVCaloCells * cells = 0x0;
1990 //Select the Calorimeter of the photon
1991 if (fCalorimeter == "PHOS" )
1993 pl = GetPHOSClusters();
1994 cells = GetPHOSCells();
1996 else if (fCalorimeter == "EMCAL")
1998 pl = GetEMCALClusters();
1999 cells = GetEMCALCells();
2004 Info("MakeShowerShapeIdentification","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2008 TLorentzVector mom ;
2009 for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++)
2011 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2013 Int_t evtIndex = 0 ;
2014 if (GetMixedEvent())
2016 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2019 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
2021 //Get Momentum vector,
2022 Double_t vertex[]={0,0,0};
2023 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2025 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
2026 }//Assume that come from vertex in straight line
2029 calo->GetMomentum(mom,vertex) ;
2032 //If too small or big pt, skip it
2033 if(mom.E() < GetMinEnergy() || mom.E() > GetMaxEnergy() ) continue ;
2035 //Check acceptance selection
2036 if(IsFiducialCutOn())
2038 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2039 if(! in ) continue ;
2043 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());
2045 //Check Distance to Bad channel, set bit.
2046 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2047 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
2048 if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
2051 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
2053 //.......................................
2054 // TOF cut, BE CAREFUL WITH THIS CUT
2055 Double_t tof = calo->GetTOF()*1e9;
2056 if(tof < fTimeCutMin || tof > fTimeCutMax) continue ;
2058 //Play with the MC stack if available
2059 //Check origin of the candidates
2063 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
2064 //GetMCAnalysisUtils()->CheckMultipleOrigin(calo->GetLabels(),calo->GetNLabels(), GetReader(), aodpi0.GetInputFileIndex(), tag);
2065 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",tag);
2068 //Skip matched clusters with tracks
2069 if(IsTrackMatched(calo, GetReader()->GetInputEvent()))
2071 FillRejectedClusterHistograms(mom,tag);
2077 //PID selection or bit setting
2079 Double_t mass = 0 , angle = 0;
2080 Double_t e1 = 0 , e2 = 0;
2081 Int_t idPartType = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(calo,cells,GetCaloUtils(),
2082 GetVertex(evtIndex),nMaxima,
2085 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",idPartType);
2088 //Skip events with too few or too many NLM
2089 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax)
2091 FillRejectedClusterHistograms(mom,tag);
2096 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - NLM %d accepted \n",nMaxima);
2098 //mass of all clusters
2099 fhMass->Fill(mom.E(),mass);
2101 // Asymmetry of all clusters
2103 if(e1+e2 > 0) asy = (e1-e2) / (e1+e2);
2104 fhAsymmetry->Fill(mom.E(),asy);
2108 Int_t mcIndex = GetMCIndex(tag);
2109 fhMCEAsymmetry[mcIndex]->Fill(mom.E(),asy);
2112 // If cluster does not pass pid, not pi0/eta, skip it.
2113 if (GetOutputAODName().Contains("Pi0") && idPartType != AliCaloPID::kPi0)
2115 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Pi0\n");
2116 FillRejectedClusterHistograms(mom,tag);
2120 else if(GetOutputAODName().Contains("Eta") && idPartType != AliCaloPID::kEta)
2122 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Eta\n");
2123 FillRejectedClusterHistograms(mom,tag);
2128 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
2129 mom.Pt(), idPartType);
2131 //Mass and asymmetry of selected pairs
2132 fhSelectedAsymmetry->Fill(mom.E(),asy);
2133 fhSelectedMass ->Fill(mom.E(),mass);
2135 //-----------------------
2136 //Create AOD for analysis
2138 AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
2139 aodpi0.SetLabel(calo->GetLabel());
2141 //Set the indeces of the original caloclusters
2142 aodpi0.SetCaloLabel(calo->GetID(),-1);
2143 aodpi0.SetDetector(fCalorimeter);
2145 if (distBad > fMinDist3) aodpi0.SetDistToBad(2) ;
2146 else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ;
2147 else aodpi0.SetDistToBad(0) ;
2149 // Check if cluster is pi0 via cluster splitting
2150 aodpi0.SetIdentifiedParticleType(idPartType);
2152 // Add number of local maxima to AOD, method name in AOD to be FIXED
2153 aodpi0.SetFiducialArea(nMaxima);
2157 //Fill some histograms about shower shape
2158 if(fFillSelectClHisto && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2160 FillSelectedClusterHistograms(calo, nMaxima, tag, asy);
2163 // Fill histograms to undertand pile-up before other cuts applied
2164 // Remember to relax time cuts in the reader
2165 FillPileUpHistograms(calo->E(),calo->GetTOF()*1e9);
2167 //Add AOD with pi0 object to aod branch
2168 AddAODParticle(aodpi0);
2172 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
2175 //______________________________________________
2176 void AliAnaPi0EbE::MakeAnalysisFillHistograms()
2178 //Do analysis and fill histograms
2180 if(!GetOutputAODBranch())
2182 printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
2185 //Loop on stored AOD pi0
2186 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2187 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2189 Float_t cen = GetEventCentrality();
2190 Float_t ep = GetEventPlaneAngle();
2192 for(Int_t iaod = 0; iaod < naod ; iaod++)
2195 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2196 Int_t pdg = pi0->GetIdentifiedParticleType();
2198 if(IsCaloPIDOn() && pdg != AliCaloPID::kPi0) continue;
2200 //Fill pi0 histograms
2201 Float_t ener = pi0->E();
2202 Float_t pt = pi0->Pt();
2203 Float_t phi = pi0->Phi();
2204 if(phi < 0) phi+=TMath::TwoPi();
2205 Float_t eta = pi0->Eta();
2210 fhEEta ->Fill(ener,eta);
2211 fhEPhi ->Fill(ener,phi);
2212 fhEtaPhi ->Fill(eta ,phi);
2214 fhPtCentrality ->Fill(pt,cen) ;
2215 fhPtEventPlane ->Fill(pt,ep ) ;
2217 if(fFillPileUpHistograms)
2219 if(GetReader()->IsPileUpFromSPD()) fhPtPi0PileUp[0]->Fill(pt);
2220 if(GetReader()->IsPileUpFromEMCal()) fhPtPi0PileUp[1]->Fill(pt);
2221 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPi0PileUp[2]->Fill(pt);
2222 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPi0PileUp[3]->Fill(pt);
2223 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPi0PileUp[4]->Fill(pt);
2224 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPi0PileUp[5]->Fill(pt);
2225 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPi0PileUp[6]->Fill(pt);
2231 Int_t tag = pi0->GetTag();
2232 Int_t mcIndex = GetMCIndex(tag);
2234 fhMCE [mcIndex] ->Fill(ener);
2235 fhMCPt [mcIndex] ->Fill(pt);
2236 fhMCPhi[mcIndex] ->Fill(pt,phi);
2237 fhMCEta[mcIndex] ->Fill(pt,eta);
2239 if((mcIndex==kmcPhoton || mcIndex==kmcPi0 || mcIndex==kmcEta) && fAnaType==kSSCalo)
2241 Float_t efracMC = 0;
2242 Int_t label = pi0->GetLabel();
2245 TLorentzVector mom = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2248 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
2250 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2251 if(grandmom.E() > 0 && ok)
2253 efracMC = grandmom.E()/ener;
2254 fhMCPi0PtGenRecoFraction ->Fill(pt,efracMC);
2257 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
2259 fhMCPi0DecayPt->Fill(pt);
2260 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2261 if(grandmom.E() > 0 && ok)
2263 efracMC = mom.E()/grandmom.E();
2264 fhMCPi0DecayPtFraction ->Fill(pt,efracMC);
2267 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
2269 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2270 if(grandmom.E() > 0 && ok)
2272 efracMC = grandmom.E()/ener;
2273 fhMCEtaPtGenRecoFraction ->Fill(pt,efracMC);
2276 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
2278 fhMCEtaDecayPt->Fill(pt);
2279 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2280 if(grandmom.E() > 0 && ok)
2282 efracMC = mom.E()/grandmom.E();
2283 fhMCEtaDecayPtFraction ->Fill(pt,efracMC);
2286 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
2288 fhMCOtherDecayPt->Fill(pt);
2293 }//Histograms with MC
2299 //__________________________________________________________________
2300 void AliAnaPi0EbE::Print(const Option_t * opt) const
2302 //Print some relevant parameters set for the analysis
2306 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2307 AliAnaCaloTrackCorrBaseClass::Print("");
2308 printf("Analysis Type = %d \n", fAnaType) ;
2309 if(fAnaType == kSSCalo){
2310 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2311 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2312 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2313 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);