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(),
82 fhMCPi0PtGenRecoFraction(0), fhMCEtaPtGenRecoFraction(0),
83 fhMCPi0DecayPt(0), fhMCPi0DecayPtFraction(0),
84 fhMCEtaDecayPt(0), fhMCEtaDecayPtFraction(0),
86 fhMassPairMCPi0(0), fhMassPairMCEta(0),
87 fhAnglePairMCPi0(0), fhAnglePairMCEta(0),
89 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
90 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
91 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
92 fhTrackMatchedMCParticle(0), fhdEdx(0),
93 fhEOverP(0), fhEOverPNoTRD(0),
94 // Number of local maxima in cluster
97 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
98 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
99 fhTimeNPileUpVertContributors(0),
100 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0)
104 for(Int_t i = 0; i < 6; i++)
110 fhMCPtCentrality [i] = 0;
112 fhEMCLambda0 [i] = 0;
113 fhEMCLambda0NoTRD [i] = 0;
114 fhEMCLambda0FracMaxCellCut[i]= 0;
115 fhEMCFracMaxCell [i] = 0;
116 fhEMCLambda1 [i] = 0;
117 fhEMCDispersion [i] = 0;
119 fhMCEDispEta [i] = 0;
120 fhMCEDispPhi [i] = 0;
121 fhMCESumEtaPhi [i] = 0;
122 fhMCEDispEtaPhiDiff[i] = 0;
123 fhMCESphericity [i] = 0;
124 fhMCEAsymmetry [i] = 0;
126 for(Int_t j = 0; j < 7; j++)
128 fhMCLambda0DispEta [j][i] = 0;
129 fhMCLambda0DispPhi [j][i] = 0;
130 fhMCDispEtaDispPhi [j][i] = 0;
131 fhMCAsymmetryLambda0 [j][i] = 0;
132 fhMCAsymmetryDispEta [j][i] = 0;
133 fhMCAsymmetryDispPhi [j][i] = 0;
137 for(Int_t j = 0; j < 7; j++)
139 fhLambda0DispEta [j] = 0;
140 fhLambda0DispPhi [j] = 0;
141 fhDispEtaDispPhi [j] = 0;
142 fhAsymmetryLambda0 [j] = 0;
143 fhAsymmetryDispEta [j] = 0;
144 fhAsymmetryDispPhi [j] = 0;
146 fhPtPi0PileUp [j] = 0;
149 for(Int_t i = 0; i < 3; i++)
151 fhELambda0LocMax [i] = 0;
152 fhELambda1LocMax [i] = 0;
153 fhEDispersionLocMax [i] = 0;
154 fhEDispEtaLocMax [i] = 0;
155 fhEDispPhiLocMax [i] = 0;
156 fhESumEtaPhiLocMax [i] = 0;
157 fhEDispEtaPhiDiffLocMax[i] = 0;
158 fhESphericityLocMax [i] = 0;
159 fhEAsymmetryLocMax [i] = 0;
163 for(Int_t i =0; i < 14; i++){
164 fhLambda0ForW0[i] = 0;
165 //fhLambda1ForW0[i] = 0;
166 if(i<8)fhMassPairLocMax[i] = 0;
169 //Initialize parameters
174 //_______________________________________________________________________________
175 void AliAnaPi0EbE::FillPileUpHistograms(const Float_t energy, const Float_t time)
177 // Fill some histograms to understand pile-up
178 if(!fFillPileUpHistograms) return;
180 //printf("E %f, time %f\n",energy,time);
181 AliVEvent * event = GetReader()->GetInputEvent();
183 fhTimeENoCut->Fill(energy,time);
184 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
185 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
187 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
189 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
190 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
192 // N pile up vertices
193 Int_t nVerticesSPD = -1;
194 Int_t nVerticesTracks = -1;
198 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
199 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
204 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
205 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
208 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
209 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
211 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
212 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
215 Float_t z1 = -1, z2 = -1;
217 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
221 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
222 ncont=pv->GetNContributors();
223 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
225 diamZ = esdEv->GetDiamondZ();
229 AliAODVertex *pv=aodEv->GetVertex(iVert);
230 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
231 ncont=pv->GetNContributors();
232 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
234 diamZ = aodEv->GetDiamondZ();
237 Double_t distZ = TMath::Abs(z2-z1);
238 diamZ = TMath::Abs(z2-diamZ);
240 fhTimeNPileUpVertContributors ->Fill(time,ncont);
241 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
242 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
248 //___________________________________________________________________________________________
249 void AliAnaPi0EbE::FillRejectedClusterHistograms(const TLorentzVector mom, const Int_t mctag)
251 // Fill histograms that do not pass the identification (SS case only)
253 Float_t ener = mom.E();
254 Float_t pt = mom.Pt();
255 Float_t phi = mom.Phi();
256 if(phi < 0) phi+=TMath::TwoPi();
257 Float_t eta = mom.Eta();
259 fhPtReject ->Fill(pt);
260 fhEReject ->Fill(ener);
262 fhEEtaReject ->Fill(ener,eta);
263 fhEPhiReject ->Fill(ener,phi);
264 fhEtaPhiReject ->Fill(eta,phi);
268 Int_t mcIndex = GetMCIndex(mctag);
269 fhMCEReject [mcIndex] ->Fill(ener);
270 fhMCPtReject [mcIndex] ->Fill(pt);
274 //_____________________________________________________________________________________
275 void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster,
280 // Fill shower shape, timing and other histograms for selected clusters from decay
282 Float_t e = cluster->E();
283 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
284 Float_t l0 = cluster->GetM02();
285 Float_t l1 = cluster->GetM20();
286 Int_t nSM = GetModuleNumber(cluster);
289 if (e < 2 ) ebin = 0;
290 else if (e < 4 ) ebin = 1;
291 else if (e < 6 ) ebin = 2;
292 else if (e < 10) ebin = 3;
293 else if (e < 15) ebin = 4;
294 else if (e < 20) ebin = 5;
298 if (nMaxima==1) indexMax = 0 ;
299 else if(nMaxima==2) indexMax = 1 ;
303 AliVCaloCells * cell = 0x0;
304 if(fCalorimeter == "PHOS")
305 cell = GetPHOSCells();
307 cell = GetEMCALCells();
309 Float_t maxCellFraction = 0;
310 GetCaloUtils()->GetMaxEnergyCell(cell, cluster, maxCellFraction);
311 fhEFracMaxCell->Fill(e,maxCellFraction);
313 FillWeightHistograms(cluster);
315 fhEDispersion->Fill(e, disp);
316 fhELambda0 ->Fill(e, l0 );
317 fhELambda1 ->Fill(e, l1 );
319 Float_t ll0 = 0., ll1 = 0.;
320 Float_t dispp= 0., dEta = 0., dPhi = 0.;
321 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
322 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
324 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
325 ll0, ll1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
327 fhDispEtaE -> Fill(e,dEta);
328 fhDispPhiE -> Fill(e,dPhi);
329 fhSumEtaE -> Fill(e,sEta);
330 fhSumPhiE -> Fill(e,sPhi);
331 fhSumEtaPhiE -> Fill(e,sEtaPhi);
332 fhDispEtaPhiDiffE -> Fill(e,dPhi-dEta);
333 if(dEta+dPhi>0)fhSphericityE -> Fill(e,(dPhi-dEta)/(dEta+dPhi));
335 fhDispEtaDispPhi[ebin]->Fill(dEta,dPhi);
336 fhLambda0DispEta[ebin]->Fill(l0 ,dEta);
337 fhLambda0DispPhi[ebin]->Fill(l0 ,dPhi);
339 if (fAnaType==kSSCalo)
341 // Asymmetry histograms
342 fhAsymmetryLambda0[ebin]->Fill(l0 ,asy);
343 fhAsymmetryDispEta[ebin]->Fill(dEta,asy);
344 fhAsymmetryDispPhi[ebin]->Fill(dPhi,asy);
348 fhNLocMax->Fill(e,nMaxima);
350 fhELambda0LocMax [indexMax]->Fill(e,l0);
351 fhELambda1LocMax [indexMax]->Fill(e,l1);
352 fhEDispersionLocMax[indexMax]->Fill(e,disp);
354 if(fCalorimeter=="EMCAL" && !fFillOnlySimpleSSHisto)
356 fhEDispEtaLocMax [indexMax]-> Fill(e,dEta);
357 fhEDispPhiLocMax [indexMax]-> Fill(e,dPhi);
358 fhESumEtaPhiLocMax [indexMax]-> Fill(e,sEtaPhi);
359 fhEDispEtaPhiDiffLocMax[indexMax]-> Fill(e,dPhi-dEta);
360 if(dEta+dPhi>0) fhESphericityLocMax[indexMax]->Fill(e,(dPhi-dEta)/(dEta+dPhi));
361 if(fAnaType==kSSCalo) fhEAsymmetryLocMax [indexMax]->Fill(e ,asy);
365 if(fCalorimeter=="EMCAL" && nSM < 6)
367 fhELambda0NoTRD->Fill(e, l0 );
368 fhEFracMaxCellNoTRD->Fill(e,maxCellFraction);
371 if(maxCellFraction < 0.5)
372 fhELambda0FracMaxCellCut->Fill(e, l0 );
374 fhETime ->Fill(e, cluster->GetTOF()*1.e9);
375 fhENCells->Fill(e, cluster->GetNCells());
377 // Fill Track matching control histograms
380 Float_t dZ = cluster->GetTrackDz();
381 Float_t dR = cluster->GetTrackDx();
383 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
385 dR = 2000., dZ = 2000.;
386 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
388 //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
390 if(fhTrackMatchedDEta && TMath::Abs(dR) < 999)
392 fhTrackMatchedDEta->Fill(e,dZ);
393 fhTrackMatchedDPhi->Fill(e,dR);
394 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
397 // Check dEdx and E/p of matched clusters
399 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
401 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
405 Float_t dEdx = track->GetTPCsignal();
406 fhdEdx->Fill(e, dEdx);
408 Float_t eOverp = e/track->P();
409 fhEOverP->Fill(e, eOverp);
411 if(fCalorimeter=="EMCAL" && nSM < 6) fhEOverPNoTRD->Fill(e, eOverp);
415 // printf("AliAnaPi0EbE::FillSelectedClusterHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
421 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
423 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
424 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 2.5 );
425 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 0.5 );
426 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 1.5 );
427 else fhTrackMatchedMCParticle->Fill(e, 3.5 );
432 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
433 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 6.5 );
434 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 4.5 );
435 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 5.5 );
436 else fhTrackMatchedMCParticle->Fill(e, 7.5 );
440 }// Track matching histograms
444 Int_t mcIndex = GetMCIndex(tag);
446 fhEMCLambda0[mcIndex] ->Fill(e, l0);
447 fhEMCLambda1[mcIndex] ->Fill(e, l1);
448 fhEMCDispersion[mcIndex] ->Fill(e, disp);
449 fhEMCFracMaxCell[mcIndex]->Fill(e,maxCellFraction);
451 if(fCalorimeter=="EMCAL" && nSM < 6)
452 fhEMCLambda0NoTRD[mcIndex]->Fill(e, l0 );
454 if(maxCellFraction < 0.5)
455 fhEMCLambda0FracMaxCellCut[mcIndex]->Fill(e, l0 );
457 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
459 fhMCEDispEta [mcIndex]-> Fill(e,dEta);
460 fhMCEDispPhi [mcIndex]-> Fill(e,dPhi);
461 fhMCESumEtaPhi [mcIndex]-> Fill(e,sEtaPhi);
462 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(e,dPhi-dEta);
463 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(e,(dPhi-dEta)/(dEta+dPhi));
465 if (fAnaType==kSSCalo)
467 fhMCAsymmetryLambda0[ebin][mcIndex]->Fill(l0 ,asy);
468 fhMCAsymmetryDispEta[ebin][mcIndex]->Fill(dEta,asy);
469 fhMCAsymmetryDispPhi[ebin][mcIndex]->Fill(dPhi,asy);
472 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta,dPhi);
473 fhMCLambda0DispEta[ebin][mcIndex]->Fill(l0 ,dEta);
474 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(l0 ,dPhi);
482 //________________________________________________________
483 void AliAnaPi0EbE::FillWeightHistograms(AliVCluster *clus)
485 // Calculate weights and fill histograms
487 if(!fFillWeightHistograms || GetMixedEvent()) return;
489 AliVCaloCells* cells = 0;
490 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
491 else cells = GetPHOSCells();
493 // First recalculate energy in case non linearity was applied
496 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
499 Int_t id = clus->GetCellsAbsId()[ipos];
501 //Recalibrate cell energy if needed
502 Float_t amp = cells->GetCellAmplitude(id);
503 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
514 printf("AliAnaPi0EbE::WeightHistograms()- Wrong calculated energy %f\n",energy);
518 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
519 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
521 //Get the ratio and log ratio to all cells in cluster
522 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
524 Int_t id = clus->GetCellsAbsId()[ipos];
526 //Recalibrate cell energy if needed
527 Float_t amp = cells->GetCellAmplitude(id);
528 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
530 fhECellClusterRatio ->Fill(energy,amp/energy);
531 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
534 //Recalculate shower shape for different W0
535 if(fCalorimeter=="EMCAL"){
537 Float_t l0org = clus->GetM02();
538 Float_t l1org = clus->GetM20();
539 Float_t dorg = clus->GetDispersion();
541 for(Int_t iw = 0; iw < 14; iw++)
543 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
544 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
546 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
547 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
551 // Set the original values back
554 clus->SetDispersion(dorg);
559 //__________________________________________
560 TObjString * AliAnaPi0EbE::GetAnalysisCuts()
562 //Save parameters used for analysis
563 TString parList ; //this will be list of parameters used for this analysis.
564 const Int_t buffersize = 255;
565 char onePar[buffersize] ;
567 snprintf(onePar,buffersize,"--- AliAnaPi0EbE ---\n") ;
569 snprintf(onePar,buffersize,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ;
572 if(fAnaType == kSSCalo)
574 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
576 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
578 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
580 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
584 //Get parameters set in base class.
585 parList += GetBaseParametersList() ;
587 //Get parameters set in PID class.
588 if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ;
590 return new TObjString(parList) ;
593 //_____________________________________________
594 TList * AliAnaPi0EbE::GetCreateOutputObjects()
596 // Create histograms to be saved in output file and
597 // store them in outputContainer
598 TList * outputContainer = new TList() ;
599 outputContainer->SetName("Pi0EbEHistos") ;
601 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
602 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
603 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
604 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
605 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
606 Int_t tbins = GetHistogramRanges()->GetHistoTimeBins() ; Float_t tmax = GetHistogramRanges()->GetHistoTimeMax(); Float_t tmin = GetHistogramRanges()->GetHistoTimeMin();
607 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
609 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
610 Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
611 Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
613 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
614 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
615 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
616 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
617 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
618 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
620 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
621 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
622 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
623 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
624 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
625 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
627 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();
628 Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();
629 Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
631 TString nlm[] ={"1 Local Maxima","2 Local Maxima", "NLM > 2"};
632 TString ptype[] ={"#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"};
633 TString pname[] ={"Photon","Conversion", "Pi0", "Eta", "Electron","Hadron"};
634 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins
636 fhPt = new TH1F("hPt","Number of identified #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
637 fhPt->SetYTitle("N");
638 fhPt->SetXTitle("p_{T} (GeV/c)");
639 outputContainer->Add(fhPt) ;
641 fhE = new TH1F("hE","Number of identified #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
643 fhE->SetXTitle("E (GeV)");
644 outputContainer->Add(fhE) ;
647 ("hEPhi","Selected #pi^{0} (#eta) pairs: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
648 fhEPhi->SetYTitle("#phi (rad)");
649 fhEPhi->SetXTitle("E (GeV)");
650 outputContainer->Add(fhEPhi) ;
653 ("hEEta","Selected #pi^{0} (#eta) pairs: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
654 fhEEta->SetYTitle("#eta");
655 fhEEta->SetXTitle("E (GeV)");
656 outputContainer->Add(fhEEta) ;
659 ("hEtaPhi","Selected #pi^{0} (#eta) pairs: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
660 fhEtaPhi->SetYTitle("#phi (rad)");
661 fhEtaPhi->SetXTitle("#eta");
662 outputContainer->Add(fhEtaPhi) ;
664 fhPtCentrality = new TH2F("hPtCentrality","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
665 fhPtCentrality->SetYTitle("centrality");
666 fhPtCentrality->SetXTitle("p_{T}(GeV/c)");
667 outputContainer->Add(fhPtCentrality) ;
669 fhPtEventPlane = new TH2F("hPtEventPlane","event plane angle vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
670 fhPtEventPlane->SetYTitle("Event plane angle (rad)");
671 fhPtEventPlane->SetXTitle("p_{T} (GeV/c)");
672 outputContainer->Add(fhPtEventPlane) ;
674 if(fAnaType == kSSCalo)
676 fhPtReject = new TH1F("hPtReject","Number of rejected as #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
677 fhPtReject->SetYTitle("N");
678 fhPtReject->SetXTitle("p_{T} (GeV/c)");
679 outputContainer->Add(fhPtReject) ;
681 fhEReject = new TH1F("hEReject","Number of rejected as #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
682 fhEReject->SetYTitle("N");
683 fhEReject->SetXTitle("E (GeV)");
684 outputContainer->Add(fhEReject) ;
686 fhEPhiReject = new TH2F
687 ("hEPhiReject","Rejected #pi^{0} (#eta) cluster: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
688 fhEPhiReject->SetYTitle("#phi (rad)");
689 fhEPhiReject->SetXTitle("E (GeV)");
690 outputContainer->Add(fhEPhiReject) ;
692 fhEEtaReject = new TH2F
693 ("hEEtaReject","Rejected #pi^{0} (#eta) cluster: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
694 fhEEtaReject->SetYTitle("#eta");
695 fhEEtaReject->SetXTitle("E (GeV)");
696 outputContainer->Add(fhEEtaReject) ;
698 fhEtaPhiReject = new TH2F
699 ("hEtaPhiReject","Rejected #pi^{0} (#eta) cluster: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
700 fhEtaPhiReject->SetYTitle("#phi (rad)");
701 fhEtaPhiReject->SetXTitle("#eta");
702 outputContainer->Add(fhEtaPhiReject) ;
706 ("hMass","all pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
707 fhMass->SetYTitle("mass (GeV/c^{2})");
708 fhMass->SetXTitle("E (GeV)");
709 outputContainer->Add(fhMass) ;
711 fhSelectedMass = new TH2F
712 ("hSelectedMass","Selected #pi^{0} (#eta) pairs mass: E vs mass",nptbins,ptmin,ptmax, nmassbins,massmin,massmax);
713 fhSelectedMass->SetYTitle("mass (GeV/c^{2})");
714 fhSelectedMass->SetXTitle("E (GeV)");
715 outputContainer->Add(fhSelectedMass) ;
717 if(fAnaType != kSSCalo)
719 fhPtDecay = new TH1F("hPtDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
720 fhPtDecay->SetYTitle("N");
721 fhPtDecay->SetXTitle("p_{T} (GeV/c)");
722 outputContainer->Add(fhPtDecay) ;
724 fhEDecay = new TH1F("hEDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
725 fhEDecay->SetYTitle("N");
726 fhEDecay->SetXTitle("E (GeV)");
727 outputContainer->Add(fhEDecay) ;
732 if( fFillSelectClHisto )
735 fhEDispersion = new TH2F
736 ("hEDispersion","Selected #pi^{0} (#eta) pairs: E vs dispersion",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
737 fhEDispersion->SetYTitle("D^{2}");
738 fhEDispersion->SetXTitle("E (GeV)");
739 outputContainer->Add(fhEDispersion) ;
741 fhELambda0 = new TH2F
742 ("hELambda0","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
743 fhELambda0->SetYTitle("#lambda_{0}^{2}");
744 fhELambda0->SetXTitle("E (GeV)");
745 outputContainer->Add(fhELambda0) ;
747 fhELambda1 = new TH2F
748 ("hELambda1","Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
749 fhELambda1->SetYTitle("#lambda_{1}^{2}");
750 fhELambda1->SetXTitle("E (GeV)");
751 outputContainer->Add(fhELambda1) ;
753 fhELambda0FracMaxCellCut = new TH2F
754 ("hELambda0FracMaxCellCut","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy < 0.5",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
755 fhELambda0FracMaxCellCut->SetYTitle("#lambda_{0}^{2}");
756 fhELambda0FracMaxCellCut->SetXTitle("E (GeV)");
757 outputContainer->Add(fhELambda0FracMaxCellCut) ;
759 fhEFracMaxCell = new TH2F
760 ("hEFracMaxCell","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy",nptbins,ptmin,ptmax,100,0,1);
761 fhEFracMaxCell->SetYTitle("Fraction");
762 fhEFracMaxCell->SetXTitle("E (GeV)");
763 outputContainer->Add(fhEFracMaxCell) ;
765 if(fCalorimeter=="EMCAL")
767 fhELambda0NoTRD = new TH2F
768 ("hELambda0NoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, not behind TRD",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
769 fhELambda0NoTRD->SetYTitle("#lambda_{0}^{2}");
770 fhELambda0NoTRD->SetXTitle("E (GeV)");
771 outputContainer->Add(fhELambda0NoTRD) ;
773 fhEFracMaxCellNoTRD = new TH2F
774 ("hEFracMaxCellNoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy, not behind TRD",nptbins,ptmin,ptmax,100,0,1);
775 fhEFracMaxCellNoTRD->SetYTitle("Fraction");
776 fhEFracMaxCellNoTRD->SetXTitle("E (GeV)");
777 outputContainer->Add(fhEFracMaxCellNoTRD) ;
779 if(!fFillOnlySimpleSSHisto)
781 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);
782 fhDispEtaE->SetXTitle("E (GeV)");
783 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
784 outputContainer->Add(fhDispEtaE);
786 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);
787 fhDispPhiE->SetXTitle("E (GeV)");
788 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
789 outputContainer->Add(fhDispPhiE);
791 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);
792 fhSumEtaE->SetXTitle("E (GeV)");
793 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
794 outputContainer->Add(fhSumEtaE);
796 fhSumPhiE = new TH2F ("hSumPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
797 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
798 fhSumPhiE->SetXTitle("E (GeV)");
799 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
800 outputContainer->Add(fhSumPhiE);
802 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
803 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
804 fhSumEtaPhiE->SetXTitle("E (GeV)");
805 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
806 outputContainer->Add(fhSumEtaPhiE);
808 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
809 nptbins,ptmin,ptmax,200, -10,10);
810 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
811 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
812 outputContainer->Add(fhDispEtaPhiDiffE);
814 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
815 nptbins,ptmin,ptmax, 200, -1,1);
816 fhSphericityE->SetXTitle("E (GeV)");
817 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
818 outputContainer->Add(fhSphericityE);
820 for(Int_t i = 0; i < 7; i++)
822 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]),
823 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
824 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
825 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
826 outputContainer->Add(fhDispEtaDispPhi[i]);
828 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]),
829 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
830 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
831 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
832 outputContainer->Add(fhLambda0DispEta[i]);
834 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]),
835 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
836 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
837 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
838 outputContainer->Add(fhLambda0DispPhi[i]);
844 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
845 nptbins,ptmin,ptmax,10,0,10);
846 fhNLocMax ->SetYTitle("N maxima");
847 fhNLocMax ->SetXTitle("E (GeV)");
848 outputContainer->Add(fhNLocMax) ;
850 for (Int_t i = 0; i < 3; i++)
852 fhELambda0LocMax[i] = new TH2F(Form("hELambda0LocMax%d",i+1),
853 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, %s",nlm[i].Data()),
854 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
855 fhELambda0LocMax[i]->SetYTitle("#lambda_{0}^{2}");
856 fhELambda0LocMax[i]->SetXTitle("E (GeV)");
857 outputContainer->Add(fhELambda0LocMax[i]) ;
859 fhELambda1LocMax[i] = new TH2F(Form("hELambda1LocMax%d",i+1),
860 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}, %s",nlm[i].Data()),
861 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
862 fhELambda1LocMax[i]->SetYTitle("#lambda_{1}^{2}");
863 fhELambda1LocMax[i]->SetXTitle("E (GeV)");
864 outputContainer->Add(fhELambda1LocMax[i]) ;
866 fhEDispersionLocMax[i] = new TH2F(Form("hEDispersionLocMax%d",i+1),
867 Form("Selected #pi^{0} (#eta) pairs: E vs dispersion^{2}, %s",nlm[i].Data()),
868 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
869 fhEDispersionLocMax[i]->SetYTitle("dispersion^{2}");
870 fhEDispersionLocMax[i]->SetXTitle("E (GeV)");
871 outputContainer->Add(fhEDispersionLocMax[i]) ;
873 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
875 fhEDispEtaLocMax[i] = new TH2F(Form("hEDispEtaLocMax%d",i+1),
876 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #eta}, %s",nlm[i].Data()),
877 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
878 fhEDispEtaLocMax[i]->SetYTitle("#sigma_{#eta #eta}");
879 fhEDispEtaLocMax[i]->SetXTitle("E (GeV)");
880 outputContainer->Add(fhEDispEtaLocMax[i]) ;
882 fhEDispPhiLocMax[i] = new TH2F(Form("hEDispPhiLocMax%d",i+1),
883 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi}, %s",nlm[i].Data()),
884 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
885 fhEDispPhiLocMax[i]->SetYTitle("#sigma_{#phi #phi}");
886 fhEDispPhiLocMax[i]->SetXTitle("E (GeV)");
887 outputContainer->Add(fhEDispPhiLocMax[i]) ;
889 fhESumEtaPhiLocMax[i] = new TH2F(Form("hESumEtaPhiLocMax%d",i+1),
890 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #phi}, %s",nlm[i].Data()),
891 nptbins,ptmin,ptmax,2*ssbins,-ssmax,ssmax);
892 fhESumEtaPhiLocMax[i]->SetYTitle("#sigma_{#eta #phi}");
893 fhESumEtaPhiLocMax[i]->SetXTitle("E (GeV)");
894 outputContainer->Add(fhESumEtaPhiLocMax[i]) ;
896 fhEDispEtaPhiDiffLocMax[i] = new TH2F(Form("hEDispEtaPhiDiffLocMax%d",i+1),
897 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta}, %s",nlm[i].Data()),
898 nptbins,ptmin,ptmax,200, -10,10);
899 fhEDispEtaPhiDiffLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta}");
900 fhEDispEtaPhiDiffLocMax[i]->SetXTitle("E (GeV)");
901 outputContainer->Add(fhEDispEtaPhiDiffLocMax[i]) ;
903 fhESphericityLocMax[i] = new TH2F(Form("hESphericityLocMax%d",i+1),
904 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta}), %s",nlm[i].Data()),
905 nptbins,ptmin,ptmax,200, -1,1);
906 fhESphericityLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta})");
907 fhESphericityLocMax[i]->SetXTitle("E (GeV)");
908 outputContainer->Add(fhESphericityLocMax[i]) ;
913 fhENCells = new TH2F ("hENCells","N cells in cluster vs E ", nptbins,ptmin,ptmax, nbins,nmin,nmax);
914 fhENCells->SetXTitle("E (GeV)");
915 fhENCells->SetYTitle("# of cells in cluster");
916 outputContainer->Add(fhENCells);
918 fhETime = new TH2F("hETime","cluster time vs pair E",nptbins,ptmin,ptmax, tbins,tmin,tmax);
919 fhETime->SetXTitle("E (GeV)");
920 fhETime->SetYTitle("t (ns)");
921 outputContainer->Add(fhETime);
925 if(fAnaType == kIMCalo)
927 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs E",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
928 fhEPairDiffTime->SetXTitle("E_{pair} (GeV)");
929 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
930 outputContainer->Add(fhEPairDiffTime);
932 TString combiName [] = {"1LocMax","2LocMax","NLocMax","1LocMax2LocMax","1LocMaxNLocMax","2LocMaxNLocMax","1LocMaxSSBad","NLocMaxSSGood"};
933 TString combiTitle[] = {"1 Local Maxima in both clusters","2 Local Maxima in both clusters","more than 2 Local Maxima in both clusters",
934 "1 Local Maxima paired with 2 Local Maxima","1 Local Maxima paired with more than 2 Local Maxima",
935 "2 Local Maxima paired with more than 2 Local Maxima",
936 "1 Local Maxima paired with #lambda_{0}^{2}>0.3","N Local Maxima paired with 0.1<#lambda_{0}^{2}<0.3"};
938 for (Int_t i = 0; i < 8 ; i++)
941 if (fAnaType == kIMCaloTracks && i > 2 ) continue ;
943 fhMassPairLocMax[i] = new TH2F
944 (Form("MassPairLocMax%s",combiName[i].Data()),
945 Form("Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}, %s", combiTitle[i].Data()),
946 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
947 fhMassPairLocMax[i]->SetYTitle("Mass (MeV/c^{2})");
948 fhMassPairLocMax[i]->SetXTitle("E_{pair} (GeV)");
949 outputContainer->Add(fhMassPairLocMax[i]) ;
955 fhTrackMatchedDEta = new TH2F
956 ("hTrackMatchedDEta",
957 "d#eta of cluster-track vs cluster energy",
958 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
959 fhTrackMatchedDEta->SetYTitle("d#eta");
960 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
962 fhTrackMatchedDPhi = new TH2F
963 ("hTrackMatchedDPhi",
964 "d#phi of cluster-track vs cluster energy",
965 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
966 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
967 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
969 fhTrackMatchedDEtaDPhi = new TH2F
970 ("hTrackMatchedDEtaDPhi",
971 "d#eta vs d#phi of cluster-track vs cluster energy",
972 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
973 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
974 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
976 outputContainer->Add(fhTrackMatchedDEta) ;
977 outputContainer->Add(fhTrackMatchedDPhi) ;
978 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
980 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
981 fhdEdx->SetXTitle("E (GeV)");
982 fhdEdx->SetYTitle("<dE/dx>");
983 outputContainer->Add(fhdEdx);
985 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
986 fhEOverP->SetXTitle("E (GeV)");
987 fhEOverP->SetYTitle("E/p");
988 outputContainer->Add(fhEOverP);
990 if(fCalorimeter=="EMCAL")
992 fhEOverPNoTRD = new TH2F ("hEOverPNoTRD","matched track E/p vs cluster E, SM not behind TRD ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
993 fhEOverPNoTRD->SetXTitle("E (GeV)");
994 fhEOverPNoTRD->SetYTitle("E/p");
995 outputContainer->Add(fhEOverPNoTRD);
998 if(IsDataMC() && fFillTMHisto)
1000 fhTrackMatchedMCParticle = new TH2F
1001 ("hTrackMatchedMCParticle",
1002 "Origin of particle vs energy",
1003 nptbins,ptmin,ptmax,8,0,8);
1004 fhTrackMatchedMCParticle->SetXTitle("E (GeV)");
1005 //fhTrackMatchedMCParticle->SetYTitle("Particle type");
1007 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(1 ,"Photon");
1008 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(2 ,"Electron");
1009 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1010 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(4 ,"Rest");
1011 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1012 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1013 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1014 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1016 outputContainer->Add(fhTrackMatchedMCParticle);
1020 if(fFillWeightHistograms)
1022 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1023 nptbins,ptmin,ptmax, 100,0,1.);
1024 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1025 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
1026 outputContainer->Add(fhECellClusterRatio);
1028 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1029 nptbins,ptmin,ptmax, 100,-10,0);
1030 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1031 fhECellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1032 outputContainer->Add(fhECellClusterLogRatio);
1034 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
1035 nptbins,ptmin,ptmax, 100,0,1.);
1036 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
1037 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
1038 outputContainer->Add(fhEMaxCellClusterRatio);
1040 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
1041 nptbins,ptmin,ptmax, 100,-10,0);
1042 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
1043 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
1044 outputContainer->Add(fhEMaxCellClusterLogRatio);
1046 for(Int_t iw = 0; iw < 14; iw++)
1048 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),
1049 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1050 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
1051 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
1052 outputContainer->Add(fhLambda0ForW0[iw]);
1054 // 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),
1055 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1056 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
1057 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
1058 // outputContainer->Add(fhLambda1ForW0[iw]);
1065 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC && fAnaType==kSSCalo)
1067 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",
1068 nptbins,ptmin,ptmax,200,0,2);
1069 fhMCPi0PtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1070 fhMCPi0PtGenRecoFraction->SetYTitle("E^{ #pi^{0} mother} / E^{rec}");
1071 outputContainer->Add(fhMCPi0PtGenRecoFraction) ;
1073 fhMCEtaPtGenRecoFraction = new TH2F("hMCEtaPtGenRecoFraction","Number of clusters from #eta (2 #gamma) identified as #pi^{0} (#eta),pT versus E primary #eta / E reco",
1074 nptbins,ptmin,ptmax,200,0,2);
1075 fhMCEtaPtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1076 fhMCEtaPtGenRecoFraction->SetYTitle("E^{ #eta mother} / E^{rec}");
1077 outputContainer->Add(fhMCEtaPtGenRecoFraction) ;
1079 fhMCPi0DecayPt = new TH1F("hMCPi0DecayPt","Number of #gamma from #pi^{0} decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1080 fhMCPi0DecayPt->SetYTitle("N");
1081 fhMCPi0DecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1082 outputContainer->Add(fhMCPi0DecayPt) ;
1084 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}",
1085 nptbins,ptmin,ptmax,100,0,1);
1086 fhMCPi0DecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1087 fhMCPi0DecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1088 outputContainer->Add(fhMCPi0DecayPtFraction) ;
1090 fhMCEtaDecayPt = new TH1F("hMCEtaDecayPt","Number of #gamma from #eta decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1091 fhMCEtaDecayPt->SetYTitle("N");
1092 fhMCEtaDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1093 outputContainer->Add(fhMCEtaDecayPt) ;
1095 fhMCEtaDecayPtFraction = new TH2F("hMCEtaDecayPtFraction","Number of #gamma from #eta decay identified as #pi^{0} (#eta), pT versus E primary #gamma / E primary #eta",
1096 nptbins,ptmin,ptmax,100,0,1);
1097 fhMCEtaDecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1098 fhMCEtaDecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1099 outputContainer->Add(fhMCEtaDecayPtFraction) ;
1101 fhMCOtherDecayPt = new TH1F("hMCOtherDecayPt","Number of #gamma decay (not #eta or #pi^{0}) identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1102 fhMCOtherDecayPt->SetYTitle("N");
1103 fhMCOtherDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1104 outputContainer->Add(fhMCOtherDecayPt) ;
1108 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
1109 GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1112 fhAnglePairMCPi0 = new TH2F
1114 "Angle between decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,250,0,0.5);
1115 fhAnglePairMCPi0->SetYTitle("#alpha (rad)");
1116 fhAnglePairMCPi0->SetXTitle("E_{pair} (GeV)");
1117 outputContainer->Add(fhAnglePairMCPi0) ;
1119 if (fAnaType!= kSSCalo)
1121 fhAnglePairMCEta = new TH2F
1123 "Angle between decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,250,0,0.5);
1124 fhAnglePairMCEta->SetYTitle("#alpha (rad)");
1125 fhAnglePairMCEta->SetXTitle("E_{pair} (GeV)");
1126 outputContainer->Add(fhAnglePairMCEta) ;
1128 fhMassPairMCPi0 = new TH2F
1130 "Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1131 fhMassPairMCPi0->SetYTitle("Mass (MeV/c^{2})");
1132 fhMassPairMCPi0->SetXTitle("E_{pair} (GeV)");
1133 outputContainer->Add(fhMassPairMCPi0) ;
1135 fhMassPairMCEta = new TH2F
1137 "Mass for decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1138 fhMassPairMCEta->SetYTitle("Mass (MeV/c^{2})");
1139 fhMassPairMCEta->SetXTitle("E_{pair} (GeV)");
1140 outputContainer->Add(fhMassPairMCEta) ;
1143 for(Int_t i = 0; i < 6; i++)
1147 (Form("hE_MC%s",pname[i].Data()),
1148 Form("Identified as #pi^{0} (#eta), cluster from %s",
1150 nptbins,ptmin,ptmax);
1151 fhMCE[i]->SetYTitle("N");
1152 fhMCE[i]->SetXTitle("E (GeV)");
1153 outputContainer->Add(fhMCE[i]) ;
1155 fhMCPt[i] = new TH1F
1156 (Form("hPt_MC%s",pname[i].Data()),
1157 Form("Identified as #pi^{0} (#eta), cluster from %s",
1159 nptbins,ptmin,ptmax);
1160 fhMCPt[i]->SetYTitle("N");
1161 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1162 outputContainer->Add(fhMCPt[i]) ;
1164 fhMCPtCentrality[i] = new TH2F
1165 (Form("hPtCentrality_MC%s",pname[i].Data()),
1166 Form("Identified as #pi^{0} (#eta), cluster from %s",
1168 nptbins,ptmin,ptmax, 100,0,100);
1169 fhMCPtCentrality[i]->SetYTitle("centrality");
1170 fhMCPtCentrality[i]->SetXTitle("p_{T} (GeV/c)");
1171 outputContainer->Add(fhMCPtCentrality[i]) ;
1173 if(fAnaType == kSSCalo)
1175 fhMCEReject[i] = new TH1F
1176 (Form("hEReject_MC%s",pname[i].Data()),
1177 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1179 nptbins,ptmin,ptmax);
1180 fhMCEReject[i]->SetYTitle("N");
1181 fhMCEReject[i]->SetXTitle("E (GeV)");
1182 outputContainer->Add(fhMCEReject[i]) ;
1184 fhMCPtReject[i] = new TH1F
1185 (Form("hPtReject_MC%s",pname[i].Data()),
1186 Form("Rejected as #pi^{0} (#eta), cluster from %s",
1188 nptbins,ptmin,ptmax);
1189 fhMCPtReject[i]->SetYTitle("N");
1190 fhMCPtReject[i]->SetXTitle("p_{T} (GeV/c)");
1191 outputContainer->Add(fhMCPtReject[i]) ;
1194 fhMCPhi[i] = new TH2F
1195 (Form("hPhi_MC%s",pname[i].Data()),
1196 Form("Identified as #pi^{0} (#eta), cluster from %s",ptype[i].Data()),
1197 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1198 fhMCPhi[i]->SetYTitle("#phi");
1199 fhMCPhi[i]->SetXTitle("p_{T} (GeV/c)");
1200 outputContainer->Add(fhMCPhi[i]) ;
1202 fhMCEta[i] = new TH2F
1203 (Form("hEta_MC%s",pname[i].Data()),
1204 Form("Identified as #pi^{0} (#eta), cluster from %s",
1205 ptype[i].Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
1206 fhMCEta[i]->SetYTitle("#eta");
1207 fhMCEta[i]->SetXTitle("p_{T} (GeV/c)");
1208 outputContainer->Add(fhMCEta[i]) ;
1211 if( fFillSelectClHisto )
1213 fhEMCLambda0[i] = new TH2F(Form("hELambda0_MC%s",pname[i].Data()),
1214 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}",ptype[i].Data()),
1215 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1216 fhEMCLambda0[i]->SetYTitle("#lambda_{0}^{2}");
1217 fhEMCLambda0[i]->SetXTitle("E (GeV)");
1218 outputContainer->Add(fhEMCLambda0[i]) ;
1220 fhEMCLambda1[i] = new TH2F(Form("hELambda1_MC%s",pname[i].Data()),
1221 Form("Selected pair, cluster from %s : E vs #lambda_{1}^{2}",ptype[i].Data()),
1222 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1223 fhEMCLambda1[i]->SetYTitle("#lambda_{1}^{2}");
1224 fhEMCLambda1[i]->SetXTitle("E (GeV)");
1225 outputContainer->Add(fhEMCLambda1[i]) ;
1227 fhEMCDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pname[i].Data()),
1228 Form("Selected pair, cluster from %s : E vs dispersion^{2}",ptype[i].Data()),
1229 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1230 fhEMCDispersion[i]->SetYTitle("D^{2}");
1231 fhEMCDispersion[i]->SetXTitle("E (GeV)");
1232 outputContainer->Add(fhEMCDispersion[i]) ;
1234 if(fCalorimeter=="EMCAL")
1236 fhEMCLambda0NoTRD[i] = new TH2F(Form("hELambda0NoTRD_MC%s",pname[i].Data()),
1237 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, NoTRD",ptype[i].Data()),
1238 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1239 fhEMCLambda0NoTRD[i]->SetYTitle("#lambda_{0}^{2}");
1240 fhEMCLambda0NoTRD[i]->SetXTitle("E (GeV)");
1241 outputContainer->Add(fhEMCLambda0NoTRD[i]) ;
1243 if(!fFillOnlySimpleSSHisto)
1245 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pname[i].Data()),
1246 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptype[i].Data()),
1247 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1248 fhMCEDispEta[i]->SetXTitle("E (GeV)");
1249 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1250 outputContainer->Add(fhMCEDispEta[i]);
1252 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pname[i].Data()),
1253 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptype[i].Data()),
1254 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1255 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
1256 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1257 outputContainer->Add(fhMCEDispPhi[i]);
1259 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pname[i].Data()),
1260 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()),
1261 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1262 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
1263 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
1264 outputContainer->Add(fhMCESumEtaPhi[i]);
1266 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pname[i].Data()),
1267 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptype[i].Data()),
1268 nptbins,ptmin,ptmax,200,-10,10);
1269 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
1270 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1271 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
1273 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pname[i].Data()),
1274 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()),
1275 nptbins,ptmin,ptmax, 200,-1,1);
1276 fhMCESphericity[i]->SetXTitle("E (GeV)");
1277 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1278 outputContainer->Add(fhMCESphericity[i]);
1280 for(Int_t ie = 0; ie < 7; ie++)
1282 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1283 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]),
1284 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1285 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1286 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1287 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
1289 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pname[i].Data()),
1290 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]),
1291 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1292 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
1293 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1294 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
1296 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1297 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]),
1298 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1299 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
1300 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1301 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
1307 fhEMCLambda0FracMaxCellCut[i] = new TH2F(Form("hELambda0FracMaxCellCut_MC%s",pname[i].Data()),
1308 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, Max cell fraction of energy < 0.5 ",ptype[i].Data()),
1309 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1310 fhEMCLambda0FracMaxCellCut[i]->SetYTitle("#lambda_{0}^{2}");
1311 fhEMCLambda0FracMaxCellCut[i]->SetXTitle("E (GeV)");
1312 outputContainer->Add(fhEMCLambda0FracMaxCellCut[i]) ;
1314 fhEMCFracMaxCell[i] = new TH2F(Form("hEFracMaxCell_MC%s",pname[i].Data()),
1315 Form("Selected pair, cluster from %s : E vs Max cell fraction of energy",ptype[i].Data()),
1316 nptbins,ptmin,ptmax,100,0,1);
1317 fhEMCFracMaxCell[i]->SetYTitle("Fraction");
1318 fhEMCFracMaxCell[i]->SetXTitle("E (GeV)");
1319 outputContainer->Add(fhEMCFracMaxCell[i]) ;
1322 } // shower shape histo
1327 if(fAnaType==kSSCalo)
1329 fhAsymmetry = new TH2F ("hAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1330 nptbins,ptmin,ptmax, 200, -1,1);
1331 fhAsymmetry->SetXTitle("E (GeV)");
1332 fhAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1333 outputContainer->Add(fhAsymmetry);
1335 fhSelectedAsymmetry = new TH2F ("hSelectedAsymmetry","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1336 nptbins,ptmin,ptmax, 200, -1,1);
1337 fhSelectedAsymmetry->SetXTitle("E (GeV)");
1338 fhSelectedAsymmetry->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1339 outputContainer->Add(fhSelectedAsymmetry);
1343 for(Int_t i = 0; i< 6; i++)
1345 fhMCEAsymmetry[i] = new TH2F (Form("hEAsymmetry_MC%s",pname[i].Data()),
1346 Form("cluster from %s : A = ( E1 - E2 ) / ( E1 + E2 ) vs E",ptype[i].Data()),
1347 nptbins,ptmin,ptmax, 200,-1,1);
1348 fhMCEAsymmetry[i]->SetXTitle("E (GeV)");
1349 fhMCEAsymmetry[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1350 outputContainer->Add(fhMCEAsymmetry[i]);
1355 if(fAnaType==kSSCalo && fFillSelectClHisto && !fFillOnlySimpleSSHisto )
1359 for(Int_t i = 0; i< 3; i++)
1361 fhEAsymmetryLocMax[i] = new TH2F(Form("hEAsymmetryLocMax%d",i+1),
1362 Form("Selected #pi^{0} (#eta) pairs: E vs A = ( E1 - E2 ) / ( E1 + E2 ), %s",nlm[i].Data()),
1363 nptbins,ptmin,ptmax,200, -1,1);
1364 fhEAsymmetryLocMax[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1365 fhEAsymmetryLocMax[i]->SetXTitle("E (GeV)");
1366 outputContainer->Add(fhEAsymmetryLocMax[i]) ;
1369 for(Int_t ie = 0; ie< 7; ie++)
1372 fhAsymmetryLambda0[ie] = new TH2F (Form("hAsymmetryLambda0_EBin%d",ie),
1373 Form("#lambda_{0}^{2} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1374 ssbins,ssmin,ssmax , 200,-1,1);
1375 fhAsymmetryLambda0[ie]->SetXTitle("#lambda_{0}^{2}");
1376 fhAsymmetryLambda0[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1377 outputContainer->Add(fhAsymmetryLambda0[ie]);
1379 fhAsymmetryDispEta[ie] = new TH2F (Form("hAsymmetryDispEta_EBin%d",ie),
1380 Form("#sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1381 ssbins,ssmin,ssmax , 200,-1,1);
1382 fhAsymmetryDispEta[ie]->SetXTitle("#sigma^{2}_{#eta #eta}");
1383 fhAsymmetryDispEta[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1384 outputContainer->Add(fhAsymmetryDispEta[ie]);
1386 fhAsymmetryDispPhi[ie] = new TH2F (Form("hAsymmetryDispPhi_EBin%d",ie),
1387 Form("#sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1388 ssbins,ssmin,ssmax , 200,-1,1);
1389 fhAsymmetryDispPhi[ie]->SetXTitle("#sigma^{2}_{#phi #phi}");
1390 fhAsymmetryDispPhi[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1391 outputContainer->Add(fhAsymmetryDispPhi[ie]);
1397 for(Int_t i = 0; i< 6; i++)
1399 for(Int_t ie = 0; ie < 7; ie++)
1401 fhMCAsymmetryLambda0[ie][i] = new TH2F (Form("hMCAsymmetryLambda0_EBin%d_MC%s",ie,pname[i].Data()),
1402 Form("cluster from %s : #lambda_{0}^{2} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1403 ssbins,ssmin,ssmax , 200,-1,1);
1404 fhMCAsymmetryLambda0[ie][i]->SetXTitle("#lambda_{0}^{2}");
1405 fhMCAsymmetryLambda0[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1406 outputContainer->Add(fhMCAsymmetryLambda0[ie][i]);
1408 fhMCAsymmetryDispEta[ie][i] = new TH2F (Form("hMCAsymmetryDispEta_EBin%d_MC%s",ie,pname[i].Data()),
1409 Form("cluster from %s : #sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1410 ssbins,ssmin,ssmax , 200,-1,1);
1411 fhMCAsymmetryDispEta[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1412 fhMCAsymmetryDispEta[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1413 outputContainer->Add(fhMCAsymmetryDispEta[ie][i]);
1415 fhMCAsymmetryDispPhi[ie][i] = new TH2F (Form("hMCAsymmetryDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1416 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1417 ssbins,ssmin,ssmax , 200,-1,1);
1418 fhMCAsymmetryDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#phi #phi}");
1419 fhMCAsymmetryDispPhi[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1420 outputContainer->Add(fhMCAsymmetryDispPhi[ie][i]);
1426 if(fFillPileUpHistograms)
1429 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1431 for(Int_t i = 0 ; i < 7 ; i++)
1433 fhPtPi0PileUp[i] = new TH1F(Form("hPtPi0PileUp%s",pileUpName[i].Data()),
1434 Form("Selected #pi^{0} (#eta) p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
1435 fhPtPi0PileUp[i]->SetXTitle("p_{T} (GeV/c)");
1436 outputContainer->Add(fhPtPi0PileUp[i]);
1439 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1440 fhTimeENoCut->SetXTitle("E (GeV)");
1441 fhTimeENoCut->SetYTitle("time (ns)");
1442 outputContainer->Add(fhTimeENoCut);
1444 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1445 fhTimeESPD->SetXTitle("E (GeV)");
1446 fhTimeESPD->SetYTitle("time (ns)");
1447 outputContainer->Add(fhTimeESPD);
1449 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1450 fhTimeESPDMulti->SetXTitle("E (GeV)");
1451 fhTimeESPDMulti->SetYTitle("time (ns)");
1452 outputContainer->Add(fhTimeESPDMulti);
1454 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1455 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
1456 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
1457 outputContainer->Add(fhTimeNPileUpVertSPD);
1459 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
1460 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
1461 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
1462 outputContainer->Add(fhTimeNPileUpVertTrack);
1464 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1465 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
1466 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
1467 outputContainer->Add(fhTimeNPileUpVertContributors);
1469 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);
1470 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
1471 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
1472 outputContainer->Add(fhTimePileUpMainVertexZDistance);
1474 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
1475 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
1476 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
1477 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
1481 //Keep neutral meson selection histograms if requiered
1482 //Setting done in AliNeutralMesonSelection
1484 if(fAnaType!=kSSCalo && GetNeutralMesonSelection())
1486 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
1488 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
1489 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
1494 return outputContainer ;
1498 //_____________________________________________
1499 Int_t AliAnaPi0EbE::GetMCIndex(const Int_t tag)
1502 // Assign mc index depending on MC bit set
1504 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1508 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
1512 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
1513 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1515 return kmcConversion ;
1516 }//conversion photon
1517 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) )
1520 }//photon no conversion
1521 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
1523 return kmcElectron ;
1532 //__________________________________________________________________
1533 void AliAnaPi0EbE::HasPairSameMCMother(AliAODPWG4Particle * photon1,
1534 AliAODPWG4Particle * photon2,
1535 Int_t & label, Int_t & tag)
1537 // Check the labels of pare in case mother was same pi0 or eta
1538 // Set the new AOD accordingly
1540 Int_t label1 = photon1->GetLabel();
1541 Int_t label2 = photon2->GetLabel();
1543 if(label1 < 0 || label2 < 0 ) return ;
1545 //Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader());
1546 //Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader());
1547 Int_t tag1 = photon1->GetTag();
1548 Int_t tag2 = photon2->GetTag();
1550 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
1551 if( (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
1552 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay) ) ||
1553 (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCEtaDecay) &&
1554 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCEtaDecay) )
1558 //Check if pi0/eta mother is the same
1559 if(GetReader()->ReadStack())
1563 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
1564 label1 = mother1->GetFirstMother();
1565 //mother1 = GetMCStack()->Particle(label1);//pi0
1569 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
1570 label2 = mother2->GetFirstMother();
1571 //mother2 = GetMCStack()->Particle(label2);//pi0
1574 else if(GetReader()->ReadAODMCParticles())
1575 {//&& (input > -1)){
1578 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label1);//photon in kine tree
1579 label1 = mother1->GetMother();
1580 //mother1 = GetMCStack()->Particle(label1);//pi0
1584 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles())->At(label2);//photon in kine tree
1585 label2 = mother2->GetMother();
1586 //mother2 = GetMCStack()->Particle(label2);//pi0
1590 //printf("mother1 %d, mother2 %d\n",label1,label2);
1591 if( label1 == label2 && label1>=0 )
1596 TLorentzVector mom1 = *(photon1->Momentum());
1597 TLorentzVector mom2 = *(photon2->Momentum());
1599 Double_t angle = mom2.Angle(mom1.Vect());
1600 Double_t mass = (mom1+mom2).M();
1601 Double_t epair = (mom1+mom2).E();
1603 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay))
1605 fhMassPairMCPi0 ->Fill(epair,mass);
1606 fhAnglePairMCPi0->Fill(epair,angle);
1607 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
1611 fhMassPairMCEta ->Fill(epair,mass);
1612 fhAnglePairMCEta->Fill(epair,angle);
1613 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCEta);
1617 } // both from eta or pi0 decay
1621 //____________________________________________________________________________
1622 void AliAnaPi0EbE::Init()
1626 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
1627 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
1630 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
1631 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
1637 //____________________________________________________________________________
1638 void AliAnaPi0EbE::InitParameters()
1640 //Initialize the parameters of the analysis.
1641 AddToHistogramsName("AnaPi0EbE_");
1643 fInputAODGammaConvName = "PhotonsCTS" ;
1644 fAnaType = kIMCalo ;
1645 fCalorimeter = "EMCAL" ;
1652 //__________________________________________________________________
1653 void AliAnaPi0EbE::MakeAnalysisFillAOD()
1655 //Do analysis and fill aods
1660 MakeInvMassInCalorimeter();
1664 MakeShowerShapeIdentification();
1668 MakeInvMassInCalorimeterAndCTS();
1674 //____________________________________________
1675 void AliAnaPi0EbE::MakeInvMassInCalorimeter()
1677 //Do analysis and fill aods
1678 //Search for the photon decay in calorimeters
1679 //Read photon list from AOD, produced in class AliAnaPhoton
1680 //Check if 2 photons have the mass of the pi0.
1682 TLorentzVector mom1;
1683 TLorentzVector mom2;
1684 TLorentzVector mom ;
1689 if(!GetInputAODBranch()){
1690 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
1694 //Get shower shape information of clusters
1695 TObjArray *clusters = 0;
1696 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1697 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1699 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast()-1; iphoton++){
1700 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1702 //Vertex cut in case of mixed events
1703 Int_t evtIndex1 = 0 ;
1705 evtIndex1 = GetMixedEvent()->EventIndexForCaloCluster(photon1->GetCaloLabel(0)) ;
1706 if(TMath::Abs(GetVertex(evtIndex1)[2]) > GetZvertexCut()) continue ; //vertex cut
1707 mom1 = *(photon1->Momentum());
1709 //Get original cluster, to recover some information
1711 AliVCluster *cluster1 = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1714 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - First cluster not found\n");
1718 for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast(); jphoton++)
1720 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(jphoton));
1722 Int_t evtIndex2 = 0 ;
1724 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1726 if(GetMixedEvent() && (evtIndex1 == evtIndex2))
1729 if(TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut()) continue ; //vertex cut
1731 mom2 = *(photon2->Momentum());
1733 //Get original cluster, to recover some information
1735 AliVCluster *cluster2 = FindCluster(clusters,photon2->GetCaloLabel(0),iclus2,iclus+1);
1739 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Second cluster not found\n");
1743 Float_t e1 = photon1->E();
1744 Float_t e2 = photon2->E();
1746 //Select clusters with good time window difference
1747 Float_t tof1 = cluster1->GetTOF()*1e9;;
1748 Float_t tof2 = cluster2->GetTOF()*1e9;;
1749 Double_t t12diff = tof1-tof2;
1750 fhEPairDiffTime->Fill(e1+e2, t12diff);
1751 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
1753 //Play with the MC stack if available
1754 if(IsDataMC()) HasPairSameMCMother(photon1, photon2, label, tag) ;
1756 // Check the invariant mass for different selection on the local maxima
1757 // Name of AOD method TO BE FIXED
1758 Int_t nMaxima1 = photon1->GetFiducialArea();
1759 Int_t nMaxima2 = photon2->GetFiducialArea();
1761 Double_t mass = (mom1+mom2).M();
1762 Double_t epair = (mom1+mom2).E();
1764 if(nMaxima1==nMaxima2)
1766 if (nMaxima1==1) fhMassPairLocMax[0]->Fill(epair,mass);
1767 else if(nMaxima1==2) fhMassPairLocMax[1]->Fill(epair,mass);
1768 else fhMassPairLocMax[2]->Fill(epair,mass);
1770 else if(nMaxima1==1 || nMaxima2==1)
1772 if (nMaxima1==2 || nMaxima2==2) fhMassPairLocMax[3]->Fill(epair,mass);
1773 else fhMassPairLocMax[4]->Fill(epair,mass);
1776 fhMassPairLocMax[5]->Fill(epair,mass);
1778 // combinations with SS axis cut and NLM cut
1779 if(nMaxima1 == 1 && cluster2->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1780 if(nMaxima2 == 1 && cluster1->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1781 if(nMaxima1 > 1 && cluster2->GetM02() < 0.3 && cluster2->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1782 if(nMaxima2 > 1 && cluster1->GetM02() < 0.3 && cluster1->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1784 //Skip events with too few or too many NLM
1785 if((nMaxima1 < fNLMCutMin || nMaxima1 > fNLMCutMax) || (nMaxima2 < fNLMCutMin || nMaxima2 > fNLMCutMax)) continue ;
1787 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - NLM of out of range: cluster1 %d, cluster2 %d \n",nMaxima1, nMaxima2);
1790 fhMass->Fill(epair,(mom1+mom2).M());
1792 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1793 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1796 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());
1798 //Fill some histograms about shower shape
1799 if(fFillSelectClHisto && clusters && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1801 FillSelectedClusterHistograms(cluster1, nMaxima1, photon1->GetTag());
1802 FillSelectedClusterHistograms(cluster2, nMaxima2, photon2->GetTag());
1805 // Tag both photons as decay
1806 photon1->SetTagged(kTRUE);
1807 photon2->SetTagged(kTRUE);
1809 fhPtDecay->Fill(photon1->Pt());
1810 fhEDecay ->Fill(photon1->E() );
1812 fhPtDecay->Fill(photon2->Pt());
1813 fhEDecay ->Fill(photon2->E() );
1815 //Create AOD for analysis
1818 //Mass of selected pairs
1819 fhSelectedMass->Fill(epair,mom.M());
1821 // Fill histograms to undertand pile-up before other cuts applied
1822 // Remember to relax time cuts in the reader
1823 FillPileUpHistograms(mom.E(),((cluster1->GetTOF()+cluster2->GetTOF())*1e9) /2);
1825 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1827 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1828 pi0.SetDetector(photon1->GetDetector());
1831 pi0.SetLabel(label);
1834 //Set the indeces of the original caloclusters
1835 pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0));
1836 //pi0.SetInputFileIndex(input);
1838 AddAODParticle(pi0);
1846 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - End fill AODs \n");
1850 //__________________________________________________
1851 void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
1853 //Do analysis and fill aods
1854 //Search for the photon decay in calorimeters
1855 //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion
1856 //Check if 2 photons have the mass of the pi0.
1858 TLorentzVector mom1;
1859 TLorentzVector mom2;
1860 TLorentzVector mom ;
1865 // Check calorimeter input
1866 if(!GetInputAODBranch()){
1867 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data());
1871 // Get the array with conversion photons
1872 TClonesArray * inputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName);
1873 if(!inputAODGammaConv) {
1875 inputAODGammaConv = (TClonesArray *) GetReader()->GetInputEvent()->FindListObject(fInputAODGammaConvName);
1877 if(!inputAODGammaConv) {
1878 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input gamma conversions in AOD branch with name < %s >\n",fInputAODGammaConvName.Data());
1884 //Get shower shape information of clusters
1885 TObjArray *clusters = 0;
1886 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1887 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1889 Int_t nCTS = inputAODGammaConv->GetEntriesFast();
1890 Int_t nCalo = GetInputAODBranch()->GetEntriesFast();
1891 if(nCTS<=0 || nCalo <=0)
1893 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - nCalo %d, nCTS %d, cannot loop\n",nCalo,nCTS);
1898 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Number of conversion photons %d\n",nCTS);
1900 // Do the loop, first calo, second CTS
1901 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){
1902 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1903 mom1 = *(photon1->Momentum());
1905 //Get original cluster, to recover some information
1907 AliVCluster *cluster = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1909 for(Int_t jphoton = 0; jphoton < nCTS; jphoton++){
1910 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (inputAODGammaConv->At(jphoton));
1912 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1913 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
1915 mom2 = *(photon2->Momentum());
1917 Double_t mass = (mom1+mom2).M();
1918 Double_t epair = (mom1+mom2).E();
1920 Int_t nMaxima = photon1->GetFiducialArea();
1921 if (nMaxima==1) fhMassPairLocMax[0]->Fill(epair,mass);
1922 else if(nMaxima==2) fhMassPairLocMax[1]->Fill(epair,mass);
1923 else fhMassPairLocMax[2]->Fill(epair,mass);
1925 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) continue ;
1926 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - NLM %d of out of range \n",nMaxima);
1928 //Play with the MC stack if available
1931 Int_t label2 = photon2->GetLabel();
1932 if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader()));
1934 HasPairSameMCMother(photon1, photon2, label, tag) ;
1937 //Mass of selected pairs
1938 fhMass->Fill(epair,(mom1+mom2).M());
1940 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1941 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1943 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());
1945 //Fill some histograms about shower shape
1946 if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1948 FillSelectedClusterHistograms(cluster, nMaxima, photon1->GetTag());
1951 // Tag both photons as decay
1952 photon1->SetTagged(kTRUE);
1953 photon2->SetTagged(kTRUE);
1955 fhPtDecay->Fill(photon1->Pt());
1956 fhEDecay ->Fill(photon1->E() );
1958 //Create AOD for analysis
1962 //Mass of selected pairs
1963 fhSelectedMass->Fill(epair,mom.M());
1965 // Fill histograms to undertand pile-up before other cuts applied
1966 // Remember to relax time cuts in the reader
1967 if(cluster)FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);
1969 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1971 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1972 pi0.SetDetector(photon1->GetDetector());
1975 pi0.SetLabel(label);
1978 //Set the indeces of the original tracks or caloclusters
1979 pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1);
1980 pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1));
1981 //pi0.SetInputFileIndex(input);
1983 AddAODParticle(pi0);
1990 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - End fill AODs \n");
1995 //_________________________________________________
1996 void AliAnaPi0EbE::MakeShowerShapeIdentification()
1998 //Search for pi0 in fCalorimeter with shower shape analysis
2000 TObjArray * pl = 0x0;
2001 AliVCaloCells * cells = 0x0;
2002 //Select the Calorimeter of the photon
2003 if (fCalorimeter == "PHOS" )
2005 pl = GetPHOSClusters();
2006 cells = GetPHOSCells();
2008 else if (fCalorimeter == "EMCAL")
2010 pl = GetEMCALClusters();
2011 cells = GetEMCALCells();
2016 Info("MakeShowerShapeIdentification","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2020 TLorentzVector mom ;
2021 for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++)
2023 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2025 Int_t evtIndex = 0 ;
2026 if (GetMixedEvent())
2028 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2031 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
2033 //Get Momentum vector,
2034 Double_t vertex[]={0,0,0};
2035 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2037 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
2038 }//Assume that come from vertex in straight line
2041 calo->GetMomentum(mom,vertex) ;
2044 //If too small or big pt, skip it
2045 if(mom.E() < GetMinEnergy() || mom.E() > GetMaxEnergy() ) continue ;
2047 //Check acceptance selection
2048 if(IsFiducialCutOn())
2050 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
2051 if(! in ) continue ;
2055 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());
2057 //Check Distance to Bad channel, set bit.
2058 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2059 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
2060 if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
2063 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
2065 //.......................................
2066 // TOF cut, BE CAREFUL WITH THIS CUT
2067 Double_t tof = calo->GetTOF()*1e9;
2068 if(tof < fTimeCutMin || tof > fTimeCutMax) continue ;
2070 //Play with the MC stack if available
2071 //Check origin of the candidates
2075 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
2076 //GetMCAnalysisUtils()->CheckMultipleOrigin(calo->GetLabels(),calo->GetNLabels(), GetReader(), aodpi0.GetInputFileIndex(), tag);
2077 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",tag);
2080 //Skip matched clusters with tracks
2081 if(IsTrackMatched(calo, GetReader()->GetInputEvent()))
2083 FillRejectedClusterHistograms(mom,tag);
2089 //PID selection or bit setting
2091 Double_t mass = 0 , angle = 0;
2092 Double_t e1 = 0 , e2 = 0;
2093 Int_t idPartType = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(calo,cells,GetCaloUtils(),
2094 GetVertex(evtIndex),nMaxima,
2097 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",idPartType);
2100 //Skip events with too few or too many NLM
2101 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax)
2103 FillRejectedClusterHistograms(mom,tag);
2108 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - NLM %d accepted \n",nMaxima);
2110 //mass of all clusters
2111 fhMass->Fill(mom.E(),mass);
2113 // Asymmetry of all clusters
2115 if(e1+e2 > 0) asy = (e1-e2) / (e1+e2);
2116 fhAsymmetry->Fill(mom.E(),asy);
2120 Int_t mcIndex = GetMCIndex(tag);
2121 fhMCEAsymmetry[mcIndex]->Fill(mom.E(),asy);
2124 // If cluster does not pass pid, not pi0/eta, skip it.
2125 if (GetOutputAODName().Contains("Pi0") && idPartType != AliCaloPID::kPi0)
2127 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Pi0\n");
2128 FillRejectedClusterHistograms(mom,tag);
2132 else if(GetOutputAODName().Contains("Eta") && idPartType != AliCaloPID::kEta)
2134 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Eta\n");
2135 FillRejectedClusterHistograms(mom,tag);
2140 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
2141 mom.Pt(), idPartType);
2143 //Mass and asymmetry of selected pairs
2144 fhSelectedAsymmetry->Fill(mom.E(),asy);
2145 fhSelectedMass ->Fill(mom.E(),mass);
2147 //-----------------------
2148 //Create AOD for analysis
2150 AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
2151 aodpi0.SetLabel(calo->GetLabel());
2153 //Set the indeces of the original caloclusters
2154 aodpi0.SetCaloLabel(calo->GetID(),-1);
2155 aodpi0.SetDetector(fCalorimeter);
2157 if (distBad > fMinDist3) aodpi0.SetDistToBad(2) ;
2158 else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ;
2159 else aodpi0.SetDistToBad(0) ;
2161 // Check if cluster is pi0 via cluster splitting
2162 aodpi0.SetIdentifiedParticleType(idPartType);
2164 // Add number of local maxima to AOD, method name in AOD to be FIXED
2165 aodpi0.SetFiducialArea(nMaxima);
2169 //Fill some histograms about shower shape
2170 if(fFillSelectClHisto && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
2172 FillSelectedClusterHistograms(calo, nMaxima, tag, asy);
2175 // Fill histograms to undertand pile-up before other cuts applied
2176 // Remember to relax time cuts in the reader
2177 FillPileUpHistograms(calo->E(),calo->GetTOF()*1e9);
2179 //Add AOD with pi0 object to aod branch
2180 AddAODParticle(aodpi0);
2184 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
2187 //______________________________________________
2188 void AliAnaPi0EbE::MakeAnalysisFillHistograms()
2190 //Do analysis and fill histograms
2192 if(!GetOutputAODBranch())
2194 printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
2197 //Loop on stored AOD pi0
2198 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2199 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2201 Float_t cen = GetEventCentrality();
2202 Float_t ep = GetEventPlaneAngle();
2204 for(Int_t iaod = 0; iaod < naod ; iaod++)
2207 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2208 Int_t pdg = pi0->GetIdentifiedParticleType();
2210 if(IsCaloPIDOn() && pdg != AliCaloPID::kPi0) continue;
2212 //Fill pi0 histograms
2213 Float_t ener = pi0->E();
2214 Float_t pt = pi0->Pt();
2215 Float_t phi = pi0->Phi();
2216 if(phi < 0) phi+=TMath::TwoPi();
2217 Float_t eta = pi0->Eta();
2222 fhEEta ->Fill(ener,eta);
2223 fhEPhi ->Fill(ener,phi);
2224 fhEtaPhi ->Fill(eta ,phi);
2226 fhPtCentrality ->Fill(pt,cen) ;
2227 fhPtEventPlane ->Fill(pt,ep ) ;
2229 if(fFillPileUpHistograms)
2231 if(GetReader()->IsPileUpFromSPD()) fhPtPi0PileUp[0]->Fill(pt);
2232 if(GetReader()->IsPileUpFromEMCal()) fhPtPi0PileUp[1]->Fill(pt);
2233 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPi0PileUp[2]->Fill(pt);
2234 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPi0PileUp[3]->Fill(pt);
2235 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPi0PileUp[4]->Fill(pt);
2236 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPi0PileUp[5]->Fill(pt);
2237 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPi0PileUp[6]->Fill(pt);
2243 Int_t tag = pi0->GetTag();
2244 Int_t mcIndex = GetMCIndex(tag);
2246 fhMCE [mcIndex] ->Fill(ener);
2247 fhMCPt [mcIndex] ->Fill(pt);
2248 fhMCPhi[mcIndex] ->Fill(pt,phi);
2249 fhMCEta[mcIndex] ->Fill(pt,eta);
2251 fhMCPtCentrality[mcIndex]->Fill(pt,cen);
2253 if((mcIndex==kmcPhoton || mcIndex==kmcPi0 || mcIndex==kmcEta) && fAnaType==kSSCalo)
2255 Float_t efracMC = 0;
2256 Int_t label = pi0->GetLabel();
2259 TLorentzVector mom = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2262 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
2264 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2265 if(grandmom.E() > 0 && ok)
2267 efracMC = grandmom.E()/ener;
2268 fhMCPi0PtGenRecoFraction ->Fill(pt,efracMC);
2271 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
2273 fhMCPi0DecayPt->Fill(pt);
2274 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2275 if(grandmom.E() > 0 && ok)
2277 efracMC = mom.E()/grandmom.E();
2278 fhMCPi0DecayPtFraction ->Fill(pt,efracMC);
2281 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
2283 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2284 if(grandmom.E() > 0 && ok)
2286 efracMC = grandmom.E()/ener;
2287 fhMCEtaPtGenRecoFraction ->Fill(pt,efracMC);
2290 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
2292 fhMCEtaDecayPt->Fill(pt);
2293 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2294 if(grandmom.E() > 0 && ok)
2296 efracMC = mom.E()/grandmom.E();
2297 fhMCEtaDecayPtFraction ->Fill(pt,efracMC);
2300 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
2302 fhMCOtherDecayPt->Fill(pt);
2307 }//Histograms with MC
2313 //__________________________________________________________________
2314 void AliAnaPi0EbE::Print(const Option_t * opt) const
2316 //Print some relevant parameters set for the analysis
2320 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2321 AliAnaCaloTrackCorrBaseClass::Print("");
2322 printf("Analysis Type = %d \n", fAnaType) ;
2323 if(fAnaType == kSSCalo){
2324 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2325 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2326 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2327 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);