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 fhPtDecay(0), fhEDecay(0),
63 // Shower shape histos
64 fhEDispersion(0), fhELambda0(0), fhELambda1(0),
65 fhELambda0NoTRD(0), fhELambda0FracMaxCellCut(0),
66 fhEFracMaxCell(0), fhEFracMaxCellNoTRD(0),
67 fhENCells(0), fhETime(0), fhEPairDiffTime(0),
68 fhDispEtaE(0), fhDispPhiE(0),
69 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
70 fhDispEtaPhiDiffE(0), fhSphericityE(0), fhAsymmetryE(0),
73 fhMCPt(), fhMCPhi(), fhMCEta(),
74 fhMCPi0PtGenRecoFraction(0), fhMCEtaPtGenRecoFraction(0),
75 fhMCPi0DecayPt(0), fhMCPi0DecayPtFraction(0),
76 fhMCEtaDecayPt(0), fhMCEtaDecayPtFraction(0),
78 fhMassPairMCPi0(0), fhMassPairMCEta(0),
79 fhAnglePairMCPi0(0), fhAnglePairMCEta(0),
81 fhECellClusterRatio(0), fhECellClusterLogRatio(0),
82 fhEMaxCellClusterRatio(0), fhEMaxCellClusterLogRatio(0),
83 fhTrackMatchedDEta(0), fhTrackMatchedDPhi(0), fhTrackMatchedDEtaDPhi(0),
84 fhTrackMatchedMCParticle(0), fhdEdx(0),
85 fhEOverP(0), fhEOverPNoTRD(0),
86 // Number of local maxima in cluster
89 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
90 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
91 fhTimeNPileUpVertContributors(0),
92 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0)
96 for(Int_t i = 0; i < 6; i++)
101 fhEMCLambda0 [i] = 0;
102 fhEMCLambda0NoTRD [i] = 0;
103 fhEMCLambda0FracMaxCellCut[i]= 0;
104 fhEMCFracMaxCell [i] = 0;
105 fhEMCLambda1 [i] = 0;
106 fhEMCDispersion [i] = 0;
108 fhMCEDispEta [i] = 0;
109 fhMCEDispPhi [i] = 0;
110 fhMCESumEtaPhi [i] = 0;
111 fhMCEDispEtaPhiDiff[i] = 0;
112 fhMCESphericity [i] = 0;
113 fhMCEAsymmetry [i] = 0;
115 for(Int_t j = 0; j < 7; j++)
117 fhMCLambda0DispEta [j][i] = 0;
118 fhMCLambda0DispPhi [j][i] = 0;
119 fhMCDispEtaDispPhi [j][i] = 0;
120 fhMCAsymmetryLambda0 [j][i] = 0;
121 fhMCAsymmetryDispEta [j][i] = 0;
122 fhMCAsymmetryDispPhi [j][i] = 0;
126 for(Int_t j = 0; j < 7; j++)
128 fhLambda0DispEta [j] = 0;
129 fhLambda0DispPhi [j] = 0;
130 fhDispEtaDispPhi [j] = 0;
131 fhAsymmetryLambda0 [j] = 0;
132 fhAsymmetryDispEta [j] = 0;
133 fhAsymmetryDispPhi [j] = 0;
136 for(Int_t i = 0; i < 3; i++)
138 fhELambda0LocMax [i] = 0;
139 fhELambda1LocMax [i] = 0;
140 fhEDispersionLocMax [i] = 0;
141 fhEDispEtaLocMax [i] = 0;
142 fhEDispPhiLocMax [i] = 0;
143 fhESumEtaPhiLocMax [i] = 0;
144 fhEDispEtaPhiDiffLocMax[i] = 0;
145 fhESphericityLocMax [i] = 0;
146 fhEAsymmetryLocMax [i] = 0;
150 for(Int_t i =0; i < 14; i++){
151 fhLambda0ForW0[i] = 0;
152 //fhLambda1ForW0[i] = 0;
153 if(i<8)fhMassPairLocMax[i] = 0;
156 //Initialize parameters
161 //___________________________________________________________________
162 void AliAnaPi0EbE::FillPileUpHistograms(Float_t energy, Float_t time)
164 // Fill some histograms to understand pile-up
165 if(!fFillPileUpHistograms) return;
167 //printf("E %f, time %f\n",energy,time);
168 AliVEvent * event = GetReader()->GetInputEvent();
170 fhTimeENoCut->Fill(energy,time);
171 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
172 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
174 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
176 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
177 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
179 // N pile up vertices
180 Int_t nVerticesSPD = -1;
181 Int_t nVerticesTracks = -1;
185 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
186 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
191 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
192 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
195 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
196 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
198 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
199 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
202 Float_t z1 = -1, z2 = -1;
204 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
208 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
209 ncont=pv->GetNContributors();
210 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
212 diamZ = esdEv->GetDiamondZ();
216 AliAODVertex *pv=aodEv->GetVertex(iVert);
217 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
218 ncont=pv->GetNContributors();
219 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
221 diamZ = aodEv->GetDiamondZ();
224 Double_t distZ = TMath::Abs(z2-z1);
225 diamZ = TMath::Abs(z2-diamZ);
227 fhTimeNPileUpVertContributors ->Fill(time,ncont);
228 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
229 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
234 //_____________________________________________________________________________________
235 void AliAnaPi0EbE::FillSelectedClusterHistograms(AliVCluster* cluster,
240 // Fill shower shape, timing and other histograms for selected clusters from decay
242 Float_t e = cluster->E();
243 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
244 Float_t l0 = cluster->GetM02();
245 Float_t l1 = cluster->GetM20();
246 Int_t nSM = GetModuleNumber(cluster);
249 if (e < 2 ) ebin = 0;
250 else if (e < 4 ) ebin = 1;
251 else if (e < 6 ) ebin = 2;
252 else if (e < 10) ebin = 3;
253 else if (e < 15) ebin = 4;
254 else if (e < 20) ebin = 5;
258 if (nMaxima==1) indexMax = 0 ;
259 else if(nMaxima==2) indexMax = 1 ;
263 AliVCaloCells * cell = 0x0;
264 if(fCalorimeter == "PHOS")
265 cell = GetPHOSCells();
267 cell = GetEMCALCells();
269 Float_t maxCellFraction = 0;
270 GetCaloUtils()->GetMaxEnergyCell(cell, cluster, maxCellFraction);
271 fhEFracMaxCell->Fill(e,maxCellFraction);
273 FillWeightHistograms(cluster);
275 fhEDispersion->Fill(e, disp);
276 fhELambda0 ->Fill(e, l0 );
277 fhELambda1 ->Fill(e, l1 );
279 Float_t ll0 = 0., ll1 = 0.;
280 Float_t dispp= 0., dEta = 0., dPhi = 0.;
281 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
282 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
284 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
285 ll0, ll1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
287 fhDispEtaE -> Fill(e,dEta);
288 fhDispPhiE -> Fill(e,dPhi);
289 fhSumEtaE -> Fill(e,sEta);
290 fhSumPhiE -> Fill(e,sPhi);
291 fhSumEtaPhiE -> Fill(e,sEtaPhi);
292 fhDispEtaPhiDiffE -> Fill(e,dPhi-dEta);
293 if(dEta+dPhi>0)fhSphericityE -> Fill(e,(dPhi-dEta)/(dEta+dPhi));
295 fhDispEtaDispPhi[ebin]->Fill(dEta,dPhi);
296 fhLambda0DispEta[ebin]->Fill(l0 ,dEta);
297 fhLambda0DispPhi[ebin]->Fill(l0 ,dPhi);
299 if (fAnaType==kSSCalo)
301 // Asymmetry histograms
302 fhAsymmetryE ->Fill(e ,asy);
303 fhAsymmetryLambda0[ebin]->Fill(l0 ,asy);
304 fhAsymmetryDispEta[ebin]->Fill(dEta,asy);
305 fhAsymmetryDispPhi[ebin]->Fill(dPhi,asy);
309 fhNLocMax->Fill(e,nMaxima);
311 fhELambda0LocMax [indexMax]->Fill(e,l0);
312 fhELambda1LocMax [indexMax]->Fill(e,l1);
313 fhEDispersionLocMax[indexMax]->Fill(e,disp);
315 if(fCalorimeter=="EMCAL" && !fFillOnlySimpleSSHisto)
317 fhEDispEtaLocMax [indexMax]-> Fill(e,dEta);
318 fhEDispPhiLocMax [indexMax]-> Fill(e,dPhi);
319 fhESumEtaPhiLocMax [indexMax]-> Fill(e,sEtaPhi);
320 fhEDispEtaPhiDiffLocMax[indexMax]-> Fill(e,dPhi-dEta);
321 if(dEta+dPhi>0) fhESphericityLocMax[indexMax]->Fill(e,(dPhi-dEta)/(dEta+dPhi));
322 if(fAnaType==kSSCalo) fhEAsymmetryLocMax [indexMax]->Fill(e ,asy);
326 if(fCalorimeter=="EMCAL" && nSM < 6)
328 fhELambda0NoTRD->Fill(e, l0 );
329 fhEFracMaxCellNoTRD->Fill(e,maxCellFraction);
332 if(maxCellFraction < 0.5)
333 fhELambda0FracMaxCellCut->Fill(e, l0 );
335 fhETime ->Fill(e, cluster->GetTOF()*1.e9);
336 fhENCells->Fill(e, cluster->GetNCells());
338 // Fill Track matching control histograms
341 Float_t dZ = cluster->GetTrackDz();
342 Float_t dR = cluster->GetTrackDx();
344 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
346 dR = 2000., dZ = 2000.;
347 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
349 //printf("Pi0EbE: dPhi %f, dEta %f\n",dR,dZ);
351 if(fhTrackMatchedDEta && TMath::Abs(dR) < 999)
353 fhTrackMatchedDEta->Fill(e,dZ);
354 fhTrackMatchedDPhi->Fill(e,dR);
355 if(e > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
358 // Check dEdx and E/p of matched clusters
360 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
362 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
366 Float_t dEdx = track->GetTPCsignal();
367 fhdEdx->Fill(e, dEdx);
369 Float_t eOverp = e/track->P();
370 fhEOverP->Fill(e, eOverp);
372 if(fCalorimeter=="EMCAL" && nSM < 6) fhEOverPNoTRD->Fill(e, eOverp);
376 // printf("AliAnaPi0EbE::FillSelectedClusterHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
382 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
384 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
385 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 2.5 );
386 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 0.5 );
387 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 1.5 );
388 else fhTrackMatchedMCParticle->Fill(e, 3.5 );
393 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
394 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(e, 6.5 );
395 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(e, 4.5 );
396 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(e, 5.5 );
397 else fhTrackMatchedMCParticle->Fill(e, 7.5 );
401 }// Track matching histograms
405 Int_t mcIndex = GetMCIndex(tag);
407 fhEMCLambda0[mcIndex] ->Fill(e, l0);
408 fhEMCLambda1[mcIndex] ->Fill(e, l1);
409 fhEMCDispersion[mcIndex] ->Fill(e, disp);
410 fhEMCFracMaxCell[mcIndex]->Fill(e,maxCellFraction);
412 if(fCalorimeter=="EMCAL" && nSM < 6)
413 fhEMCLambda0NoTRD[mcIndex]->Fill(e, l0 );
415 if(maxCellFraction < 0.5)
416 fhEMCLambda0FracMaxCellCut[mcIndex]->Fill(e, l0 );
418 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
420 fhMCEDispEta [mcIndex]-> Fill(e,dEta);
421 fhMCEDispPhi [mcIndex]-> Fill(e,dPhi);
422 fhMCESumEtaPhi [mcIndex]-> Fill(e,sEtaPhi);
423 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(e,dPhi-dEta);
424 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(e,(dPhi-dEta)/(dEta+dPhi));
426 if (fAnaType==kSSCalo)
428 fhMCEAsymmetry [mcIndex]->Fill(e ,asy);
429 fhMCAsymmetryLambda0[ebin][mcIndex]->Fill(l0 ,asy);
430 fhMCAsymmetryDispEta[ebin][mcIndex]->Fill(dEta,asy);
431 fhMCAsymmetryDispPhi[ebin][mcIndex]->Fill(dPhi,asy);
434 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta,dPhi);
435 fhMCLambda0DispEta[ebin][mcIndex]->Fill(l0 ,dEta);
436 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(l0 ,dPhi);
444 //________________________________________________________
445 void AliAnaPi0EbE::FillWeightHistograms(AliVCluster *clus)
447 // Calculate weights and fill histograms
449 if(!fFillWeightHistograms || GetMixedEvent()) return;
451 AliVCaloCells* cells = 0;
452 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
453 else cells = GetPHOSCells();
455 // First recalculate energy in case non linearity was applied
458 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
461 Int_t id = clus->GetCellsAbsId()[ipos];
463 //Recalibrate cell energy if needed
464 Float_t amp = cells->GetCellAmplitude(id);
465 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
476 printf("AliAnaPi0EbE::WeightHistograms()- Wrong calculated energy %f\n",energy);
480 fhEMaxCellClusterRatio ->Fill(energy,ampMax/energy);
481 fhEMaxCellClusterLogRatio->Fill(energy,TMath::Log(ampMax/energy));
483 //Get the ratio and log ratio to all cells in cluster
484 for (Int_t ipos = 0; ipos < clus->GetNCells(); ipos++)
486 Int_t id = clus->GetCellsAbsId()[ipos];
488 //Recalibrate cell energy if needed
489 Float_t amp = cells->GetCellAmplitude(id);
490 GetCaloUtils()->RecalibrateCellAmplitude(amp,fCalorimeter, id);
492 fhECellClusterRatio ->Fill(energy,amp/energy);
493 fhECellClusterLogRatio->Fill(energy,TMath::Log(amp/energy));
496 //Recalculate shower shape for different W0
497 if(fCalorimeter=="EMCAL"){
499 Float_t l0org = clus->GetM02();
500 Float_t l1org = clus->GetM20();
501 Float_t dorg = clus->GetDispersion();
503 for(Int_t iw = 0; iw < 14; iw++)
505 GetCaloUtils()->GetEMCALRecoUtils()->SetW0(1+iw*0.5);
506 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), cells, clus);
508 fhLambda0ForW0[iw]->Fill(energy,clus->GetM02());
509 //fhLambda1ForW0[iw]->Fill(energy,clus->GetM20());
513 // Set the original values back
516 clus->SetDispersion(dorg);
521 //__________________________________________
522 TObjString * AliAnaPi0EbE::GetAnalysisCuts()
524 //Save parameters used for analysis
525 TString parList ; //this will be list of parameters used for this analysis.
526 const Int_t buffersize = 255;
527 char onePar[buffersize] ;
529 snprintf(onePar,buffersize,"--- AliAnaPi0EbE ---\n") ;
531 snprintf(onePar,buffersize,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ;
534 if(fAnaType == kSSCalo)
536 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
538 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
540 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
542 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
546 //Get parameters set in base class.
547 parList += GetBaseParametersList() ;
549 //Get parameters set in PID class.
550 if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ;
552 return new TObjString(parList) ;
555 //_____________________________________________
556 TList * AliAnaPi0EbE::GetCreateOutputObjects()
558 // Create histograms to be saved in output file and
559 // store them in outputContainer
560 TList * outputContainer = new TList() ;
561 outputContainer->SetName("Pi0EbEHistos") ;
563 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
564 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
565 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
566 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
567 Int_t tdbins = GetHistogramRanges()->GetHistoDiffTimeBins() ; Float_t tdmax = GetHistogramRanges()->GetHistoDiffTimeMax(); Float_t tdmin = GetHistogramRanges()->GetHistoDiffTimeMin();
568 Int_t tbins = GetHistogramRanges()->GetHistoTimeBins() ; Float_t tmax = GetHistogramRanges()->GetHistoTimeMax(); Float_t tmin = GetHistogramRanges()->GetHistoTimeMin();
569 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
571 Int_t nmassbins = GetHistogramRanges()->GetHistoMassBins();
572 Float_t massmin = GetHistogramRanges()->GetHistoMassMin();
573 Float_t massmax = GetHistogramRanges()->GetHistoMassMax();
575 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
576 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
577 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
578 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
579 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
580 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
582 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
583 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
584 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
585 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
586 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
587 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
589 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins();
590 Float_t timemax = GetHistogramRanges()->GetHistoTimeMax();
591 Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
593 TString nlm[] ={"1 Local Maxima","2 Local Maxima", "NLM > 2"};
594 TString ptype[] ={"#gamma","#gamma->e^{#pm}","#pi^{0}","#eta","e^{#pm}", "hadron"};
595 TString pname[] ={"Photon","Conversion", "Pi0", "Eta", "Electron","Hadron"};
596 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins
598 fhPt = new TH1F("hPt","Number of identified #pi^{0} (#eta) decay",nptbins,ptmin,ptmax);
599 fhPt->SetYTitle("N");
600 fhPt->SetXTitle("p_{T} (GeV/c)");
601 outputContainer->Add(fhPt) ;
603 fhE = new TH1F("hE","Number of identified #pi^{0} (#eta) decay pairs",nptbins,ptmin,ptmax);
605 fhE->SetXTitle("E (GeV)");
606 outputContainer->Add(fhE) ;
609 ("hEPhi","Selected #pi^{0} (#eta) pairs: E vs #phi",nptbins,ptmin,ptmax, nphibins,phimin,phimax);
610 fhEPhi->SetYTitle("#phi (rad)");
611 fhEPhi->SetXTitle("E (GeV)");
612 outputContainer->Add(fhEPhi) ;
615 ("hEEta","Selected #pi^{0} (#eta) pairs: E vs #eta",nptbins,ptmin,ptmax,netabins,etamin,etamax);
616 fhEEta->SetYTitle("#eta");
617 fhEEta->SetXTitle("E (GeV)");
618 outputContainer->Add(fhEEta) ;
621 ("hEtaPhi","Selected #pi^{0} (#eta) pairs: #eta vs #phi",netabins,etamin,etamax, nphibins,phimin,phimax);
622 fhEtaPhi->SetYTitle("#phi (rad)");
623 fhEtaPhi->SetXTitle("#eta");
624 outputContainer->Add(fhEtaPhi) ;
626 if(fAnaType != kSSCalo)
628 fhPtDecay = new TH1F("hPtDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
629 fhPtDecay->SetYTitle("N");
630 fhPtDecay->SetXTitle("p_{T} (GeV/c)");
631 outputContainer->Add(fhPtDecay) ;
633 fhEDecay = new TH1F("hEDecay","Number of identified #pi^{0} (#eta) decay photons",nptbins,ptmin,ptmax);
634 fhEDecay->SetYTitle("N");
635 fhEDecay->SetXTitle("E (GeV)");
636 outputContainer->Add(fhEDecay) ;
641 if( fFillSelectClHisto )
644 fhEDispersion = new TH2F
645 ("hEDispersion","Selected #pi^{0} (#eta) pairs: E vs dispersion",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
646 fhEDispersion->SetYTitle("D^{2}");
647 fhEDispersion->SetXTitle("E (GeV)");
648 outputContainer->Add(fhEDispersion) ;
650 fhELambda0 = new TH2F
651 ("hELambda0","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
652 fhELambda0->SetYTitle("#lambda_{0}^{2}");
653 fhELambda0->SetXTitle("E (GeV)");
654 outputContainer->Add(fhELambda0) ;
656 fhELambda1 = new TH2F
657 ("hELambda1","Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
658 fhELambda1->SetYTitle("#lambda_{1}^{2}");
659 fhELambda1->SetXTitle("E (GeV)");
660 outputContainer->Add(fhELambda1) ;
662 fhELambda0FracMaxCellCut = new TH2F
663 ("hELambda0FracMaxCellCut","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy < 0.5",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
664 fhELambda0FracMaxCellCut->SetYTitle("#lambda_{0}^{2}");
665 fhELambda0FracMaxCellCut->SetXTitle("E (GeV)");
666 outputContainer->Add(fhELambda0FracMaxCellCut) ;
668 fhEFracMaxCell = new TH2F
669 ("hEFracMaxCell","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy",nptbins,ptmin,ptmax,100,0,1);
670 fhEFracMaxCell->SetYTitle("Fraction");
671 fhEFracMaxCell->SetXTitle("E (GeV)");
672 outputContainer->Add(fhEFracMaxCell) ;
674 if(fCalorimeter=="EMCAL")
676 fhELambda0NoTRD = new TH2F
677 ("hELambda0NoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, not behind TRD",nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
678 fhELambda0NoTRD->SetYTitle("#lambda_{0}^{2}");
679 fhELambda0NoTRD->SetXTitle("E (GeV)");
680 outputContainer->Add(fhELambda0NoTRD) ;
682 fhEFracMaxCellNoTRD = new TH2F
683 ("hEFracMaxCellNoTRD","Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, Max cell fraction of energy, not behind TRD",nptbins,ptmin,ptmax,100,0,1);
684 fhEFracMaxCellNoTRD->SetYTitle("Fraction");
685 fhEFracMaxCellNoTRD->SetXTitle("E (GeV)");
686 outputContainer->Add(fhEFracMaxCellNoTRD) ;
688 if(!fFillOnlySimpleSSHisto)
690 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);
691 fhDispEtaE->SetXTitle("E (GeV)");
692 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
693 outputContainer->Add(fhDispEtaE);
695 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);
696 fhDispPhiE->SetXTitle("E (GeV)");
697 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
698 outputContainer->Add(fhDispPhiE);
700 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);
701 fhSumEtaE->SetXTitle("E (GeV)");
702 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
703 outputContainer->Add(fhSumEtaE);
705 fhSumPhiE = new TH2F ("hSumPhiE","#sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
706 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
707 fhSumPhiE->SetXTitle("E (GeV)");
708 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
709 outputContainer->Add(fhSumPhiE);
711 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
712 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
713 fhSumEtaPhiE->SetXTitle("E (GeV)");
714 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
715 outputContainer->Add(fhSumEtaPhiE);
717 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
718 nptbins,ptmin,ptmax,200, -10,10);
719 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
720 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
721 outputContainer->Add(fhDispEtaPhiDiffE);
723 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
724 nptbins,ptmin,ptmax, 200, -1,1);
725 fhSphericityE->SetXTitle("E (GeV)");
726 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
727 outputContainer->Add(fhSphericityE);
729 for(Int_t i = 0; i < 7; i++)
731 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]),
732 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
733 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
734 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
735 outputContainer->Add(fhDispEtaDispPhi[i]);
737 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]),
738 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
739 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
740 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
741 outputContainer->Add(fhLambda0DispEta[i]);
743 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]),
744 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
745 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
746 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
747 outputContainer->Add(fhLambda0DispPhi[i]);
753 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
754 nptbins,ptmin,ptmax,10,0,10);
755 fhNLocMax ->SetYTitle("N maxima");
756 fhNLocMax ->SetXTitle("E (GeV)");
757 outputContainer->Add(fhNLocMax) ;
759 for (Int_t i = 0; i < 3; i++)
761 fhELambda0LocMax[i] = new TH2F(Form("hELambda0LocMax%d",i+1),
762 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{0}, %s",nlm[i].Data()),
763 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
764 fhELambda0LocMax[i]->SetYTitle("#lambda_{0}^{2}");
765 fhELambda0LocMax[i]->SetXTitle("E (GeV)");
766 outputContainer->Add(fhELambda0LocMax[i]) ;
768 fhELambda1LocMax[i] = new TH2F(Form("hELambda1LocMax%d",i+1),
769 Form("Selected #pi^{0} (#eta) pairs: E vs #lambda_{1}, %s",nlm[i].Data()),
770 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
771 fhELambda1LocMax[i]->SetYTitle("#lambda_{1}^{2}");
772 fhELambda1LocMax[i]->SetXTitle("E (GeV)");
773 outputContainer->Add(fhELambda1LocMax[i]) ;
775 fhEDispersionLocMax[i] = new TH2F(Form("hEDispersionLocMax%d",i+1),
776 Form("Selected #pi^{0} (#eta) pairs: E vs dispersion^{2}, %s",nlm[i].Data()),
777 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
778 fhEDispersionLocMax[i]->SetYTitle("dispersion^{2}");
779 fhEDispersionLocMax[i]->SetXTitle("E (GeV)");
780 outputContainer->Add(fhEDispersionLocMax[i]) ;
782 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
784 fhEDispEtaLocMax[i] = new TH2F(Form("hEDispEtaLocMax%d",i+1),
785 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #eta}, %s",nlm[i].Data()),
786 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
787 fhEDispEtaLocMax[i]->SetYTitle("#sigma_{#eta #eta}");
788 fhEDispEtaLocMax[i]->SetXTitle("E (GeV)");
789 outputContainer->Add(fhEDispEtaLocMax[i]) ;
791 fhEDispPhiLocMax[i] = new TH2F(Form("hEDispPhiLocMax%d",i+1),
792 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi}, %s",nlm[i].Data()),
793 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
794 fhEDispPhiLocMax[i]->SetYTitle("#sigma_{#phi #phi}");
795 fhEDispPhiLocMax[i]->SetXTitle("E (GeV)");
796 outputContainer->Add(fhEDispPhiLocMax[i]) ;
798 fhESumEtaPhiLocMax[i] = new TH2F(Form("hESumEtaPhiLocMax%d",i+1),
799 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#eta #phi}, %s",nlm[i].Data()),
800 nptbins,ptmin,ptmax,2*ssbins,-ssmax,ssmax);
801 fhESumEtaPhiLocMax[i]->SetYTitle("#sigma_{#eta #phi}");
802 fhESumEtaPhiLocMax[i]->SetXTitle("E (GeV)");
803 outputContainer->Add(fhESumEtaPhiLocMax[i]) ;
805 fhEDispEtaPhiDiffLocMax[i] = new TH2F(Form("hEDispEtaPhiDiffLocMax%d",i+1),
806 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta}, %s",nlm[i].Data()),
807 nptbins,ptmin,ptmax,200, -10,10);
808 fhEDispEtaPhiDiffLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta}");
809 fhEDispEtaPhiDiffLocMax[i]->SetXTitle("E (GeV)");
810 outputContainer->Add(fhEDispEtaPhiDiffLocMax[i]) ;
812 fhESphericityLocMax[i] = new TH2F(Form("hESphericityLocMax%d",i+1),
813 Form("Selected #pi^{0} (#eta) pairs: E vs #sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta}), %s",nlm[i].Data()),
814 nptbins,ptmin,ptmax,200, -1,1);
815 fhESphericityLocMax[i]->SetYTitle("#sigma_{#phi #phi} - #sigma_{#eta #eta} / (#sigma_{#phi #phi} + #sigma_{#eta #eta})");
816 fhESphericityLocMax[i]->SetXTitle("E (GeV)");
817 outputContainer->Add(fhESphericityLocMax[i]) ;
822 fhENCells = new TH2F ("hENCells","N cells in cluster vs E ", nptbins,ptmin,ptmax, nbins,nmin,nmax);
823 fhENCells->SetXTitle("E (GeV)");
824 fhENCells->SetYTitle("# of cells in cluster");
825 outputContainer->Add(fhENCells);
827 fhETime = new TH2F("hETime","cluster time vs pair E",nptbins,ptmin,ptmax, tbins,tmin,tmax);
828 fhETime->SetXTitle("E (GeV)");
829 fhETime->SetYTitle("t (ns)");
830 outputContainer->Add(fhETime);
834 if(fAnaType == kIMCalo)
836 fhEPairDiffTime = new TH2F("hEPairDiffTime","cluster pair time difference vs E",nptbins,ptmin,ptmax, tdbins,tdmin,tdmax);
837 fhEPairDiffTime->SetXTitle("E_{pair} (GeV)");
838 fhEPairDiffTime->SetYTitle("#Delta t (ns)");
839 outputContainer->Add(fhEPairDiffTime);
841 TString combiName [] = {"1LocMax","2LocMax","NLocMax","1LocMax2LocMax","1LocMaxNLocMax","2LocMaxNLocMax","1LocMaxSSBad","NLocMaxSSGood"};
842 TString combiTitle[] = {"1 Local Maxima in both clusters","2 Local Maxima in both clusters","more than 2 Local Maxima in both clusters",
843 "1 Local Maxima paired with 2 Local Maxima","1 Local Maxima paired with more than 2 Local Maxima",
844 "2 Local Maxima paired with more than 2 Local Maxima",
845 "1 Local Maxima paired with #lambda_{0}^{2}>0.3","N Local Maxima paired with 0.1<#lambda_{0}^{2}<0.3"};
847 for (Int_t i = 0; i < 8 ; i++)
850 if (fAnaType == kIMCaloTracks && i > 2 ) continue ;
852 fhMassPairLocMax[i] = new TH2F
853 (Form("MassPairLocMax%s",combiName[i].Data()),
854 Form("Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}, %s", combiTitle[i].Data()),
855 nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
856 fhMassPairLocMax[i]->SetYTitle("Mass (MeV/c^{2})");
857 fhMassPairLocMax[i]->SetXTitle("E_{pair} (GeV)");
858 outputContainer->Add(fhMassPairLocMax[i]) ;
864 fhTrackMatchedDEta = new TH2F
865 ("hTrackMatchedDEta",
866 "d#eta of cluster-track vs cluster energy",
867 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
868 fhTrackMatchedDEta->SetYTitle("d#eta");
869 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
871 fhTrackMatchedDPhi = new TH2F
872 ("hTrackMatchedDPhi",
873 "d#phi of cluster-track vs cluster energy",
874 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
875 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
876 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
878 fhTrackMatchedDEtaDPhi = new TH2F
879 ("hTrackMatchedDEtaDPhi",
880 "d#eta vs d#phi of cluster-track vs cluster energy",
881 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
882 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
883 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
885 outputContainer->Add(fhTrackMatchedDEta) ;
886 outputContainer->Add(fhTrackMatchedDPhi) ;
887 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
889 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
890 fhdEdx->SetXTitle("E (GeV)");
891 fhdEdx->SetYTitle("<dE/dx>");
892 outputContainer->Add(fhdEdx);
894 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
895 fhEOverP->SetXTitle("E (GeV)");
896 fhEOverP->SetYTitle("E/p");
897 outputContainer->Add(fhEOverP);
899 if(fCalorimeter=="EMCAL")
901 fhEOverPNoTRD = new TH2F ("hEOverPNoTRD","matched track E/p vs cluster E, SM not behind TRD ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
902 fhEOverPNoTRD->SetXTitle("E (GeV)");
903 fhEOverPNoTRD->SetYTitle("E/p");
904 outputContainer->Add(fhEOverPNoTRD);
907 if(IsDataMC() && fFillTMHisto)
909 fhTrackMatchedMCParticle = new TH2F
910 ("hTrackMatchedMCParticle",
911 "Origin of particle vs energy",
912 nptbins,ptmin,ptmax,8,0,8);
913 fhTrackMatchedMCParticle->SetXTitle("E (GeV)");
914 //fhTrackMatchedMCParticle->SetYTitle("Particle type");
916 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(1 ,"Photon");
917 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(2 ,"Electron");
918 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
919 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(4 ,"Rest");
920 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
921 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
922 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
923 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
925 outputContainer->Add(fhTrackMatchedMCParticle);
929 if(fFillWeightHistograms)
931 fhECellClusterRatio = new TH2F ("hECellClusterRatio"," cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
932 nptbins,ptmin,ptmax, 100,0,1.);
933 fhECellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
934 fhECellClusterRatio->SetYTitle("E_{cell i}/E_{cluster}");
935 outputContainer->Add(fhECellClusterRatio);
937 fhECellClusterLogRatio = new TH2F ("hECellClusterLogRatio"," Log(cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
938 nptbins,ptmin,ptmax, 100,-10,0);
939 fhECellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
940 fhECellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
941 outputContainer->Add(fhECellClusterLogRatio);
943 fhEMaxCellClusterRatio = new TH2F ("hEMaxCellClusterRatio"," max cell energy / cluster energy vs cluster energy, for selected decay photons from neutral meson",
944 nptbins,ptmin,ptmax, 100,0,1.);
945 fhEMaxCellClusterRatio->SetXTitle("E_{cluster} (GeV) ");
946 fhEMaxCellClusterRatio->SetYTitle("E_{max cell}/E_{cluster}");
947 outputContainer->Add(fhEMaxCellClusterRatio);
949 fhEMaxCellClusterLogRatio = new TH2F ("hEMaxCellClusterLogRatio"," Log(max cell energy / cluster energy) vs cluster energy, for selected decay photons from neutral meson",
950 nptbins,ptmin,ptmax, 100,-10,0);
951 fhEMaxCellClusterLogRatio->SetXTitle("E_{cluster} (GeV) ");
952 fhEMaxCellClusterLogRatio->SetYTitle("Log (E_{max cell}/E_{cluster})");
953 outputContainer->Add(fhEMaxCellClusterLogRatio);
955 for(Int_t iw = 0; iw < 14; iw++)
957 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),
958 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
959 fhLambda0ForW0[iw]->SetXTitle("E_{cluster}");
960 fhLambda0ForW0[iw]->SetYTitle("#lambda^{2}_{0}");
961 outputContainer->Add(fhLambda0ForW0[iw]);
963 // 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),
964 // nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
965 // fhLambda1ForW0[iw]->SetXTitle("E_{cluster}");
966 // fhLambda1ForW0[iw]->SetYTitle("#lambda^{2}_{1}");
967 // outputContainer->Add(fhLambda1ForW0[iw]);
974 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC && fAnaType==kSSCalo)
976 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",
977 nptbins,ptmin,ptmax,200,0,2);
978 fhMCPi0PtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
979 fhMCPi0PtGenRecoFraction->SetYTitle("E^{ #pi^{0} mother} / E^{rec}");
980 outputContainer->Add(fhMCPi0PtGenRecoFraction) ;
982 fhMCEtaPtGenRecoFraction = new TH2F("hMCEtaPtGenRecoFraction","Number of clusters from #eta (2 #gamma) identified as #pi^{0} (#eta),pT versus E primary #eta / E reco",
983 nptbins,ptmin,ptmax,200,0,2);
984 fhMCEtaPtGenRecoFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
985 fhMCEtaPtGenRecoFraction->SetYTitle("E^{ #eta mother} / E^{rec}");
986 outputContainer->Add(fhMCEtaPtGenRecoFraction) ;
988 fhMCPi0DecayPt = new TH1F("hMCPi0DecayPt","Number of #gamma from #pi^{0} decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
989 fhMCPi0DecayPt->SetYTitle("N");
990 fhMCPi0DecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
991 outputContainer->Add(fhMCPi0DecayPt) ;
993 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}",
994 nptbins,ptmin,ptmax,100,0,1);
995 fhMCPi0DecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
996 fhMCPi0DecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
997 outputContainer->Add(fhMCPi0DecayPtFraction) ;
999 fhMCEtaDecayPt = new TH1F("hMCEtaDecayPt","Number of #gamma from #eta decay identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1000 fhMCEtaDecayPt->SetYTitle("N");
1001 fhMCEtaDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1002 outputContainer->Add(fhMCEtaDecayPt) ;
1004 fhMCEtaDecayPtFraction = new TH2F("hMCEtaDecayPtFraction","Number of #gamma from #eta decay identified as #pi^{0} (#eta), pT versus E primary #gamma / E primary #eta",
1005 nptbins,ptmin,ptmax,100,0,1);
1006 fhMCEtaDecayPtFraction->SetXTitle("p^{rec}_{T} (GeV/c)");
1007 fhMCEtaDecayPtFraction->SetYTitle("E^{gen} / E^{gen-mother}");
1008 outputContainer->Add(fhMCEtaDecayPtFraction) ;
1010 fhMCOtherDecayPt = new TH1F("hMCOtherDecayPt","Number of #gamma decay (not #eta or #pi^{0}) identified as #pi^{0} (#eta)",nptbins,ptmin,ptmax);
1011 fhMCOtherDecayPt->SetYTitle("N");
1012 fhMCOtherDecayPt->SetXTitle("p^{rec}_{T} (GeV/c)");
1013 outputContainer->Add(fhMCOtherDecayPt) ;
1017 if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) ||
1018 GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1021 fhAnglePairMCPi0 = new TH2F
1023 "Angle between decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,250,0,0.5);
1024 fhAnglePairMCPi0->SetYTitle("#alpha (rad)");
1025 fhAnglePairMCPi0->SetXTitle("E_{pair} (GeV)");
1026 outputContainer->Add(fhAnglePairMCPi0) ;
1028 if (fAnaType!= kSSCalo)
1030 fhAnglePairMCEta = new TH2F
1032 "Angle between decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,250,0,0.5);
1033 fhAnglePairMCEta->SetYTitle("#alpha (rad)");
1034 fhAnglePairMCEta->SetXTitle("E_{pair} (GeV)");
1035 outputContainer->Add(fhAnglePairMCEta) ;
1037 fhMassPairMCPi0 = new TH2F
1039 "Mass for decay #gamma pair vs E_{pair}, origin #pi^{0}",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1040 fhMassPairMCPi0->SetYTitle("Mass (MeV/c^{2})");
1041 fhMassPairMCPi0->SetXTitle("E_{pair} (GeV)");
1042 outputContainer->Add(fhMassPairMCPi0) ;
1044 fhMassPairMCEta = new TH2F
1046 "Mass for decay #gamma pair vs E_{pair}, origin #eta",nptbins,ptmin,ptmax,nmassbins,massmin,massmax);
1047 fhMassPairMCEta->SetYTitle("Mass (MeV/c^{2})");
1048 fhMassPairMCEta->SetXTitle("E_{pair} (GeV)");
1049 outputContainer->Add(fhMassPairMCEta) ;
1052 for(Int_t i = 0; i < 6; i++)
1055 fhMCPt[i] = new TH1F
1056 (Form("hPt_MC%s",pname[i].Data()),
1057 Form("Identified as #pi^{0} (#eta), cluster from %s",
1059 nptbins,ptmin,ptmax);
1060 fhMCPt[i]->SetYTitle("N");
1061 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1062 outputContainer->Add(fhMCPt[i]) ;
1064 fhMCPhi[i] = new TH2F
1065 (Form("hPhi_MC%s",pname[i].Data()),
1066 Form("Identified as #pi^{0} (#eta), cluster from %s",ptype[i].Data()),
1067 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1068 fhMCPhi[i]->SetYTitle("#phi");
1069 fhMCPhi[i]->SetXTitle("p_{T} (GeV/c)");
1070 outputContainer->Add(fhMCPhi[i]) ;
1072 fhMCEta[i] = new TH2F
1073 (Form("hEta_MC%s",pname[i].Data()),
1074 Form("Identified as #pi^{0} (#eta), cluster from %s",
1075 ptype[i].Data()),nptbins,ptmin,ptmax,netabins,etamin,etamax);
1076 fhMCEta[i]->SetYTitle("#eta");
1077 fhMCEta[i]->SetXTitle("p_{T} (GeV/c)");
1078 outputContainer->Add(fhMCEta[i]) ;
1081 if( fFillSelectClHisto )
1083 fhEMCLambda0[i] = new TH2F(Form("hELambda0_MC%s",pname[i].Data()),
1084 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}",ptype[i].Data()),
1085 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1086 fhEMCLambda0[i]->SetYTitle("#lambda_{0}^{2}");
1087 fhEMCLambda0[i]->SetXTitle("E (GeV)");
1088 outputContainer->Add(fhEMCLambda0[i]) ;
1090 fhEMCLambda1[i] = new TH2F(Form("hELambda1_MC%s",pname[i].Data()),
1091 Form("Selected pair, cluster from %s : E vs #lambda_{1}^{2}",ptype[i].Data()),
1092 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1093 fhEMCLambda1[i]->SetYTitle("#lambda_{1}^{2}");
1094 fhEMCLambda1[i]->SetXTitle("E (GeV)");
1095 outputContainer->Add(fhEMCLambda1[i]) ;
1097 fhEMCDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pname[i].Data()),
1098 Form("Selected pair, cluster from %s : E vs dispersion^{2}",ptype[i].Data()),
1099 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1100 fhEMCDispersion[i]->SetYTitle("D^{2}");
1101 fhEMCDispersion[i]->SetXTitle("E (GeV)");
1102 outputContainer->Add(fhEMCDispersion[i]) ;
1104 if(fCalorimeter=="EMCAL")
1106 fhEMCLambda0NoTRD[i] = new TH2F(Form("hELambda0NoTRD_MC%s",pname[i].Data()),
1107 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, NoTRD",ptype[i].Data()),
1108 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1109 fhEMCLambda0NoTRD[i]->SetYTitle("#lambda_{0}^{2}");
1110 fhEMCLambda0NoTRD[i]->SetXTitle("E (GeV)");
1111 outputContainer->Add(fhEMCLambda0NoTRD[i]) ;
1113 if(!fFillOnlySimpleSSHisto)
1115 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pname[i].Data()),
1116 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptype[i].Data()),
1117 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1118 fhMCEDispEta[i]->SetXTitle("E (GeV)");
1119 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1120 outputContainer->Add(fhMCEDispEta[i]);
1122 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pname[i].Data()),
1123 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptype[i].Data()),
1124 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1125 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
1126 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1127 outputContainer->Add(fhMCEDispPhi[i]);
1129 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pname[i].Data()),
1130 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()),
1131 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1132 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
1133 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
1134 outputContainer->Add(fhMCESumEtaPhi[i]);
1136 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pname[i].Data()),
1137 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptype[i].Data()),
1138 nptbins,ptmin,ptmax,200,-10,10);
1139 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
1140 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1141 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
1143 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pname[i].Data()),
1144 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()),
1145 nptbins,ptmin,ptmax, 200,-1,1);
1146 fhMCESphericity[i]->SetXTitle("E (GeV)");
1147 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1148 outputContainer->Add(fhMCESphericity[i]);
1150 for(Int_t ie = 0; ie < 7; ie++)
1152 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1153 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]),
1154 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1155 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1156 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1157 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
1159 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pname[i].Data()),
1160 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]),
1161 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1162 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
1163 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1164 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
1166 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1167 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]),
1168 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1169 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
1170 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1171 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
1177 fhEMCLambda0FracMaxCellCut[i] = new TH2F(Form("hELambda0FracMaxCellCut_MC%s",pname[i].Data()),
1178 Form("Selected pair, cluster from %s : E vs #lambda_{0}^{2}, Max cell fraction of energy < 0.5 ",ptype[i].Data()),
1179 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1180 fhEMCLambda0FracMaxCellCut[i]->SetYTitle("#lambda_{0}^{2}");
1181 fhEMCLambda0FracMaxCellCut[i]->SetXTitle("E (GeV)");
1182 outputContainer->Add(fhEMCLambda0FracMaxCellCut[i]) ;
1184 fhEMCFracMaxCell[i] = new TH2F(Form("hEFracMaxCell_MC%s",pname[i].Data()),
1185 Form("Selected pair, cluster from %s : E vs Max cell fraction of energy",ptype[i].Data()),
1186 nptbins,ptmin,ptmax,100,0,1);
1187 fhEMCFracMaxCell[i]->SetYTitle("Fraction");
1188 fhEMCFracMaxCell[i]->SetXTitle("E (GeV)");
1189 outputContainer->Add(fhEMCFracMaxCell[i]) ;
1192 } // shower shape histo
1198 if(fAnaType==kSSCalo && fFillSelectClHisto && !fFillOnlySimpleSSHisto )
1201 fhAsymmetryE = new TH2F ("hAsymmetryE","A = ( E1 - E2 ) / ( E1 + E2 ) vs E",
1202 nptbins,ptmin,ptmax, 200, -1,1);
1203 fhAsymmetryE->SetXTitle("E (GeV)");
1204 fhAsymmetryE->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1205 outputContainer->Add(fhAsymmetryE);
1207 for(Int_t i = 0; i< 3; i++)
1209 fhEAsymmetryLocMax[i] = new TH2F(Form("hEAsymmetryLocMax%d",i+1),
1210 Form("Selected #pi^{0} (#eta) pairs: E vs A = ( E1 - E2 ) / ( E1 + E2 ), %s",nlm[i].Data()),
1211 nptbins,ptmin,ptmax,200, -1,1);
1212 fhEAsymmetryLocMax[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1213 fhEAsymmetryLocMax[i]->SetXTitle("E (GeV)");
1214 outputContainer->Add(fhEAsymmetryLocMax[i]) ;
1217 for(Int_t ie = 0; ie< 7; ie++)
1220 fhAsymmetryLambda0[ie] = new TH2F (Form("hAsymmetryLambda0_EBin%d",ie),
1221 Form("#lambda_{0}^{2} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1222 ssbins,ssmin,ssmax , 200,-1,1);
1223 fhAsymmetryLambda0[ie]->SetXTitle("#lambda_{0}^{2}");
1224 fhAsymmetryLambda0[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1225 outputContainer->Add(fhAsymmetryLambda0[ie]);
1227 fhAsymmetryDispEta[ie] = new TH2F (Form("hAsymmetryDispEta_EBin%d",ie),
1228 Form("#sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1229 ssbins,ssmin,ssmax , 200,-1,1);
1230 fhAsymmetryDispEta[ie]->SetXTitle("#sigma^{2}_{#eta #eta}");
1231 fhAsymmetryDispEta[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1232 outputContainer->Add(fhAsymmetryDispEta[ie]);
1234 fhAsymmetryDispPhi[ie] = new TH2F (Form("hAsymmetryDispPhi_EBin%d",ie),
1235 Form("#sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",bin[ie],bin[ie+1]),
1236 ssbins,ssmin,ssmax , 200,-1,1);
1237 fhAsymmetryDispPhi[ie]->SetXTitle("#sigma^{2}_{#phi #phi}");
1238 fhAsymmetryDispPhi[ie]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1239 outputContainer->Add(fhAsymmetryDispPhi[ie]);
1245 for(Int_t i = 0; i< 6; i++)
1247 fhMCEAsymmetry[i] = new TH2F (Form("hEAsymmetry_MC%s",pname[i].Data()),
1248 Form("cluster from %s : A = ( E1 - E2 ) / ( E1 + E2 ) vs E",ptype[i].Data()),
1249 nptbins,ptmin,ptmax, 200,-1,1);
1250 fhMCEAsymmetry[i]->SetXTitle("E (GeV)");
1251 fhMCEAsymmetry[i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1252 outputContainer->Add(fhMCEAsymmetry[i]);
1254 for(Int_t ie = 0; ie < 7; ie++)
1256 fhMCAsymmetryLambda0[ie][i] = new TH2F (Form("hMCAsymmetryLambda0_EBin%d_MC%s",ie,pname[i].Data()),
1257 Form("cluster from %s : #lambda_{0}^{2} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1258 ssbins,ssmin,ssmax , 200,-1,1);
1259 fhMCAsymmetryLambda0[ie][i]->SetXTitle("#lambda_{0}^{2}");
1260 fhMCAsymmetryLambda0[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1261 outputContainer->Add(fhMCAsymmetryLambda0[ie][i]);
1263 fhMCAsymmetryDispEta[ie][i] = new TH2F (Form("hMCAsymmetryDispEta_EBin%d_MC%s",ie,pname[i].Data()),
1264 Form("cluster from %s : #sigma^{2}_{#eta #eta} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1265 ssbins,ssmin,ssmax , 200,-1,1);
1266 fhMCAsymmetryDispEta[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1267 fhMCAsymmetryDispEta[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1268 outputContainer->Add(fhMCAsymmetryDispEta[ie][i]);
1270 fhMCAsymmetryDispPhi[ie][i] = new TH2F (Form("hMCAsymmetryDispPhi_EBin%d_MC%s",ie,pname[i].Data()),
1271 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs A for %d < E < %d GeV",pname[i].Data(),bin[ie],bin[ie+1]),
1272 ssbins,ssmin,ssmax , 200,-1,1);
1273 fhMCAsymmetryDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#phi #phi}");
1274 fhMCAsymmetryDispPhi[ie][i]->SetYTitle("A = ( E1 - E2 ) / ( E1 + E2 )");
1275 outputContainer->Add(fhMCAsymmetryDispPhi[ie][i]);
1281 if(fFillPileUpHistograms)
1283 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1284 fhTimeENoCut->SetXTitle("E (GeV)");
1285 fhTimeENoCut->SetYTitle("time (ns)");
1286 outputContainer->Add(fhTimeENoCut);
1288 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1289 fhTimeESPD->SetXTitle("E (GeV)");
1290 fhTimeESPD->SetYTitle("time (ns)");
1291 outputContainer->Add(fhTimeESPD);
1293 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1294 fhTimeESPDMulti->SetXTitle("E (GeV)");
1295 fhTimeESPDMulti->SetYTitle("time (ns)");
1296 outputContainer->Add(fhTimeESPDMulti);
1298 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1299 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
1300 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
1301 outputContainer->Add(fhTimeNPileUpVertSPD);
1303 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
1304 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
1305 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
1306 outputContainer->Add(fhTimeNPileUpVertTrack);
1308 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
1309 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
1310 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
1311 outputContainer->Add(fhTimeNPileUpVertContributors);
1313 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);
1314 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
1315 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
1316 outputContainer->Add(fhTimePileUpMainVertexZDistance);
1318 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
1319 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
1320 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
1321 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
1325 //Keep neutral meson selection histograms if requiered
1326 //Setting done in AliNeutralMesonSelection
1328 if(fAnaType!=kSSCalo && GetNeutralMesonSelection())
1330 TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ;
1332 if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept())
1333 for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ;
1338 return outputContainer ;
1342 //_____________________________________________
1343 Int_t AliAnaPi0EbE::GetMCIndex(const Int_t tag)
1346 // Assign mc index depending on MC bit set
1348 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) )
1352 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) )
1356 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
1357 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1359 return kmcConversion ;
1360 }//conversion photon
1361 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) )
1364 }//photon no conversion
1365 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron))
1367 return kmcElectron ;
1376 //__________________________________________________________________
1377 void AliAnaPi0EbE::HasPairSameMCMother(AliAODPWG4Particle * photon1,
1378 AliAODPWG4Particle * photon2,
1379 Int_t & label, Int_t & tag)
1381 // Check the labels of pare in case mother was same pi0 or eta
1382 // Set the new AOD accordingly
1384 Int_t label1 = photon1->GetLabel();
1385 Int_t label2 = photon2->GetLabel();
1387 if(label1 < 0 || label2 < 0 ) return ;
1389 //Int_t tag1 = GetMCAnalysisUtils()->CheckOrigin(label1, GetReader(), photon1->GetInputFileIndex());
1390 //Int_t tag2 = GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(), photon2->GetInputFileIndex());
1391 Int_t tag1 = photon1->GetTag();
1392 Int_t tag2 = photon2->GetTag();
1394 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Origin of: photon1 %d; photon2 %d \n",tag1, tag2);
1395 if( (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay) &&
1396 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCPi0Decay) ) ||
1397 (GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCEtaDecay) &&
1398 GetMCAnalysisUtils()->CheckTagBit(tag2,AliMCAnalysisUtils::kMCEtaDecay) )
1402 //Check if pi0/eta mother is the same
1403 if(GetReader()->ReadStack())
1407 TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree
1408 label1 = mother1->GetFirstMother();
1409 //mother1 = GetMCStack()->Particle(label1);//pi0
1413 TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree
1414 label2 = mother2->GetFirstMother();
1415 //mother2 = GetMCStack()->Particle(label2);//pi0
1418 else if(GetReader()->ReadAODMCParticles())
1419 {//&& (input > -1)){
1422 AliAODMCParticle * mother1 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon1->GetInputFileIndex()))->At(label1);//photon in kine tree
1423 label1 = mother1->GetMother();
1424 //mother1 = GetMCStack()->Particle(label1);//pi0
1428 AliAODMCParticle * mother2 = (AliAODMCParticle *) (GetReader()->GetAODMCParticles(photon2->GetInputFileIndex()))->At(label2);//photon in kine tree
1429 label2 = mother2->GetMother();
1430 //mother2 = GetMCStack()->Particle(label2);//pi0
1434 //printf("mother1 %d, mother2 %d\n",label1,label2);
1435 if( label1 == label2 && label1>=0 )
1440 TLorentzVector mom1 = *(photon1->Momentum());
1441 TLorentzVector mom2 = *(photon2->Momentum());
1443 Double_t angle = mom2.Angle(mom1.Vect());
1444 Double_t mass = (mom1+mom2).M();
1445 Double_t epair = (mom1+mom2).E();
1447 if(GetMCAnalysisUtils()->CheckTagBit(tag1,AliMCAnalysisUtils::kMCPi0Decay))
1449 fhMassPairMCPi0 ->Fill(epair,mass);
1450 fhAnglePairMCPi0->Fill(epair,angle);
1451 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCPi0);
1455 fhMassPairMCEta ->Fill(epair,mass);
1456 fhAnglePairMCEta->Fill(epair,angle);
1457 GetMCAnalysisUtils()->SetTagBit(tag,AliMCAnalysisUtils::kMCEta);
1461 } // both from eta or pi0 decay
1465 //____________________________________________________________________________
1466 void AliAnaPi0EbE::Init()
1470 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
1471 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
1474 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
1475 printf("AliAnaPi0EbE::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
1481 //____________________________________________________________________________
1482 void AliAnaPi0EbE::InitParameters()
1484 //Initialize the parameters of the analysis.
1485 AddToHistogramsName("AnaPi0EbE_");
1487 fInputAODGammaConvName = "PhotonsCTS" ;
1488 fAnaType = kIMCalo ;
1489 fCalorimeter = "EMCAL" ;
1496 //__________________________________________________________________
1497 void AliAnaPi0EbE::MakeAnalysisFillAOD()
1499 //Do analysis and fill aods
1504 MakeInvMassInCalorimeter();
1508 MakeShowerShapeIdentification();
1512 MakeInvMassInCalorimeterAndCTS();
1518 //____________________________________________
1519 void AliAnaPi0EbE::MakeInvMassInCalorimeter()
1521 //Do analysis and fill aods
1522 //Search for the photon decay in calorimeters
1523 //Read photon list from AOD, produced in class AliAnaPhoton
1524 //Check if 2 photons have the mass of the pi0.
1526 TLorentzVector mom1;
1527 TLorentzVector mom2;
1528 TLorentzVector mom ;
1533 if(!GetInputAODBranch()){
1534 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data());
1538 //Get shower shape information of clusters
1539 TObjArray *clusters = 0;
1540 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1541 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1543 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast()-1; iphoton++){
1544 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1546 //Vertex cut in case of mixed events
1547 Int_t evtIndex1 = 0 ;
1549 evtIndex1 = GetMixedEvent()->EventIndexForCaloCluster(photon1->GetCaloLabel(0)) ;
1550 if(TMath::Abs(GetVertex(evtIndex1)[2]) > GetZvertexCut()) continue ; //vertex cut
1551 mom1 = *(photon1->Momentum());
1553 //Get original cluster, to recover some information
1555 AliVCluster *cluster1 = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1558 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - First cluster not found\n");
1562 for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast(); jphoton++)
1564 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(jphoton));
1566 Int_t evtIndex2 = 0 ;
1568 evtIndex2 = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1570 if(GetMixedEvent() && (evtIndex1 == evtIndex2))
1573 if(TMath::Abs(GetVertex(evtIndex2)[2]) > GetZvertexCut()) continue ; //vertex cut
1575 mom2 = *(photon2->Momentum());
1577 //Get original cluster, to recover some information
1579 AliVCluster *cluster2 = FindCluster(clusters,photon2->GetCaloLabel(0),iclus2,iclus+1);
1583 printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - Second cluster not found\n");
1587 Float_t e1 = photon1->E();
1588 Float_t e2 = photon2->E();
1590 //Select clusters with good time window difference
1591 Float_t tof1 = cluster1->GetTOF()*1e9;;
1592 Float_t tof2 = cluster2->GetTOF()*1e9;;
1593 Double_t t12diff = tof1-tof2;
1594 fhEPairDiffTime->Fill(e1+e2, t12diff);
1595 if(TMath::Abs(t12diff) > GetPairTimeCut()) continue;
1597 //Play with the MC stack if available
1598 if(IsDataMC()) HasPairSameMCMother(photon1, photon2, label, tag) ;
1600 // Check the invariant mass for different selection on the local maxima
1601 // Name of AOD method TO BE FIXED
1602 Int_t nMaxima1 = photon1->GetFiducialArea();
1603 Int_t nMaxima2 = photon2->GetFiducialArea();
1605 Double_t mass = (mom1+mom2).M();
1606 Double_t epair = (mom1+mom2).E();
1608 if(nMaxima1==nMaxima2)
1610 if (nMaxima1==1) fhMassPairLocMax[0]->Fill(epair,mass);
1611 else if(nMaxima1==2) fhMassPairLocMax[1]->Fill(epair,mass);
1612 else fhMassPairLocMax[2]->Fill(epair,mass);
1614 else if(nMaxima1==1 || nMaxima2==1)
1616 if (nMaxima1==2 || nMaxima2==2) fhMassPairLocMax[3]->Fill(epair,mass);
1617 else fhMassPairLocMax[4]->Fill(epair,mass);
1620 fhMassPairLocMax[5]->Fill(epair,mass);
1622 // combinations with SS axis cut and NLM cut
1623 if(nMaxima1 == 1 && cluster2->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1624 if(nMaxima2 == 1 && cluster1->GetM02() > 0.3) fhMassPairLocMax[6]->Fill(epair,mass);
1625 if(nMaxima1 > 1 && cluster2->GetM02() < 0.3 && cluster2->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1626 if(nMaxima2 > 1 && cluster1->GetM02() < 0.3 && cluster1->GetM02()> 0.1 ) fhMassPairLocMax[7]->Fill(epair,mass);
1628 //Skip events with too few or too many NLM
1629 if((nMaxima1 < fNLMCutMin || nMaxima1 > fNLMCutMax) || (nMaxima2 < fNLMCutMin || nMaxima2 > fNLMCutMax)) continue ;
1631 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - NLM of out of range: cluster1 %d, cluster2 %d \n",nMaxima1, nMaxima2);
1634 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1635 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1638 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());
1640 //Fill some histograms about shower shape
1641 if(fFillSelectClHisto && clusters && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1643 FillSelectedClusterHistograms(cluster1, nMaxima1, photon1->GetTag());
1644 FillSelectedClusterHistograms(cluster2, nMaxima2, photon2->GetTag());
1647 // Tag both photons as decay
1648 photon1->SetTagged(kTRUE);
1649 photon2->SetTagged(kTRUE);
1651 fhPtDecay->Fill(photon1->Pt());
1652 fhEDecay ->Fill(photon1->E() );
1654 fhPtDecay->Fill(photon2->Pt());
1655 fhEDecay ->Fill(photon2->E() );
1657 //Create AOD for analysis
1660 // Fill histograms to undertand pile-up before other cuts applied
1661 // Remember to relax time cuts in the reader
1662 FillPileUpHistograms(mom.E(),((cluster1->GetTOF()+cluster2->GetTOF())*1e9) /2);
1664 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1666 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1667 pi0.SetDetector(photon1->GetDetector());
1670 pi0.SetLabel(label);
1673 //Set the indeces of the original caloclusters
1674 pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0));
1675 //pi0.SetInputFileIndex(input);
1677 AddAODParticle(pi0);
1685 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeter() - End fill AODs \n");
1689 //__________________________________________________
1690 void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS()
1692 //Do analysis and fill aods
1693 //Search for the photon decay in calorimeters
1694 //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion
1695 //Check if 2 photons have the mass of the pi0.
1697 TLorentzVector mom1;
1698 TLorentzVector mom2;
1699 TLorentzVector mom ;
1704 // Check calorimeter input
1705 if(!GetInputAODBranch()){
1706 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data());
1710 // Get the array with conversion photons
1711 TClonesArray * inputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName);
1712 if(!inputAODGammaConv) {
1714 inputAODGammaConv = (TClonesArray *) GetReader()->GetInputEvent()->FindListObject(fInputAODGammaConvName);
1716 if(!inputAODGammaConv) {
1717 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - No input gamma conversions in AOD branch with name < %s >\n",fInputAODGammaConvName.Data());
1723 //Get shower shape information of clusters
1724 TObjArray *clusters = 0;
1725 if (fCalorimeter=="EMCAL") clusters = GetEMCALClusters();
1726 else if(fCalorimeter=="PHOS") clusters = GetPHOSClusters() ;
1728 Int_t nCTS = inputAODGammaConv->GetEntriesFast();
1729 Int_t nCalo = GetInputAODBranch()->GetEntriesFast();
1730 if(nCTS<=0 || nCalo <=0)
1732 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - nCalo %d, nCTS %d, cannot loop\n",nCalo,nCTS);
1737 printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Number of conversion photons %d\n",nCTS);
1739 // Do the loop, first calo, second CTS
1740 for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){
1741 AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton));
1742 mom1 = *(photon1->Momentum());
1744 //Get original cluster, to recover some information
1746 AliVCluster *cluster = FindCluster(clusters,photon1->GetCaloLabel(0),iclus);
1748 for(Int_t jphoton = 0; jphoton < nCTS; jphoton++){
1749 AliAODPWG4Particle * photon2 = (AliAODPWG4Particle*) (inputAODGammaConv->At(jphoton));
1751 evtIndex = GetMixedEvent()->EventIndexForCaloCluster(photon2->GetCaloLabel(0)) ;
1752 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
1754 mom2 = *(photon2->Momentum());
1756 Double_t mass = (mom1+mom2).M();
1757 Double_t epair = (mom1+mom2).E();
1759 Int_t nMaxima = photon1->GetFiducialArea();
1760 if (nMaxima==1) fhMassPairLocMax[0]->Fill(epair,mass);
1761 else if(nMaxima==2) fhMassPairLocMax[1]->Fill(epair,mass);
1762 else fhMassPairLocMax[2]->Fill(epair,mass);
1764 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) continue ;
1765 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - NLM %d of out of range \n",nMaxima);
1767 //Play with the MC stack if available
1770 Int_t label2 = photon2->GetLabel();
1771 if(label2 >= 0 )photon2->SetTag(GetMCAnalysisUtils()->CheckOrigin(label2, GetReader(), photon2->GetInputFileIndex()));
1773 HasPairSameMCMother(photon1, photon2, label, tag) ;
1776 //Select good pair (good phi, pt cuts, aperture and invariant mass)
1777 if(GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter))
1779 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());
1781 //Fill some histograms about shower shape
1782 if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1784 FillSelectedClusterHistograms(cluster, nMaxima, photon1->GetTag());
1787 // Tag both photons as decay
1788 photon1->SetTagged(kTRUE);
1789 photon2->SetTagged(kTRUE);
1791 fhPtDecay->Fill(photon1->Pt());
1792 fhEDecay ->Fill(photon1->E() );
1794 //Create AOD for analysis
1798 // Fill histograms to undertand pile-up before other cuts applied
1799 // Remember to relax time cuts in the reader
1800 FillPileUpHistograms(mom.E(),cluster->GetTOF()*1e9);
1802 AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom);
1804 pi0.SetIdentifiedParticleType(AliCaloPID::kPi0);
1805 pi0.SetDetector(photon1->GetDetector());
1808 pi0.SetLabel(label);
1811 //Set the indeces of the original tracks or caloclusters
1812 pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1);
1813 pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1));
1814 //pi0.SetInputFileIndex(input);
1816 AddAODParticle(pi0);
1823 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - End fill AODs \n");
1828 //_________________________________________________
1829 void AliAnaPi0EbE::MakeShowerShapeIdentification()
1831 //Search for pi0 in fCalorimeter with shower shape analysis
1833 TObjArray * pl = 0x0;
1834 AliVCaloCells * cells = 0x0;
1835 //Select the Calorimeter of the photon
1836 if (fCalorimeter == "PHOS" )
1838 pl = GetPHOSClusters();
1839 cells = GetPHOSCells();
1841 else if (fCalorimeter == "EMCAL")
1843 pl = GetEMCALClusters();
1844 cells = GetEMCALCells();
1849 Info("MakeShowerShapeIdentification","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
1853 TLorentzVector mom ;
1854 for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++)
1856 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
1858 Int_t evtIndex = 0 ;
1859 if (GetMixedEvent())
1861 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
1864 if(TMath::Abs(GetVertex(evtIndex)[2]) > GetZvertexCut()) continue ; //vertex cut
1866 //Get Momentum vector,
1867 Double_t vertex[]={0,0,0};
1868 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1870 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
1871 }//Assume that come from vertex in straight line
1874 calo->GetMomentum(mom,vertex) ;
1877 //If too small or big pt, skip it
1878 if(mom.E() < GetMinEnergy() || mom.E() > GetMaxEnergy() ) continue ;
1880 //Check acceptance selection
1881 if(IsFiducialCutOn())
1883 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
1884 if(! in ) continue ;
1888 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());
1890 //Check Distance to Bad channel, set bit.
1891 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
1892 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
1893 if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm)
1896 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - FillAOD: Bad channel cut passed %4.2f\n",distBad);
1898 //.......................................
1899 // TOF cut, BE CAREFUL WITH THIS CUT
1900 Double_t tof = calo->GetTOF()*1e9;
1901 if(tof < fTimeCutMin || tof > fTimeCutMax) continue ;
1903 //Skip matched clusters with tracks
1904 if(IsTrackMatched(calo, GetReader()->GetInputEvent())) continue ;
1908 //PID selection or bit setting
1910 Double_t mass = 0 , angle = 0;
1911 Double_t e1 = 0 , e2 = 0;
1912 Int_t idPartType = GetCaloPID()->GetIdentifiedParticleTypeFromClusterSplitting(calo,cells,GetCaloUtils(),
1913 GetVertex(evtIndex),nMaxima,
1916 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - PDG of identified particle %d\n",idPartType);
1918 //Skip events with too few or too many NLM
1919 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) continue ;
1922 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - NLM %d accepted \n",nMaxima);
1924 // If cluster does not pass pid, not pi0/eta, skip it.
1925 if (GetOutputAODName().Contains("Pi0") && idPartType != AliCaloPID::kPi0)
1927 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Pi0\n");
1931 else if(GetOutputAODName().Contains("Eta") && idPartType != AliCaloPID::kEta)
1933 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Cluster is not Eta\n");
1938 printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Pi0/Eta selection cuts passed: pT %3.2f, pdg %d\n",
1939 mom.Pt(), idPartType);
1941 //-----------------------
1942 //Create AOD for analysis
1944 AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom);
1945 aodpi0.SetLabel(calo->GetLabel());
1947 //Set the indeces of the original caloclusters
1948 aodpi0.SetCaloLabel(calo->GetID(),-1);
1949 aodpi0.SetDetector(fCalorimeter);
1951 if (distBad > fMinDist3) aodpi0.SetDistToBad(2) ;
1952 else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ;
1953 else aodpi0.SetDistToBad(0) ;
1955 // Check if cluster is pi0 via cluster splitting
1956 aodpi0.SetIdentifiedParticleType(idPartType);
1958 // Add number of local maxima to AOD, method name in AOD to be FIXED
1959 aodpi0.SetFiducialArea(nMaxima);
1961 //Play with the MC stack if available
1962 //Check origin of the candidates
1966 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodpi0.GetInputFileIndex());
1967 //GetMCAnalysisUtils()->CheckMultipleOrigin(calo->GetLabels(),calo->GetNLabels(), GetReader(), aodpi0.GetInputFileIndex(), tag);
1969 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - Origin of candidate %d\n",aodpi0.GetTag());
1970 }//Work with stack also
1972 //Fill some histograms about shower shape
1973 if(fFillSelectClHisto && GetReader()->GetDataType()!=AliCaloTrackReader::kMC)
1976 if(e1+e2 > 0 ) asy = (e1-e2) / (e1+e2);
1977 FillSelectedClusterHistograms(calo, nMaxima, tag, asy);
1980 // Fill histograms to undertand pile-up before other cuts applied
1981 // Remember to relax time cuts in the reader
1982 FillPileUpHistograms(calo->E(),calo->GetTOF()*1e9);
1984 //Add AOD with pi0 object to aod branch
1985 AddAODParticle(aodpi0);
1989 if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeShowerShapeIdentification() - End fill AODs \n");
1992 //______________________________________________
1993 void AliAnaPi0EbE::MakeAnalysisFillHistograms()
1995 //Do analysis and fill histograms
1997 if(!GetOutputAODBranch())
1999 printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data());
2002 //Loop on stored AOD pi0
2003 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2004 if(GetDebug() > 0) printf("AliAnaPi0EbE::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2006 for(Int_t iaod = 0; iaod < naod ; iaod++)
2009 AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2010 Int_t pdg = pi0->GetIdentifiedParticleType();
2012 if(IsCaloPIDOn() && pdg != AliCaloPID::kPi0) continue;
2014 //Fill pi0 histograms
2015 Float_t ener = pi0->E();
2016 Float_t pt = pi0->Pt();
2017 Float_t phi = pi0->Phi();
2018 if(phi < 0) phi+=TMath::TwoPi();
2019 Float_t eta = pi0->Eta();
2024 fhEEta ->Fill(ener,eta);
2025 fhEPhi ->Fill(ener,phi);
2026 fhEtaPhi ->Fill(eta,phi);
2030 Int_t tag = pi0->GetTag();
2031 Int_t mcIndex = GetMCIndex(tag);
2033 fhMCPt [mcIndex] ->Fill(pt);
2034 fhMCPhi[mcIndex] ->Fill(pt,phi);
2035 fhMCEta[mcIndex] ->Fill(pt,eta);
2037 if((mcIndex==kmcPhoton || mcIndex==kmcPi0 || mcIndex==kmcEta) && fAnaType==kSSCalo)
2039 Float_t efracMC = 0;
2040 Int_t label = pi0->GetLabel();
2043 TLorentzVector mom = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2046 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0))
2048 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2049 if(grandmom.E() > 0 && ok)
2051 efracMC = grandmom.E()/ener;
2052 fhMCPi0PtGenRecoFraction ->Fill(pt,efracMC);
2055 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay))
2057 fhMCPi0DecayPt->Fill(pt);
2058 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,111,GetReader(),ok);
2059 if(grandmom.E() > 0 && ok)
2061 efracMC = mom.E()/grandmom.E();
2062 fhMCPi0DecayPtFraction ->Fill(pt,efracMC);
2065 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
2067 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2068 if(grandmom.E() > 0 && ok)
2070 efracMC = grandmom.E()/ener;
2071 fhMCEtaPtGenRecoFraction ->Fill(pt,efracMC);
2074 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay))
2076 fhMCEtaDecayPt->Fill(pt);
2077 TLorentzVector grandmom = GetMCAnalysisUtils()->GetMotherWithPDG(label,221,GetReader(),ok);
2078 if(grandmom.E() > 0 && ok)
2080 efracMC = mom.E()/grandmom.E();
2081 fhMCEtaDecayPtFraction ->Fill(pt,efracMC);
2084 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay))
2086 fhMCOtherDecayPt->Fill(pt);
2091 }//Histograms with MC
2097 //__________________________________________________________________
2098 void AliAnaPi0EbE::Print(const Option_t * opt) const
2100 //Print some relevant parameters set for the analysis
2104 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2105 AliAnaCaloTrackCorrBaseClass::Print("");
2106 printf("Analysis Type = %d \n", fAnaType) ;
2107 if(fAnaType == kSSCalo){
2108 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2109 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2110 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2111 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);