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),
61 fNOriginHistograms(8), fNPrimaryHistograms(4),
64 fhNCellsE(0), fhMaxCellDiffClusterE(0), fhTimeE(0), // Control histograms
65 fhEPhoton(0), fhPtPhoton(0),
66 fhPhiPhoton(0), fhEtaPhoton(0),
67 fhEtaPhiPhoton(0), fhEtaPhi05Photon(0),
69 // Shower shape histograms
70 fhDispE(0), fhLam0E(0), fhLam1E(0),
71 fhDispETRD(0), fhLam0ETRD(0), fhLam1ETRD(0),
73 fhNCellsLam0LowE(0), fhNCellsLam1LowE(0), fhNCellsDispLowE(0),
74 fhNCellsLam0HighE(0), fhNCellsLam1HighE(0), fhNCellsDispHighE(0),
76 fhEtaLam0LowE(0), fhPhiLam0LowE(0),
77 fhEtaLam0HighE(0), fhPhiLam0HighE(0),
78 fhLam0DispLowE(0), fhLam0DispHighE(0),
79 fhLam1Lam0LowE(0), fhLam1Lam0HighE(0),
80 fhDispLam1LowE(0), fhDispLam1HighE(0),
83 fhMCPhotonELambda0NoOverlap(0), fhMCPhotonELambda0TwoOverlap(0), fhMCPhotonELambda0NOverlap(0),
85 fhEmbeddedSignalFractionEnergy(0),
86 fhEmbedPhotonELambda0FullSignal(0), fhEmbedPhotonELambda0MostlySignal(0),
87 fhEmbedPhotonELambda0MostlyBkg(0), fhEmbedPhotonELambda0FullBkg(0),
88 fhEmbedPi0ELambda0FullSignal(0), fhEmbedPi0ELambda0MostlySignal(0),
89 fhEmbedPi0ELambda0MostlyBkg(0), fhEmbedPi0ELambda0FullBkg(0),
90 fhTrackMatchedDEta(0x0), fhTrackMatchedDPhi(0x0), fhTrackMatchedDEtaDPhi(0x0),
91 fhTrackMatchedDEtaNoCut(0x0), fhTrackMatchedDPhiNoCut(0x0), fhTrackMatchedDEtaDPhiNoCut(0x0),
92 fhdEdx(0), fhEOverP(0),
93 fhdEdxNoCut(0), fhEOverPNoCut(0),
94 fhTrackMatchedMCParticle(0), fhTrackMatchedMCParticleNoCut(0)
98 for(Int_t i = 0; i < 14; i++){
110 for(Int_t i = 0; i < 7; i++){
116 fhPtPrimMCAcc [i] = 0;
117 fhEPrimMCAcc [i] = 0;
118 fhPhiPrimMCAcc[i] = 0;
119 fhYPrimMCAcc [i] = 0;
122 for(Int_t i = 0; i < 6; i++){
123 fhMCELambda0 [i] = 0;
124 fhMCELambda1 [i] = 0;
125 fhMCEDispersion [i] = 0;
127 fhMCMaxCellDiffClusterE[i] = 0;
128 fhMCLambda0vsClusterMaxCellDiffE0[i] = 0;
129 fhMCLambda0vsClusterMaxCellDiffE2[i] = 0;
130 fhMCLambda0vsClusterMaxCellDiffE6[i] = 0;
131 fhMCNCellsvsClusterMaxCellDiffE0 [i] = 0;
132 fhMCNCellsvsClusterMaxCellDiffE2 [i] = 0;
133 fhMCNCellsvsClusterMaxCellDiffE6 [i] = 0;
136 for(Int_t i = 0; i < 5; i++) fhClusterCuts[i] = 0;
138 //Initialize parameters
143 //__________________________________________________________________________
144 Bool_t AliAnaPhoton::ClusterSelected(AliVCluster* calo, TLorentzVector mom)
146 //Select clusters if they pass different cuts
148 printf("AliAnaPhoton::ClusterSelected() Current Event %d; Before selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
149 GetReader()->GetEventNumber(),
150 calo->E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
152 fhClusterCuts[1]->Fill(calo->E());
154 //.......................................
155 //If too small or big energy, skip it
156 if(calo->E() < GetMinEnergy() || calo->E() > GetMaxEnergy() ) return kFALSE ;
158 if(GetDebug() > 2) printf("\t Cluster %d Pass E Cut \n",calo->GetID());
160 fhClusterCuts[2]->Fill(calo->E());
162 //.......................................
163 // TOF cut, BE CAREFUL WITH THIS CUT
164 Double_t tof = calo->GetTOF()*1e9;
165 if(tof < fTimeCutMin || tof > fTimeCutMax) return kFALSE;
167 if(GetDebug() > 2) printf("\t Cluster %d Pass Time Cut \n",calo->GetID());
169 fhClusterCuts[3]->Fill(calo->E());
171 //.......................................
172 if(calo->GetNCells() <= fNCellsCut && GetReader()->GetDataType() != AliCaloTrackReader::kMC) return kFALSE;
174 if(GetDebug() > 2) printf("\t Cluster %d Pass NCell Cut \n",calo->GetID());
176 fhClusterCuts[4]->Fill(calo->E());
178 //.......................................
179 //Check acceptance selection
180 if(IsFiducialCutOn()){
181 Bool_t in = GetFiducialCut()->IsInFiducialCut(mom,fCalorimeter) ;
182 if(! in ) return kFALSE ;
185 if(GetDebug() > 2) printf("Fiducial cut passed \n");
187 fhClusterCuts[5]->Fill(calo->E());
189 //.......................................
190 //Skip matched clusters with tracks
194 Float_t dZ = calo->GetTrackDz();
195 Float_t dR = calo->GetTrackDx();
197 if(calo->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn()){
198 dR = 2000., dZ = 2000.;
199 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(calo->GetID(),dZ,dR);
202 if(fhTrackMatchedDEtaNoCut && TMath::Abs(dR) < 999){
203 fhTrackMatchedDEtaNoCut->Fill(calo->E(),dZ);
204 fhTrackMatchedDPhiNoCut->Fill(calo->E(),dR);
205 if(calo->E() > 0.5) fhTrackMatchedDEtaDPhiNoCut->Fill(dZ,dR);
208 // Check dEdx and E/p of matched clusters
210 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
212 AliVTrack *track = 0;
213 if(!strcmp("AliESDCaloCluster",Form("%s",calo->ClassName()))){
214 Int_t iESDtrack = calo->GetTrackMatchedIndex();
215 if(iESDtrack<0) printf("AliAnaPhoton::ClusterSelected - Wrong track index\n");
216 AliVEvent * event = GetReader()->GetInputEvent();
217 track = dynamic_cast<AliVTrack*> (event->GetTrack(iESDtrack));
220 track = dynamic_cast<AliVTrack*>(calo->GetTrackMatched(0));
225 Float_t dEdx = track->GetTPCsignal();
226 fhdEdxNoCut->Fill(calo->E(), dEdx);
228 Float_t eOverp = calo->E()/track->P();
229 fhEOverPNoCut->Fill(calo->E(), eOverp);
233 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), 0);
234 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) ){
236 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
237 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 2.5 );
238 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 0.5 );
239 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 1.5 );
240 else fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 3.5 );
245 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
246 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 6.5 );
247 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 4.5 );
248 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 5.5 );
249 else fhTrackMatchedMCParticleNoCut->Fill(calo->E(), 7.5 );
255 } // residuals window
257 }// Fill track matching histograms
259 if(fRejectTrackMatch){
260 if(IsTrackMatched(calo,GetReader()->GetInputEvent())) {
261 if(GetDebug() > 2) printf("\t Reject track-matched clusters\n");
265 if(GetDebug() > 2) printf(" Track-matching cut passed \n");
266 }// reject matched clusters
268 fhClusterCuts[6]->Fill(calo->E());
270 //.......................................
271 //Check Distance to Bad channel, set bit.
272 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
273 if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ;
274 if(distBad < fMinDist) {//In bad channel (PHOS cristal size 2.2x2.2 cm), EMCAL ( cell units )
277 else if(GetDebug() > 2) printf("\t Bad channel cut passed %4.2f > %2.2f \n",distBad, fMinDist);
279 fhClusterCuts[7]->Fill(calo->E());
282 printf("AliAnaPhoton::ClusterSelected() Current Event %d; After selection : E %2.2f, pT %2.2f, Ecl %2.2f, phi %2.2f, eta %2.2f\n",
283 GetReader()->GetEventNumber(),
284 calo->E(), mom.Pt(),calo->E(),mom.Phi()*TMath::RadToDeg(),mom.Eta());
286 //All checks passed, cluster selected
291 //_____________________________________________________________
292 void AliAnaPhoton::FillAcceptanceHistograms(){
293 //Fill acceptance histograms if MC data is available
295 if(GetReader()->ReadStack()){
296 AliStack * stack = GetMCStack();
298 for(Int_t i=0 ; i<stack->GetNtrack(); i++){
299 TParticle * prim = stack->Particle(i) ;
300 Int_t pdg = prim->GetPdgCode();
301 //printf("i %d, %s %d %s %d \n",i, stack->Particle(i)->GetName(), stack->Particle(i)->GetPdgCode(),
302 // prim->GetName(), prim->GetPdgCode());
306 // Get tag of this particle photon from fragmentation, decay, prompt ...
307 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
308 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)){
309 //A conversion photon from a hadron, skip this kind of photon
310 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!: tag %d, conv %d, pi0 %d, hadron %d, electron %d, unk %d, muon %d,pion %d, proton %d, neutron %d, kaon %d, antiproton %d, antineutron %d\n",tag,
311 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion),
312 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0),
313 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOther),
314 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron),
315 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCUnknown),
316 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCMuon),
317 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPion),
318 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCProton),
319 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron),
320 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCKaon),
321 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton),
322 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron));
327 //Get photon kinematics
328 if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
330 Double_t photonY = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ;
331 Double_t photonE = prim->Energy() ;
332 Double_t photonPt = prim->Pt() ;
333 Double_t photonPhi = TMath::RadToDeg()*prim->Phi() ;
334 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
335 Double_t photonEta = prim->Eta() ;
338 //Check if photons hit the Calorimeter
341 Bool_t inacceptance = kFALSE;
342 if (fCalorimeter == "PHOS"){
343 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){
346 if(GetPHOSGeometry()->ImpactOnEmc(prim,mod,z,x))
347 inacceptance = kTRUE;
348 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
351 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
352 inacceptance = kTRUE ;
353 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
356 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
357 if(GetEMCALGeometry()){
361 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
364 inacceptance = kTRUE;
366 // if(GetEMCALGeometry()->Impact(phot1) && GetEMCALGeometry()->Impact(phot2))
367 // inacceptance = kTRUE;
368 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
371 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
372 inacceptance = kTRUE ;
373 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
379 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
380 if(TMath::Abs(photonY) < 1.0)
382 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
383 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
384 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
385 fhYPrimMC[kmcPPhoton] ->Fill(photonE , photonEta) ;
388 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
389 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
390 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
391 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
395 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
397 fhYPrimMC[kmcPPrompt]->Fill(photonPt, photonY) ;
398 if(TMath::Abs(photonY) < 1.0){
399 fhEPrimMC [kmcPPrompt]->Fill(photonE ) ;
400 fhPtPrimMC [kmcPPrompt]->Fill(photonPt) ;
401 fhPhiPrimMC[kmcPPrompt]->Fill(photonE , photonPhi) ;
402 fhYPrimMC[kmcPPrompt] ->Fill(photonE , photonEta) ;
405 fhEPrimMCAcc[kmcPPrompt] ->Fill(photonE ) ;
406 fhPtPrimMCAcc[kmcPPrompt] ->Fill(photonPt) ;
407 fhPhiPrimMCAcc[kmcPPrompt]->Fill(photonE , photonPhi) ;
408 fhYPrimMCAcc[kmcPPrompt] ->Fill(photonE , photonY) ;
411 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation])
413 fhYPrimMC[kmcPFragmentation]->Fill(photonPt, photonY) ;
414 if(TMath::Abs(photonY) < 1.0){
415 fhEPrimMC [kmcPFragmentation]->Fill(photonE ) ;
416 fhPtPrimMC [kmcPFragmentation]->Fill(photonPt) ;
417 fhPhiPrimMC[kmcPFragmentation]->Fill(photonE , photonPhi) ;
418 fhYPrimMC[kmcPFragmentation] ->Fill(photonE , photonEta) ;
421 fhEPrimMCAcc[kmcPFragmentation] ->Fill(photonE ) ;
422 fhPtPrimMCAcc[kmcPFragmentation] ->Fill(photonPt) ;
423 fhPhiPrimMCAcc[kmcPFragmentation]->Fill(photonE , photonPhi) ;
424 fhYPrimMCAcc[kmcPFragmentation] ->Fill(photonE , photonY) ;
427 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
429 fhYPrimMC[kmcPISR]->Fill(photonPt, photonY) ;
430 if(TMath::Abs(photonY) < 1.0){
431 fhEPrimMC [kmcPISR]->Fill(photonE ) ;
432 fhPtPrimMC [kmcPISR]->Fill(photonPt) ;
433 fhPhiPrimMC[kmcPISR]->Fill(photonE , photonPhi) ;
434 fhYPrimMC[kmcPISR]->Fill(photonE , photonEta) ;
437 fhEPrimMCAcc[kmcPISR] ->Fill(photonE ) ;
438 fhPtPrimMCAcc[kmcPISR] ->Fill(photonPt) ;
439 fhPhiPrimMCAcc[kmcPISR]->Fill(photonE , photonPhi) ;
440 fhYPrimMCAcc[kmcPISR] ->Fill(photonE , photonY) ;
443 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
445 fhYPrimMC[kmcPPi0Decay]->Fill(photonPt, photonY) ;
446 if(TMath::Abs(photonY) < 1.0){
447 fhEPrimMC [kmcPPi0Decay]->Fill(photonE ) ;
448 fhPtPrimMC [kmcPPi0Decay]->Fill(photonPt) ;
449 fhPhiPrimMC[kmcPPi0Decay]->Fill(photonE , photonPhi) ;
450 fhYPrimMC[kmcPPi0Decay] ->Fill(photonE , photonEta) ;
453 fhEPrimMCAcc[kmcPPi0Decay] ->Fill(photonE ) ;
454 fhPtPrimMCAcc[kmcPPi0Decay] ->Fill(photonPt) ;
455 fhPhiPrimMCAcc[kmcPPi0Decay]->Fill(photonE , photonPhi) ;
456 fhYPrimMCAcc[kmcPPi0Decay] ->Fill(photonE , photonY) ;
459 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
460 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay)) && fhEPrimMC[kmcPOtherDecay])
462 fhYPrimMC[kmcPOtherDecay]->Fill(photonPt, photonY) ;
463 if(TMath::Abs(photonY) < 1.0){
464 fhEPrimMC [kmcPOtherDecay]->Fill(photonE ) ;
465 fhPtPrimMC [kmcPOtherDecay]->Fill(photonPt) ;
466 fhPhiPrimMC[kmcPOtherDecay]->Fill(photonE , photonPhi) ;
467 fhYPrimMC[kmcPOtherDecay] ->Fill(photonE , photonEta) ;
470 fhEPrimMCAcc[kmcPOtherDecay] ->Fill(photonE ) ;
471 fhPtPrimMCAcc[kmcPOtherDecay] ->Fill(photonPt) ;
472 fhPhiPrimMCAcc[kmcPOtherDecay]->Fill(photonE , photonPhi) ;
473 fhYPrimMCAcc[kmcPOtherDecay] ->Fill(photonE , photonY) ;
476 else if(fhEPrimMC[kmcPOther])
478 fhYPrimMC[kmcPOther]->Fill(photonPt, photonY) ;
479 if(TMath::Abs(photonY) < 1.0){
480 fhEPrimMC [kmcPOther]->Fill(photonE ) ;
481 fhPtPrimMC [kmcPOther]->Fill(photonPt) ;
482 fhPhiPrimMC[kmcPOther]->Fill(photonE , photonPhi) ;
483 fhYPrimMC[kmcPOther] ->Fill(photonE , photonEta) ;
486 fhEPrimMCAcc[kmcPOther] ->Fill(photonE ) ;
487 fhPtPrimMCAcc[kmcPOther] ->Fill(photonPt) ;
488 fhPhiPrimMCAcc[kmcPOther]->Fill(photonE , photonPhi) ;
489 fhYPrimMCAcc[kmcPOther] ->Fill(photonE , photonY) ;
494 }//stack exists and data is MC
496 else if(GetReader()->ReadAODMCParticles()){
497 TClonesArray * mcparticles = GetReader()->GetAODMCParticles(0);
499 Int_t nprim = mcparticles->GetEntriesFast();
501 for(Int_t i=0; i < nprim; i++)
503 AliAODMCParticle * prim = (AliAODMCParticle *) mcparticles->At(i);
505 Int_t pdg = prim->GetPdgCode();
509 // Get tag of this particle photon from fragmentation, decay, prompt ...
510 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(i,GetReader(), 0);
511 if(!GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton)){
512 //A conversion photon from a hadron, skip this kind of photon
513 // printf("AliAnaPhoton::FillAcceptanceHistograms() - not a photon, weird!: tag %d, conv %d, pi0 %d, hadron %d, electron %d, unk %d, muon %d,pion %d, proton %d, neutron %d, kaon %d, antiproton %d, antineutron %d\n",tag,
514 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion),
515 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0),
516 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOther),
517 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron),
518 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCUnknown),
519 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCMuon),
520 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPion),
521 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCProton),
522 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron),
523 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCKaon),
524 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton),
525 // GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron));
530 //Get photon kinematics
531 if(prim->E() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception
533 Double_t photonY = 0.5*TMath::Log((prim->E()-prim->Pz())/(prim->E()+prim->Pz())) ;
534 Double_t photonE = prim->E() ;
535 Double_t photonPt = prim->Pt() ;
536 Double_t photonPhi = TMath::RadToDeg()*prim->Phi() ;
537 if(photonPhi < 0) photonPhi+=TMath::TwoPi();
538 Double_t photonEta = prim->Eta() ;
540 //Check if photons hit the Calorimeter
542 lv.SetPxPyPzE(prim->Px(),prim->Py(),prim->Pz(),prim->E());
543 Bool_t inacceptance = kFALSE;
544 if (fCalorimeter == "PHOS"){
545 if(GetPHOSGeometry() && GetCaloUtils()->IsPHOSGeoMatrixSet()){
548 Double_t vtx[]={prim->Xv(),prim->Yv(),prim->Zv()};
549 if(GetPHOSGeometry()->ImpactOnEmc(vtx, prim->Theta(),prim->Phi(),mod,z,x))
550 inacceptance = kTRUE;
551 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
554 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
555 inacceptance = kTRUE ;
556 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
559 else if(fCalorimeter == "EMCAL" && GetCaloUtils()->IsEMCALGeoMatrixSet()){
560 if(GetEMCALGeometry()){
564 GetEMCALGeometry()->GetAbsCellIdFromEtaPhi(prim->Eta(),prim->Phi(),absID);
567 inacceptance = kTRUE;
569 if(GetDebug() > 2) printf("In %s Real acceptance? %d\n",fCalorimeter.Data(),inacceptance);
572 if(GetFiducialCut()->IsInFiducialCut(lv,fCalorimeter))
573 inacceptance = kTRUE ;
574 if(GetDebug() > 2) printf("In %s fiducial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance);
580 fhYPrimMC[kmcPPhoton]->Fill(photonPt, photonY) ;
581 if(TMath::Abs(photonY) < 1.0)
583 fhEPrimMC [kmcPPhoton]->Fill(photonE ) ;
584 fhPtPrimMC [kmcPPhoton]->Fill(photonPt) ;
585 fhPhiPrimMC[kmcPPhoton]->Fill(photonE , photonPhi) ;
586 fhYPrimMC[kmcPPhoton]->Fill(photonE , photonEta) ;
589 fhEPrimMCAcc[kmcPPhoton] ->Fill(photonE ) ;
590 fhPtPrimMCAcc[kmcPPhoton] ->Fill(photonPt) ;
591 fhPhiPrimMCAcc[kmcPPhoton]->Fill(photonE , photonPhi) ;
592 fhYPrimMCAcc[kmcPPhoton] ->Fill(photonE , photonY) ;
597 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhEPrimMC[kmcPPrompt])
599 fhYPrimMC[kmcPPrompt]->Fill(photonPt, photonY) ;
600 if(TMath::Abs(photonY) < 1.0){
601 fhEPrimMC [kmcPPrompt]->Fill(photonE ) ;
602 fhPtPrimMC [kmcPPrompt]->Fill(photonPt) ;
603 fhPhiPrimMC[kmcPPrompt]->Fill(photonE , photonPhi) ;
604 fhYPrimMC[kmcPPrompt]->Fill(photonE , photonEta) ;
607 fhEPrimMCAcc[kmcPPrompt] ->Fill(photonE ) ;
608 fhPtPrimMCAcc[kmcPPrompt] ->Fill(photonPt) ;
609 fhPhiPrimMCAcc[kmcPPrompt]->Fill(photonE , photonPhi) ;
610 fhYPrimMCAcc[kmcPPrompt] ->Fill(photonE , photonY) ;
613 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation) && fhEPrimMC[kmcPFragmentation] )
615 fhYPrimMC[kmcPFragmentation]->Fill(photonPt, photonY) ;
616 if(TMath::Abs(photonY) < 1.0){
617 fhEPrimMC [kmcPFragmentation]->Fill(photonE ) ;
618 fhPtPrimMC [kmcPFragmentation]->Fill(photonPt) ;
619 fhPhiPrimMC[kmcPFragmentation]->Fill(photonE , photonPhi) ;
620 fhYPrimMC[kmcPFragmentation]->Fill(photonE , photonEta) ;
623 fhEPrimMCAcc[kmcPFragmentation] ->Fill(photonE ) ;
624 fhPtPrimMCAcc[kmcPFragmentation] ->Fill(photonPt) ;
625 fhPhiPrimMCAcc[kmcPFragmentation]->Fill(photonE , photonPhi) ;
626 fhYPrimMCAcc[kmcPFragmentation] ->Fill(photonE , photonY) ;
629 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR) && fhEPrimMC[kmcPISR])
631 fhYPrimMC[kmcPISR]->Fill(photonPt, photonY) ;
632 if(TMath::Abs(photonY) < 1.0){
633 fhEPrimMC [kmcPISR]->Fill(photonE ) ;
634 fhPtPrimMC [kmcPISR]->Fill(photonPt) ;
635 fhPhiPrimMC[kmcPISR]->Fill(photonE , photonPhi) ;
636 fhYPrimMC[kmcPISR]->Fill(photonE , photonEta) ;
639 fhEPrimMCAcc[kmcPISR] ->Fill(photonE ) ;
640 fhPtPrimMCAcc[kmcPISR] ->Fill(photonPt) ;
641 fhPhiPrimMCAcc[kmcPISR]->Fill(photonE , photonPhi) ;
642 fhYPrimMCAcc[kmcPISR] ->Fill(photonE , photonY) ;
645 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay)&& fhEPrimMC[kmcPPi0Decay])
647 fhYPrimMC[kmcPPi0Decay]->Fill(photonPt, photonY) ;
648 if(TMath::Abs(photonY) < 1.0){
649 fhEPrimMC [kmcPPi0Decay]->Fill(photonE ) ;
650 fhPtPrimMC [kmcPPi0Decay]->Fill(photonPt) ;
651 fhPhiPrimMC[kmcPPi0Decay]->Fill(photonE , photonPhi) ;
652 fhYPrimMC[kmcPPi0Decay]->Fill(photonE , photonEta) ;
655 fhEPrimMCAcc[kmcPPi0Decay] ->Fill(photonE ) ;
656 fhPtPrimMCAcc[kmcPPi0Decay] ->Fill(photonPt) ;
657 fhPhiPrimMCAcc[kmcPPi0Decay]->Fill(photonE , photonPhi) ;
658 fhYPrimMCAcc[kmcPPi0Decay] ->Fill(photonE , photonY) ;
661 else if((GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
662 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhEPrimMC[kmcPOtherDecay])
664 fhYPrimMC[kmcPOtherDecay]->Fill(photonPt, photonY) ;
665 if(TMath::Abs(photonY) < 1.0){
666 fhEPrimMC [kmcPOtherDecay]->Fill(photonE ) ;
667 fhPtPrimMC [kmcPOtherDecay]->Fill(photonPt) ;
668 fhPhiPrimMC[kmcPOtherDecay]->Fill(photonE , photonPhi) ;
669 fhYPrimMC[kmcPOtherDecay]->Fill(photonE , photonEta) ;
672 fhEPrimMCAcc[kmcPOtherDecay] ->Fill(photonE ) ;
673 fhPtPrimMCAcc[kmcPOtherDecay] ->Fill(photonPt) ;
674 fhPhiPrimMCAcc[kmcPOtherDecay]->Fill(photonE , photonPhi) ;
675 fhYPrimMCAcc[kmcPOtherDecay] ->Fill(photonE , photonY) ;
678 else if(fhEPrimMC[kmcPOther])
680 fhYPrimMC[kmcPOther]->Fill(photonPt, photonY) ;
681 if(TMath::Abs(photonY) < 1.0){
682 fhEPrimMC [kmcPOther]->Fill(photonE ) ;
683 fhPtPrimMC [kmcPOther]->Fill(photonPt) ;
684 fhPhiPrimMC[kmcPOther]->Fill(photonE , photonPhi) ;
685 fhYPrimMC[kmcPOther]->Fill(photonE , photonEta) ;
688 fhEPrimMCAcc[kmcPOther] ->Fill(photonE ) ;
689 fhPtPrimMCAcc[kmcPOther] ->Fill(photonPt) ;
690 fhPhiPrimMCAcc[kmcPOther]->Fill(photonE , photonPhi) ;
691 fhYPrimMCAcc[kmcPOther] ->Fill(photonE , photonY) ;
697 }//kmc array exists and data is MC
701 //__________________________________________________________________
702 void AliAnaPhoton::FillShowerShapeHistograms(AliVCluster* cluster, const Int_t mcTag){
704 //Fill cluster Shower Shape histograms
706 if(!fFillSSHistograms || GetMixedEvent()) return;
708 Float_t energy = cluster->E();
709 Int_t ncells = cluster->GetNCells();
710 Float_t lambda0 = cluster->GetM02();
711 Float_t lambda1 = cluster->GetM20();
712 Float_t disp = cluster->GetDispersion()*cluster->GetDispersion();
715 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
716 cluster->GetMomentum(mom,GetVertex(0)) ;}//Assume that come from vertex in straight line
718 Double_t vertex[]={0,0,0};
719 cluster->GetMomentum(mom,vertex) ;
722 Float_t eta = mom.Eta();
723 Float_t phi = mom.Phi();
724 if(phi < 0) phi+=TMath::TwoPi();
726 fhLam0E ->Fill(energy,lambda0);
727 fhLam1E ->Fill(energy,lambda1);
728 fhDispE ->Fill(energy,disp);
730 if(fCalorimeter == "EMCAL" && GetModuleNumber(cluster) > 5){
731 fhLam0ETRD->Fill(energy,lambda0);
732 fhLam1ETRD->Fill(energy,lambda1);
733 fhDispETRD->Fill(energy,disp);
737 fhNCellsLam0LowE ->Fill(ncells,lambda0);
738 fhNCellsLam1LowE ->Fill(ncells,lambda1);
739 fhNCellsDispLowE ->Fill(ncells,disp);
741 fhLam1Lam0LowE ->Fill(lambda1,lambda0);
742 fhLam0DispLowE ->Fill(lambda0,disp);
743 fhDispLam1LowE ->Fill(disp,lambda1);
744 fhEtaLam0LowE ->Fill(eta,lambda0);
745 fhPhiLam0LowE ->Fill(phi,lambda0);
749 fhNCellsLam0HighE ->Fill(ncells,lambda0);
750 fhNCellsLam1HighE ->Fill(ncells,lambda1);
751 fhNCellsDispHighE ->Fill(ncells,disp);
753 fhLam1Lam0HighE ->Fill(lambda1,lambda0);
754 fhLam0DispHighE ->Fill(lambda0,disp);
755 fhDispLam1HighE ->Fill(disp,lambda1);
756 fhEtaLam0HighE ->Fill(eta, lambda0);
757 fhPhiLam0HighE ->Fill(phi, lambda0);
762 AliVCaloCells* cells = 0;
763 if(fCalorimeter == "EMCAL") cells = GetEMCALCells();
764 else cells = GetPHOSCells();
766 //Fill histograms to check shape of embedded clusters
767 Float_t fraction = 0;
768 if(GetReader()->IsEmbeddedClusterSelectionOn()){//Only working for EMCAL
770 Float_t clusterE = 0; // recalculate in case corrections applied.
772 for(Int_t icell = 0; icell < cluster->GetNCells(); icell++){
773 cellE = cells->GetCellAmplitude(cluster->GetCellAbsId(icell));
775 fraction+=cellE*cluster->GetCellAmplitudeFraction(icell);
778 //Fraction of total energy due to the embedded signal
781 if(GetDebug() > 1 ) printf("AliAnaPhoton::FillShowerShapeHistogram() - Energy fraction of embedded signal %2.3f, Energy %2.3f\n",fraction, clusterE);
783 fhEmbeddedSignalFractionEnergy->Fill(clusterE,fraction);
785 } // embedded fraction
787 // Get the fraction of the cluster energy that carries the cell with highest energy
789 Float_t maxCellFraction = 0.;
791 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
793 // Check the origin and fill histograms
794 if( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
795 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) &&
796 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) &&
797 !GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta)){
798 fhMCELambda0[kmcssPhoton] ->Fill(energy, lambda0);
799 fhMCELambda1[kmcssPhoton] ->Fill(energy, lambda1);
800 fhMCEDispersion[kmcssPhoton] ->Fill(energy, disp);
801 fhMCNCellsE[kmcssPhoton] ->Fill(energy, ncells);
802 fhMCMaxCellDiffClusterE[kmcssPhoton]->Fill(energy,maxCellFraction);
805 fhMCLambda0vsClusterMaxCellDiffE0[kmcssPhoton]->Fill(lambda0, maxCellFraction);
806 fhMCNCellsvsClusterMaxCellDiffE0[kmcssPhoton] ->Fill(ncells, maxCellFraction);
808 else if(energy < 6.){
809 fhMCLambda0vsClusterMaxCellDiffE2[kmcssPhoton]->Fill(lambda0, maxCellFraction);
810 fhMCNCellsvsClusterMaxCellDiffE2[kmcssPhoton] ->Fill(ncells, maxCellFraction);
813 fhMCLambda0vsClusterMaxCellDiffE6[kmcssPhoton]->Fill(lambda0, maxCellFraction);
814 fhMCNCellsvsClusterMaxCellDiffE6[kmcssPhoton] ->Fill(ncells, maxCellFraction);
817 if(!GetReader()->IsEmbeddedClusterSelectionOn()){
818 //Check particle overlaps in cluster
820 //Compare the primary depositing more energy with the rest, if no photon/electron as comon ancestor (conversions), count as other particle
821 Int_t ancPDG = 0, ancStatus = -1;
822 TLorentzVector momentum; TVector3 prodVertex;
825 for (UInt_t ilab = 0; ilab < cluster->GetNLabels(); ilab++ ) {
826 ancLabel = GetMCAnalysisUtils()->CheckCommonAncestor(cluster->GetLabels()[0],cluster->GetLabels()[ilab], GetReader(),ancPDG,ancStatus,momentum,prodVertex);
827 if(ancPDG!=22 && TMath::Abs(ancPDG)!=11) noverlaps++;
831 fhMCPhotonELambda0NoOverlap ->Fill(energy, lambda0);
833 else if(noverlaps == 2){
834 fhMCPhotonELambda0TwoOverlap ->Fill(energy, lambda0);
836 else if(noverlaps > 2){
837 fhMCPhotonELambda0NOverlap ->Fill(energy, lambda0);
840 printf("AliAnaPhoton::FillShowerShapeHistogram() - n overlaps = %d!!", noverlaps);
844 //Fill histograms to check shape of embedded clusters
845 if(GetReader()->IsEmbeddedClusterSelectionOn()){
849 fhEmbedPhotonELambda0FullSignal ->Fill(energy, lambda0);
851 else if(fraction > 0.5)
853 fhEmbedPhotonELambda0MostlySignal ->Fill(energy, lambda0);
855 else if(fraction > 0.1)
857 fhEmbedPhotonELambda0MostlyBkg ->Fill(energy, lambda0);
861 fhEmbedPhotonELambda0FullBkg ->Fill(energy, lambda0);
865 }//photon no conversion
866 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCElectron)){
867 fhMCELambda0[kmcssElectron] ->Fill(energy, lambda0);
868 fhMCELambda1[kmcssElectron] ->Fill(energy, lambda1);
869 fhMCEDispersion[kmcssElectron] ->Fill(energy, disp);
870 fhMCNCellsE[kmcssElectron] ->Fill(energy, ncells);
871 fhMCMaxCellDiffClusterE[kmcssElectron]->Fill(energy,maxCellFraction);
874 fhMCLambda0vsClusterMaxCellDiffE0[kmcssElectron]->Fill(lambda0, maxCellFraction);
875 fhMCNCellsvsClusterMaxCellDiffE0[kmcssElectron] ->Fill(ncells, maxCellFraction);
877 else if(energy < 6.){
878 fhMCLambda0vsClusterMaxCellDiffE2[kmcssElectron]->Fill(lambda0, maxCellFraction);
879 fhMCNCellsvsClusterMaxCellDiffE2[kmcssElectron] ->Fill(ncells, maxCellFraction);
882 fhMCLambda0vsClusterMaxCellDiffE6[kmcssElectron]->Fill(lambda0, maxCellFraction);
883 fhMCNCellsvsClusterMaxCellDiffE6[kmcssElectron] ->Fill(ncells, maxCellFraction);
886 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPhoton) &&
887 GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCConversion) ){
888 fhMCELambda0[kmcssConversion] ->Fill(energy, lambda0);
889 fhMCELambda1[kmcssConversion] ->Fill(energy, lambda1);
890 fhMCEDispersion[kmcssConversion] ->Fill(energy, disp);
891 fhMCNCellsE[kmcssConversion] ->Fill(energy, ncells);
892 fhMCMaxCellDiffClusterE[kmcssConversion]->Fill(energy,maxCellFraction);
895 fhMCLambda0vsClusterMaxCellDiffE0[kmcssConversion]->Fill(lambda0, maxCellFraction);
896 fhMCNCellsvsClusterMaxCellDiffE0[kmcssConversion] ->Fill(ncells, maxCellFraction);
898 else if(energy < 6.){
899 fhMCLambda0vsClusterMaxCellDiffE2[kmcssConversion]->Fill(lambda0, maxCellFraction);
900 fhMCNCellsvsClusterMaxCellDiffE2[kmcssConversion] ->Fill(ncells, maxCellFraction);
903 fhMCLambda0vsClusterMaxCellDiffE6[kmcssConversion]->Fill(lambda0, maxCellFraction);
904 fhMCNCellsvsClusterMaxCellDiffE6[kmcssConversion] ->Fill(ncells, maxCellFraction);
908 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCPi0) ){
909 fhMCELambda0[kmcssPi0] ->Fill(energy, lambda0);
910 fhMCELambda1[kmcssPi0] ->Fill(energy, lambda1);
911 fhMCEDispersion[kmcssPi0] ->Fill(energy, disp);
912 fhMCNCellsE[kmcssPi0] ->Fill(energy, ncells);
913 fhMCMaxCellDiffClusterE[kmcssPi0]->Fill(energy,maxCellFraction);
916 fhMCLambda0vsClusterMaxCellDiffE0[kmcssPi0]->Fill(lambda0, maxCellFraction);
917 fhMCNCellsvsClusterMaxCellDiffE0[kmcssPi0] ->Fill(ncells, maxCellFraction);
919 else if(energy < 6.){
920 fhMCLambda0vsClusterMaxCellDiffE2[kmcssPi0]->Fill(lambda0, maxCellFraction);
921 fhMCNCellsvsClusterMaxCellDiffE2[kmcssPi0] ->Fill(ncells, maxCellFraction);
924 fhMCLambda0vsClusterMaxCellDiffE6[kmcssPi0]->Fill(lambda0, maxCellFraction);
925 fhMCNCellsvsClusterMaxCellDiffE6[kmcssPi0] ->Fill(ncells, maxCellFraction);
928 //Fill histograms to check shape of embedded clusters
929 if(GetReader()->IsEmbeddedClusterSelectionOn()){
933 fhEmbedPi0ELambda0FullSignal ->Fill(energy, lambda0);
935 else if(fraction > 0.5)
937 fhEmbedPi0ELambda0MostlySignal ->Fill(energy, lambda0);
939 else if(fraction > 0.1)
941 fhEmbedPi0ELambda0MostlyBkg ->Fill(energy, lambda0);
945 fhEmbedPi0ELambda0FullBkg ->Fill(energy, lambda0);
950 else if ( GetMCAnalysisUtils()->CheckTagBit(mcTag,AliMCAnalysisUtils::kMCEta) ){
951 fhMCELambda0[kmcssEta] ->Fill(energy, lambda0);
952 fhMCELambda1[kmcssEta] ->Fill(energy, lambda1);
953 fhMCEDispersion[kmcssEta] ->Fill(energy, disp);
954 fhMCNCellsE[kmcssEta] ->Fill(energy, ncells);
955 fhMCMaxCellDiffClusterE[kmcssEta]->Fill(energy,maxCellFraction);
958 fhMCLambda0vsClusterMaxCellDiffE0[kmcssEta]->Fill(lambda0, maxCellFraction);
959 fhMCNCellsvsClusterMaxCellDiffE0[kmcssEta] ->Fill(ncells, maxCellFraction);
961 else if(energy < 6.){
962 fhMCLambda0vsClusterMaxCellDiffE2[kmcssEta]->Fill(lambda0, maxCellFraction);
963 fhMCNCellsvsClusterMaxCellDiffE2[kmcssEta] ->Fill(ncells, maxCellFraction);
966 fhMCLambda0vsClusterMaxCellDiffE6[kmcssEta]->Fill(lambda0, maxCellFraction);
967 fhMCNCellsvsClusterMaxCellDiffE6[kmcssEta] ->Fill(ncells, maxCellFraction);
972 fhMCELambda0[kmcssOther] ->Fill(energy, lambda0);
973 fhMCELambda1[kmcssOther] ->Fill(energy, lambda1);
974 fhMCEDispersion[kmcssOther] ->Fill(energy, disp);
975 fhMCNCellsE[kmcssOther] ->Fill(energy, ncells);
976 fhMCMaxCellDiffClusterE[kmcssOther]->Fill(energy,maxCellFraction);
979 fhMCLambda0vsClusterMaxCellDiffE0[kmcssOther]->Fill(lambda0, maxCellFraction);
980 fhMCNCellsvsClusterMaxCellDiffE0[kmcssOther] ->Fill(ncells, maxCellFraction);
982 else if(energy < 6.){
983 fhMCLambda0vsClusterMaxCellDiffE2[kmcssOther]->Fill(lambda0, maxCellFraction);
984 fhMCNCellsvsClusterMaxCellDiffE2[kmcssOther] ->Fill(ncells, maxCellFraction);
987 fhMCLambda0vsClusterMaxCellDiffE6[kmcssOther]->Fill(lambda0, maxCellFraction);
988 fhMCNCellsvsClusterMaxCellDiffE6[kmcssOther] ->Fill(ncells, maxCellFraction);
997 //________________________________________________________________________
998 TObjString * AliAnaPhoton::GetAnalysisCuts()
1000 //Save parameters used for analysis
1001 TString parList ; //this will be list of parameters used for this analysis.
1002 const Int_t buffersize = 255;
1003 char onePar[buffersize] ;
1005 snprintf(onePar,buffersize,"--- AliAnaPhoton ---\n") ;
1007 snprintf(onePar,buffersize,"Calorimeter: %s\n",fCalorimeter.Data()) ;
1009 snprintf(onePar,buffersize,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ;
1011 snprintf(onePar,buffersize,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ;
1013 snprintf(onePar,buffersize,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ;
1015 snprintf(onePar,buffersize,"fRejectTrackMatch: %d\n",fRejectTrackMatch) ;
1018 //Get parameters set in base class.
1019 parList += GetBaseParametersList() ;
1021 //Get parameters set in PID class.
1022 parList += GetCaloPID()->GetPIDParametersList() ;
1024 //Get parameters set in FiducialCut class (not available yet)
1025 //parlist += GetFidCut()->GetFidCutParametersList()
1027 return new TObjString(parList) ;
1030 //________________________________________________________________________
1031 TList * AliAnaPhoton::GetCreateOutputObjects()
1033 // Create histograms to be saved in output file and
1034 // store them in outputContainer
1035 TList * outputContainer = new TList() ;
1036 outputContainer->SetName("PhotonHistos") ;
1038 Int_t nptbins = GetHistogramRanges()->GetHistoPtBins(); Float_t ptmax = GetHistogramRanges()->GetHistoPtMax(); Float_t ptmin = GetHistogramRanges()->GetHistoPtMin();
1039 Int_t nphibins = GetHistogramRanges()->GetHistoPhiBins(); Float_t phimax = GetHistogramRanges()->GetHistoPhiMax(); Float_t phimin = GetHistogramRanges()->GetHistoPhiMin();
1040 Int_t netabins = GetHistogramRanges()->GetHistoEtaBins(); Float_t etamax = GetHistogramRanges()->GetHistoEtaMax(); Float_t etamin = GetHistogramRanges()->GetHistoEtaMin();
1041 Int_t ssbins = GetHistogramRanges()->GetHistoShowerShapeBins(); Float_t ssmax = GetHistogramRanges()->GetHistoShowerShapeMax(); Float_t ssmin = GetHistogramRanges()->GetHistoShowerShapeMin();
1042 Int_t nbins = GetHistogramRanges()->GetHistoNClusterCellBins(); Int_t nmax = GetHistogramRanges()->GetHistoNClusterCellMax(); Int_t nmin = GetHistogramRanges()->GetHistoNClusterCellMin();
1043 Int_t ntimebins= GetHistogramRanges()->GetHistoTimeBins(); Float_t timemax = GetHistogramRanges()->GetHistoTimeMax(); Float_t timemin = GetHistogramRanges()->GetHistoTimeMin();
1045 Int_t nresetabins = GetHistogramRanges()->GetHistoTrackResidualEtaBins();
1046 Float_t resetamax = GetHistogramRanges()->GetHistoTrackResidualEtaMax();
1047 Float_t resetamin = GetHistogramRanges()->GetHistoTrackResidualEtaMin();
1048 Int_t nresphibins = GetHistogramRanges()->GetHistoTrackResidualPhiBins();
1049 Float_t resphimax = GetHistogramRanges()->GetHistoTrackResidualPhiMax();
1050 Float_t resphimin = GetHistogramRanges()->GetHistoTrackResidualPhiMin();
1052 Int_t ndedxbins = GetHistogramRanges()->GetHistodEdxBins();
1053 Float_t dedxmax = GetHistogramRanges()->GetHistodEdxMax();
1054 Float_t dedxmin = GetHistogramRanges()->GetHistodEdxMin();
1055 Int_t nPoverEbins = GetHistogramRanges()->GetHistoPOverEBins();
1056 Float_t pOverEmax = GetHistogramRanges()->GetHistoPOverEMax();
1057 Float_t pOverEmin = GetHistogramRanges()->GetHistoPOverEMin();
1059 TString cut[] = {"Open","Reader","E","Time","NCells","Fidutial","Matching","Bad","PID"};
1060 for (Int_t i = 0; i < 9 ; i++)
1062 fhClusterCuts[i] = new TH1F(Form("hCut_%d_%s", i, cut[i].Data()),
1063 Form("Number of clusters that pass cuts <= %d, %s", i, cut[i].Data()),
1064 nptbins,ptmin,ptmax);
1065 fhClusterCuts[i]->SetYTitle("dN/dE ");
1066 fhClusterCuts[i]->SetXTitle("E (GeV)");
1067 outputContainer->Add(fhClusterCuts[i]) ;
1070 fhNCellsE = new TH2F ("hNCellsE","# of cells in cluster vs E of clusters", nptbins,ptmin,ptmax, nbins,nmin,nmax);
1071 fhNCellsE->SetXTitle("E (GeV)");
1072 fhNCellsE->SetYTitle("# of cells in cluster");
1073 outputContainer->Add(fhNCellsE);
1075 fhTimeE = new TH2F ("hTimeE","time of cluster vs E of clusters", nptbins,ptmin,ptmax, ntimebins,timemin,timemax);
1076 fhTimeE->SetXTitle("E (GeV)");
1077 fhTimeE->SetYTitle("time (ns)");
1078 outputContainer->Add(fhTimeE);
1080 fhMaxCellDiffClusterE = new TH2F ("hMaxCellDiffClusterE","energy vs difference of cluster energy - max cell energy / cluster energy, good clusters",
1081 nptbins,ptmin,ptmax, 500,0,1.);
1082 fhMaxCellDiffClusterE->SetXTitle("E_{cluster} (GeV) ");
1083 fhMaxCellDiffClusterE->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1084 outputContainer->Add(fhMaxCellDiffClusterE);
1086 fhEPhoton = new TH1F("hEPhoton","Number of #gamma over calorimeter vs energy",nptbins,ptmin,ptmax);
1087 fhEPhoton->SetYTitle("N");
1088 fhEPhoton->SetXTitle("E_{#gamma}(GeV)");
1089 outputContainer->Add(fhEPhoton) ;
1091 fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter vs p_{T}",nptbins,ptmin,ptmax);
1092 fhPtPhoton->SetYTitle("N");
1093 fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)");
1094 outputContainer->Add(fhPtPhoton) ;
1096 fhPhiPhoton = new TH2F
1097 ("hPhiPhoton","#phi_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1098 fhPhiPhoton->SetYTitle("#phi (rad)");
1099 fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1100 outputContainer->Add(fhPhiPhoton) ;
1102 fhEtaPhoton = new TH2F
1103 ("hEtaPhoton","#eta_{#gamma} vs p_{T}",nptbins,ptmin,ptmax,netabins,etamin,etamax);
1104 fhEtaPhoton->SetYTitle("#eta");
1105 fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)");
1106 outputContainer->Add(fhEtaPhoton) ;
1108 fhEtaPhiPhoton = new TH2F
1109 ("hEtaPhiPhoton","#eta vs #phi",netabins,etamin,etamax,nphibins,phimin,phimax);
1110 fhEtaPhiPhoton->SetYTitle("#phi (rad)");
1111 fhEtaPhiPhoton->SetXTitle("#eta");
1112 outputContainer->Add(fhEtaPhiPhoton) ;
1113 if(GetMinPt() < 0.5){
1114 fhEtaPhi05Photon = new TH2F
1115 ("hEtaPhi05Photon","#eta vs #phi, E > 0.5",netabins,etamin,etamax,nphibins,phimin,phimax);
1116 fhEtaPhi05Photon->SetYTitle("#phi (rad)");
1117 fhEtaPhi05Photon->SetXTitle("#eta");
1118 outputContainer->Add(fhEtaPhi05Photon) ;
1122 if(fFillSSHistograms){
1124 fhLam0E = new TH2F ("hLam0E","#lambda_{0}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1125 fhLam0E->SetYTitle("#lambda_{0}^{2}");
1126 fhLam0E->SetXTitle("E (GeV)");
1127 outputContainer->Add(fhLam0E);
1129 fhLam1E = new TH2F ("hLam1E","#lambda_{1}^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1130 fhLam1E->SetYTitle("#lambda_{1}^{2}");
1131 fhLam1E->SetXTitle("E (GeV)");
1132 outputContainer->Add(fhLam1E);
1134 fhDispE = new TH2F ("hDispE"," dispersion^{2} vs E", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1135 fhDispE->SetYTitle("D^{2}");
1136 fhDispE->SetXTitle("E (GeV) ");
1137 outputContainer->Add(fhDispE);
1139 if(fCalorimeter == "EMCAL"){
1140 fhLam0ETRD = new TH2F ("hLam0ETRD","#lambda_{0}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1141 fhLam0ETRD->SetYTitle("#lambda_{0}^{2}");
1142 fhLam0ETRD->SetXTitle("E (GeV)");
1143 outputContainer->Add(fhLam0ETRD);
1145 fhLam1ETRD = new TH2F ("hLam1ETRD","#lambda_{1}^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1146 fhLam1ETRD->SetYTitle("#lambda_{1}^{2}");
1147 fhLam1ETRD->SetXTitle("E (GeV)");
1148 outputContainer->Add(fhLam1ETRD);
1150 fhDispETRD = new TH2F ("hDispETRD"," dispersion^{2} vs E, EMCAL SM covered by TRD", nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1151 fhDispETRD->SetYTitle("Dispersion^{2}");
1152 fhDispETRD->SetXTitle("E (GeV) ");
1153 outputContainer->Add(fhDispETRD);
1156 fhNCellsLam0LowE = new TH2F ("hNCellsLam0LowE","N_{cells} in cluster vs #lambda_{0}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1157 fhNCellsLam0LowE->SetXTitle("N_{cells}");
1158 fhNCellsLam0LowE->SetYTitle("#lambda_{0}^{2}");
1159 outputContainer->Add(fhNCellsLam0LowE);
1161 fhNCellsLam0HighE = new TH2F ("hNCellsLam0HighE","N_{cells} in cluster vs #lambda_{0}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1162 fhNCellsLam0HighE->SetXTitle("N_{cells}");
1163 fhNCellsLam0HighE->SetYTitle("#lambda_{0}^{2}");
1164 outputContainer->Add(fhNCellsLam0HighE);
1166 fhNCellsLam1LowE = new TH2F ("hNCellsLam1LowE","N_{cells} in cluster vs #lambda_{1}^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1167 fhNCellsLam1LowE->SetXTitle("N_{cells}");
1168 fhNCellsLam1LowE->SetYTitle("#lambda_{0}^{2}");
1169 outputContainer->Add(fhNCellsLam1LowE);
1171 fhNCellsLam1HighE = new TH2F ("hNCellsLam1HighE","N_{cells} in cluster vs #lambda_{1}^{2}, E > 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1172 fhNCellsLam1HighE->SetXTitle("N_{cells}");
1173 fhNCellsLam1HighE->SetYTitle("#lambda_{0}^{2}");
1174 outputContainer->Add(fhNCellsLam1HighE);
1176 fhNCellsDispLowE = new TH2F ("hNCellsDispLowE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1177 fhNCellsDispLowE->SetXTitle("N_{cells}");
1178 fhNCellsDispLowE->SetYTitle("D^{2}");
1179 outputContainer->Add(fhNCellsDispLowE);
1181 fhNCellsDispHighE = new TH2F ("hNCellsDispHighE","N_{cells} in cluster vs dispersion^{2}, E < 2 GeV", nbins,nmin, nmax, ssbins,ssmin,ssmax);
1182 fhNCellsDispHighE->SetXTitle("N_{cells}");
1183 fhNCellsDispHighE->SetYTitle("D^{2}");
1184 outputContainer->Add(fhNCellsDispHighE);
1186 fhEtaLam0LowE = new TH2F ("hEtaLam0LowE","#eta vs #lambda_{0}^{2}, E < 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1187 fhEtaLam0LowE->SetYTitle("#lambda_{0}^{2}");
1188 fhEtaLam0LowE->SetXTitle("#eta");
1189 outputContainer->Add(fhEtaLam0LowE);
1191 fhPhiLam0LowE = new TH2F ("hPhiLam0LowE","#phi vs #lambda_{0}^{2}, E < 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1192 fhPhiLam0LowE->SetYTitle("#lambda_{0}^{2}");
1193 fhPhiLam0LowE->SetXTitle("#phi");
1194 outputContainer->Add(fhPhiLam0LowE);
1196 fhEtaLam0HighE = new TH2F ("hEtaLam0HighE","#eta vs #lambda_{0}^{2}, E > 2 GeV", netabins,etamin,etamax, ssbins,ssmin,ssmax);
1197 fhEtaLam0HighE->SetYTitle("#lambda_{0}^{2}");
1198 fhEtaLam0HighE->SetXTitle("#eta");
1199 outputContainer->Add(fhEtaLam0HighE);
1201 fhPhiLam0HighE = new TH2F ("hPhiLam0HighE","#phi vs #lambda_{0}^{2}, E > 2 GeV", nphibins,phimin,phimax, ssbins,ssmin,ssmax);
1202 fhPhiLam0HighE->SetYTitle("#lambda_{0}^{2}");
1203 fhPhiLam0HighE->SetXTitle("#phi");
1204 outputContainer->Add(fhPhiLam0HighE);
1206 fhLam1Lam0LowE = new TH2F ("hLam1Lam0LowE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1207 fhLam1Lam0LowE->SetYTitle("#lambda_{0}^{2}");
1208 fhLam1Lam0LowE->SetXTitle("#lambda_{1}^{2}");
1209 outputContainer->Add(fhLam1Lam0LowE);
1211 fhLam1Lam0HighE = new TH2F ("hLam1Lam0HighE","#lambda_{0}^{2} vs #lambda_{1}^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1212 fhLam1Lam0HighE->SetYTitle("#lambda_{0}^{2}");
1213 fhLam1Lam0HighE->SetXTitle("#lambda_{1}^{2}");
1214 outputContainer->Add(fhLam1Lam0HighE);
1216 fhLam0DispLowE = new TH2F ("hLam0DispLowE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1217 fhLam0DispLowE->SetXTitle("#lambda_{0}^{2}");
1218 fhLam0DispLowE->SetYTitle("D^{2}");
1219 outputContainer->Add(fhLam0DispLowE);
1221 fhLam0DispHighE = new TH2F ("hLam0DispHighE","#lambda_{0}^{2} vs dispersion^{2} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1222 fhLam0DispHighE->SetXTitle("#lambda_{0}^{2}");
1223 fhLam0DispHighE->SetYTitle("D^{2}");
1224 outputContainer->Add(fhLam0DispHighE);
1226 fhDispLam1LowE = new TH2F ("hDispLam1LowE","Dispersion^{2} vs #lambda_{1}^{2} in cluster of E < 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1227 fhDispLam1LowE->SetXTitle("D^{2}");
1228 fhDispLam1LowE->SetYTitle("#lambda_{1}^{2}");
1229 outputContainer->Add(fhDispLam1LowE);
1231 fhDispLam1HighE = new TH2F ("hDispLam1HighE","Dispersion^{2} vs #lambda_{1^{2}} in cluster of E > 2 GeV", ssbins,ssmin,ssmax, ssbins,ssmin,ssmax);
1232 fhDispLam1HighE->SetXTitle("D^{2}");
1233 fhDispLam1HighE->SetYTitle("#lambda_{1}^{2}");
1234 outputContainer->Add(fhDispLam1HighE);
1241 fhTrackMatchedDEta = new TH2F
1242 ("hTrackMatchedDEta",
1243 "d#eta of cluster-track vs cluster energy",
1244 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1245 fhTrackMatchedDEta->SetYTitle("d#eta");
1246 fhTrackMatchedDEta->SetXTitle("E_{cluster} (GeV)");
1248 fhTrackMatchedDPhi = new TH2F
1249 ("hTrackMatchedDPhi",
1250 "d#phi of cluster-track vs cluster energy",
1251 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1252 fhTrackMatchedDPhi->SetYTitle("d#phi (rad)");
1253 fhTrackMatchedDPhi->SetXTitle("E_{cluster} (GeV)");
1255 fhTrackMatchedDEtaDPhi = new TH2F
1256 ("hTrackMatchedDEtaDPhi",
1257 "d#eta vs d#phi of cluster-track vs cluster energy",
1258 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1259 fhTrackMatchedDEtaDPhi->SetYTitle("d#phi (rad)");
1260 fhTrackMatchedDEtaDPhi->SetXTitle("d#eta");
1262 outputContainer->Add(fhTrackMatchedDEta) ;
1263 outputContainer->Add(fhTrackMatchedDPhi) ;
1264 outputContainer->Add(fhTrackMatchedDEtaDPhi) ;
1266 fhTrackMatchedDEtaNoCut = new TH2F
1267 ("hTrackMatchedDEtaNoCut",
1268 "d#eta of cluster-track vs cluster energy, no photon cuts",
1269 nptbins,ptmin,ptmax,nresetabins,resetamin,resetamax);
1270 fhTrackMatchedDEtaNoCut->SetYTitle("d#eta");
1271 fhTrackMatchedDEtaNoCut->SetXTitle("E_{cluster} (GeV)");
1273 fhTrackMatchedDPhiNoCut = new TH2F
1274 ("hTrackMatchedDPhiNoCut",
1275 "d#phi of cluster-track vs cluster energy, no photon cuts",
1276 nptbins,ptmin,ptmax,nresphibins,resphimin,resphimax);
1277 fhTrackMatchedDPhiNoCut->SetYTitle("d#phi (rad)");
1278 fhTrackMatchedDPhiNoCut->SetXTitle("E_{cluster} (GeV)");
1280 fhTrackMatchedDEtaDPhiNoCut = new TH2F
1281 ("hTrackMatchedDEtaDPhiNoCut",
1282 "d#eta vs d#phi of cluster-track vs cluster energy, no photon cuts",
1283 nresetabins,resetamin,resetamax,nresphibins,resphimin,resphimax);
1284 fhTrackMatchedDEtaDPhiNoCut->SetYTitle("d#phi (rad)");
1285 fhTrackMatchedDEtaDPhiNoCut->SetXTitle("d#eta");
1287 outputContainer->Add(fhTrackMatchedDEtaNoCut) ;
1288 outputContainer->Add(fhTrackMatchedDPhiNoCut) ;
1289 outputContainer->Add(fhTrackMatchedDEtaDPhiNoCut) ;
1291 fhdEdx = new TH2F ("hdEdx","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1292 fhdEdx->SetXTitle("E (GeV)");
1293 fhdEdx->SetYTitle("<dE/dx>");
1294 outputContainer->Add(fhdEdx);
1296 fhEOverP = new TH2F ("hEOverP","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1297 fhEOverP->SetXTitle("E (GeV)");
1298 fhEOverP->SetYTitle("E/p");
1299 outputContainer->Add(fhEOverP);
1301 fhdEdxNoCut = new TH2F ("hdEdxNoCut","matched track <dE/dx> vs cluster E ", nptbins,ptmin,ptmax,ndedxbins, dedxmin, dedxmax);
1302 fhdEdxNoCut->SetXTitle("E (GeV)");
1303 fhdEdxNoCut->SetYTitle("<dE/dx>");
1304 outputContainer->Add(fhdEdxNoCut);
1306 fhEOverPNoCut = new TH2F ("hEOverPNoCut","matched track E/p vs cluster E ", nptbins,ptmin,ptmax,nPoverEbins,pOverEmin,pOverEmax);
1307 fhEOverPNoCut->SetXTitle("E (GeV)");
1308 fhEOverPNoCut->SetYTitle("E/p");
1309 outputContainer->Add(fhEOverPNoCut);
1313 fhTrackMatchedMCParticle = new TH2F
1314 ("hTrackMatchedMCParticle",
1315 "Origin of particle vs energy",
1316 nptbins,ptmin,ptmax,8,0,8);
1317 fhTrackMatchedMCParticle->SetXTitle("E (GeV)");
1318 //fhTrackMatchedMCParticle->SetYTitle("Particle type");
1320 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(1 ,"Photon");
1321 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(2 ,"Electron");
1322 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1323 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(4 ,"Rest");
1324 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1325 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1326 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1327 fhTrackMatchedMCParticle->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1329 outputContainer->Add(fhTrackMatchedMCParticle);
1331 fhTrackMatchedMCParticleNoCut = new TH2F
1332 ("hTrackMatchedMCParticleNoCut",
1333 "Origin of particle vs energy",
1334 nptbins,ptmin,ptmax,8,0,8);
1335 fhTrackMatchedMCParticleNoCut->SetXTitle("E (GeV)");
1336 //fhTrackMatchedMCParticleNoCut->SetYTitle("Particle type");
1338 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(1 ,"Photon");
1339 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(2 ,"Electron");
1340 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(3 ,"Meson Merged");
1341 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(4 ,"Rest");
1342 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(5 ,"Conv. Photon");
1343 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(6 ,"Conv. Electron");
1344 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(7 ,"Conv. Merged");
1345 fhTrackMatchedMCParticleNoCut->GetYaxis()->SetBinLabel(8 ,"Conv. Rest");
1347 outputContainer->Add(fhTrackMatchedMCParticleNoCut);
1354 TString ptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}", "#pi^{0}","#eta",
1355 "e^{#pm}","#gamma->e^{#pm}","hadron?","Anti-N","Anti-P",
1356 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}","String" } ;
1358 TString pname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Pi0","Eta","Electron",
1359 "Conversion", "Hadron", "AntiNeutron","AntiProton",
1360 "PhotonPrompt","PhotonFragmentation","PhotonISR","String" } ;
1362 for(Int_t i = 0; i < fNOriginHistograms; i++){
1364 fhMCE[i] = new TH1F(Form("hE_MC%s",pname[i].Data()),
1365 Form("cluster from %s : E ",ptype[i].Data()),
1366 nptbins,ptmin,ptmax);
1367 fhMCE[i]->SetXTitle("E (GeV)");
1368 outputContainer->Add(fhMCE[i]) ;
1370 fhMCPt[i] = new TH1F(Form("hPt_MC%s",pname[i].Data()),
1371 Form("cluster from %s : p_{T} ",ptype[i].Data()),
1372 nptbins,ptmin,ptmax);
1373 fhMCPt[i]->SetXTitle("p_{T} (GeV/c)");
1374 outputContainer->Add(fhMCPt[i]) ;
1376 fhMCEta[i] = new TH2F(Form("hEta_MC%s",pname[i].Data()),
1377 Form("cluster from %s : #eta ",ptype[i].Data()),
1378 nptbins,ptmin,ptmax,netabins,etamin,etamax);
1379 fhMCEta[i]->SetYTitle("#eta");
1380 fhMCEta[i]->SetXTitle("E (GeV)");
1381 outputContainer->Add(fhMCEta[i]) ;
1383 fhMCPhi[i] = new TH2F(Form("hPhi_MC%s",pname[i].Data()),
1384 Form("cluster from %s : #phi ",ptype[i].Data()),
1385 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1386 fhMCPhi[i]->SetYTitle("#phi (rad)");
1387 fhMCPhi[i]->SetXTitle("E (GeV)");
1388 outputContainer->Add(fhMCPhi[i]) ;
1391 fhMCDeltaE[i] = new TH2F (Form("hDeltaE_MC%s",pname[i].Data()),
1392 Form("MC - Reco E from %s",pname[i].Data()),
1393 nptbins,ptmin,ptmax, 200,-50,50);
1394 fhMCDeltaE[i]->SetXTitle("#Delta E (GeV)");
1395 outputContainer->Add(fhMCDeltaE[i]);
1397 fhMCDeltaPt[i] = new TH2F (Form("hDeltaPt_MC%s",pname[i].Data()),
1398 Form("MC - Reco p_{T} from %s",pname[i].Data()),
1399 nptbins,ptmin,ptmax, 200,-50,50);
1400 fhMCDeltaPt[i]->SetXTitle("#Delta p_{T} (GeV/c)");
1401 outputContainer->Add(fhMCDeltaPt[i]);
1403 fhMC2E[i] = new TH2F (Form("h2E_MC%s",pname[i].Data()),
1404 Form("E distribution, reconstructed vs generated from %s",pname[i].Data()),
1405 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1406 fhMC2E[i]->SetXTitle("E_{rec} (GeV)");
1407 fhMC2E[i]->SetYTitle("E_{gen} (GeV)");
1408 outputContainer->Add(fhMC2E[i]);
1410 fhMC2Pt[i] = new TH2F (Form("h2Pt_MC%s",pname[i].Data()),
1411 Form("p_T distribution, reconstructed vs generated from %s",pname[i].Data()),
1412 nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1413 fhMC2Pt[i]->SetXTitle("p_{T,rec} (GeV/c)");
1414 fhMC2Pt[i]->SetYTitle("p_{T,gen} (GeV/c)");
1415 outputContainer->Add(fhMC2Pt[i]);
1420 TString pptype[] = { "#gamma", "#gamma_{#pi decay}","#gamma_{other decay}","hadron?",
1421 "#gamma_{prompt}","#gamma_{fragmentation}","#gamma_{ISR}"} ;
1423 TString ppname[] = { "Photon","PhotonPi0Decay","PhotonOtherDecay","Hadron",
1424 "PhotonPrompt","PhotonFragmentation","PhotonISR"} ;
1426 for(Int_t i = 0; i < fNPrimaryHistograms; i++){
1427 fhEPrimMC[i] = new TH1F(Form("hEPrim_MC%s",ppname[i].Data()),
1428 Form("primary photon %s : E ",pptype[i].Data()),
1429 nptbins,ptmin,ptmax);
1430 fhEPrimMC[i]->SetXTitle("E (GeV)");
1431 outputContainer->Add(fhEPrimMC[i]) ;
1433 fhPtPrimMC[i] = new TH1F(Form("hPtPrim_MC%s",ppname[i].Data()),
1434 Form("primary photon %s : p_{T} ",pptype[i].Data()),
1435 nptbins,ptmin,ptmax);
1436 fhPtPrimMC[i]->SetXTitle("p_{T} (GeV/c)");
1437 outputContainer->Add(fhPtPrimMC[i]) ;
1439 fhYPrimMC[i] = new TH2F(Form("hYPrim_MC%s",ppname[i].Data()),
1440 Form("primary photon %s : Rapidity ",pptype[i].Data()),
1441 nptbins,ptmin,ptmax,800,-8,8);
1442 fhYPrimMC[i]->SetYTitle("Rapidity");
1443 fhYPrimMC[i]->SetXTitle("E (GeV)");
1444 outputContainer->Add(fhYPrimMC[i]) ;
1446 fhPhiPrimMC[i] = new TH2F(Form("hPhiPrim_MC%s",ppname[i].Data()),
1447 Form("primary photon %s : #phi ",pptype[i].Data()),
1448 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1449 fhPhiPrimMC[i]->SetYTitle("#phi (rad)");
1450 fhPhiPrimMC[i]->SetXTitle("E (GeV)");
1451 outputContainer->Add(fhPhiPrimMC[i]) ;
1454 fhEPrimMCAcc[i] = new TH1F(Form("hEPrimAcc_MC%s",ppname[i].Data()),
1455 Form("primary photon %s in acceptance: E ",pptype[i].Data()),
1456 nptbins,ptmin,ptmax);
1457 fhEPrimMCAcc[i]->SetXTitle("E (GeV)");
1458 outputContainer->Add(fhEPrimMCAcc[i]) ;
1460 fhPtPrimMCAcc[i] = new TH1F(Form("hPtPrimAcc_MC%s",ppname[i].Data()),
1461 Form("primary photon %s in acceptance: p_{T} ",pptype[i].Data()),
1462 nptbins,ptmin,ptmax);
1463 fhPtPrimMCAcc[i]->SetXTitle("p_{T} (GeV/c)");
1464 outputContainer->Add(fhPtPrimMCAcc[i]) ;
1466 fhYPrimMCAcc[i] = new TH2F(Form("hYPrimAcc_MC%s",ppname[i].Data()),
1467 Form("primary photon %s in acceptance: Rapidity ",pptype[i].Data()),
1468 nptbins,ptmin,ptmax,100,-1,1);
1469 fhYPrimMCAcc[i]->SetYTitle("Rapidity");
1470 fhYPrimMCAcc[i]->SetXTitle("E (GeV)");
1471 outputContainer->Add(fhYPrimMCAcc[i]) ;
1473 fhPhiPrimMCAcc[i] = new TH2F(Form("hPhiPrimAcc_MC%s",ppname[i].Data()),
1474 Form("primary photon %s in acceptance: #phi ",pptype[i].Data()),
1475 nptbins,ptmin,ptmax,nphibins,phimin,phimax);
1476 fhPhiPrimMCAcc[i]->SetYTitle("#phi (rad)");
1477 fhPhiPrimMCAcc[i]->SetXTitle("E (GeV)");
1478 outputContainer->Add(fhPhiPrimMCAcc[i]) ;
1482 if(fFillSSHistograms){
1484 TString ptypess[] = { "#gamma","hadron?","#pi^{0}","#eta","#gamma->e^{#pm}","e^{#pm}"} ;
1486 TString pnamess[] = { "Photon","Hadron","Pi0","Eta","Conversion","Electron"} ;
1488 for(Int_t i = 0; i < 6; i++){
1490 fhMCELambda0[i] = new TH2F(Form("hELambda0_MC%s",pnamess[i].Data()),
1491 Form("cluster from %s : E vs #lambda_{0}^{2}",ptypess[i].Data()),
1492 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1493 fhMCELambda0[i]->SetYTitle("#lambda_{0}^{2}");
1494 fhMCELambda0[i]->SetXTitle("E (GeV)");
1495 outputContainer->Add(fhMCELambda0[i]) ;
1497 fhMCELambda1[i] = new TH2F(Form("hELambda1_MC%s",pnamess[i].Data()),
1498 Form("cluster from %s : E vs #lambda_{1}^{2}",ptypess[i].Data()),
1499 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1500 fhMCELambda1[i]->SetYTitle("#lambda_{1}^{2}");
1501 fhMCELambda1[i]->SetXTitle("E (GeV)");
1502 outputContainer->Add(fhMCELambda1[i]) ;
1504 fhMCEDispersion[i] = new TH2F(Form("hEDispersion_MC%s",pnamess[i].Data()),
1505 Form("cluster from %s : E vs dispersion^{2}",ptypess[i].Data()),
1506 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1507 fhMCEDispersion[i]->SetYTitle("D^{2}");
1508 fhMCEDispersion[i]->SetXTitle("E (GeV)");
1509 outputContainer->Add(fhMCEDispersion[i]) ;
1511 fhMCNCellsE[i] = new TH2F (Form("hNCellsE_MC%s",pnamess[i].Data()),
1512 Form("# of cells in cluster from %s vs E of clusters",ptypess[i].Data()),
1513 nptbins,ptmin,ptmax, nbins,nmin,nmax);
1514 fhMCNCellsE[i]->SetXTitle("E (GeV)");
1515 fhMCNCellsE[i]->SetYTitle("# of cells in cluster");
1516 outputContainer->Add(fhMCNCellsE[i]);
1518 fhMCMaxCellDiffClusterE[i] = new TH2F (Form("hMaxCellDiffClusterE_MC%s",pnamess[i].Data()),
1519 Form("energy vs difference of cluster energy from %s - max cell energy / cluster energy, good clusters",ptypess[i].Data()),
1520 nptbins,ptmin,ptmax, 500,0,1.);
1521 fhMCMaxCellDiffClusterE[i]->SetXTitle("E_{cluster} (GeV) ");
1522 fhMCMaxCellDiffClusterE[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1523 outputContainer->Add(fhMCMaxCellDiffClusterE[i]);
1525 fhMCLambda0vsClusterMaxCellDiffE0[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1526 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1527 ssbins,ssmin,ssmax,500,0,1.);
1528 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetXTitle("#lambda_{0}^{2}");
1529 fhMCLambda0vsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1530 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE0[i]) ;
1532 fhMCLambda0vsClusterMaxCellDiffE2[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1533 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1534 ssbins,ssmin,ssmax,500,0,1.);
1535 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetXTitle("#lambda_{0}^{2}");
1536 fhMCLambda0vsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1537 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE2[i]) ;
1539 fhMCLambda0vsClusterMaxCellDiffE6[i] = new TH2F(Form("hLambda0vsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1540 Form("cluster from %s : #lambda^{2}_{0} vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1541 ssbins,ssmin,ssmax,500,0,1.);
1542 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetXTitle("#lambda_{0}^{2}");
1543 fhMCLambda0vsClusterMaxCellDiffE6[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1544 outputContainer->Add(fhMCLambda0vsClusterMaxCellDiffE6[i]) ;
1546 fhMCNCellsvsClusterMaxCellDiffE0[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE0_MC%s",pnamess[i].Data()),
1547 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E < 2 GeV",ptypess[i].Data()),
1548 nbins/5,nmin,nmax/5,500,0,1.);
1549 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetXTitle("N cells in cluster");
1550 fhMCNCellsvsClusterMaxCellDiffE0[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1551 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE0[i]) ;
1553 fhMCNCellsvsClusterMaxCellDiffE2[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE2_MC%s",pnamess[i].Data()),
1554 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, 2< E < 6 GeV",ptypess[i].Data()),
1555 nbins/5,nmin,nmax/5,500,0,1.);
1556 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetXTitle("N cells in cluster");
1557 fhMCNCellsvsClusterMaxCellDiffE2[i]->SetYTitle("(E_{cluster} - E_{cell max})/ E_{cluster}");
1558 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE2[i]) ;
1560 fhMCNCellsvsClusterMaxCellDiffE6[i] = new TH2F(Form("hNCellsvsClusterMaxCellDiffE6_MC%s",pnamess[i].Data()),
1561 Form("cluster from %s : N cells in cluster vs fraction of energy carried by max cell, E > 6 GeV",ptypess[i].Data()),
1562 nbins/5,nmin,nmax/5,500,0,1.);
1563 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetXTitle("N cells in cluster");
1564 fhMCNCellsvsClusterMaxCellDiffE6[i]->SetYTitle("E (GeV)");
1565 outputContainer->Add(fhMCNCellsvsClusterMaxCellDiffE6[i]) ;
1569 if(!GetReader()->IsEmbeddedClusterSelectionOn())
1571 fhMCPhotonELambda0NoOverlap = new TH2F("hELambda0_MCPhoton_NoOverlap",
1572 "cluster from Photon : E vs #lambda_{0}^{2}",
1573 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1574 fhMCPhotonELambda0NoOverlap->SetYTitle("#lambda_{0}^{2}");
1575 fhMCPhotonELambda0NoOverlap->SetXTitle("E (GeV)");
1576 outputContainer->Add(fhMCPhotonELambda0NoOverlap) ;
1578 fhMCPhotonELambda0TwoOverlap = new TH2F("hELambda0_MCPhoton_TwoOverlap",
1579 "cluster from Photon : E vs #lambda_{0}^{2}",
1580 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1581 fhMCPhotonELambda0TwoOverlap->SetYTitle("#lambda_{0}^{2}");
1582 fhMCPhotonELambda0TwoOverlap->SetXTitle("E (GeV)");
1583 outputContainer->Add(fhMCPhotonELambda0TwoOverlap) ;
1585 fhMCPhotonELambda0NOverlap = new TH2F("hELambda0_MCPhoton_NOverlap",
1586 "cluster from Photon : E vs #lambda_{0}^{2}",
1587 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1588 fhMCPhotonELambda0NOverlap->SetYTitle("#lambda_{0}^{2}");
1589 fhMCPhotonELambda0NOverlap->SetXTitle("E (GeV)");
1590 outputContainer->Add(fhMCPhotonELambda0NOverlap) ;
1594 //Fill histograms to check shape of embedded clusters
1595 if(GetReader()->IsEmbeddedClusterSelectionOn())
1598 fhEmbeddedSignalFractionEnergy = new TH2F("hEmbeddedSignal_FractionEnergy",
1599 "Energy Fraction of embedded signal versus cluster energy",
1600 nptbins,ptmin,ptmax,100,0.,1.);
1601 fhEmbeddedSignalFractionEnergy->SetYTitle("Fraction");
1602 fhEmbeddedSignalFractionEnergy->SetXTitle("E (GeV)");
1603 outputContainer->Add(fhEmbeddedSignalFractionEnergy) ;
1605 fhEmbedPhotonELambda0FullSignal = new TH2F("hELambda0_EmbedPhoton_FullSignal",
1606 "cluster from Photon embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
1607 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1608 fhEmbedPhotonELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
1609 fhEmbedPhotonELambda0FullSignal->SetXTitle("E (GeV)");
1610 outputContainer->Add(fhEmbedPhotonELambda0FullSignal) ;
1612 fhEmbedPhotonELambda0MostlySignal = new TH2F("hELambda0_EmbedPhoton_MostlySignal",
1613 "cluster from Photon embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
1614 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1615 fhEmbedPhotonELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
1616 fhEmbedPhotonELambda0MostlySignal->SetXTitle("E (GeV)");
1617 outputContainer->Add(fhEmbedPhotonELambda0MostlySignal) ;
1619 fhEmbedPhotonELambda0MostlyBkg = new TH2F("hELambda0_EmbedPhoton_MostlyBkg",
1620 "cluster from Photon embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
1621 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1622 fhEmbedPhotonELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
1623 fhEmbedPhotonELambda0MostlyBkg->SetXTitle("E (GeV)");
1624 outputContainer->Add(fhEmbedPhotonELambda0MostlyBkg) ;
1626 fhEmbedPhotonELambda0FullBkg = new TH2F("hELambda0_EmbedPhoton_FullBkg",
1627 "cluster from Photonm embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
1628 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1629 fhEmbedPhotonELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
1630 fhEmbedPhotonELambda0FullBkg->SetXTitle("E (GeV)");
1631 outputContainer->Add(fhEmbedPhotonELambda0FullBkg) ;
1633 fhEmbedPi0ELambda0FullSignal = new TH2F("hELambda0_EmbedPi0_FullSignal",
1634 "cluster from Pi0 embedded with more than 90% energy in cluster : E vs #lambda_{0}^{2}",
1635 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1636 fhEmbedPi0ELambda0FullSignal->SetYTitle("#lambda_{0}^{2}");
1637 fhEmbedPi0ELambda0FullSignal->SetXTitle("E (GeV)");
1638 outputContainer->Add(fhEmbedPi0ELambda0FullSignal) ;
1640 fhEmbedPi0ELambda0MostlySignal = new TH2F("hELambda0_EmbedPi0_MostlySignal",
1641 "cluster from Pi0 embedded with 50% to 90% energy in cluster : E vs #lambda_{0}^{2}",
1642 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1643 fhEmbedPi0ELambda0MostlySignal->SetYTitle("#lambda_{0}^{2}");
1644 fhEmbedPi0ELambda0MostlySignal->SetXTitle("E (GeV)");
1645 outputContainer->Add(fhEmbedPi0ELambda0MostlySignal) ;
1647 fhEmbedPi0ELambda0MostlyBkg = new TH2F("hELambda0_EmbedPi0_MostlyBkg",
1648 "cluster from Pi0 embedded with 10% to 50% energy in cluster : E vs #lambda_{0}^{2}",
1649 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1650 fhEmbedPi0ELambda0MostlyBkg->SetYTitle("#lambda_{0}^{2}");
1651 fhEmbedPi0ELambda0MostlyBkg->SetXTitle("E (GeV)");
1652 outputContainer->Add(fhEmbedPi0ELambda0MostlyBkg) ;
1654 fhEmbedPi0ELambda0FullBkg = new TH2F("hELambda0_EmbedPi0_FullBkg",
1655 "cluster from Pi0 embedded with 0% to 10% energy in cluster : E vs #lambda_{0}^{2}",
1656 nptbins,ptmin,ptmax,ssbins,ssmin,ssmax);
1657 fhEmbedPi0ELambda0FullBkg->SetYTitle("#lambda_{0}^{2}");
1658 fhEmbedPi0ELambda0FullBkg->SetXTitle("E (GeV)");
1659 outputContainer->Add(fhEmbedPi0ELambda0FullBkg) ;
1661 }// embedded histograms
1664 }// Fill SS MC histograms
1668 return outputContainer ;
1672 //____________________________________________________________________________
1673 void AliAnaPhoton::Init()
1678 if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn() && NewOutputAOD()){
1679 printf("AliAnaPhoton::Init() - !!STOP: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n");
1682 else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn() && NewOutputAOD()){
1683 printf("AliAnaPhoton::Init() - !!STOP: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n");
1687 if(GetReader()->GetDataType() == AliCaloTrackReader::kMC) GetCaloPID()->SwitchOnBayesian();
1691 //____________________________________________________________________________
1692 void AliAnaPhoton::InitParameters()
1695 //Initialize the parameters of the analysis.
1696 AddToHistogramsName("AnaPhoton_");
1698 fCalorimeter = "EMCAL" ;
1703 fTimeCutMin =-1000000;
1704 fTimeCutMax = 1000000;
1707 fRejectTrackMatch = kTRUE ;
1711 //__________________________________________________________________
1712 void AliAnaPhoton::MakeAnalysisFillAOD()
1714 //Do photon analysis and fill aods
1717 Double_t v[3] = {0,0,0}; //vertex ;
1718 GetReader()->GetVertex(v);
1720 //Select the Calorimeter of the photon
1721 TObjArray * pl = 0x0;
1722 if(fCalorimeter == "PHOS")
1723 pl = GetPHOSClusters();
1724 else if (fCalorimeter == "EMCAL")
1725 pl = GetEMCALClusters();
1728 Info("MakeAnalysisFillAOD","TObjArray with %s clusters is NULL!\n",fCalorimeter.Data());
1732 // Loop on raw clusters before filtering in the reader and fill control histogram
1733 if((GetReader()->GetEMCALClusterListName()=="" && fCalorimeter=="EMCAL") || fCalorimeter=="PHOS"){
1734 for(Int_t iclus = 0; iclus < GetReader()->GetInputEvent()->GetNumberOfCaloClusters(); iclus++ ){
1735 AliVCluster * clus = GetReader()->GetInputEvent()->GetCaloCluster(iclus);
1736 if (fCalorimeter == "PHOS" && clus->IsPHOS() && clus->E() > GetReader()->GetPHOSPtMin() ) fhClusterCuts[0]->Fill(clus->E());
1737 else if(fCalorimeter == "EMCAL" && clus->IsEMCAL() && clus->E() > GetReader()->GetEMCALPtMin()) fhClusterCuts[0]->Fill(clus->E());
1740 else { // reclusterized
1741 TClonesArray * clusterList = 0;
1742 if(GetReader()->GetOutputEvent())
1743 clusterList = dynamic_cast<TClonesArray*> (GetReader()->GetOutputEvent()->FindListObject(GetReader()->GetEMCALClusterListName()));
1745 Int_t nclusters = clusterList->GetEntriesFast();
1746 for (Int_t iclus = 0; iclus < nclusters; iclus++) {
1747 AliVCluster * clus = dynamic_cast<AliVCluster*> (clusterList->At(iclus));
1748 if(clus)fhClusterCuts[0]->Fill(clus->E());
1753 //Init arrays, variables, get number of clusters
1754 TLorentzVector mom, mom2 ;
1755 Int_t nCaloClusters = pl->GetEntriesFast();
1757 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillAOD() - input %s cluster entries %d\n", fCalorimeter.Data(), nCaloClusters);
1759 //----------------------------------------------------
1760 // Fill AOD with PHOS/EMCAL AliAODPWG4Particle objects
1761 //----------------------------------------------------
1763 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++){
1765 AliVCluster * calo = (AliVCluster*) (pl->At(icalo));
1766 //printf("calo %d, %f\n",icalo,calo->E());
1768 //Get the index where the cluster comes, to retrieve the corresponding vertex
1769 Int_t evtIndex = 0 ;
1770 if (GetMixedEvent()) {
1771 evtIndex=GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
1772 //Get the vertex and check it is not too large in z
1773 if(TMath::Abs(GetVertex(evtIndex)[2])> GetZvertexCut()) continue;
1776 //Cluster selection, not charged, with photon id and in fiducial cut
1777 if(GetReader()->GetDataType() != AliCaloTrackReader::kMC){
1778 calo->GetMomentum(mom,GetVertex(evtIndex)) ;}//Assume that come from vertex in straight line
1780 Double_t vertex[]={0,0,0};
1781 calo->GetMomentum(mom,vertex) ;
1784 //--------------------------------------
1785 // Cluster selection
1786 //--------------------------------------
1787 if(!ClusterSelected(calo,mom)) continue;
1789 //----------------------------
1790 //Create AOD for analysis
1791 //----------------------------
1792 AliAODPWG4Particle aodph = AliAODPWG4Particle(mom);
1794 //...............................................
1795 //Set the indeces of the original caloclusters (MC, ID), and calorimeter
1796 Int_t label = calo->GetLabel();
1797 aodph.SetLabel(label);
1798 aodph.SetCaloLabel(calo->GetID(),-1);
1799 aodph.SetDetector(fCalorimeter);
1800 //printf("Index %d, Id %d, iaod %d\n",icalo, calo->GetID(),GetOutputAODBranch()->GetEntriesFast());
1802 //...............................................
1803 //Set bad channel distance bit
1804 Double_t distBad=calo->GetDistanceToBadChannel() ; //Distance to bad channel
1805 if (distBad > fMinDist3) aodph.SetDistToBad(2) ;
1806 else if(distBad > fMinDist2) aodph.SetDistToBad(1) ;
1807 else aodph.SetDistToBad(0) ;
1808 //printf("DistBad %f Bit %d\n",distBad, aodph.DistToBad());
1810 //--------------------------------------------------------------------------------------
1811 //Fill some shower shape histograms before PID is applied
1812 //--------------------------------------------------------------------------------------
1814 FillShowerShapeHistograms(calo,aodph.GetTag());
1816 //-------------------------------------
1817 //PID selection or bit setting
1818 //-------------------------------------
1820 //...............................................
1821 // Data, PID check on
1823 // Get most probable PID, 2 options check bayesian PID weights or redo PID
1824 // By default, redo PID
1826 aodph.SetIdentifiedParticleType(GetCaloPID()->GetIdentifiedParticleType(fCalorimeter,mom,calo));
1828 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PDG of identified particle %d\n",aodph.GetIdentifiedParticleType());
1830 //If cluster does not pass pid, not photon, skip it.
1831 if(aodph.GetIdentifiedParticleType() != AliCaloPID::kPhoton) continue ;
1834 //...............................................
1835 // Data, PID check off
1837 //Set PID bits for later selection (AliAnaPi0 for example)
1838 //GetIdentifiedParticleType already called in SetPIDBits.
1840 GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodph, GetCaloUtils(),GetReader()->GetInputEvent());
1842 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - PID Bits set \n");
1845 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() - Photon selection cuts passed: pT %3.2f, pdg %d\n",aodph.Pt(), aodph.GetIdentifiedParticleType());
1847 fhClusterCuts[8]->Fill(calo->E());
1849 // Matching after cuts
1852 Float_t dZ = calo->GetTrackDz();
1853 Float_t dR = calo->GetTrackDx();
1855 if(calo->IsEMCAL() && GetCaloUtils()->IsRecalculationOfClusterTrackMatchingOn()){
1856 dR = 2000., dZ = 2000.;
1857 GetCaloUtils()->GetEMCALRecoUtils()->GetMatchedResiduals(calo->GetID(),dZ,dR);
1860 if(TMath::Abs(dR) < 999){
1861 fhTrackMatchedDEta->Fill(calo->E(),dZ);
1862 fhTrackMatchedDPhi->Fill(calo->E(),dR);
1863 if(calo->E() > 0.5) fhTrackMatchedDEtaDPhi->Fill(dZ,dR);
1866 // Check dEdx and E/p of matched clusters
1868 if(TMath::Abs(dZ) < 0.05 && TMath::Abs(dR) < 0.05)
1870 AliVTrack *track = 0;
1871 if(!strcmp("AliESDCaloCluster",Form("%s",calo->ClassName()))){
1872 Int_t iESDtrack = calo->GetTrackMatchedIndex();
1873 if(iESDtrack<0) printf("AliAnaPhoton::MakeAnalysisFillAOD - Wrong track index\n");
1874 AliVEvent * event = GetReader()->GetInputEvent();
1875 track = dynamic_cast<AliVTrack*> (event->GetTrack(iESDtrack));
1878 track = dynamic_cast<AliVTrack*>(calo->GetTrackMatched(0));
1883 Float_t dEdx = track->GetTPCsignal();
1884 fhdEdx->Fill(calo->E(), dEdx);
1886 Float_t eOverp = calo->E()/track->P();
1887 fhEOverP->Fill(calo->E(), eOverp);
1892 Int_t tag = GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), 0);
1893 if ( !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) ){
1895 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1896 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(calo->E(), 2.5 );
1897 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(calo->E(), 0.5 );
1898 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(calo->E(), 1.5 );
1899 else fhTrackMatchedMCParticle->Fill(calo->E(), 3.5 );
1904 if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) ||
1905 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) ) fhTrackMatchedMCParticle->Fill(calo->E(), 6.5 );
1906 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) ) fhTrackMatchedMCParticle->Fill(calo->E(), 4.5 );
1907 else if ( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) ) fhTrackMatchedMCParticle->Fill(calo->E(), 5.5 );
1908 else fhTrackMatchedMCParticle->Fill(calo->E(), 7.5 );
1914 } // residual window
1916 } // Fill Track matching histo
1918 //--------------------------------------------------------------------------------------
1919 //Play with the MC stack if available
1920 //--------------------------------------------------------------------------------------
1922 //Check origin of the candidates
1924 aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabels(),calo->GetNLabels(),GetReader(), aodph.GetInputFileIndex()));
1927 printf("AliAnaPhoton::MakeAnalysisFillAOD() - Origin of candidate, bit map %d\n",aodph.GetTag());
1928 }//Work with stack also
1930 //Add AOD with photon object to aod branch
1931 AddAODParticle(aodph);
1935 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillAOD() End fill AODs, with %d entries \n",GetOutputAODBranch()->GetEntriesFast());
1939 //__________________________________________________________________
1940 void AliAnaPhoton::MakeAnalysisFillHistograms()
1944 //-------------------------------------------------------------------
1945 // Access MC information in stack if requested, check that it exists.
1946 AliStack * stack = 0x0;
1947 TParticle * primary = 0x0;
1948 TClonesArray * mcparticles = 0x0;
1949 AliAODMCParticle * aodprimary = 0x0;
1953 if(GetReader()->ReadStack()){
1954 stack = GetMCStack() ;
1956 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Stack not available, is the MC handler called? STOP\n");
1961 else if(GetReader()->ReadAODMCParticles()){
1963 //Get the list of MC particles
1964 mcparticles = GetReader()->GetAODMCParticles(0);
1965 if(!mcparticles && GetDebug() > 0) {
1966 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - Standard MCParticles not available!\n");
1973 Double_t v[3] = {0,0,0}; //vertex ;
1974 GetReader()->GetVertex(v);
1975 //fhVertex->Fill(v[0],v[1],v[2]);
1976 if(TMath::Abs(v[2]) > GetZvertexCut()) return ; // done elsewhere for Single Event analysis, but there for mixed event
1978 //----------------------------------
1979 //Loop on stored AOD photons
1980 Int_t naod = GetOutputAODBranch()->GetEntriesFast();
1981 if(GetDebug() > 0) printf("AliAnaPhoton::MakeAnalysisFillHistograms() - aod branch entries %d\n", naod);
1983 for(Int_t iaod = 0; iaod < naod ; iaod++){
1984 AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod));
1985 Int_t pdg = ph->GetIdentifiedParticleType();
1988 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - PDG %d, MC TAG %d, Calorimeter %s\n", ph->GetIdentifiedParticleType(),ph->GetTag(), (ph->GetDetector()).Data()) ;
1990 //If PID used, fill histos with photons in Calorimeter fCalorimeter
1991 if(IsCaloPIDOn() && pdg != AliCaloPID::kPhoton) continue;
1992 if(ph->GetDetector() != fCalorimeter) continue;
1995 printf("AliAnaPhoton::MakeAnalysisFillHistograms() - ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ;
1997 //................................
1998 //Fill photon histograms
1999 Float_t ptcluster = ph->Pt();
2000 Float_t phicluster = ph->Phi();
2001 Float_t etacluster = ph->Eta();
2002 Float_t ecluster = ph->E();
2004 fhEPhoton ->Fill(ecluster);
2005 fhPtPhoton ->Fill(ptcluster);
2006 fhPhiPhoton ->Fill(ptcluster,phicluster);
2007 fhEtaPhoton ->Fill(ptcluster,etacluster);
2008 if (ecluster > 0.5) fhEtaPhiPhoton ->Fill(etacluster, phicluster);
2009 else if(GetMinPt() < 0.5) fhEtaPhi05Photon->Fill(etacluster, phicluster);
2012 //Get original cluster, to recover some information
2014 Float_t maxCellFraction = 0;
2015 AliVCaloCells* cells = 0;
2016 TObjArray * clusters = 0;
2017 if(fCalorimeter == "EMCAL"){
2018 cells = GetEMCALCells();
2019 clusters = GetEMCALClusters();
2022 cells = GetPHOSCells();
2023 clusters = GetPHOSClusters();
2027 AliVCluster *cluster = FindCluster(clusters,ph->GetCaloLabel(0),iclus);
2029 absID = GetCaloUtils()->GetMaxEnergyCell(cells, cluster,maxCellFraction);
2031 // Control histograms
2032 fhMaxCellDiffClusterE->Fill(ph->E(),maxCellFraction);
2033 fhNCellsE ->Fill(ph->E(),cluster->GetNCells());
2034 fhTimeE ->Fill(ph->E(),cluster->GetTOF()*1.e9);
2037 //.......................................
2038 //Play with the MC data if available
2041 FillAcceptanceHistograms();
2043 //....................................................................
2044 // Access MC information in stack if requested, check that it exists.
2045 Int_t label =ph->GetLabel();
2047 if(GetDebug() > 1) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** bad label ***: label %d \n", label);
2053 if(GetReader()->ReadStack()){
2055 if(label >= stack->GetNtrack()) {
2056 if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n", label, stack->GetNtrack());
2060 primary = stack->Particle(label);
2062 printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label);
2065 eprim = primary->Energy();
2066 ptprim = primary->Pt();
2069 else if(GetReader()->ReadAODMCParticles()){
2070 //Check which is the input
2071 if(ph->GetInputFileIndex() == 0){
2072 if(!mcparticles) continue;
2073 if(label >= mcparticles->GetEntriesFast()) {
2074 if(GetDebug() > 2) printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** large label ***: label %d, n tracks %d \n",
2075 label, mcparticles->GetEntriesFast());
2079 aodprimary = (AliAODMCParticle*) mcparticles->At(label);
2084 printf("AliAnaPhoton::MakeAnalysisFillHistograms() *** no primary ***: label %d \n", label);
2088 eprim = aodprimary->E();
2089 ptprim = aodprimary->Pt();
2093 Int_t tag =ph->GetTag();
2095 if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPhoton) && fhMCE[kmcPhoton])
2097 fhMCE [kmcPhoton] ->Fill(ecluster);
2098 fhMCPt [kmcPhoton] ->Fill(ptcluster);
2099 fhMCPhi[kmcPhoton] ->Fill(ecluster,phicluster);
2100 fhMCEta[kmcPhoton] ->Fill(ecluster,etacluster);
2102 fhMC2E[kmcPhoton] ->Fill(ecluster, eprim);
2103 fhMC2Pt[kmcPhoton] ->Fill(ptcluster, ptprim);
2104 fhMCDeltaE[kmcPhoton] ->Fill(ecluster,eprim-ecluster);
2105 fhMCDeltaPt[kmcPhoton]->Fill(ptcluster,ptprim-ptcluster);
2107 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCConversion) && fhMCE[kmcConversion])
2109 fhMCE [kmcConversion] ->Fill(ecluster);
2110 fhMCPt [kmcConversion] ->Fill(ptcluster);
2111 fhMCPhi[kmcConversion] ->Fill(ecluster,phicluster);
2112 fhMCEta[kmcConversion] ->Fill(ecluster,etacluster);
2114 fhMC2E[kmcConversion] ->Fill(ecluster, eprim);
2115 fhMC2Pt[kmcConversion] ->Fill(ptcluster, ptprim);
2116 fhMCDeltaE[kmcConversion] ->Fill(ecluster,eprim-ecluster);
2117 fhMCDeltaPt[kmcConversion]->Fill(ptcluster,ptprim-ptcluster);
2120 if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPrompt) && fhMCE[kmcPrompt]){
2121 fhMCE [kmcPrompt] ->Fill(ecluster);
2122 fhMCPt [kmcPrompt] ->Fill(ptcluster);
2123 fhMCPhi[kmcPrompt] ->Fill(ecluster,phicluster);
2124 fhMCEta[kmcPrompt] ->Fill(ecluster,etacluster);
2126 fhMC2E[kmcPrompt] ->Fill(ecluster, eprim);
2127 fhMC2Pt[kmcPrompt] ->Fill(ptcluster, ptprim);
2128 fhMCDeltaE[kmcPrompt] ->Fill(ecluster,eprim-ecluster);
2129 fhMCDeltaPt[kmcPrompt]->Fill(ptcluster,ptprim-ptcluster);
2132 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCFragmentation)&& fhMCE[kmcFragmentation])
2134 fhMCE [kmcFragmentation] ->Fill(ecluster);
2135 fhMCPt [kmcFragmentation] ->Fill(ptcluster);
2136 fhMCPhi[kmcFragmentation] ->Fill(ecluster,phicluster);
2137 fhMCEta[kmcFragmentation] ->Fill(ecluster,etacluster);
2139 fhMC2E[kmcFragmentation] ->Fill(ecluster, eprim);
2140 fhMC2Pt[kmcFragmentation] ->Fill(ptcluster, ptprim);
2141 fhMCDeltaE[kmcFragmentation] ->Fill(ecluster,eprim-ecluster);
2142 fhMCDeltaPt[kmcFragmentation]->Fill(ptcluster,ptprim-ptcluster);
2145 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCISR)&& fhMCE[kmcISR])
2147 fhMCE [kmcISR] ->Fill(ecluster);
2148 fhMCPt [kmcISR] ->Fill(ptcluster);
2149 fhMCPhi[kmcISR] ->Fill(ecluster,phicluster);
2150 fhMCEta[kmcISR] ->Fill(ecluster,etacluster);
2152 fhMC2E[kmcISR] ->Fill(ecluster, eprim);
2153 fhMC2Pt[kmcISR] ->Fill(ptcluster, ptprim);
2154 fhMCDeltaE[kmcISR] ->Fill(ecluster,eprim-ecluster);
2155 fhMCDeltaPt[kmcISR]->Fill(ptcluster,ptprim-ptcluster);
2158 else if( GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0Decay) &&
2159 !GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE[kmcPi0Decay])
2161 fhMCE [kmcPi0Decay] ->Fill(ecluster);
2162 fhMCPt [kmcPi0Decay] ->Fill(ptcluster);
2163 fhMCPhi[kmcPi0Decay] ->Fill(ecluster,phicluster);
2164 fhMCEta[kmcPi0Decay] ->Fill(ecluster,etacluster);
2166 fhMC2E[kmcPi0Decay] ->Fill(ecluster, eprim);
2167 fhMC2Pt[kmcPi0Decay] ->Fill(ptcluster, ptprim);
2168 fhMCDeltaE[kmcPi0Decay] ->Fill(ecluster,eprim-ecluster);
2169 fhMCDeltaPt[kmcPi0Decay]->Fill(ptcluster,ptprim-ptcluster);
2172 else if( (GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEtaDecay) ||
2173 GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCOtherDecay) ) && fhMCE[kmcOtherDecay])
2175 fhMCE [kmcOtherDecay] ->Fill(ecluster);
2176 fhMCPt [kmcOtherDecay] ->Fill(ptcluster);
2177 fhMCPhi[kmcOtherDecay] ->Fill(ecluster,phicluster);
2178 fhMCEta[kmcOtherDecay] ->Fill(ecluster,etacluster);
2180 fhMC2E[kmcOtherDecay] ->Fill(ecluster, eprim);
2181 fhMC2Pt[kmcOtherDecay] ->Fill(ptcluster, ptprim);
2182 fhMCDeltaE[kmcOtherDecay] ->Fill(ecluster,eprim-ecluster);
2183 fhMCDeltaPt[kmcOtherDecay]->Fill(ptcluster,ptprim-ptcluster);
2186 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCPi0) && fhMCE [kmcPi0])
2188 fhMCE [kmcPi0] ->Fill(ecluster);
2189 fhMCPt [kmcPi0] ->Fill(ptcluster);
2190 fhMCPhi[kmcPi0] ->Fill(ecluster,phicluster);
2191 fhMCEta[kmcPi0] ->Fill(ecluster,etacluster);
2193 fhMC2E[kmcPi0] ->Fill(ecluster, eprim);
2194 fhMC2Pt[kmcPi0] ->Fill(ptcluster, ptprim);
2195 fhMCDeltaE[kmcPi0] ->Fill(ecluster,eprim-ecluster);
2196 fhMCDeltaPt[kmcPi0]->Fill(ptcluster,ptprim-ptcluster);
2199 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCEta) && fhMCE[kmcEta])
2201 fhMCE [kmcEta] ->Fill(ecluster);
2202 fhMCPt [kmcEta] ->Fill(ptcluster);
2203 fhMCPhi[kmcEta] ->Fill(ecluster,phicluster);
2204 fhMCEta[kmcEta] ->Fill(ecluster,etacluster);
2206 fhMC2E[kmcEta] ->Fill(ecluster, eprim);
2207 fhMC2Pt[kmcEta] ->Fill(ptcluster, ptprim);
2208 fhMCDeltaE[kmcEta] ->Fill(ecluster,eprim-ecluster);
2209 fhMCDeltaPt[kmcEta]->Fill(ptcluster,ptprim-ptcluster);
2213 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiNeutron) && fhMCE[kmcAntiNeutron])
2215 fhMCE [kmcAntiNeutron] ->Fill(ecluster);
2216 fhMCPt [kmcAntiNeutron] ->Fill(ptcluster);
2217 fhMCPhi[kmcAntiNeutron] ->Fill(ecluster,phicluster);
2218 fhMCEta[kmcAntiNeutron] ->Fill(ecluster,etacluster);
2220 fhMC2E[kmcAntiNeutron] ->Fill(ecluster, eprim);
2221 fhMC2Pt[kmcAntiNeutron] ->Fill(ptcluster, ptprim);
2222 fhMCDeltaE[kmcAntiNeutron] ->Fill(ecluster,eprim-ecluster);
2223 fhMCDeltaPt[kmcAntiNeutron]->Fill(ptcluster,ptprim-ptcluster);
2226 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCAntiProton) && fhMCE[kmcAntiProton])
2228 fhMCE [kmcAntiProton] ->Fill(ecluster);
2229 fhMCPt [kmcAntiProton] ->Fill(ptcluster);
2230 fhMCPhi[kmcAntiProton] ->Fill(ecluster,phicluster);
2231 fhMCEta[kmcAntiProton] ->Fill(ecluster,etacluster);
2233 fhMC2E[kmcAntiProton] ->Fill(ecluster, eprim);
2234 fhMC2Pt[kmcAntiProton] ->Fill(ptcluster, ptprim);
2235 fhMCDeltaE[kmcAntiProton] ->Fill(ecluster,eprim-ecluster);
2236 fhMCDeltaPt[kmcAntiProton]->Fill(ecluster,ptprim-ptcluster);
2239 else if(GetMCAnalysisUtils()->CheckTagBit(tag,AliMCAnalysisUtils::kMCElectron) && fhMCE[kmcElectron])
2241 fhMCE [kmcElectron] ->Fill(ecluster);
2242 fhMCPt [kmcElectron] ->Fill(ptcluster);
2243 fhMCPhi[kmcElectron] ->Fill(ecluster,phicluster);
2244 fhMCEta[kmcElectron] ->Fill(ecluster,etacluster);
2246 fhMC2E[kmcElectron] ->Fill(ecluster, eprim);
2247 fhMC2Pt[kmcElectron] ->Fill(ptcluster, ptprim);
2248 fhMCDeltaE[kmcElectron] ->Fill(ecluster,eprim-ecluster);
2249 fhMCDeltaPt[kmcElectron]->Fill(ecluster,ptprim-ptcluster);
2251 else if( fhMCE[kmcOther]){
2252 fhMCE [kmcOther] ->Fill(ecluster);
2253 fhMCPt [kmcOther] ->Fill(ptcluster);
2254 fhMCPhi[kmcOther] ->Fill(ecluster,phicluster);
2255 fhMCEta[kmcOther] ->Fill(ecluster,etacluster);
2257 fhMC2E[kmcOther] ->Fill(ecluster, eprim);
2258 fhMC2Pt[kmcOther] ->Fill(ptcluster, ptprim);
2259 fhMCDeltaE[kmcOther] ->Fill(ecluster,eprim-ecluster);
2260 fhMCDeltaPt[kmcOther]->Fill(ecluster,ptprim-ptcluster);
2262 // printf(" AliAnaPhoton::MakeAnalysisFillHistograms() - Label %d, pT %2.3f Unknown, bits set: ",
2263 // ph->GetLabel(),ph->Pt());
2264 // for(Int_t i = 0; i < 20; i++) {
2265 // if(GetMCAnalysisUtils()->CheckTagBit(tag,i)) printf(" %d, ",i);
2271 }//Histograms with MC
2278 //__________________________________________________________________
2279 void AliAnaPhoton::Print(const Option_t * opt) const
2281 //Print some relevant parameters set for the analysis
2286 printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ;
2287 AliAnaCaloTrackCorrBaseClass::Print(" ");
2289 printf("Calorimeter = %s\n", fCalorimeter.Data()) ;
2290 printf("Min Distance to Bad Channel = %2.1f\n",fMinDist);
2291 printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2);
2292 printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3);
2293 printf("Reject clusters with a track matched = %d\n",fRejectTrackMatch);
2294 printf("Time Cut: %3.1f < TOF < %3.1f\n", fTimeCutMin, fTimeCutMax);
2295 printf("Number of cells in cluster is > %d \n", fNCellsCut);