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 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 //_________________________________________________________________________
18 // Class for the photon identification.
19 // Clusters from calorimeters are identified as photons
20 // and kept in the AOD. Few histograms produced.
21 // Produces input for other analysis classes like AliAnaPi0,
22 // AliAnaParticleHadronCorrelation ...
24 // -- Author: Gustavo Conesa (LNF-INFN)
25 //////////////////////////////////////////////////////////////////////////////
28 // --- ROOT system ---
31 #include <TClonesArray.h>
32 #include <TObjString.h>
33 #include "TParticle.h"
34 #include "TDatabasePDG.h"
36 // --- Analysis system ---
37 #include "AliAnaPhoton.h"
38 #include "AliCaloTrackReader.h"
40 #include "AliCaloPID.h"
41 #include "AliMCAnalysisUtils.h"
42 #include "AliFiducialCut.h"
43 #include "AliVCluster.h"
44 #include "AliAODMCParticle.h"
45 #include "AliMixedEvent.h"
46 #include "AliAODEvent.h"
47 #include "AliESDEvent.h"
50 #include "AliPHOSGeoUtils.h"
51 #include "AliEMCALGeometry.h"
53 ClassImp(AliAnaPhoton)
55 //____________________________
56 AliAnaPhoton::AliAnaPhoton() :
57 AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
58 fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
59 fRejectTrackMatch(0), fFillTMHisto(kFALSE),
60 fTimeCutMin(-10000), fTimeCutMax(10000),
62 fNLMCutMin(-1), fNLMCutMax(10),
63 fFillSSHistograms(kFALSE), fFillOnlySimpleSSHisto(1),
64 fNOriginHistograms(8), fNPrimaryHistograms(4),
65 fFillPileUpHistograms(0),
67 fhNCellsE(0), fhCellsE(0), // Control histograms
68 fhMaxCellDiffClusterE(0), fhTimeE(0), // Control histograms
69 fhEPhoton(0), fhPtPhoton(0),
70 fhPhiPhoton(0), fhEtaPhoton(0),
71 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
73 // Shower shape histograms
75 fhDispE(0), fhLam0E(0), fhLam1E(0),
76 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
77 fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
78 fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam1ETMTRD(0),
80 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
81 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
83 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
84 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
85 fhLam0DispLowE(0), fhLam0DispHighE(0),
86 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
87 fhDispLam1LowE(0), fhDispLam1HighE(0),
88 fhDispEtaE(0), fhDispPhiE(0),
89 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
90 fhDispEtaPhiDiffE(0), fhSphericityE(0),
91 fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
94 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
96 fhEmbeddedSignalFractionEnergy(0),
97 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
98 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
99 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
100 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
102 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
103 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
104 fhTimeNPileUpVertContributors(0),
105 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
106 fhClusterMultSPDPileUp(), fhClusterMultNoPileUp(),
107 fhEtaPhiBC0(0), fhEtaPhiBCPlus(0), fhEtaPhiBCMinus(0),
108 fhEtaPhiBC0PileUpSPD(0),
109 fhEtaPhiBCPlusPileUpSPD(0),
110 fhEtaPhiBCMinusPileUpSPD(0)
114 for(Int_t i = 0; i < 14; i++)
126 for(Int_t i = 0; i < 7; i++)
133 fhPtPrimMCAcc [i] = 0;
134 fhEPrimMCAcc [i] = 0;
135 fhPhiPrimMCAcc[i] = 0;
136 fhYPrimMCAcc [i] = 0;
138 fhDispEtaDispPhi[i] = 0;
139 fhLambda0DispPhi[i] = 0;
140 fhLambda0DispEta[i] = 0;
143 fhPtChargedPileUp[i] = 0;
144 fhPtPhotonPileUp [i] = 0;
146 fhLambda0PileUp [i] = 0;
147 fhLambda0ChargedPileUp[i] = 0;
149 fhClusterEFracLongTimePileUp [i] = 0;
151 fhClusterTimeDiffPileUp [i] = 0;
152 fhClusterTimeDiffChargedPileUp[i] = 0;
153 fhClusterTimeDiffPhotonPileUp [i] = 0;
155 for(Int_t j = 0; j < 6; j++)
157 fhMCDispEtaDispPhi[i][j] = 0;
158 fhMCLambda0DispEta[i][j] = 0;
159 fhMCLambda0DispPhi[i][j] = 0;
163 for(Int_t i = 0; i < 6; i++)
165 fhMCELambda0 [i] = 0;
166 fhMCELambda1 [i] = 0;
167 fhMCEDispersion [i] = 0;
169 fhMCMaxCellDiffClusterE[i] = 0;
170 fhLambda0DispEta[i] = 0;
171 fhLambda0DispPhi[i] = 0;
173 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
174 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
175 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
176 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
177 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
178 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
180 fhMCEDispEta [i] = 0;
181 fhMCEDispPhi [i] = 0;
182 fhMCESumEtaPhi [i] = 0;
183 fhMCEDispEtaPhiDiff[i] = 0;
184 fhMCESphericity [i] = 0;
187 for(Int_t i = 0; i < 5; i++)
189 fhClusterCuts[i] = 0;
192 // Track matching residuals
193 for(Int_t i = 0; i < 2; i++)
195 fhTrackMatchedDEta[i] = 0; fhTrackMatchedDPhi[i] = 0; fhTrackMatchedDEtaDPhi[i] = 0;
196 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
197 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
198 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
199 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
200 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
201 fhdEdx[i] = 0; fhEOverP[i] = 0;
205 for(Int_t i = 0; i < 4; i++)
207 fhClusterMultSPDPileUp[i] = 0;
208 fhClusterMultNoPileUp [i] = 0;
211 //Initialize parameters
216 //_____________________________________________________________________________________________________
217 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, const TLorentzVector mom, const Int_t nMaxima)
219 //Select clusters if they pass different cuts
221 Float_t ptcluster = mom.Pt();
222 Float_t ecluster = mom.E();
223 Float_t l0cluster = calo->GetM02();
226 printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
227 GetReader()->GetEventNumber(),
228 ecluster,ptcluster, mom.Phi()*TMath::RadToDeg(),mom.Eta());
230 fhClusterCuts[1]->Fill(ecluster);
232 //.......................................
233 //If too small or big energy, skip it
234 if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
236 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
238 fhClusterCuts[2]->Fill(ecluster);
240 if(fFillPileUpHistograms)
242 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
243 AliVCaloCells* cells = 0;
244 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
245 else cells = GetPHOSCells();
247 Float_t maxCellFraction = 0.;
248 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
250 Double_t tmax = cells->GetCellTime(absIdMax);
251 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
254 Bool_t okPhoton = kFALSE;
255 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
257 Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
258 Float_t clusterLongTimeE = 0;
259 Float_t clusterOKTimeE = 0;
260 //Loop on cells inside cluster
261 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
263 Int_t absId = calo->GetCellsAbsId()[ipos];
264 //if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
265 if(cells->GetCellAmplitude(absIdMax) > 0.1)
267 Double_t time = cells->GetCellTime(absId);
268 Float_t amp = cells->GetCellAmplitude(absId);
269 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
270 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
273 Float_t diff = (tmax-time);
275 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimeE += amp;
276 else clusterLongTimeE += amp;
278 if(GetReader()->IsPileUpFromSPD())
280 fhClusterTimeDiffPileUp[0]->Fill(ecluster, diff);
283 fhClusterTimeDiffChargedPileUp[0]->Fill(ecluster, diff);
284 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ecluster, diff);
288 if(GetReader()->IsPileUpFromEMCal())
290 fhClusterTimeDiffPileUp[1]->Fill(ecluster, diff);
293 fhClusterTimeDiffChargedPileUp[1]->Fill(ecluster, diff);
294 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ecluster, diff);
298 if(GetReader()->IsPileUpFromSPDOrEMCal())
300 fhClusterTimeDiffPileUp[2]->Fill(ecluster, diff);
303 fhClusterTimeDiffChargedPileUp[2]->Fill(ecluster, diff);
304 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ecluster, diff);
308 if(GetReader()->IsPileUpFromSPDAndEMCal())
310 fhClusterTimeDiffPileUp[3]->Fill(ecluster, diff);
313 fhClusterTimeDiffChargedPileUp[3]->Fill(ecluster, diff);
314 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ecluster, diff);
318 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
320 fhClusterTimeDiffPileUp[4]->Fill(ecluster, diff);
323 fhClusterTimeDiffChargedPileUp[4]->Fill(ecluster, diff);
324 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ecluster, diff);
328 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
330 fhClusterTimeDiffPileUp[5]->Fill(ecluster, diff);
333 fhClusterTimeDiffChargedPileUp[5]->Fill(ecluster, diff);
334 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ecluster, diff);
338 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
340 fhClusterTimeDiffPileUp[6]->Fill(ecluster, diff);
343 fhClusterTimeDiffChargedPileUp[6]->Fill(ecluster, diff);
344 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ecluster, diff);
351 if(clusterLongTimeE+clusterOKTimeE > 0.001)
352 frac = clusterLongTimeE/(clusterLongTimeE+clusterOKTimeE);
353 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimeE,clusterOKTimeE,frac,ecluster);
355 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ecluster,frac);}
356 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ecluster,frac);}
357 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ecluster,frac);}
358 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ecluster,frac);}
359 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ecluster,frac);}
360 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ecluster,frac);}
361 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ecluster,frac);}
363 if(tmax > -25 && tmax < 25) {fhEtaPhiBC0 ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
364 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
365 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(mom.Eta(),mom.Phi()); }
368 //.......................................
369 // TOF cut, BE CAREFUL WITH THIS CUT
370 Double_t tof = calo->GetTOF()*1e9;
371 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
373 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
375 fhClusterCuts[3]->Fill(ecluster);
377 //.......................................
378 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
380 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
382 fhClusterCuts[4]->Fill(ecluster);
384 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
385 if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
387 fhClusterCuts[5]->Fill(ecluster);
389 //.......................................
390 //Check acceptance selection
391 if(IsFiducialCutOn())
393 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
394 if(! in ) return kFALSE ;
397 if(GetDebug() > 2) printf("Fiducial cut passed \n");
399 fhClusterCuts[6]->Fill(ecluster);
401 //.......................................
402 //Skip matched clusters with tracks
404 // Fill matching residual histograms before PID cuts
405 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
407 if(fRejectTrackMatch)
409 if(IsTrackMatched(calo,GetReader()->GetInputEvent()))
411 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
415 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
416 }// reject matched clusters
418 fhClusterCuts[7]->Fill(ecluster);
420 if(fFillPileUpHistograms)
422 if(GetReader()->IsPileUpFromSPD()) {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
423 if(GetReader()->IsPileUpFromEMCal()) {fhPtChargedPileUp[1]->Fill(ptcluster); fhLambda0ChargedPileUp[1]->Fill(ecluster,l0cluster); }
424 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtChargedPileUp[2]->Fill(ptcluster); fhLambda0ChargedPileUp[2]->Fill(ecluster,l0cluster); }
425 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtChargedPileUp[3]->Fill(ptcluster); fhLambda0ChargedPileUp[3]->Fill(ecluster,l0cluster); }
426 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtChargedPileUp[4]->Fill(ptcluster); fhLambda0ChargedPileUp[4]->Fill(ecluster,l0cluster); }
427 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtChargedPileUp[5]->Fill(ptcluster); fhLambda0ChargedPileUp[5]->Fill(ecluster,l0cluster); }
428 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtChargedPileUp[6]->Fill(ptcluster); fhLambda0ChargedPileUp[6]->Fill(ecluster,l0cluster); }
431 //.......................................
432 //Check Distance to Bad channel, set bit.
433 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
434 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
435 if(distBad < fMinDist)
436 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
439 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
441 fhClusterCuts[8]->Fill(ecluster);
444 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
445 GetReader()->GetEventNumber(),
446 ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
448 //All checks passed, cluster selected
453 //___________________________________________
454 void AliAnaPhoton::FillAcceptanceHistograms()
456 //Fill acceptance histograms if MC data is available
458 Double_t photonY = -100 ;
459 Double_t photonE = -1 ;
460 Double_t photonPt = -1 ;
461 Double_t photonPhi = 100 ;
462 Double_t photonEta = -1 ;
467 Bool_t inacceptance = kFALSE;
469 if(GetReader()->ReadStack())
471 AliStack * stack = GetMCStack();
474 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
476 TParticle * prim = stack->Particle(i) ;
477 pdg = prim->GetPdgCode();
478 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
479 // prim->GetName(), prim->GetPdgCode());
483 // Get tag of this particle photon from fragmentation, decay, prompt ...
484 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
485 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
487 //A conversion photon from a hadron, skip this kind of photon
488 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
489 // GetMCAnalysisUtils()->PrintMCTag(tag);
494 //Get photon kinematics
495 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
497 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
498 photonE = prim->Energy() ;
499 photonPt = prim->Pt() ;
500 photonPhi = TMath::RadToDeg()*prim->Phi() ;
501 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
502 photonEta = prim->Eta() ;
504 //Check if photons hit the Calorimeter
507 inacceptance = kFALSE;
508 if (fCalorimeter == "PHOS")
510 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
514 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
515 inacceptance = kTRUE;
516 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
520 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
521 inacceptance = kTRUE ;
522 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
525 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
527 if(GetEMCALGeometry())
531 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
534 inacceptance = kTRUE;
536 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
537 // inacceptance = kTRUE;
538 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
542 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
543 inacceptance = kTRUE ;
544 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
549 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
550 if(TMath::Abs(photonY) < 1.0)
552 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
553 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
554 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
555 fhYPrimMC [kmcPPhoton]->Fill(photonE , photonEta) ;
559 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
560 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
561 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
562 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
566 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
568 mcIndex = kmcPPrompt;
570 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
572 mcIndex = kmcPFragmentation ;
574 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
578 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
580 mcIndex = kmcPPi0Decay;
582 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
583 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
585 mcIndex = kmcPOtherDecay;
587 else if(fhEPrimMC[kmcPOther])
592 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
593 if(TMath::Abs(photonY) < 1.0)
595 fhEPrimMC [mcIndex]->Fill(photonE ) ;
596 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
597 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
598 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
602 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
603 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
604 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
605 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
610 }//stack exists and data is MC
612 else if(GetReader()->ReadAODMCParticles())
614 TClonesArray * mcparticles = GetReader()->GetAODMCParticles(0);
617 Int_t nprim = mcparticles->GetEntriesFast();
619 for(Int_t i=0; i < nprim; i++)
621 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
623 pdg = prim->GetPdgCode();
627 // Get tag of this particle photon from fragmentation, decay, prompt ...
628 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
629 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
631 //A conversion photon from a hadron, skip this kind of photon
632 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
633 // GetMCAnalysisUtils()->PrintMCTag(tag);
638 //Get photon kinematics
639 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
641 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
642 photonE = prim->E() ;
643 photonPt = prim->Pt() ;
644 photonPhi = prim->Phi() ;
645 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
646 photonEta = prim->Eta() ;
648 //Check if photons hit the Calorimeter
650 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
651 inacceptance = kFALSE;
652 if (fCalorimeter == "PHOS")
654 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
658 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
659 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
660 inacceptance = kTRUE;
661 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
665 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
666 inacceptance = kTRUE ;
667 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
670 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
672 if(GetEMCALGeometry())
676 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
679 inacceptance = kTRUE;
681 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
685 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
686 inacceptance = kTRUE ;
687 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
693 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
694 if(TMath::Abs(photonY) < 1.0)
696 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
697 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
698 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
699 fhYPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
704 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
705 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
706 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
707 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
711 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
713 mcIndex = kmcPPrompt;
715 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
717 mcIndex = kmcPFragmentation ;
719 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
723 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
725 mcIndex = kmcPPi0Decay;
727 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
728 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
730 mcIndex = kmcPOtherDecay;
732 else if(fhEPrimMC[kmcPOther])
737 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
738 if(TMath::Abs(photonY) < 1.0)
740 fhEPrimMC [mcIndex]->Fill(photonE ) ;
741 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
742 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
743 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
747 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
748 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
749 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
750 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
756 }//kmc array exists and data is MC
760 //___________________________________________________________________
761 void AliAnaPhoton::FillPileUpHistogramsPerEvent(TObjArray * clusters)
763 // Fill some histograms per event to understand pile-up
764 // Open the time cut in the reader to be more meaningful
766 if(!fFillPileUpHistograms) return;
768 // Loop on clusters, get the maximum energy cluster as reference
769 Int_t nclusters = clusters->GetEntriesFast();
773 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
775 AliVCluster * clus = (AliVCluster*) (clusters->At(iclus));
776 if(clus->E() > eMax && TMath::Abs(clus->GetTOF()*1e9) < 20)
779 tMax = clus->GetTOF()*1e9;
786 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
792 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
794 AliVCluster * clus = (AliVCluster*) (clusters->At(iclus));
796 if(clus->E() < 0.3 || iclus==idMax) continue;
798 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
800 if(tdiff < 20) nOK++;
804 if(tdiff > 40 ) n40++;
808 // Check pile-up and fill histograms depending on the different cluster multiplicities
809 if(GetReader()->IsPileUpFromSPD())
811 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
812 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
813 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
814 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
818 fhClusterMultNoPileUp[0]->Fill(eMax,n );
819 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
820 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
821 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
827 //_________________________________________________________________________________________________
828 void AliAnaPhoton::FillPileUpHistograms(const Float_t energy, const Float_t pt, const Float_t time)
830 // Fill some histograms to understand pile-up
831 if(!fFillPileUpHistograms) return;
833 //printf("E %f, time %f\n",energy,time);
834 AliVEvent * event = GetReader()->GetInputEvent();
836 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
837 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
838 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
839 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
840 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
841 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
842 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
844 fhTimeENoCut->Fill(energy,time);
845 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
846 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
848 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
850 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
851 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
853 // N pile up vertices
854 Int_t nVerticesSPD = -1;
855 Int_t nVerticesTracks = -1;
859 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
860 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
865 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
866 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
869 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
870 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
872 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
873 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
876 Float_t z1 = -1, z2 = -1;
878 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
882 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
883 ncont=pv->GetNContributors();
884 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
886 diamZ = esdEv->GetDiamondZ();
890 AliAODVertex *pv=aodEv->GetVertex(iVert);
891 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
892 ncont=pv->GetNContributors();
893 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
895 diamZ = aodEv->GetDiamondZ();
898 Double_t distZ = TMath::Abs(z2-z1);
899 diamZ = TMath::Abs(z2-diamZ);
901 fhTimeNPileUpVertContributors ->Fill(time,ncont);
902 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
903 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
908 //____________________________________________________________________________________
909 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, const Int_t mcTag)
911 //Fill cluster Shower Shape histograms
913 if(!fFillSSHistograms || GetMixedEvent()) return;
915 Float_t energy = cluster->E();
916 Int_t ncells = cluster->GetNCells();
917 Float_t lambda0 = cluster->GetM02();
918 Float_t lambda1 = cluster->GetM20();
919 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
922 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
924 cluster->GetMomentum(mom,GetVertex(0)) ;
925 }//Assume that come from vertex in straight line
928 Double_t vertex[]={0,0,0};
929 cluster->GetMomentum(mom,vertex) ;
932 Float_t eta = mom.Eta();
933 Float_t phi = mom.Phi();
934 if(phi < 0) phi+=TMath::TwoPi();
936 fhLam0E ->Fill(energy,lambda0);
937 fhLam1E ->Fill(energy,lambda1);
938 fhDispE ->Fill(energy,disp);
940 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
942 fhLam0ETRD->Fill(energy,lambda0);
943 fhLam1ETRD->Fill(energy,lambda1);
944 fhDispETRD->Fill(energy,disp);
947 Float_t l0 = 0., l1 = 0.;
948 Float_t dispp= 0., dEta = 0., dPhi = 0.;
949 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
950 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
952 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
953 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
954 //printf("AliAnaPhoton::FillShowerShapeHistogram - l0 %2.6f, l1 %2.6f, disp %2.6f, dEta %2.6f, dPhi %2.6f, sEta %2.6f, sPhi %2.6f, sEtaPhi %2.6f \n",
955 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
956 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
957 // disp, dPhi+dEta );
958 fhDispEtaE -> Fill(energy,dEta);
959 fhDispPhiE -> Fill(energy,dPhi);
960 fhSumEtaE -> Fill(energy,sEta);
961 fhSumPhiE -> Fill(energy,sPhi);
962 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
963 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
964 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
965 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
966 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
969 if (energy < 2 ) ebin = 0;
970 else if (energy < 4 ) ebin = 1;
971 else if (energy < 6 ) ebin = 2;
972 else if (energy < 10) ebin = 3;
973 else if (energy < 15) ebin = 4;
974 else if (energy < 20) ebin = 5;
977 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
978 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
979 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
983 // if track-matching was of, check effect of track-matching residual cut
985 if(!fRejectTrackMatch)
987 Float_t dZ = cluster->GetTrackDz();
988 Float_t dR = cluster->GetTrackDx();
989 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
991 dR = 2000., dZ = 2000.;
992 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
995 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
997 fhLam0ETM ->Fill(energy,lambda0);
998 fhLam1ETM ->Fill(energy,lambda1);
999 fhDispETM ->Fill(energy,disp);
1001 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1003 fhLam0ETMTRD->Fill(energy,lambda0);
1004 fhLam1ETMTRD->Fill(energy,lambda1);
1005 fhDispETMTRD->Fill(energy,disp);
1008 }// if track-matching was of, check effect of matching residual cut
1011 if(!fFillOnlySimpleSSHisto){
1014 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1015 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1016 fhNCellsDispLowE ->Fill(ncells,disp);
1018 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1019 fhLam0DispLowE ->Fill(lambda0,disp);
1020 fhDispLam1LowE ->Fill(disp,lambda1);
1021 fhEtaLam0LowE ->Fill(eta,lambda0);
1022 fhPhiLam0LowE ->Fill(phi,lambda0);
1026 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1027 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1028 fhNCellsDispHighE ->Fill(ncells,disp);
1030 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1031 fhLam0DispHighE ->Fill(lambda0,disp);
1032 fhDispLam1HighE ->Fill(disp,lambda1);
1033 fhEtaLam0HighE ->Fill(eta, lambda0);
1034 fhPhiLam0HighE ->Fill(phi, lambda0);
1040 AliVCaloCells* cells = 0;
1041 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1042 else cells = GetPHOSCells();
1044 //Fill histograms to check shape of embedded clusters
1045 Float_t fraction = 0;
1046 if(GetReader()->IsEmbeddedClusterSelectionOn())
1047 {//Only working for EMCAL
1048 Float_t clusterE = 0; // recalculate in case corrections applied.
1050 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1052 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
1054 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1057 //Fraction of total energy due to the embedded signal
1061 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
1063 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1065 } // embedded fraction
1067 // Get the fraction of the cluster energy that carries the cell with highest energy
1069 Float_t maxCellFraction = 0.;
1071 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1073 // Check the origin and fill histograms
1077 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1078 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1079 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1080 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1082 mcIndex = kmcssPhoton ;
1084 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1086 //Check particle overlaps in cluster
1088 // Compare the primary depositing more energy with the rest,
1089 // if no photon/electron as comon ancestor (conversions), count as other particle
1090 Int_t ancPDG = 0, ancStatus = -1;
1091 TLorentzVector momentum; TVector3 prodVertex;
1093 Int_t noverlaps = 1;
1094 for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
1096 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab],
1097 GetReader(),ancPDG,ancStatus,momentum,prodVertex);
1098 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
1100 //printf("N overlaps %d \n",noverlaps);
1104 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
1106 else if(noverlaps == 2)
1108 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
1110 else if(noverlaps > 2)
1112 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
1116 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
1120 //Fill histograms to check shape of embedded clusters
1121 if(GetReader()->IsEmbeddedClusterSelectionOn())
1125 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
1127 else if(fraction > 0.5)
1129 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
1131 else if(fraction > 0.1)
1133 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
1137 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
1141 }//photon no conversion
1142 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1144 mcIndex = kmcssElectron ;
1146 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1147 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1149 mcIndex = kmcssConversion ;
1150 }//conversion photon
1151 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1153 mcIndex = kmcssPi0 ;
1155 //Fill histograms to check shape of embedded clusters
1156 if(GetReader()->IsEmbeddedClusterSelectionOn())
1160 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
1162 else if(fraction > 0.5)
1164 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
1166 else if(fraction > 0.1)
1168 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
1172 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
1177 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1179 mcIndex = kmcssEta ;
1183 mcIndex = kmcssOther ;
1186 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1187 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1188 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1189 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1190 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1192 if(!fFillOnlySimpleSSHisto)
1196 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1197 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1199 else if(energy < 6.)
1201 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1202 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1206 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1207 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1210 if(fCalorimeter == "EMCAL")
1212 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1213 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1214 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1215 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
1216 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1219 if (energy < 2 ) ebin = 0;
1220 else if (energy < 4 ) ebin = 1;
1221 else if (energy < 6 ) ebin = 2;
1222 else if (energy < 10) ebin = 3;
1223 else if (energy < 15) ebin = 4;
1224 else if (energy < 20) ebin = 5;
1227 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1228 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
1229 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
1236 //__________________________________________________________________________
1237 void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
1240 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1241 // Residual filled for different cuts 0 (No cut), after 1 PID cut
1243 Float_t dZ = cluster->GetTrackDz();
1244 Float_t dR = cluster->GetTrackDx();
1246 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1248 dR = 2000., dZ = 2000.;
1249 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1252 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1254 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1255 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
1257 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
1259 Int_t nSMod = GetModuleNumber(cluster);
1261 if(fCalorimeter=="EMCAL" && nSMod > 5)
1263 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1264 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1267 // Check dEdx and E/p of matched clusters
1269 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1272 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1277 Float_t dEdx = track->GetTPCsignal();
1278 Float_t eOverp = cluster->E()/track->P();
1280 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1281 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1283 if(fCalorimeter=="EMCAL" && nSMod > 5)
1284 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1289 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
1296 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader(), 0);
1298 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1300 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1301 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
1302 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1303 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1304 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1306 // Check if several particles contributed to cluster and discard overlapped mesons
1307 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1308 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1310 if(cluster->GetNLabels()==1)
1312 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1313 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1317 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1318 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1326 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1327 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
1328 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1329 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1330 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1332 // Check if several particles contributed to cluster
1333 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1334 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1336 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1337 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1345 } // residuals window
1351 //___________________________________________
1352 TObjString * AliAnaPhoton::GetAnalysisCuts()
1354 //Save parameters used for analysis
1355 TString parList ; //this will be list of parameters used for this analysis.
1356 const Int_t buffersize = 255;
1357 char onePar[buffersize] ;
1359 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
1361 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1363 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
1365 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
1367 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
1369 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
1372 //Get parameters set in base class.
1373 parList += GetBaseParametersList() ;
1375 //Get parameters set in PID class.
1376 parList += GetCaloPID()->GetPIDParametersList() ;
1378 //Get parameters set in FiducialCut class (not available yet)
1379 //parlist += GetFidCut()->GetFidCutParametersList()
1381 return new TObjString(parList) ;
1384 //________________________________________________________________________
1385 TList * AliAnaPhoton::GetCreateOutputObjects()
1387 // Create histograms to be saved in output file and
1388 // store them in outputContainer
1389 TList * outputContainer = new TList() ;
1390 outputContainer->SetName("PhotonHistos") ;
1392 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1393 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1394 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1395 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1396 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1397 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1399 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1400 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1401 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1402 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1403 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1404 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1406 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1407 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1408 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1409 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1410 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1411 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1413 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1415 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
1416 for (Int_t i = 0; i < 10 ; i++)
1418 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1419 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1420 nptbins,ptmin,ptmax);
1421 fhClusterCuts[i]->SetYTitle("dN/dE ");
1422 fhClusterCuts[i]->SetXTitle("E (GeV)");
1423 outputContainer->Add(fhClusterCuts[i]) ;
1426 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1427 fhNCellsE->SetXTitle("E (GeV)");
1428 fhNCellsE->SetYTitle("# of cells in cluster");
1429 outputContainer->Add(fhNCellsE);
1431 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1432 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1433 fhCellsE->SetYTitle("E_{cell} (GeV)");
1434 outputContainer->Add(fhCellsE);
1436 fhTimeE = new TH2F ("hTimeE","time of cluster vs E of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1437 fhTimeE->SetXTitle("E (GeV)");
1438 fhTimeE->SetYTitle("time (ns)");
1439 outputContainer->Add(fhTimeE);
1441 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1442 nptbins,ptmin,ptmax, 500,0,1.);
1443 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1444 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1445 outputContainer->Add(fhMaxCellDiffClusterE);
1447 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1448 fhEPhoton->SetYTitle("N");
1449 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1450 outputContainer->Add(fhEPhoton) ;
1452 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
1453 fhPtPhoton->SetYTitle("N");
1454 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1455 outputContainer->Add(fhPtPhoton) ;
1457 fhPhiPhoton = new TH2F
1458 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1459 fhPhiPhoton->SetYTitle("#phi (rad)");
1460 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1461 outputContainer->Add(fhPhiPhoton) ;
1463 fhEtaPhoton = new TH2F
1464 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1465 fhEtaPhoton->SetYTitle("#eta");
1466 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1467 outputContainer->Add(fhEtaPhoton) ;
1469 fhEtaPhiPhoton = new TH2F
1470 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1471 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1472 fhEtaPhiPhoton->SetXTitle("#eta");
1473 outputContainer->Add(fhEtaPhiPhoton) ;
1474 if(GetMinPt() < 0.5)
1476 fhEtaPhi05Photon = new TH2F
1477 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1478 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1479 fhEtaPhi05Photon->SetXTitle("#eta");
1480 outputContainer->Add(fhEtaPhi05Photon) ;
1484 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
1485 nptbins,ptmin,ptmax,10,0,10);
1486 fhNLocMax ->SetYTitle("N maxima");
1487 fhNLocMax ->SetXTitle("E (GeV)");
1488 outputContainer->Add(fhNLocMax) ;
1491 if(fFillSSHistograms)
1493 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1494 fhLam0E->SetYTitle("#lambda_{0}^{2}");
1495 fhLam0E->SetXTitle("E (GeV)");
1496 outputContainer->Add(fhLam0E);
1498 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1499 fhLam1E->SetYTitle("#lambda_{1}^{2}");
1500 fhLam1E->SetXTitle("E (GeV)");
1501 outputContainer->Add(fhLam1E);
1503 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1504 fhDispE->SetYTitle("D^{2}");
1505 fhDispE->SetXTitle("E (GeV) ");
1506 outputContainer->Add(fhDispE);
1508 if(!fRejectTrackMatch)
1510 fhLam0ETM = new TH2F ("hLam0ETM","#lambda_{0}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1511 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
1512 fhLam0ETM->SetXTitle("E (GeV)");
1513 outputContainer->Add(fhLam0ETM);
1515 fhLam1ETM = new TH2F ("hLam1ETM","#lambda_{1}^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1516 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
1517 fhLam1ETM->SetXTitle("E (GeV)");
1518 outputContainer->Add(fhLam1ETM);
1520 fhDispETM = new TH2F ("hDispETM"," dispersion^{2} vs E, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1521 fhDispETM->SetYTitle("D^{2}");
1522 fhDispETM->SetXTitle("E (GeV) ");
1523 outputContainer->Add(fhDispETM);
1526 if(fCalorimeter == "EMCAL")
1528 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1529 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1530 fhLam0ETRD->SetXTitle("E (GeV)");
1531 outputContainer->Add(fhLam0ETRD);
1533 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1534 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1535 fhLam1ETRD->SetXTitle("E (GeV)");
1536 outputContainer->Add(fhLam1ETRD);
1538 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1539 fhDispETRD->SetYTitle("Dispersion^{2}");
1540 fhDispETRD->SetXTitle("E (GeV) ");
1541 outputContainer->Add(fhDispETRD);
1543 if(!fRejectTrackMatch)
1545 fhLam0ETMTRD = new TH2F ("hLam0ETMTRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1546 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
1547 fhLam0ETMTRD->SetXTitle("E (GeV)");
1548 outputContainer->Add(fhLam0ETMTRD);
1550 fhLam1ETMTRD = new TH2F ("hLam1ETMTRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1551 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
1552 fhLam1ETMTRD->SetXTitle("E (GeV)");
1553 outputContainer->Add(fhLam1ETMTRD);
1555 fhDispETMTRD = new TH2F ("hDispETMTRD"," dispersion^{2} vs E, EMCAL SM covered by TRD, cut on track-matching residual |#Delta #eta| < 0.05, |#Delta #phi| < 0.05", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1556 fhDispETMTRD->SetYTitle("Dispersion^{2}");
1557 fhDispETMTRD->SetXTitle("E (GeV) ");
1558 outputContainer->Add(fhDispETMTRD);
1562 if(!fFillOnlySimpleSSHisto)
1564 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1565 fhNCellsLam0LowE->SetXTitle("N_{cells}");
1566 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1567 outputContainer->Add(fhNCellsLam0LowE);
1569 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1570 fhNCellsLam0HighE->SetXTitle("N_{cells}");
1571 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1572 outputContainer->Add(fhNCellsLam0HighE);
1574 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1575 fhNCellsLam1LowE->SetXTitle("N_{cells}");
1576 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1577 outputContainer->Add(fhNCellsLam1LowE);
1579 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1580 fhNCellsLam1HighE->SetXTitle("N_{cells}");
1581 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1582 outputContainer->Add(fhNCellsLam1HighE);
1584 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1585 fhNCellsDispLowE->SetXTitle("N_{cells}");
1586 fhNCellsDispLowE->SetYTitle("D^{2}");
1587 outputContainer->Add(fhNCellsDispLowE);
1589 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1590 fhNCellsDispHighE->SetXTitle("N_{cells}");
1591 fhNCellsDispHighE->SetYTitle("D^{2}");
1592 outputContainer->Add(fhNCellsDispHighE);
1594 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1595 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1596 fhEtaLam0LowE->SetXTitle("#eta");
1597 outputContainer->Add(fhEtaLam0LowE);
1599 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1600 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1601 fhPhiLam0LowE->SetXTitle("#phi");
1602 outputContainer->Add(fhPhiLam0LowE);
1604 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1605 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1606 fhEtaLam0HighE->SetXTitle("#eta");
1607 outputContainer->Add(fhEtaLam0HighE);
1609 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1610 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1611 fhPhiLam0HighE->SetXTitle("#phi");
1612 outputContainer->Add(fhPhiLam0HighE);
1614 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1615 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1616 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1617 outputContainer->Add(fhLam1Lam0LowE);
1619 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1620 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1621 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1622 outputContainer->Add(fhLam1Lam0HighE);
1624 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1625 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1626 fhLam0DispLowE->SetYTitle("D^{2}");
1627 outputContainer->Add(fhLam0DispLowE);
1629 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1630 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1631 fhLam0DispHighE->SetYTitle("D^{2}");
1632 outputContainer->Add(fhLam0DispHighE);
1634 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1635 fhDispLam1LowE->SetXTitle("D^{2}");
1636 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1637 outputContainer->Add(fhDispLam1LowE);
1639 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1640 fhDispLam1HighE->SetXTitle("D^{2}");
1641 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1642 outputContainer->Add(fhDispLam1HighE);
1644 if(fCalorimeter == "EMCAL")
1646 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);
1647 fhDispEtaE->SetXTitle("E (GeV)");
1648 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
1649 outputContainer->Add(fhDispEtaE);
1651 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);
1652 fhDispPhiE->SetXTitle("E (GeV)");
1653 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
1654 outputContainer->Add(fhDispPhiE);
1656 fhSumEtaE = new TH2F ("hSumEtaE","#delta^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i})^{2} / #Sigma w_{i} - <#eta>^{2} vs E", nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1657 fhSumEtaE->SetXTitle("E (GeV)");
1658 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
1659 outputContainer->Add(fhSumEtaE);
1661 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
1662 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1663 fhSumPhiE->SetXTitle("E (GeV)");
1664 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
1665 outputContainer->Add(fhSumPhiE);
1667 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
1668 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1669 fhSumEtaPhiE->SetXTitle("E (GeV)");
1670 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
1671 outputContainer->Add(fhSumEtaPhiE);
1673 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
1674 nptbins,ptmin,ptmax,200, -10,10);
1675 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
1676 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1677 outputContainer->Add(fhDispEtaPhiDiffE);
1679 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
1680 nptbins,ptmin,ptmax, 200, -1,1);
1681 fhSphericityE->SetXTitle("E (GeV)");
1682 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1683 outputContainer->Add(fhSphericityE);
1685 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1686 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
1687 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
1688 outputContainer->Add(fhDispSumEtaDiffE);
1690 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1691 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
1692 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
1693 outputContainer->Add(fhDispSumPhiDiffE);
1695 for(Int_t i = 0; i < 7; i++)
1697 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]),
1698 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1699 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1700 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1701 outputContainer->Add(fhDispEtaDispPhi[i]);
1703 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]),
1704 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1705 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
1706 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1707 outputContainer->Add(fhLambda0DispEta[i]);
1709 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]),
1710 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1711 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
1712 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1713 outputContainer->Add(fhLambda0DispPhi[i]);
1723 fhTrackMatchedDEta[0] = new TH2F
1724 ("hTrackMatchedDEtaNoCut",
1725 "d#eta of cluster-track vs cluster energy, no photon cuts",
1726 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1727 fhTrackMatchedDEta[0]->SetYTitle("d#eta");
1728 fhTrackMatchedDEta[0]->SetXTitle("E_{cluster} (GeV)");
1730 fhTrackMatchedDPhi[0] = new TH2F
1731 ("hTrackMatchedDPhiNoCut",
1732 "d#phi of cluster-track vs cluster energy, no photon cuts",
1733 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1734 fhTrackMatchedDPhi[0]->SetYTitle("d#phi (rad)");
1735 fhTrackMatchedDPhi[0]->SetXTitle("E_{cluster} (GeV)");
1737 fhTrackMatchedDEtaDPhi[0] = new TH2F
1738 ("hTrackMatchedDEtaDPhiNoCut",
1739 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1740 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1741 fhTrackMatchedDEtaDPhi[0]->SetYTitle("d#phi (rad)");
1742 fhTrackMatchedDEtaDPhi[0]->SetXTitle("d#eta");
1744 fhdEdx[0] = new TH2F ("hdEdxNoCut","matched track <dE/dx> vs cluster E, no photon cuts ",
1745 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1746 fhdEdx[0]->SetXTitle("E (GeV)");
1747 fhdEdx[0]->SetYTitle("<dE/dx>");
1749 fhEOverP[0] = new TH2F ("hEOverPNoCut","matched track E/p vs cluster E, no photon cuts ",
1750 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1751 fhEOverP[0]->SetXTitle("E (GeV)");
1752 fhEOverP[0]->SetYTitle("E/p");
1754 outputContainer->Add(fhTrackMatchedDEta[0]) ;
1755 outputContainer->Add(fhTrackMatchedDPhi[0]) ;
1756 outputContainer->Add(fhTrackMatchedDEtaDPhi[0]) ;
1757 outputContainer->Add(fhdEdx[0]);
1758 outputContainer->Add(fhEOverP[0]);
1760 fhTrackMatchedDEta[1] = new TH2F
1761 ("hTrackMatchedDEta",
1762 "d#eta of cluster-track vs cluster energy, no photon cuts",
1763 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1764 fhTrackMatchedDEta[1]->SetYTitle("d#eta");
1765 fhTrackMatchedDEta[1]->SetXTitle("E_{cluster} (GeV)");
1767 fhTrackMatchedDPhi[1] = new TH2F
1768 ("hTrackMatchedDPhi",
1769 "d#phi of cluster-track vs cluster energy, no photon cuts",
1770 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1771 fhTrackMatchedDPhi[1]->SetYTitle("d#phi (rad)");
1772 fhTrackMatchedDPhi[1]->SetXTitle("E_{cluster} (GeV)");
1774 fhTrackMatchedDEtaDPhi[1] = new TH2F
1775 ("hTrackMatchedDEtaDPhi",
1776 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1777 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1778 fhTrackMatchedDEtaDPhi[1]->SetYTitle("d#phi (rad)");
1779 fhTrackMatchedDEtaDPhi[1]->SetXTitle("d#eta");
1781 fhdEdx[1] = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ",
1782 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1783 fhdEdx[1]->SetXTitle("E (GeV)");
1784 fhdEdx[1]->SetYTitle("<dE/dx>");
1786 fhEOverP[1] = new TH2F ("hEOverP","matched track E/p vs cluster E ",
1787 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1788 fhEOverP[1]->SetXTitle("E (GeV)");
1789 fhEOverP[1]->SetYTitle("E/p");
1791 outputContainer->Add(fhTrackMatchedDEta[1]) ;
1792 outputContainer->Add(fhTrackMatchedDPhi[1]) ;
1793 outputContainer->Add(fhTrackMatchedDEtaDPhi[1]) ;
1794 outputContainer->Add(fhdEdx[1]);
1795 outputContainer->Add(fhEOverP[1]);
1797 if(fCalorimeter=="EMCAL")
1799 fhTrackMatchedDEtaTRD[0] = new TH2F
1800 ("hTrackMatchedDEtaTRDNoCut",
1801 "d#eta of cluster-track vs cluster energy, SM behind TRD, no photon cuts",
1802 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1803 fhTrackMatchedDEtaTRD[0]->SetYTitle("d#eta");
1804 fhTrackMatchedDEtaTRD[0]->SetXTitle("E_{cluster} (GeV)");
1806 fhTrackMatchedDPhiTRD[0] = new TH2F
1807 ("hTrackMatchedDPhiTRDNoCut",
1808 "d#phi of cluster-track vs cluster energy, SM behing TRD, no photon cuts",
1809 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1810 fhTrackMatchedDPhiTRD[0]->SetYTitle("d#phi (rad)");
1811 fhTrackMatchedDPhiTRD[0]->SetXTitle("E_{cluster} (GeV)");
1813 fhEOverPTRD[0] = new TH2F ("hEOverPTRDNoCut","matched track E/p vs cluster E, behind TRD, no photon cuts ",
1814 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1815 fhEOverPTRD[0]->SetXTitle("E (GeV)");
1816 fhEOverPTRD[0]->SetYTitle("E/p");
1818 outputContainer->Add(fhTrackMatchedDEtaTRD[0]) ;
1819 outputContainer->Add(fhTrackMatchedDPhiTRD[0]) ;
1820 outputContainer->Add(fhEOverPTRD[0]);
1822 fhTrackMatchedDEtaTRD[1] = new TH2F
1823 ("hTrackMatchedDEtaTRD",
1824 "d#eta of cluster-track vs cluster energy, SM behind TRD",
1825 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1826 fhTrackMatchedDEtaTRD[1]->SetYTitle("d#eta");
1827 fhTrackMatchedDEtaTRD[1]->SetXTitle("E_{cluster} (GeV)");
1829 fhTrackMatchedDPhiTRD[1] = new TH2F
1830 ("hTrackMatchedDPhiTRD",
1831 "d#phi of cluster-track vs cluster energy, SM behing TRD",
1832 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1833 fhTrackMatchedDPhiTRD[1]->SetYTitle("d#phi (rad)");
1834 fhTrackMatchedDPhiTRD[1]->SetXTitle("E_{cluster} (GeV)");
1836 fhEOverPTRD[1] = new TH2F ("hEOverPTRD","matched track E/p vs cluster E, behind TRD ",
1837 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1838 fhEOverPTRD[1]->SetXTitle("E (GeV)");
1839 fhEOverPTRD[1]->SetYTitle("E/p");
1841 outputContainer->Add(fhTrackMatchedDEtaTRD[1]) ;
1842 outputContainer->Add(fhTrackMatchedDPhiTRD[1]) ;
1843 outputContainer->Add(fhEOverPTRD[1]);
1849 fhTrackMatchedDEtaMCNoOverlap[0] = new TH2F
1850 ("hTrackMatchedDEtaMCNoOverlapNoCut",
1851 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1852 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1853 fhTrackMatchedDEtaMCNoOverlap[0]->SetYTitle("d#eta");
1854 fhTrackMatchedDEtaMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1856 fhTrackMatchedDPhiMCNoOverlap[0] = new TH2F
1857 ("hTrackMatchedDPhiMCNoOverlapNoCut",
1858 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1859 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1860 fhTrackMatchedDPhiMCNoOverlap[0]->SetYTitle("d#phi (rad)");
1861 fhTrackMatchedDPhiMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1863 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[0]) ;
1864 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[0]) ;
1866 fhTrackMatchedDEtaMCNoOverlap[1] = new TH2F
1867 ("hTrackMatchedDEtaMCNoOverlap",
1868 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1869 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1870 fhTrackMatchedDEtaMCNoOverlap[1]->SetYTitle("d#eta");
1871 fhTrackMatchedDEtaMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1873 fhTrackMatchedDPhiMCNoOverlap[1] = new TH2F
1874 ("hTrackMatchedDPhiMCNoOverlap",
1875 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1876 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1877 fhTrackMatchedDPhiMCNoOverlap[1]->SetYTitle("d#phi (rad)");
1878 fhTrackMatchedDPhiMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1880 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[1]) ;
1881 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[1]) ;
1883 fhTrackMatchedDEtaMCOverlap[0] = new TH2F
1884 ("hTrackMatchedDEtaMCOverlapNoCut",
1885 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1886 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1887 fhTrackMatchedDEtaMCOverlap[0]->SetYTitle("d#eta");
1888 fhTrackMatchedDEtaMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1890 fhTrackMatchedDPhiMCOverlap[0] = new TH2F
1891 ("hTrackMatchedDPhiMCOverlapNoCut",
1892 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1893 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1894 fhTrackMatchedDPhiMCOverlap[0]->SetYTitle("d#phi (rad)");
1895 fhTrackMatchedDPhiMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1897 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[0]) ;
1898 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[0]) ;
1900 fhTrackMatchedDEtaMCOverlap[1] = new TH2F
1901 ("hTrackMatchedDEtaMCOverlap",
1902 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1903 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1904 fhTrackMatchedDEtaMCOverlap[1]->SetYTitle("d#eta");
1905 fhTrackMatchedDEtaMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1907 fhTrackMatchedDPhiMCOverlap[1] = new TH2F
1908 ("hTrackMatchedDPhiMCOverlap",
1909 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1910 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1911 fhTrackMatchedDPhiMCOverlap[1]->SetYTitle("d#phi (rad)");
1912 fhTrackMatchedDPhiMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1914 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[1]) ;
1915 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[1]) ;
1917 fhTrackMatchedDEtaMCConversion[0] = new TH2F
1918 ("hTrackMatchedDEtaMCConversionNoCut",
1919 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1920 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1921 fhTrackMatchedDEtaMCConversion[0]->SetYTitle("d#eta");
1922 fhTrackMatchedDEtaMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1924 fhTrackMatchedDPhiMCConversion[0] = new TH2F
1925 ("hTrackMatchedDPhiMCConversionNoCut",
1926 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1927 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1928 fhTrackMatchedDPhiMCConversion[0]->SetYTitle("d#phi (rad)");
1929 fhTrackMatchedDPhiMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1931 outputContainer->Add(fhTrackMatchedDEtaMCConversion[0]) ;
1932 outputContainer->Add(fhTrackMatchedDPhiMCConversion[0]) ;
1935 fhTrackMatchedDEtaMCConversion[1] = new TH2F
1936 ("hTrackMatchedDEtaMCConversion",
1937 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1938 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1939 fhTrackMatchedDEtaMCConversion[1]->SetYTitle("d#eta");
1940 fhTrackMatchedDEtaMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1942 fhTrackMatchedDPhiMCConversion[1] = new TH2F
1943 ("hTrackMatchedDPhiMCConversion",
1944 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1945 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1946 fhTrackMatchedDPhiMCConversion[1]->SetYTitle("d#phi (rad)");
1947 fhTrackMatchedDPhiMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1949 outputContainer->Add(fhTrackMatchedDEtaMCConversion[1]) ;
1950 outputContainer->Add(fhTrackMatchedDPhiMCConversion[1]) ;
1953 fhTrackMatchedMCParticle[0] = new TH2F
1954 ("hTrackMatchedMCParticleNoCut",
1955 "Origin of particle vs energy",
1956 nptbins,ptmin,ptmax,8,0,8);
1957 fhTrackMatchedMCParticle[0]->SetXTitle("E (GeV)");
1958 //fhTrackMatchedMCParticle[0]->SetYTitle("Particle type");
1960 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(1 ,"Photon");
1961 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(2 ,"Electron");
1962 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1963 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(4 ,"Rest");
1964 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1965 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1966 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1967 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1969 fhTrackMatchedMCParticle[1] = new TH2F
1970 ("hTrackMatchedMCParticle",
1971 "Origin of particle vs energy",
1972 nptbins,ptmin,ptmax,8,0,8);
1973 fhTrackMatchedMCParticle[1]->SetXTitle("E (GeV)");
1974 //fhTrackMatchedMCParticle[1]->SetYTitle("Particle type");
1976 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(1 ,"Photon");
1977 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(2 ,"Electron");
1978 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1979 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(4 ,"Rest");
1980 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1981 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1982 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1983 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1985 outputContainer->Add(fhTrackMatchedMCParticle[0]);
1986 outputContainer->Add(fhTrackMatchedMCParticle[1]);
1991 if(fFillPileUpHistograms)
1994 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
1996 for(Int_t i = 0 ; i < 7 ; i++)
1998 fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
1999 Form("Cluster p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2000 fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2001 outputContainer->Add(fhPtPileUp[i]);
2003 fhPtChargedPileUp[i] = new TH1F(Form("hPtChargedPileUp%s",pileUpName[i].Data()),
2004 Form("Charged clusters p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2005 fhPtChargedPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2006 outputContainer->Add(fhPtChargedPileUp[i]);
2008 fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
2009 Form("Selected photon p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2010 fhPtPhotonPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2011 outputContainer->Add(fhPtPhotonPileUp[i]);
2014 fhClusterEFracLongTimePileUp[i] = new TH2F(Form("hClusterEFracLongTimePileUp%s",pileUpName[i].Data()),
2015 Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
2016 nptbins,ptmin,ptmax,200,0,1);
2017 fhClusterEFracLongTimePileUp[i]->SetXTitle("E (GeV)");
2018 fhClusterEFracLongTimePileUp[i]->SetYTitle("E(large time) / E");
2019 outputContainer->Add(fhClusterEFracLongTimePileUp[i]);
2021 fhClusterTimeDiffPileUp[i] = new TH2F(Form("hClusterTimeDiffPileUp%s",pileUpName[i].Data()),
2022 Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2023 nptbins,ptmin,ptmax,200,-100,100);
2024 fhClusterTimeDiffPileUp[i]->SetXTitle("E (GeV)");
2025 fhClusterTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2026 outputContainer->Add(fhClusterTimeDiffPileUp[i]);
2028 fhClusterTimeDiffChargedPileUp[i] = new TH2F(Form("hClusterTimeDiffChargedPileUp%s",pileUpName[i].Data()),
2029 Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2030 nptbins,ptmin,ptmax,200,-100,100);
2031 fhClusterTimeDiffChargedPileUp[i]->SetXTitle("E (GeV)");
2032 fhClusterTimeDiffChargedPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2033 outputContainer->Add(fhClusterTimeDiffChargedPileUp[i]);
2035 fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
2036 Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2037 nptbins,ptmin,ptmax,200,-100,100);
2038 fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("E (GeV)");
2039 fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2040 outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
2042 fhLambda0PileUp[i] = new TH2F(Form("hLambda0PileUp%s",pileUpName[i].Data()),
2043 Form("Cluster E vs #lambda^{2}_{0} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2044 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2045 fhLambda0PileUp[i]->SetXTitle("E (GeV)");
2046 fhLambda0PileUp[i]->SetYTitle("#lambda^{2}_{0}");
2047 outputContainer->Add(fhLambda0PileUp[i]);
2049 fhLambda0ChargedPileUp[i] = new TH2F(Form("hLambda0ChargedPileUp%s",pileUpName[i].Data()),
2050 Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2051 fhLambda0ChargedPileUp[i]->SetXTitle("E (GeV)");
2052 fhLambda0ChargedPileUp[i]->SetYTitle("#lambda^{2}_{0}");
2053 outputContainer->Add(fhLambda0ChargedPileUp[i]);
2057 fhEtaPhiBC0 = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
2058 fhEtaPhiBC0->SetXTitle("#eta ");
2059 fhEtaPhiBC0->SetYTitle("#phi (rad)");
2060 outputContainer->Add(fhEtaPhiBC0);
2062 fhEtaPhiBCPlus = new TH2F ("hEtaPhiBCPlus","eta-phi for clusters tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
2063 fhEtaPhiBCPlus->SetXTitle("#eta ");
2064 fhEtaPhiBCPlus->SetYTitle("#phi (rad)");
2065 outputContainer->Add(fhEtaPhiBCPlus);
2067 fhEtaPhiBCMinus = new TH2F ("hEtaPhiBCMinus","eta-phi for clusters tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
2068 fhEtaPhiBCMinus->SetXTitle("#eta ");
2069 fhEtaPhiBCMinus->SetYTitle("#phi (rad)");
2070 outputContainer->Add(fhEtaPhiBCMinus);
2072 fhEtaPhiBC0PileUpSPD = new TH2F ("hEtaPhiBC0PileUpSPD","eta-phi for clusters tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2073 fhEtaPhiBC0PileUpSPD->SetXTitle("#eta ");
2074 fhEtaPhiBC0PileUpSPD->SetYTitle("#phi (rad)");
2075 outputContainer->Add(fhEtaPhiBC0PileUpSPD);
2077 fhEtaPhiBCPlusPileUpSPD = new TH2F ("hEtaPhiBCPlusPileUpSPD","eta-phi for clusters tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2078 fhEtaPhiBCPlusPileUpSPD->SetXTitle("#eta ");
2079 fhEtaPhiBCPlusPileUpSPD->SetYTitle("#phi (rad)");
2080 outputContainer->Add(fhEtaPhiBCPlusPileUpSPD);
2082 fhEtaPhiBCMinusPileUpSPD = new TH2F ("hEtaPhiBCMinusPileUpSPD","eta-phi for clusters tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2083 fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
2084 fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
2085 outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
2087 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2088 fhTimeENoCut->SetXTitle("E (GeV)");
2089 fhTimeENoCut->SetYTitle("time (ns)");
2090 outputContainer->Add(fhTimeENoCut);
2092 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2093 fhTimeESPD->SetXTitle("E (GeV)");
2094 fhTimeESPD->SetYTitle("time (ns)");
2095 outputContainer->Add(fhTimeESPD);
2097 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2098 fhTimeESPDMulti->SetXTitle("E (GeV)");
2099 fhTimeESPDMulti->SetYTitle("time (ns)");
2100 outputContainer->Add(fhTimeESPDMulti);
2102 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2103 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
2104 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
2105 outputContainer->Add(fhTimeNPileUpVertSPD);
2107 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
2108 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
2109 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
2110 outputContainer->Add(fhTimeNPileUpVertTrack);
2112 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2113 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
2114 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
2115 outputContainer->Add(fhTimeNPileUpVertContributors);
2117 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);
2118 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
2119 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
2120 outputContainer->Add(fhTimePileUpMainVertexZDistance);
2122 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
2123 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
2124 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
2125 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
2127 TString title[] = {"no |t diff| cut","|t diff|<20 ns","|t diff|>20 ns","|t diff|>40 ns"};
2128 TString name [] = {"TDiffNoCut","TDiffSmaller20ns","TDiffLarger20ns","TDiffLarger40ns"};
2129 for(Int_t i = 0; i < 4; i++)
2131 fhClusterMultSPDPileUp[i] = new TH2F(Form("fhClusterMultSPDPileUp_%s", name[i].Data()),
2132 Form("Number of clusters per pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
2133 nptbins,ptmin,ptmax,100,0,100);
2134 fhClusterMultSPDPileUp[i]->SetYTitle("n clusters ");
2135 fhClusterMultSPDPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2136 outputContainer->Add(fhClusterMultSPDPileUp[i]) ;
2138 fhClusterMultNoPileUp[i] = new TH2F(Form("fhClusterMultNoPileUp_%s", name[i].Data()),
2139 Form("Number of clusters per non pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
2140 nptbins,ptmin,ptmax,100,0,100);
2141 fhClusterMultNoPileUp[i]->SetYTitle("n clusters ");
2142 fhClusterMultNoPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2143 outputContainer->Add(fhClusterMultNoPileUp[i]) ;
2150 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
2151 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
2152 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
2154 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
2155 "Conversion", "Hadron", "AntiNeutron","AntiProton",
2156 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
2158 for(Int_t i = 0; i < fNOriginHistograms; i++)
2160 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
2161 Form("cluster from %s : E ",ptype[i].Data()),
2162 nptbins,ptmin,ptmax);
2163 fhMCE[i]->SetXTitle("E (GeV)");
2164 outputContainer->Add(fhMCE[i]) ;
2166 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
2167 Form("cluster from %s : p_{T} ",ptype[i].Data()),
2168 nptbins,ptmin,ptmax);
2169 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
2170 outputContainer->Add(fhMCPt[i]) ;
2172 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
2173 Form("cluster from %s : #eta ",ptype[i].Data()),
2174 nptbins,ptmin,ptmax,netabins,etamin,etamax);
2175 fhMCEta[i]->SetYTitle("#eta");
2176 fhMCEta[i]->SetXTitle("E (GeV)");
2177 outputContainer->Add(fhMCEta[i]) ;
2179 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
2180 Form("cluster from %s : #phi ",ptype[i].Data()),
2181 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2182 fhMCPhi[i]->SetYTitle("#phi (rad)");
2183 fhMCPhi[i]->SetXTitle("E (GeV)");
2184 outputContainer->Add(fhMCPhi[i]) ;
2187 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
2188 Form("MC - Reco E from %s",pname[i].Data()),
2189 nptbins,ptmin,ptmax, 200,-50,50);
2190 fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
2191 outputContainer->Add(fhMCDeltaE[i]);
2193 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
2194 Form("MC - Reco p_{T} from %s",pname[i].Data()),
2195 nptbins,ptmin,ptmax, 200,-50,50);
2196 fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
2197 outputContainer->Add(fhMCDeltaPt[i]);
2199 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
2200 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
2201 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2202 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
2203 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
2204 outputContainer->Add(fhMC2E[i]);
2206 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
2207 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
2208 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2209 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
2210 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
2211 outputContainer->Add(fhMC2Pt[i]);
2216 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
2217 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
2219 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
2220 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
2222 for(Int_t i = 0; i < fNPrimaryHistograms; i++)
2224 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
2225 Form("primary photon %s : E ",pptype[i].Data()),
2226 nptbins,ptmin,ptmax);
2227 fhEPrimMC[i]->SetXTitle("E (GeV)");
2228 outputContainer->Add(fhEPrimMC[i]) ;
2230 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
2231 Form("primary photon %s : p_{T} ",pptype[i].Data()),
2232 nptbins,ptmin,ptmax);
2233 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
2234 outputContainer->Add(fhPtPrimMC[i]) ;
2236 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
2237 Form("primary photon %s : Rapidity ",pptype[i].Data()),
2238 nptbins,ptmin,ptmax,800,-8,8);
2239 fhYPrimMC[i]->SetYTitle("Rapidity");
2240 fhYPrimMC[i]->SetXTitle("E (GeV)");
2241 outputContainer->Add(fhYPrimMC[i]) ;
2243 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
2244 Form("primary photon %s : #phi ",pptype[i].Data()),
2245 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2246 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
2247 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
2248 outputContainer->Add(fhPhiPrimMC[i]) ;
2251 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
2252 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
2253 nptbins,ptmin,ptmax);
2254 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
2255 outputContainer->Add(fhEPrimMCAcc[i]) ;
2257 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
2258 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
2259 nptbins,ptmin,ptmax);
2260 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
2261 outputContainer->Add(fhPtPrimMCAcc[i]) ;
2263 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
2264 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
2265 nptbins,ptmin,ptmax,100,-1,1);
2266 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
2267 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
2268 outputContainer->Add(fhYPrimMCAcc[i]) ;
2270 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
2271 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
2272 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2273 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
2274 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
2275 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
2279 if(fFillSSHistograms)
2281 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
2283 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
2285 for(Int_t i = 0; i < 6; i++)
2287 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
2288 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
2289 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2290 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
2291 fhMCELambda0[i]->SetXTitle("E (GeV)");
2292 outputContainer->Add(fhMCELambda0[i]) ;
2294 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
2295 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
2296 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2297 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
2298 fhMCELambda1[i]->SetXTitle("E (GeV)");
2299 outputContainer->Add(fhMCELambda1[i]) ;
2301 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
2302 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
2303 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2304 fhMCEDispersion[i]->SetYTitle("D^{2}");
2305 fhMCEDispersion[i]->SetXTitle("E (GeV)");
2306 outputContainer->Add(fhMCEDispersion[i]) ;
2308 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
2309 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
2310 nptbins,ptmin,ptmax, nbins,nmin,nmax);
2311 fhMCNCellsE[i]->SetXTitle("E (GeV)");
2312 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
2313 outputContainer->Add(fhMCNCellsE[i]);
2315 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
2316 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
2317 nptbins,ptmin,ptmax, 500,0,1.);
2318 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
2319 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2320 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
2322 if(!fFillOnlySimpleSSHisto)
2324 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2325 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2326 ssbins,ssmin,ssmax,500,0,1.);
2327 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
2328 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2329 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
2331 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2332 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2333 ssbins,ssmin,ssmax,500,0,1.);
2334 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
2335 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2336 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
2338 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2339 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
2340 ssbins,ssmin,ssmax,500,0,1.);
2341 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
2342 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2343 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
2345 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2346 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2347 nbins/5,nmin,nmax/5,500,0,1.);
2348 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
2349 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2350 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
2352 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2353 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2354 nbins/5,nmin,nmax/5,500,0,1.);
2355 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
2356 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2357 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
2359 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2360 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
2361 nbins/5,nmin,nmax/5,500,0,1.);
2362 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
2363 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
2364 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
2366 if(fCalorimeter=="EMCAL")
2368 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
2369 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
2370 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2371 fhMCEDispEta[i]->SetXTitle("E (GeV)");
2372 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
2373 outputContainer->Add(fhMCEDispEta[i]);
2375 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
2376 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
2377 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2378 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
2379 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2380 outputContainer->Add(fhMCEDispPhi[i]);
2382 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
2383 Form("cluster from %s : #delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",ptypess[i].Data()),
2384 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
2385 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
2386 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
2387 outputContainer->Add(fhMCESumEtaPhi[i]);
2389 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
2390 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
2391 nptbins,ptmin,ptmax,200,-10,10);
2392 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
2393 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
2394 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
2396 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
2397 Form("cluster from %s : (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",ptypess[i].Data()),
2398 nptbins,ptmin,ptmax, 200,-1,1);
2399 fhMCESphericity[i]->SetXTitle("E (GeV)");
2400 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2401 outputContainer->Add(fhMCESphericity[i]);
2403 for(Int_t ie = 0; ie < 7; ie++)
2405 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2406 Form("cluster from %s : #sigma^{2}_{#phi #phi} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2407 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2408 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2409 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2410 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
2412 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
2413 Form("cluster from %s : #lambda^{2}_{0} vs #sigma^{2}_{#eta #eta} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2414 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2415 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
2416 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2417 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
2419 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2420 Form("cluster from %s :#lambda^{2}_{0} vs #sigma^{2}_{#phi #phi} for %d < E < %d GeV",pnamess[i].Data(),bin[ie],bin[ie+1]),
2421 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2422 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
2423 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2424 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
2430 if(!GetReader()->IsEmbeddedClusterSelectionOn())
2432 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
2433 "cluster from Photon : E vs #lambda_{0}^{2}",
2434 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2435 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
2436 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
2437 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
2439 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
2440 "cluster from Photon : E vs #lambda_{0}^{2}",
2441 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2442 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
2443 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
2444 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
2446 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
2447 "cluster from Photon : E vs #lambda_{0}^{2}",
2448 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2449 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
2450 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
2451 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
2455 //Fill histograms to check shape of embedded clusters
2456 if(GetReader()->IsEmbeddedClusterSelectionOn())
2459 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
2460 "Energy Fraction of embedded signal versus cluster energy",
2461 nptbins,ptmin,ptmax,100,0.,1.);
2462 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
2463 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
2464 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
2466 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
2467 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2468 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2469 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2470 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
2471 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
2473 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
2474 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2475 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2476 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2477 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
2478 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
2480 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
2481 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2482 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2483 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2484 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
2485 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
2487 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
2488 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2489 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2490 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2491 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
2492 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
2494 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
2495 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2496 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2497 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2498 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
2499 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
2501 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
2502 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2503 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2504 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2505 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
2506 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
2508 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
2509 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2510 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2511 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2512 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
2513 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
2515 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
2516 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2517 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2518 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2519 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
2520 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
2522 }// embedded histograms
2525 }// Fill SS MC histograms
2529 return outputContainer ;
2533 //_______________________
2534 void AliAnaPhoton::Init()
2539 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
2541 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
2544 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
2546 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
2550 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
2554 //____________________________________________________________________________
2555 void AliAnaPhoton::InitParameters()
2558 //Initialize the parameters of the analysis.
2559 AddToHistogramsName("AnaPhoton_");
2561 fCalorimeter = "EMCAL" ;
2566 fTimeCutMin =-1000000;
2567 fTimeCutMax = 1000000;
2570 fRejectTrackMatch = kTRUE ;
2574 //__________________________________________________________________
2575 void AliAnaPhoton::MakeAnalysisFillAOD()
2577 //Do photon analysis and fill aods
2580 Double_t v[3] = {0,0,0}; //vertex ;
2581 GetReader()->GetVertex(v);
2583 //Select the Calorimeter of the photon
2584 TObjArray * pl = 0x0;
2585 AliVCaloCells* cells = 0;
2586 if (fCalorimeter == "PHOS" )
2588 pl = GetPHOSClusters();
2589 cells = GetPHOSCells();
2591 else if (fCalorimeter == "EMCAL")
2593 pl = GetEMCALClusters();
2594 cells = GetEMCALCells();
2599 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2603 FillPileUpHistogramsPerEvent(pl);
2605 // Loop on raw clusters before filtering in the reader and fill control histogram
2606 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
2608 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
2610 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
2611 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
2612 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
2617 TClonesArray * clusterList = 0;
2619 if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
2620 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2621 else if(GetReader()->GetOutputEvent())
2622 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2626 Int_t nclusters = clusterList->GetEntriesFast();
2627 for (Int_t iclus = 0; iclus < nclusters; iclus++)
2629 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
2630 if(clus)fhClusterCuts[0]->Fill(clus->E());
2635 //Init arrays, variables, get number of clusters
2636 TLorentzVector mom, mom2 ;
2637 Int_t nCaloClusters = pl->GetEntriesFast();
2639 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
2641 //----------------------------------------------------
2642 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
2643 //----------------------------------------------------
2645 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
2647 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2648 //printf("calo %d, %f\n",icalo,calo->E());
2650 //Get the index where the cluster comes, to retrieve the corresponding vertex
2651 Int_t evtIndex = 0 ;
2652 if (GetMixedEvent())
2654 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2655 //Get the vertex and check it is not too large in z
2656 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
2659 //Cluster selection, not charged, with photon id and in fiducial cut
2660 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2662 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
2665 Double_t vertex[]={0,0,0};
2666 calo->GetMomentum(mom,vertex) ;
2669 //--------------------------------------
2670 // Cluster selection
2671 //--------------------------------------
2672 Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
2673 if(!ClusterSelected(calo,mom,nMaxima)) continue;
2675 //----------------------------
2676 //Create AOD for analysis
2677 //----------------------------
2678 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
2680 //...............................................
2681 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
2682 Int_t label = calo->GetLabel();
2683 aodph.SetLabel(label);
2684 aodph.SetCaloLabel(calo->GetID(),-1);
2685 aodph.SetDetector(fCalorimeter);
2686 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
2688 //...............................................
2689 //Set bad channel distance bit
2690 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2691 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
2692 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
2693 else aodph.SetDistToBad(0) ;
2694 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
2696 //--------------------------------------------------------------------------------------
2697 // Play with the MC stack if available
2698 //--------------------------------------------------------------------------------------
2700 //Check origin of the candidates
2705 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodph.GetInputFileIndex());
2709 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
2710 }//Work with stack also
2713 //--------------------------------------------------------------------------------------
2714 //Fill some shower shape histograms before PID is applied
2715 //--------------------------------------------------------------------------------------
2717 FillShowerShapeHistograms(calo,tag);
2719 //-------------------------------------
2720 //PID selection or bit setting
2721 //-------------------------------------
2723 //...............................................
2724 // Data, PID check on
2727 // Get most probable PID, 2 options check bayesian PID weights or redo PID
2728 // By default, redo PID
2730 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
2732 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
2734 //If cluster does not pass pid, not photon, skip it.
2735 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
2739 //...............................................
2740 // Data, PID check off
2743 //Set PID bits for later selection (AliAnaPi0 for example)
2744 //GetIdentifiedParticleType already called in SetPIDBits.
2746 GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
2748 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
2751 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
2752 aodph.Pt(), aodph.GetIdentifiedParticleType());
2754 fhClusterCuts[9]->Fill(calo->E());
2756 fhNLocMax->Fill(calo->E(),nMaxima);
2758 // Matching after cuts
2759 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
2761 // Fill histograms to undertand pile-up before other cuts applied
2762 // Remember to relax time cuts in the reader
2763 FillPileUpHistograms(calo->E(),mom.Pt(),calo->GetTOF()*1e9);
2765 // Add number of local maxima to AOD, method name in AOD to be FIXED
2766 aodph.SetFiducialArea(nMaxima);
2769 //Add AOD with photon object to aod branch
2770 AddAODParticle(aodph);
2774 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
2778 //__________________________________________________________________
2779 void AliAnaPhoton::MakeAnalysisFillHistograms()
2784 Double_t v[3] = {0,0,0}; //vertex ;
2785 GetReader()->GetVertex(v);
2786 //fhVertex->Fill(v[0],v[1],v[2]);
2787 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
2789 //----------------------------------
2790 //Loop on stored AOD photons
2791 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2792 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2794 for(Int_t iaod = 0; iaod < naod ; iaod++)
2796 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2797 Int_t pdg = ph->GetIdentifiedParticleType();
2800 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
2801 ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
2803 //If PID used, fill histos with photons in Calorimeter fCalorimeter
2804 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
2805 if(ph->GetDetector() != fCalorimeter) continue;
2808 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
2810 //................................
2811 //Fill photon histograms
2812 Float_t ptcluster = ph->Pt();
2813 Float_t phicluster = ph->Phi();
2814 Float_t etacluster = ph->Eta();
2815 Float_t ecluster = ph->E();
2817 fhEPhoton ->Fill(ecluster);
2818 fhPtPhoton ->Fill(ptcluster);
2819 fhPhiPhoton ->Fill(ptcluster,phicluster);
2820 fhEtaPhoton ->Fill(ptcluster,etacluster);
2821 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
2822 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
2824 //Get original cluster, to recover some information
2826 Float_t maxCellFraction = 0;
2827 AliVCaloCells* cells = 0;
2828 TObjArray * clusters = 0;
2829 if(fCalorimeter == "EMCAL")
2831 cells = GetEMCALCells();
2832 clusters = GetEMCALClusters();
2836 cells = GetPHOSCells();
2837 clusters = GetPHOSClusters();
2841 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
2844 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
2846 // Control histograms
2847 fhMaxCellDiffClusterE->Fill(ph->E(),maxCellFraction);
2848 fhNCellsE ->Fill(ph->E(),cluster->GetNCells());
2849 fhTimeE ->Fill(ph->E(),cluster->GetTOF()*1.e9);
2852 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
2853 fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
2857 //.......................................
2858 //Play with the MC data if available
2863 if(GetReader()->ReadStack() && !GetMCStack())
2865 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called?\n");
2867 else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles(0))
2869 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
2873 FillAcceptanceHistograms();
2875 //....................................................................
2876 // Access MC information in stack if requested, check that it exists.
2877 Int_t label =ph->GetLabel();
2881 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
2888 TLorentzVector primary = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2891 eprim = primary.Energy();
2892 ptprim = primary.Pt();
2895 Int_t tag =ph->GetTag();
2896 Int_t mcParticleTag = -1;
2897 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
2899 fhMCE [kmcPhoton] ->Fill(ecluster);
2900 fhMCPt [kmcPhoton] ->Fill(ptcluster);
2901 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
2902 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
2904 fhMC2E [kmcPhoton] ->Fill(ecluster, eprim);
2905 fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim);
2906 fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
2907 fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
2909 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
2910 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
2911 fhMCE[kmcConversion])
2913 fhMCE [kmcConversion] ->Fill(ecluster);
2914 fhMCPt [kmcConversion] ->Fill(ptcluster);
2915 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
2916 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
2918 fhMC2E [kmcConversion] ->Fill(ecluster, eprim);
2919 fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim);
2920 fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
2921 fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
2924 if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
2926 mcParticleTag = kmcPrompt;
2928 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
2930 mcParticleTag = kmcFragmentation;
2932 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
2934 mcParticleTag = kmcISR;
2936 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
2937 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
2939 mcParticleTag = kmcPi0Decay;
2941 else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
2942 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) ||
2943 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
2945 mcParticleTag = kmcOtherDecay;
2947 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
2949 mcParticleTag = kmcPi0;
2951 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
2953 mcParticleTag = kmcEta;
2956 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
2958 mcParticleTag = kmcAntiNeutron;
2960 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
2962 mcParticleTag = kmcAntiProton;
2964 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
2966 mcParticleTag = kmcElectron;
2968 else if( fhMCE[kmcOther])
2970 mcParticleTag = kmcOther;
2972 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2973 // ph->GetLabel(),ph->Pt());
2974 // for(Int_t i = 0; i < 20; i++) {
2975 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2981 fhMCE [mcParticleTag] ->Fill(ecluster);
2982 fhMCPt [mcParticleTag] ->Fill(ptcluster);
2983 fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
2984 fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
2986 fhMC2E[mcParticleTag] ->Fill(ecluster, eprim);
2987 fhMC2Pt[mcParticleTag] ->Fill(ptcluster, ptprim);
2988 fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
2989 fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
2991 }//Histograms with MC
2998 //__________________________________________________________________
2999 void AliAnaPhoton::Print(const Option_t * opt) const
3001 //Print some relevant parameters set for the analysis
3006 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3007 AliAnaCaloTrackCorrBaseClass::Print(" ");
3009 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
3010 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
3011 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
3012 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
3013 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
3014 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
3015 printf("Number of cells in cluster is > %d \n", fNCellsCut);