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), fFillEMCALBCHistograms(0),
67 fhNCellsE(0), fhCellsE(0), // Control histograms
68 fhMaxCellDiffClusterE(0), fhTimePt(0), // Control histograms
69 fhEtaPhi(0), fhEtaPhiEMCALBC0(0),
70 fhEtaPhiEMCALBC1(0), fhEtaPhiEMCALBCN(0),
71 fhTimeTriggerEMCALBCCluster(0),
72 fhTimeTriggerEMCALBCUMCluster(0),
73 fhEtaPhiTriggerEMCALBCClusterOverTh(0),
74 fhEtaPhiTriggerEMCALBCUMClusterOverTh(0),
75 fhEtaPhiTriggerEMCALBCClusterBelowTh1(0),
76 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1(0),
77 fhEtaPhiTriggerEMCALBCClusterBelowTh2(0),
78 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2(0),
79 fhEtaPhiTriggerEMCALBCExotic(0), fhTimeTriggerEMCALBCExotic(0),
80 fhEtaPhiTriggerEMCALBCUMExotic(0), fhTimeTriggerEMCALBCUMExotic(0),
81 fhEtaPhiTriggerEMCALBCBad(0), fhTimeTriggerEMCALBCBad(0),
82 fhEtaPhiTriggerEMCALBCUMBad(0), fhTimeTriggerEMCALBCUMBad(0),
83 fhEtaPhiTriggerEMCALBCBadExotic(0), fhTimeTriggerEMCALBCBadExotic(0),
84 fhEtaPhiTriggerEMCALBCUMBadExotic(0), fhTimeTriggerEMCALBCUMBadExotic(0),
85 fhEtaPhiTriggerEMCALBCExoticCluster(0), fhTimeTriggerEMCALBCExoticCluster(0),
86 fhEtaPhiTriggerEMCALBCUMExoticCluster(0), fhTimeTriggerEMCALBCUMExoticCluster(0),
87 fhEtaPhiTriggerEMCALBCBadCluster(0), fhTimeTriggerEMCALBCBadCluster(0),
88 fhEtaPhiTriggerEMCALBCUMBadCluster(0), fhTimeTriggerEMCALBCUMBadCluster(0),
89 fhEtaPhiTriggerEMCALBCBadExoticCluster(0), fhTimeTriggerEMCALBCBadExoticCluster(0),
90 fhEtaPhiTriggerEMCALBCUMBadExoticCluster(0), fhTimeTriggerEMCALBCUMBadExoticCluster(0),
91 fhTimeTriggerEMCALBCBadMaxCell(0), fhTimeTriggerEMCALBCUMBadMaxCell(0),
92 fhTimeTriggerEMCALBCBadMaxCellExotic(0), fhTimeTriggerEMCALBCUMBadMaxCellExotic(0),
93 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster (0), fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster(0),
94 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster(0),fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster(0),
95 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster(0), fhTimeTriggerEMCALBCUMReMatchBothCluster(0),
96 fhTimeTriggerEMCALBC0UMReMatchOpenTime(0),
97 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh(0),
98 fhTimeTriggerEMCALBC0UMReMatchBoth(0),
100 fhEtaPhiNoTrigger(0), fhTimeNoTrigger(0),
102 fhEPhoton(0), fhPtPhoton(0),
103 fhPhiPhoton(0), fhEtaPhoton(0),
104 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
105 fhEtaPhiPhotonEMCALBC0(0), fhEtaPhiPhotonEMCALBC1(0), fhEtaPhiPhotonEMCALBCN(0),
106 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime(0),
107 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh(0),
108 fhTimePhotonTriggerEMCALBC0UMReMatchBoth(0),
110 fhPtCentralityPhoton(0), fhPtEventPlanePhoton(0),
112 // Shower shape histograms
114 fhDispE(0), fhLam0E(0), fhLam1E(0),
115 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
116 fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
117 fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam1ETMTRD(0),
119 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
120 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
122 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
123 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
124 fhLam0DispLowE(0), fhLam0DispHighE(0),
125 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
126 fhDispLam1LowE(0), fhDispLam1HighE(0),
127 fhDispEtaE(0), fhDispPhiE(0),
128 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
129 fhDispEtaPhiDiffE(0), fhSphericityE(0),
130 fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
133 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
135 fhEmbeddedSignalFractionEnergy(0),
136 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
137 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
138 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
139 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
141 fhTimePtNoCut(0), fhTimePtSPD(0),
142 fhTimePtPhotonNoCut(0), fhTimePtPhotonSPD(0),
143 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
144 fhTimeNPileUpVertContributors(0),
145 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
146 fhClusterMultSPDPileUp(), fhClusterMultNoPileUp(),
147 fhEtaPhiBC0(0), fhEtaPhiBCPlus(0), fhEtaPhiBCMinus(0),
148 fhEtaPhiBC0PileUpSPD(0),
149 fhEtaPhiBCPlusPileUpSPD(0), fhEtaPhiBCMinusPileUpSPD(0),
150 fhPtNPileUpSPDVtx(0), fhPtNPileUpTrkVtx(0),
151 fhPtNPileUpSPDVtxTimeCut(0), fhPtNPileUpTrkVtxTimeCut(0),
152 fhPtNPileUpSPDVtxTimeCut2(0), fhPtNPileUpTrkVtxTimeCut2(0),
153 fhPtPhotonNPileUpSPDVtx(0), fhPtPhotonNPileUpTrkVtx(0),
154 fhPtPhotonNPileUpSPDVtxTimeCut(0), fhPtPhotonNPileUpTrkVtxTimeCut(0),
155 fhPtPhotonNPileUpSPDVtxTimeCut2(0), fhPtPhotonNPileUpTrkVtxTimeCut2(0)
159 for(Int_t i = 0; i < 14; i++)
171 for(Int_t i = 0; i < 7; i++)
179 fhPtPrimMCAcc [i] = 0;
180 fhEPrimMCAcc [i] = 0;
181 fhPhiPrimMCAcc[i] = 0;
182 fhEtaPrimMCAcc[i] = 0;
183 fhYPrimMCAcc [i] = 0;
185 fhDispEtaDispPhi[i] = 0;
186 fhLambda0DispPhi[i] = 0;
187 fhLambda0DispEta[i] = 0;
190 fhPtChargedPileUp[i] = 0;
191 fhPtPhotonPileUp [i] = 0;
193 fhLambda0PileUp [i] = 0;
194 fhLambda0ChargedPileUp[i] = 0;
196 fhClusterEFracLongTimePileUp [i] = 0;
198 fhClusterCellTimePileUp [i] = 0;
199 fhClusterTimeDiffPileUp [i] = 0;
200 fhClusterTimeDiffChargedPileUp[i] = 0;
201 fhClusterTimeDiffPhotonPileUp [i] = 0;
203 for(Int_t j = 0; j < 6; j++)
205 fhMCDispEtaDispPhi[i][j] = 0;
206 fhMCLambda0DispEta[i][j] = 0;
207 fhMCLambda0DispPhi[i][j] = 0;
211 for(Int_t i = 0; i < 6; i++)
213 fhMCELambda0 [i] = 0;
214 fhMCELambda1 [i] = 0;
215 fhMCEDispersion [i] = 0;
217 fhMCMaxCellDiffClusterE[i] = 0;
218 fhLambda0DispEta[i] = 0;
219 fhLambda0DispPhi[i] = 0;
221 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
222 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
223 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
224 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
225 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
226 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
228 fhMCEDispEta [i] = 0;
229 fhMCEDispPhi [i] = 0;
230 fhMCESumEtaPhi [i] = 0;
231 fhMCEDispEtaPhiDiff[i] = 0;
232 fhMCESphericity [i] = 0;
235 for(Int_t i = 0; i < 5; i++)
237 fhClusterCuts[i] = 0;
240 // Track matching residuals
241 for(Int_t i = 0; i < 2; i++)
243 fhTrackMatchedDEta [i] = 0; fhTrackMatchedDPhi [i] = 0; fhTrackMatchedDEtaDPhi [i] = 0;
244 fhTrackMatchedDEtaNeg[i] = 0; fhTrackMatchedDPhiNeg[i] = 0; fhTrackMatchedDEtaDPhiNeg[i] = 0;
245 fhTrackMatchedDEtaPos[i] = 0; fhTrackMatchedDPhiPos[i] = 0; fhTrackMatchedDEtaDPhiPos[i] = 0;
246 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
247 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
248 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
249 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
250 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
251 fhdEdx[i] = 0; fhEOverP[i] = 0;
255 for(Int_t i = 0; i < 4; i++)
257 fhClusterMultSPDPileUp[i] = 0;
258 fhClusterMultNoPileUp [i] = 0;
261 for(Int_t i = 0; i < 11; i++)
263 fhEtaPhiTriggerEMCALBC [i] = 0 ;
264 fhTimeTriggerEMCALBC [i] = 0 ;
265 fhEtaPhiTriggerEMCALBCUM [i] = 0 ;
266 fhTimeTriggerEMCALBCUM [i] = 0 ;
268 fhEtaPhiPhotonTriggerEMCALBC [i] = 0 ;
269 fhTimePhotonTriggerEMCALBC [i] = 0 ;
270 fhEtaPhiPhotonTriggerEMCALBCUM [i] = 0 ;
271 fhTimePhotonTriggerEMCALBCUM [i] = 0 ;
273 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = 0 ;
274 fhTimeTriggerEMCALBCPileUpSPD [i] = 0 ;
276 fhEtaPhiTriggerEMCALBCCluster [i] = 0 ;
277 fhEtaPhiTriggerEMCALBCUMCluster [i] = 0 ;
280 //Initialize parameters
285 //_________________________________________________________________________________________
286 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima)
288 //Select clusters if they pass different cuts
290 Float_t ptcluster = mom.Pt();
291 Float_t ecluster = mom.E();
292 Float_t l0cluster = calo->GetM02();
293 Float_t etacluster = mom.Eta();
294 Float_t phicluster = mom.Phi();
295 if(phicluster<0) phicluster+=TMath::TwoPi();
296 Float_t tofcluster = calo->GetTOF()*1.e9;
298 Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
301 printf("AliAnaPhoton::ClusterSelected() - Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
302 GetReader()->GetEventNumber(),
303 ecluster,ptcluster, phicluster*TMath::RadToDeg(),etacluster);
305 fhClusterCuts[1]->Fill(ecluster);
307 if(ecluster > 0.5) fhEtaPhi->Fill(etacluster, phicluster);
309 FillEMCALTriggerClusterBCHistograms(calo->GetID(),ecluster,tofcluster,etacluster,phicluster);
311 //.......................................
312 //If too small or big energy, skip it
313 if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
315 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
317 fhClusterCuts[2]->Fill(ecluster);
319 FillClusterPileUpHistograms(calo,matched,ptcluster,etacluster,phicluster,l0cluster);
321 //.......................................
322 // TOF cut, BE CAREFUL WITH THIS CUT
323 Double_t tof = calo->GetTOF()*1e9;
324 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
326 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
328 fhClusterCuts[3]->Fill(ecluster);
330 //.......................................
331 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
333 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
335 fhClusterCuts[4]->Fill(ecluster);
337 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
338 if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
340 fhClusterCuts[5]->Fill(ecluster);
342 //.......................................
343 //Check acceptance selection
344 if(IsFiducialCutOn())
346 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
347 if(! in ) return kFALSE ;
350 if(GetDebug() > 2) printf("Fiducial cut passed \n");
352 fhClusterCuts[6]->Fill(ecluster);
354 //.......................................
355 //Skip matched clusters with tracks
357 // Fill matching residual histograms before PID cuts
358 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
360 if(fRejectTrackMatch)
364 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
368 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
369 }// reject matched clusters
371 fhClusterCuts[7]->Fill(ecluster);
373 if(fFillPileUpHistograms)
375 if(GetReader()->IsPileUpFromSPD()) {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
376 if(GetReader()->IsPileUpFromEMCal()) {fhPtChargedPileUp[1]->Fill(ptcluster); fhLambda0ChargedPileUp[1]->Fill(ecluster,l0cluster); }
377 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtChargedPileUp[2]->Fill(ptcluster); fhLambda0ChargedPileUp[2]->Fill(ecluster,l0cluster); }
378 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtChargedPileUp[3]->Fill(ptcluster); fhLambda0ChargedPileUp[3]->Fill(ecluster,l0cluster); }
379 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtChargedPileUp[4]->Fill(ptcluster); fhLambda0ChargedPileUp[4]->Fill(ecluster,l0cluster); }
380 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtChargedPileUp[5]->Fill(ptcluster); fhLambda0ChargedPileUp[5]->Fill(ecluster,l0cluster); }
381 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtChargedPileUp[6]->Fill(ptcluster); fhLambda0ChargedPileUp[6]->Fill(ecluster,l0cluster); }
384 //.......................................
385 //Check Distance to Bad channel, set bit.
386 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
387 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
388 if(distBad < fMinDist)
389 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
392 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
394 fhClusterCuts[8]->Fill(ecluster);
397 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
398 GetReader()->GetEventNumber(),
399 ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
401 //All checks passed, cluster selected
406 //___________________________________________
407 void AliAnaPhoton::FillAcceptanceHistograms()
409 //Fill acceptance histograms if MC data is available
411 Double_t photonY = -100 ;
412 Double_t photonE = -1 ;
413 Double_t photonPt = -1 ;
414 Double_t photonPhi = 100 ;
415 Double_t photonEta = -1 ;
420 Bool_t inacceptance = kFALSE;
422 if(GetReader()->ReadStack())
424 AliStack * stack = GetMCStack();
427 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
429 TParticle * prim = stack->Particle(i) ;
430 pdg = prim->GetPdgCode();
431 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
432 // prim->GetName(), prim->GetPdgCode());
436 // Get tag of this particle photon from fragmentation, decay, prompt ...
437 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
438 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
440 //A conversion photon from a hadron, skip this kind of photon
441 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
442 // GetMCAnalysisUtils()->PrintMCTag(tag);
447 //Get photon kinematics
448 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
450 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
451 photonE = prim->Energy() ;
452 photonPt = prim->Pt() ;
453 photonPhi = TMath::RadToDeg()*prim->Phi() ;
454 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
455 photonEta = prim->Eta() ;
457 //Check if photons hit the Calorimeter
460 inacceptance = kFALSE;
461 if (fCalorimeter == "PHOS")
463 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
467 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
468 inacceptance = kTRUE;
469 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
473 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
474 inacceptance = kTRUE ;
475 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
478 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
480 if(GetEMCALGeometry())
484 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
487 inacceptance = kTRUE;
489 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
490 // inacceptance = kTRUE;
491 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
495 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
496 inacceptance = kTRUE ;
497 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
502 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
503 if(TMath::Abs(photonY) < 1.0)
505 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
506 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
507 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
508 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
512 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
513 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
514 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
515 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
516 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
520 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
522 mcIndex = kmcPPrompt;
524 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
526 mcIndex = kmcPFragmentation ;
528 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
532 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
534 mcIndex = kmcPPi0Decay;
536 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
537 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
539 mcIndex = kmcPOtherDecay;
541 else if(fhEPrimMC[kmcPOther])
546 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
547 if(TMath::Abs(photonY) < 1.0)
549 fhEPrimMC [mcIndex]->Fill(photonE ) ;
550 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
551 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
552 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
557 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
558 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
559 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
560 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
561 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
566 }//stack exists and data is MC
568 else if(GetReader()->ReadAODMCParticles())
570 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
573 Int_t nprim = mcparticles->GetEntriesFast();
575 for(Int_t i=0; i < nprim; i++)
577 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
579 pdg = prim->GetPdgCode();
583 // Get tag of this particle photon from fragmentation, decay, prompt ...
584 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
585 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
587 //A conversion photon from a hadron, skip this kind of photon
588 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
589 // GetMCAnalysisUtils()->PrintMCTag(tag);
594 //Get photon kinematics
595 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
597 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
598 photonE = prim->E() ;
599 photonPt = prim->Pt() ;
600 photonPhi = prim->Phi() ;
601 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
602 photonEta = prim->Eta() ;
604 //Check if photons hit the Calorimeter
606 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
607 inacceptance = kFALSE;
608 if (fCalorimeter == "PHOS")
610 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
614 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
615 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
616 inacceptance = kTRUE;
617 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
621 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
622 inacceptance = kTRUE ;
623 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
626 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
628 if(GetEMCALGeometry())
632 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
635 inacceptance = kTRUE;
637 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
641 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
642 inacceptance = kTRUE ;
643 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
649 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
650 if(TMath::Abs(photonY) < 1.0)
652 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
653 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
654 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
655 fhEtaPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
660 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
661 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
662 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
663 fhEtaPrimMCAcc[kmcPPhoton]->Fill(photonE , photonEta) ;
664 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
668 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
670 mcIndex = kmcPPrompt;
672 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
674 mcIndex = kmcPFragmentation ;
676 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
680 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
682 mcIndex = kmcPPi0Decay;
684 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
685 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
687 mcIndex = kmcPOtherDecay;
689 else if(fhEPrimMC[kmcPOther])
694 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
695 if(TMath::Abs(photonY) < 1.0)
697 fhEPrimMC [mcIndex]->Fill(photonE ) ;
698 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
699 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
700 fhEtaPrimMC[mcIndex]->Fill(photonE , photonEta) ;
704 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
705 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
706 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
707 fhEtaPrimMCAcc[mcIndex]->Fill(photonE , photonEta) ;
708 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
714 }//kmc array exists and data is MC
718 //__________________________________________________________________________________________________________________________
719 void AliAnaPhoton::FillEMCALTriggerClusterBCHistograms(const Int_t idcalo, const Float_t ecluster, const Float_t tofcluster,
720 const Float_t etacluster, const Float_t phicluster)
723 // Fill trigger related histograms
725 if(!fFillEMCALBCHistograms || fCalorimeter!="EMCAL") return ;
727 Float_t tofclusterUS = TMath::Abs(tofcluster);
731 if (tofclusterUS < 25) fhEtaPhiEMCALBC0->Fill(etacluster, phicluster);
732 else if (tofclusterUS < 75) fhEtaPhiEMCALBC1->Fill(etacluster, phicluster);
733 else fhEtaPhiEMCALBCN->Fill(etacluster, phicluster);
736 Int_t bc = GetReader()->GetTriggerClusterBC();
737 Int_t id = GetReader()->GetTriggerClusterId();
738 Bool_t badMax = GetReader()->IsBadMaxCellTriggerEvent();
742 //printf("AliAnaPhoton::ClusterSelected() - No trigger found bc=%d\n",bc);
743 fhEtaPhiNoTrigger->Fill(etacluster, phicluster);
744 fhTimeNoTrigger ->Fill(ecluster, tofcluster);
746 else if(TMath::Abs(bc) < 6)
748 if(!GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent() )
750 if(GetReader()->IsTriggerMatched())
752 if(ecluster > 2) fhEtaPhiTriggerEMCALBC[bc+5]->Fill(etacluster, phicluster);
753 fhTimeTriggerEMCALBC[bc+5]->Fill(ecluster, tofcluster);
754 if(GetReader()->IsPileUpFromSPD()) fhTimeTriggerEMCALBCPileUpSPD[bc+5]->Fill(ecluster, tofcluster);
756 if(idcalo == GetReader()->GetTriggerClusterId())
758 fhEtaPhiTriggerEMCALBCCluster[bc+5]->Fill(etacluster, phicluster);
759 fhTimeTriggerEMCALBCCluster ->Fill(ecluster, tofcluster);
763 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
764 if(ecluster > threshold)
765 fhEtaPhiTriggerEMCALBCClusterOverTh->Fill(etacluster, phicluster);
766 else if(ecluster > threshold-1)
767 fhEtaPhiTriggerEMCALBCClusterBelowTh1->Fill(etacluster, phicluster);
769 fhEtaPhiTriggerEMCALBCClusterBelowTh2->Fill(etacluster, phicluster);
775 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUM[bc+5]->Fill(etacluster, phicluster);
776 fhTimeTriggerEMCALBCUM[bc+5]->Fill(ecluster, tofcluster);
780 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimeTriggerEMCALBC0UMReMatchOpenTime ->Fill(ecluster, tofcluster);
781 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimeTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(ecluster, tofcluster);
782 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimeTriggerEMCALBC0UMReMatchBoth ->Fill(ecluster, tofcluster);
785 if(idcalo == GetReader()->GetTriggerClusterId())
787 fhEtaPhiTriggerEMCALBCUMCluster[bc+5]->Fill(etacluster, phicluster);
788 fhTimeTriggerEMCALBCUMCluster->Fill(ecluster, tofcluster);
791 Float_t threshold = GetReader()->GetEventTriggerThreshold() ;
792 if(ecluster > threshold)
793 fhEtaPhiTriggerEMCALBCUMClusterOverTh->Fill(etacluster, phicluster);
794 else if(ecluster > threshold-1)
795 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->Fill(etacluster, phicluster);
797 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->Fill(etacluster, phicluster);
799 if(GetReader()->IsTriggerMatchedOpenCuts(0))
801 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->Fill(etacluster, phicluster);
802 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster ->Fill(ecluster, tofcluster);
804 if(GetReader()->IsTriggerMatchedOpenCuts(1))
806 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->Fill(etacluster, phicluster);
807 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster ->Fill(ecluster, tofcluster);
809 if(GetReader()->IsTriggerMatchedOpenCuts(2))
811 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->Fill(etacluster, phicluster);
812 fhTimeTriggerEMCALBCUMReMatchBothCluster ->Fill(ecluster, tofcluster);
818 }// neither bad nor exotic
819 else if(GetReader()->IsBadCellTriggerEvent() && GetReader()->IsExoticEvent())
821 if(GetReader()->IsTriggerMatched())
823 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBadExotic->Fill(etacluster, phicluster);
824 fhTimeTriggerEMCALBCBadExotic->Fill(ecluster, tofcluster);
825 if(badMax) fhTimeTriggerEMCALBCBadMaxCellExotic->Fill(ecluster, tofcluster);
829 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBadExotic->Fill(etacluster, phicluster);
830 fhTimeTriggerEMCALBCUMBadExotic->Fill(ecluster, tofcluster);
831 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCellExotic->Fill(ecluster, tofcluster);
834 }// Bad and exotic cluster trigger
835 else if(GetReader()->IsBadCellTriggerEvent() )
837 if(GetReader()->IsTriggerMatched())
839 if(ecluster > 2) fhEtaPhiTriggerEMCALBCBad->Fill(etacluster, phicluster);
840 fhTimeTriggerEMCALBCBad->Fill(ecluster, tofcluster);
841 if(badMax) fhTimeTriggerEMCALBCBadMaxCell->Fill(ecluster, tofcluster);
845 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMBad->Fill(etacluster, phicluster);
846 fhTimeTriggerEMCALBCUMBad->Fill(ecluster, tofcluster);
847 if(badMax) fhTimeTriggerEMCALBCUMBadMaxCell->Fill(ecluster, tofcluster);
849 }// Bad cluster trigger
850 else if(GetReader()->IsExoticEvent() )
852 if(GetReader()->IsTriggerMatched())
854 if(ecluster > 2) fhEtaPhiTriggerEMCALBCExotic->Fill(etacluster, phicluster);
855 fhTimeTriggerEMCALBCExotic->Fill(ecluster, tofcluster);
859 if(ecluster > 2) fhEtaPhiTriggerEMCALBCUMExotic->Fill(etacluster, phicluster);
860 fhTimeTriggerEMCALBCUMExotic->Fill(ecluster, tofcluster);
864 else if(TMath::Abs(bc) >= 6)
865 printf("AliAnaPhoton::ClusterSelected() - Trigger BC not expected = %d\n",bc);
869 //______________________________________________________________________________________________
870 void AliAnaPhoton::FillClusterPileUpHistograms(AliVCluster * calo, const Bool_t matched,
871 const Float_t ptcluster,
872 const Float_t etacluster, const Float_t phicluster,
873 const Float_t l0cluster)
875 // Fill some histograms related to pile up before any cluster cut is applied
877 if(!fFillPileUpHistograms) return ;
879 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
880 AliVCaloCells* cells = 0;
881 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
882 else cells = GetPHOSCells();
884 Float_t maxCellFraction = 0.;
885 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
887 Double_t tmax = cells->GetCellTime(absIdMax);
888 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
891 Bool_t okPhoton = kFALSE;
892 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
894 Float_t clusterLongTimePt = 0;
895 Float_t clusterOKTimePt = 0;
897 //Loop on cells inside cluster, max cell must be over 100 MeV and time in BC=0
898 if(cells->GetCellAmplitude(absIdMax) > 0.1 && TMath::Abs(tmax) < 30)
900 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
902 Int_t absId = calo->GetCellsAbsId()[ipos];
904 if( absId == absIdMax ) continue ;
906 Double_t time = cells->GetCellTime(absId);
907 Float_t amp = cells->GetCellAmplitude(absId);
908 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
909 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
912 Float_t diff = (tmax-time);
914 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimePt += amp;
915 else clusterLongTimePt += amp;
917 if( cells->GetCellAmplitude(absIdMax) < 0.1 ) continue ;
919 if(GetReader()->IsPileUpFromSPD())
921 fhClusterCellTimePileUp[0]->Fill(ptcluster, time);
922 fhClusterTimeDiffPileUp[0]->Fill(ptcluster, diff);
925 fhClusterTimeDiffChargedPileUp[0]->Fill(ptcluster, diff);
926 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ptcluster, diff);
930 if(GetReader()->IsPileUpFromEMCal())
932 fhClusterCellTimePileUp[1]->Fill(ptcluster, time);
933 fhClusterTimeDiffPileUp[1]->Fill(ptcluster, diff);
936 fhClusterTimeDiffChargedPileUp[1]->Fill(ptcluster, diff);
937 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ptcluster, diff);
941 if(GetReader()->IsPileUpFromSPDOrEMCal())
943 fhClusterCellTimePileUp[2]->Fill(ptcluster, time);
944 fhClusterTimeDiffPileUp[2]->Fill(ptcluster, diff);
947 fhClusterTimeDiffChargedPileUp[2]->Fill(ptcluster, diff);
948 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ptcluster, diff);
952 if(GetReader()->IsPileUpFromSPDAndEMCal())
954 fhClusterCellTimePileUp[3]->Fill(ptcluster, time);
955 fhClusterTimeDiffPileUp[3]->Fill(ptcluster, diff);
958 fhClusterTimeDiffChargedPileUp[3]->Fill(ptcluster, diff);
959 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ptcluster, diff);
963 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
965 fhClusterCellTimePileUp[4]->Fill(ptcluster, time);
966 fhClusterTimeDiffPileUp[4]->Fill(ptcluster, diff);
969 fhClusterTimeDiffChargedPileUp[4]->Fill(ptcluster, diff);
970 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ptcluster, diff);
974 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
976 fhClusterCellTimePileUp[5]->Fill(ptcluster, time);
977 fhClusterTimeDiffPileUp[5]->Fill(ptcluster, diff);
980 fhClusterTimeDiffChargedPileUp[5]->Fill(ptcluster, diff);
981 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ptcluster, diff);
985 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
987 fhClusterCellTimePileUp[6]->Fill(ptcluster, time);
988 fhClusterTimeDiffPileUp[6]->Fill(ptcluster, diff);
991 fhClusterTimeDiffChargedPileUp[6]->Fill(ptcluster, diff);
992 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ptcluster, diff);
999 if(clusterLongTimePt+clusterOKTimePt > 0.001)
1000 frac = clusterLongTimePt/(clusterLongTimePt+clusterOKTimePt);
1001 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimePt,clusterOKTimePt,frac,ptcluster);
1003 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ptcluster,frac);}
1004 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ptcluster,frac);}
1005 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ptcluster,frac);}
1006 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ptcluster,frac);}
1007 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ptcluster,frac);}
1008 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ptcluster,frac);}
1009 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ptcluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ptcluster,frac);}
1011 fhEtaPhiBC0->Fill(etacluster,phicluster);
1012 if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(etacluster,phicluster);
1015 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(etacluster,phicluster); }
1016 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(etacluster,phicluster); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(etacluster,phicluster); }
1019 //_______________________________________________
1020 void AliAnaPhoton::FillPileUpHistogramsPerEvent()
1022 // Fill some histograms per event to understand pile-up
1023 // Open the time cut in the reader to be more meaningful
1025 if(!fFillPileUpHistograms) return;
1027 AliVEvent * event = GetReader()->GetInputEvent();
1029 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1030 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1032 // N pile up vertices
1039 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1040 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
1044 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1045 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
1049 // Get the appropriate list of clusters
1050 TClonesArray * clusterList = 0;
1051 TString clusterListName = GetReader()->GetEMCALClusterListName();
1052 if (event->FindListObject(clusterListName))
1053 clusterList = dynamic_cast<TClonesArray*> (event->FindListObject(clusterListName));
1054 else if(GetReader()->GetOutputEvent())
1055 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
1057 // Loop on clusters, get the maximum energy cluster as reference
1058 Int_t nclusters = 0;
1059 if(clusterList) nclusters = clusterList->GetEntriesFast();
1060 else nclusters = event->GetNumberOfCaloClusters();
1065 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1067 AliVCluster * clus = 0;
1068 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
1069 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1073 if(!clus->IsEMCAL()) continue;
1075 Float_t tof = clus->GetTOF()*1e9;
1076 if(clus->E() > eMax && TMath::Abs(tof) < 30)
1083 clus->GetMomentum(mom,GetVertex(0));
1084 Float_t pt = mom.Pt();
1086 fhPtNPileUpSPDVtx->Fill(pt,nVtxSPD);
1087 fhPtNPileUpTrkVtx->Fill(pt,nVtxTrk);
1089 if(TMath::Abs(tof) < 30)
1091 fhPtNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1092 fhPtNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
1095 if(tof < 75 && tof > -30)
1097 fhPtNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1098 fhPtNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1101 fhTimePtNoCut->Fill(pt,tof);
1102 if(GetReader()->IsPileUpFromSPD()) fhTimePtSPD->Fill(pt,tof);
1106 if(eMax < 5) return;
1108 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
1114 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
1116 AliVCluster * clus = 0;
1117 if(clusterList) clus = (AliVCluster*) (clusterList->At(iclus));
1118 else clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1122 if(!clus->IsEMCAL()) continue;
1124 if(clus->E() < 0.3 || iclus==idMax) continue;
1126 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
1128 if(tdiff < 25) nOK++;
1132 if(tdiff > 40 ) n40++;
1136 // Check pile-up and fill histograms depending on the different cluster multiplicities
1137 if(GetReader()->IsPileUpFromSPD())
1139 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
1140 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
1141 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
1142 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
1146 fhClusterMultNoPileUp[0]->Fill(eMax,n );
1147 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
1148 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
1149 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
1155 //_________________________________________________________________________________________________
1156 void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time)
1158 // Fill some histograms to understand pile-up
1159 if(!fFillPileUpHistograms) return;
1161 //printf("E %f, time %f\n",energy,time);
1162 AliVEvent * event = GetReader()->GetInputEvent();
1164 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
1165 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
1166 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
1167 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
1168 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
1169 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
1170 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
1172 fhTimePtPhotonNoCut->Fill(pt,time);
1173 if(GetReader()->IsPileUpFromSPD()) fhTimePtPhotonSPD->Fill(pt,time);
1175 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
1177 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
1178 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
1180 // N pile up vertices
1186 nVtxSPD = esdEv->GetNumberOfPileupVerticesSPD();
1187 nVtxTrk = esdEv->GetNumberOfPileupVerticesTracks();
1192 nVtxSPD = aodEv->GetNumberOfPileupVerticesSPD();
1193 nVtxTrk = aodEv->GetNumberOfPileupVerticesTracks();
1196 fhTimeNPileUpVertSPD ->Fill(time,nVtxSPD);
1197 fhTimeNPileUpVertTrack->Fill(time,nVtxTrk);
1199 fhPtPhotonNPileUpSPDVtx->Fill(pt,nVtxSPD);
1200 fhPtPhotonNPileUpTrkVtx->Fill(pt,nVtxTrk);
1202 if(TMath::Abs(time) < 25)
1204 fhPtPhotonNPileUpSPDVtxTimeCut->Fill(pt,nVtxSPD);
1205 fhPtPhotonNPileUpTrkVtxTimeCut->Fill(pt,nVtxTrk);
1208 if(time < 75 && time > -25)
1210 fhPtPhotonNPileUpSPDVtxTimeCut2->Fill(pt,nVtxSPD);
1211 fhPtPhotonNPileUpTrkVtxTimeCut2->Fill(pt,nVtxTrk);
1214 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
1215 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVtxSPD,nVtxTrk);
1218 Float_t z1 = -1, z2 = -1;
1220 for(Int_t iVert=0; iVert<nVtxSPD;iVert++)
1224 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
1225 ncont=pv->GetNContributors();
1226 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
1228 diamZ = esdEv->GetDiamondZ();
1232 AliAODVertex *pv=aodEv->GetVertex(iVert);
1233 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
1234 ncont=pv->GetNContributors();
1235 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
1237 diamZ = aodEv->GetDiamondZ();
1240 Double_t distZ = TMath::Abs(z2-z1);
1241 diamZ = TMath::Abs(z2-diamZ);
1243 fhTimeNPileUpVertContributors ->Fill(time,ncont);
1244 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
1245 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
1250 //____________________________________________________________________________________
1251 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
1253 //Fill cluster Shower Shape histograms
1255 if(!fFillSSHistograms || GetMixedEvent()) return;
1257 Float_t energy = cluster->E();
1258 Int_t ncells = cluster->GetNCells();
1259 Float_t lambda0 = cluster->GetM02();
1260 Float_t lambda1 = cluster->GetM20();
1261 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
1264 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
1266 cluster->GetMomentum(mom,GetVertex(0)) ;
1267 }//Assume that come from vertex in straight line
1270 Double_t vertex[]={0,0,0};
1271 cluster->GetMomentum(mom,vertex) ;
1274 Float_t eta = mom.Eta();
1275 Float_t phi = mom.Phi();
1276 if(phi < 0) phi+=TMath::TwoPi();
1278 fhLam0E ->Fill(energy,lambda0);
1279 fhLam1E ->Fill(energy,lambda1);
1280 fhDispE ->Fill(energy,disp);
1282 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1284 fhLam0ETRD->Fill(energy,lambda0);
1285 fhLam1ETRD->Fill(energy,lambda1);
1286 fhDispETRD->Fill(energy,disp);
1289 Float_t l0 = 0., l1 = 0.;
1290 Float_t dispp= 0., dEta = 0., dPhi = 0.;
1291 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
1292 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
1294 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
1295 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
1296 //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",
1297 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
1298 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
1299 // disp, dPhi+dEta );
1300 fhDispEtaE -> Fill(energy,dEta);
1301 fhDispPhiE -> Fill(energy,dPhi);
1302 fhSumEtaE -> Fill(energy,sEta);
1303 fhSumPhiE -> Fill(energy,sPhi);
1304 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
1305 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
1306 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1307 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
1308 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
1311 if (energy < 2 ) ebin = 0;
1312 else if (energy < 4 ) ebin = 1;
1313 else if (energy < 6 ) ebin = 2;
1314 else if (energy < 10) ebin = 3;
1315 else if (energy < 15) ebin = 4;
1316 else if (energy < 20) ebin = 5;
1319 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
1320 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
1321 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
1325 // if track-matching was of, check effect of track-matching residual cut
1327 if(!fRejectTrackMatch)
1329 Float_t dZ = cluster->GetTrackDz();
1330 Float_t dR = cluster->GetTrackDx();
1331 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1333 dR = 2000., dZ = 2000.;
1334 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1337 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1339 fhLam0ETM ->Fill(energy,lambda0);
1340 fhLam1ETM ->Fill(energy,lambda1);
1341 fhDispETM ->Fill(energy,disp);
1343 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1345 fhLam0ETMTRD->Fill(energy,lambda0);
1346 fhLam1ETMTRD->Fill(energy,lambda1);
1347 fhDispETMTRD->Fill(energy,disp);
1350 }// if track-matching was of, check effect of matching residual cut
1353 if(!fFillOnlySimpleSSHisto){
1356 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1357 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1358 fhNCellsDispLowE ->Fill(ncells,disp);
1360 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1361 fhLam0DispLowE ->Fill(lambda0,disp);
1362 fhDispLam1LowE ->Fill(disp,lambda1);
1363 fhEtaLam0LowE ->Fill(eta,lambda0);
1364 fhPhiLam0LowE ->Fill(phi,lambda0);
1368 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1369 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1370 fhNCellsDispHighE ->Fill(ncells,disp);
1372 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1373 fhLam0DispHighE ->Fill(lambda0,disp);
1374 fhDispLam1HighE ->Fill(disp,lambda1);
1375 fhEtaLam0HighE ->Fill(eta, lambda0);
1376 fhPhiLam0HighE ->Fill(phi, lambda0);
1381 AliVCaloCells* cells = 0;
1382 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1383 else cells = GetPHOSCells();
1385 //Fill histograms to check shape of embedded clusters
1386 Float_t fraction = 0;
1387 // printf("check embedding %i\n",GetReader()->IsEmbeddedClusterSelectionOn());
1389 if(GetReader()->IsEmbeddedClusterSelectionOn())
1390 {//Only working for EMCAL
1391 // printf("embedded\n");
1392 Float_t clusterE = 0; // recalculate in case corrections applied.
1394 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1396 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
1398 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1401 //Fraction of total energy due to the embedded signal
1405 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
1407 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1409 } // embedded fraction
1411 // Get the fraction of the cluster energy that carries the cell with highest energy
1413 Float_t maxCellFraction = 0.;
1415 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1417 // Check the origin and fill histograms
1421 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1422 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1423 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1424 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1426 mcIndex = kmcssPhoton ;
1428 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1430 //Check particle overlaps in cluster
1432 // Compare the primary depositing more energy with the rest,
1433 // if no photon/electron as comon ancestor (conversions), count as other particle
1434 Int_t ancPDG = 0, ancStatus = -1;
1435 TLorentzVector momentum; TVector3 prodVertex;
1437 Int_t noverlaps = 1;
1438 for (UInt_t ilab = 1; ilab < cluster->GetNLabels(); ilab++ )
1440 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab],
1441 GetReader(),ancPDG,ancStatus,momentum,prodVertex);
1442 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
1444 //printf("N overlaps %d \n",noverlaps);
1448 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
1450 else if(noverlaps == 2)
1452 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
1454 else if(noverlaps > 2)
1456 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
1460 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
1464 //Fill histograms to check shape of embedded clusters
1465 if(GetReader()->IsEmbeddedClusterSelectionOn())
1469 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
1471 else if(fraction > 0.5)
1473 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
1475 else if(fraction > 0.1)
1477 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
1481 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
1485 }//photon no conversion
1486 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1488 mcIndex = kmcssElectron ;
1490 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1491 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1493 mcIndex = kmcssConversion ;
1494 }//conversion photon
1495 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1497 mcIndex = kmcssPi0 ;
1499 //Fill histograms to check shape of embedded clusters
1500 if(GetReader()->IsEmbeddedClusterSelectionOn())
1504 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
1506 else if(fraction > 0.5)
1508 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
1510 else if(fraction > 0.1)
1512 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
1516 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
1521 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1523 mcIndex = kmcssEta ;
1527 mcIndex = kmcssOther ;
1530 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1531 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1532 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1533 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1534 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1536 if(!fFillOnlySimpleSSHisto)
1540 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1541 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1543 else if(energy < 6.)
1545 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1546 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1550 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1551 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1554 if(fCalorimeter == "EMCAL")
1556 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1557 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1558 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1559 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
1560 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1563 if (energy < 2 ) ebin = 0;
1564 else if (energy < 4 ) ebin = 1;
1565 else if (energy < 6 ) ebin = 2;
1566 else if (energy < 10) ebin = 3;
1567 else if (energy < 15) ebin = 4;
1568 else if (energy < 20) ebin = 5;
1571 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1572 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
1573 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
1580 //__________________________________________________________________________
1581 void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
1584 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1585 // Residual filled for different cuts 0 (No cut), after 1 PID cut
1587 Float_t dZ = cluster->GetTrackDz();
1588 Float_t dR = cluster->GetTrackDx();
1590 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1592 dR = 2000., dZ = 2000.;
1593 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1596 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1598 Bool_t positive = kFALSE;
1599 if(track) positive = (track->Charge()>0);
1601 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1603 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1604 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
1605 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
1611 fhTrackMatchedDEtaPos[cut]->Fill(cluster->E(),dZ);
1612 fhTrackMatchedDPhiPos[cut]->Fill(cluster->E(),dR);
1613 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiPos[cut]->Fill(dZ,dR);
1617 fhTrackMatchedDEtaNeg[cut]->Fill(cluster->E(),dZ);
1618 fhTrackMatchedDPhiNeg[cut]->Fill(cluster->E(),dR);
1619 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhiNeg[cut]->Fill(dZ,dR);
1623 Int_t nSMod = GetModuleNumber(cluster);
1625 if(fCalorimeter=="EMCAL" && nSMod > 5)
1627 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1628 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1631 // Check dEdx and E/p of matched clusters
1633 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1637 Float_t dEdx = track->GetTPCsignal();
1638 Float_t eOverp = cluster->E()/track->P();
1640 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1641 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1643 if(fCalorimeter=="EMCAL" && nSMod > 5)
1644 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1649 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
1656 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader());
1658 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1660 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1661 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
1662 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1663 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1664 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1666 // Check if several particles contributed to cluster and discard overlapped mesons
1667 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1668 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1670 if(cluster->GetNLabels()==1)
1672 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1673 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1677 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1678 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1686 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1687 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
1688 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1689 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1690 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1692 // Check if several particles contributed to cluster
1693 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1694 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1696 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1697 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1705 } // residuals window
1711 //___________________________________________
1712 TObjString * AliAnaPhoton::GetAnalysisCuts()
1714 //Save parameters used for analysis
1715 TString parList ; //this will be list of parameters used for this analysis.
1716 const Int_t buffersize = 255;
1717 char onePar[buffersize] ;
1719 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
1721 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1723 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
1725 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
1727 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
1729 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
1732 //Get parameters set in base class.
1733 parList += GetBaseParametersList() ;
1735 //Get parameters set in PID class.
1736 parList += GetCaloPID()->GetPIDParametersList() ;
1738 //Get parameters set in FiducialCut class (not available yet)
1739 //parlist += GetFidCut()->GetFidCutParametersList()
1741 return new TObjString(parList) ;
1744 //________________________________________________________________________
1745 TList * AliAnaPhoton::GetCreateOutputObjects()
1747 // Create histograms to be saved in output file and
1748 // store them in outputContainer
1749 TList * outputContainer = new TList() ;
1750 outputContainer->SetName("PhotonHistos") ;
1752 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1753 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1754 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1755 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1756 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1757 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1759 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1760 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1761 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1762 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1763 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1764 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1766 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1767 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1768 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1769 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1770 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1771 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1773 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1775 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
1776 for (Int_t i = 0; i < 10 ; i++)
1778 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1779 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1780 nptbins,ptmin,ptmax);
1781 fhClusterCuts[i]->SetYTitle("dN/dE ");
1782 fhClusterCuts[i]->SetXTitle("E (GeV)");
1783 outputContainer->Add(fhClusterCuts[i]) ;
1786 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1787 fhNCellsE->SetXTitle("E (GeV)");
1788 fhNCellsE->SetYTitle("# of cells in cluster");
1789 outputContainer->Add(fhNCellsE);
1791 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1792 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1793 fhCellsE->SetYTitle("E_{cell} (GeV)");
1794 outputContainer->Add(fhCellsE);
1796 fhTimePt = new TH2F ("hTimePt","time of cluster vs pT of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1797 fhTimePt->SetXTitle("p_{T} (GeV/c)");
1798 fhTimePt->SetYTitle("time (ns)");
1799 outputContainer->Add(fhTimePt);
1801 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1802 nptbins,ptmin,ptmax, 500,0,1.);
1803 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1804 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1805 outputContainer->Add(fhMaxCellDiffClusterE);
1807 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1808 fhEPhoton->SetYTitle("N");
1809 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1810 outputContainer->Add(fhEPhoton) ;
1812 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
1813 fhPtPhoton->SetYTitle("N");
1814 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1815 outputContainer->Add(fhPtPhoton) ;
1817 fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
1818 fhPtCentralityPhoton->SetYTitle("Centrality");
1819 fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
1820 outputContainer->Add(fhPtCentralityPhoton) ;
1822 fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1823 fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1824 fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
1825 outputContainer->Add(fhPtEventPlanePhoton) ;
1828 ("hEtaPhi","cluster,E > 0.5 GeV, #eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1829 fhEtaPhi->SetYTitle("#phi (rad)");
1830 fhEtaPhi->SetXTitle("#eta");
1831 outputContainer->Add(fhEtaPhi) ;
1833 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
1835 fhEtaPhiEMCALBC0 = new TH2F
1836 ("hEtaPhiEMCALBC0","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
1837 fhEtaPhiEMCALBC0->SetYTitle("#phi (rad)");
1838 fhEtaPhiEMCALBC0->SetXTitle("#eta");
1839 outputContainer->Add(fhEtaPhiEMCALBC0) ;
1841 fhEtaPhiEMCALBC1 = new TH2F
1842 ("hEtaPhiEMCALBC1","cluster,E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
1843 fhEtaPhiEMCALBC1->SetYTitle("#phi (rad)");
1844 fhEtaPhiEMCALBC1->SetXTitle("#eta");
1845 outputContainer->Add(fhEtaPhiEMCALBC1) ;
1847 fhEtaPhiEMCALBCN = new TH2F
1848 ("hEtaPhiEMCALBCN","cluster,E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
1849 fhEtaPhiEMCALBCN->SetYTitle("#phi (rad)");
1850 fhEtaPhiEMCALBCN->SetXTitle("#eta");
1851 outputContainer->Add(fhEtaPhiEMCALBCN) ;
1853 for(Int_t i = 0; i < 11; i++)
1855 fhEtaPhiTriggerEMCALBC[i] = new TH2F
1856 (Form("hEtaPhiTriggerEMCALBC%d",i-5),
1857 Form("cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
1858 netabins,etamin,etamax,nphibins,phimin,phimax);
1859 fhEtaPhiTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
1860 fhEtaPhiTriggerEMCALBC[i]->SetXTitle("#eta");
1861 outputContainer->Add(fhEtaPhiTriggerEMCALBC[i]) ;
1863 fhTimeTriggerEMCALBC[i] = new TH2F
1864 (Form("hTimeTriggerEMCALBC%d",i-5),
1865 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-5),
1866 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1867 fhTimeTriggerEMCALBC[i]->SetXTitle("E (GeV)");
1868 fhTimeTriggerEMCALBC[i]->SetYTitle("time (ns)");
1869 outputContainer->Add(fhTimeTriggerEMCALBC[i]);
1871 fhTimeTriggerEMCALBCPileUpSPD[i] = new TH2F
1872 (Form("hTimeTriggerEMCALBC%dPileUpSPD",i-5),
1873 Form("cluster time vs E of clusters, Trigger EMCAL-BC=%d",i-5),
1874 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1875 fhTimeTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
1876 fhTimeTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
1877 outputContainer->Add(fhTimeTriggerEMCALBCPileUpSPD[i]);
1879 fhEtaPhiTriggerEMCALBCUM[i] = new TH2F
1880 (Form("hEtaPhiTriggerEMCALBC%d_UnMatch",i-5),
1881 Form("cluster E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
1882 netabins,etamin,etamax,nphibins,phimin,phimax);
1883 fhEtaPhiTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
1884 fhEtaPhiTriggerEMCALBCUM[i]->SetXTitle("#eta");
1885 outputContainer->Add(fhEtaPhiTriggerEMCALBCUM[i]) ;
1887 fhTimeTriggerEMCALBCUM[i] = new TH2F
1888 (Form("hTimeTriggerEMCALBC%d_UnMatch",i-5),
1889 Form("cluster time vs E of clusters, unmatched trigger EMCAL-BC=%d",i-5),
1890 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1891 fhTimeTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
1892 fhTimeTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
1893 outputContainer->Add(fhTimeTriggerEMCALBCUM[i]);
1895 fhEtaPhiTriggerEMCALBCCluster[i] = new TH2F
1896 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger",i-5),
1897 Form("trigger cluster, #eta vs #phi, Trigger EMCAL-BC=%d",i-5),
1898 netabins,etamin,etamax,nphibins,phimin,phimax);
1899 fhEtaPhiTriggerEMCALBCCluster[i]->SetYTitle("#phi (rad)");
1900 fhEtaPhiTriggerEMCALBCCluster[i]->SetXTitle("#eta");
1901 outputContainer->Add(fhEtaPhiTriggerEMCALBCCluster[i]) ;
1903 fhEtaPhiTriggerEMCALBCUMCluster[i] = new TH2F
1904 (Form("hEtaPhiTriggerEMCALBC%d_OnlyTrigger_UnMatch",i-5),
1905 Form("trigger cluster, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
1906 netabins,etamin,etamax,nphibins,phimin,phimax);
1907 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetYTitle("#phi (rad)");
1908 fhEtaPhiTriggerEMCALBCUMCluster[i]->SetXTitle("#eta");
1909 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMCluster[i]) ;
1912 fhTimeTriggerEMCALBCCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger",
1913 "trigger cluster time vs E of clusters",
1914 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1915 fhTimeTriggerEMCALBCCluster->SetXTitle("E (GeV)");
1916 fhTimeTriggerEMCALBCCluster->SetYTitle("time (ns)");
1917 outputContainer->Add(fhTimeTriggerEMCALBCCluster);
1919 fhTimeTriggerEMCALBCUMCluster = new TH2F("hTimeTriggerEMCALBC_OnlyTrigger_UnMatch",
1920 "trigger cluster time vs E of clusters, unmatched trigger",
1921 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1922 fhTimeTriggerEMCALBCUMCluster->SetXTitle("E (GeV)");
1923 fhTimeTriggerEMCALBCUMCluster->SetYTitle("time (ns)");
1924 outputContainer->Add(fhTimeTriggerEMCALBCUMCluster);
1926 fhEtaPhiTriggerEMCALBCClusterOverTh = new TH2F
1927 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold",
1928 "trigger cluster E > trigger threshold, #eta vs #phi, Trigger EMCAL-BC=0",
1929 netabins,etamin,etamax,nphibins,phimin,phimax);
1930 fhEtaPhiTriggerEMCALBCClusterOverTh->SetYTitle("#phi (rad)");
1931 fhEtaPhiTriggerEMCALBCClusterOverTh->SetXTitle("#eta");
1932 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterOverTh) ;
1934 fhEtaPhiTriggerEMCALBCUMClusterOverTh = new TH2F
1935 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_OverThreshold_UnMatch",
1936 "trigger cluster E > trigger threshold, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1937 netabins,etamin,etamax,nphibins,phimin,phimax);
1938 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetYTitle("#phi (rad)");
1939 fhEtaPhiTriggerEMCALBCUMClusterOverTh->SetXTitle("#eta");
1940 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterOverTh) ;
1942 fhEtaPhiTriggerEMCALBCClusterBelowTh1 = new TH2F
1943 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1",
1944 "trigger cluster thresh-1 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1945 netabins,etamin,etamax,nphibins,phimin,phimax);
1946 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetYTitle("#phi (rad)");
1947 fhEtaPhiTriggerEMCALBCClusterBelowTh1->SetXTitle("#eta");
1948 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh1) ;
1950 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1 = new TH2F
1951 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold1_UnMatch",
1952 "trigger cluster thresh-1 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1953 netabins,etamin,etamax,nphibins,phimin,phimax);
1954 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetYTitle("#phi (rad)");
1955 fhEtaPhiTriggerEMCALBCUMClusterBelowTh1->SetXTitle("#eta");
1956 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh1) ;
1958 fhEtaPhiTriggerEMCALBCClusterBelowTh2 = new TH2F
1959 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2",
1960 "trigger cluster thresh-2 < E < thres, #eta vs #phi, Trigger EMCAL-BC=0",
1961 netabins,etamin,etamax,nphibins,phimin,phimax);
1962 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetYTitle("#phi (rad)");
1963 fhEtaPhiTriggerEMCALBCClusterBelowTh2->SetXTitle("#eta");
1964 outputContainer->Add(fhEtaPhiTriggerEMCALBCClusterBelowTh2) ;
1966 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2 = new TH2F
1967 ("hEtaPhiTriggerEMCALBC0_OnlyTrigger_BelowThreshold2_UnMatch",
1968 "trigger cluster thresh-2 < E < thres, #eta vs #phi, unmatched trigger EMCAL-BC=0",
1969 netabins,etamin,etamax,nphibins,phimin,phimax);
1970 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetYTitle("#phi (rad)");
1971 fhEtaPhiTriggerEMCALBCUMClusterBelowTh2->SetXTitle("#eta");
1972 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMClusterBelowTh2) ;
1974 fhEtaPhiTriggerEMCALBCExotic = new TH2F
1975 ("hEtaPhiTriggerExotic",
1976 "cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
1977 netabins,etamin,etamax,nphibins,phimin,phimax);
1978 fhEtaPhiTriggerEMCALBCExotic->SetYTitle("#phi (rad)");
1979 fhEtaPhiTriggerEMCALBCExotic->SetXTitle("#eta");
1980 outputContainer->Add(fhEtaPhiTriggerEMCALBCExotic) ;
1982 fhTimeTriggerEMCALBCExotic = new TH2F
1983 ("hTimeTriggerExotic",
1984 "cluster time vs E of clusters, Trigger Exotic ",
1985 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1986 fhTimeTriggerEMCALBCExotic->SetXTitle("E (GeV)");
1987 fhTimeTriggerEMCALBCExotic->SetYTitle("time (ns)");
1988 outputContainer->Add(fhTimeTriggerEMCALBCExotic);
1990 fhEtaPhiTriggerEMCALBCUMExotic = new TH2F
1991 ("hEtaPhiTriggerExotic_UnMatch",
1992 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
1993 netabins,etamin,etamax,nphibins,phimin,phimax);
1994 fhEtaPhiTriggerEMCALBCUMExotic->SetYTitle("#phi (rad)");
1995 fhEtaPhiTriggerEMCALBCUMExotic->SetXTitle("#eta");
1996 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExotic) ;
1998 fhTimeTriggerEMCALBCUMExotic = new TH2F
1999 ("hTimeTriggerExotic_UnMatch",
2000 "cluster time vs E of clusters, unmatched trigger Exotic",
2001 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2002 fhTimeTriggerEMCALBCUMExotic->SetXTitle("E (GeV)");
2003 fhTimeTriggerEMCALBCUMExotic->SetYTitle("time (ns)");
2004 outputContainer->Add(fhTimeTriggerEMCALBCUMExotic);
2006 fhEtaPhiTriggerEMCALBCExoticCluster = new TH2F
2007 ("hEtaPhiTriggerExotic_OnlyTrigger",
2008 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Exotic",
2009 netabins,etamin,etamax,nphibins,phimin,phimax);
2010 fhEtaPhiTriggerEMCALBCExoticCluster->SetYTitle("#phi (rad)");
2011 fhEtaPhiTriggerEMCALBCExoticCluster->SetXTitle("#eta");
2012 outputContainer->Add(fhEtaPhiTriggerEMCALBCExoticCluster) ;
2014 fhTimeTriggerEMCALBCExoticCluster = new TH2F
2015 ("hTimeTriggerExotic_OnlyTrigger",
2016 "trigger cluster time vs E of clusters, Trigger Exotic",
2017 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2018 fhTimeTriggerEMCALBCExoticCluster->SetXTitle("E (GeV)");
2019 fhTimeTriggerEMCALBCExoticCluster->SetYTitle("time (ns)");
2020 outputContainer->Add(fhTimeTriggerEMCALBCExoticCluster);
2022 fhEtaPhiTriggerEMCALBCUMExoticCluster = new TH2F
2023 ("hEtaPhiTriggerExotic_OnlyTrigger_UnMatch",
2024 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Exotic",
2025 netabins,etamin,etamax,nphibins,phimin,phimax);
2026 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetYTitle("#phi (rad)");
2027 fhEtaPhiTriggerEMCALBCUMExoticCluster->SetXTitle("#eta");
2028 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMExoticCluster) ;
2030 fhTimeTriggerEMCALBCUMExoticCluster = new TH2F
2031 ("hTimeTriggerExotic_OnlyTrigger_UnMatch",
2032 "trigger cluster time vs E of clusters, unmatched trigger Exotic",
2033 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2034 fhTimeTriggerEMCALBCUMExoticCluster->SetXTitle("E (GeV)");
2035 fhTimeTriggerEMCALBCUMExoticCluster->SetYTitle("time (ns)");
2036 outputContainer->Add(fhTimeTriggerEMCALBCUMExoticCluster);
2038 fhEtaPhiTriggerEMCALBCBad = new TH2F
2039 ("hEtaPhiTriggerBad",
2040 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2041 netabins,etamin,etamax,nphibins,phimin,phimax);
2042 fhEtaPhiTriggerEMCALBCBad->SetYTitle("#phi (rad)");
2043 fhEtaPhiTriggerEMCALBCBad->SetXTitle("#eta");
2044 outputContainer->Add(fhEtaPhiTriggerEMCALBCBad) ;
2046 fhTimeTriggerEMCALBCBad = new TH2F
2048 "cluster time vs E of clusters, Trigger Bad ",
2049 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2050 fhTimeTriggerEMCALBCBad->SetXTitle("E (GeV)");
2051 fhTimeTriggerEMCALBCBad->SetYTitle("time (ns)");
2052 outputContainer->Add(fhTimeTriggerEMCALBCBad);
2054 fhEtaPhiTriggerEMCALBCUMBad = new TH2F
2055 ("hEtaPhiTriggerBad_UnMatch",
2056 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2057 netabins,etamin,etamax,nphibins,phimin,phimax);
2058 fhEtaPhiTriggerEMCALBCUMBad->SetYTitle("#phi (rad)");
2059 fhEtaPhiTriggerEMCALBCUMBad->SetXTitle("#eta");
2060 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBad) ;
2062 fhTimeTriggerEMCALBCUMBad = new TH2F
2063 ("hTimeTriggerBad_UnMatch",
2064 "cluster time vs E of clusters, unmatched trigger Bad",
2065 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2066 fhTimeTriggerEMCALBCUMBad->SetXTitle("E (GeV)");
2067 fhTimeTriggerEMCALBCUMBad->SetYTitle("time (ns)");
2068 outputContainer->Add(fhTimeTriggerEMCALBCUMBad);
2070 fhEtaPhiTriggerEMCALBCBadCluster = new TH2F
2071 ("hEtaPhiTriggerBad_OnlyTrigger",
2072 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad",
2073 netabins,etamin,etamax,nphibins,phimin,phimax);
2074 fhEtaPhiTriggerEMCALBCBadCluster->SetYTitle("#phi (rad)");
2075 fhEtaPhiTriggerEMCALBCBadCluster->SetXTitle("#eta");
2076 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadCluster) ;
2078 fhTimeTriggerEMCALBCBadCluster = new TH2F
2079 ("hTimeTriggerBad_OnlyTrigger",
2080 "trigger cluster time vs E of clusters, Trigger Bad",
2081 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2082 fhTimeTriggerEMCALBCBadCluster->SetXTitle("E (GeV)");
2083 fhTimeTriggerEMCALBCBadCluster->SetYTitle("time (ns)");
2084 outputContainer->Add(fhTimeTriggerEMCALBCBadCluster);
2086 fhEtaPhiTriggerEMCALBCUMBadCluster = new TH2F
2087 ("hEtaPhiTriggerBad_OnlyTrigger_UnMatch",
2088 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad",
2089 netabins,etamin,etamax,nphibins,phimin,phimax);
2090 fhEtaPhiTriggerEMCALBCUMBadCluster->SetYTitle("#phi (rad)");
2091 fhEtaPhiTriggerEMCALBCUMBadCluster->SetXTitle("#eta");
2092 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadCluster) ;
2094 fhTimeTriggerEMCALBCUMBadCluster = new TH2F
2095 ("hTimeTriggerBad_OnlyTrigger_UnMatch",
2096 "trigger cluster time vs E of clusters, unmatched trigger Bad",
2097 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2098 fhTimeTriggerEMCALBCUMBadCluster->SetXTitle("E (GeV)");
2099 fhTimeTriggerEMCALBCUMBadCluster->SetYTitle("time (ns)");
2100 outputContainer->Add(fhTimeTriggerEMCALBCUMBadCluster);
2102 fhEtaPhiTriggerEMCALBCBadExotic = new TH2F
2103 ("hEtaPhiTriggerBadExotic",
2104 "cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2105 netabins,etamin,etamax,nphibins,phimin,phimax);
2106 fhEtaPhiTriggerEMCALBCBadExotic->SetYTitle("#phi (rad)");
2107 fhEtaPhiTriggerEMCALBCBadExotic->SetXTitle("#eta");
2108 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExotic) ;
2110 fhTimeTriggerEMCALBCBadExotic = new TH2F
2111 ("hTimeTriggerBadExotic",
2112 "cluster time vs E of clusters, Trigger Bad&Exotic ",
2113 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2114 fhTimeTriggerEMCALBCBadExotic->SetXTitle("E (GeV)");
2115 fhTimeTriggerEMCALBCBadExotic->SetYTitle("time (ns)");
2116 outputContainer->Add(fhTimeTriggerEMCALBCBadExotic);
2118 fhEtaPhiTriggerEMCALBCUMBadExotic = new TH2F
2119 ("hEtaPhiTriggerBadExotic_UnMatch",
2120 "cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2121 netabins,etamin,etamax,nphibins,phimin,phimax);
2122 fhEtaPhiTriggerEMCALBCUMBadExotic->SetYTitle("#phi (rad)");
2123 fhEtaPhiTriggerEMCALBCUMBadExotic->SetXTitle("#eta");
2124 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExotic) ;
2126 fhTimeTriggerEMCALBCUMBadExotic = new TH2F
2127 ("hTimeTriggerBadExotic_UnMatch",
2128 "cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2129 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2130 fhTimeTriggerEMCALBCUMBadExotic->SetXTitle("E (GeV)");
2131 fhTimeTriggerEMCALBCUMBadExotic->SetYTitle("time (ns)");
2132 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExotic);
2134 fhEtaPhiTriggerEMCALBCBadExoticCluster = new TH2F
2135 ("hEtaPhiTriggerBadExotic_OnlyTrigger",
2136 "trigger cluster E > 2 GeV, #eta vs #phi, Trigger Bad&Exotic",
2137 netabins,etamin,etamax,nphibins,phimin,phimax);
2138 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetYTitle("#phi (rad)");
2139 fhEtaPhiTriggerEMCALBCBadExoticCluster->SetXTitle("#eta");
2140 outputContainer->Add(fhEtaPhiTriggerEMCALBCBadExoticCluster) ;
2142 fhTimeTriggerEMCALBCBadExoticCluster = new TH2F
2143 ("hTimeTriggerBadExotic_OnlyTrigger",
2144 "trigger cluster time vs E of clusters, Trigger Bad&Exotic",
2145 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2146 fhTimeTriggerEMCALBCBadExoticCluster->SetXTitle("E (GeV)");
2147 fhTimeTriggerEMCALBCBadExoticCluster->SetYTitle("time (ns)");
2148 outputContainer->Add(fhTimeTriggerEMCALBCBadExoticCluster);
2150 fhEtaPhiTriggerEMCALBCUMBadExoticCluster = new TH2F
2151 ("hEtaPhiTriggerBadExotic_OnlyTrigger_UnMatch",
2152 "trigger cluster E > 2 GeV, #eta vs #phi, unmatched trigger Bad&Exotic",
2153 netabins,etamin,etamax,nphibins,phimin,phimax);
2154 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetYTitle("#phi (rad)");
2155 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->SetXTitle("#eta");
2156 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMBadExoticCluster) ;
2158 fhTimeTriggerEMCALBCUMBadExoticCluster = new TH2F
2159 ("hTimeTriggerBadExotic_OnlyTrigger_UnMatch",
2160 "trigger cluster time vs E of clusters, unmatched trigger Bad&Exotic",
2161 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2162 fhTimeTriggerEMCALBCUMBadExoticCluster->SetXTitle("E (GeV)");
2163 fhTimeTriggerEMCALBCUMBadExoticCluster->SetYTitle("time (ns)");
2164 outputContainer->Add(fhTimeTriggerEMCALBCUMBadExoticCluster);
2166 fhTimeTriggerEMCALBCBadMaxCell = new TH2F
2167 ("hTimeTriggerBadMaxCell",
2168 "cluster time vs E of clusters, Trigger BadMaxCell",
2169 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2170 fhTimeTriggerEMCALBCBadMaxCell->SetXTitle("E (GeV)");
2171 fhTimeTriggerEMCALBCBadMaxCell->SetYTitle("time (ns)");
2172 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCell);
2174 fhTimeTriggerEMCALBCUMBadMaxCell = new TH2F
2175 ("hTimeTriggerBadMaxCell_UnMatch",
2176 "cluster time vs E of clusters, unmatched trigger BadMaxCell",
2177 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2178 fhTimeTriggerEMCALBCUMBadMaxCell->SetXTitle("E (GeV)");
2179 fhTimeTriggerEMCALBCUMBadMaxCell->SetYTitle("time (ns)");
2180 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCell);
2183 fhTimeTriggerEMCALBCBadMaxCellExotic = new TH2F
2184 ("hTimeTriggerBadMaxCellExotic",
2185 "cluster time vs E of clusters, Trigger BadMaxCell&Exotic",
2186 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2187 fhTimeTriggerEMCALBCBadMaxCellExotic->SetXTitle("E (GeV)");
2188 fhTimeTriggerEMCALBCBadMaxCellExotic->SetYTitle("time (ns)");
2189 outputContainer->Add(fhTimeTriggerEMCALBCBadMaxCellExotic);
2191 fhTimeTriggerEMCALBCUMBadMaxCellExotic = new TH2F
2192 ("hTimeTriggerBadMaxCellExotic_UnMatch",
2193 "cluster time vs E of clusters, unmatched trigger BadMaxCell&Exotic",
2194 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2195 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetXTitle("E (GeV)");
2196 fhTimeTriggerEMCALBCUMBadMaxCellExotic->SetYTitle("time (ns)");
2197 outputContainer->Add(fhTimeTriggerEMCALBCUMBadMaxCellExotic);
2199 fhTimeNoTrigger = new TH2F
2201 "events with no foundable trigger, time vs e of clusters",
2202 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2203 fhTimeNoTrigger->SetXTitle("E (GeV)");
2204 fhTimeNoTrigger->SetYTitle("time (ns)");
2205 outputContainer->Add(fhTimeNoTrigger);
2207 fhEtaPhiNoTrigger = new TH2F
2208 ("hEtaPhiNoTrigger",
2209 "events with no foundable trigger, eta vs phi of clusters",
2210 netabins,etamin,etamax,nphibins,phimin,phimax);
2211 fhEtaPhiNoTrigger->SetYTitle("#phi (rad)");
2212 fhEtaPhiNoTrigger->SetXTitle("#eta");
2213 outputContainer->Add(fhEtaPhiNoTrigger) ;
2216 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_OpenTime",
2217 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time",
2218 netabins,etamin,etamax,nphibins,phimin,phimax);
2219 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("#phi (rad)");
2220 fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("#eta");
2221 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchOpenTimeCluster) ;
2223 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_OpenTime",
2224 "cluster time vs E of clusters, no match, rematch open time",
2225 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2226 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetXTitle("E (GeV)");
2227 fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster->SetYTitle("time (ns)");
2228 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchOpenTimeCluster);
2231 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
2232 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch with neighbour patches",
2233 netabins,etamin,etamax,nphibins,phimin,phimax);
2234 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("#phi (rad)");
2235 fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("#eta");
2236 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchCheckNeighCluster) ;
2238 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_CheckNeighbours",
2239 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2240 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2241 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetXTitle("E (GeV)");
2242 fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster->SetYTitle("time (ns)");
2243 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchCheckNeighCluster);
2245 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster = new TH2F("hEtaPhiTriggerEMCALBC0_OnlyTrigger_UnMatch_ReMatch_Both",
2246 "cluster E > 2 GeV, #eta vs #phi, Trigger EMCAL-BC=0, un match, rematch open time and neighbour",
2247 netabins,etamin,etamax,nphibins,phimin,phimax);
2248 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetYTitle("#phi (rad)");
2249 fhEtaPhiTriggerEMCALBCUMReMatchBothCluster->SetXTitle("#eta");
2250 outputContainer->Add(fhEtaPhiTriggerEMCALBCUMReMatchBothCluster) ;
2252 fhTimeTriggerEMCALBCUMReMatchBothCluster = new TH2F("hTimeTrigger_OnlyTrigger_UnMatch_ReMatch_Both",
2253 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2254 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2255 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetXTitle("E (GeV)");
2256 fhTimeTriggerEMCALBCUMReMatchBothCluster->SetYTitle("time (ns)");
2257 outputContainer->Add(fhTimeTriggerEMCALBCUMReMatchBothCluster);
2259 fhTimeTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_OpenTime",
2260 "cluster time vs E of clusters, no match, rematch open time",
2261 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2262 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2263 fhTimeTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2264 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchOpenTime);
2267 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2268 "cluster time vs E of clusters, no match, rematch with neigbour parches",
2269 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2270 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2271 fhTimeTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2272 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchCheckNeigh);
2274 fhTimeTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimeTriggerBC0_UnMatch_ReMatch_Both",
2275 "cluster time vs E of clusters, no match, rematch open time and neigbour",
2276 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2277 fhTimeTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2278 fhTimeTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2279 outputContainer->Add(fhTimeTriggerEMCALBC0UMReMatchBoth);
2283 fhPhiPhoton = new TH2F
2284 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2285 fhPhiPhoton->SetYTitle("#phi (rad)");
2286 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
2287 outputContainer->Add(fhPhiPhoton) ;
2289 fhEtaPhoton = new TH2F
2290 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
2291 fhEtaPhoton->SetYTitle("#eta");
2292 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
2293 outputContainer->Add(fhEtaPhoton) ;
2295 fhEtaPhiPhoton = new TH2F
2296 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
2297 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
2298 fhEtaPhiPhoton->SetXTitle("#eta");
2299 outputContainer->Add(fhEtaPhiPhoton) ;
2300 if(GetMinPt() < 0.5)
2302 fhEtaPhi05Photon = new TH2F
2303 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
2304 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
2305 fhEtaPhi05Photon->SetXTitle("#eta");
2306 outputContainer->Add(fhEtaPhi05Photon) ;
2309 if(fCalorimeter=="EMCAL" && fFillEMCALBCHistograms)
2311 fhEtaPhiPhotonEMCALBC0 = new TH2F
2312 ("hEtaPhiPhotonEMCALBC0","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| < 25 ns, EMCAL-BC=0",netabins,etamin,etamax,nphibins,phimin,phimax);
2313 fhEtaPhiPhotonEMCALBC0->SetYTitle("#phi (rad)");
2314 fhEtaPhiPhotonEMCALBC0->SetXTitle("#eta");
2315 outputContainer->Add(fhEtaPhiPhotonEMCALBC0) ;
2317 fhEtaPhiPhotonEMCALBC1 = new TH2F
2318 ("hEtaPhiPhotonEMCALBC1","identified photon, E > 2 GeV, #eta vs #phi, for clusters with 25 < |time| < 75 ns, EMCAL-BC=1",netabins,etamin,etamax,nphibins,phimin,phimax);
2319 fhEtaPhiPhotonEMCALBC1->SetYTitle("#phi (rad)");
2320 fhEtaPhiPhotonEMCALBC1->SetXTitle("#eta");
2321 outputContainer->Add(fhEtaPhiPhotonEMCALBC1) ;
2323 fhEtaPhiPhotonEMCALBCN = new TH2F
2324 ("hEtaPhiPhotonEMCALBCN","identified photon, E > 2 GeV, #eta vs #phi, for clusters with |time| > 75 ns, EMCAL-BC>1",netabins,etamin,etamax,nphibins,phimin,phimax);
2325 fhEtaPhiPhotonEMCALBCN->SetYTitle("#phi (rad)");
2326 fhEtaPhiPhotonEMCALBCN->SetXTitle("#eta");
2327 outputContainer->Add(fhEtaPhiPhotonEMCALBCN) ;
2329 for(Int_t i = 0; i < 11; i++)
2331 fhEtaPhiPhotonTriggerEMCALBC[i] = new TH2F
2332 (Form("hEtaPhiPhotonTriggerEMCALBC%d",i-5),
2333 Form("photon E > 2 GeV, #eta vs #phi, PhotonTrigger EMCAL-BC=%d",i-5),
2334 netabins,etamin,etamax,nphibins,phimin,phimax);
2335 fhEtaPhiPhotonTriggerEMCALBC[i]->SetYTitle("#phi (rad)");
2336 fhEtaPhiPhotonTriggerEMCALBC[i]->SetXTitle("#eta");
2337 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBC[i]) ;
2339 fhTimePhotonTriggerEMCALBC[i] = new TH2F
2340 (Form("hTimePhotonTriggerEMCALBC%d",i-5),
2341 Form("photon time vs E of clusters, PhotonTrigger EMCAL-BC=%d",i-5),
2342 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2343 fhTimePhotonTriggerEMCALBC[i]->SetXTitle("E (GeV)");
2344 fhTimePhotonTriggerEMCALBC[i]->SetYTitle("time (ns)");
2345 outputContainer->Add(fhTimePhotonTriggerEMCALBC[i]);
2347 fhTimePhotonTriggerEMCALBCPileUpSPD[i] = new TH2F
2348 (Form("hTimePhotonTriggerEMCALBC%dPileUpSPD",i-5),
2349 Form("photon time vs E, PhotonTrigger EMCAL-BC=%d",i-5),
2350 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2351 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetXTitle("E (GeV)");
2352 fhTimePhotonTriggerEMCALBCPileUpSPD[i]->SetYTitle("time (ns)");
2353 outputContainer->Add(fhTimePhotonTriggerEMCALBCPileUpSPD[i]);
2355 fhEtaPhiPhotonTriggerEMCALBCUM[i] = new TH2F
2356 (Form("hEtaPhiPhotonTriggerEMCALBC%d_UnMatch",i-5),
2357 Form("photon E > 2 GeV, #eta vs #phi, unmatched trigger EMCAL-BC=%d",i-5),
2358 netabins,etamin,etamax,nphibins,phimin,phimax);
2359 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetYTitle("#phi (rad)");
2360 fhEtaPhiPhotonTriggerEMCALBCUM[i]->SetXTitle("#eta");
2361 outputContainer->Add(fhEtaPhiPhotonTriggerEMCALBCUM[i]) ;
2363 fhTimePhotonTriggerEMCALBCUM[i] = new TH2F
2364 (Form("hTimePhotonTriggerEMCALBC%d_UnMatch",i-5),
2365 Form("photon time vs E, unmatched trigger EMCAL-BC=%d",i-5),
2366 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2367 fhTimePhotonTriggerEMCALBCUM[i]->SetXTitle("E (GeV)");
2368 fhTimePhotonTriggerEMCALBCUM[i]->SetYTitle("time (ns)");
2369 outputContainer->Add(fhTimePhotonTriggerEMCALBCUM[i]);
2373 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_OpenTime",
2374 "cluster time vs E of photons, no match, rematch open time",
2375 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2376 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetXTitle("E (GeV)");
2377 fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime->SetYTitle("time (ns)");
2378 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime);
2381 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_CheckNeighbours",
2382 "cluster time vs E of photons, no match, rematch with neigbour parches",
2383 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2384 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetXTitle("E (GeV)");
2385 fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh->SetYTitle("time (ns)");
2386 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh);
2388 fhTimePhotonTriggerEMCALBC0UMReMatchBoth = new TH2F("hTimePhotonTriggerBC0_UnMatch_ReMatch_Both",
2389 "cluster time vs E of photons, no match, rematch open time and neigbour",
2390 nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2391 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetXTitle("E (GeV)");
2392 fhTimePhotonTriggerEMCALBC0UMReMatchBoth->SetYTitle("time (ns)");
2393 outputContainer->Add(fhTimePhotonTriggerEMCALBC0UMReMatchBoth);
2397 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
2398 nptbins,ptmin,ptmax,10,0,10);
2399 fhNLocMax ->SetYTitle("N maxima");
2400 fhNLocMax ->SetXTitle("E (GeV)");
2401 outputContainer->Add(fhNLocMax) ;
2404 if(fFillSSHistograms)
2406 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2407 fhLam0E->SetYTitle("#lambda_{0}^{2}");
2408 fhLam0E->SetXTitle("E (GeV)");
2409 outputContainer->Add(fhLam0E);
2411 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2412 fhLam1E->SetYTitle("#lambda_{1}^{2}");
2413 fhLam1E->SetXTitle("E (GeV)");
2414 outputContainer->Add(fhLam1E);
2416 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2417 fhDispE->SetYTitle("D^{2}");
2418 fhDispE->SetXTitle("E (GeV) ");
2419 outputContainer->Add(fhDispE);
2421 if(!fRejectTrackMatch)
2423 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);
2424 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
2425 fhLam0ETM->SetXTitle("E (GeV)");
2426 outputContainer->Add(fhLam0ETM);
2428 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);
2429 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
2430 fhLam1ETM->SetXTitle("E (GeV)");
2431 outputContainer->Add(fhLam1ETM);
2433 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);
2434 fhDispETM->SetYTitle("D^{2}");
2435 fhDispETM->SetXTitle("E (GeV) ");
2436 outputContainer->Add(fhDispETM);
2439 if(fCalorimeter == "EMCAL")
2441 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2442 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
2443 fhLam0ETRD->SetXTitle("E (GeV)");
2444 outputContainer->Add(fhLam0ETRD);
2446 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2447 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
2448 fhLam1ETRD->SetXTitle("E (GeV)");
2449 outputContainer->Add(fhLam1ETRD);
2451 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2452 fhDispETRD->SetYTitle("Dispersion^{2}");
2453 fhDispETRD->SetXTitle("E (GeV) ");
2454 outputContainer->Add(fhDispETRD);
2456 if(!fRejectTrackMatch)
2458 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);
2459 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
2460 fhLam0ETMTRD->SetXTitle("E (GeV)");
2461 outputContainer->Add(fhLam0ETMTRD);
2463 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);
2464 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
2465 fhLam1ETMTRD->SetXTitle("E (GeV)");
2466 outputContainer->Add(fhLam1ETMTRD);
2468 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);
2469 fhDispETMTRD->SetYTitle("Dispersion^{2}");
2470 fhDispETMTRD->SetXTitle("E (GeV) ");
2471 outputContainer->Add(fhDispETMTRD);
2475 if(!fFillOnlySimpleSSHisto)
2477 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2478 fhNCellsLam0LowE->SetXTitle("N_{cells}");
2479 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
2480 outputContainer->Add(fhNCellsLam0LowE);
2482 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2483 fhNCellsLam0HighE->SetXTitle("N_{cells}");
2484 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
2485 outputContainer->Add(fhNCellsLam0HighE);
2487 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2488 fhNCellsLam1LowE->SetXTitle("N_{cells}");
2489 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
2490 outputContainer->Add(fhNCellsLam1LowE);
2492 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2493 fhNCellsLam1HighE->SetXTitle("N_{cells}");
2494 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
2495 outputContainer->Add(fhNCellsLam1HighE);
2497 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2498 fhNCellsDispLowE->SetXTitle("N_{cells}");
2499 fhNCellsDispLowE->SetYTitle("D^{2}");
2500 outputContainer->Add(fhNCellsDispLowE);
2502 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
2503 fhNCellsDispHighE->SetXTitle("N_{cells}");
2504 fhNCellsDispHighE->SetYTitle("D^{2}");
2505 outputContainer->Add(fhNCellsDispHighE);
2507 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
2508 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
2509 fhEtaLam0LowE->SetXTitle("#eta");
2510 outputContainer->Add(fhEtaLam0LowE);
2512 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
2513 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
2514 fhPhiLam0LowE->SetXTitle("#phi");
2515 outputContainer->Add(fhPhiLam0LowE);
2517 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
2518 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
2519 fhEtaLam0HighE->SetXTitle("#eta");
2520 outputContainer->Add(fhEtaLam0HighE);
2522 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
2523 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
2524 fhPhiLam0HighE->SetXTitle("#phi");
2525 outputContainer->Add(fhPhiLam0HighE);
2527 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2528 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
2529 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
2530 outputContainer->Add(fhLam1Lam0LowE);
2532 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2533 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
2534 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
2535 outputContainer->Add(fhLam1Lam0HighE);
2537 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2538 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
2539 fhLam0DispLowE->SetYTitle("D^{2}");
2540 outputContainer->Add(fhLam0DispLowE);
2542 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2543 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
2544 fhLam0DispHighE->SetYTitle("D^{2}");
2545 outputContainer->Add(fhLam0DispHighE);
2547 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2548 fhDispLam1LowE->SetXTitle("D^{2}");
2549 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
2550 outputContainer->Add(fhDispLam1LowE);
2552 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
2553 fhDispLam1HighE->SetXTitle("D^{2}");
2554 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
2555 outputContainer->Add(fhDispLam1HighE);
2557 if(fCalorimeter == "EMCAL")
2559 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);
2560 fhDispEtaE->SetXTitle("E (GeV)");
2561 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
2562 outputContainer->Add(fhDispEtaE);
2564 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);
2565 fhDispPhiE->SetXTitle("E (GeV)");
2566 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
2567 outputContainer->Add(fhDispPhiE);
2569 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);
2570 fhSumEtaE->SetXTitle("E (GeV)");
2571 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
2572 outputContainer->Add(fhSumEtaE);
2574 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
2575 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2576 fhSumPhiE->SetXTitle("E (GeV)");
2577 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
2578 outputContainer->Add(fhSumPhiE);
2580 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
2581 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
2582 fhSumEtaPhiE->SetXTitle("E (GeV)");
2583 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
2584 outputContainer->Add(fhSumEtaPhiE);
2586 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
2587 nptbins,ptmin,ptmax,200, -10,10);
2588 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
2589 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
2590 outputContainer->Add(fhDispEtaPhiDiffE);
2592 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
2593 nptbins,ptmin,ptmax, 200, -1,1);
2594 fhSphericityE->SetXTitle("E (GeV)");
2595 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2596 outputContainer->Add(fhSphericityE);
2598 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
2599 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
2600 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
2601 outputContainer->Add(fhDispSumEtaDiffE);
2603 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
2604 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
2605 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
2606 outputContainer->Add(fhDispSumPhiDiffE);
2608 for(Int_t i = 0; i < 7; i++)
2610 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]),
2611 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2612 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2613 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2614 outputContainer->Add(fhDispEtaDispPhi[i]);
2616 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]),
2617 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2618 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
2619 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
2620 outputContainer->Add(fhLambda0DispEta[i]);
2622 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]),
2623 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2624 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
2625 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2626 outputContainer->Add(fhLambda0DispPhi[i]);
2636 TString cutTM [] = {"NoCut",""};
2638 for(Int_t i = 0; i < 2; i++)
2640 fhTrackMatchedDEta[i] = new TH2F
2641 (Form("hTrackMatchedDEta%s",cutTM[i].Data()),
2642 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2643 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2644 fhTrackMatchedDEta[i]->SetYTitle("d#eta");
2645 fhTrackMatchedDEta[i]->SetXTitle("E_{cluster} (GeV)");
2647 fhTrackMatchedDPhi[i] = new TH2F
2648 (Form("hTrackMatchedDPhi%s",cutTM[i].Data()),
2649 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2650 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2651 fhTrackMatchedDPhi[i]->SetYTitle("d#phi (rad)");
2652 fhTrackMatchedDPhi[i]->SetXTitle("E_{cluster} (GeV)");
2654 fhTrackMatchedDEtaDPhi[i] = new TH2F
2655 (Form("hTrackMatchedDEtaDPhi%s",cutTM[i].Data()),
2656 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2657 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2658 fhTrackMatchedDEtaDPhi[i]->SetYTitle("d#phi (rad)");
2659 fhTrackMatchedDEtaDPhi[i]->SetXTitle("d#eta");
2661 fhTrackMatchedDEtaPos[i] = new TH2F
2662 (Form("hTrackMatchedDEtaPos%s",cutTM[i].Data()),
2663 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2664 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2665 fhTrackMatchedDEtaPos[i]->SetYTitle("d#eta");
2666 fhTrackMatchedDEtaPos[i]->SetXTitle("E_{cluster} (GeV)");
2668 fhTrackMatchedDPhiPos[i] = new TH2F
2669 (Form("hTrackMatchedDPhiPos%s",cutTM[i].Data()),
2670 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2671 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2672 fhTrackMatchedDPhiPos[i]->SetYTitle("d#phi (rad)");
2673 fhTrackMatchedDPhiPos[i]->SetXTitle("E_{cluster} (GeV)");
2675 fhTrackMatchedDEtaDPhiPos[i] = new TH2F
2676 (Form("hTrackMatchedDEtaDPhiPos%s",cutTM[i].Data()),
2677 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2678 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2679 fhTrackMatchedDEtaDPhiPos[i]->SetYTitle("d#phi (rad)");
2680 fhTrackMatchedDEtaDPhiPos[i]->SetXTitle("d#eta");
2682 fhTrackMatchedDEtaNeg[i] = new TH2F
2683 (Form("hTrackMatchedDEtaNeg%s",cutTM[i].Data()),
2684 Form("d#eta of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2685 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2686 fhTrackMatchedDEtaNeg[i]->SetYTitle("d#eta");
2687 fhTrackMatchedDEtaNeg[i]->SetXTitle("E_{cluster} (GeV)");
2689 fhTrackMatchedDPhiNeg[i] = new TH2F
2690 (Form("hTrackMatchedDPhiNeg%s",cutTM[i].Data()),
2691 Form("d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2692 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2693 fhTrackMatchedDPhiNeg[i]->SetYTitle("d#phi (rad)");
2694 fhTrackMatchedDPhiNeg[i]->SetXTitle("E_{cluster} (GeV)");
2696 fhTrackMatchedDEtaDPhiNeg[i] = new TH2F
2697 (Form("hTrackMatchedDEtaDPhiNeg%s",cutTM[i].Data()),
2698 Form("d#eta vs d#phi of cluster-track vs cluster energy, %s",cutTM[i].Data()),
2699 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
2700 fhTrackMatchedDEtaDPhiNeg[i]->SetYTitle("d#phi (rad)");
2701 fhTrackMatchedDEtaDPhiNeg[i]->SetXTitle("d#eta");
2703 fhdEdx[i] = new TH2F (Form("hdEdx%s",cutTM[i].Data()),Form("matched track <dE/dx> vs cluster E, %s",cutTM[i].Data()),
2704 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
2705 fhdEdx[i]->SetXTitle("E (GeV)");
2706 fhdEdx[i]->SetYTitle("<dE/dx>");
2708 fhEOverP[i] = new TH2F (Form("hEOverP%s",cutTM[i].Data()),Form("matched track E/p vs cluster E, %s",cutTM[i].Data()),
2709 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2710 fhEOverP[i]->SetXTitle("E (GeV)");
2711 fhEOverP[i]->SetYTitle("E/p");
2713 outputContainer->Add(fhTrackMatchedDEta[i]) ;
2714 outputContainer->Add(fhTrackMatchedDPhi[i]) ;
2715 outputContainer->Add(fhTrackMatchedDEtaDPhi[i]) ;
2716 outputContainer->Add(fhTrackMatchedDEtaPos[i]) ;
2717 outputContainer->Add(fhTrackMatchedDPhiPos[i]) ;
2718 outputContainer->Add(fhTrackMatchedDEtaDPhiPos[i]) ;
2719 outputContainer->Add(fhTrackMatchedDEtaNeg[i]) ;
2720 outputContainer->Add(fhTrackMatchedDPhiNeg[i]) ;
2721 outputContainer->Add(fhTrackMatchedDEtaDPhiNeg[i]) ;
2722 outputContainer->Add(fhdEdx[i]);
2723 outputContainer->Add(fhEOverP[i]);
2725 if(fCalorimeter=="EMCAL")
2727 fhTrackMatchedDEtaTRD[i] = new TH2F
2728 (Form("hTrackMatchedDEtaTRD%s",cutTM[i].Data()),
2729 Form("d#eta of cluster-track vs cluster energy, SM behind TRD, %s",cutTM[i].Data()),
2730 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2731 fhTrackMatchedDEtaTRD[i]->SetYTitle("d#eta");
2732 fhTrackMatchedDEtaTRD[i]->SetXTitle("E_{cluster} (GeV)");
2734 fhTrackMatchedDPhiTRD[i] = new TH2F
2735 (Form("hTrackMatchedDPhiTRD%s",cutTM[i].Data()),
2736 Form("d#phi of cluster-track vs cluster energy, SM behing TRD, %s",cutTM[i].Data()),
2737 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2738 fhTrackMatchedDPhiTRD[i]->SetYTitle("d#phi (rad)");
2739 fhTrackMatchedDPhiTRD[i]->SetXTitle("E_{cluster} (GeV)");
2741 fhEOverPTRD[i] = new TH2F
2742 (Form("hEOverPTRD%s",cutTM[i].Data()),
2743 Form("matched track E/p vs cluster E, behind TRD, %s",cutTM[i].Data()),
2744 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
2745 fhEOverPTRD[i]->SetXTitle("E (GeV)");
2746 fhEOverPTRD[i]->SetYTitle("E/p");
2748 outputContainer->Add(fhTrackMatchedDEtaTRD[i]) ;
2749 outputContainer->Add(fhTrackMatchedDPhiTRD[i]) ;
2750 outputContainer->Add(fhEOverPTRD[i]);
2755 fhTrackMatchedDEtaMCNoOverlap[i] = new TH2F
2756 (Form("hTrackMatchedDEtaMCNoOverlap%s",cutTM[i].Data()),
2757 Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2758 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2759 fhTrackMatchedDEtaMCNoOverlap[i]->SetYTitle("d#eta");
2760 fhTrackMatchedDEtaMCNoOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2762 fhTrackMatchedDPhiMCNoOverlap[i] = new TH2F
2763 (Form("hTrackMatchedDPhiMCNoOverlap%s",cutTM[i].Data()),
2764 Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap %s",cutTM[i].Data()),
2765 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2766 fhTrackMatchedDPhiMCNoOverlap[i]->SetYTitle("d#phi (rad)");
2767 fhTrackMatchedDPhiMCNoOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2769 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[i]) ;
2770 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[i]) ;
2771 fhTrackMatchedDEtaMCOverlap[i] = new TH2F
2772 (Form("hTrackMatchedDEtaMCOverlap%s",cutTM[i].Data()),
2773 Form("d#eta of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2774 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2775 fhTrackMatchedDEtaMCOverlap[i]->SetYTitle("d#eta");
2776 fhTrackMatchedDEtaMCOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2778 fhTrackMatchedDPhiMCOverlap[i] = new TH2F
2779 (Form("hTrackMatchedDPhiMCOverlap%s",cutTM[i].Data()),
2780 Form("d#phi of cluster-track vs cluster energy, several MC particles overlap %s",cutTM[i].Data()),
2781 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2782 fhTrackMatchedDPhiMCOverlap[i]->SetYTitle("d#phi (rad)");
2783 fhTrackMatchedDPhiMCOverlap[i]->SetXTitle("E_{cluster} (GeV)");
2785 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[i]) ;
2786 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[i]) ;
2788 fhTrackMatchedDEtaMCConversion[i] = new TH2F
2789 (Form("hTrackMatchedDEtaMCConversion%s",cutTM[i].Data()),
2790 Form("d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2791 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
2792 fhTrackMatchedDEtaMCConversion[i]->SetYTitle("d#eta");
2793 fhTrackMatchedDEtaMCConversion[i]->SetXTitle("E_{cluster} (GeV)");
2795 fhTrackMatchedDPhiMCConversion[i] = new TH2F
2796 (Form("hTrackMatchedDPhiMCConversion%s",cutTM[i].Data()),
2797 Form("d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions %s",cutTM[i].Data()),
2798 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
2799 fhTrackMatchedDPhiMCConversion[i]->SetYTitle("d#phi (rad)");
2800 fhTrackMatchedDPhiMCConversion[i]->SetXTitle("E_{cluster} (GeV)");
2802 outputContainer->Add(fhTrackMatchedDEtaMCConversion[i]) ;
2803 outputContainer->Add(fhTrackMatchedDPhiMCConversion[i]) ;
2805 fhTrackMatchedMCParticle[i] = new TH2F
2806 (Form("hTrackMatchedMCParticle%s",cutTM[i].Data()),
2807 Form("Origin of particle vs energy %s",cutTM[i].Data()),
2808 nptbins,ptmin,ptmax,8,0,8);
2809 fhTrackMatchedMCParticle[i]->SetXTitle("E (GeV)");
2810 //fhTrackMatchedMCParticle[i]->SetYTitle("Particle type");
2812 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(1 ,"Photon");
2813 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(2 ,"Electron");
2814 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
2815 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(4 ,"Rest");
2816 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
2817 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
2818 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
2819 fhTrackMatchedMCParticle[i]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
2821 outputContainer->Add(fhTrackMatchedMCParticle[i]);
2826 if(fFillPileUpHistograms)
2829 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
2831 for(Int_t i = 0 ; i < 7 ; i++)
2833 fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
2834 Form("Cluster p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2835 fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2836 outputContainer->Add(fhPtPileUp[i]);
2838 fhPtChargedPileUp[i] = new TH1F(Form("hPtChargedPileUp%s",pileUpName[i].Data()),
2839 Form("Charged clusters p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2840 fhPtChargedPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2841 outputContainer->Add(fhPtChargedPileUp[i]);
2843 fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
2844 Form("Selected photon p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2845 fhPtPhotonPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2846 outputContainer->Add(fhPtPhotonPileUp[i]);
2849 fhClusterEFracLongTimePileUp[i] = new TH2F(Form("hClusterEFracLongTimePileUp%s",pileUpName[i].Data()),
2850 Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
2851 nptbins,ptmin,ptmax,200,0,1);
2852 fhClusterEFracLongTimePileUp[i]->SetXTitle("E (GeV)");
2853 fhClusterEFracLongTimePileUp[i]->SetYTitle("E(large time) / E");
2854 outputContainer->Add(fhClusterEFracLongTimePileUp[i]);
2856 fhClusterCellTimePileUp[i] = new TH2F(Form("hClusterCellTimePileUp%s",pileUpName[i].Data()),
2857 Form("Cluster E vs cell time in cluster, %s Pile-Up event",pileUpName[i].Data()),
2858 nptbins,ptmin,ptmax,ntimebins,timemin,timemax);
2859 fhClusterCellTimePileUp[i]->SetXTitle("E (GeV)");
2860 fhClusterCellTimePileUp[i]->SetYTitle("t_{cell} (ns)");
2861 outputContainer->Add(fhClusterCellTimePileUp[i]);
2863 fhClusterTimeDiffPileUp[i] = new TH2F(Form("hClusterTimeDiffPileUp%s",pileUpName[i].Data()),
2864 Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2865 nptbins,ptmin,ptmax,400,-200,200);
2866 fhClusterTimeDiffPileUp[i]->SetXTitle("E (GeV)");
2867 fhClusterTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2868 outputContainer->Add(fhClusterTimeDiffPileUp[i]);
2870 fhClusterTimeDiffChargedPileUp[i] = new TH2F(Form("hClusterTimeDiffChargedPileUp%s",pileUpName[i].Data()),
2871 Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2872 nptbins,ptmin,ptmax,400,-200,200);
2873 fhClusterTimeDiffChargedPileUp[i]->SetXTitle("E (GeV)");
2874 fhClusterTimeDiffChargedPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2875 outputContainer->Add(fhClusterTimeDiffChargedPileUp[i]);
2877 fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
2878 Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2879 nptbins,ptmin,ptmax,400,-200,200);
2880 fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("E (GeV)");
2881 fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2882 outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
2884 fhLambda0PileUp[i] = new TH2F(Form("hLambda0PileUp%s",pileUpName[i].Data()),
2885 Form("Cluster E vs #lambda^{2}_{0} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2886 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2887 fhLambda0PileUp[i]->SetXTitle("E (GeV)");
2888 fhLambda0PileUp[i]->SetYTitle("#lambda^{2}_{0}");
2889 outputContainer->Add(fhLambda0PileUp[i]);
2891 fhLambda0ChargedPileUp[i] = new TH2F(Form("hLambda0ChargedPileUp%s",pileUpName[i].Data()),
2892 Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2893 fhLambda0ChargedPileUp[i]->SetXTitle("E (GeV)");
2894 fhLambda0ChargedPileUp[i]->SetYTitle("#lambda^{2}_{0}");
2895 outputContainer->Add(fhLambda0ChargedPileUp[i]);
2899 fhEtaPhiBC0 = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
2900 fhEtaPhiBC0->SetXTitle("#eta ");
2901 fhEtaPhiBC0->SetYTitle("#phi (rad)");
2902 outputContainer->Add(fhEtaPhiBC0);
2904 fhEtaPhiBCPlus = new TH2F ("hEtaPhiBCPlus","eta-phi for clusters tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
2905 fhEtaPhiBCPlus->SetXTitle("#eta ");
2906 fhEtaPhiBCPlus->SetYTitle("#phi (rad)");
2907 outputContainer->Add(fhEtaPhiBCPlus);
2909 fhEtaPhiBCMinus = new TH2F ("hEtaPhiBCMinus","eta-phi for clusters tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
2910 fhEtaPhiBCMinus->SetXTitle("#eta ");
2911 fhEtaPhiBCMinus->SetYTitle("#phi (rad)");
2912 outputContainer->Add(fhEtaPhiBCMinus);
2914 fhEtaPhiBC0PileUpSPD = new TH2F ("hEtaPhiBC0PileUpSPD","eta-phi for clusters tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2915 fhEtaPhiBC0PileUpSPD->SetXTitle("#eta ");
2916 fhEtaPhiBC0PileUpSPD->SetYTitle("#phi (rad)");
2917 outputContainer->Add(fhEtaPhiBC0PileUpSPD);
2919 fhEtaPhiBCPlusPileUpSPD = new TH2F ("hEtaPhiBCPlusPileUpSPD","eta-phi for clusters tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2920 fhEtaPhiBCPlusPileUpSPD->SetXTitle("#eta ");
2921 fhEtaPhiBCPlusPileUpSPD->SetYTitle("#phi (rad)");
2922 outputContainer->Add(fhEtaPhiBCPlusPileUpSPD);
2924 fhEtaPhiBCMinusPileUpSPD = new TH2F ("hEtaPhiBCMinusPileUpSPD","eta-phi for clusters tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2925 fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
2926 fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
2927 outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
2929 fhTimePtNoCut = new TH2F ("hTimePt_NoCut","time of cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2930 fhTimePtNoCut->SetXTitle("p_{T} (GeV/c)");
2931 fhTimePtNoCut->SetYTitle("time (ns)");
2932 outputContainer->Add(fhTimePtNoCut);
2934 fhTimePtSPD = new TH2F ("hTimePt_SPD","time of cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2935 fhTimePtSPD->SetXTitle("p_{T} (GeV/c)");
2936 fhTimePtSPD->SetYTitle("time (ns)");
2937 outputContainer->Add(fhTimePtSPD);
2939 fhTimePtPhotonNoCut = new TH2F ("hTimePtPhoton_NoCut","time of photon cluster vs pT of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2940 fhTimePtPhotonNoCut->SetXTitle("p_{T} (GeV/c)");
2941 fhTimePtPhotonNoCut->SetYTitle("time (ns)");
2942 outputContainer->Add(fhTimePtPhotonNoCut);
2944 fhTimePtPhotonSPD = new TH2F ("hTimePtPhoton_SPD","time of photon cluster vs pT of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2945 fhTimePtPhotonSPD->SetXTitle("p_{T} (GeV/c)");
2946 fhTimePtPhotonSPD->SetYTitle("time (ns)");
2947 outputContainer->Add(fhTimePtPhotonSPD);
2949 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,20,0,20);
2950 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
2951 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
2952 outputContainer->Add(fhTimeNPileUpVertSPD);
2954 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 20,0,20 );
2955 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
2956 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
2957 outputContainer->Add(fhTimeNPileUpVertTrack);
2959 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2960 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
2961 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
2962 outputContainer->Add(fhTimeNPileUpVertContributors);
2964 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);
2965 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
2966 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
2967 outputContainer->Add(fhTimePileUpMainVertexZDistance);
2969 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
2970 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
2971 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
2972 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
2974 TString title[] = {"no |t diff| cut","|t diff|<20 ns","|t diff|>20 ns","|t diff|>40 ns"};
2975 TString name [] = {"TDiffNoCut","TDiffSmaller20ns","TDiffLarger20ns","TDiffLarger40ns"};
2976 for(Int_t i = 0; i < 4; i++)
2978 fhClusterMultSPDPileUp[i] = new TH2F(Form("fhClusterMultSPDPileUp_%s", name[i].Data()),
2979 Form("Number of clusters per pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
2980 nptbins,ptmin,ptmax,100,0,100);
2981 fhClusterMultSPDPileUp[i]->SetYTitle("n clusters ");
2982 fhClusterMultSPDPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2983 outputContainer->Add(fhClusterMultSPDPileUp[i]) ;
2985 fhClusterMultNoPileUp[i] = new TH2F(Form("fhClusterMultNoPileUp_%s", name[i].Data()),
2986 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()),
2987 nptbins,ptmin,ptmax,100,0,100);
2988 fhClusterMultNoPileUp[i]->SetYTitle("n clusters ");
2989 fhClusterMultNoPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2990 outputContainer->Add(fhClusterMultNoPileUp[i]) ;
2993 fhPtNPileUpSPDVtx = new TH2F ("hPt_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
2994 nptbins,ptmin,ptmax,20,0,20);
2995 fhPtNPileUpSPDVtx->SetYTitle("# vertex ");
2996 fhPtNPileUpSPDVtx->SetXTitle("p_{T} (GeV/c)");
2997 outputContainer->Add(fhPtNPileUpSPDVtx);
2999 fhPtNPileUpTrkVtx = new TH2F ("hPt_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
3000 nptbins,ptmin,ptmax, 20,0,20 );
3001 fhPtNPileUpTrkVtx->SetYTitle("# vertex ");
3002 fhPtNPileUpTrkVtx->SetXTitle("p_{T} (GeV/c)");
3003 outputContainer->Add(fhPtNPileUpTrkVtx);
3005 fhPtNPileUpSPDVtxTimeCut = new TH2F ("hPt_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
3006 nptbins,ptmin,ptmax,20,0,20);
3007 fhPtNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
3008 fhPtNPileUpSPDVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3009 outputContainer->Add(fhPtNPileUpSPDVtxTimeCut);
3011 fhPtNPileUpTrkVtxTimeCut = new TH2F ("hPt_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
3012 nptbins,ptmin,ptmax, 20,0,20 );
3013 fhPtNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
3014 fhPtNPileUpTrkVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3015 outputContainer->Add(fhPtNPileUpTrkVtxTimeCut);
3017 fhPtNPileUpSPDVtxTimeCut2 = new TH2F ("hPt_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
3018 nptbins,ptmin,ptmax,20,0,20);
3019 fhPtNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
3020 fhPtNPileUpSPDVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3021 outputContainer->Add(fhPtNPileUpSPDVtxTimeCut2);
3023 fhPtNPileUpTrkVtxTimeCut2 = new TH2F ("hPt_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
3024 nptbins,ptmin,ptmax, 20,0,20 );
3025 fhPtNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
3026 fhPtNPileUpTrkVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3027 outputContainer->Add(fhPtNPileUpTrkVtxTimeCut2);
3029 fhPtPhotonNPileUpSPDVtx = new TH2F ("hPtPhoton_NPileUpVertSPD","pT of cluster vs N pile-up SPD vertex",
3030 nptbins,ptmin,ptmax,20,0,20);
3031 fhPtPhotonNPileUpSPDVtx->SetYTitle("# vertex ");
3032 fhPtPhotonNPileUpSPDVtx->SetXTitle("p_{T} (GeV/c)");
3033 outputContainer->Add(fhPtPhotonNPileUpSPDVtx);
3035 fhPtPhotonNPileUpTrkVtx = new TH2F ("hPtPhoton_NPileUpVertTracks","pT of cluster vs N pile-up Tracks vertex",
3036 nptbins,ptmin,ptmax, 20,0,20 );
3037 fhPtPhotonNPileUpTrkVtx->SetYTitle("# vertex ");
3038 fhPtPhotonNPileUpTrkVtx->SetXTitle("p_{T} (GeV/c)");
3039 outputContainer->Add(fhPtPhotonNPileUpTrkVtx);
3041 fhPtPhotonNPileUpSPDVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut","pT of cluster vs N pile-up SPD vertex, |tof| < 25 ns",
3042 nptbins,ptmin,ptmax,20,0,20);
3043 fhPtPhotonNPileUpSPDVtxTimeCut->SetYTitle("# vertex ");
3044 fhPtPhotonNPileUpSPDVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3045 outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut);
3047 fhPtPhotonNPileUpTrkVtxTimeCut = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut","pT of cluster vs N pile-up Tracks vertex, |tof| < 25 ns",
3048 nptbins,ptmin,ptmax, 20,0,20 );
3049 fhPtPhotonNPileUpTrkVtxTimeCut->SetYTitle("# vertex ");
3050 fhPtPhotonNPileUpTrkVtxTimeCut->SetXTitle("p_{T} (GeV/c)");
3051 outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut);
3053 fhPtPhotonNPileUpSPDVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertSPD_TimeCut2","pT of cluster vs N pile-up SPD vertex, -25 < tof < 75 ns",
3054 nptbins,ptmin,ptmax,20,0,20);
3055 fhPtPhotonNPileUpSPDVtxTimeCut2->SetYTitle("# vertex ");
3056 fhPtPhotonNPileUpSPDVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3057 outputContainer->Add(fhPtPhotonNPileUpSPDVtxTimeCut2);
3059 fhPtPhotonNPileUpTrkVtxTimeCut2 = new TH2F ("hPtPhoton_NPileUpVertTracks_TimeCut2","pT of cluster vs N pile-up Tracks vertex, -25 < tof < 75 ns",
3060 nptbins,ptmin,ptmax, 20,0,20 );
3061 fhPtPhotonNPileUpTrkVtxTimeCut2->SetYTitle("# vertex ");
3062 fhPtPhotonNPileUpTrkVtxTimeCut2->SetXTitle("p_{T} (GeV/c)");
3063 outputContainer->Add(fhPtPhotonNPileUpTrkVtxTimeCut2);
3069 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
3070 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
3071 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
3073 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
3074 "Conversion", "Hadron", "AntiNeutron","AntiProton",
3075 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
3077 for(Int_t i = 0; i < fNOriginHistograms; i++)
3079 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
3080 Form("cluster from %s : E ",ptype[i].Data()),
3081 nptbins,ptmin,ptmax);
3082 fhMCE[i]->SetXTitle("E (GeV)");
3083 outputContainer->Add(fhMCE[i]) ;
3085 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
3086 Form("cluster from %s : p_{T} ",ptype[i].Data()),
3087 nptbins,ptmin,ptmax);
3088 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
3089 outputContainer->Add(fhMCPt[i]) ;
3091 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
3092 Form("cluster from %s : #eta ",ptype[i].Data()),
3093 nptbins,ptmin,ptmax,netabins,etamin,etamax);
3094 fhMCEta[i]->SetYTitle("#eta");
3095 fhMCEta[i]->SetXTitle("E (GeV)");
3096 outputContainer->Add(fhMCEta[i]) ;
3098 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
3099 Form("cluster from %s : #phi ",ptype[i].Data()),
3100 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
3101 fhMCPhi[i]->SetYTitle("#phi (rad)");
3102 fhMCPhi[i]->SetXTitle("E (GeV)");
3103 outputContainer->Add(fhMCPhi[i]) ;
3106 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
3107 Form("MC - Reco E from %s",pname[i].Data()),
3108 nptbins,ptmin,ptmax, 200,-50,50);
3109 fhMCDeltaE[i]->SetYTitle("#Delta E (GeV)");
3110 fhMCDeltaE[i]->SetXTitle("E (GeV)");
3111 outputContainer->Add(fhMCDeltaE[i]);
3113 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
3114 Form("MC - Reco p_{T} from %s",pname[i].Data()),
3115 nptbins,ptmin,ptmax, 200,-50,50);
3116 fhMCDeltaPt[i]->SetXTitle("p_{T,rec} (GeV/c)");
3117 fhMCDeltaPt[i]->SetYTitle("#Delta p_{T} (GeV/c)");
3118 outputContainer->Add(fhMCDeltaPt[i]);
3120 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
3121 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
3122 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3123 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
3124 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
3125 outputContainer->Add(fhMC2E[i]);
3127 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
3128 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
3129 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
3130 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
3131 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
3132 outputContainer->Add(fhMC2Pt[i]);
3137 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
3138 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
3140 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
3141 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
3143 for(Int_t i = 0; i < fNPrimaryHistograms; i++)
3145 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
3146 Form("primary photon %s : E ",pptype[i].Data()),
3147 nptbins,ptmin,ptmax);
3148 fhEPrimMC[i]->SetXTitle("E (GeV)");
3149 outputContainer->Add(fhEPrimMC[i]) ;
3151 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
3152 Form("primary photon %s : p_{T} ",pptype[i].Data()),
3153 nptbins,ptmin,ptmax);
3154 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
3155 outputContainer->Add(fhPtPrimMC[i]) ;
3157 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
3158 Form("primary photon %s : Rapidity ",pptype[i].Data()),
3159 nptbins,ptmin,ptmax,800,-8,8);
3160 fhYPrimMC[i]->SetYTitle("Rapidity");
3161 fhYPrimMC[i]->SetXTitle("E (GeV)");
3162 outputContainer->Add(fhYPrimMC[i]) ;
3164 fhEtaPrimMC[i] = new TH2F(Form("hEtaPrim_MC%s",ppname[i].Data()),
3165 Form("primary photon %s : #eta",pptype[i].Data()),
3166 nptbins,ptmin,ptmax,800,-8,8);
3167 fhEtaPrimMC[i]->SetYTitle("#eta");
3168 fhEtaPrimMC[i]->SetXTitle("E (GeV)");
3169 outputContainer->Add(fhEtaPrimMC[i]) ;
3171 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
3172 Form("primary photon %s : #phi ",pptype[i].Data()),
3173 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
3174 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
3175 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
3176 outputContainer->Add(fhPhiPrimMC[i]) ;
3179 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
3180 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
3181 nptbins,ptmin,ptmax);
3182 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
3183 outputContainer->Add(fhEPrimMCAcc[i]) ;
3185 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
3186 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
3187 nptbins,ptmin,ptmax);
3188 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
3189 outputContainer->Add(fhPtPrimMCAcc[i]) ;
3191 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
3192 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
3193 nptbins,ptmin,ptmax,100,-1,1);
3194 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
3195 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
3196 outputContainer->Add(fhYPrimMCAcc[i]) ;
3198 fhEtaPrimMCAcc[i] = new TH2F(Form("hEtaPrimAcc_MC%s",ppname[i].Data()),
3199 Form("primary photon %s in acceptance: #eta ",pptype[i].Data()),
3200 nptbins,ptmin,ptmax,netabins,etamin,etamax);
3201 fhEtaPrimMCAcc[i]->SetYTitle("#eta");
3202 fhEtaPrimMCAcc[i]->SetXTitle("E (GeV)");
3203 outputContainer->Add(fhYPrimMCAcc[i]) ;
3205 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
3206 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
3207 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
3208 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
3209 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
3210 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
3214 if(fFillSSHistograms)
3216 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
3218 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
3220 for(Int_t i = 0; i < 6; i++)
3222 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
3223 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
3224 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3225 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
3226 fhMCELambda0[i]->SetXTitle("E (GeV)");
3227 outputContainer->Add(fhMCELambda0[i]) ;
3229 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
3230 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
3231 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3232 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
3233 fhMCELambda1[i]->SetXTitle("E (GeV)");
3234 outputContainer->Add(fhMCELambda1[i]) ;
3236 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
3237 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
3238 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3239 fhMCEDispersion[i]->SetYTitle("D^{2}");
3240 fhMCEDispersion[i]->SetXTitle("E (GeV)");
3241 outputContainer->Add(fhMCEDispersion[i]) ;
3243 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
3244 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
3245 nptbins,ptmin,ptmax, nbins,nmin,nmax);
3246 fhMCNCellsE[i]->SetXTitle("E (GeV)");
3247 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
3248 outputContainer->Add(fhMCNCellsE[i]);
3250 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
3251 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
3252 nptbins,ptmin,ptmax, 500,0,1.);
3253 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
3254 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3255 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
3257 if(!fFillOnlySimpleSSHisto)
3259 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
3260 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
3261 ssbins,ssmin,ssmax,500,0,1.);
3262 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
3263 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3264 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
3266 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
3267 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
3268 ssbins,ssmin,ssmax,500,0,1.);
3269 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
3270 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3271 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
3273 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
3274 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
3275 ssbins,ssmin,ssmax,500,0,1.);
3276 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
3277 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3278 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
3280 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
3281 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
3282 nbins/5,nmin,nmax/5,500,0,1.);
3283 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
3284 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3285 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
3287 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
3288 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
3289 nbins/5,nmin,nmax/5,500,0,1.);
3290 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
3291 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
3292 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
3294 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
3295 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
3296 nbins/5,nmin,nmax/5,500,0,1.);
3297 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
3298 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
3299 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
3301 if(fCalorimeter=="EMCAL")
3303 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
3304 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
3305 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3306 fhMCEDispEta[i]->SetXTitle("E (GeV)");
3307 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
3308 outputContainer->Add(fhMCEDispEta[i]);
3310 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
3311 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
3312 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
3313 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
3314 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
3315 outputContainer->Add(fhMCEDispPhi[i]);
3317 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
3318 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()),
3319 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
3320 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
3321 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
3322 outputContainer->Add(fhMCESumEtaPhi[i]);
3324 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
3325 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
3326 nptbins,ptmin,ptmax,200,-10,10);
3327 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
3328 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
3329 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
3331 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
3332 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()),
3333 nptbins,ptmin,ptmax, 200,-1,1);
3334 fhMCESphericity[i]->SetXTitle("E (GeV)");
3335 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
3336 outputContainer->Add(fhMCESphericity[i]);
3338 for(Int_t ie = 0; ie < 7; ie++)
3340 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
3341 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]),
3342 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
3343 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
3344 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
3345 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
3347 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
3348 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]),
3349 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
3350 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
3351 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
3352 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
3354 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
3355 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]),
3356 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
3357 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
3358 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
3359 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
3365 if(!GetReader()->IsEmbeddedClusterSelectionOn())
3367 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
3368 "cluster from Photon : E vs #lambda_{0}^{2}",
3369 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3370 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
3371 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
3372 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
3374 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
3375 "cluster from Photon : E vs #lambda_{0}^{2}",
3376 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3377 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
3378 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
3379 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
3381 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
3382 "cluster from Photon : E vs #lambda_{0}^{2}",
3383 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3384 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
3385 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
3386 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
3390 if(GetReader()->IsEmbeddedClusterSelectionOn())
3393 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
3394 "Energy Fraction of embedded signal versus cluster energy",
3395 nptbins,ptmin,ptmax,100,0.,1.);
3396 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
3397 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
3398 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
3400 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
3401 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
3402 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3403 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
3404 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
3405 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
3407 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
3408 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
3409 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3410 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
3411 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
3412 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
3414 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
3415 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
3416 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3417 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
3418 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
3419 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
3421 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
3422 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
3423 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3424 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
3425 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
3426 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
3428 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
3429 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
3430 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3431 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
3432 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
3433 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
3435 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
3436 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
3437 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3438 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
3439 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
3440 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
3442 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
3443 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
3444 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3445 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
3446 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
3447 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
3449 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
3450 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
3451 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
3452 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
3453 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
3454 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
3456 }// embedded histograms
3459 }// Fill SS MC histograms
3463 return outputContainer ;
3467 //_______________________
3468 void AliAnaPhoton::Init()
3473 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
3475 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
3478 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
3480 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
3484 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
3488 //____________________________________________________________________________
3489 void AliAnaPhoton::InitParameters()
3492 //Initialize the parameters of the analysis.
3493 AddToHistogramsName("AnaPhoton_");
3495 fCalorimeter = "EMCAL" ;
3500 fTimeCutMin =-1000000;
3501 fTimeCutMax = 1000000;
3504 fRejectTrackMatch = kTRUE ;
3508 //__________________________________________________________________
3509 void AliAnaPhoton::MakeAnalysisFillAOD()
3511 //Do photon analysis and fill aods
3514 Double_t v[3] = {0,0,0}; //vertex ;
3515 GetReader()->GetVertex(v);
3517 //Select the Calorimeter of the photon
3518 TObjArray * pl = 0x0;
3519 AliVCaloCells* cells = 0;
3520 if (fCalorimeter == "PHOS" )
3522 pl = GetPHOSClusters();
3523 cells = GetPHOSCells();
3525 else if (fCalorimeter == "EMCAL")
3527 pl = GetEMCALClusters();
3528 cells = GetEMCALCells();
3533 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
3537 FillPileUpHistogramsPerEvent();
3539 // Loop on raw clusters before filtering in the reader and fill control histogram
3540 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
3542 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
3544 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
3545 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
3546 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
3551 TClonesArray * clusterList = 0;
3553 if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
3554 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
3555 else if(GetReader()->GetOutputEvent())
3556 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
3560 Int_t nclusters = clusterList->GetEntriesFast();
3561 for (Int_t iclus = 0; iclus < nclusters; iclus++)
3563 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
3564 if(clus)fhClusterCuts[0]->Fill(clus->E());
3569 // Fill some trigger related histograms
3570 Int_t idTrig = GetReader()->GetTriggerClusterIndex();
3571 Bool_t exotic = GetReader()->IsExoticEvent();
3572 Bool_t bad = GetReader()->IsBadCellTriggerEvent();
3574 if( fFillEMCALBCHistograms && fCalorimeter=="EMCAL" &&
3575 ( bad || exotic ) && idTrig >= 0)
3577 // printf("Index %d, Id %d, bad %d, exo %d\n",
3578 // GetReader()->GetTriggerClusterIndex(),
3579 // GetReader()->GetTriggerClusterId(),
3580 // GetReader()->IsBadCellTriggerEvent(),
3581 // GetReader()->IsExoticEvent() );
3583 TClonesArray * clusterList = 0;
3584 TString clusterListName = GetReader()->GetEMCALClusterListName();
3585 if (GetReader()->GetInputEvent()->FindListObject(clusterListName))
3586 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent() ->FindListObject(clusterListName));
3587 else if(GetReader()->GetOutputEvent())
3588 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(clusterListName));
3590 AliVCluster * badClusTrig = 0;
3591 if(clusterList) badClusTrig = (AliVCluster*) clusterList->At(idTrig);
3592 else badClusTrig = GetReader()->GetInputEvent()->GetCaloCluster(idTrig);
3595 printf("AliAnaPhoton::MakeAnalysisFillAOD() - No cluster (bad-exotic trigger) found with requested index %d \n",idTrig);
3598 TLorentzVector momBadClus;
3600 badClusTrig->GetMomentum(momBadClus,GetVertex(0));
3602 Float_t etaclusterBad = momBadClus.Eta();
3603 Float_t phiclusterBad = momBadClus.Phi();
3604 if( phiclusterBad < 0 ) phiclusterBad+=TMath::TwoPi();
3605 Float_t tofclusterBad = badClusTrig->GetTOF()*1.e9;
3606 Float_t eclusterBad = badClusTrig->E();
3610 if(GetReader()->IsTriggerMatched())
3612 fhEtaPhiTriggerEMCALBCBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
3613 fhTimeTriggerEMCALBCBadExoticCluster ->Fill(eclusterBad, tofclusterBad);
3617 fhEtaPhiTriggerEMCALBCUMBadExoticCluster->Fill(etaclusterBad, phiclusterBad);
3618 fhTimeTriggerEMCALBCUMBadExoticCluster ->Fill(eclusterBad, tofclusterBad);
3621 else if( bad && !exotic )
3623 if(GetReader()->IsTriggerMatched())
3625 fhEtaPhiTriggerEMCALBCBadCluster->Fill(etaclusterBad, phiclusterBad);
3626 fhTimeTriggerEMCALBCBadCluster ->Fill(eclusterBad, tofclusterBad);
3630 fhEtaPhiTriggerEMCALBCUMBadCluster->Fill(etaclusterBad, phiclusterBad);
3631 fhTimeTriggerEMCALBCUMBadCluster ->Fill(eclusterBad, tofclusterBad);
3633 }// Bad cluster trigger
3634 else if( !bad && exotic )
3636 if(GetReader()->IsTriggerMatched())
3638 fhEtaPhiTriggerEMCALBCExoticCluster->Fill(etaclusterBad, phiclusterBad);
3639 fhTimeTriggerEMCALBCExoticCluster ->Fill(eclusterBad, tofclusterBad);
3643 fhEtaPhiTriggerEMCALBCUMExoticCluster->Fill(etaclusterBad, phiclusterBad);
3644 fhTimeTriggerEMCALBCUMExoticCluster ->Fill(eclusterBad, tofclusterBad);
3648 } // study bad/exotic trigger BC
3650 //Init arrays, variables, get number of clusters
3651 TLorentzVector mom, mom2 ;
3652 Int_t nCaloClusters = pl->GetEntriesFast();
3654 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
3656 //----------------------------------------------------
3657 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
3658 //----------------------------------------------------
3660 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
3662 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
3663 //printf("calo %d, %f\n",icalo,calo->E());
3665 //Get the index where the cluster comes, to retrieve the corresponding vertex
3666 Int_t evtIndex = 0 ;
3667 if (GetMixedEvent())
3669 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
3670 //Get the vertex and check it is not too large in z
3671 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
3674 //Cluster selection, not charged, with photon id and in fiducial cut
3675 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
3677 calo->GetMomentum(mom,GetVertex(evtIndex)) ;
3678 }//Assume that come from vertex in straight line
3681 Double_t vertex[]={0,0,0};
3682 calo->GetMomentum(mom,vertex) ;
3685 //--------------------------------------
3686 // Cluster selection
3687 //--------------------------------------
3688 Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
3689 if(!ClusterSelected(calo,mom,nMaxima)) continue;
3691 //----------------------------
3692 //Create AOD for analysis
3693 //----------------------------
3694 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
3696 //...............................................
3697 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
3698 Int_t label = calo->GetLabel();
3699 aodph.SetLabel(label);
3700 aodph.SetCaloLabel(calo->GetID(),-1);
3701 aodph.SetDetector(fCalorimeter);
3702 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
3704 //...............................................
3705 //Set bad channel distance bit
3706 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
3707 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
3708 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
3709 else aodph.SetDistToBad(0) ;
3710 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
3712 //--------------------------------------------------------------------------------------
3713 // Play with the MC stack if available
3714 //--------------------------------------------------------------------------------------
3716 //Check origin of the candidates
3721 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
3725 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
3726 }//Work with stack also
3729 //--------------------------------------------------------------------------------------
3730 //Fill some shower shape histograms before PID is applied
3731 //--------------------------------------------------------------------------------------
3733 FillShowerShapeHistograms(calo,tag);
3735 //-------------------------------------
3736 //PID selection or bit setting
3737 //-------------------------------------
3739 //...............................................
3740 // Data, PID check on
3743 // Get most probable PID, 2 options check bayesian PID weights or redo PID
3744 // By default, redo PID
3746 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
3748 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
3750 //If cluster does not pass pid, not photon, skip it.
3751 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
3755 //...............................................
3756 // Data, PID check off
3759 //Set PID bits for later selection (AliAnaPi0 for example)
3760 //GetIdentifiedParticleType already called in SetPIDBits.
3762 GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
3764 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
3767 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
3768 aodph.Pt(), aodph.GetIdentifiedParticleType());
3770 fhClusterCuts[9]->Fill(calo->E());
3772 fhNLocMax->Fill(calo->E(),nMaxima);
3774 // Matching after cuts
3775 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
3777 // Fill histograms to undertand pile-up before other cuts applied
3778 // Remember to relax time cuts in the reader
3779 FillPileUpHistograms(calo->E(),mom.Pt(),calo->GetTOF()*1e9);
3781 // Add number of local maxima to AOD, method name in AOD to be FIXED
3782 aodph.SetFiducialArea(nMaxima);
3784 if(fFillEMCALBCHistograms && fCalorimeter=="EMCAL" && idTrig >= 0)
3786 Double_t calotof = calo->GetTOF()*1e9;
3787 Float_t calotofUS = TMath::Abs(calotof);
3788 Float_t phicluster = aodph.Phi();
3789 if(phicluster < 0) phicluster+=TMath::TwoPi();
3793 if (calotofUS < 25) fhEtaPhiPhotonEMCALBC0->Fill(aodph.Eta(), phicluster);
3794 else if (calotofUS < 75) fhEtaPhiPhotonEMCALBC1->Fill(aodph.Eta(), phicluster);
3795 else fhEtaPhiPhotonEMCALBCN->Fill(aodph.Eta(), phicluster);
3798 Int_t bc = GetReader()->GetTriggerClusterBC();
3799 if(TMath::Abs(bc) < 6 && !GetReader()->IsBadCellTriggerEvent() && !GetReader()->IsExoticEvent())
3801 if(GetReader()->IsTriggerMatched())
3803 if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBC[bc+5]->Fill(aodph.Eta(), phicluster);
3804 fhTimePhotonTriggerEMCALBC[bc+5]->Fill(calo->E(), calotof);
3805 if(GetReader()->IsPileUpFromSPD()) fhTimePhotonTriggerEMCALBCPileUpSPD[bc+5]->Fill(calo->E(), calotof);
3809 if(calo->E() > 2) fhEtaPhiPhotonTriggerEMCALBCUM[bc+5]->Fill(aodph.Eta(), phicluster);
3810 fhTimePhotonTriggerEMCALBCUM[bc+5]->Fill(calo->E(), calotof);
3814 if(GetReader()->IsTriggerMatchedOpenCuts(0)) fhTimePhotonTriggerEMCALBC0UMReMatchOpenTime ->Fill(calo->E(), calotof);
3815 if(GetReader()->IsTriggerMatchedOpenCuts(1)) fhTimePhotonTriggerEMCALBC0UMReMatchCheckNeigh ->Fill(calo->E(), calotof);
3816 if(GetReader()->IsTriggerMatchedOpenCuts(2)) fhTimePhotonTriggerEMCALBC0UMReMatchBoth ->Fill(calo->E(), calotof);
3820 else if(TMath::Abs(bc) >= 6)
3821 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Trigger BC not expected = %d\n",bc);
3824 //Add AOD with photon object to aod branch
3825 AddAODParticle(aodph);
3829 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
3833 //__________________________________________________________________
3834 void AliAnaPhoton::MakeAnalysisFillHistograms()
3839 Double_t v[3] = {0,0,0}; //vertex ;
3840 GetReader()->GetVertex(v);
3841 //fhVertex->Fill(v[0],v[1],v[2]);
3842 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
3844 //----------------------------------
3845 //Loop on stored AOD photons
3846 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
3847 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
3849 Float_t cen = GetEventCentrality();
3850 // printf("++++++++++ GetEventCentrality() %f\n",cen);
3852 Float_t ep = GetEventPlaneAngle();
3854 for(Int_t iaod = 0; iaod < naod ; iaod++)
3856 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
3857 Int_t pdg = ph->GetIdentifiedParticleType();
3860 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
3861 ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
3863 //If PID used, fill histos with photons in Calorimeter fCalorimeter
3864 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
3865 if(ph->GetDetector() != fCalorimeter) continue;
3868 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
3870 //................................
3871 //Fill photon histograms
3872 Float_t ptcluster = ph->Pt();
3873 Float_t phicluster = ph->Phi();
3874 Float_t etacluster = ph->Eta();
3875 Float_t ecluster = ph->E();
3877 fhEPhoton ->Fill(ecluster);
3878 fhPtPhoton ->Fill(ptcluster);
3879 fhPhiPhoton ->Fill(ptcluster,phicluster);
3880 fhEtaPhoton ->Fill(ptcluster,etacluster);
3881 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
3882 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
3884 fhPtCentralityPhoton ->Fill(ptcluster,cen) ;
3885 fhPtEventPlanePhoton ->Fill(ptcluster,ep ) ;
3887 //Get original cluster, to recover some information
3889 Float_t maxCellFraction = 0;
3890 AliVCaloCells* cells = 0;
3891 TObjArray * clusters = 0;
3892 if(fCalorimeter == "EMCAL")
3894 cells = GetEMCALCells();
3895 clusters = GetEMCALClusters();
3899 cells = GetPHOSCells();
3900 clusters = GetPHOSClusters();
3904 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
3907 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
3909 // Control histograms
3910 fhMaxCellDiffClusterE->Fill(ph->E() ,maxCellFraction);
3911 fhNCellsE ->Fill(ph->E() ,cluster->GetNCells());
3912 fhTimePt ->Fill(ph->Pt(),cluster->GetTOF()*1.e9);
3915 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
3916 fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
3920 //.......................................
3921 //Play with the MC data if available
3926 if(GetReader()->ReadStack() && !GetMCStack())
3928 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called?\n");
3930 else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles())
3932 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
3936 FillAcceptanceHistograms();
3938 //....................................................................
3939 // Access MC information in stack if requested, check that it exists.
3940 Int_t label =ph->GetLabel();
3944 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
3951 TLorentzVector primary = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
3954 eprim = primary.Energy();
3955 ptprim = primary.Pt();
3958 Int_t tag =ph->GetTag();
3959 Int_t mcParticleTag = -1;
3960 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
3962 fhMCE [kmcPhoton] ->Fill(ecluster);
3963 fhMCPt [kmcPhoton] ->Fill(ptcluster);
3964 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
3965 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
3967 fhMC2E [kmcPhoton] ->Fill(ecluster, eprim);
3968 fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim);
3969 fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
3970 fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
3972 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
3973 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
3974 fhMCE[kmcConversion])
3976 fhMCE [kmcConversion] ->Fill(ecluster);
3977 fhMCPt [kmcConversion] ->Fill(ptcluster);
3978 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
3979 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
3981 fhMC2E [kmcConversion] ->Fill(ecluster, eprim);
3982 fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim);
3983 fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
3984 fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
3987 if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
3989 mcParticleTag = kmcPrompt;
3991 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
3993 mcParticleTag = kmcFragmentation;
3995 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
3997 mcParticleTag = kmcISR;
3999 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
4000 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
4002 mcParticleTag = kmcPi0Decay;
4004 else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
4005 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) ||
4006 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
4008 mcParticleTag = kmcOtherDecay;
4010 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
4012 mcParticleTag = kmcPi0;
4014 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
4016 mcParticleTag = kmcEta;
4019 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
4021 mcParticleTag = kmcAntiNeutron;
4023 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
4025 mcParticleTag = kmcAntiProton;
4027 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
4029 mcParticleTag = kmcElectron;
4031 else if( fhMCE[kmcOther])
4033 mcParticleTag = kmcOther;
4035 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
4036 // ph->GetLabel(),ph->Pt());
4037 // for(Int_t i = 0; i < 20; i++) {
4038 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
4044 fhMCE [mcParticleTag] ->Fill(ecluster);
4045 fhMCPt [mcParticleTag] ->Fill(ptcluster);
4046 fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
4047 fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
4049 fhMC2E[mcParticleTag] ->Fill(ecluster, eprim);
4050 fhMC2Pt[mcParticleTag] ->Fill(ptcluster, ptprim);
4051 fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
4052 fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
4054 }//Histograms with MC
4061 //__________________________________________________________________
4062 void AliAnaPhoton::Print(const Option_t * opt) const
4064 //Print some relevant parameters set for the analysis
4069 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
4070 AliAnaCaloTrackCorrBaseClass::Print(" ");
4072 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
4073 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
4074 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
4075 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
4076 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
4077 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
4078 printf("Number of cells in cluster is > %d \n", fNCellsCut);