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"
49 #include "AliPHOSGeoUtils.h"
50 #include "AliEMCALGeometry.h"
52 ClassImp(AliAnaPhoton)
54 //____________________________
55 AliAnaPhoton::AliAnaPhoton() :
56 AliAnaCaloTrackCorrBaseClass(), fCalorimeter(""),
57 fMinDist(0.), fMinDist2(0.), fMinDist3(0.),
58 fRejectTrackMatch(0), fFillTMHisto(kFALSE),
59 fTimeCutMin(-10000), fTimeCutMax(10000),
60 fNCellsCut(0), fFillSSHistograms(kFALSE), fFillOnlySimpleSSHisto(1),
61 fNOriginHistograms(8), fNPrimaryHistograms(4),
64 fhNCellsE(0), fhCellsE(0), // Control histograms
65 fhMaxCellDiffClusterE(0), fhTimeE(0), // Control histograms
66 fhEPhoton(0), fhPtPhoton(0),
67 fhPhiPhoton(0), fhEtaPhoton(0),
68 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
70 // Shower shape histograms
71 fhDispE(0), fhLam0E(0), fhLam1E(0),
72 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
73 fhDispETM(0), fhLam0ETM(0), fhLam1ETM(0),
74 fhDispETMTRD(0), fhLam0ETMTRD(0), fhLam1ETMTRD(0),
76 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
77 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
79 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
80 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
81 fhLam0DispLowE(0), fhLam0DispHighE(0),
82 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
83 fhDispLam1LowE(0), fhDispLam1HighE(0),
84 fhDispEtaE(0), fhDispPhiE(0),
85 fhSumEtaE(0), fhSumPhiE(0), fhSumEtaPhiE(0),
86 fhDispEtaPhiDiffE(0), fhSphericityE(0),
87 fhDispSumEtaDiffE(0), fhDispSumPhiDiffE(0),
90 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
92 fhEmbeddedSignalFractionEnergy(0),
93 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
94 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
95 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
96 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0)
101 for(Int_t i = 0; i < 14; i++)
113 for(Int_t i = 0; i < 7; i++)
120 fhPtPrimMCAcc [i] = 0;
121 fhEPrimMCAcc [i] = 0;
122 fhPhiPrimMCAcc[i] = 0;
123 fhYPrimMCAcc [i] = 0;
125 fhDispEtaDispPhi[i] = 0;
126 fhLambda0DispPhi[i] = 0;
127 fhLambda0DispEta[i] = 0;
128 for(Int_t j = 0; j < 6; j++)
130 fhMCDispEtaDispPhi[i][j] = 0;
131 fhMCLambda0DispEta[i][j] = 0;
132 fhMCLambda0DispPhi[i][j] = 0;
136 for(Int_t i = 0; i < 6; i++)
138 fhMCELambda0 [i] = 0;
139 fhMCELambda1 [i] = 0;
140 fhMCEDispersion [i] = 0;
142 fhMCMaxCellDiffClusterE[i] = 0;
143 fhLambda0DispEta[i] = 0;
144 fhLambda0DispPhi[i] = 0;
146 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
147 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
148 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
149 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
150 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
151 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
153 fhMCEDispEta [i] = 0;
154 fhMCEDispPhi [i] = 0;
155 fhMCESumEtaPhi [i] = 0;
156 fhMCEDispEtaPhiDiff[i] = 0;
157 fhMCESphericity [i] = 0;
160 for(Int_t i = 0; i < 5; i++)
162 fhClusterCuts[i] = 0;
165 // Track matching residuals
166 for(Int_t i = 0; i < 2; i++)
168 fhTrackMatchedDEta[i] = 0; fhTrackMatchedDPhi[i] = 0; fhTrackMatchedDEtaDPhi[i] = 0;
169 fhTrackMatchedDEtaTRD[i] = 0; fhTrackMatchedDPhiTRD[i] = 0;
170 fhTrackMatchedDEtaMCOverlap[i] = 0; fhTrackMatchedDPhiMCOverlap[i] = 0;
171 fhTrackMatchedDEtaMCNoOverlap[i] = 0; fhTrackMatchedDPhiMCNoOverlap[i] = 0;
172 fhTrackMatchedDEtaMCConversion[i] = 0; fhTrackMatchedDPhiMCConversion[i] = 0;
173 fhTrackMatchedMCParticle[i] = 0; fhTrackMatchedMCParticle[i] = 0;
174 fhdEdx[i] = 0; fhEOverP[i] = 0;
178 //Initialize parameters
183 //__________________________________________________________________________
184 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom)
186 //Select clusters if they pass different cuts
188 printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
189 GetReader()->GetEventNumber(),
190 calo->E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
192 fhClusterCuts[1]->Fill(calo->E());
194 //.......................................
195 //If too small or big energy, skip it
196 if(calo->E() < GetMinEnergy() || calo->E() > GetMaxEnergy() ) return kFALSE ;
198 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
200 fhClusterCuts[2]->Fill(calo->E());
202 //.......................................
203 // TOF cut, BE CAREFUL WITH THIS CUT
204 Double_t tof = calo->GetTOF()*1e9;
205 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
207 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
209 fhClusterCuts[3]->Fill(calo->E());
211 //.......................................
212 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
214 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
216 fhClusterCuts[4]->Fill(calo->E());
218 //.......................................
219 //Check acceptance selection
220 if(IsFiducialCutOn())
222 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
223 if(! in ) return kFALSE ;
226 if(GetDebug() > 2) printf("Fiducial cut passed \n");
228 fhClusterCuts[5]->Fill(calo->E());
230 //.......................................
231 //Skip matched clusters with tracks
233 // Fill matching residual histograms before PID cuts
234 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,0);
236 if(fRejectTrackMatch)
238 if(IsTrackMatched(calo,GetReader()->GetInputEvent()))
240 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
244 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
245 }// reject matched clusters
247 fhClusterCuts[6]->Fill(calo->E());
249 //.......................................
250 //Check Distance to Bad channel, set bit.
251 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
252 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
253 if(distBad < fMinDist)
254 {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
257 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
259 fhClusterCuts[7]->Fill(calo->E());
262 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
263 GetReader()->GetEventNumber(),
264 calo->E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
266 //All checks passed, cluster selected
271 //___________________________________________
272 void AliAnaPhoton::FillAcceptanceHistograms()
274 //Fill acceptance histograms if MC data is available
276 Double_t photonY = -100 ;
277 Double_t photonE = -1 ;
278 Double_t photonPt = -1 ;
279 Double_t photonPhi = 100 ;
280 Double_t photonEta = -1 ;
285 Bool_t inacceptance = kFALSE;
287 if(GetReader()->ReadStack())
289 AliStack * stack = GetMCStack();
292 for(Int_t i=0 ; i<stack->GetNtrack(); i++)
294 TParticle * prim = stack->Particle(i) ;
295 pdg = prim->GetPdgCode();
296 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
297 // prim->GetName(), prim->GetPdgCode());
301 // Get tag of this particle photon from fragmentation, decay, prompt ...
302 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
303 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
305 //A conversion photon from a hadron, skip this kind of photon
306 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
307 // GetMCAnalysisUtils()->PrintMCTag(tag);
312 //Get photon kinematics
313 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
315 photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
316 photonE = prim->Energy() ;
317 photonPt = prim->Pt() ;
318 photonPhi = TMath::RadToDeg()*prim->Phi() ;
319 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
320 photonEta = prim->Eta() ;
322 //Check if photons hit the Calorimeter
325 inacceptance = kFALSE;
326 if (fCalorimeter == "PHOS")
328 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
332 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
333 inacceptance = kTRUE;
334 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
338 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
339 inacceptance = kTRUE ;
340 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
343 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
345 if(GetEMCALGeometry())
349 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
352 inacceptance = kTRUE;
354 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
355 // inacceptance = kTRUE;
356 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
360 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
361 inacceptance = kTRUE ;
362 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
367 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
368 if(TMath::Abs(photonY) < 1.0)
370 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
371 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
372 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
373 fhYPrimMC [kmcPPhoton]->Fill(photonE , photonEta) ;
377 fhEPrimMCAcc [kmcPPhoton]->Fill(photonE ) ;
378 fhPtPrimMCAcc [kmcPPhoton]->Fill(photonPt) ;
379 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
380 fhYPrimMCAcc [kmcPPhoton]->Fill(photonE , photonY) ;
384 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
386 mcIndex = kmcPPrompt;
388 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
390 mcIndex = kmcPFragmentation ;
392 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
396 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
398 mcIndex = kmcPPi0Decay;
400 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
401 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
403 mcIndex = kmcPOtherDecay;
405 else if(fhEPrimMC[kmcPOther])
410 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
411 if(TMath::Abs(photonY) < 1.0)
413 fhEPrimMC [mcIndex]->Fill(photonE ) ;
414 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
415 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
416 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
420 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
421 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
422 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
423 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
428 }//stack exists and data is MC
430 else if(GetReader()->ReadAODMCParticles())
432 TClonesArray * mcparticles = GetReader()->GetAODMCParticles(0);
435 Int_t nprim = mcparticles->GetEntriesFast();
437 for(Int_t i=0; i < nprim; i++)
439 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
441 pdg = prim->GetPdgCode();
445 // Get tag of this particle photon from fragmentation, decay, prompt ...
446 tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
447 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton))
449 //A conversion photon from a hadron, skip this kind of photon
450 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!\n ");
451 // GetMCAnalysisUtils()->PrintMCTag(tag);
456 //Get photon kinematics
457 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
459 photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
460 photonE = prim->E() ;
461 photonPt = prim->Pt() ;
462 photonPhi = prim->Phi() ;
463 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
464 photonEta = prim->Eta() ;
466 //Check if photons hit the Calorimeter
468 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
469 inacceptance = kFALSE;
470 if (fCalorimeter == "PHOS")
472 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet())
476 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
477 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
478 inacceptance = kTRUE;
479 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
483 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
484 inacceptance = kTRUE ;
485 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
488 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet())
490 if(GetEMCALGeometry())
494 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
497 inacceptance = kTRUE;
499 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
503 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
504 inacceptance = kTRUE ;
505 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
511 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
512 if(TMath::Abs(photonY) < 1.0)
514 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
515 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
516 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
517 fhYPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
522 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
523 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
524 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
525 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
529 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
531 mcIndex = kmcPPrompt;
533 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
535 mcIndex = kmcPFragmentation ;
537 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
541 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
543 mcIndex = kmcPPi0Decay;
545 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
546 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
548 mcIndex = kmcPOtherDecay;
550 else if(fhEPrimMC[kmcPOther])
555 fhYPrimMC[mcIndex]->Fill(photonPt, photonY) ;
556 if(TMath::Abs(photonY) < 1.0)
558 fhEPrimMC [mcIndex]->Fill(photonE ) ;
559 fhPtPrimMC [mcIndex]->Fill(photonPt) ;
560 fhPhiPrimMC[mcIndex]->Fill(photonE , photonPhi) ;
561 fhYPrimMC [mcIndex]->Fill(photonE , photonEta) ;
565 fhEPrimMCAcc [mcIndex]->Fill(photonE ) ;
566 fhPtPrimMCAcc [mcIndex]->Fill(photonPt) ;
567 fhPhiPrimMCAcc[mcIndex]->Fill(photonE , photonPhi) ;
568 fhYPrimMCAcc [mcIndex]->Fill(photonE , photonY) ;
574 }//kmc array exists and data is MC
578 //____________________________________________________________________________________
579 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, const Int_t mcTag)
581 //Fill cluster Shower Shape histograms
583 if(!fFillSSHistograms || GetMixedEvent()) return;
585 Float_t energy = cluster->E();
586 Int_t ncells = cluster->GetNCells();
587 Float_t lambda0 = cluster->GetM02();
588 Float_t lambda1 = cluster->GetM20();
589 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
592 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
594 cluster->GetMomentum(mom,GetVertex(0)) ;
595 }//Assume that come from vertex in straight line
598 Double_t vertex[]={0,0,0};
599 cluster->GetMomentum(mom,vertex) ;
602 Float_t eta = mom.Eta();
603 Float_t phi = mom.Phi();
604 if(phi < 0) phi+=TMath::TwoPi();
606 fhLam0E ->Fill(energy,lambda0);
607 fhLam1E ->Fill(energy,lambda1);
608 fhDispE ->Fill(energy,disp);
610 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
612 fhLam0ETRD->Fill(energy,lambda0);
613 fhLam1ETRD->Fill(energy,lambda1);
614 fhDispETRD->Fill(energy,disp);
617 Float_t l0 = 0., l1 = 0.;
618 Float_t dispp= 0., dEta = 0., dPhi = 0.;
619 Float_t sEta = 0., sPhi = 0., sEtaPhi = 0.;
620 if(fCalorimeter == "EMCAL" && !fFillOnlySimpleSSHisto)
622 GetCaloUtils()->GetEMCALRecoUtils()->RecalculateClusterShowerShapeParameters(GetEMCALGeometry(), GetReader()->GetInputEvent()->GetEMCALCells(), cluster,
623 l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi);
624 //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",
625 // l0, l1, dispp, dEta, dPhi, sEta, sPhi, sEtaPhi );
626 //printf("AliAnaPhoton::FillShowerShapeHistogram - dispersion %f, dispersion eta+phi %f \n",
627 // disp, dPhi+dEta );
628 fhDispEtaE -> Fill(energy,dEta);
629 fhDispPhiE -> Fill(energy,dPhi);
630 fhSumEtaE -> Fill(energy,sEta);
631 fhSumPhiE -> Fill(energy,sPhi);
632 fhSumEtaPhiE -> Fill(energy,sEtaPhi);
633 fhDispEtaPhiDiffE -> Fill(energy,dPhi-dEta);
634 if(dEta+dPhi>0)fhSphericityE -> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
635 if(dEta+sEta>0)fhDispSumEtaDiffE -> Fill(energy,(dEta-sEta)/((dEta+sEta)/2.));
636 if(dPhi+sPhi>0)fhDispSumPhiDiffE -> Fill(energy,(dPhi-sPhi)/((dPhi+sPhi)/2.));
639 if (energy < 2 ) ebin = 0;
640 else if (energy < 4 ) ebin = 1;
641 else if (energy < 6 ) ebin = 2;
642 else if (energy < 10) ebin = 3;
643 else if (energy < 15) ebin = 4;
644 else if (energy < 20) ebin = 5;
647 fhDispEtaDispPhi[ebin]->Fill(dEta ,dPhi);
648 fhLambda0DispEta[ebin]->Fill(lambda0,dEta);
649 fhLambda0DispPhi[ebin]->Fill(lambda0,dPhi);
653 // if track-matching was of, check effect of track-matching residual cut
655 if(!fRejectTrackMatch)
657 Float_t dZ = cluster->GetTrackDz();
658 Float_t dR = cluster->GetTrackDx();
659 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
661 dR = 2000., dZ = 2000.;
662 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
665 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
667 fhLam0ETM ->Fill(energy,lambda0);
668 fhLam1ETM ->Fill(energy,lambda1);
669 fhDispETM ->Fill(energy,disp);
671 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5)
673 fhLam0ETMTRD->Fill(energy,lambda0);
674 fhLam1ETMTRD->Fill(energy,lambda1);
675 fhDispETMTRD->Fill(energy,disp);
678 }// if track-matching was of, check effect of matching residual cut
681 if(!fFillOnlySimpleSSHisto){
684 fhNCellsLam0LowE ->Fill(ncells,lambda0);
685 fhNCellsLam1LowE ->Fill(ncells,lambda1);
686 fhNCellsDispLowE ->Fill(ncells,disp);
688 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
689 fhLam0DispLowE ->Fill(lambda0,disp);
690 fhDispLam1LowE ->Fill(disp,lambda1);
691 fhEtaLam0LowE ->Fill(eta,lambda0);
692 fhPhiLam0LowE ->Fill(phi,lambda0);
696 fhNCellsLam0HighE ->Fill(ncells,lambda0);
697 fhNCellsLam1HighE ->Fill(ncells,lambda1);
698 fhNCellsDispHighE ->Fill(ncells,disp);
700 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
701 fhLam0DispHighE ->Fill(lambda0,disp);
702 fhDispLam1HighE ->Fill(disp,lambda1);
703 fhEtaLam0HighE ->Fill(eta, lambda0);
704 fhPhiLam0HighE ->Fill(phi, lambda0);
710 AliVCaloCells* cells = 0;
711 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
712 else cells = GetPHOSCells();
714 //Fill histograms to check shape of embedded clusters
715 Float_t fraction = 0;
716 if(GetReader()->IsEmbeddedClusterSelectionOn())
717 {//Only working for EMCAL
718 Float_t clusterE = 0; // recalculate in case corrections applied.
720 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
722 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
724 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
727 //Fraction of total energy due to the embedded signal
731 printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
733 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
735 } // embedded fraction
737 // Get the fraction of the cluster energy that carries the cell with highest energy
739 Float_t maxCellFraction = 0.;
741 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
743 // Check the origin and fill histograms
747 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
748 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
749 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
750 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta))
752 mcIndex = kmcssPhoton ;
754 if(!GetReader()->IsEmbeddedClusterSelectionOn())
756 //Check particle overlaps in cluster
758 // Compare the primary depositing more energy with the rest,
759 // if no photon/electron as comon ancestor (conversions), count as other particle
760 Int_t ancPDG = 0, ancStatus = -1;
761 TLorentzVector momentum; TVector3 prodVertex;
764 for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ )
766 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab],
767 GetReader(),ancPDG,ancStatus,momentum,prodVertex);
768 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
770 //printf("N overlaps %d \n",noverlaps);
774 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
776 else if(noverlaps == 2)
778 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
780 else if(noverlaps > 2)
782 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
786 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
790 //Fill histograms to check shape of embedded clusters
791 if(GetReader()->IsEmbeddedClusterSelectionOn())
795 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
797 else if(fraction > 0.5)
799 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
801 else if(fraction > 0.1)
803 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
807 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
811 }//photon no conversion
812 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron))
814 mcIndex = kmcssElectron ;
816 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
817 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) )
819 mcIndex = kmcssConversion ;
821 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) )
825 //Fill histograms to check shape of embedded clusters
826 if(GetReader()->IsEmbeddedClusterSelectionOn())
830 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
832 else if(fraction > 0.5)
834 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
836 else if(fraction > 0.1)
838 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
842 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
847 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) )
853 mcIndex = kmcssOther ;
856 fhMCELambda0 [mcIndex]->Fill(energy, lambda0);
857 fhMCELambda1 [mcIndex]->Fill(energy, lambda1);
858 fhMCEDispersion [mcIndex]->Fill(energy, disp);
859 fhMCNCellsE [mcIndex]->Fill(energy, ncells);
860 fhMCMaxCellDiffClusterE[mcIndex]->Fill(energy, maxCellFraction);
862 if(!fFillOnlySimpleSSHisto)
866 fhMCLambda0vsClusterMaxCellDiffE0[mcIndex]->Fill(lambda0, maxCellFraction);
867 fhMCNCellsvsClusterMaxCellDiffE0 [mcIndex]->Fill(ncells, maxCellFraction);
871 fhMCLambda0vsClusterMaxCellDiffE2[mcIndex]->Fill(lambda0, maxCellFraction);
872 fhMCNCellsvsClusterMaxCellDiffE2 [mcIndex]->Fill(ncells, maxCellFraction);
876 fhMCLambda0vsClusterMaxCellDiffE6[mcIndex]->Fill(lambda0, maxCellFraction);
877 fhMCNCellsvsClusterMaxCellDiffE6 [mcIndex]->Fill(ncells, maxCellFraction);
880 if(fCalorimeter == "EMCAL")
882 fhMCEDispEta [mcIndex]-> Fill(energy,dEta);
883 fhMCEDispPhi [mcIndex]-> Fill(energy,dPhi);
884 fhMCESumEtaPhi [mcIndex]-> Fill(energy,sEtaPhi);
885 fhMCEDispEtaPhiDiff [mcIndex]-> Fill(energy,dPhi-dEta);
886 if(dEta+dPhi>0)fhMCESphericity[mcIndex]-> Fill(energy,(dPhi-dEta)/(dEta+dPhi));
889 if (energy < 2 ) ebin = 0;
890 else if (energy < 4 ) ebin = 1;
891 else if (energy < 6 ) ebin = 2;
892 else if (energy < 10) ebin = 3;
893 else if (energy < 15) ebin = 4;
894 else if (energy < 20) ebin = 5;
897 fhMCDispEtaDispPhi[ebin][mcIndex]->Fill(dEta ,dPhi);
898 fhMCLambda0DispEta[ebin][mcIndex]->Fill(lambda0,dEta);
899 fhMCLambda0DispPhi[ebin][mcIndex]->Fill(lambda0,dPhi);
906 //__________________________________________________________________________
907 void AliAnaPhoton::FillTrackMatchingResidualHistograms(AliVCluster* cluster,
910 // If selected, fill histograms with residuals of matched clusters, help to define track matching cut
911 // Residual filled for different cuts 0 (No cut), after 1 PID cut
913 Float_t dZ = cluster->GetTrackDz();
914 Float_t dR = cluster->GetTrackDx();
916 if(cluster->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn())
918 dR = 2000., dZ = 2000.;
919 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(cluster->GetID(),dZ,dR);
922 if(fhTrackMatchedDEta[cut] && TMath::Abs(dR) < 999)
924 fhTrackMatchedDEta[cut]->Fill(cluster->E(),dZ);
925 fhTrackMatchedDPhi[cut]->Fill(cluster->E(),dR);
927 if(cluster->E() > 0.5) fhTrackMatchedDEtaDPhi[cut]->Fill(dZ,dR);
929 Int_t nSMod = GetModuleNumber(cluster);
931 if(fCalorimeter=="EMCAL" && nSMod > 5)
933 fhTrackMatchedDEtaTRD[cut]->Fill(cluster->E(),dZ);
934 fhTrackMatchedDPhiTRD[cut]->Fill(cluster->E(),dR);
937 // Check dEdx and E/p of matched clusters
939 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
942 AliVTrack *track = GetCaloUtils()->GetMatchedTrack(cluster, GetReader()->GetInputEvent());
947 Float_t dEdx = track->GetTPCsignal();
948 Float_t eOverp = cluster->E()/track->P();
950 fhdEdx[cut] ->Fill(cluster->E(), dEdx);
951 fhEOverP[cut]->Fill(cluster->E(), eOverp);
953 if(fCalorimeter=="EMCAL" && nSMod > 5)
954 fhEOverPTRD[cut]->Fill(cluster->E(), eOverp);
959 printf("AliAnaPhoton::FillTrackMatchingResidualHistograms() - Residual OK but (dR, dZ)= (%2.4f,%2.4f) no track associated WHAT? \n", dR,dZ);
966 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(cluster->GetLabels(),cluster->GetNLabels(),GetReader(), 0);
968 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) )
970 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
971 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 2.5 );
972 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 0.5 );
973 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 1.5 );
974 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 3.5 );
976 // Check if several particles contributed to cluster and discard overlapped mesons
977 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
978 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
980 if(cluster->GetNLabels()==1)
982 fhTrackMatchedDEtaMCNoOverlap[cut]->Fill(cluster->E(),dZ);
983 fhTrackMatchedDPhiMCNoOverlap[cut]->Fill(cluster->E(),dR);
987 fhTrackMatchedDEtaMCOverlap[cut]->Fill(cluster->E(),dZ);
988 fhTrackMatchedDPhiMCOverlap[cut]->Fill(cluster->E(),dR);
996 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
997 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 6.5 );
998 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 4.5 );
999 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 5.5 );
1000 else fhTrackMatchedMCParticle[cut]->Fill(cluster->E(), 7.5 );
1002 // Check if several particles contributed to cluster
1003 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1004 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta))
1006 fhTrackMatchedDEtaMCConversion[cut]->Fill(cluster->E(),dZ);
1007 fhTrackMatchedDPhiMCConversion[cut]->Fill(cluster->E(),dR);
1015 } // residuals window
1021 //___________________________________________
1022 TObjString * AliAnaPhoton::GetAnalysisCuts()
1024 //Save parameters used for analysis
1025 TString parList ; //this will be list of parameters used for this analysis.
1026 const Int_t buffersize = 255;
1027 char onePar[buffersize] ;
1029 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
1031 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1033 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
1035 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
1037 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
1039 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
1042 //Get parameters set in base class.
1043 parList += GetBaseParametersList() ;
1045 //Get parameters set in PID class.
1046 parList += GetCaloPID()->GetPIDParametersList() ;
1048 //Get parameters set in FiducialCut class (not available yet)
1049 //parlist += GetFidCut()->GetFidCutParametersList()
1051 return new TObjString(parList) ;
1054 //________________________________________________________________________
1055 TList * AliAnaPhoton::GetCreateOutputObjects()
1057 // Create histograms to be saved in output file and
1058 // store them in outputContainer
1059 TList * outputContainer = new TList() ;
1060 outputContainer->SetName("PhotonHistos") ;
1062 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1063 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1064 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1065 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1066 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1067 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1069 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1070 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1071 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1072 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1073 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1074 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1076 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1077 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1078 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1079 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1080 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1081 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1083 Int_t bin[] = {0,2,4,6,10,15,20,100}; // energy bins for SS studies
1085 TString cut[] = {"Open","Reader","E","Time","NCells","Fidutial","Matching","Bad","PID"};
1086 for (Int_t i = 0; i < 9 ; i++)
1088 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1089 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1090 nptbins,ptmin,ptmax);
1091 fhClusterCuts[i]->SetYTitle("dN/dE ");
1092 fhClusterCuts[i]->SetXTitle("E (GeV)");
1093 outputContainer->Add(fhClusterCuts[i]) ;
1096 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1097 fhNCellsE->SetXTitle("E (GeV)");
1098 fhNCellsE->SetYTitle("# of cells in cluster");
1099 outputContainer->Add(fhNCellsE);
1101 fhCellsE = new TH2F ("hCellsE","energy of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nptbins*2,ptmin,ptmax);
1102 fhCellsE->SetXTitle("E_{cluster} (GeV)");
1103 fhCellsE->SetYTitle("E_{cell} (GeV)");
1104 outputContainer->Add(fhCellsE);
1106 fhTimeE = new TH2F ("hTimeE","time of cluster vs E of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1107 fhTimeE->SetXTitle("E (GeV)");
1108 fhTimeE->SetYTitle("time (ns)");
1109 outputContainer->Add(fhTimeE);
1111 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1112 nptbins,ptmin,ptmax, 500,0,1.);
1113 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1114 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1115 outputContainer->Add(fhMaxCellDiffClusterE);
1117 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1118 fhEPhoton->SetYTitle("N");
1119 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1120 outputContainer->Add(fhEPhoton) ;
1122 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
1123 fhPtPhoton->SetYTitle("N");
1124 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1125 outputContainer->Add(fhPtPhoton) ;
1127 fhPhiPhoton = new TH2F
1128 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1129 fhPhiPhoton->SetYTitle("#phi (rad)");
1130 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1131 outputContainer->Add(fhPhiPhoton) ;
1133 fhEtaPhoton = new TH2F
1134 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1135 fhEtaPhoton->SetYTitle("#eta");
1136 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1137 outputContainer->Add(fhEtaPhoton) ;
1139 fhEtaPhiPhoton = new TH2F
1140 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1141 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1142 fhEtaPhiPhoton->SetXTitle("#eta");
1143 outputContainer->Add(fhEtaPhiPhoton) ;
1144 if(GetMinPt() < 0.5)
1146 fhEtaPhi05Photon = new TH2F
1147 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1148 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1149 fhEtaPhi05Photon->SetXTitle("#eta");
1150 outputContainer->Add(fhEtaPhi05Photon) ;
1154 if(fFillSSHistograms)
1156 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1157 fhLam0E->SetYTitle("#lambda_{0}^{2}");
1158 fhLam0E->SetXTitle("E (GeV)");
1159 outputContainer->Add(fhLam0E);
1161 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1162 fhLam1E->SetYTitle("#lambda_{1}^{2}");
1163 fhLam1E->SetXTitle("E (GeV)");
1164 outputContainer->Add(fhLam1E);
1166 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1167 fhDispE->SetYTitle("D^{2}");
1168 fhDispE->SetXTitle("E (GeV) ");
1169 outputContainer->Add(fhDispE);
1171 if(!fRejectTrackMatch)
1173 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);
1174 fhLam0ETM->SetYTitle("#lambda_{0}^{2}");
1175 fhLam0ETM->SetXTitle("E (GeV)");
1176 outputContainer->Add(fhLam0ETM);
1178 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);
1179 fhLam1ETM->SetYTitle("#lambda_{1}^{2}");
1180 fhLam1ETM->SetXTitle("E (GeV)");
1181 outputContainer->Add(fhLam1ETM);
1183 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);
1184 fhDispETM->SetYTitle("D^{2}");
1185 fhDispETM->SetXTitle("E (GeV) ");
1186 outputContainer->Add(fhDispETM);
1189 if(fCalorimeter == "EMCAL")
1191 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1192 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1193 fhLam0ETRD->SetXTitle("E (GeV)");
1194 outputContainer->Add(fhLam0ETRD);
1196 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1197 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1198 fhLam1ETRD->SetXTitle("E (GeV)");
1199 outputContainer->Add(fhLam1ETRD);
1201 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1202 fhDispETRD->SetYTitle("Dispersion^{2}");
1203 fhDispETRD->SetXTitle("E (GeV) ");
1204 outputContainer->Add(fhDispETRD);
1206 if(!fRejectTrackMatch)
1208 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);
1209 fhLam0ETMTRD->SetYTitle("#lambda_{0}^{2}");
1210 fhLam0ETMTRD->SetXTitle("E (GeV)");
1211 outputContainer->Add(fhLam0ETMTRD);
1213 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);
1214 fhLam1ETMTRD->SetYTitle("#lambda_{1}^{2}");
1215 fhLam1ETMTRD->SetXTitle("E (GeV)");
1216 outputContainer->Add(fhLam1ETMTRD);
1218 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);
1219 fhDispETMTRD->SetYTitle("Dispersion^{2}");
1220 fhDispETMTRD->SetXTitle("E (GeV) ");
1221 outputContainer->Add(fhDispETMTRD);
1225 if(!fFillOnlySimpleSSHisto)
1227 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1228 fhNCellsLam0LowE->SetXTitle("N_{cells}");
1229 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1230 outputContainer->Add(fhNCellsLam0LowE);
1232 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1233 fhNCellsLam0HighE->SetXTitle("N_{cells}");
1234 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1235 outputContainer->Add(fhNCellsLam0HighE);
1237 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1238 fhNCellsLam1LowE->SetXTitle("N_{cells}");
1239 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1240 outputContainer->Add(fhNCellsLam1LowE);
1242 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1243 fhNCellsLam1HighE->SetXTitle("N_{cells}");
1244 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1245 outputContainer->Add(fhNCellsLam1HighE);
1247 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1248 fhNCellsDispLowE->SetXTitle("N_{cells}");
1249 fhNCellsDispLowE->SetYTitle("D^{2}");
1250 outputContainer->Add(fhNCellsDispLowE);
1252 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1253 fhNCellsDispHighE->SetXTitle("N_{cells}");
1254 fhNCellsDispHighE->SetYTitle("D^{2}");
1255 outputContainer->Add(fhNCellsDispHighE);
1257 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1258 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1259 fhEtaLam0LowE->SetXTitle("#eta");
1260 outputContainer->Add(fhEtaLam0LowE);
1262 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1263 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1264 fhPhiLam0LowE->SetXTitle("#phi");
1265 outputContainer->Add(fhPhiLam0LowE);
1267 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1268 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1269 fhEtaLam0HighE->SetXTitle("#eta");
1270 outputContainer->Add(fhEtaLam0HighE);
1272 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1273 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1274 fhPhiLam0HighE->SetXTitle("#phi");
1275 outputContainer->Add(fhPhiLam0HighE);
1277 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1278 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1279 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1280 outputContainer->Add(fhLam1Lam0LowE);
1282 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1283 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1284 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1285 outputContainer->Add(fhLam1Lam0HighE);
1287 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1288 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1289 fhLam0DispLowE->SetYTitle("D^{2}");
1290 outputContainer->Add(fhLam0DispLowE);
1292 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1293 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1294 fhLam0DispHighE->SetYTitle("D^{2}");
1295 outputContainer->Add(fhLam0DispHighE);
1297 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1298 fhDispLam1LowE->SetXTitle("D^{2}");
1299 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1300 outputContainer->Add(fhDispLam1LowE);
1302 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1303 fhDispLam1HighE->SetXTitle("D^{2}");
1304 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1305 outputContainer->Add(fhDispLam1HighE);
1307 if(fCalorimeter == "EMCAL")
1309 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);
1310 fhDispEtaE->SetXTitle("E (GeV)");
1311 fhDispEtaE->SetYTitle("#sigma^{2}_{#eta #eta}");
1312 outputContainer->Add(fhDispEtaE);
1314 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);
1315 fhDispPhiE->SetXTitle("E (GeV)");
1316 fhDispPhiE->SetYTitle("#sigma^{2}_{#phi #phi}");
1317 outputContainer->Add(fhDispPhiE);
1319 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);
1320 fhSumEtaE->SetXTitle("E (GeV)");
1321 fhSumEtaE->SetYTitle("#delta^{2}_{#eta #eta}");
1322 outputContainer->Add(fhSumEtaE);
1324 fhSumPhiE = new TH2F ("hSumPhiE","#delta^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i})^{2}/ #Sigma w_{i} - <#phi>^{2} vs E",
1325 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1326 fhSumPhiE->SetXTitle("E (GeV)");
1327 fhSumPhiE->SetYTitle("#delta^{2}_{#phi #phi}");
1328 outputContainer->Add(fhSumPhiE);
1330 fhSumEtaPhiE = new TH2F ("hSumEtaPhiE","#delta^{2}_{#eta #phi} = #Sigma w_{i}(#phi_{i} #eta_{i} ) / #Sigma w_{i} - <#phi><#eta> vs E",
1331 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1332 fhSumEtaPhiE->SetXTitle("E (GeV)");
1333 fhSumEtaPhiE->SetYTitle("#delta^{2}_{#eta #phi}");
1334 outputContainer->Add(fhSumEtaPhiE);
1336 fhDispEtaPhiDiffE = new TH2F ("hDispEtaPhiDiffE","#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",
1337 nptbins,ptmin,ptmax,200, -10,10);
1338 fhDispEtaPhiDiffE->SetXTitle("E (GeV)");
1339 fhDispEtaPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1340 outputContainer->Add(fhDispEtaPhiDiffE);
1342 fhSphericityE = new TH2F ("hSphericityE","(#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi}) vs E",
1343 nptbins,ptmin,ptmax, 200, -1,1);
1344 fhSphericityE->SetXTitle("E (GeV)");
1345 fhSphericityE->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1346 outputContainer->Add(fhSphericityE);
1348 fhDispSumEtaDiffE = new TH2F ("hDispSumEtaDiffE","#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1349 fhDispSumEtaDiffE->SetXTitle("E (GeV)");
1350 fhDispSumEtaDiffE->SetYTitle("#sigma^{2}_{#eta #eta} - #delta^{2}_{#eta #eta} / average");
1351 outputContainer->Add(fhDispSumEtaDiffE);
1353 fhDispSumPhiDiffE = new TH2F ("hDispSumPhiDiffE","#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average vs E", nptbins,ptmin,ptmax, 200,-0.01,0.01);
1354 fhDispSumPhiDiffE->SetXTitle("E (GeV)");
1355 fhDispSumPhiDiffE->SetYTitle("#sigma^{2}_{#phi #phi} - #delta^{2}_{#phi #phi} / average");
1356 outputContainer->Add(fhDispSumPhiDiffE);
1358 for(Int_t i = 0; i < 7; i++)
1360 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]),
1361 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1362 fhDispEtaDispPhi[i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1363 fhDispEtaDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1364 outputContainer->Add(fhDispEtaDispPhi[i]);
1366 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]),
1367 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1368 fhLambda0DispEta[i]->SetXTitle("#lambda^{2}_{0}");
1369 fhLambda0DispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1370 outputContainer->Add(fhLambda0DispEta[i]);
1372 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]),
1373 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1374 fhLambda0DispPhi[i]->SetXTitle("#lambda^{2}_{0}");
1375 fhLambda0DispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1376 outputContainer->Add(fhLambda0DispPhi[i]);
1386 fhTrackMatchedDEta[0] = new TH2F
1387 ("hTrackMatchedDEtaNoCut",
1388 "d#eta of cluster-track vs cluster energy, no photon cuts",
1389 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1390 fhTrackMatchedDEta[0]->SetYTitle("d#eta");
1391 fhTrackMatchedDEta[0]->SetXTitle("E_{cluster} (GeV)");
1393 fhTrackMatchedDPhi[0] = new TH2F
1394 ("hTrackMatchedDPhiNoCut",
1395 "d#phi of cluster-track vs cluster energy, no photon cuts",
1396 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1397 fhTrackMatchedDPhi[0]->SetYTitle("d#phi (rad)");
1398 fhTrackMatchedDPhi[0]->SetXTitle("E_{cluster} (GeV)");
1400 fhTrackMatchedDEtaDPhi[0] = new TH2F
1401 ("hTrackMatchedDEtaDPhiNoCut",
1402 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1403 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1404 fhTrackMatchedDEtaDPhi[0]->SetYTitle("d#phi (rad)");
1405 fhTrackMatchedDEtaDPhi[0]->SetXTitle("d#eta");
1407 fhdEdx[0] = new TH2F ("hdEdxNoCut","matched track <dE/dx> vs cluster E, no photon cuts ",
1408 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1409 fhdEdx[0]->SetXTitle("E (GeV)");
1410 fhdEdx[0]->SetYTitle("<dE/dx>");
1412 fhEOverP[0] = new TH2F ("hEOverPNoCut","matched track E/p vs cluster E, no photon cuts ",
1413 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1414 fhEOverP[0]->SetXTitle("E (GeV)");
1415 fhEOverP[0]->SetYTitle("E/p");
1417 outputContainer->Add(fhTrackMatchedDEta[0]) ;
1418 outputContainer->Add(fhTrackMatchedDPhi[0]) ;
1419 outputContainer->Add(fhTrackMatchedDEtaDPhi[0]) ;
1420 outputContainer->Add(fhdEdx[0]);
1421 outputContainer->Add(fhEOverP[0]);
1423 fhTrackMatchedDEta[1] = new TH2F
1424 ("hTrackMatchedDEta",
1425 "d#eta of cluster-track vs cluster energy, no photon cuts",
1426 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1427 fhTrackMatchedDEta[1]->SetYTitle("d#eta");
1428 fhTrackMatchedDEta[1]->SetXTitle("E_{cluster} (GeV)");
1430 fhTrackMatchedDPhi[1] = new TH2F
1431 ("hTrackMatchedDPhi",
1432 "d#phi of cluster-track vs cluster energy, no photon cuts",
1433 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1434 fhTrackMatchedDPhi[1]->SetYTitle("d#phi (rad)");
1435 fhTrackMatchedDPhi[1]->SetXTitle("E_{cluster} (GeV)");
1437 fhTrackMatchedDEtaDPhi[1] = new TH2F
1438 ("hTrackMatchedDEtaDPhi",
1439 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1440 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1441 fhTrackMatchedDEtaDPhi[1]->SetYTitle("d#phi (rad)");
1442 fhTrackMatchedDEtaDPhi[1]->SetXTitle("d#eta");
1444 fhdEdx[1] = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ",
1445 nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1446 fhdEdx[1]->SetXTitle("E (GeV)");
1447 fhdEdx[1]->SetYTitle("<dE/dx>");
1449 fhEOverP[1] = new TH2F ("hEOverP","matched track E/p vs cluster E ",
1450 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1451 fhEOverP[1]->SetXTitle("E (GeV)");
1452 fhEOverP[1]->SetYTitle("E/p");
1454 outputContainer->Add(fhTrackMatchedDEta[1]) ;
1455 outputContainer->Add(fhTrackMatchedDPhi[1]) ;
1456 outputContainer->Add(fhTrackMatchedDEtaDPhi[1]) ;
1457 outputContainer->Add(fhdEdx[1]);
1458 outputContainer->Add(fhEOverP[1]);
1460 if(fCalorimeter=="EMCAL")
1462 fhTrackMatchedDEtaTRD[0] = new TH2F
1463 ("hTrackMatchedDEtaTRDNoCut",
1464 "d#eta of cluster-track vs cluster energy, SM behind TRD, no photon cuts",
1465 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1466 fhTrackMatchedDEtaTRD[0]->SetYTitle("d#eta");
1467 fhTrackMatchedDEtaTRD[0]->SetXTitle("E_{cluster} (GeV)");
1469 fhTrackMatchedDPhiTRD[0] = new TH2F
1470 ("hTrackMatchedDPhiTRDNoCut",
1471 "d#phi of cluster-track vs cluster energy, SM behing TRD, no photon cuts",
1472 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1473 fhTrackMatchedDPhiTRD[0]->SetYTitle("d#phi (rad)");
1474 fhTrackMatchedDPhiTRD[0]->SetXTitle("E_{cluster} (GeV)");
1476 fhEOverPTRD[0] = new TH2F ("hEOverPTRDNoCut","matched track E/p vs cluster E, behind TRD, no photon cuts ",
1477 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1478 fhEOverPTRD[0]->SetXTitle("E (GeV)");
1479 fhEOverPTRD[0]->SetYTitle("E/p");
1481 outputContainer->Add(fhTrackMatchedDEtaTRD[0]) ;
1482 outputContainer->Add(fhTrackMatchedDPhiTRD[0]) ;
1483 outputContainer->Add(fhEOverPTRD[0]);
1485 fhTrackMatchedDEtaTRD[1] = new TH2F
1486 ("hTrackMatchedDEtaTRD",
1487 "d#eta of cluster-track vs cluster energy, SM behind TRD",
1488 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1489 fhTrackMatchedDEtaTRD[1]->SetYTitle("d#eta");
1490 fhTrackMatchedDEtaTRD[1]->SetXTitle("E_{cluster} (GeV)");
1492 fhTrackMatchedDPhiTRD[1] = new TH2F
1493 ("hTrackMatchedDPhiTRD",
1494 "d#phi of cluster-track vs cluster energy, SM behing TRD",
1495 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1496 fhTrackMatchedDPhiTRD[1]->SetYTitle("d#phi (rad)");
1497 fhTrackMatchedDPhiTRD[1]->SetXTitle("E_{cluster} (GeV)");
1499 fhEOverPTRD[1] = new TH2F ("hEOverPTRD","matched track E/p vs cluster E, behind TRD ",
1500 nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1501 fhEOverPTRD[1]->SetXTitle("E (GeV)");
1502 fhEOverPTRD[1]->SetYTitle("E/p");
1504 outputContainer->Add(fhTrackMatchedDEtaTRD[1]) ;
1505 outputContainer->Add(fhTrackMatchedDPhiTRD[1]) ;
1506 outputContainer->Add(fhEOverPTRD[1]);
1512 fhTrackMatchedDEtaMCNoOverlap[0] = new TH2F
1513 ("hTrackMatchedDEtaMCNoOverlapNoCut",
1514 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1515 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1516 fhTrackMatchedDEtaMCNoOverlap[0]->SetYTitle("d#eta");
1517 fhTrackMatchedDEtaMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1519 fhTrackMatchedDPhiMCNoOverlap[0] = new TH2F
1520 ("hTrackMatchedDPhiMCNoOverlapNoCut",
1521 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1522 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1523 fhTrackMatchedDPhiMCNoOverlap[0]->SetYTitle("d#phi (rad)");
1524 fhTrackMatchedDPhiMCNoOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1526 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[0]) ;
1527 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[0]) ;
1529 fhTrackMatchedDEtaMCNoOverlap[1] = new TH2F
1530 ("hTrackMatchedDEtaMCNoOverlap",
1531 "d#eta of cluster-track vs cluster energy, no other MC particles overlap",
1532 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1533 fhTrackMatchedDEtaMCNoOverlap[1]->SetYTitle("d#eta");
1534 fhTrackMatchedDEtaMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1536 fhTrackMatchedDPhiMCNoOverlap[1] = new TH2F
1537 ("hTrackMatchedDPhiMCNoOverlap",
1538 "d#phi of cluster-track vs cluster energy, no other MC particles overlap",
1539 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1540 fhTrackMatchedDPhiMCNoOverlap[1]->SetYTitle("d#phi (rad)");
1541 fhTrackMatchedDPhiMCNoOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1543 outputContainer->Add(fhTrackMatchedDEtaMCNoOverlap[1]) ;
1544 outputContainer->Add(fhTrackMatchedDPhiMCNoOverlap[1]) ;
1546 fhTrackMatchedDEtaMCOverlap[0] = new TH2F
1547 ("hTrackMatchedDEtaMCOverlapNoCut",
1548 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1549 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1550 fhTrackMatchedDEtaMCOverlap[0]->SetYTitle("d#eta");
1551 fhTrackMatchedDEtaMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1553 fhTrackMatchedDPhiMCOverlap[0] = new TH2F
1554 ("hTrackMatchedDPhiMCOverlapNoCut",
1555 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1556 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1557 fhTrackMatchedDPhiMCOverlap[0]->SetYTitle("d#phi (rad)");
1558 fhTrackMatchedDPhiMCOverlap[0]->SetXTitle("E_{cluster} (GeV)");
1560 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[0]) ;
1561 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[0]) ;
1563 fhTrackMatchedDEtaMCOverlap[1] = new TH2F
1564 ("hTrackMatchedDEtaMCOverlap",
1565 "d#eta of cluster-track vs cluster energy, several MC particles overlap",
1566 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1567 fhTrackMatchedDEtaMCOverlap[1]->SetYTitle("d#eta");
1568 fhTrackMatchedDEtaMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1570 fhTrackMatchedDPhiMCOverlap[1] = new TH2F
1571 ("hTrackMatchedDPhiMCOverlap",
1572 "d#phi of cluster-track vs cluster energy, several MC particles overlap",
1573 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1574 fhTrackMatchedDPhiMCOverlap[1]->SetYTitle("d#phi (rad)");
1575 fhTrackMatchedDPhiMCOverlap[1]->SetXTitle("E_{cluster} (GeV)");
1577 outputContainer->Add(fhTrackMatchedDEtaMCOverlap[1]) ;
1578 outputContainer->Add(fhTrackMatchedDPhiMCOverlap[1]) ;
1580 fhTrackMatchedDEtaMCConversion[0] = new TH2F
1581 ("hTrackMatchedDEtaMCConversionNoCut",
1582 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1583 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1584 fhTrackMatchedDEtaMCConversion[0]->SetYTitle("d#eta");
1585 fhTrackMatchedDEtaMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1587 fhTrackMatchedDPhiMCConversion[0] = new TH2F
1588 ("hTrackMatchedDPhiMCConversionNoCut",
1589 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1590 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1591 fhTrackMatchedDPhiMCConversion[0]->SetYTitle("d#phi (rad)");
1592 fhTrackMatchedDPhiMCConversion[0]->SetXTitle("E_{cluster} (GeV)");
1594 outputContainer->Add(fhTrackMatchedDEtaMCConversion[0]) ;
1595 outputContainer->Add(fhTrackMatchedDPhiMCConversion[0]) ;
1598 fhTrackMatchedDEtaMCConversion[1] = new TH2F
1599 ("hTrackMatchedDEtaMCConversion",
1600 "d#eta of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1601 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1602 fhTrackMatchedDEtaMCConversion[1]->SetYTitle("d#eta");
1603 fhTrackMatchedDEtaMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1605 fhTrackMatchedDPhiMCConversion[1] = new TH2F
1606 ("hTrackMatchedDPhiMCConversion",
1607 "d#phi of cluster-track vs cluster energy, no other MC particles overlap appart from conversions",
1608 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1609 fhTrackMatchedDPhiMCConversion[1]->SetYTitle("d#phi (rad)");
1610 fhTrackMatchedDPhiMCConversion[1]->SetXTitle("E_{cluster} (GeV)");
1612 outputContainer->Add(fhTrackMatchedDEtaMCConversion[1]) ;
1613 outputContainer->Add(fhTrackMatchedDPhiMCConversion[1]) ;
1616 fhTrackMatchedMCParticle[0] = new TH2F
1617 ("hTrackMatchedMCParticleNoCut",
1618 "Origin of particle vs energy",
1619 nptbins,ptmin,ptmax,8,0,8);
1620 fhTrackMatchedMCParticle[0]->SetXTitle("E (GeV)");
1621 //fhTrackMatchedMCParticle[0]->SetYTitle("Particle type");
1623 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(1 ,"Photon");
1624 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(2 ,"Electron");
1625 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1626 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(4 ,"Rest");
1627 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1628 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1629 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1630 fhTrackMatchedMCParticle[0]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1632 fhTrackMatchedMCParticle[1] = new TH2F
1633 ("hTrackMatchedMCParticle",
1634 "Origin of particle vs energy",
1635 nptbins,ptmin,ptmax,8,0,8);
1636 fhTrackMatchedMCParticle[1]->SetXTitle("E (GeV)");
1637 //fhTrackMatchedMCParticle[1]->SetYTitle("Particle type");
1639 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(1 ,"Photon");
1640 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(2 ,"Electron");
1641 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1642 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(4 ,"Rest");
1643 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1644 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1645 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1646 fhTrackMatchedMCParticle[1]->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1648 outputContainer->Add(fhTrackMatchedMCParticle[0]);
1649 outputContainer->Add(fhTrackMatchedMCParticle[1]);
1656 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
1657 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
1658 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
1660 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
1661 "Conversion", "Hadron", "AntiNeutron","AntiProton",
1662 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
1664 for(Int_t i = 0; i < fNOriginHistograms; i++)
1666 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
1667 Form("cluster from %s : E ",ptype[i].Data()),
1668 nptbins,ptmin,ptmax);
1669 fhMCE[i]->SetXTitle("E (GeV)");
1670 outputContainer->Add(fhMCE[i]) ;
1672 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
1673 Form("cluster from %s : p_{T} ",ptype[i].Data()),
1674 nptbins,ptmin,ptmax);
1675 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1676 outputContainer->Add(fhMCPt[i]) ;
1678 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
1679 Form("cluster from %s : #eta ",ptype[i].Data()),
1680 nptbins,ptmin,ptmax,netabins,etamin,etamax);
1681 fhMCEta[i]->SetYTitle("#eta");
1682 fhMCEta[i]->SetXTitle("E (GeV)");
1683 outputContainer->Add(fhMCEta[i]) ;
1685 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
1686 Form("cluster from %s : #phi ",ptype[i].Data()),
1687 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1688 fhMCPhi[i]->SetYTitle("#phi (rad)");
1689 fhMCPhi[i]->SetXTitle("E (GeV)");
1690 outputContainer->Add(fhMCPhi[i]) ;
1693 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
1694 Form("MC - Reco E from %s",pname[i].Data()),
1695 nptbins,ptmin,ptmax, 200,-50,50);
1696 fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
1697 outputContainer->Add(fhMCDeltaE[i]);
1699 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
1700 Form("MC - Reco p_{T} from %s",pname[i].Data()),
1701 nptbins,ptmin,ptmax, 200,-50,50);
1702 fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
1703 outputContainer->Add(fhMCDeltaPt[i]);
1705 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
1706 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
1707 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1708 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
1709 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
1710 outputContainer->Add(fhMC2E[i]);
1712 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
1713 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
1714 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1715 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
1716 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
1717 outputContainer->Add(fhMC2Pt[i]);
1722 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
1723 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
1725 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
1726 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
1728 for(Int_t i = 0; i < fNPrimaryHistograms; i++)
1730 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
1731 Form("primary photon %s : E ",pptype[i].Data()),
1732 nptbins,ptmin,ptmax);
1733 fhEPrimMC[i]->SetXTitle("E (GeV)");
1734 outputContainer->Add(fhEPrimMC[i]) ;
1736 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
1737 Form("primary photon %s : p_{T} ",pptype[i].Data()),
1738 nptbins,ptmin,ptmax);
1739 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
1740 outputContainer->Add(fhPtPrimMC[i]) ;
1742 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
1743 Form("primary photon %s : Rapidity ",pptype[i].Data()),
1744 nptbins,ptmin,ptmax,800,-8,8);
1745 fhYPrimMC[i]->SetYTitle("Rapidity");
1746 fhYPrimMC[i]->SetXTitle("E (GeV)");
1747 outputContainer->Add(fhYPrimMC[i]) ;
1749 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
1750 Form("primary photon %s : #phi ",pptype[i].Data()),
1751 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1752 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
1753 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
1754 outputContainer->Add(fhPhiPrimMC[i]) ;
1757 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
1758 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
1759 nptbins,ptmin,ptmax);
1760 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
1761 outputContainer->Add(fhEPrimMCAcc[i]) ;
1763 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
1764 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
1765 nptbins,ptmin,ptmax);
1766 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
1767 outputContainer->Add(fhPtPrimMCAcc[i]) ;
1769 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
1770 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
1771 nptbins,ptmin,ptmax,100,-1,1);
1772 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
1773 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
1774 outputContainer->Add(fhYPrimMCAcc[i]) ;
1776 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
1777 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
1778 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1779 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
1780 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
1781 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
1785 if(fFillSSHistograms)
1787 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
1789 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
1791 for(Int_t i = 0; i < 6; i++)
1793 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
1794 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
1795 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1796 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
1797 fhMCELambda0[i]->SetXTitle("E (GeV)");
1798 outputContainer->Add(fhMCELambda0[i]) ;
1800 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
1801 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
1802 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1803 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
1804 fhMCELambda1[i]->SetXTitle("E (GeV)");
1805 outputContainer->Add(fhMCELambda1[i]) ;
1807 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
1808 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
1809 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1810 fhMCEDispersion[i]->SetYTitle("D^{2}");
1811 fhMCEDispersion[i]->SetXTitle("E (GeV)");
1812 outputContainer->Add(fhMCEDispersion[i]) ;
1814 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
1815 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
1816 nptbins,ptmin,ptmax, nbins,nmin,nmax);
1817 fhMCNCellsE[i]->SetXTitle("E (GeV)");
1818 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
1819 outputContainer->Add(fhMCNCellsE[i]);
1821 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
1822 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
1823 nptbins,ptmin,ptmax, 500,0,1.);
1824 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
1825 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1826 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
1828 if(!fFillOnlySimpleSSHisto)
1830 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1831 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1832 ssbins,ssmin,ssmax,500,0,1.);
1833 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
1834 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1835 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
1837 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1838 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1839 ssbins,ssmin,ssmax,500,0,1.);
1840 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
1841 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1842 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
1844 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1845 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1846 ssbins,ssmin,ssmax,500,0,1.);
1847 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
1848 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1849 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
1851 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1852 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1853 nbins/5,nmin,nmax/5,500,0,1.);
1854 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
1855 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1856 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
1858 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1859 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1860 nbins/5,nmin,nmax/5,500,0,1.);
1861 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
1862 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1863 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
1865 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1866 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1867 nbins/5,nmin,nmax/5,500,0,1.);
1868 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
1869 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
1870 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
1872 if(fCalorimeter=="EMCAL")
1874 fhMCEDispEta[i] = new TH2F (Form("hEDispEtaE_MC%s",pnamess[i].Data()),
1875 Form("cluster from %s : #sigma^{2}_{#eta #eta} = #Sigma w_{i}(#eta_{i} - <#eta>)^{2}/ #Sigma w_{i} vs E",ptypess[i].Data()),
1876 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1877 fhMCEDispEta[i]->SetXTitle("E (GeV)");
1878 fhMCEDispEta[i]->SetYTitle("#sigma^{2}_{#eta #eta}");
1879 outputContainer->Add(fhMCEDispEta[i]);
1881 fhMCEDispPhi[i] = new TH2F (Form("hEDispPhiE_MC%s",pnamess[i].Data()),
1882 Form("cluster from %s : #sigma^{2}_{#phi #phi} = #Sigma w_{i}(#phi_{i} - <#phi>)^{2} / #Sigma w_{i} vs E",ptypess[i].Data()),
1883 nptbins,ptmin,ptmax, ssbins,ssmin,ssmax);
1884 fhMCEDispPhi[i]->SetXTitle("E (GeV)");
1885 fhMCEDispPhi[i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1886 outputContainer->Add(fhMCEDispPhi[i]);
1888 fhMCESumEtaPhi[i] = new TH2F (Form("hESumEtaPhiE_MC%s",pnamess[i].Data()),
1889 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()),
1890 nptbins,ptmin,ptmax, 2*ssbins,-ssmax,ssmax);
1891 fhMCESumEtaPhi[i]->SetXTitle("E (GeV)");
1892 fhMCESumEtaPhi[i]->SetYTitle("#delta^{2}_{#eta #phi}");
1893 outputContainer->Add(fhMCESumEtaPhi[i]);
1895 fhMCEDispEtaPhiDiff[i] = new TH2F (Form("hEDispEtaPhiDiffE_MC%s",pnamess[i].Data()),
1896 Form("cluster from %s : #sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta} vs E",ptypess[i].Data()),
1897 nptbins,ptmin,ptmax,200,-10,10);
1898 fhMCEDispEtaPhiDiff[i]->SetXTitle("E (GeV)");
1899 fhMCEDispEtaPhiDiff[i]->SetYTitle("#sigma^{2}_{#phi #phi}-#sigma^{2}_{#eta #eta}");
1900 outputContainer->Add(fhMCEDispEtaPhiDiff[i]);
1902 fhMCESphericity[i] = new TH2F (Form("hESphericity_MC%s",pnamess[i].Data()),
1903 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()),
1904 nptbins,ptmin,ptmax, 200,-1,1);
1905 fhMCESphericity[i]->SetXTitle("E (GeV)");
1906 fhMCESphericity[i]->SetYTitle("s = (#sigma^{2}_{#phi #phi} - #sigma^{2}_{#eta #eta}) / (#sigma^{2}_{#eta #eta} + #sigma^{2}_{#phi #phi})");
1907 outputContainer->Add(fhMCESphericity[i]);
1909 for(Int_t ie = 0; ie < 7; ie++)
1911 fhMCDispEtaDispPhi[ie][i] = new TH2F (Form("hMCDispEtaDispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
1912 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]),
1913 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1914 fhMCDispEtaDispPhi[ie][i]->SetXTitle("#sigma^{2}_{#eta #eta}");
1915 fhMCDispEtaDispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1916 outputContainer->Add(fhMCDispEtaDispPhi[ie][i]);
1918 fhMCLambda0DispEta[ie][i] = new TH2F (Form("hMCLambda0DispEta_EBin%d_MC%s",ie,pnamess[i].Data()),
1919 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]),
1920 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1921 fhMCLambda0DispEta[ie][i]->SetXTitle("#lambda^{2}_{0}");
1922 fhMCLambda0DispEta[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1923 outputContainer->Add(fhMCLambda0DispEta[ie][i]);
1925 fhMCLambda0DispPhi[ie][i] = new TH2F (Form("hMCLambda0DispPhi_EBin%d_MC%s",ie,pnamess[i].Data()),
1926 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]),
1927 ssbins,ssmin,ssmax , ssbins,ssmin,ssmax);
1928 fhMCLambda0DispPhi[ie][i]->SetXTitle("#lambda^{2}_{0}");
1929 fhMCLambda0DispPhi[ie][i]->SetYTitle("#sigma^{2}_{#phi #phi}");
1930 outputContainer->Add(fhMCLambda0DispPhi[ie][i]);
1936 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1938 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
1939 "cluster from Photon : E vs #lambda_{0}^{2}",
1940 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1941 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
1942 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
1943 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
1945 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
1946 "cluster from Photon : E vs #lambda_{0}^{2}",
1947 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1948 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
1949 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
1950 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
1952 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
1953 "cluster from Photon : E vs #lambda_{0}^{2}",
1954 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1955 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
1956 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
1957 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
1961 //Fill histograms to check shape of embedded clusters
1962 if(GetReader()->IsEmbeddedClusterSelectionOn())
1965 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
1966 "Energy Fraction of embedded signal versus cluster energy",
1967 nptbins,ptmin,ptmax,100,0.,1.);
1968 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
1969 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
1970 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
1972 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
1973 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
1974 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1975 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
1976 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
1977 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
1979 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
1980 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
1981 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1982 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
1983 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
1984 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
1986 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
1987 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
1988 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1989 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
1990 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
1991 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
1993 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
1994 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
1995 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1996 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
1997 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
1998 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
2000 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
2001 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
2002 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2003 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
2004 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
2005 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
2007 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
2008 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
2009 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2010 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
2011 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
2012 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
2014 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
2015 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
2016 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2017 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
2018 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
2019 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
2021 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
2022 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
2023 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
2024 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
2025 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
2026 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
2028 }// embedded histograms
2031 }// Fill SS MC histograms
2035 return outputContainer ;
2039 //_______________________
2040 void AliAnaPhoton::Init()
2045 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD())
2047 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
2050 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD())
2052 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
2056 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
2060 //____________________________________________________________________________
2061 void AliAnaPhoton::InitParameters()
2064 //Initialize the parameters of the analysis.
2065 AddToHistogramsName("AnaPhoton_");
2067 fCalorimeter = "EMCAL" ;
2072 fTimeCutMin =-1000000;
2073 fTimeCutMax = 1000000;
2076 fRejectTrackMatch = kTRUE ;
2080 //__________________________________________________________________
2081 void AliAnaPhoton::MakeAnalysisFillAOD()
2083 //Do photon analysis and fill aods
2086 Double_t v[3] = {0,0,0}; //vertex ;
2087 GetReader()->GetVertex(v);
2089 //Select the Calorimeter of the photon
2090 TObjArray * pl = 0x0;
2091 AliVCaloCells* cells = 0;
2092 if (fCalorimeter == "PHOS" )
2094 pl = GetPHOSClusters();
2095 cells = GetPHOSCells();
2097 else if (fCalorimeter == "EMCAL")
2099 pl = GetEMCALClusters();
2100 cells = GetEMCALCells();
2105 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
2109 // Loop on raw clusters before filtering in the reader and fill control histogram
2110 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS")
2112 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ )
2114 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
2115 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
2116 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
2121 TClonesArray * clusterList = 0;
2123 if(GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()))
2124 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetInputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2125 else if(GetReader()->GetOutputEvent())
2126 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
2130 Int_t nclusters = clusterList->GetEntriesFast();
2131 for (Int_t iclus = 0; iclus < nclusters; iclus++)
2133 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
2134 if(clus)fhClusterCuts[0]->Fill(clus->E());
2139 //Init arrays, variables, get number of clusters
2140 TLorentzVector mom, mom2 ;
2141 Int_t nCaloClusters = pl->GetEntriesFast();
2143 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
2145 //----------------------------------------------------
2146 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
2147 //----------------------------------------------------
2149 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
2151 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
2152 //printf("calo %d, %f\n",icalo,calo->E());
2154 //Get the index where the cluster comes, to retrieve the corresponding vertex
2155 Int_t evtIndex = 0 ;
2156 if (GetMixedEvent())
2158 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
2159 //Get the vertex and check it is not too large in z
2160 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
2163 //Cluster selection, not charged, with photon id and in fiducial cut
2164 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC)
2166 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
2169 Double_t vertex[]={0,0,0};
2170 calo->GetMomentum(mom,vertex) ;
2173 //--------------------------------------
2174 // Cluster selection
2175 //--------------------------------------
2176 if(!ClusterSelected(calo,mom)) continue;
2178 //----------------------------
2179 //Create AOD for analysis
2180 //----------------------------
2181 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
2183 //...............................................
2184 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
2185 Int_t label = calo->GetLabel();
2186 aodph.SetLabel(label);
2187 aodph.SetCaloLabel(calo->GetID(),-1);
2188 aodph.SetDetector(fCalorimeter);
2189 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
2191 //...............................................
2192 //Set bad channel distance bit
2193 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
2194 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
2195 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
2196 else aodph.SetDistToBad(0) ;
2197 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
2199 //--------------------------------------------------------------------------------------
2200 // Play with the MC stack if available
2201 //--------------------------------------------------------------------------------------
2203 //Check origin of the candidates
2208 tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodph.GetInputFileIndex());
2212 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
2213 }//Work with stack also
2216 //--------------------------------------------------------------------------------------
2217 //Fill some shower shape histograms before PID is applied
2218 //--------------------------------------------------------------------------------------
2220 FillShowerShapeHistograms(calo,tag);
2222 //-------------------------------------
2223 //PID selection or bit setting
2224 //-------------------------------------
2226 //...............................................
2227 // Data, PID check on
2230 // Get most probable PID, 2 options check bayesian PID weights or redo PID
2231 // By default, redo PID
2233 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(calo));
2235 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
2237 //If cluster does not pass pid, not photon, skip it.
2238 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
2242 //...............................................
2243 // Data, PID check off
2246 //Set PID bits for later selection (AliAnaPi0 for example)
2247 //GetIdentifiedParticleType already called in SetPIDBits.
2249 GetCaloPID()->SetPIDBits(calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
2251 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
2254 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",
2255 aodph.Pt(), aodph.GetIdentifiedParticleType());
2257 fhClusterCuts[8]->Fill(calo->E());
2259 // Matching after cuts
2260 if(fFillTMHisto) FillTrackMatchingResidualHistograms(calo,1);
2262 // Add number of local maxima to AOD, method name in AOD to be FIXED
2264 aodph.SetFiducialArea(GetCaloUtils()->GetNumberOfLocalMaxima(calo, cells));
2267 //Add AOD with photon object to aod branch
2268 AddAODParticle(aodph);
2272 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
2276 //__________________________________________________________________
2277 void AliAnaPhoton::MakeAnalysisFillHistograms()
2282 Double_t v[3] = {0,0,0}; //vertex ;
2283 GetReader()->GetVertex(v);
2284 //fhVertex->Fill(v[0],v[1],v[2]);
2285 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
2287 //----------------------------------
2288 //Loop on stored AOD photons
2289 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
2290 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
2292 for(Int_t iaod = 0; iaod < naod ; iaod++)
2294 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
2295 Int_t pdg = ph->GetIdentifiedParticleType();
2298 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n",
2299 ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
2301 //If PID used, fill histos with photons in Calorimeter fCalorimeter
2302 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
2303 if(ph->GetDetector() != fCalorimeter) continue;
2306 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
2308 //................................
2309 //Fill photon histograms
2310 Float_t ptcluster = ph->Pt();
2311 Float_t phicluster = ph->Phi();
2312 Float_t etacluster = ph->Eta();
2313 Float_t ecluster = ph->E();
2315 fhEPhoton ->Fill(ecluster);
2316 fhPtPhoton ->Fill(ptcluster);
2317 fhPhiPhoton ->Fill(ptcluster,phicluster);
2318 fhEtaPhoton ->Fill(ptcluster,etacluster);
2319 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
2320 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
2323 //Get original cluster, to recover some information
2325 Float_t maxCellFraction = 0;
2326 AliVCaloCells* cells = 0;
2327 TObjArray * clusters = 0;
2328 if(fCalorimeter == "EMCAL")
2330 cells = GetEMCALCells();
2331 clusters = GetEMCALClusters();
2335 cells = GetPHOSCells();
2336 clusters = GetPHOSClusters();
2340 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
2343 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
2345 // Control histograms
2346 fhMaxCellDiffClusterE->Fill(ph->E(),maxCellFraction);
2347 fhNCellsE ->Fill(ph->E(),cluster->GetNCells());
2348 fhTimeE ->Fill(ph->E(),cluster->GetTOF()*1.e9);
2351 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++)
2352 fhCellsE->Fill(ph->E(),cells->GetCellAmplitude(cluster->GetCellsAbsId()[icell]));
2356 //.......................................
2357 //Play with the MC data if available
2362 if(GetReader()->ReadStack() && !GetMCStack())
2364 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called?\n");
2366 else if(GetReader()->ReadAODMCParticles() && !GetReader()->GetAODMCParticles(0))
2368 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
2372 FillAcceptanceHistograms();
2374 //....................................................................
2375 // Access MC information in stack if requested, check that it exists.
2376 Int_t label =ph->GetLabel();
2380 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
2387 TLorentzVector primary = GetMCAnalysisUtils()->GetMother(label,GetReader(),ok);
2390 eprim = primary.Energy();
2391 ptprim = primary.Pt();
2394 Int_t tag =ph->GetTag();
2395 Int_t mcParticleTag = -1;
2396 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
2398 fhMCE [kmcPhoton] ->Fill(ecluster);
2399 fhMCPt [kmcPhoton] ->Fill(ptcluster);
2400 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
2401 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
2403 fhMC2E [kmcPhoton] ->Fill(ecluster, eprim);
2404 fhMC2Pt [kmcPhoton] ->Fill(ptcluster, ptprim);
2405 fhMCDeltaE [kmcPhoton] ->Fill(ecluster,eprim-ecluster);
2406 fhMCDeltaPt[kmcPhoton] ->Fill(ptcluster,ptprim-ptcluster);
2408 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) &&
2409 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) &&
2410 fhMCE[kmcConversion])
2412 fhMCE [kmcConversion] ->Fill(ecluster);
2413 fhMCPt [kmcConversion] ->Fill(ptcluster);
2414 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
2415 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
2417 fhMC2E [kmcConversion] ->Fill(ecluster, eprim);
2418 fhMC2Pt [kmcConversion] ->Fill(ptcluster, ptprim);
2419 fhMCDeltaE [kmcConversion] ->Fill(ecluster,eprim-ecluster);
2420 fhMCDeltaPt[kmcConversion] ->Fill(ptcluster,ptprim-ptcluster);
2423 if (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt])
2425 mcParticleTag = kmcPrompt;
2427 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
2429 mcParticleTag = kmcFragmentation;
2431 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
2433 mcParticleTag = kmcISR;
2435 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
2436 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
2438 mcParticleTag = kmcPi0Decay;
2440 else if((( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) &&
2441 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) ||
2442 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
2444 mcParticleTag = kmcOtherDecay;
2446 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0])
2448 mcParticleTag = kmcPi0;
2450 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
2452 mcParticleTag = kmcEta;
2455 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
2457 mcParticleTag = kmcAntiNeutron;
2459 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
2461 mcParticleTag = kmcAntiProton;
2463 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
2465 mcParticleTag = kmcElectron;
2467 else if( fhMCE[kmcOther])
2469 mcParticleTag = kmcOther;
2471 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2472 // ph->GetLabel(),ph->Pt());
2473 // for(Int_t i = 0; i < 20; i++) {
2474 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2480 fhMCE [mcParticleTag] ->Fill(ecluster);
2481 fhMCPt [mcParticleTag] ->Fill(ptcluster);
2482 fhMCPhi[mcParticleTag] ->Fill(ecluster,phicluster);
2483 fhMCEta[mcParticleTag] ->Fill(ecluster,etacluster);
2485 fhMC2E[mcParticleTag] ->Fill(ecluster, eprim);
2486 fhMC2Pt[mcParticleTag] ->Fill(ptcluster, ptprim);
2487 fhMCDeltaE[mcParticleTag] ->Fill(ecluster,eprim-ecluster);
2488 fhMCDeltaPt[mcParticleTag]->Fill(ptcluster,ptprim-ptcluster);
2490 }//Histograms with MC
2497 //__________________________________________________________________
2498 void AliAnaPhoton::Print(const Option_t * opt) const
2500 //Print some relevant parameters set for the analysis
2505 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2506 AliAnaCaloTrackCorrBaseClass::Print(" ");
2508 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2509 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2510 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2511 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
2512 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
2513 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2514 printf("Number of cells in cluster is > %d \n", fNCellsCut);