1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //_________________________________________________________________________
18 // Class for the photon identification.
19 // Clusters from calorimeters are identified as photons
20 // and kept in the AOD. Few histograms produced.
21 // Produces input for other analysis classes like AliAnaPi0,
22 // AliAnaParticleHadronCorrelation ...
24 // -- Author: Gustavo Conesa (LNF-INFN)
25 //////////////////////////////////////////////////////////////////////////////
28 // --- ROOT system ---
31 #include <TClonesArray.h>
32 #include <TObjString.h>
33 #include "TParticle.h"
34 #include "TDatabasePDG.h"
36 // --- Analysis system ---
37 #include "AliAnaPhoton.h"
38 #include "AliCaloTrackReader.h"
40 #include "AliCaloPID.h"
41 #include "AliMCAnalysisUtils.h"
42 #include "AliFiducialCut.h"
43 #include "AliVCluster.h"
44 #include "AliAODMCParticle.h"
45 #include "AliMixedEvent.h"
46 #include "AliAODEvent.h"
47 #include "AliESDEvent.h"
50 #include "AliPHOSGeoUtils.h"
51 #include "AliEMCALGeometry.h"
53 ClassImp(AliAnaPhoton)
55 //____________________________
56 AliAnaPhoton::AliAnaPhoton() :
57 AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
58 fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
59 fRejectTrackMatch(0), fFillTMHisto(kFALSE),
60 fTimeCutMin(-10000), fTimeCutMax(10000),
62 fNLMCutMin(-1), fNLMCutMax(10),
63 fFillSSHistograms(kFALSE), fFillOnlySimpleSSHisto(1),
64 fNOriginHistograms(8), fNPrimaryHistograms(4),
65 fFillPileUpHistograms(0),
67 fhNCellsE(0), fhCellsE(0), // Control histograms
68 fhMaxCellDiffClusterE(0), fhTimeE(0), // Control histograms
69 fhEPhoton(0), fhPtPhoton(0),
70 fhPhiPhoton(0), fhEtaPhoton(0),
71 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
72 fhPtCentralityPhoton(0), fhPtEventPlanePhoton(0),
74 // Shower shape histograms
76 fhDispE(0), fhLam0E(0), fhLam1E(0),
77 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
78 fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
79 fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam1ETMTRD(0),
81 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
82 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
84 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
85 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
86 fhLam0DispLowE(0), fhLam0DispHighE(0),
87 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
88 fhDispLam1LowE(0), fhDispLam1HighE(0),
89 fhDispEtaE(0), fhDispPhiE(0),
90 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
91 fhDispEtaPhiDiffE(0), fhSphericityE(0),
92 fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
95 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
97 fhEmbeddedSignalFractionEnergy(0),
98 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
99 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
100 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
101 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
103 fhTimeENoCut(0), fhTimeESPD(0), fhTimeESPDMulti(0),
104 fhTimeNPileUpVertSPD(0), fhTimeNPileUpVertTrack(0),
105 fhTimeNPileUpVertContributors(0),
106 fhTimePileUpMainVertexZDistance(0), fhTimePileUpMainVertexZDiamond(0),
107 fhClusterMultSPDPileUp(), fhClusterMultNoPileUp(),
108 fhEtaPhiBC0(0), fhEtaPhiBCPlus(0), fhEtaPhiBCMinus(0),
109 fhEtaPhiBC0PileUpSPD(0),
110 fhEtaPhiBCPlusPileUpSPD(0),
111 fhEtaPhiBCMinusPileUpSPD(0)
115 for(Int_t i = 0; i < 14; i++)
127 for(Int_t i = 0; i < 7; i++)
134 fhPtPrimMCAcc [i] = 0;
135 fhEPrimMCAcc [i] = 0;
136 fhPhiPrimMCAcc[i] = 0;
137 fhYPrimMCAcc [i] = 0;
139 fhDispEtaDispPhi[i] = 0;
140 fhLambda0DispPhi[i] = 0;
141 fhLambda0DispEta[i] = 0;
144 fhPtChargedPileUp[i] = 0;
145 fhPtPhotonPileUp [i] = 0;
147 fhLambda0PileUp [i] = 0;
148 fhLambda0ChargedPileUp[i] = 0;
150 fhClusterEFracLongTimePileUp [i] = 0;
152 fhClusterTimeDiffPileUp [i] = 0;
153 fhClusterTimeDiffChargedPileUp[i] = 0;
154 fhClusterTimeDiffPhotonPileUp [i] = 0;
156 for(Int_t j = 0; j < 6; j++)
158 fhMCDispEtaDispPhi[i][j] = 0;
159 fhMCLambda0DispEta[i][j] = 0;
160 fhMCLambda0DispPhi[i][j] = 0;
164 for(Int_t i = 0; i < 6; i++)
166 fhMCELambda0 [i] = 0;
167 fhMCELambda1 [i] = 0;
168 fhMCEDispersion [i] = 0;
170 fhMCMaxCellDiffClusterE[i] = 0;
171 fhLambda0DispEta[i] = 0;
172 fhLambda0DispPhi[i] = 0;
174 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
175 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
176 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
177 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
178 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
179 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
181 fhMCEDispEta [i] = 0;
182 fhMCEDispPhi [i] = 0;
183 fhMCESumEtaPhi [i] = 0;
184 fhMCEDispEtaPhiDiff[i] = 0;
185 fhMCESphericity [i] = 0;
188 for(Int_t i = 0; i < 5; i++)
190 fhClusterCuts[i] = 0;
193 // Track matching residuals
194 for(Int_t i = 0; i < 2; i++)
196 fhTrackMatchedDEta[i] = 0; fhTrackMatchedDPhi[i] = 0; fhTrackMatchedDEtaDPhi[i] = 0;
197 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
198 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
199 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
200 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
201 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
202 fhdEdx[i] = 0; fhEOverP[i] = 0;
206 for(Int_t i = 0; i < 4; i++)
208 fhClusterMultSPDPileUp[i] = 0;
209 fhClusterMultNoPileUp [i] = 0;
212 //Initialize parameters
217 //_____________________________________________________________________________________________________
218 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom, Int_t nMaxima)
220 //Select clusters if they pass different cuts
222 Float_t ptcluster = mom.Pt();
223 Float_t ecluster = mom.E();
224 Float_t l0cluster = calo->GetM02();
227 printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
228 GetReader()->GetEventNumber(),
229 ecluster,ptcluster, mom.Phi()*TMath::RadToDeg(),mom.Eta());
231 fhClusterCuts[1]->Fill(ecluster);
233 //.......................................
234 //If too small or big energy, skip it
235 if(ecluster < GetMinEnergy() || ecluster > GetMaxEnergy() ) return kFALSE ;
237 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
239 fhClusterCuts[2]->Fill(ecluster);
241 if(fFillPileUpHistograms)
243 // Get the fraction of the cluster energy that carries the cell with highest energy and its absId
244 AliVCaloCells* cells = 0;
245 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
246 else cells = GetPHOSCells();
248 Float_t maxCellFraction = 0.;
249 Int_t absIdMax = GetCaloUtils()->GetMaxEnergyCell(cells, calo,maxCellFraction);
251 Double_t tmax = cells->GetCellTime(absIdMax);
252 GetCaloUtils()->RecalibrateCellTime(tmax, fCalorimeter, absIdMax,GetReader()->GetInputEvent()->GetBunchCrossNumber());
255 Bool_t okPhoton = kFALSE;
256 if( GetCaloPID()->GetIdentifiedParticleType(calo)== AliCaloPID::kPhoton) okPhoton = kTRUE;
258 Bool_t matched = IsTrackMatched(calo,GetReader()->GetInputEvent());
259 Float_t clusterLongTimeE = 0;
260 Float_t clusterOKTimeE = 0;
261 //Loop on cells inside cluster
262 for (Int_t ipos = 0; ipos < calo->GetNCells(); ipos++)
264 Int_t absId = calo->GetCellsAbsId()[ipos];
265 //if(absId!=absIdMax && cells->GetCellAmplitude(absIdMax) > 0.01)
266 if(cells->GetCellAmplitude(absIdMax) > 0.1)
268 Double_t time = cells->GetCellTime(absId);
269 Float_t amp = cells->GetCellAmplitude(absId);
270 Int_t bc = GetReader()->GetInputEvent()->GetBunchCrossNumber();
271 GetCaloUtils()->GetEMCALRecoUtils()->AcceptCalibrateCell(absId,bc,amp,time,cells);
274 Float_t diff = (tmax-time);
276 if(GetReader()->IsInTimeWindow(time,amp)) clusterOKTimeE += amp;
277 else clusterLongTimeE += amp;
279 if(GetReader()->IsPileUpFromSPD())
281 fhClusterTimeDiffPileUp[0]->Fill(ecluster, diff);
284 fhClusterTimeDiffChargedPileUp[0]->Fill(ecluster, diff);
285 if(okPhoton) fhClusterTimeDiffPhotonPileUp[0]->Fill(ecluster, diff);
289 if(GetReader()->IsPileUpFromEMCal())
291 fhClusterTimeDiffPileUp[1]->Fill(ecluster, diff);
294 fhClusterTimeDiffChargedPileUp[1]->Fill(ecluster, diff);
295 if(okPhoton) fhClusterTimeDiffPhotonPileUp[1]->Fill(ecluster, diff);
299 if(GetReader()->IsPileUpFromSPDOrEMCal())
301 fhClusterTimeDiffPileUp[2]->Fill(ecluster, diff);
304 fhClusterTimeDiffChargedPileUp[2]->Fill(ecluster, diff);
305 if(okPhoton) fhClusterTimeDiffPhotonPileUp[2]->Fill(ecluster, diff);
309 if(GetReader()->IsPileUpFromSPDAndEMCal())
311 fhClusterTimeDiffPileUp[3]->Fill(ecluster, diff);
314 fhClusterTimeDiffChargedPileUp[3]->Fill(ecluster, diff);
315 if(okPhoton) fhClusterTimeDiffPhotonPileUp[3]->Fill(ecluster, diff);
319 if(GetReader()->IsPileUpFromSPDAndNotEMCal())
321 fhClusterTimeDiffPileUp[4]->Fill(ecluster, diff);
324 fhClusterTimeDiffChargedPileUp[4]->Fill(ecluster, diff);
325 if(okPhoton) fhClusterTimeDiffPhotonPileUp[4]->Fill(ecluster, diff);
329 if(GetReader()->IsPileUpFromEMCalAndNotSPD())
331 fhClusterTimeDiffPileUp[5]->Fill(ecluster, diff);
334 fhClusterTimeDiffChargedPileUp[5]->Fill(ecluster, diff);
335 if(okPhoton) fhClusterTimeDiffPhotonPileUp[5]->Fill(ecluster, diff);
339 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal())
341 fhClusterTimeDiffPileUp[6]->Fill(ecluster, diff);
344 fhClusterTimeDiffChargedPileUp[6]->Fill(ecluster, diff);
345 if(okPhoton) fhClusterTimeDiffPhotonPileUp[6]->Fill(ecluster, diff);
352 if(clusterLongTimeE+clusterOKTimeE > 0.001)
353 frac = clusterLongTimeE/(clusterLongTimeE+clusterOKTimeE);
354 //printf("E long %f, E OK %f, Fraction large time %f, E %f\n",clusterLongTimeE,clusterOKTimeE,frac,ecluster);
356 if(GetReader()->IsPileUpFromSPD()) {fhPtPileUp[0]->Fill(ptcluster); fhLambda0PileUp[0]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[0]->Fill(ecluster,frac);}
357 if(GetReader()->IsPileUpFromEMCal()) {fhPtPileUp[1]->Fill(ptcluster); fhLambda0PileUp[1]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[1]->Fill(ecluster,frac);}
358 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtPileUp[2]->Fill(ptcluster); fhLambda0PileUp[2]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[2]->Fill(ecluster,frac);}
359 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtPileUp[3]->Fill(ptcluster); fhLambda0PileUp[3]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[3]->Fill(ecluster,frac);}
360 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtPileUp[4]->Fill(ptcluster); fhLambda0PileUp[4]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[4]->Fill(ecluster,frac);}
361 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtPileUp[5]->Fill(ptcluster); fhLambda0PileUp[5]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[5]->Fill(ecluster,frac);}
362 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtPileUp[6]->Fill(ptcluster); fhLambda0PileUp[6]->Fill(ecluster,l0cluster); fhClusterEFracLongTimePileUp[6]->Fill(ecluster,frac);}
364 if(tmax > -25 && tmax < 25) {fhEtaPhiBC0 ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBC0PileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
365 else if (tmax > 25) {fhEtaPhiBCPlus ->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCPlusPileUpSPD ->Fill(mom.Eta(),mom.Phi()); }
366 else if (tmax <-25) {fhEtaPhiBCMinus->Fill(mom.Eta(),mom.Phi()); if(GetReader()->IsPileUpFromSPD()) fhEtaPhiBCMinusPileUpSPD->Fill(mom.Eta(),mom.Phi()); }
369 //.......................................
370 // TOF cut, BE CAREFUL WITH THIS CUT
371 Double_t tof = calo->GetTOF()*1e9;
372 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
374 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
376 fhClusterCuts[3]->Fill(ecluster);
378 //.......................................
379 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
381 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
383 fhClusterCuts[4]->Fill(ecluster);
385 if(nMaxima < fNLMCutMin || nMaxima > fNLMCutMax) return kFALSE ;
386 if(GetDebug() > 2) printf(" \t Cluster %d pass NLM %d of out of range \n",calo->GetID(), nMaxima);
388 fhClusterCuts[5]->Fill(ecluster);
390 //.......................................
391 //Check acceptance selection
392 if(IsFiducialCutOn())
394 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
395 if(! in ) return kFALSE ;
398 if(GetDebug() > 2) printf("Fiducial cut passed \n");
400 fhClusterCuts[6]->Fill(ecluster);
402 //.......................................
403 //Skip matched clusters with tracks
405 // Fill matching residual histograms before PID cuts
406 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
408 if(fRejectTrackMatch)
410 if(IsTrackMatched(calo,GetReader()->GetInputEvent()))
412 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
416 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
417 }// reject matched clusters
419 fhClusterCuts[7]->Fill(ecluster);
421 if(fFillPileUpHistograms)
423 if(GetReader()->IsPileUpFromSPD()) {fhPtChargedPileUp[0]->Fill(ptcluster); fhLambda0ChargedPileUp[0]->Fill(ecluster,l0cluster); }
424 if(GetReader()->IsPileUpFromEMCal()) {fhPtChargedPileUp[1]->Fill(ptcluster); fhLambda0ChargedPileUp[1]->Fill(ecluster,l0cluster); }
425 if(GetReader()->IsPileUpFromSPDOrEMCal()) {fhPtChargedPileUp[2]->Fill(ptcluster); fhLambda0ChargedPileUp[2]->Fill(ecluster,l0cluster); }
426 if(GetReader()->IsPileUpFromSPDAndEMCal()) {fhPtChargedPileUp[3]->Fill(ptcluster); fhLambda0ChargedPileUp[3]->Fill(ecluster,l0cluster); }
427 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) {fhPtChargedPileUp[4]->Fill(ptcluster); fhLambda0ChargedPileUp[4]->Fill(ecluster,l0cluster); }
428 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) {fhPtChargedPileUp[5]->Fill(ptcluster); fhLambda0ChargedPileUp[5]->Fill(ecluster,l0cluster); }
429 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) {fhPtChargedPileUp[6]->Fill(ptcluster); fhLambda0ChargedPileUp[6]->Fill(ecluster,l0cluster); }
432 //.......................................
433 //Check Distance to Bad channel, set bit.
434 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
435 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
436 if(distBad < fMinDist)
437 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
440 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
442 fhClusterCuts[8]->Fill(ecluster);
445 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, phi %2.2f, eta %2.2f\n",
446 GetReader()->GetEventNumber(),
447 ecluster, ptcluster,mom.Phi()*TMath::RadToDeg(),mom.Eta());
449 //All checks passed, cluster selected
454 //___________________________________________
455 void AliAnaPhoton::FillAcceptanceHistograms()
457 //Fill acceptance histograms if MC data is available
459 Double_t photonY = -100 ;
460 Double_t photonE = -1 ;
461 Double_t photonPt = -1 ;
462 Double_t photonPhi = 100 ;
463 Double_t photonEta = -1 ;
468 Bool_t inacceptance = kFALSE;
470 if(GetReader()->ReadStack())
472 AliStack * stack = GetMCStack();
475 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
477 TParticle * prim = stack->Particle(i) ;
478 pdg = prim->GetPdgCode();
479 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
480 // prim->GetName(), prim->GetPdgCode());
484 // Get tag of this particle photon from fragmentation, decay, prompt ...
485 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
486 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
488 //A conversion photon from a hadron, skip this kind of photon
489 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
490 // GetMCAnalysisUtils()->PrintMCTag(tag);
495 //Get photon kinematics
496 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
498 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
499 photonE = prim->Energy() ;
500 photonPt = prim->Pt() ;
501 photonPhi = TMath::RadToDeg()*prim->Phi() ;
502 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
503 photonEta = prim->Eta() ;
505 //Check if photons hit the Calorimeter
508 inacceptance = kFALSE;
509 if (fCalorimeter == "PHOS")
511 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
515 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
516 inacceptance = kTRUE;
517 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
521 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
522 inacceptance = kTRUE ;
523 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
526 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
528 if(GetEMCALGeometry())
532 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
535 inacceptance = kTRUE;
537 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
538 // inacceptance = kTRUE;
539 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
543 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
544 inacceptance = kTRUE ;
545 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
550 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
551 if(TMath::Abs(photonY) < 1.0)
553 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
554 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
555 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
556 fhYPrimMC [kmcPPhoton]->Fill(photonE , photonEta) ;
560 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
561 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
562 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
563 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
567 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
569 mcIndex = kmcPPrompt;
571 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
573 mcIndex = kmcPFragmentation ;
575 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
579 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
581 mcIndex = kmcPPi0Decay;
583 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
584 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
586 mcIndex = kmcPOtherDecay;
588 else if(fhEPrimMC[kmcPOther])
593 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
594 if(TMath::Abs(photonY) < 1.0)
596 fhEPrimMC [mcIndex]->Fill(photonE ) ;
597 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
598 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
599 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
603 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
604 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
605 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
606 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
611 }//stack exists and data is MC
613 else if(GetReader()->ReadAODMCParticles())
615 TClonesArray * mcparticles = GetReader()->GetAODMCParticles();
618 Int_t nprim = mcparticles->GetEntriesFast();
620 for(Int_t i=0; i < nprim; i++)
622 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
624 pdg = prim->GetPdgCode();
628 // Get tag of this particle photon from fragmentation, decay, prompt ...
629 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader());
630 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
632 //A conversion photon from a hadron, skip this kind of photon
633 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
634 // GetMCAnalysisUtils()->PrintMCTag(tag);
639 //Get photon kinematics
640 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
642 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
643 photonE = prim->E() ;
644 photonPt = prim->Pt() ;
645 photonPhi = prim->Phi() ;
646 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
647 photonEta = prim->Eta() ;
649 //Check if photons hit the Calorimeter
651 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
652 inacceptance = kFALSE;
653 if (fCalorimeter == "PHOS")
655 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
659 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
660 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
661 inacceptance = kTRUE;
662 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
666 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
667 inacceptance = kTRUE ;
668 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
671 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
673 if(GetEMCALGeometry())
677 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
680 inacceptance = kTRUE;
682 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
686 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
687 inacceptance = kTRUE ;
688 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
694 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
695 if(TMath::Abs(photonY) < 1.0)
697 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
698 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
699 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
700 fhYPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
705 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
706 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
707 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
708 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
712 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
714 mcIndex = kmcPPrompt;
716 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
718 mcIndex = kmcPFragmentation ;
720 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
724 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
726 mcIndex = kmcPPi0Decay;
728 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
729 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
731 mcIndex = kmcPOtherDecay;
733 else if(fhEPrimMC[kmcPOther])
738 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
739 if(TMath::Abs(photonY) < 1.0)
741 fhEPrimMC [mcIndex]->Fill(photonE ) ;
742 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
743 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
744 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
748 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
749 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
750 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
751 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
757 }//kmc array exists and data is MC
761 //___________________________________________________________________
762 void AliAnaPhoton::FillPileUpHistogramsPerEvent(TObjArray * clusters)
764 // Fill some histograms per event to understand pile-up
765 // Open the time cut in the reader to be more meaningful
767 if(!fFillPileUpHistograms) return;
769 // Loop on clusters, get the maximum energy cluster as reference
770 Int_t nclusters = clusters->GetEntriesFast();
774 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
776 AliVCluster * clus = (AliVCluster*) (clusters->At(iclus));
777 if(clus->E() > eMax && TMath::Abs(clus->GetTOF()*1e9) < 20)
780 tMax = clus->GetTOF()*1e9;
787 // Loop again on clusters to compare this max cluster t and the rest of the clusters, if E > 0.3
793 for(Int_t iclus = 0; iclus < nclusters ; iclus++)
795 AliVCluster * clus = (AliVCluster*) (clusters->At(iclus));
797 if(clus->E() < 0.3 || iclus==idMax) continue;
799 Float_t tdiff = TMath::Abs(tMax-clus->GetTOF()*1e9);
801 if(tdiff < 20) nOK++;
805 if(tdiff > 40 ) n40++;
809 // Check pile-up and fill histograms depending on the different cluster multiplicities
810 if(GetReader()->IsPileUpFromSPD())
812 fhClusterMultSPDPileUp[0]->Fill(eMax,n );
813 fhClusterMultSPDPileUp[1]->Fill(eMax,nOK);
814 fhClusterMultSPDPileUp[2]->Fill(eMax,n20);
815 fhClusterMultSPDPileUp[3]->Fill(eMax,n40);
819 fhClusterMultNoPileUp[0]->Fill(eMax,n );
820 fhClusterMultNoPileUp[1]->Fill(eMax,nOK);
821 fhClusterMultNoPileUp[2]->Fill(eMax,n20);
822 fhClusterMultNoPileUp[3]->Fill(eMax,n40);
828 //_________________________________________________________________________________________________
829 void AliAnaPhoton::FillPileUpHistograms(Float_t energy, Float_t pt, Float_t time)
831 // Fill some histograms to understand pile-up
832 if(!fFillPileUpHistograms) return;
834 //printf("E %f, time %f\n",energy,time);
835 AliVEvent * event = GetReader()->GetInputEvent();
837 if(GetReader()->IsPileUpFromSPD()) fhPtPhotonPileUp[0]->Fill(pt);
838 if(GetReader()->IsPileUpFromEMCal()) fhPtPhotonPileUp[1]->Fill(pt);
839 if(GetReader()->IsPileUpFromSPDOrEMCal()) fhPtPhotonPileUp[2]->Fill(pt);
840 if(GetReader()->IsPileUpFromSPDAndEMCal()) fhPtPhotonPileUp[3]->Fill(pt);
841 if(GetReader()->IsPileUpFromSPDAndNotEMCal()) fhPtPhotonPileUp[4]->Fill(pt);
842 if(GetReader()->IsPileUpFromEMCalAndNotSPD()) fhPtPhotonPileUp[5]->Fill(pt);
843 if(GetReader()->IsPileUpFromNotSPDAndNotEMCal()) fhPtPhotonPileUp[6]->Fill(pt);
845 fhTimeENoCut->Fill(energy,time);
846 if(GetReader()->IsPileUpFromSPD()) fhTimeESPD ->Fill(energy,time);
847 if(event->IsPileupFromSPDInMultBins()) fhTimeESPDMulti->Fill(energy,time);
849 if(energy < 8) return; // Fill time figures for high energy clusters not too close to trigger threshold
851 AliESDEvent* esdEv = dynamic_cast<AliESDEvent*> (event);
852 AliAODEvent* aodEv = dynamic_cast<AliAODEvent*> (event);
854 // N pile up vertices
855 Int_t nVerticesSPD = -1;
856 Int_t nVerticesTracks = -1;
860 nVerticesSPD = esdEv->GetNumberOfPileupVerticesSPD();
861 nVerticesTracks = esdEv->GetNumberOfPileupVerticesTracks();
866 nVerticesSPD = aodEv->GetNumberOfPileupVerticesSPD();
867 nVerticesTracks = aodEv->GetNumberOfPileupVerticesTracks();
870 fhTimeNPileUpVertSPD ->Fill(time,nVerticesSPD);
871 fhTimeNPileUpVertTrack->Fill(time,nVerticesTracks);
873 //printf("Is SPD %d, Is SPD Multi %d, n spd %d, n track %d\n",
874 // GetReader()->IsPileUpFromSPD(),event->IsPileupFromSPDInMultBins(),nVerticesSPD,nVerticesTracks);
877 Float_t z1 = -1, z2 = -1;
879 for(Int_t iVert=0; iVert<nVerticesSPD;iVert++)
883 const AliESDVertex* pv=esdEv->GetPileupVertexSPD(iVert);
884 ncont=pv->GetNContributors();
885 z1 = esdEv->GetPrimaryVertexSPD()->GetZ();
887 diamZ = esdEv->GetDiamondZ();
891 AliAODVertex *pv=aodEv->GetVertex(iVert);
892 if(pv->GetType()!=AliAODVertex::kPileupSPD) continue;
893 ncont=pv->GetNContributors();
894 z1=aodEv->GetPrimaryVertexSPD()->GetZ();
896 diamZ = aodEv->GetDiamondZ();
899 Double_t distZ = TMath::Abs(z2-z1);
900 diamZ = TMath::Abs(z2-diamZ);
902 fhTimeNPileUpVertContributors ->Fill(time,ncont);
903 fhTimePileUpMainVertexZDistance->Fill(time,distZ);
904 fhTimePileUpMainVertexZDiamond ->Fill(time,diamZ);
909 //____________________________________________________________________________________
910 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, Int_t mcTag)
912 //Fill cluster Shower Shape histograms
914 if(!fFillSSHistograms || GetMixedEvent()) return;
916 Float_t energy = cluster->E();
917 Int_t ncells = cluster->GetNCells();
918 Float_t lambda0 = cluster->GetM02();
919 Float_t lambda1 = cluster->GetM20();
920 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
923 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
925 cluster->GetMomentum(mom,GetVertex(0)) ;
926 }//Assume that come from vertex in straight line
929 Double_t vertex[]={0,0,0};
930 cluster->GetMomentum(mom,vertex) ;
933 Float_t eta = mom.Eta();
934 Float_t phi = mom.Phi();
935 if(phi < 0) phi+=TMath::TwoPi();
937 fhLam0E ->Fill(energy,lambda0);
938 fhLam1E ->Fill(energy,lambda1);
939 fhDispE ->Fill(energy,disp);
941 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
943 fhLam0ETRD->Fill(energy,lambda0);
944 fhLam1ETRD->Fill(energy,lambda1);
945 fhDispETRD->Fill(energy,disp);
948 Float_t l0 = 0., l1 = 0.;
949 Float_t dispp= 0., dEta = 0., dPhi = 0.;
950 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
951 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
953 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
954 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
955 //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",
956 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
957 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
958 // disp, dPhi+dEta );
959 fhDispEtaE -> Fill(energy,dEta);
960 fhDispPhiE -> Fill(energy,dPhi);
961 fhSumEtaE -> Fill(energy,sEta);
962 fhSumPhiE -> Fill(energy,sPhi);
963 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
964 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
965 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
966 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
967 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
970 if (energy < 2 ) ebin = 0;
971 else if (energy < 4 ) ebin = 1;
972 else if (energy < 6 ) ebin = 2;
973 else if (energy < 10) ebin = 3;
974 else if (energy < 15) ebin = 4;
975 else if (energy < 20) ebin = 5;
978 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
979 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
980 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
984 // if track-matching was of, check effect of track-matching residual cut
986 if(!fRejectTrackMatch)
988 Float_t dZ = cluster->GetTrackDz();
989 Float_t dR = cluster->GetTrackDx();
990 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
992 dR = 2000., dZ = 2000.;
993 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
996 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
998 fhLam0ETM ->Fill(energy,lambda0);
999 fhLam1ETM ->Fill(energy,lambda1);
1000 fhDispETM ->Fill(energy,disp);
1002 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
1004 fhLam0ETMTRD->Fill(energy,lambda0);
1005 fhLam1ETMTRD->Fill(energy,lambda1);
1006 fhDispETMTRD->Fill(energy,disp);
1009 }// if track-matching was of, check effect of matching residual cut
1012 if(!fFillOnlySimpleSSHisto){
1015 fhNCellsLam0LowE ->Fill(ncells,lambda0);
1016 fhNCellsLam1LowE ->Fill(ncells,lambda1);
1017 fhNCellsDispLowE ->Fill(ncells,disp);
1019 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
1020 fhLam0DispLowE ->Fill(lambda0,disp);
1021 fhDispLam1LowE ->Fill(disp,lambda1);
1022 fhEtaLam0LowE ->Fill(eta,lambda0);
1023 fhPhiLam0LowE ->Fill(phi,lambda0);
1027 fhNCellsLam0HighE ->Fill(ncells,lambda0);
1028 fhNCellsLam1HighE ->Fill(ncells,lambda1);
1029 fhNCellsDispHighE ->Fill(ncells,disp);
1031 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
1032 fhLam0DispHighE ->Fill(lambda0,disp);
1033 fhDispLam1HighE ->Fill(disp,lambda1);
1034 fhEtaLam0HighE ->Fill(eta, lambda0);
1035 fhPhiLam0HighE ->Fill(phi, lambda0);
1041 AliVCaloCells* cells = 0;
1042 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
1043 else cells = GetPHOSCells();
1045 //Fill histograms to check shape of embedded clusters
1046 Float_t fraction = 0;
1047 if(GetReader()->IsEmbeddedClusterSelectionOn())
1048 {//Only working for EMCAL
1049 Float_t clusterE = 0; // recalculate in case corrections applied.
1051 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
1053 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
1055 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
1058 //Fraction of total energy due to the embedded signal
1062 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
1064 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
1066 } // embedded fraction
1068 // Get the fraction of the cluster energy that carries the cell with highest energy
1070 Float_t maxCellFraction = 0.;
1072 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
1074 // Check the origin and fill histograms
1078 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1079 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
1080 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
1081 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
1083 mcIndex = kmcssPhoton ;
1085 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1087 //Check particle overlaps in cluster
1089 // Compare the primary depositing more energy with the rest,
1090 // if no photon/electron as comon ancestor (conversions), count as other particle
1091 Int_t ancPDG = 0, ancStatus = -1;
1092 TLorentzVector momentum; TVector3 prodVertex;
1094 Int_t noverlaps = 1;
1095 for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
1097 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab],
1098 GetReader(),ancPDG,ancStatus,momentum,prodVertex);
1099 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
1101 //printf("N overlaps %d \n",noverlaps);
1105 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
1107 else if(noverlaps == 2)
1109 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
1111 else if(noverlaps > 2)
1113 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
1117 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
1121 //Fill histograms to check shape of embedded clusters
1122 if(GetReader()->IsEmbeddedClusterSelectionOn())
1126 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
1128 else if(fraction > 0.5)
1130 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
1132 else if(fraction > 0.1)
1134 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
1138 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
1142 }//photon no conversion
1143 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
1145 mcIndex = kmcssElectron ;
1147 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
1148 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
1150 mcIndex = kmcssConversion ;
1151 }//conversion photon
1152 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
1154 mcIndex = kmcssPi0 ;
1156 //Fill histograms to check shape of embedded clusters
1157 if(GetReader()->IsEmbeddedClusterSelectionOn())
1161 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
1163 else if(fraction > 0.5)
1165 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
1167 else if(fraction > 0.1)
1169 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
1173 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
1178 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
1180 mcIndex = kmcssEta ;
1184 mcIndex = kmcssOther ;
1187 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
1188 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
1189 fhMCEDispersion [mcIndex]->Fill(energy, disp);
1190 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
1191 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
1193 if(!fFillOnlySimpleSSHisto)
1197 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
1198 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
1200 else if(energy < 6.)
1202 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
1203 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
1207 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
1208 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
1211 if(fCalorimeter == "EMCAL")
1213 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
1214 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
1215 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
1216 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
1217 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
1220 if (energy < 2 ) ebin = 0;
1221 else if (energy < 4 ) ebin = 1;
1222 else if (energy < 6 ) ebin = 2;
1223 else if (energy < 10) ebin = 3;
1224 else if (energy < 15) ebin = 4;
1225 else if (energy < 20) ebin = 5;
1228 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
1229 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
1230 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
1237 //__________________________________________________________________________
1238 void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
1241 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
1242 // Residual filled for different cuts 0 (No cut), after 1 PID cut
1244 Float_t dZ = cluster->GetTrackDz();
1245 Float_t dR = cluster->GetTrackDx();
1247 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
1249 dR = 2000., dZ = 2000.;
1250 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
1253 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
1255 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
1256 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
1258 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
1260 Int_t nSMod = GetModuleNumber(cluster);
1262 if(fCalorimeter=="EMCAL" && nSMod > 5)
1264 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
1265 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
1268 // Check dEdx and E/p of matched clusters
1270 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1273 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
1278 Float_t dEdx = track->GetTPCsignal();
1279 Float_t eOverp = cluster->E()/track->P();
1281 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
1282 fhEOverP[cut]->Fill(cluster->E(), eOverp);
1284 if(fCalorimeter=="EMCAL" && nSMod > 5)
1285 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
1290 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
1297 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader());
1299 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
1301 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1302 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
1303 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
1304 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
1305 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
1307 // Check if several particles contributed to cluster and discard overlapped mesons
1308 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1309 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1311 if(cluster->GetNLabels()==1)
1313 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
1314 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
1318 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
1319 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
1327 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1328 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
1329 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
1330 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1331 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1333 // Check if several particles contributed to cluster
1334 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1335 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1337 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1338 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1346 } // residuals window
1352 //___________________________________________
1353 TObjString * AliAnaPhoton::GetAnalysisCuts()
1355 //Save parameters used for analysis
1356 TString parList ; //this will be list of parameters used for this analysis.
1357 const Int_t buffersize = 255;
1358 char onePar[buffersize] ;
1360 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
1362 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1364 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
1366 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
1368 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
1370 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
1373 //Get parameters set in base class.
1374 parList += GetBaseParametersList() ;
1376 //Get parameters set in PID class.
1377 parList += GetCaloPID()->GetPIDParametersList() ;
1379 //Get parameters set in FiducialCut class (not available yet)
1380 //parlist += GetFidCut()->GetFidCutParametersList()
1382 return new TObjString(parList) ;
1385 //________________________________________________________________________
1386 TList * AliAnaPhoton::GetCreateOutputObjects()
1388 // Create histograms to be saved in output file and
1389 // store them in outputContainer
1390 TList * outputContainer = new TList() ;
1391 outputContainer->SetName("PhotonHistos") ;
1393 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1394 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1395 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1396 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1397 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1398 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1400 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1401 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1402 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1403 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1404 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1405 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1407 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1408 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1409 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1410 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1411 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1412 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1414 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1416 TString cut[] = {"Open","Reader","E","Time","NCells","NLM","Fidutial","Matching","Bad","PID"};
1417 for (Int_t i = 0; i < 10 ; i++)
1419 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1420 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1421 nptbins,ptmin,ptmax);
1422 fhClusterCuts[i]->SetYTitle("dN/dE ");
1423 fhClusterCuts[i]->SetXTitle("E (GeV)");
1424 outputContainer->Add(fhClusterCuts[i]) ;
1427 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1428 fhNCellsE->SetXTitle("E (GeV)");
1429 fhNCellsE->SetYTitle("# of cells in cluster");
1430 outputContainer->Add(fhNCellsE);
1432 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1433 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1434 fhCellsE->SetYTitle("E_{cell} (GeV)");
1435 outputContainer->Add(fhCellsE);
1437 fhTimeE = new TH2F ("hTimeE","time of cluster vs E of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1438 fhTimeE->SetXTitle("E (GeV)");
1439 fhTimeE->SetYTitle("time (ns)");
1440 outputContainer->Add(fhTimeE);
1442 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1443 nptbins,ptmin,ptmax, 500,0,1.);
1444 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1445 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1446 outputContainer->Add(fhMaxCellDiffClusterE);
1448 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1449 fhEPhoton->SetYTitle("N");
1450 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1451 outputContainer->Add(fhEPhoton) ;
1453 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
1454 fhPtPhoton->SetYTitle("N");
1455 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1456 outputContainer->Add(fhPtPhoton) ;
1458 fhPtCentralityPhoton = new TH2F("hPtCentralityPhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,100);
1459 fhPtCentralityPhoton->SetYTitle("Centrality");
1460 fhPtCentralityPhoton->SetXTitle("p_{T}(GeV/c)");
1461 outputContainer->Add(fhPtCentralityPhoton) ;
1463 fhPtEventPlanePhoton = new TH2F("hPtEventPlanePhoton","centrality vs p_{T}",nptbins,ptmin,ptmax, 100,0,TMath::Pi());
1464 fhPtEventPlanePhoton->SetYTitle("Event plane angle (rad)");
1465 fhPtEventPlanePhoton->SetXTitle("p_{T} (GeV/c)");
1466 outputContainer->Add(fhPtEventPlanePhoton) ;
1468 fhPhiPhoton = new TH2F
1469 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1470 fhPhiPhoton->SetYTitle("#phi (rad)");
1471 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1472 outputContainer->Add(fhPhiPhoton) ;
1474 fhEtaPhoton = new TH2F
1475 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1476 fhEtaPhoton->SetYTitle("#eta");
1477 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1478 outputContainer->Add(fhEtaPhoton) ;
1480 fhEtaPhiPhoton = new TH2F
1481 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1482 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1483 fhEtaPhiPhoton->SetXTitle("#eta");
1484 outputContainer->Add(fhEtaPhiPhoton) ;
1485 if(GetMinPt() < 0.5)
1487 fhEtaPhi05Photon = new TH2F
1488 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1489 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1490 fhEtaPhi05Photon->SetXTitle("#eta");
1491 outputContainer->Add(fhEtaPhi05Photon) ;
1495 fhNLocMax = new TH2F("hNLocMax","Number of local maxima in cluster",
1496 nptbins,ptmin,ptmax,10,0,10);
1497 fhNLocMax ->SetYTitle("N maxima");
1498 fhNLocMax ->SetXTitle("E (GeV)");
1499 outputContainer->Add(fhNLocMax) ;
1502 if(fFillSSHistograms)
1504 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1505 fhLam0E->SetYTitle("#lambda_{0}^{2}");
1506 fhLam0E->SetXTitle("E (GeV)");
1507 outputContainer->Add(fhLam0E);
1509 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1510 fhLam1E->SetYTitle("#lambda_{1}^{2}");
1511 fhLam1E->SetXTitle("E (GeV)");
1512 outputContainer->Add(fhLam1E);
1514 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1515 fhDispE->SetYTitle("D^{2}");
1516 fhDispE->SetXTitle("E (GeV) ");
1517 outputContainer->Add(fhDispE);
1519 if(!fRejectTrackMatch)
1521 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);
1522 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
1523 fhLam0ETM->SetXTitle("E (GeV)");
1524 outputContainer->Add(fhLam0ETM);
1526 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);
1527 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
1528 fhLam1ETM->SetXTitle("E (GeV)");
1529 outputContainer->Add(fhLam1ETM);
1531 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);
1532 fhDispETM->SetYTitle("D^{2}");
1533 fhDispETM->SetXTitle("E (GeV) ");
1534 outputContainer->Add(fhDispETM);
1537 if(fCalorimeter == "EMCAL")
1539 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1540 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1541 fhLam0ETRD->SetXTitle("E (GeV)");
1542 outputContainer->Add(fhLam0ETRD);
1544 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1545 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1546 fhLam1ETRD->SetXTitle("E (GeV)");
1547 outputContainer->Add(fhLam1ETRD);
1549 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1550 fhDispETRD->SetYTitle("Dispersion^{2}");
1551 fhDispETRD->SetXTitle("E (GeV) ");
1552 outputContainer->Add(fhDispETRD);
1554 if(!fRejectTrackMatch)
1556 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);
1557 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
1558 fhLam0ETMTRD->SetXTitle("E (GeV)");
1559 outputContainer->Add(fhLam0ETMTRD);
1561 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);
1562 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
1563 fhLam1ETMTRD->SetXTitle("E (GeV)");
1564 outputContainer->Add(fhLam1ETMTRD);
1566 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);
1567 fhDispETMTRD->SetYTitle("Dispersion^{2}");
1568 fhDispETMTRD->SetXTitle("E (GeV) ");
1569 outputContainer->Add(fhDispETMTRD);
1573 if(!fFillOnlySimpleSSHisto)
1575 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1576 fhNCellsLam0LowE->SetXTitle("N_{cells}");
1577 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1578 outputContainer->Add(fhNCellsLam0LowE);
1580 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1581 fhNCellsLam0HighE->SetXTitle("N_{cells}");
1582 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1583 outputContainer->Add(fhNCellsLam0HighE);
1585 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1586 fhNCellsLam1LowE->SetXTitle("N_{cells}");
1587 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1588 outputContainer->Add(fhNCellsLam1LowE);
1590 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1591 fhNCellsLam1HighE->SetXTitle("N_{cells}");
1592 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1593 outputContainer->Add(fhNCellsLam1HighE);
1595 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1596 fhNCellsDispLowE->SetXTitle("N_{cells}");
1597 fhNCellsDispLowE->SetYTitle("D^{2}");
1598 outputContainer->Add(fhNCellsDispLowE);
1600 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1601 fhNCellsDispHighE->SetXTitle("N_{cells}");
1602 fhNCellsDispHighE->SetYTitle("D^{2}");
1603 outputContainer->Add(fhNCellsDispHighE);
1605 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1606 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1607 fhEtaLam0LowE->SetXTitle("#eta");
1608 outputContainer->Add(fhEtaLam0LowE);
1610 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1611 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1612 fhPhiLam0LowE->SetXTitle("#phi");
1613 outputContainer->Add(fhPhiLam0LowE);
1615 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1616 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1617 fhEtaLam0HighE->SetXTitle("#eta");
1618 outputContainer->Add(fhEtaLam0HighE);
1620 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1621 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1622 fhPhiLam0HighE->SetXTitle("#phi");
1623 outputContainer->Add(fhPhiLam0HighE);
1625 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1626 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1627 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1628 outputContainer->Add(fhLam1Lam0LowE);
1630 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1631 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1632 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1633 outputContainer->Add(fhLam1Lam0HighE);
1635 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1636 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1637 fhLam0DispLowE->SetYTitle("D^{2}");
1638 outputContainer->Add(fhLam0DispLowE);
1640 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1641 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1642 fhLam0DispHighE->SetYTitle("D^{2}");
1643 outputContainer->Add(fhLam0DispHighE);
1645 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1646 fhDispLam1LowE->SetXTitle("D^{2}");
1647 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1648 outputContainer->Add(fhDispLam1LowE);
1650 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1651 fhDispLam1HighE->SetXTitle("D^{2}");
1652 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1653 outputContainer->Add(fhDispLam1HighE);
1655 if(fCalorimeter == "EMCAL")
1657 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);
1658 fhDispEtaE->SetXTitle("E (GeV)");
1659 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
1660 outputContainer->Add(fhDispEtaE);
1662 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);
1663 fhDispPhiE->SetXTitle("E (GeV)");
1664 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
1665 outputContainer->Add(fhDispPhiE);
1667 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);
1668 fhSumEtaE->SetXTitle("E (GeV)");
1669 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
1670 outputContainer->Add(fhSumEtaE);
1672 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
1673 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1674 fhSumPhiE->SetXTitle("E (GeV)");
1675 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
1676 outputContainer->Add(fhSumPhiE);
1678 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
1679 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1680 fhSumEtaPhiE->SetXTitle("E (GeV)");
1681 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
1682 outputContainer->Add(fhSumEtaPhiE);
1684 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
1685 nptbins,ptmin,ptmax,200, -10,10);
1686 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
1687 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1688 outputContainer->Add(fhDispEtaPhiDiffE);
1690 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
1691 nptbins,ptmin,ptmax, 200, -1,1);
1692 fhSphericityE->SetXTitle("E (GeV)");
1693 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1694 outputContainer->Add(fhSphericityE);
1696 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1697 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
1698 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
1699 outputContainer->Add(fhDispSumEtaDiffE);
1701 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1702 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
1703 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
1704 outputContainer->Add(fhDispSumPhiDiffE);
1706 for(Int_t i = 0; i < 7; i++)
1708 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]),
1709 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1710 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1711 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1712 outputContainer->Add(fhDispEtaDispPhi[i]);
1714 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]),
1715 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1716 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
1717 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1718 outputContainer->Add(fhLambda0DispEta[i]);
1720 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]),
1721 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1722 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
1723 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1724 outputContainer->Add(fhLambda0DispPhi[i]);
1734 fhTrackMatchedDEta[0] = new TH2F
1735 ("hTrackMatchedDEtaNoCut",
1736 "d#eta of cluster-track vs cluster energy, no photon cuts",
1737 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1738 fhTrackMatchedDEta[0]->SetYTitle("d#eta");
1739 fhTrackMatchedDEta[0]->SetXTitle("E_{cluster} (GeV)");
1741 fhTrackMatchedDPhi[0] = new TH2F
1742 ("hTrackMatchedDPhiNoCut",
1743 "d#phi of cluster-track vs cluster energy, no photon cuts",
1744 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1745 fhTrackMatchedDPhi[0]->SetYTitle("d#phi (rad)");
1746 fhTrackMatchedDPhi[0]->SetXTitle("E_{cluster} (GeV)");
1748 fhTrackMatchedDEtaDPhi[0] = new TH2F
1749 ("hTrackMatchedDEtaDPhiNoCut",
1750 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1751 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1752 fhTrackMatchedDEtaDPhi[0]->SetYTitle("d#phi (rad)");
1753 fhTrackMatchedDEtaDPhi[0]->SetXTitle("d#eta");
1755 fhdEdx[0] = new TH2F ("hdEdxNoCut","matched track <dE/dx> vs cluster E, no photon cuts ",
1756 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1757 fhdEdx[0]->SetXTitle("E (GeV)");
1758 fhdEdx[0]->SetYTitle("<dE/dx>");
1760 fhEOverP[0] = new TH2F ("hEOverPNoCut","matched track E/p vs cluster E, no photon cuts ",
1761 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1762 fhEOverP[0]->SetXTitle("E (GeV)");
1763 fhEOverP[0]->SetYTitle("E/p");
1765 outputContainer->Add(fhTrackMatchedDEta[0]) ;
1766 outputContainer->Add(fhTrackMatchedDPhi[0]) ;
1767 outputContainer->Add(fhTrackMatchedDEtaDPhi[0]) ;
1768 outputContainer->Add(fhdEdx[0]);
1769 outputContainer->Add(fhEOverP[0]);
1771 fhTrackMatchedDEta[1] = new TH2F
1772 ("hTrackMatchedDEta",
1773 "d#eta of cluster-track vs cluster energy, no photon cuts",
1774 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1775 fhTrackMatchedDEta[1]->SetYTitle("d#eta");
1776 fhTrackMatchedDEta[1]->SetXTitle("E_{cluster} (GeV)");
1778 fhTrackMatchedDPhi[1] = new TH2F
1779 ("hTrackMatchedDPhi",
1780 "d#phi of cluster-track vs cluster energy, no photon cuts",
1781 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1782 fhTrackMatchedDPhi[1]->SetYTitle("d#phi (rad)");
1783 fhTrackMatchedDPhi[1]->SetXTitle("E_{cluster} (GeV)");
1785 fhTrackMatchedDEtaDPhi[1] = new TH2F
1786 ("hTrackMatchedDEtaDPhi",
1787 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1788 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1789 fhTrackMatchedDEtaDPhi[1]->SetYTitle("d#phi (rad)");
1790 fhTrackMatchedDEtaDPhi[1]->SetXTitle("d#eta");
1792 fhdEdx[1] = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ",
1793 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1794 fhdEdx[1]->SetXTitle("E (GeV)");
1795 fhdEdx[1]->SetYTitle("<dE/dx>");
1797 fhEOverP[1] = new TH2F ("hEOverP","matched track E/p vs cluster E ",
1798 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1799 fhEOverP[1]->SetXTitle("E (GeV)");
1800 fhEOverP[1]->SetYTitle("E/p");
1802 outputContainer->Add(fhTrackMatchedDEta[1]) ;
1803 outputContainer->Add(fhTrackMatchedDPhi[1]) ;
1804 outputContainer->Add(fhTrackMatchedDEtaDPhi[1]) ;
1805 outputContainer->Add(fhdEdx[1]);
1806 outputContainer->Add(fhEOverP[1]);
1808 if(fCalorimeter=="EMCAL")
1810 fhTrackMatchedDEtaTRD[0] = new TH2F
1811 ("hTrackMatchedDEtaTRDNoCut",
1812 "d#eta of cluster-track vs cluster energy, SM behind TRD, no photon cuts",
1813 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1814 fhTrackMatchedDEtaTRD[0]->SetYTitle("d#eta");
1815 fhTrackMatchedDEtaTRD[0]->SetXTitle("E_{cluster} (GeV)");
1817 fhTrackMatchedDPhiTRD[0] = new TH2F
1818 ("hTrackMatchedDPhiTRDNoCut",
1819 "d#phi of cluster-track vs cluster energy, SM behing TRD, no photon cuts",
1820 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1821 fhTrackMatchedDPhiTRD[0]->SetYTitle("d#phi (rad)");
1822 fhTrackMatchedDPhiTRD[0]->SetXTitle("E_{cluster} (GeV)");
1824 fhEOverPTRD[0] = new TH2F ("hEOverPTRDNoCut","matched track E/p vs cluster E, behind TRD, no photon cuts ",
1825 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1826 fhEOverPTRD[0]->SetXTitle("E (GeV)");
1827 fhEOverPTRD[0]->SetYTitle("E/p");
1829 outputContainer->Add(fhTrackMatchedDEtaTRD[0]) ;
1830 outputContainer->Add(fhTrackMatchedDPhiTRD[0]) ;
1831 outputContainer->Add(fhEOverPTRD[0]);
1833 fhTrackMatchedDEtaTRD[1] = new TH2F
1834 ("hTrackMatchedDEtaTRD",
1835 "d#eta of cluster-track vs cluster energy, SM behind TRD",
1836 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1837 fhTrackMatchedDEtaTRD[1]->SetYTitle("d#eta");
1838 fhTrackMatchedDEtaTRD[1]->SetXTitle("E_{cluster} (GeV)");
1840 fhTrackMatchedDPhiTRD[1] = new TH2F
1841 ("hTrackMatchedDPhiTRD",
1842 "d#phi of cluster-track vs cluster energy, SM behing TRD",
1843 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1844 fhTrackMatchedDPhiTRD[1]->SetYTitle("d#phi (rad)");
1845 fhTrackMatchedDPhiTRD[1]->SetXTitle("E_{cluster} (GeV)");
1847 fhEOverPTRD[1] = new TH2F ("hEOverPTRD","matched track E/p vs cluster E, behind TRD ",
1848 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1849 fhEOverPTRD[1]->SetXTitle("E (GeV)");
1850 fhEOverPTRD[1]->SetYTitle("E/p");
1852 outputContainer->Add(fhTrackMatchedDEtaTRD[1]) ;
1853 outputContainer->Add(fhTrackMatchedDPhiTRD[1]) ;
1854 outputContainer->Add(fhEOverPTRD[1]);
1860 fhTrackMatchedDEtaMCNoOverlap[0] = new TH2F
1861 ("hTrackMatchedDEtaMCNoOverlapNoCut",
1862 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1863 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1864 fhTrackMatchedDEtaMCNoOverlap[0]->SetYTitle("d#eta");
1865 fhTrackMatchedDEtaMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1867 fhTrackMatchedDPhiMCNoOverlap[0] = new TH2F
1868 ("hTrackMatchedDPhiMCNoOverlapNoCut",
1869 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1870 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1871 fhTrackMatchedDPhiMCNoOverlap[0]->SetYTitle("d#phi (rad)");
1872 fhTrackMatchedDPhiMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1874 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[0]) ;
1875 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[0]) ;
1877 fhTrackMatchedDEtaMCNoOverlap[1] = new TH2F
1878 ("hTrackMatchedDEtaMCNoOverlap",
1879 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1880 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1881 fhTrackMatchedDEtaMCNoOverlap[1]->SetYTitle("d#eta");
1882 fhTrackMatchedDEtaMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1884 fhTrackMatchedDPhiMCNoOverlap[1] = new TH2F
1885 ("hTrackMatchedDPhiMCNoOverlap",
1886 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1887 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1888 fhTrackMatchedDPhiMCNoOverlap[1]->SetYTitle("d#phi (rad)");
1889 fhTrackMatchedDPhiMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1891 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[1]) ;
1892 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[1]) ;
1894 fhTrackMatchedDEtaMCOverlap[0] = new TH2F
1895 ("hTrackMatchedDEtaMCOverlapNoCut",
1896 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1897 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1898 fhTrackMatchedDEtaMCOverlap[0]->SetYTitle("d#eta");
1899 fhTrackMatchedDEtaMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1901 fhTrackMatchedDPhiMCOverlap[0] = new TH2F
1902 ("hTrackMatchedDPhiMCOverlapNoCut",
1903 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1904 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1905 fhTrackMatchedDPhiMCOverlap[0]->SetYTitle("d#phi (rad)");
1906 fhTrackMatchedDPhiMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1908 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[0]) ;
1909 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[0]) ;
1911 fhTrackMatchedDEtaMCOverlap[1] = new TH2F
1912 ("hTrackMatchedDEtaMCOverlap",
1913 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1914 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1915 fhTrackMatchedDEtaMCOverlap[1]->SetYTitle("d#eta");
1916 fhTrackMatchedDEtaMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1918 fhTrackMatchedDPhiMCOverlap[1] = new TH2F
1919 ("hTrackMatchedDPhiMCOverlap",
1920 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1921 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1922 fhTrackMatchedDPhiMCOverlap[1]->SetYTitle("d#phi (rad)");
1923 fhTrackMatchedDPhiMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1925 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[1]) ;
1926 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[1]) ;
1928 fhTrackMatchedDEtaMCConversion[0] = new TH2F
1929 ("hTrackMatchedDEtaMCConversionNoCut",
1930 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1931 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1932 fhTrackMatchedDEtaMCConversion[0]->SetYTitle("d#eta");
1933 fhTrackMatchedDEtaMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1935 fhTrackMatchedDPhiMCConversion[0] = new TH2F
1936 ("hTrackMatchedDPhiMCConversionNoCut",
1937 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1938 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1939 fhTrackMatchedDPhiMCConversion[0]->SetYTitle("d#phi (rad)");
1940 fhTrackMatchedDPhiMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1942 outputContainer->Add(fhTrackMatchedDEtaMCConversion[0]) ;
1943 outputContainer->Add(fhTrackMatchedDPhiMCConversion[0]) ;
1946 fhTrackMatchedDEtaMCConversion[1] = new TH2F
1947 ("hTrackMatchedDEtaMCConversion",
1948 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1949 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1950 fhTrackMatchedDEtaMCConversion[1]->SetYTitle("d#eta");
1951 fhTrackMatchedDEtaMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1953 fhTrackMatchedDPhiMCConversion[1] = new TH2F
1954 ("hTrackMatchedDPhiMCConversion",
1955 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1956 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1957 fhTrackMatchedDPhiMCConversion[1]->SetYTitle("d#phi (rad)");
1958 fhTrackMatchedDPhiMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1960 outputContainer->Add(fhTrackMatchedDEtaMCConversion[1]) ;
1961 outputContainer->Add(fhTrackMatchedDPhiMCConversion[1]) ;
1964 fhTrackMatchedMCParticle[0] = new TH2F
1965 ("hTrackMatchedMCParticleNoCut",
1966 "Origin of particle vs energy",
1967 nptbins,ptmin,ptmax,8,0,8);
1968 fhTrackMatchedMCParticle[0]->SetXTitle("E (GeV)");
1969 //fhTrackMatchedMCParticle[0]->SetYTitle("Particle type");
1971 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(1 ,"Photon");
1972 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(2 ,"Electron");
1973 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1974 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(4 ,"Rest");
1975 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1976 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1977 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1978 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1980 fhTrackMatchedMCParticle[1] = new TH2F
1981 ("hTrackMatchedMCParticle",
1982 "Origin of particle vs energy",
1983 nptbins,ptmin,ptmax,8,0,8);
1984 fhTrackMatchedMCParticle[1]->SetXTitle("E (GeV)");
1985 //fhTrackMatchedMCParticle[1]->SetYTitle("Particle type");
1987 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(1 ,"Photon");
1988 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(2 ,"Electron");
1989 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1990 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(4 ,"Rest");
1991 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1992 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1993 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1994 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1996 outputContainer->Add(fhTrackMatchedMCParticle[0]);
1997 outputContainer->Add(fhTrackMatchedMCParticle[1]);
2002 if(fFillPileUpHistograms)
2005 TString pileUpName[] = {"SPD","EMCAL","SPDOrEMCAL","SPDAndEMCAL","SPDAndNotEMCAL","EMCALAndNotSPD","NotSPDAndNotEMCAL"} ;
2007 for(Int_t i = 0 ; i < 7 ; i++)
2009 fhPtPileUp[i] = new TH1F(Form("hPtPileUp%s",pileUpName[i].Data()),
2010 Form("Cluster p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2011 fhPtPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2012 outputContainer->Add(fhPtPileUp[i]);
2014 fhPtChargedPileUp[i] = new TH1F(Form("hPtChargedPileUp%s",pileUpName[i].Data()),
2015 Form("Charged clusters p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2016 fhPtChargedPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2017 outputContainer->Add(fhPtChargedPileUp[i]);
2019 fhPtPhotonPileUp[i] = new TH1F(Form("hPtPhotonPileUp%s",pileUpName[i].Data()),
2020 Form("Selected photon p_{T} distribution, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax);
2021 fhPtPhotonPileUp[i]->SetXTitle("p_{T} (GeV/c)");
2022 outputContainer->Add(fhPtPhotonPileUp[i]);
2025 fhClusterEFracLongTimePileUp[i] = new TH2F(Form("hClusterEFracLongTimePileUp%s",pileUpName[i].Data()),
2026 Form("Cluster E vs fraction of cluster energy from large T cells, %s Pile-Up event",pileUpName[i].Data()),
2027 nptbins,ptmin,ptmax,200,0,1);
2028 fhClusterEFracLongTimePileUp[i]->SetXTitle("E (GeV)");
2029 fhClusterEFracLongTimePileUp[i]->SetYTitle("E(large time) / E");
2030 outputContainer->Add(fhClusterEFracLongTimePileUp[i]);
2032 fhClusterTimeDiffPileUp[i] = new TH2F(Form("hClusterTimeDiffPileUp%s",pileUpName[i].Data()),
2033 Form("Cluster E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2034 nptbins,ptmin,ptmax,200,-100,100);
2035 fhClusterTimeDiffPileUp[i]->SetXTitle("E (GeV)");
2036 fhClusterTimeDiffPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2037 outputContainer->Add(fhClusterTimeDiffPileUp[i]);
2039 fhClusterTimeDiffChargedPileUp[i] = new TH2F(Form("hClusterTimeDiffChargedPileUp%s",pileUpName[i].Data()),
2040 Form("Charged clusters E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2041 nptbins,ptmin,ptmax,200,-100,100);
2042 fhClusterTimeDiffChargedPileUp[i]->SetXTitle("E (GeV)");
2043 fhClusterTimeDiffChargedPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2044 outputContainer->Add(fhClusterTimeDiffChargedPileUp[i]);
2046 fhClusterTimeDiffPhotonPileUp[i] = new TH2F(Form("hClusterTimeDiffPhotonPileUp%s",pileUpName[i].Data()),
2047 Form("Selected photon E vs t_{max}-t_{cell} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2048 nptbins,ptmin,ptmax,200,-100,100);
2049 fhClusterTimeDiffPhotonPileUp[i]->SetXTitle("E (GeV)");
2050 fhClusterTimeDiffPhotonPileUp[i]->SetYTitle("t_{max}-t_{cell} (ns)");
2051 outputContainer->Add(fhClusterTimeDiffPhotonPileUp[i]);
2053 fhLambda0PileUp[i] = new TH2F(Form("hLambda0PileUp%s",pileUpName[i].Data()),
2054 Form("Cluster E vs #lambda^{2}_{0} in cluster, %s Pile-Up event",pileUpName[i].Data()),
2055 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2056 fhLambda0PileUp[i]->SetXTitle("E (GeV)");
2057 fhLambda0PileUp[i]->SetYTitle("#lambda^{2}_{0}");
2058 outputContainer->Add(fhLambda0PileUp[i]);
2060 fhLambda0ChargedPileUp[i] = new TH2F(Form("hLambda0ChargedPileUp%s",pileUpName[i].Data()),
2061 Form("Charged clusters E vs #lambda^{2}_{0}in cluster, %s Pile-Up event",pileUpName[i].Data()), nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2062 fhLambda0ChargedPileUp[i]->SetXTitle("E (GeV)");
2063 fhLambda0ChargedPileUp[i]->SetYTitle("#lambda^{2}_{0}");
2064 outputContainer->Add(fhLambda0ChargedPileUp[i]);
2068 fhEtaPhiBC0 = new TH2F ("hEtaPhiBC0","eta-phi for clusters tof corresponding to BC=0",netabins,etamin,etamax, nphibins,phimin,phimax);
2069 fhEtaPhiBC0->SetXTitle("#eta ");
2070 fhEtaPhiBC0->SetYTitle("#phi (rad)");
2071 outputContainer->Add(fhEtaPhiBC0);
2073 fhEtaPhiBCPlus = new TH2F ("hEtaPhiBCPlus","eta-phi for clusters tof corresponding to BC>0",netabins,etamin,etamax, nphibins,phimin,phimax);
2074 fhEtaPhiBCPlus->SetXTitle("#eta ");
2075 fhEtaPhiBCPlus->SetYTitle("#phi (rad)");
2076 outputContainer->Add(fhEtaPhiBCPlus);
2078 fhEtaPhiBCMinus = new TH2F ("hEtaPhiBCMinus","eta-phi for clusters tof corresponding to BC<0",netabins,etamin,etamax, nphibins,phimin,phimax);
2079 fhEtaPhiBCMinus->SetXTitle("#eta ");
2080 fhEtaPhiBCMinus->SetYTitle("#phi (rad)");
2081 outputContainer->Add(fhEtaPhiBCMinus);
2083 fhEtaPhiBC0PileUpSPD = new TH2F ("hEtaPhiBC0PileUpSPD","eta-phi for clusters tof corresponding to BC=0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2084 fhEtaPhiBC0PileUpSPD->SetXTitle("#eta ");
2085 fhEtaPhiBC0PileUpSPD->SetYTitle("#phi (rad)");
2086 outputContainer->Add(fhEtaPhiBC0PileUpSPD);
2088 fhEtaPhiBCPlusPileUpSPD = new TH2F ("hEtaPhiBCPlusPileUpSPD","eta-phi for clusters tof corresponding to BC>0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2089 fhEtaPhiBCPlusPileUpSPD->SetXTitle("#eta ");
2090 fhEtaPhiBCPlusPileUpSPD->SetYTitle("#phi (rad)");
2091 outputContainer->Add(fhEtaPhiBCPlusPileUpSPD);
2093 fhEtaPhiBCMinusPileUpSPD = new TH2F ("hEtaPhiBCMinusPileUpSPD","eta-phi for clusters tof corresponding to BC<0, SPD pile-up",netabins,etamin,etamax, nphibins,phimin,phimax);
2094 fhEtaPhiBCMinusPileUpSPD->SetXTitle("#eta ");
2095 fhEtaPhiBCMinusPileUpSPD->SetYTitle("#phi (rad)");
2096 outputContainer->Add(fhEtaPhiBCMinusPileUpSPD);
2098 fhTimeENoCut = new TH2F ("hTimeE_NoCut","time of cluster vs E of clusters, no cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2099 fhTimeENoCut->SetXTitle("E (GeV)");
2100 fhTimeENoCut->SetYTitle("time (ns)");
2101 outputContainer->Add(fhTimeENoCut);
2103 fhTimeESPD = new TH2F ("hTimeE_SPD","time of cluster vs E of clusters, SPD cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2104 fhTimeESPD->SetXTitle("E (GeV)");
2105 fhTimeESPD->SetYTitle("time (ns)");
2106 outputContainer->Add(fhTimeESPD);
2108 fhTimeESPDMulti = new TH2F ("hTimeE_SPDMulti","time of cluster vs E of clusters, SPD multi cut", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
2109 fhTimeESPDMulti->SetXTitle("E (GeV)");
2110 fhTimeESPDMulti->SetYTitle("time (ns)");
2111 outputContainer->Add(fhTimeESPDMulti);
2113 fhTimeNPileUpVertSPD = new TH2F ("hTime_NPileUpVertSPD","time of cluster vs N pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2114 fhTimeNPileUpVertSPD->SetYTitle("# vertex ");
2115 fhTimeNPileUpVertSPD->SetXTitle("time (ns)");
2116 outputContainer->Add(fhTimeNPileUpVertSPD);
2118 fhTimeNPileUpVertTrack = new TH2F ("hTime_NPileUpVertTracks","time of cluster vs N pile-up Tracks vertex", ntimebins,timemin,timemax, 50,0,50 );
2119 fhTimeNPileUpVertTrack->SetYTitle("# vertex ");
2120 fhTimeNPileUpVertTrack->SetXTitle("time (ns)");
2121 outputContainer->Add(fhTimeNPileUpVertTrack);
2123 fhTimeNPileUpVertContributors = new TH2F ("hTime_NPileUpVertContributors","time of cluster vs N constributors to pile-up SPD vertex", ntimebins,timemin,timemax,50,0,50);
2124 fhTimeNPileUpVertContributors->SetYTitle("# vertex ");
2125 fhTimeNPileUpVertContributors->SetXTitle("time (ns)");
2126 outputContainer->Add(fhTimeNPileUpVertContributors);
2128 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);
2129 fhTimePileUpMainVertexZDistance->SetYTitle("distance Z (cm) ");
2130 fhTimePileUpMainVertexZDistance->SetXTitle("time (ns)");
2131 outputContainer->Add(fhTimePileUpMainVertexZDistance);
2133 fhTimePileUpMainVertexZDiamond = new TH2F ("hTime_PileUpMainVertexZDiamond","time of cluster vs distance in Z pile-up SPD vertex - z diamond",ntimebins,timemin,timemax,100,0,50);
2134 fhTimePileUpMainVertexZDiamond->SetYTitle("diamond distance Z (cm) ");
2135 fhTimePileUpMainVertexZDiamond->SetXTitle("time (ns)");
2136 outputContainer->Add(fhTimePileUpMainVertexZDiamond);
2138 TString title[] = {"no |t diff| cut","|t diff|<20 ns","|t diff|>20 ns","|t diff|>40 ns"};
2139 TString name [] = {"TDiffNoCut","TDiffSmaller20ns","TDiffLarger20ns","TDiffLarger40ns"};
2140 for(Int_t i = 0; i < 4; i++)
2142 fhClusterMultSPDPileUp[i] = new TH2F(Form("fhClusterMultSPDPileUp_%s", name[i].Data()),
2143 Form("Number of clusters per pile up event with E > 0.5 and %s respect cluster max vs cluster max E ",title[i].Data()),
2144 nptbins,ptmin,ptmax,100,0,100);
2145 fhClusterMultSPDPileUp[i]->SetYTitle("n clusters ");
2146 fhClusterMultSPDPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2147 outputContainer->Add(fhClusterMultSPDPileUp[i]) ;
2149 fhClusterMultNoPileUp[i] = new TH2F(Form("fhClusterMultNoPileUp_%s", name[i].Data()),
2150 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()),
2151 nptbins,ptmin,ptmax,100,0,100);
2152 fhClusterMultNoPileUp[i]->SetYTitle("n clusters ");
2153 fhClusterMultNoPileUp[i]->SetXTitle("E_{cluster max} (GeV)");
2154 outputContainer->Add(fhClusterMultNoPileUp[i]) ;
2161 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
2162 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
2163 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
2165 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
2166 "Conversion", "Hadron", "AntiNeutron","AntiProton",
2167 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
2169 for(Int_t i = 0; i < fNOriginHistograms; i++)
2171 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
2172 Form("cluster from %s : E ",ptype[i].Data()),
2173 nptbins,ptmin,ptmax);
2174 fhMCE[i]->SetXTitle("E (GeV)");
2175 outputContainer->Add(fhMCE[i]) ;
2177 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
2178 Form("cluster from %s : p_{T} ",ptype[i].Data()),
2179 nptbins,ptmin,ptmax);
2180 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
2181 outputContainer->Add(fhMCPt[i]) ;
2183 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
2184 Form("cluster from %s : #eta ",ptype[i].Data()),
2185 nptbins,ptmin,ptmax,netabins,etamin,etamax);
2186 fhMCEta[i]->SetYTitle("#eta");
2187 fhMCEta[i]->SetXTitle("E (GeV)");
2188 outputContainer->Add(fhMCEta[i]) ;
2190 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
2191 Form("cluster from %s : #phi ",ptype[i].Data()),
2192 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2193 fhMCPhi[i]->SetYTitle("#phi (rad)");
2194 fhMCPhi[i]->SetXTitle("E (GeV)");
2195 outputContainer->Add(fhMCPhi[i]) ;
2198 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
2199 Form("MC - Reco E from %s",pname[i].Data()),
2200 nptbins,ptmin,ptmax, 200,-50,50);
2201 fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
2202 outputContainer->Add(fhMCDeltaE[i]);
2204 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
2205 Form("MC - Reco p_{T} from %s",pname[i].Data()),
2206 nptbins,ptmin,ptmax, 200,-50,50);
2207 fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
2208 outputContainer->Add(fhMCDeltaPt[i]);
2210 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
2211 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
2212 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2213 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
2214 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
2215 outputContainer->Add(fhMC2E[i]);
2217 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
2218 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
2219 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
2220 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
2221 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
2222 outputContainer->Add(fhMC2Pt[i]);
2227 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
2228 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
2230 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
2231 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
2233 for(Int_t i = 0; i < fNPrimaryHistograms; i++)
2235 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
2236 Form("primary photon %s : E ",pptype[i].Data()),
2237 nptbins,ptmin,ptmax);
2238 fhEPrimMC[i]->SetXTitle("E (GeV)");
2239 outputContainer->Add(fhEPrimMC[i]) ;
2241 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
2242 Form("primary photon %s : p_{T} ",pptype[i].Data()),
2243 nptbins,ptmin,ptmax);
2244 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
2245 outputContainer->Add(fhPtPrimMC[i]) ;
2247 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
2248 Form("primary photon %s : Rapidity ",pptype[i].Data()),
2249 nptbins,ptmin,ptmax,800,-8,8);
2250 fhYPrimMC[i]->SetYTitle("Rapidity");
2251 fhYPrimMC[i]->SetXTitle("E (GeV)");
2252 outputContainer->Add(fhYPrimMC[i]) ;
2254 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
2255 Form("primary photon %s : #phi ",pptype[i].Data()),
2256 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2257 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
2258 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
2259 outputContainer->Add(fhPhiPrimMC[i]) ;
2262 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
2263 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
2264 nptbins,ptmin,ptmax);
2265 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
2266 outputContainer->Add(fhEPrimMCAcc[i]) ;
2268 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
2269 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
2270 nptbins,ptmin,ptmax);
2271 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
2272 outputContainer->Add(fhPtPrimMCAcc[i]) ;
2274 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
2275 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
2276 nptbins,ptmin,ptmax,100,-1,1);
2277 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
2278 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
2279 outputContainer->Add(fhYPrimMCAcc[i]) ;
2281 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
2282 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
2283 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
2284 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
2285 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
2286 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
2290 if(fFillSSHistograms)
2292 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
2294 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
2296 for(Int_t i = 0; i < 6; i++)
2298 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
2299 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
2300 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2301 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
2302 fhMCELambda0[i]->SetXTitle("E (GeV)");
2303 outputContainer->Add(fhMCELambda0[i]) ;
2305 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
2306 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
2307 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2308 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
2309 fhMCELambda1[i]->SetXTitle("E (GeV)");
2310 outputContainer->Add(fhMCELambda1[i]) ;
2312 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
2313 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
2314 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2315 fhMCEDispersion[i]->SetYTitle("D^{2}");
2316 fhMCEDispersion[i]->SetXTitle("E (GeV)");
2317 outputContainer->Add(fhMCEDispersion[i]) ;
2319 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
2320 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
2321 nptbins,ptmin,ptmax, nbins,nmin,nmax);
2322 fhMCNCellsE[i]->SetXTitle("E (GeV)");
2323 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
2324 outputContainer->Add(fhMCNCellsE[i]);
2326 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
2327 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
2328 nptbins,ptmin,ptmax, 500,0,1.);
2329 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
2330 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2331 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
2333 if(!fFillOnlySimpleSSHisto)
2335 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2336 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2337 ssbins,ssmin,ssmax,500,0,1.);
2338 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
2339 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2340 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
2342 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2343 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2344 ssbins,ssmin,ssmax,500,0,1.);
2345 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
2346 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2347 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
2349 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2350 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
2351 ssbins,ssmin,ssmax,500,0,1.);
2352 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
2353 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2354 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
2356 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
2357 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
2358 nbins/5,nmin,nmax/5,500,0,1.);
2359 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
2360 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2361 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
2363 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
2364 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
2365 nbins/5,nmin,nmax/5,500,0,1.);
2366 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
2367 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
2368 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
2370 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
2371 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
2372 nbins/5,nmin,nmax/5,500,0,1.);
2373 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
2374 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
2375 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
2377 if(fCalorimeter=="EMCAL")
2379 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
2380 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
2381 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2382 fhMCEDispEta[i]->SetXTitle("E (GeV)");
2383 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
2384 outputContainer->Add(fhMCEDispEta[i]);
2386 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
2387 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
2388 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
2389 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
2390 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2391 outputContainer->Add(fhMCEDispPhi[i]);
2393 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
2394 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()),
2395 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
2396 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
2397 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
2398 outputContainer->Add(fhMCESumEtaPhi[i]);
2400 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
2401 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
2402 nptbins,ptmin,ptmax,200,-10,10);
2403 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
2404 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
2405 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
2407 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
2408 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()),
2409 nptbins,ptmin,ptmax, 200,-1,1);
2410 fhMCESphericity[i]->SetXTitle("E (GeV)");
2411 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
2412 outputContainer->Add(fhMCESphericity[i]);
2414 for(Int_t ie = 0; ie < 7; ie++)
2416 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2417 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]),
2418 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2419 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
2420 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2421 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
2423 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
2424 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]),
2425 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2426 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
2427 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2428 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
2430 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
2431 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]),
2432 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
2433 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
2434 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
2435 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
2441 if(!GetReader()->IsEmbeddedClusterSelectionOn())
2443 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
2444 "cluster from Photon : E vs #lambda_{0}^{2}",
2445 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2446 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
2447 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
2448 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
2450 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
2451 "cluster from Photon : E vs #lambda_{0}^{2}",
2452 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2453 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
2454 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
2455 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
2457 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
2458 "cluster from Photon : E vs #lambda_{0}^{2}",
2459 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2460 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
2461 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
2462 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
2466 //Fill histograms to check shape of embedded clusters
2467 if(GetReader()->IsEmbeddedClusterSelectionOn())
2470 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
2471 "Energy Fraction of embedded signal versus cluster energy",
2472 nptbins,ptmin,ptmax,100,0.,1.);
2473 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
2474 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
2475 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
2477 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
2478 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2479 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2480 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2481 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
2482 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
2484 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
2485 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2486 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2487 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2488 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
2489 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
2491 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
2492 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2493 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2494 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2495 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
2496 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
2498 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
2499 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2500 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2501 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2502 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
2503 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
2505 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
2506 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2507 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2508 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2509 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
2510 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
2512 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
2513 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2514 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2515 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2516 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
2517 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
2519 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
2520 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2521 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2522 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2523 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
2524 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
2526 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
2527 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2528 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2529 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2530 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
2531 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
2533 }// embedded histograms
2536 }// Fill SS MC histograms
2540 return outputContainer ;
2544 //_______________________
2545 void AliAnaPhoton::Init()
2550 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
2552 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
2555 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
2557 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
2561 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
2565 //____________________________________________________________________________
2566 void AliAnaPhoton::InitParameters()
2569 //Initialize the parameters of the analysis.
2570 AddToHistogramsName("AnaPhoton_");
2572 fCalorimeter = "EMCAL" ;
2577 fTimeCutMin =-1000000;
2578 fTimeCutMax = 1000000;
2581 fRejectTrackMatch = kTRUE ;
2585 //__________________________________________________________________
2586 void AliAnaPhoton::MakeAnalysisFillAOD()
2588 //Do photon analysis and fill aods
2591 Double_t v[3] = {0,0,0}; //vertex ;
2592 GetReader()->GetVertex(v);
2594 //Select the Calorimeter of the photon
2595 TObjArray * pl = 0x0;
2596 AliVCaloCells* cells = 0;
2597 if (fCalorimeter == "PHOS" )
2599 pl = GetPHOSClusters();
2600 cells = GetPHOSCells();
2602 else if (fCalorimeter == "EMCAL")
2604 pl = GetEMCALClusters();
2605 cells = GetEMCALCells();
2610 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2614 FillPileUpHistogramsPerEvent(pl);
2616 // Loop on raw clusters before filtering in the reader and fill control histogram
2617 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
2619 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
2621 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
2622 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
2623 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
2628 TClonesArray * clusterList = 0;
2630 if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
2631 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2632 else if(GetReader()->GetOutputEvent())
2633 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2637 Int_t nclusters = clusterList->GetEntriesFast();
2638 for (Int_t iclus = 0; iclus < nclusters; iclus++)
2640 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
2641 if(clus)fhClusterCuts[0]->Fill(clus->E());
2646 //Init arrays, variables, get number of clusters
2647 TLorentzVector mom, mom2 ;
2648 Int_t nCaloClusters = pl->GetEntriesFast();
2650 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
2652 //----------------------------------------------------
2653 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
2654 //----------------------------------------------------
2656 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
2658 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2659 //printf("calo %d, %f\n",icalo,calo->E());
2661 //Get the index where the cluster comes, to retrieve the corresponding vertex
2662 Int_t evtIndex = 0 ;
2663 if (GetMixedEvent())
2665 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2666 //Get the vertex and check it is not too large in z
2667 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
2670 //Cluster selection, not charged, with photon id and in fiducial cut
2671 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2673 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
2676 Double_t vertex[]={0,0,0};
2677 calo->GetMomentum(mom,vertex) ;
2680 //--------------------------------------
2681 // Cluster selection
2682 //--------------------------------------
2683 Int_t nMaxima = GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells); // NLM
2684 if(!ClusterSelected(calo,mom,nMaxima)) continue;
2686 //----------------------------
2687 //Create AOD for analysis
2688 //----------------------------
2689 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
2691 //...............................................
2692 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
2693 Int_t label = calo->GetLabel();
2694 aodph.SetLabel(label);
2695 aodph.SetCaloLabel(calo->GetID(),-1);
2696 aodph.SetDetector(fCalorimeter);
2697 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
2699 //...............................................
2700 //Set bad channel distance bit
2701 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2702 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
2703 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
2704 else aodph.SetDistToBad(0) ;
2705 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
2707 //--------------------------------------------------------------------------------------
2708 // Play with the MC stack if available
2709 //--------------------------------------------------------------------------------------
2711 //Check origin of the candidates
2716 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader());
2720 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
2721 }//Work with stack also
2724 //--------------------------------------------------------------------------------------
2725 //Fill some shower shape histograms before PID is applied
2726 //--------------------------------------------------------------------------------------
2728 FillShowerShapeHistograms(calo,tag);
2730 //-------------------------------------
2731 //PID selection or bit setting
2732 //-------------------------------------
2734 //...............................................
2735 // Data, PID check on
2738 // Get most probable PID, 2 options check bayesian PID weights or redo PID
2739 // By default, redo PID
2741 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
2743 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
2745 //If cluster does not pass pid, not photon, skip it.
2746 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
2750 //...............................................
2751 // Data, PID check off
2754 //Set PID bits for later selection (AliAnaPi0 for example)
2755 //GetIdentifiedParticleType already called in SetPIDBits.
2757 GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
2759 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
2762 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
2763 aodph.Pt(), aodph.GetIdentifiedParticleType());
2765 fhClusterCuts[9]->Fill(calo->E());
2767 fhNLocMax->Fill(calo->E(),nMaxima);
2769 // Matching after cuts
2770 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
2772 // Fill histograms to undertand pile-up before other cuts applied
2773 // Remember to relax time cuts in the reader
2774 FillPileUpHistograms(calo->E(),mom.Pt(),calo->GetTOF()*1e9);
2776 // Add number of local maxima to AOD, method name in AOD to be FIXED
2777 aodph.SetFiducialArea(nMaxima);
2780 //Add AOD with photon object to aod branch
2781 AddAODParticle(aodph);
2785 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
2789 //__________________________________________________________________
2790 void AliAnaPhoton::MakeAnalysisFillHistograms()
2795 Double_t v[3] = {0,0,0}; //vertex ;
2796 GetReader()->GetVertex(v);
2797 //fhVertex->Fill(v[0],v[1],v[2]);
2798 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
2800 //----------------------------------
2801 //Loop on stored AOD photons
2802 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2803 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2805 Float_t cen = GetEventCentrality();
2806 Float_t ep = GetEventPlaneAngle();
2808 for(Int_t iaod = 0; iaod < naod ; iaod++)
2810 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2811 Int_t pdg = ph->GetIdentifiedParticleType();
2814 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
2815 ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
2817 //If PID used, fill histos with photons in Calorimeter fCalorimeter
2818 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
2819 if(ph->GetDetector() != fCalorimeter) continue;
2822 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
2824 //................................
2825 //Fill photon histograms
2826 Float_t ptcluster = ph->Pt();
2827 Float_t phicluster = ph->Phi();
2828 Float_t etacluster = ph->Eta();
2829 Float_t ecluster = ph->E();
2831 fhEPhoton ->Fill(ecluster);
2832 fhPtPhoton ->Fill(ptcluster);
2833 fhPhiPhoton ->Fill(ptcluster,phicluster);
2834 fhEtaPhoton ->Fill(ptcluster,etacluster);
2835 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
2836 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
2838 fhPtCentralityPhoton ->Fill(ptcluster,cen) ;
2839 fhPtEventPlanePhoton ->Fill(ptcluster,ep ) ;
2841 //Get original cluster, to recover some information
2843 Float_t maxCellFraction = 0;
2844 AliVCaloCells* cells = 0;
2845 TObjArray * clusters = 0;
2846 if(fCalorimeter == "EMCAL")
2848 cells = GetEMCALCells();
2849 clusters = GetEMCALClusters();
2853 cells = GetPHOSCells();
2854 clusters = GetPHOSClusters();
2858 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
2861 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
2863 // Control histograms
2864 fhMaxCellDiffClusterE->Fill(ph->E(),maxCellFraction);
2865 fhNCellsE ->Fill(ph->E(),cluster->GetNCells());
2866 fhTimeE ->Fill(ph->E(),cluster->GetTOF()*1.e9);
2869 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
2870 fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
2874 //.......................................
2875 //Play with the MC data if available
2880 if(GetReader()->ReadStack() && !GetMCStack())
2882 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called?\n");
2884 else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles())
2886 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
2890 FillAcceptanceHistograms();
2892 //....................................................................
2893 // Access MC information in stack if requested, check that it exists.
2894 Int_t label =ph->GetLabel();
2898 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
2905 TLorentzVector primary = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2908 eprim = primary.Energy();
2909 ptprim = primary.Pt();
2912 Int_t tag =ph->GetTag();
2913 Int_t mcParticleTag = -1;
2914 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
2916 fhMCE [kmcPhoton] ->Fill(ecluster);
2917 fhMCPt [kmcPhoton] ->Fill(ptcluster);
2918 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
2919 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
2921 fhMC2E [kmcPhoton] ->Fill(ecluster, eprim);
2922 fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim);
2923 fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
2924 fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
2926 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
2927 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
2928 fhMCE[kmcConversion])
2930 fhMCE [kmcConversion] ->Fill(ecluster);
2931 fhMCPt [kmcConversion] ->Fill(ptcluster);
2932 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
2933 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
2935 fhMC2E [kmcConversion] ->Fill(ecluster, eprim);
2936 fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim);
2937 fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
2938 fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
2941 if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
2943 mcParticleTag = kmcPrompt;
2945 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
2947 mcParticleTag = kmcFragmentation;
2949 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
2951 mcParticleTag = kmcISR;
2953 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
2954 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
2956 mcParticleTag = kmcPi0Decay;
2958 else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
2959 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) ||
2960 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
2962 mcParticleTag = kmcOtherDecay;
2964 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
2966 mcParticleTag = kmcPi0;
2968 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
2970 mcParticleTag = kmcEta;
2973 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
2975 mcParticleTag = kmcAntiNeutron;
2977 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
2979 mcParticleTag = kmcAntiProton;
2981 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
2983 mcParticleTag = kmcElectron;
2985 else if( fhMCE[kmcOther])
2987 mcParticleTag = kmcOther;
2989 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2990 // ph->GetLabel(),ph->Pt());
2991 // for(Int_t i = 0; i < 20; i++) {
2992 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2998 fhMCE [mcParticleTag] ->Fill(ecluster);
2999 fhMCPt [mcParticleTag] ->Fill(ptcluster);
3000 fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
3001 fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
3003 fhMC2E[mcParticleTag] ->Fill(ecluster, eprim);
3004 fhMC2Pt[mcParticleTag] ->Fill(ptcluster, ptprim);
3005 fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
3006 fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
3008 }//Histograms with MC
3015 //__________________________________________________________________
3016 void AliAnaPhoton::Print(const Option_t * opt) const
3018 //Print some relevant parameters set for the analysis
3023 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
3024 AliAnaCaloTrackCorrBaseClass::Print(" ");
3026 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
3027 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
3028 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
3029 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
3030 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
3031 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
3032 printf("Number of cells in cluster is > %d \n", fNCellsCut);