From 477d6cee166e6352a42084ae97f00e0a425eead6 Mon Sep 17 00:00:00 2001 From: gconesab Date: Mon, 20 Apr 2009 17:21:17 +0000 Subject: [PATCH] Several changes: 1) AddTaskPartCorr.C: The analysis train will call this macro to execute the tasks 2) Readers: Memory transient objects removed, now clusters and tracks selected and used in analysis are in TRefArrays. 3) AliAnaPi0.cxx: Protection added agains floating point exception when calculating the rapidity for MC particles 4)AliChargedParticles: New class for charged tracks selection for correlations. 5) Few coding violations removed 6) In AliAnaParticleHadron* and AliAnaParticleJet* added option to fill histograms when trigger particle is isolated 7)AliAnaParticle* and AliIsolationCut: When adding clusters or tracks to reference lists in AliAODParticleCorrelation, use new with placement. --- PWG4/CMake_libPWG4PartCorrDep.txt | 2 +- PWG4/PWG4PartCorrDepLinkDef.h | 1 + PWG4/PartCorrBase/AliAODPWG4Particle.cxx | 174 +- PWG4/PartCorrBase/AliAODPWG4Particle.h | 146 +- .../AliAODPWG4ParticleCorrelation.cxx | 117 +- .../AliAODPWG4ParticleCorrelation.h | 152 +- PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx | 336 +-- PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h | 355 +-- PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx | 290 +-- PWG4/PartCorrBase/AliAnaPartCorrMaker.h | 24 +- PWG4/PartCorrBase/AliAnaScale.cxx | 8 +- PWG4/PartCorrBase/AliAnaScale.h | 5 +- .../AliAnalysisTaskParticleCorrelation.cxx | 98 +- .../AliAnalysisTaskParticleCorrelation.h | 47 +- PWG4/PartCorrBase/AliCaloPID.cxx | 460 ++-- PWG4/PartCorrBase/AliCaloPID.h | 199 +- PWG4/PartCorrBase/AliCaloTrackAODReader.cxx | 136 +- PWG4/PartCorrBase/AliCaloTrackAODReader.h | 36 +- PWG4/PartCorrBase/AliCaloTrackESDReader.cxx | 460 ++-- PWG4/PartCorrBase/AliCaloTrackESDReader.h | 40 +- PWG4/PartCorrBase/AliCaloTrackMCReader.cxx | 299 ++- PWG4/PartCorrBase/AliCaloTrackMCReader.h | 41 +- PWG4/PartCorrBase/AliCaloTrackReader.cxx | 72 +- PWG4/PartCorrBase/AliCaloTrackReader.h | 71 +- PWG4/PartCorrBase/AliFidutialCut.cxx | 15 +- PWG4/PartCorrBase/AliFidutialCut.h | 38 +- PWG4/PartCorrBase/AliIsolationCut.cxx | 229 +- PWG4/PartCorrBase/AliIsolationCut.h | 76 +- PWG4/PartCorrBase/AliMCAnalysisUtils.cxx | 274 ++- PWG4/PartCorrBase/AliMCAnalysisUtils.h | 3 - .../PartCorrBase/AliNeutralMesonSelection.cxx | 116 +- PWG4/PartCorrBase/AliNeutralMesonSelection.h | 211 +- PWG4/PartCorrDep/AliAnaCaloTrigger.cxx | 219 +- PWG4/PartCorrDep/AliAnaChargedParticles.cxx | 321 +++ PWG4/PartCorrDep/AliAnaChargedParticles.h | 81 + PWG4/PartCorrDep/AliAnaExample.cxx | 481 ++-- PWG4/PartCorrDep/AliAnaExample.h | 90 +- .../AliAnaParticleHadronCorrelation.cxx | 460 ++-- .../AliAnaParticleHadronCorrelation.h | 24 +- PWG4/PartCorrDep/AliAnaParticleIsolation.cxx | 1979 +++++++++-------- PWG4/PartCorrDep/AliAnaParticleIsolation.h | 359 ++- .../AliAnaParticleJetFinderCorrelation.cxx | 508 ++--- .../AliAnaParticleJetFinderCorrelation.h | 131 +- ...liAnaParticleJetLeadingConeCorrelation.cxx | 843 +++---- .../AliAnaParticleJetLeadingConeCorrelation.h | 7 +- .../AliAnaParticlePartonCorrelation.cxx | 59 +- PWG4/PartCorrDep/AliAnaPhoton.cxx | 765 +++---- PWG4/PartCorrDep/AliAnaPi0.cxx | 718 +++--- PWG4/PartCorrDep/AliAnaPi0EbE.cxx | 1206 +++++----- PWG4/PartCorrDep/AliAnaPi0EbE.h | 204 +- .../AliAnalysisTaskPHOSExample.cxx | 9 +- PWG4/libPWG4PartCorrDep.pkg | 5 +- 52 files changed, 6759 insertions(+), 6241 deletions(-) create mode 100755 PWG4/PartCorrDep/AliAnaChargedParticles.cxx create mode 100755 PWG4/PartCorrDep/AliAnaChargedParticles.h diff --git a/PWG4/CMake_libPWG4PartCorrDep.txt b/PWG4/CMake_libPWG4PartCorrDep.txt index a1210c1fac0..8f4bfe845fd 100755 --- a/PWG4/CMake_libPWG4PartCorrDep.txt +++ b/PWG4/CMake_libPWG4PartCorrDep.txt @@ -6,7 +6,7 @@ set(SRCS PartCorrDep/AliAnaPhoton.cxx PartCorrDep/AliAnaPi0.cxx PartCorrDep/AliAnaPi0EbE.cxx PartCorrDep/AliAnaParticleIsolation.cxx PartCorrDep/AliAnaParticlePartonCorrelation.cxx PartCorrDep/AliAnaParticleHadronCorrelation.cxx PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx - PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx + PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx PartCorrDep/AliAnaChargedParticles.cxx ) diff --git a/PWG4/PWG4PartCorrDepLinkDef.h b/PWG4/PWG4PartCorrDepLinkDef.h index de652150388..2e4f72958d3 100755 --- a/PWG4/PWG4PartCorrDepLinkDef.h +++ b/PWG4/PWG4PartCorrDepLinkDef.h @@ -10,6 +10,7 @@ #pragma link C++ class AliAnaPhoton+; #pragma link C++ class AliAnaPi0+; #pragma link C++ class AliAnaPi0EbE+; +#pragma link C++ class AliAnaChargedParticles+; #pragma link C++ class AliAnaParticleIsolation+; #pragma link C++ class AliAnaParticlePartonCorrelation+; #pragma link C++ class AliAnaParticleHadronCorrelation+; diff --git a/PWG4/PartCorrBase/AliAODPWG4Particle.cxx b/PWG4/PartCorrBase/AliAODPWG4Particle.cxx index b42a1719584..92ed8cd40be 100755 --- a/PWG4/PartCorrBase/AliAODPWG4Particle.cxx +++ b/PWG4/PartCorrBase/AliAODPWG4Particle.cxx @@ -35,130 +35,130 @@ AliVParticle(), fMomentum(0),fPdg(-1), fTag(-1), fLabel(-1), fCaloLabel(), fTrackLabel(), fDetector(""), fDisp(0), fTof(0), fCharged(0), fBadDist(0) { - // constructor - fCaloLabel [0] = -1; - fCaloLabel [1] = -1; - fTrackLabel[0] = -1; - fTrackLabel[1] = -1; + // constructor + fCaloLabel [0] = -1; + fCaloLabel [1] = -1; + fTrackLabel[0] = -1; + fTrackLabel[1] = -1; } //______________________________________________________________________________ AliAODPWG4Particle::AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e): -AliVParticle(), -fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(), -fDetector(""), fDisp(0),fTof(0),fCharged(0), fBadDist(0) + AliVParticle(), + fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(), + fDetector(""), fDisp(0),fTof(0),fCharged(0), fBadDist(0) { - // constructor - fMomentum = new TLorentzVector(px, py, pz, e); - - fCaloLabel [0] = -1; - fCaloLabel [1] = -1; - fTrackLabel[0] = -1; - fTrackLabel[1] = -1; + // constructor + fMomentum = new TLorentzVector(px, py, pz, e); + + fCaloLabel [0] = -1; + fCaloLabel [1] = -1; + fTrackLabel[0] = -1; + fTrackLabel[1] = -1; } //______________________________________________________________________________ AliAODPWG4Particle::AliAODPWG4Particle(TLorentzVector & p): -AliVParticle(), -fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(), -fDetector(""), fDisp(0),fTof(0),fCharged(0),fBadDist(0) + AliVParticle(), + fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fCaloLabel(), fTrackLabel(), + fDetector(""), fDisp(0),fTof(0),fCharged(0),fBadDist(0) { - // constructor - fMomentum = new TLorentzVector(p); - - fCaloLabel [0] = -1; - fCaloLabel [1] = -1; - fTrackLabel[0] = -1; - fTrackLabel[1] = -1; + // constructor + fMomentum = new TLorentzVector(p); + + fCaloLabel [0] = -1; + fCaloLabel [1] = -1; + fTrackLabel[0] = -1; + fTrackLabel[1] = -1; } //______________________________________________________________________________ AliAODPWG4Particle::~AliAODPWG4Particle() { - // destructor + // destructor delete fMomentum; } //______________________________________________________________________________ AliAODPWG4Particle::AliAODPWG4Particle(const AliAODPWG4Particle& part) : -AliVParticle(part), -fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel), fCaloLabel(), fTrackLabel(), -fDetector(part.fDetector),fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged), fBadDist(part.fBadDist) - + AliVParticle(part), + fMomentum(0), fPdg(part.fPdg), fTag(part.fTag), fLabel(part.fLabel), fCaloLabel(), fTrackLabel(), + fDetector(part.fDetector),fDisp(part.fDisp), fTof(part.fTof), fCharged(part.fCharged), fBadDist(part.fBadDist) + { - // Copy constructor - fMomentum = new TLorentzVector(*part.fMomentum); - - fCaloLabel [0] = part.fCaloLabel[0]; - fCaloLabel [1] = part.fCaloLabel[1]; - fTrackLabel[0] = part.fTrackLabel[0]; - fTrackLabel[1] = part.fTrackLabel[1]; + // Copy constructor + fMomentum = new TLorentzVector(*part.fMomentum); + + fCaloLabel [0] = part.fCaloLabel[0]; + fCaloLabel [1] = part.fCaloLabel[1]; + fTrackLabel[0] = part.fTrackLabel[0]; + fTrackLabel[1] = part.fTrackLabel[1]; } //______________________________________________________________________________ AliAODPWG4Particle& AliAODPWG4Particle::operator=(const AliAODPWG4Particle& part) { - // Assignment operator - if(this!=&part) { - - fPdg = part.fPdg; - fTag = part.fTag; - fLabel = part.fLabel; - fCaloLabel [0] = part.fCaloLabel[0]; - fCaloLabel [1] = part.fCaloLabel[1]; - fTrackLabel[0] = part.fTrackLabel[0]; - fTrackLabel[1] = part.fTrackLabel[1]; - fDetector =part.fDetector; - - fDisp = part.fDisp; - fTof = part.fTof; - fCharged = part.fCharged; - fBadDist=part.fBadDist; - - if (fMomentum ) delete fMomentum; - fMomentum = new TLorentzVector(*part.fMomentum); - } - - return *this; + // Assignment operator + if(this!=&part) { + + fPdg = part.fPdg; + fTag = part.fTag; + fLabel = part.fLabel; + fCaloLabel [0] = part.fCaloLabel[0]; + fCaloLabel [1] = part.fCaloLabel[1]; + fTrackLabel[0] = part.fTrackLabel[0]; + fTrackLabel[1] = part.fTrackLabel[1]; + fDetector =part.fDetector; + + fDisp = part.fDisp; + fTof = part.fTof; + fCharged = part.fCharged; + fBadDist=part.fBadDist; + + if (fMomentum ) delete fMomentum; + fMomentum = new TLorentzVector(*part.fMomentum); + } + + return *this; } //_______________________________________________________________ Bool_t AliAODPWG4Particle::IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const{ - // returns true if particle satisfies given PID criterium + // returns true if particle satisfies given PID criterium switch(ipid){ - case 0: return kTRUE ; //No PID at all - case 1: - { - if (fPdg == pdgwanted) return kTRUE; - else return kFALSE; //Overall PID calculated with bayesian methods. - } - case 2: return fDisp ; //only dispersion cut - case 3: return fTof ; //Only TOF cut - case 4: return fCharged ; //Only Charged cut - case 5: return fDisp && fTof ; //Dispersion and TOF - case 6: return fDisp && fCharged ; //Dispersion and Charged - case 7: return fTof && fCharged ; //TOF and Charged - case 8: return fDisp && fTof && fCharged ; // all 3 cuts - default: return kFALSE ; //Not known combination + case 0: return kTRUE ; //No PID at all + case 1: + { + if (fPdg == pdgwanted) return kTRUE; + else return kFALSE; //Overall PID calculated with bayesian methods. + } + case 2: return fDisp ; //only dispersion cut + case 3: return fTof ; //Only TOF cut + case 4: return fCharged ; //Only Charged cut + case 5: return fDisp && fTof ; //Dispersion and TOF + case 6: return fDisp && fCharged ; //Dispersion and Charged + case 7: return fTof && fCharged ; //TOF and Charged + case 8: return fDisp && fTof && fCharged ; // all 3 cuts + default: return kFALSE ; //Not known combination } } //______________________________________________________________________________ void AliAODPWG4Particle::Print(Option_t* /*option*/) const { - // Print information of all data members - printf("Particle 4-vector:\n"); - printf(" E = %13.3f\n", E() ); - printf(" Px = %13.3f\n", Px()); - printf(" Py = %13.3f\n", Py()); - printf(" Pz = %13.3f\n", Pz()); - printf("TOF bit : %d\n",fTof); - printf("Charged bit : %d\n",fCharged); - printf("Dispersion bit : %d\n",fDisp); - printf("pdg : %d\n",fPdg); - printf("tag : %d\n",fTag); - printf("Trigger Detector : %s\n",fDetector.Data()); - + // Print information of all data members + printf("Particle 4-vector:\n"); + printf(" E = %13.3f\n", E() ); + printf(" Px = %13.3f\n", Px()); + printf(" Py = %13.3f\n", Py()); + printf(" Pz = %13.3f\n", Pz()); + printf("TOF bit : %d\n",fTof); + printf("Charged bit : %d\n",fCharged); + printf("Dispersion bit : %d\n",fDisp); + printf("pdg : %d\n",fPdg); + printf("tag : %d\n",fTag); + printf("Trigger Detector : %s\n",fDetector.Data()); + } diff --git a/PWG4/PartCorrBase/AliAODPWG4Particle.h b/PWG4/PartCorrBase/AliAODPWG4Particle.h index 40547b81e06..e787de4edb1 100755 --- a/PWG4/PartCorrBase/AliAODPWG4Particle.h +++ b/PWG4/PartCorrBase/AliAODPWG4Particle.h @@ -19,85 +19,85 @@ class TString; #include "AliVParticle.h" class AliAODPWG4Particle : public AliVParticle { - + public: - AliAODPWG4Particle(); - AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e); - AliAODPWG4Particle(TLorentzVector & p); - virtual ~AliAODPWG4Particle(); - AliAODPWG4Particle(const AliAODPWG4Particle& photon); - AliAODPWG4Particle& operator=(const AliAODPWG4Particle& photon); - - // AliVParticle methods - virtual Double_t Px() const { return fMomentum->Px(); } - virtual Double_t Py() const { return fMomentum->Py(); } - virtual Double_t Pz() const { return fMomentum->Pz(); } - virtual Double_t Pt() const { return fMomentum->Pt(); } - virtual Double_t P() const { return fMomentum->P(); } - virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } - virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); } - virtual Double_t Phi() const; - virtual Double_t Theta() const { return fMomentum->Theta(); } - virtual Double_t E() const { return fMomentum->E(); } - virtual Double_t M() const { return fMomentum->M(); } - virtual Double_t Eta() const { return fMomentum->Eta(); } - virtual Double_t Y() const { return fMomentum->Rapidity();} - virtual Double_t Xv() const {return -999.;} // put reasonable values here - virtual Double_t Yv() const {return -999.;} // - virtual Double_t Zv() const {return -999.;} // - virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } - virtual void Print(Option_t* /*option*/) const; - - // - //Dummy - virtual Short_t Charge() const { return 0;} - virtual const Double_t* PID() const { return NULL;} - // - - virtual Int_t GetPdg() const {return fPdg ; } - virtual Int_t GetTag() const {return fTag ; } - virtual Int_t GetLabel() const {return fLabel ; } - virtual Int_t GetCaloLabel (Int_t i) const {return fCaloLabel[i];} - virtual Int_t GetTrackLabel(Int_t i) const {return fTrackLabel[i];} - virtual TString GetDetector() const {return fDetector ; } - - virtual Bool_t GetDispBit(void) const {return fDisp;} - virtual Bool_t GetTOFBit(void) const {return fTof;} - virtual Bool_t GetChargedBit(void) const {return fCharged;} - virtual Int_t DistToBad() const {return fBadDist ;} - - virtual void SetPdg(Int_t pdg) {fPdg = pdg ; } - virtual void SetTag(Int_t tag) {fTag = tag ; } - virtual void SetLabel(Int_t l) {fLabel = l ; } - virtual void SetCaloLabel (Int_t a, Int_t b) {fCaloLabel [0] = a; fCaloLabel [1] = b ; } - virtual void SetTrackLabel(Int_t a, Int_t b) {fTrackLabel[0] = a; fTrackLabel[1] = b ; } - virtual void SetDetector(TString d) {fDetector = d ; } + AliAODPWG4Particle(); + AliAODPWG4Particle(Double_t px, Double_t py, Double_t pz, Double_t e); + AliAODPWG4Particle(TLorentzVector & p); + virtual ~AliAODPWG4Particle(); + AliAODPWG4Particle(const AliAODPWG4Particle& photon); + AliAODPWG4Particle& operator=(const AliAODPWG4Particle& photon); + + // AliVParticle methods + virtual Double_t Px() const { return fMomentum->Px(); } + virtual Double_t Py() const { return fMomentum->Py(); } + virtual Double_t Pz() const { return fMomentum->Pz(); } + virtual Double_t Pt() const { return fMomentum->Pt(); } + virtual Double_t P() const { return fMomentum->P(); } + virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; } + virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); } + virtual Double_t Phi() const; + virtual Double_t Theta() const { return fMomentum->Theta(); } + virtual Double_t E() const { return fMomentum->E(); } + virtual Double_t M() const { return fMomentum->M(); } + virtual Double_t Eta() const { return fMomentum->Eta(); } + virtual Double_t Y() const { return fMomentum->Rapidity();} + virtual Double_t Xv() const {return -999.;} // put reasonable values here + virtual Double_t Yv() const {return -999.;} // + virtual Double_t Zv() const {return -999.;} // + virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; } + virtual void Print(Option_t* /*option*/) const; + + // + //Dummy + virtual Short_t Charge() const { return 0;} + virtual const Double_t* PID() const { return NULL;} + // + + virtual Int_t GetPdg() const {return fPdg ; } + virtual Int_t GetTag() const {return fTag ; } + virtual Int_t GetLabel() const {return fLabel ; } + virtual Int_t GetCaloLabel (Int_t i) const {return fCaloLabel[i];} + virtual Int_t GetTrackLabel(Int_t i) const {return fTrackLabel[i];} + virtual TString GetDetector() const {return fDetector ; } - virtual void SetDispBit(Bool_t chi2){fDisp = chi2 ;} - virtual void SetTOFBit(Bool_t tof){fTof = tof ;} - virtual void SetChargedBit(Bool_t ch){fCharged = ch; } - virtual void SetDistToBad(Int_t dist){fBadDist=dist;} + virtual Bool_t GetDispBit(void) const {return fDisp;} + virtual Bool_t GetTOFBit(void) const {return fTof;} + virtual Bool_t GetChargedBit(void) const {return fCharged;} + virtual Int_t DistToBad() const {return fBadDist ;} + + virtual void SetPdg(Int_t pdg) {fPdg = pdg ; } + virtual void SetTag(Int_t tag) {fTag = tag ; } + virtual void SetLabel(Int_t l) {fLabel = l ; } + virtual void SetCaloLabel (Int_t a, Int_t b) {fCaloLabel [0] = a; fCaloLabel [1] = b ; } + virtual void SetTrackLabel(Int_t a, Int_t b) {fTrackLabel[0] = a; fTrackLabel[1] = b ; } + virtual void SetDetector(TString d) {fDetector = d ; } - TLorentzVector * Momentum() const {return fMomentum ; } - virtual void SetMomentum(TLorentzVector *lv) {fMomentum = lv ; } + virtual void SetDispBit(Bool_t chi2){fDisp = chi2 ;} + virtual void SetTOFBit(Bool_t tof){fTof = tof ;} + virtual void SetChargedBit(Bool_t ch){fCharged = ch; } + virtual void SetDistToBad(Int_t dist){fBadDist=dist;} - Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const; + TLorentzVector * Momentum() const {return fMomentum ; } + virtual void SetMomentum(TLorentzVector *lv) {fMomentum = lv ; } + + Bool_t IsPIDOK(const Int_t ipid, const Int_t pdgwanted) const; private: - TLorentzVector* fMomentum; // Photon 4-momentum vector - Int_t fPdg; // id of particle - Int_t fTag; // tag of particle (decay, fragment, prompt photon) - Int_t fLabel; // MC label - Int_t fCaloLabel[2]; // CaloCluster index, 1 for photons, 2 for pi0. - Int_t fTrackLabel[2]; // Track lable, 1 for pions, 2 for conversion photons - TString fDetector; // Detector where particle was measured. - - Bool_t fDisp ; //Dispersion bit - Bool_t fTof ; //TOF bit - Bool_t fCharged ; //Charged bit - Int_t fBadDist ; //Distance to bad module in module units - - ClassDef(AliAODPWG4Particle,1); + TLorentzVector* fMomentum; // Photon 4-momentum vector + Int_t fPdg; // id of particle + Int_t fTag; // tag of particle (decay, fragment, prompt photon) + Int_t fLabel; // MC label + Int_t fCaloLabel[2]; // CaloCluster index, 1 for photons, 2 for pi0. + Int_t fTrackLabel[2]; // Track lable, 1 for pions, 2 for conversion photons + TString fDetector; // Detector where particle was measured. + + Bool_t fDisp ; //Dispersion bit + Bool_t fTof ; //TOF bit + Bool_t fCharged ; //Charged bit + Int_t fBadDist ; //Distance to bad module in module units + + ClassDef(AliAODPWG4Particle,1); }; inline Double_t AliAODPWG4Particle::Phi() const diff --git a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.cxx b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.cxx index 60f06750c2f..421266a6a41 100755 --- a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.cxx +++ b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.cxx @@ -25,79 +25,78 @@ //-- Analysis system #include "AliAODPWG4ParticleCorrelation.h" -#include "AliAODJet.h" ClassImp(AliAODPWG4ParticleCorrelation) //______________________________________________________________________________ -AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation() : - AliAODPWG4Particle(), fIsolated(kFALSE), - fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), - fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), - fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), - fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0) + AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation() : + AliAODPWG4Particle(), fIsolated(kFALSE), + fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), + fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), + fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), + fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0) { // constructor } //______________________________________________________________________________ AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e): - AliAODPWG4Particle(), fIsolated(kFALSE), - fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), - fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), - fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), - fLeadingDetector(""), fLeading(), fCorrJet(), - fCorrBkg(), fRefJet(0) + AliAODPWG4Particle(), fIsolated(kFALSE), + fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), + fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), + fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), + fLeadingDetector(""), fLeading(), fCorrJet(), + fCorrBkg(), fRefJet(0) { // constructor - SetMomentum(new TLorentzVector(px, py, pz, e)); + SetMomentum(new TLorentzVector(px, py, pz, e)); } //______________________________________________________________________________ AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(TLorentzVector & p): - AliAODPWG4Particle(p), fIsolated(kFALSE), - fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), - fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), - fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), - fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0) + AliAODPWG4Particle(p), fIsolated(kFALSE), + fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), + fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), + fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), + fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0) { // constructor } //______________________________________________________________________________ AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p): - AliAODPWG4Particle(p), fIsolated(kFALSE), - fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), - fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), - fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), - fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0) + AliAODPWG4Particle(p), fIsolated(kFALSE), + fRefTracks(new TRefArray()), fRefClusters(new TRefArray()), + fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()), + fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()), + fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0) { // constructor - + } //______________________________________________________________________________ AliAODPWG4ParticleCorrelation::~AliAODPWG4ParticleCorrelation() { // destructor - delete fRefTracks; - delete fRefClusters; - delete fRefIsolationConeTracks; - delete fRefIsolationConeClusters; - delete fRefBackgroundTracks; - delete fRefBackgroundClusters; - + delete fRefTracks; + delete fRefClusters; + delete fRefIsolationConeTracks; + delete fRefIsolationConeClusters; + delete fRefBackgroundTracks; + delete fRefBackgroundClusters; + } //______________________________________________________________________________ AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& part) : - AliAODPWG4Particle(part), fIsolated(part.fIsolated), - fRefTracks(), fRefClusters(), - fRefIsolationConeTracks(), fRefIsolationConeClusters(), - fRefBackgroundTracks(), fRefBackgroundClusters(), - fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading), - fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet) + AliAODPWG4Particle(part), fIsolated(part.fIsolated), + fRefTracks(), fRefClusters(), + fRefIsolationConeTracks(), fRefIsolationConeClusters(), + fRefBackgroundTracks(), fRefBackgroundClusters(), + fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading), + fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet) { // Copy constructor fRefTracks = new TRefArray(*part.fRefTracks); @@ -114,27 +113,27 @@ AliAODPWG4ParticleCorrelation& AliAODPWG4ParticleCorrelation::operator=(const Al // Assignment operator if(this!=&part) { - fIsolated = part.fIsolated; - fRefJet = part.fRefJet ; - fLeadingDetector =part.fLeadingDetector; - fLeading = part.fLeading; - fCorrJet = part.fCorrJet ; - fCorrBkg = part.fCorrBkg; - - if( fRefTracks ) delete fRefTracks ; - if( fRefClusters) delete fRefClusters ; - if( fRefIsolationConeTracks ) delete fRefIsolationConeTracks ; - if( fRefIsolationConeClusters) delete fRefIsolationConeClusters ; - if( fRefBackgroundTracks ) delete fRefBackgroundTracks ; - if( fRefBackgroundClusters ) delete fRefBackgroundClusters ; - - fRefTracks = new TRefArray(*part.fRefTracks); - fRefClusters = new TRefArray(*part.fRefClusters); - fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks); - fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters); - fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks); - fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters); - + fIsolated = part.fIsolated; + fRefJet = part.fRefJet ; + fLeadingDetector =part.fLeadingDetector; + fLeading = part.fLeading; + fCorrJet = part.fCorrJet ; + fCorrBkg = part.fCorrBkg; + + if( fRefTracks ) delete fRefTracks ; + if( fRefClusters) delete fRefClusters ; + if( fRefIsolationConeTracks ) delete fRefIsolationConeTracks ; + if( fRefIsolationConeClusters) delete fRefIsolationConeClusters ; + if( fRefBackgroundTracks ) delete fRefBackgroundTracks ; + if( fRefBackgroundClusters ) delete fRefBackgroundClusters ; + + fRefTracks = new TRefArray(*part.fRefTracks); + fRefClusters = new TRefArray(*part.fRefClusters); + fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks); + fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters); + fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks); + fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters); + } return *this; diff --git a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h index ed9eae4fae3..6a6c28b2745 100755 --- a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h +++ b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h @@ -14,88 +14,88 @@ //-- ROOT system -- //-- Analysis system -#include "AliAODJet.h" +#include "AliAODJet.h" #include "AliAODPWG4Particle.h" class AliAODPWG4ParticleCorrelation : public AliAODPWG4Particle { public: - AliAODPWG4ParticleCorrelation(); - AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e); - AliAODPWG4ParticleCorrelation(TLorentzVector & p); - AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p); - - virtual ~AliAODPWG4ParticleCorrelation(); - AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& photon); - AliAODPWG4ParticleCorrelation& operator=(const AliAODPWG4ParticleCorrelation& photon); - - virtual Bool_t IsIsolated() const { return fIsolated ;} - virtual void SetIsolated(Bool_t iso) {fIsolated = iso ;} - - virtual TRefArray* GetRefTracks() const { return fRefTracks;} - virtual void AddTrack(TObject *tr) {fRefTracks->Add(tr);} - virtual TObject* GetTrack(Int_t i) const { return fRefTracks->At(i);} - - virtual TRefArray* GetRefClusters() const { return fRefClusters;} - virtual void AddCluster(TObject *tr) {fRefClusters->Add(tr);} - virtual TObject* GetCluster(Int_t i) const { return fRefClusters->At(i);} - - virtual TRefArray* GetRefIsolationConeTracks() const { return fRefIsolationConeTracks;} - virtual void AddIsolationConeTrack(TObject *tr) {fRefIsolationConeTracks->Add(tr);} - virtual TObject* GetIsolationConeTrack(Int_t i) const { return fRefIsolationConeTracks->At(i);} - - virtual TRefArray* GetRefIsolationConeClusters() const { return fRefIsolationConeClusters;} - virtual void AddIsolationConeCluster(TObject *tr) {fRefIsolationConeClusters->Add(tr);} - virtual TObject* GetIsolationConeCluster(Int_t i) const { return fRefIsolationConeClusters->At(i);} - - virtual TRefArray* GetRefBackgroundTracks() const { return fRefBackgroundTracks;} - virtual void AddBackgroundTrack(TObject *tr) {fRefBackgroundTracks->Add(tr);} - virtual TObject* GetBackgroundTrack(Int_t i) const { return fRefBackgroundTracks->At(i);} - - virtual TRefArray* GetRefBackgroundClusters() const { return fRefBackgroundClusters;} - virtual void AddBackgroundCluster(TObject *tr) {fRefBackgroundClusters->Add(tr);} - virtual TObject* GetBackgroundCluster(Int_t i) const { return fRefBackgroundClusters->At(i);} - - virtual TString GetLeadingDetector() const {return fLeadingDetector ; } - virtual void SetLeadingDetector(TString d) {fLeadingDetector = d ; } - - virtual TLorentzVector GetLeading() const { return fLeading;} - virtual void SetLeading(TLorentzVector lead) {fLeading = lead;} - - virtual TLorentzVector GetCorrelatedJet() const { return fCorrJet;} - virtual void SetCorrelatedJet(TLorentzVector jet) {fCorrJet = jet;} - - virtual TLorentzVector GetCorrelatedBackground() const { return fCorrBkg;} - virtual void SetCorrelatedBackground(TLorentzVector bkg) {fCorrBkg = bkg;} - - virtual void SetRefJet(AliAODJet* jet) { fRefJet = jet;} - virtual AliAODJet* GetJet() const {return ((AliAODJet*) fRefJet.GetObject());} - virtual TRef GetRefJet() const {return fRefJet;} - - virtual void Print(Option_t* /*option*/) const; - + AliAODPWG4ParticleCorrelation(); + AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e); + AliAODPWG4ParticleCorrelation(TLorentzVector & p); + AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p); + + virtual ~AliAODPWG4ParticleCorrelation(); + AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& photon); + AliAODPWG4ParticleCorrelation& operator=(const AliAODPWG4ParticleCorrelation& photon); + + virtual Bool_t IsIsolated() const { return fIsolated ;} + virtual void SetIsolated(Bool_t iso) {fIsolated = iso ;} + + virtual TRefArray* GetRefTracks() const { return fRefTracks;} + virtual void AddTrack(TObject *tr) {fRefTracks->Add(tr);} + virtual TObject* GetTrack(Int_t i) const { return fRefTracks->At(i);} + + virtual TRefArray* GetRefClusters() const { return fRefClusters;} + virtual void AddCluster(TObject *tr) {fRefClusters->Add(tr);} + virtual TObject* GetCluster(Int_t i) const { return fRefClusters->At(i);} + + virtual TRefArray* GetRefIsolationConeTracks() const { return fRefIsolationConeTracks;} + virtual void AddIsolationConeTrack(TObject *tr) {fRefIsolationConeTracks->Add(tr);} + virtual TObject* GetIsolationConeTrack(Int_t i) const { return fRefIsolationConeTracks->At(i);} + + virtual TRefArray* GetRefIsolationConeClusters() const { return fRefIsolationConeClusters;} + virtual void AddIsolationConeCluster(TObject *tr) {fRefIsolationConeClusters->Add(tr);} + virtual TObject* GetIsolationConeCluster(Int_t i) const { return fRefIsolationConeClusters->At(i);} + + virtual TRefArray* GetRefBackgroundTracks() const { return fRefBackgroundTracks;} + virtual void AddBackgroundTrack(TObject *tr) {fRefBackgroundTracks->Add(tr);} + virtual TObject* GetBackgroundTrack(Int_t i) const { return fRefBackgroundTracks->At(i);} + + virtual TRefArray* GetRefBackgroundClusters() const { return fRefBackgroundClusters;} + virtual void AddBackgroundCluster(TObject *tr) {fRefBackgroundClusters->Add(tr);} + virtual TObject* GetBackgroundCluster(Int_t i) const { return fRefBackgroundClusters->At(i);} + + virtual TString GetLeadingDetector() const {return fLeadingDetector ; } + virtual void SetLeadingDetector(TString d) {fLeadingDetector = d ; } + + virtual TLorentzVector GetLeading() const { return fLeading;} + virtual void SetLeading(TLorentzVector lead) {fLeading = lead;} + + virtual TLorentzVector GetCorrelatedJet() const { return fCorrJet;} + virtual void SetCorrelatedJet(TLorentzVector jet) {fCorrJet = jet;} + + virtual TLorentzVector GetCorrelatedBackground() const { return fCorrBkg;} + virtual void SetCorrelatedBackground(TLorentzVector bkg) {fCorrBkg = bkg;} + + virtual void SetRefJet(AliAODJet* jet) { fRefJet = jet;} + virtual AliAODJet* GetJet() const {return ((AliAODJet*) fRefJet.GetObject());} + virtual TRef GetRefJet() const {return fRefJet;} + + virtual void Print(Option_t* /*option*/) const; + private: - - Bool_t fIsolated ; //Particle is isolated or not - - TRefArray* fRefTracks; // array of references to the tracks belonging to the jet / all selected hadrons - TRefArray* fRefClusters; // array of references to the clusters belonging to the jet / all selected hadrons - - TRefArray* fRefIsolationConeTracks; // array of references to the tracks belonging to the cone around direct particle candidate - TRefArray* fRefIsolationConeClusters; // array of references to the clusters belonging to the cone around direct particle candidate - - TRefArray* fRefBackgroundTracks; // array of references to the tracks for background stimation - TRefArray* fRefBackgroundClusters; // array of references to the clusters for background stimation - - TString fLeadingDetector; // Detector where leading particle was measured. - TLorentzVector fLeading; // Leading Particle 4-momentum vector - - TLorentzVector fCorrJet; // Jet 4-momentum vector - TLorentzVector fCorrBkg; // Background 4-momentum vector - - TRef fRefJet; // Rerence to jet found with JETAN and correlated with particle - - ClassDef(AliAODPWG4ParticleCorrelation,1); + + Bool_t fIsolated ; //Particle is isolated or not + + TRefArray* fRefTracks; // array of references to the tracks belonging to the jet / all selected hadrons + TRefArray* fRefClusters; // array of references to the clusters belonging to the jet / all selected hadrons + + TRefArray* fRefIsolationConeTracks; // array of references to the tracks belonging to the cone around direct particle candidate + TRefArray* fRefIsolationConeClusters; // array of references to the clusters belonging to the cone around direct particle candidate + + TRefArray* fRefBackgroundTracks; // array of references to the tracks for background stimation + TRefArray* fRefBackgroundClusters; // array of references to the clusters for background stimation + + TString fLeadingDetector; // Detector where leading particle was measured. + TLorentzVector fLeading; // Leading Particle 4-momentum vector + + TLorentzVector fCorrJet; // Jet 4-momentum vector + TLorentzVector fCorrBkg; // Background 4-momentum vector + + TRef fRefJet; // Rerence to jet found with JETAN and correlated with particle + + ClassDef(AliAODPWG4ParticleCorrelation,1); }; diff --git a/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx b/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx index bee184fed3a..42de8872297 100755 --- a/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx +++ b/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx @@ -22,12 +22,10 @@ // --- ROOT system --- #include +//#include //---- AliRoot system ---- -#include "AliAODPWG4Particle.h" -#include "AliAODCaloCluster.h" -#include "AliAODCaloCells.h" -#include "AliAODTrack.h" +#include "AliAODPWG4ParticleCorrelation.h" #include "AliAnaPartCorrBaseClass.h" #include "AliCaloTrackReader.h" #include "AliCaloPID.h" @@ -35,8 +33,8 @@ #include "AliIsolationCut.h" #include "AliMCAnalysisUtils.h" #include "AliNeutralMesonSelection.h" -#include "AliLog.h" -#include "AliAODPWG4ParticleCorrelation.h" +#include "AliAODCaloCells.h" +#include "AliAODEvent.h" ClassImp(AliAnaPartCorrBaseClass) @@ -48,7 +46,7 @@ ClassImp(AliAnaPartCorrBaseClass) fReader(0x0), fInputAODBranch(0x0), fInputAODName(""), fOutputAODBranch(0x0), fNewAOD(kFALSE), fOutputAODName(""), fOutputAODClassName(""), - fAODCaloClusters(0x0), fAODCaloCells(0x0), + fAODCaloCells(0x0),//fAODCaloClusters(0x0), fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fMCUtils(0x0), fNMS(0x0), fHistoNPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.), fHistoNPhiBins(0), fHistoPhiMax(0.), fHistoPhiMin(0.), @@ -75,7 +73,7 @@ AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & fInputAODBranch(new TClonesArray(*abc.fInputAODBranch)), fInputAODName(abc.fInputAODName), fOutputAODBranch(new TClonesArray(*abc.fOutputAODBranch)),fNewAOD(abc.fNewAOD), fOutputAODName(abc.fOutputAODName), fOutputAODClassName(abc.fOutputAODClassName), - fAODCaloClusters(new TClonesArray(*abc.fAODCaloClusters)), + //fAODCaloClusters(new TClonesArray(*abc.fAODCaloClusters)), fAODCaloCells(new AliAODCaloCells(*abc.fAODCaloCells)), fCaloPID(abc.fCaloPID), fFidCut(abc.fFidCut), fIC(abc.fIC),fMCUtils(abc.fMCUtils), fNMS(abc.fNMS), fHistoNPtBins(abc.fHistoNPtBins), fHistoPtMax(abc.fHistoPtMax), fHistoPtMin(abc.fHistoPtMin), @@ -89,42 +87,42 @@ AliAnaPartCorrBaseClass::AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & //_________________________________________________________________________ AliAnaPartCorrBaseClass & AliAnaPartCorrBaseClass::operator = (const AliAnaPartCorrBaseClass & abc) { - // assignment operator - - if(this == &abc) return *this; - ((TObject *)this)->operator=(abc); - - fDataMC = abc.fDataMC; - fDebug = abc.fDebug ; - fRecalculateCaloPID = abc.fRecalculateCaloPID ; - fCheckCaloPID = abc.fCheckCaloPID ; - fCheckFidCut = abc.fCheckFidCut ; - - fReader = abc.fReader ; - fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ; - fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ; - - fMinPt = abc.fMinPt; - fMaxPt = abc.fMaxPt; - fCaloPID = abc.fCaloPID; - fFidCut = abc.fFidCut; - fIC = abc.fIC; - fMCUtils = abc.fMCUtils; - fNMS = abc.fNMS; - - fInputAODBranch = new TClonesArray(*abc.fInputAODBranch) ; - fInputAODName = abc.fInputAODName; - fOutputAODBranch = new TClonesArray(*abc.fOutputAODBranch) ; - fNewAOD = abc.fNewAOD ; - fOutputAODName = abc.fOutputAODName; - fOutputAODClassName = abc.fOutputAODClassName; - - fHistoNPtBins = abc.fHistoNPtBins; fHistoPtMax = abc.fHistoPtMax; fHistoPtMin = abc.fHistoPtMin; - fHistoNPhiBins = abc.fHistoNPhiBins; fHistoPhiMax = abc.fHistoPhiMax; fHistoPhiMin = abc.fHistoPhiMin; - fHistoNEtaBins = abc.fHistoNEtaBins; fHistoEtaMax = abc.fHistoEtaMax; fHistoEtaMin = abc.fHistoEtaMin; - - return *this; + // assignment operator + + if(this == &abc) return *this; + ((TObject *)this)->operator=(abc); + + fDataMC = abc.fDataMC; + fDebug = abc.fDebug ; + fRecalculateCaloPID = abc.fRecalculateCaloPID ; + fCheckCaloPID = abc.fCheckCaloPID ; + fCheckFidCut = abc.fCheckFidCut ; + fReader = abc.fReader ; + //fAODCaloClusters = new TClonesArray(*abc.fAODCaloClusters) ; + fAODCaloCells = new AliAODCaloCells(*abc.fAODCaloCells) ; + + fMinPt = abc.fMinPt; + fMaxPt = abc.fMaxPt; + fCaloPID = abc.fCaloPID; + fFidCut = abc.fFidCut; + fIC = abc.fIC; + fMCUtils = abc.fMCUtils; + fNMS = abc.fNMS; + + fInputAODBranch = new TClonesArray(*abc.fInputAODBranch) ; + fInputAODName = abc.fInputAODName; + fOutputAODBranch = new TClonesArray(*abc.fOutputAODBranch) ; + fNewAOD = abc.fNewAOD ; + fOutputAODName = abc.fOutputAODName; + fOutputAODClassName = abc.fOutputAODClassName; + + fHistoNPtBins = abc.fHistoNPtBins; fHistoPtMax = abc.fHistoPtMax; fHistoPtMin = abc.fHistoPtMin; + fHistoNPhiBins = abc.fHistoNPhiBins; fHistoPhiMax = abc.fHistoPhiMax; fHistoPhiMin = abc.fHistoPhiMin; + fHistoNEtaBins = abc.fHistoNEtaBins; fHistoEtaMax = abc.fHistoEtaMax; fHistoEtaMin = abc.fHistoEtaMin; + + return *this; + } //____________________________________________________________________________ @@ -132,79 +130,84 @@ AliAnaPartCorrBaseClass::~AliAnaPartCorrBaseClass() { // Remove all pointers except analysis output pointers. - if(fOutputAODBranch){ - fOutputAODBranch->Clear() ; - delete fOutputAODBranch ; - } - - if(fInputAODBranch){ - fInputAODBranch->Clear() ; - delete fInputAODBranch ; - } - - if(fAODCaloClusters){ - fAODCaloClusters->Clear() ; - delete fAODCaloClusters ; - } - - if(fAODCaloCells){ - fAODCaloCells->Clear() ; - delete fAODCaloCells ; - } + if(fOutputAODBranch){ + fOutputAODBranch->Clear() ; + delete fOutputAODBranch ; + } + + if(fInputAODBranch){ + fInputAODBranch->Clear() ; + delete fInputAODBranch ; + } + +// if(fAODCaloClusters){ +// fAODCaloClusters->Clear() ; +// delete fAODCaloClusters ; +// } - if(fReader) delete fReader ; - if(fCaloPID) delete fCaloPID ; - if(fFidCut) delete fFidCut ; - if(fIC) delete fIC ; - if(fMCUtils) delete fMCUtils ; - if(fNMS) delete fNMS ; - + if(fAODCaloCells){ + fAODCaloCells->Clear() ; + delete fAODCaloCells ; + } + + if(fReader) delete fReader ; + if(fCaloPID) delete fCaloPID ; + if(fFidCut) delete fFidCut ; + if(fIC) delete fIC ; + if(fMCUtils) delete fMCUtils ; + if(fNMS) delete fNMS ; + } -//____________________________________________________________________________ -void AliAnaPartCorrBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) { - //Put AOD calo cluster in the CaloClusters array - - Int_t i = fAODCaloClusters->GetEntriesFast(); - new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo); - -} +////____________________________________________________________________________ +//void AliAnaPartCorrBaseClass::AddAODCaloCluster(AliAODCaloCluster calo) { +// //Put AOD calo cluster in the CaloClusters array +// +// Int_t i = fAODCaloClusters->GetEntriesFast(); +// new((*fAODCaloClusters)[i]) AliAODCaloCluster(calo); +// +//} //____________________________________________________________________________ void AliAnaPartCorrBaseClass::AddAODParticle(AliAODPWG4Particle pc) { //Put AOD calo cluster in the AODParticleCorrelation array - if(fOutputAODBranch){ - - Int_t i = fOutputAODBranch->GetEntriesFast(); - //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); - if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0) - new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); - else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0) - new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc); - else - AliFatal(Form(">>> Cannot add an object of type < %s >, to the AOD TClonesArray \n", - fOutputAODBranch->GetClass()->GetName())); - } - else AliFatal("AddAODParticle: No AOD branch available!!!"); - + if(fOutputAODBranch){ + + Int_t i = fOutputAODBranch->GetEntriesFast(); + //new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); + if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4Particle")==0) + new((*fOutputAODBranch)[i]) AliAODPWG4Particle(pc); + else if(strcmp(fOutputAODBranch->GetClass()->GetName(),"AliAODPWG4ParticleCorrelation")==0) + new((*fOutputAODBranch)[i]) AliAODPWG4ParticleCorrelation(pc); + else { + printf("AliAnaPartCorrBaseClass::AddAODParticle() - Cannot add an object of type < %s >, to the AOD TClonesArray \n", + fOutputAODBranch->GetClass()->GetName()); + abort(); + } + } + else { + printf(" AliAnaPartCorrBaseClass::AddAODParticle() - No AOD branch available!!!\n"); + abort(); + } + } //___________________________________________________ -void AliAnaPartCorrBaseClass::ConnectAODCaloClusters() { - //Recover the list of AODCaloClusters - - fAODCaloClusters = fReader->GetAOD()->GetCaloClusters(); - -} - +//void AliAnaPartCorrBaseClass::ConnectAODCaloClusters() { +// //Recover the list of AODCaloClusters +// +// fAODCaloClusters = fReader->GetOutputEvent()->GetCaloClusters(); +// +//} +// //___________________________________________________ void AliAnaPartCorrBaseClass::ConnectAODPHOSCells() { //Recover the list of PHOS AODCaloCells - fAODCaloCells = fReader->GetAOD()->GetPHOSCells(); + fAODCaloCells = fReader->GetOutputEvent()->GetPHOSCells(); } @@ -212,80 +215,95 @@ void AliAnaPartCorrBaseClass::ConnectAODPHOSCells() { void AliAnaPartCorrBaseClass::ConnectAODEMCALCells() { //Recover the list of EMCAL AODCaloCells - fAODCaloCells = fReader->GetAOD()->GetEMCALCells(); + fAODCaloCells = fReader->GetOutputEvent()->GetEMCALCells(); } //___________________________________________________ void AliAnaPartCorrBaseClass::ConnectInputOutputAODBranches() { - //Recover ouput and input AOD pointers for each event in the maker - fOutputAODBranch = (TClonesArray *) fReader->GetAOD()->FindListObject(fOutputAODName); - fInputAODBranch = (TClonesArray *) fReader->GetAOD()->FindListObject(fInputAODName); + //Recover ouput and input AOD pointers for each event in the maker + + fOutputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fOutputAODName); + fInputAODBranch = (TClonesArray *) fReader->GetOutputEvent()->FindListObject(fInputAODName); + } //__________________________________________________ -TClonesArray * AliAnaPartCorrBaseClass::GetAODCTS() const { - //Get list of tracks from reader +TRefArray * AliAnaPartCorrBaseClass::GetAODCTS() const { + //Get list of referenced tracks from reader return fReader->GetAODCTS(); } //__________________________________________________ -TClonesArray * AliAnaPartCorrBaseClass::GetAODPHOS() const { - //Get list of PHOS calo clusters from reader +TRefArray * AliAnaPartCorrBaseClass::GetAODPHOS() const { + //Get list of PHOS reference caloclusters from reader return fReader->GetAODPHOS(); } - //__________________________________________________ -TClonesArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const { - //Get list of emcal caloclusters from reader +TRefArray * AliAnaPartCorrBaseClass::GetAODEMCAL() const { + //Get list of emcal referenced caloclusters from reader return fReader->GetAODEMCAL(); } +//__________________________________________________ +TClonesArray * AliAnaPartCorrBaseClass::GetAODCaloClusters() const { + //Get list of all caloclusters in AOD output file + + return fReader->GetOutputEvent()->GetCaloClusters(); + +} + +//__________________________________________________ +TClonesArray * AliAnaPartCorrBaseClass::GetAODTracks() const { + //Get list of all tracks in AOD output file + + return fReader->GetOutputEvent()->GetTracks(); + +} + //__________________________________________________ TString AliAnaPartCorrBaseClass::GetBaseParametersList() { //Put data member values in string to keep in output container - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - sprintf(onePar,"--- AliAnaPartCorrBaseClass ---\n") ; - parList+=onePar ; - sprintf(onePar,"Minimal P_t: %2.2f ; Max\n", fMinPt) ; - parList+=onePar ; - sprintf(onePar,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ; - parList+=onePar ; - sprintf(onePar,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ; - parList+=onePar ; - sprintf(onePar,"fCheckFidCut=%d (Check Fidutial cut selection on/off) \n",fCheckFidCut) ; - parList+=onePar ; - sprintf(onePar,"fCheckCaloPIC =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ; - parList+=onePar ; - sprintf(onePar,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ; - parList+=onePar ; - + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + sprintf(onePar,"--- AliAnaPartCorrBaseClass ---\n") ; + parList+=onePar ; + sprintf(onePar,"Minimal P_t: %2.2f ; Max\n", fMinPt) ; + parList+=onePar ; + sprintf(onePar,"Minimal P_t: %2.2f ; Max\n", fMaxPt) ; + parList+=onePar ; + sprintf(onePar,"fDataMC =%d (Check MC information, on/off) \n",fDataMC) ; + parList+=onePar ; + sprintf(onePar,"fCheckFidCut=%d (Check Fidutial cut selection on/off) \n",fCheckFidCut) ; + parList+=onePar ; + sprintf(onePar,"fCheckCaloPIC =%d (Use Bayesian PID in calorimetes, on/off) \n",fCheckCaloPID) ; + parList+=onePar ; + sprintf(onePar,"fRecalculateCaloPID =%d (Calculate PID from shower/tof/tracking parameters, on/off) \n",fRecalculateCaloPID) ; + parList+=onePar ; + return parList; } //__________________________________________________ TClonesArray * AliAnaPartCorrBaseClass::GetCreateOutputAODBranch() { - //Create AOD branch filled in the analysis - - //if(fDebug > 0 ) - printf("Create AOD branch of %s objects and with name < %s >\n", - fOutputAODClassName.Data(),fOutputAODName.Data()) ; - - TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0); - aodBranch->SetName(fOutputAODName); - - return aodBranch ; - + //Create AOD branch filled in the analysis + + printf("Create AOD branch of %s objects and with name < %s >\n", + fOutputAODClassName.Data(),fOutputAODName.Data()) ; + + TClonesArray * aodBranch = new TClonesArray(fOutputAODClassName, 0); + aodBranch->SetName(fOutputAODName); + return aodBranch ; + } //__________________________________________________ @@ -374,25 +392,25 @@ void AliAnaPartCorrBaseClass::InitParameters() //__________________________________________________________________ void AliAnaPartCorrBaseClass::Print(const Option_t * opt) const { - //Print some relevant parameters set for the analysis - - if(! opt) - return; - printf("New AOD: = %d\n",fNewAOD); - printf("Input AOD name: = %s\n",fInputAODName.Data()); - printf("Output AOD name: = %s\n",fOutputAODName.Data()); - printf("Output AOD Class name: = %s\n",fOutputAODClassName.Data()); - printf("Min Photon pT = %2.2f\n", fMinPt) ; - printf("Max Photon pT = %3.2f\n", fMaxPt) ; - printf("Check PID = %d\n", fCheckCaloPID) ; - printf("Recalculate PID = %d\n", fRecalculateCaloPID) ; - printf("Check Fidutial cut = %d\n", fCheckFidCut) ; - printf("Check MC labels = %d\n", fDataMC); - printf("Debug Level = %d\n", fDebug); - printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoNPtBins); - printf("Histograms: %3.1f < phi < %3.1f, Nbin = %d\n", fHistoPhiMin, fHistoPhiMax, fHistoNPhiBins); - printf("Histograms: %3.1f < eta < %3.1f, Nbin = %d\n", fHistoEtaMin, fHistoEtaMax, fHistoNEtaBins); - - printf(" \n") ; - + //Print some relevant parameters set for the analysis + + if(! opt) + return; + printf("New AOD: = %d\n",fNewAOD); + printf("Input AOD name: = %s\n",fInputAODName.Data()); + printf("Output AOD name: = %s\n",fOutputAODName.Data()); + printf("Output AOD Class name: = %s\n",fOutputAODClassName.Data()); + printf("Min Photon pT = %2.2f\n", fMinPt) ; + printf("Max Photon pT = %3.2f\n", fMaxPt) ; + printf("Check PID = %d\n", fCheckCaloPID) ; + printf("Recalculate PID = %d\n", fRecalculateCaloPID) ; + printf("Check Fidutial cut = %d\n", fCheckFidCut) ; + printf("Check MC labels = %d\n", fDataMC); + printf("Debug Level = %d\n", fDebug); + printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoNPtBins); + printf("Histograms: %3.1f < phi < %3.1f, Nbin = %d\n", fHistoPhiMin, fHistoPhiMax, fHistoNPhiBins); + printf("Histograms: %3.1f < eta < %3.1f, Nbin = %d\n", fHistoEtaMin, fHistoEtaMax, fHistoNEtaBins); + + printf(" \n") ; + } diff --git a/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h b/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h index 3dbdb350f2b..7525745c22b 100755 --- a/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h +++ b/PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h @@ -10,6 +10,7 @@ //ROOT class TClonesArray ; +class TRefArray ; #include #include @@ -32,182 +33,184 @@ class AliAnaPartCorrBaseClass : public TObject { public: - AliAnaPartCorrBaseClass() ; // default ctor - AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor - AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment - virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor - - virtual void AddAODCaloCluster(AliAODCaloCluster calo) ; - virtual void AddAODParticle(AliAODPWG4Particle pc) ; - - virtual void ConnectAODCaloClusters(); - virtual void ConnectAODPHOSCells(); - virtual void ConnectAODEMCALCells(); - virtual void ConnectInputOutputAODBranches(); - - virtual TList * GetCreateOutputObjects() { return (new TList) ;} - - virtual void Init() {;} - virtual void InitParameters() ; - - virtual void Print(const Option_t * ) const ; - - virtual void MakeAnalysisFillAOD() {;} - - virtual void MakeAnalysisFillHistograms() {;} - - virtual Int_t GetDebug() const { return fDebug ; } - virtual void SetDebug(Int_t d) { fDebug = d ; } - - virtual Int_t GetEventNumber() const ; - - virtual AliCaloTrackReader * GetReader() const {return fReader ; } - virtual void SetReader(AliCaloTrackReader * reader) { fReader = reader ; } - - virtual void Terminate() {;} - - //analysis AOD branch - virtual TClonesArray * GetCreateOutputAODBranch() ; - virtual TString GetInputAODName() const {return fInputAODName ; } - virtual void SetInputAODName(TString name) { fInputAODName = name; } - virtual TString GetOutputAODName() const {return fOutputAODName ; } - virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; } - virtual Bool_t NewOutputAOD() const {return fNewAOD;} - virtual TString GetOutputAODClassName() const {return fOutputAODClassName;} - virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; } - - virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;} - virtual TClonesArray* GetOutputAODBranch() const {return fOutputAODBranch ;} - - virtual TClonesArray* GetAODCaloClusters() const {return fAODCaloClusters ;} - virtual AliAODCaloCells* GetAODCaloCells() const {return fAODCaloCells ;} - - virtual TClonesArray* GetAODCTS() const ; - virtual TClonesArray* GetAODEMCAL() const ; - virtual TClonesArray* GetAODPHOS() const ; - - virtual TString GetBaseParametersList(); - - virtual TNamed * GetEMCALCells() const ; - virtual TNamed * GetPHOSCells() const ; - - virtual AliStack * GetMCStack() const ; - virtual AliHeader* GetMCHeader() const ; - virtual AliGenEventHeader* GetMCGenEventHeader() const ; - - //Analysis helpers classes pointers setters and getters - virtual AliCaloPID * GetCaloPID() const {return fCaloPID ;} - virtual void SetCaloPID(AliCaloPID * pid) { fCaloPID = pid ;} - - virtual AliFidutialCut * GetFidutialCut() const {return fFidCut ;} - virtual void SetFidutialCut(AliFidutialCut * fc) { fFidCut = fc ;} - - virtual AliIsolationCut * GetIsolationCut() const {return fIC ;} - virtual void SetIsolationCut(AliIsolationCut * fc) { fIC = fc ;} - - virtual AliMCAnalysisUtils * GetMCAnalysisUtils() const {return fMCUtils ;} - virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * mcutils) { fMCUtils = mcutils ;} - - virtual AliNeutralMesonSelection * GetNeutralMesonSelection() const {return fNMS ;} - virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * nms) { fNMS = nms ;} - - virtual Bool_t IsDataMC() const {return fDataMC ; } - virtual void SwitchOnDataMC() {fDataMC = kTRUE ; } - virtual void SwitchOffDataMC() {fDataMC = kFALSE ; } - - virtual Bool_t IsFidutialCutOn() const {return fCheckFidCut ; } - virtual void SwitchOnFidutialCut() { fCheckFidCut = kTRUE;} - virtual void SwitchOffFidutialCut() { fCheckFidCut = kFALSE;} - - virtual Bool_t IsCaloPIDOn() const {return fCheckCaloPID ; } - virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE;} - virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;} - - virtual Bool_t IsCaloPIDRecalculationOn() const {return fRecalculateCaloPID ; } - virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;} - virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;} - - virtual Float_t GetMaxPt() const {return fMaxPt ; } - virtual Float_t GetMinPt() const {return fMinPt ; } - virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; } - virtual void SetMinPt(Float_t pt) {fMinPt = pt ; } - void SetPtCutRange(Double_t ptmin, Double_t ptmax) - { fMaxPt=ptmax; fMinPt=ptmin;} - - //Histogrammes setters and getters - virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNPtBins = n ; - fHistoPtMax = max ; - fHistoPtMin = min ; - } - - Int_t GetHistoNPtBins() const { return fHistoNPtBins ; } - Float_t GetHistoPtMin() const { return fHistoPtMin ; } - Float_t GetHistoPtMax() const { return fHistoPtMax ; } - - virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNPhiBins = n ; - fHistoPhiMax = max ; - fHistoPhiMin = min ; - } - - Int_t GetHistoNPhiBins() const { return fHistoNPhiBins ; } - Float_t GetHistoPhiMin() const { return fHistoPhiMin ; } - Float_t GetHistoPhiMax() const { return fHistoPhiMax ; } - - virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNEtaBins = n ; - fHistoEtaMax = max ; - fHistoEtaMin = min ; - } - - Int_t GetHistoNEtaBins() const { return fHistoNEtaBins ; } - Float_t GetHistoEtaMin() const { return fHistoEtaMin ; } - Float_t GetHistoEtaMax() const { return fHistoEtaMax ; } - - - private: - - Bool_t fDataMC ; //Flag to access MC data when using ESD or AOD - Int_t fDebug ; // Debug level - Bool_t fCheckFidCut ; // Do analysis for clusters in defined region - Bool_t fCheckCaloPID ; // Do analysis for calorimeters - Bool_t fRecalculateCaloPID ; //Recalculate PID or use PID weights in calorimeters - Float_t fMinPt ; //Maximum pt of (trigger) particles in the analysis - Float_t fMaxPt ; //Minimum pt of (trigger) particles in the analysis - - AliCaloTrackReader * fReader; //Acces to ESD/AOD/MC data - - TClonesArray* fInputAODBranch ; //! Selected input particles branch - TString fInputAODName ; // Name of input AOD branch; - TClonesArray* fOutputAODBranch ; //! Selected output particles branch - Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not. - TString fOutputAODName ; // Name of output AOD branch; - TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...) - - TClonesArray* fAODCaloClusters ; //! selected PHOS/EMCAL CaloClusters - AliAODCaloCells * fAODCaloCells ; //! selected PHOS/EMCAL CaloCells - - //Analysis helper classes access pointers - AliCaloPID * fCaloPID; // PID calculation - AliFidutialCut * fFidCut; // Acceptance cuts - AliIsolationCut * fIC; // Isolation cut - AliMCAnalysisUtils * fMCUtils; // MonteCarlo Analysis utils - AliNeutralMesonSelection * fNMS; // Neutral Meson Selection - - //Histograms binning and range - Int_t fHistoNPtBins ; //Number of bins in pt axis - Float_t fHistoPtMax ; //Maximum value of pt histogram range - Float_t fHistoPtMin ; //Minimum value of pt histogram range - Int_t fHistoNPhiBins ; //Number of bins in phi axis - Float_t fHistoPhiMax ; //Maximum value of phi histogram range - Float_t fHistoPhiMin ; //Minimum value of phi histogram range - Int_t fHistoNEtaBins ; //Number of bins in eta axis - Float_t fHistoEtaMax ; //Maximum value of eta histogram range - Float_t fHistoEtaMin ; //Minimum value of eta histogram range - - ClassDef(AliAnaPartCorrBaseClass,3) -} ; + AliAnaPartCorrBaseClass() ; // default ctor + AliAnaPartCorrBaseClass(const AliAnaPartCorrBaseClass & g) ; // cpy ctor + AliAnaPartCorrBaseClass & operator = (const AliAnaPartCorrBaseClass & g) ;//cpy assignment + virtual ~AliAnaPartCorrBaseClass() ; //virtual dtor + +// virtual void AddAODCaloCluster(AliAODCaloCluster calo) ; + virtual void AddAODParticle(AliAODPWG4Particle pc) ; +// +// virtual void ConnectAODCaloClusters(); + virtual void ConnectAODPHOSCells(); + virtual void ConnectAODEMCALCells(); + virtual void ConnectInputOutputAODBranches(); + + virtual TList * GetCreateOutputObjects() { return (new TList) ;} + + virtual void Init() {;} + virtual void InitParameters() ; + + virtual void Print(const Option_t * ) const ; + + virtual void MakeAnalysisFillAOD() {;} + + virtual void MakeAnalysisFillHistograms() {;} + + virtual Int_t GetDebug() const { return fDebug ; } + virtual void SetDebug(Int_t d) { fDebug = d ; } + + virtual Int_t GetEventNumber() const ; + + virtual AliCaloTrackReader * GetReader() const {return fReader ; } + virtual void SetReader(AliCaloTrackReader * reader) { fReader = reader ; } + + virtual void Terminate() {;} + + //analysis AOD branch + virtual TClonesArray * GetCreateOutputAODBranch() ; + virtual TString GetInputAODName() const {return fInputAODName ; } + virtual void SetInputAODName(TString name) { fInputAODName = name; } + virtual TString GetOutputAODName() const {return fOutputAODName ; } + virtual void SetOutputAODName(TString name) { fNewAOD = kTRUE ; fOutputAODName = name; } + virtual Bool_t NewOutputAOD() const {return fNewAOD;} + virtual TString GetOutputAODClassName() const {return fOutputAODClassName;} + virtual void SetOutputAODClassName(TString name) {fOutputAODClassName = name; } + + virtual TClonesArray* GetInputAODBranch() const {return fInputAODBranch ;} + virtual TClonesArray* GetOutputAODBranch() const {return fOutputAODBranch ;} + +// virtual TClonesArray* GetAODCaloClusters() const {return fAODCaloClusters ;} + virtual TClonesArray* GetAODCaloClusters() const ; + virtual TClonesArray* GetAODTracks() const ; + virtual AliAODCaloCells* GetAODCaloCells() const {return fAODCaloCells ;} + + virtual TRefArray* GetAODCTS() const ; + virtual TRefArray* GetAODEMCAL() const ; + virtual TRefArray* GetAODPHOS() const ; + + virtual TString GetBaseParametersList(); + + virtual TNamed * GetEMCALCells() const ; + virtual TNamed * GetPHOSCells() const ; + + virtual AliStack * GetMCStack() const ; + virtual AliHeader* GetMCHeader() const ; + virtual AliGenEventHeader* GetMCGenEventHeader() const ; + + //Analysis helpers classes pointers setters and getters + virtual AliCaloPID * GetCaloPID() const {return fCaloPID ;} + virtual void SetCaloPID(AliCaloPID * pid) { fCaloPID = pid ;} + + virtual AliFidutialCut * GetFidutialCut() const {return fFidCut ;} + virtual void SetFidutialCut(AliFidutialCut * fc) { fFidCut = fc ;} + + virtual AliIsolationCut * GetIsolationCut() const {return fIC ;} + virtual void SetIsolationCut(AliIsolationCut * fc) { fIC = fc ;} + + virtual AliMCAnalysisUtils * GetMCAnalysisUtils() const {return fMCUtils ;} + virtual void SetMCAnalysisUtils(AliMCAnalysisUtils * mcutils) { fMCUtils = mcutils ;} + + virtual AliNeutralMesonSelection * GetNeutralMesonSelection() const {return fNMS ;} + virtual void SetNeutralMesonSelection(AliNeutralMesonSelection * nms) { fNMS = nms ;} + + virtual Bool_t IsDataMC() const {return fDataMC ; } + virtual void SwitchOnDataMC() {fDataMC = kTRUE ; } + virtual void SwitchOffDataMC() {fDataMC = kFALSE ; } + + virtual Bool_t IsFidutialCutOn() const {return fCheckFidCut ; } + virtual void SwitchOnFidutialCut() { fCheckFidCut = kTRUE;} + virtual void SwitchOffFidutialCut() { fCheckFidCut = kFALSE;} + + virtual Bool_t IsCaloPIDOn() const {return fCheckCaloPID ; } + virtual void SwitchOnCaloPID() { fCheckCaloPID = kTRUE;} + virtual void SwitchOffCaloPID() { fCheckCaloPID = kFALSE;} + + virtual Bool_t IsCaloPIDRecalculationOn() const {return fRecalculateCaloPID ; } + virtual void SwitchOnCaloPIDRecalculation() { fRecalculateCaloPID = kTRUE;} + virtual void SwitchOffCaloPIDRecalculation() { fRecalculateCaloPID = kFALSE;} + + virtual Float_t GetMaxPt() const {return fMaxPt ; } + virtual Float_t GetMinPt() const {return fMinPt ; } + virtual void SetMaxPt(Float_t pt) {fMaxPt = pt ; } + virtual void SetMinPt(Float_t pt) {fMinPt = pt ; } + void SetPtCutRange(Double_t ptmin, Double_t ptmax) + { fMaxPt=ptmax; fMinPt=ptmin;} + + //Histogrammes setters and getters + virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNPtBins = n ; + fHistoPtMax = max ; + fHistoPtMin = min ; + } + + Int_t GetHistoNPtBins() const { return fHistoNPtBins ; } + Float_t GetHistoPtMin() const { return fHistoPtMin ; } + Float_t GetHistoPtMax() const { return fHistoPtMax ; } + + virtual void SetHistoPhiRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNPhiBins = n ; + fHistoPhiMax = max ; + fHistoPhiMin = min ; + } + + Int_t GetHistoNPhiBins() const { return fHistoNPhiBins ; } + Float_t GetHistoPhiMin() const { return fHistoPhiMin ; } + Float_t GetHistoPhiMax() const { return fHistoPhiMax ; } + + virtual void SetHistoEtaRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNEtaBins = n ; + fHistoEtaMax = max ; + fHistoEtaMin = min ; + } + + Int_t GetHistoNEtaBins() const { return fHistoNEtaBins ; } + Float_t GetHistoEtaMin() const { return fHistoEtaMin ; } + Float_t GetHistoEtaMax() const { return fHistoEtaMax ; } + + + private: + + Bool_t fDataMC ; // Flag to access MC data when using ESD or AOD + Int_t fDebug ; // Debug level + Bool_t fCheckFidCut ; // Do analysis for clusters in defined region + Bool_t fCheckCaloPID ; // Do analysis for calorimeters + Bool_t fRecalculateCaloPID ; // Recalculate PID or use PID weights in calorimeters + Float_t fMinPt ; // Maximum pt of (trigger) particles in the analysis + Float_t fMaxPt ; // Minimum pt of (trigger) particles in the analysis + + AliCaloTrackReader * fReader; // Acces to ESD/AOD/MC data + + TClonesArray* fInputAODBranch ; //! Selected input particles branch + TString fInputAODName ; // Name of input AOD branch; + TClonesArray* fOutputAODBranch ; //! Selected output particles branch + Bool_t fNewAOD ; // Flag, new aod branch added to the analysis or not. + TString fOutputAODName ; // Name of output AOD branch; + TString fOutputAODClassName; // Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...) + + //TClonesArray* fAODCaloClusters ; //! selected PHOS/EMCAL CaloClusters + AliAODCaloCells * fAODCaloCells ; //! selected PHOS/EMCAL CaloCells + + //Analysis helper classes access pointers + AliCaloPID * fCaloPID; // PID calculation + AliFidutialCut * fFidCut; // Acceptance cuts + AliIsolationCut * fIC; // Isolation cut + AliMCAnalysisUtils * fMCUtils; // MonteCarlo Analysis utils + AliNeutralMesonSelection * fNMS; // Neutral Meson Selection + + //Histograms binning and range + Int_t fHistoNPtBins ; // Number of bins in pt axis + Float_t fHistoPtMax ; // Maximum value of pt histogram range + Float_t fHistoPtMin ; // Minimum value of pt histogram range + Int_t fHistoNPhiBins ; // Number of bins in phi axis + Float_t fHistoPhiMax ; // Maximum value of phi histogram range + Float_t fHistoPhiMin ; // Minimum value of phi histogram range + Int_t fHistoNEtaBins ; // Number of bins in eta axis + Float_t fHistoEtaMax ; // Maximum value of eta histogram range + Float_t fHistoEtaMin ; // Minimum value of eta histogram range + + ClassDef(AliAnaPartCorrBaseClass,3) + } ; #endif //ALIANAPARTCORRBASECLASS_H diff --git a/PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx b/PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx index 2c8e1207bde..b1bdc550257 100755 --- a/PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx +++ b/PWG4/PartCorrBase/AliAnaPartCorrMaker.cxx @@ -24,15 +24,15 @@ // -- Author: Gustavo Conesa (INFN-LNF) // --- ROOT system --- -class TClonesArray; +#include "TClonesArray.h" class TString ; +#include "TList.h" //#include "Riostream.h" //---- AliRoot system ---- #include "AliAnaPartCorrBaseClass.h" #include "AliAnaPartCorrMaker.h" #include "AliCaloTrackReader.h" -#include "AliLog.h" ClassImp(AliAnaPartCorrMaker) @@ -45,14 +45,14 @@ fOutputContainer(new TList ), fAnalysisContainer(new TList ), fMakeHisto(0), fMakeAOD(0), fAnaDebug(0), fReader(0x0), fAODBranchList(new TList ) { - //Default Ctor - if(fAnaDebug > 1 ) printf("*** Analysis Maker Constructor *** \n"); - - //Initialize parameters, pointers and histograms - if(!fReader) - fReader = new AliCaloTrackReader(); - - InitParameters(); + //Default Ctor + if(fAnaDebug > 1 ) printf("*** Analysis Maker Constructor *** \n"); + + //Initialize parameters, pointers and histograms + if(!fReader) + fReader = new AliCaloTrackReader(); + + InitParameters(); } //____________________________________________________________________________ @@ -62,58 +62,58 @@ fOutputContainer(g. fOutputContainer), fAnalysisContainer(g.fAnalysisContainer), fMakeHisto(g.fMakeHisto), fMakeAOD(fMakeAOD), fAnaDebug(g. fAnaDebug), fReader(g.fReader), fAODBranchList(g.fAODBranchList) { - // cpy ctor + // cpy ctor } //_________________________________________________________________________ AliAnaPartCorrMaker & AliAnaPartCorrMaker::operator = (const AliAnaPartCorrMaker & source) { - // assignment operator - - if(this == &source)return *this; - ((TObject *)this)->operator=(source); - - fOutputContainer = source.fOutputContainer ; - fAnalysisContainer = source.fAnalysisContainer ; - fAnaDebug = source.fAnaDebug; - fMakeHisto = source.fMakeHisto; - fMakeAOD = source.fMakeAOD; - - fReader = source.fReader ; - fAODBranchList = source.fAODBranchList; - - return *this; - + // assignment operator + + if(this == &source)return *this; + ((TObject *)this)->operator=(source); + + fOutputContainer = source.fOutputContainer ; + fAnalysisContainer = source.fAnalysisContainer ; + fAnaDebug = source.fAnaDebug; + fMakeHisto = source.fMakeHisto; + fMakeAOD = source.fMakeAOD; + + fReader = source.fReader ; + fAODBranchList = source.fAODBranchList; + + return *this; + } //____________________________________________________________________________ AliAnaPartCorrMaker::~AliAnaPartCorrMaker() { - // Remove all pointers. - - // Protection added in case of NULL pointers (MG) - if (fOutputContainer) { - fOutputContainer->Clear(); - delete fOutputContainer ; - } - - if (fAnalysisContainer) { - fAnalysisContainer->Clear(); - delete fAnalysisContainer ; - } - - if (fReader) delete fReader ; - - - if(fAODBranchList){ + // Remove all pointers. + + // Protection added in case of NULL pointers (MG) + if (fOutputContainer) { + fOutputContainer->Clear(); + delete fOutputContainer ; + } + + if (fAnalysisContainer) { + fAnalysisContainer->Clear(); + delete fAnalysisContainer ; + } + + if (fReader) delete fReader ; + + + if(fAODBranchList){ // for(Int_t iaod = 0; iaod < fAODBranchList->GetEntries(); iaod++) // fAODBranchList->At(iaod)->Clear(); - fAODBranchList->Clear(); - delete fAODBranchList ; - } - + fAODBranchList->Clear(); + delete fAODBranchList ; + } + } //________________________________________________________________________ @@ -124,129 +124,131 @@ TList * AliAnaPartCorrMaker::GetAODBranchList() // The list is filled in the maker, and new branch passed to the analysis frame // AliAnalysisTaskPartCorr - for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ - - AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; - if(ana->NewOutputAOD()) fAODBranchList->Add(ana->GetCreateOutputAODBranch()); - } - - return fAODBranchList ; - + for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ + + AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; + if(ana->NewOutputAOD()) fAODBranchList->Add(ana->GetCreateOutputAODBranch()); + } + + return fAODBranchList ; + } //________________________________________________________________________ TList *AliAnaPartCorrMaker::GetOutputContainer() { // Fill the output list of histograms during the CreateOutputObjects stage. - if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0) - AliFatal("Analysis job list not initialized"); - - for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ - AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; - if(fMakeHisto){// Analysis with histograms as output on - //Fill container with appropriate histograms - TList * templist = ana -> GetCreateOutputObjects(); - for(Int_t i = 0; i < templist->GetEntries(); i++) - fOutputContainer->Add(templist->At(i)) ; - }// Analysis with histograms as output on - }//Loop on analysis defined - return fOutputContainer; + if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0){ + printf("AliAnaPartCorrMaker::GetOutputContainer() - Analysis job list not initialized\n"); + abort(); + } + for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ + AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; + if(fMakeHisto){// Analysis with histograms as output on + //Fill container with appropriate histograms + TList * templist = ana -> GetCreateOutputObjects(); + for(Int_t i = 0; i < templist->GetEntries(); i++) + fOutputContainer->Add(templist->At(i)) ; + }// Analysis with histograms as output on + }//Loop on analysis defined + return fOutputContainer; } //________________________________________________________________________ void AliAnaPartCorrMaker::Init() { - //Init container histograms and other common variables - - if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0) - AliFatal("Analysis job list not initialized"); - - for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ - - AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; - ana->SetReader(fReader); //SetReader for each analysis - ana->Init(); - - }//Loop on analysis defined + //Init container histograms and other common variables + // Fill the output list of histograms during the CreateOutputObjects stage. + + if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0){ + printf("AliAnaPartCorrMaker::GetOutputInit() - Analysis job list not initialized\n"); + abort(); + } + + for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ + + AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; + ana->SetReader(fReader); //SetReader for each analysis + ana->Init(); + + }//Loop on analysis defined } //____________________________________________________________________________ void AliAnaPartCorrMaker::InitParameters() -{ - - //Init data members - fMakeHisto = kTRUE; - fMakeAOD = kTRUE; - fAnaDebug = 0; // No debugging info displayed by default - +{ + //Init data members + + fMakeHisto = kTRUE; + fMakeAOD = kTRUE; + fAnaDebug = 0; // No debugging info displayed by default + } //__________________________________________________________________ void AliAnaPartCorrMaker::Print(const Option_t * opt) const -{ - - //Print some relevant parameters set for the analysis - if(! opt) - return; - - printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; - printf("Debug level = %d\n", fAnaDebug) ; - printf("Produce Histo = %d\n", fMakeHisto) ; - printf("Produce AOD = %d\n", fMakeAOD) ; - +{ + //Print some relevant parameters set for the analysis + + if(! opt) + return; + + printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; + printf("Debug level = %d\n", fAnaDebug) ; + printf("Produce Histo = %d\n", fMakeHisto) ; + printf("Produce AOD = %d\n", fMakeAOD) ; + } //____________________________________________________________________________ Bool_t AliAnaPartCorrMaker::ProcessEvent(Int_t iEntry){ - //Process analysis for this event - - if(fMakeHisto && !fOutputContainer) - AliFatal("Histograms not initialized"); - - if(fAnaDebug >= 0 ) printf("*** Event %d *** \n",iEntry); - - //Each event needs an empty branch - for(Int_t iaod = 0; iaod < fAODBranchList->GetEntries(); iaod++) - fAODBranchList->At(iaod)->Clear(); - - //Tell the reader to fill the data in the 3 detector lists - fReader->FillInputEvent(iEntry); - - //Loop on analysis algorithms - if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n"); - Int_t nana = fAnalysisContainer->GetEntries() ; - for(Int_t iana = 0; iana < nana; iana++){ - - AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; - - ana->ConnectInputOutputAODBranches(); //Sets branches for each analysis - - //Make analysis, create aods in aod branch or AODCaloClusters - if(fMakeAOD) ana->MakeAnalysisFillAOD() ; - //Make further analysis with aod branch and fill histograms - if(fMakeHisto) ana->MakeAnalysisFillHistograms() ; - - } - - fReader->ResetLists(); - - if(fAnaDebug > 0 ) printf("*** End analysis *** \n"); - - return kTRUE ; - + //Process analysis for this event + + if(fMakeHisto && !fOutputContainer){ + printf("AliAnaPartCorrMaker::ProcessEvent() - Histograms not initialized\n"); + abort(); + } + if(fAnaDebug >= 0 ) printf("*** Event %d *** \n",iEntry); + + //Each event needs an empty branch + for(Int_t iaod = 0; iaod < fAODBranchList->GetEntries(); iaod++) + fAODBranchList->At(iaod)->Clear(); + + //Tell the reader to fill the data in the 3 detector lists + fReader->FillInputEvent(iEntry); + + //Loop on analysis algorithms + if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n"); + Int_t nana = fAnalysisContainer->GetEntries() ; + for(Int_t iana = 0; iana < nana; iana++){ + AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; + ana->ConnectInputOutputAODBranches(); //Sets branches for each analysis + //Make analysis, create aods in aod branch or AODCaloClusters + if(fMakeAOD) ana->MakeAnalysisFillAOD() ; + //Make further analysis with aod branch and fill histograms + if(fMakeHisto) ana->MakeAnalysisFillHistograms() ; + + } + + fReader->ResetLists(); + + if(fAnaDebug > 0 ) printf("*** End analysis *** \n"); + + return kTRUE ; + } //________________________________________________________________________ void AliAnaPartCorrMaker::Terminate() { - //Execute Terminate of analysis - //Do some final plots. - - for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ - - AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; - ana->Terminate(); - - }//Loop on analysis defined + //Execute Terminate of analysis + //Do some final plots. + + for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++){ + + AliAnaPartCorrBaseClass * ana = ((AliAnaPartCorrBaseClass *) fAnalysisContainer->At(iana)) ; + ana->Terminate(); + + }//Loop on analysis defined } diff --git a/PWG4/PartCorrBase/AliAnaPartCorrMaker.h b/PWG4/PartCorrBase/AliAnaPartCorrMaker.h index 7aacbfb1e55..e6dc9292e48 100755 --- a/PWG4/PartCorrBase/AliAnaPartCorrMaker.h +++ b/PWG4/PartCorrBase/AliAnaPartCorrMaker.h @@ -24,13 +24,13 @@ class AliCaloTrackReader ; class AliAnaPartCorrMaker : public TObject { -public: + public: AliAnaPartCorrMaker() ; // default ctor AliAnaPartCorrMaker(const AliAnaPartCorrMaker & g) ; // cpy ctor AliAnaPartCorrMaker & operator = (const AliAnaPartCorrMaker & g) ;//cpy assignment virtual ~AliAnaPartCorrMaker() ; //virtual dtor - + //Setter and getters TList * GetAODBranchList() ; TList * GetOutputContainer() ; @@ -49,26 +49,26 @@ public: void Terminate(); void AddAnalysis(TObject* ana, Int_t n) { - if ( fAnalysisContainer) fAnalysisContainer->AddAt(ana,n); - else { printf("AnalysisContainer not initialized"); - abort();} - } - + if ( fAnalysisContainer) fAnalysisContainer->AddAt(ana,n); + else { printf("AliAnaPartCorrMaker::AddAnalysis() - AnalysisContainer not initialized\n"); + abort();} + } + AliCaloTrackReader * GetReader() const {return fReader ; } void SetReader(AliCaloTrackReader * reader) { fReader = reader ; } - + //Others void Init(); void InitParameters(); - + void Print(const Option_t * opt) const; - + Bool_t ProcessEvent(Int_t iEntry) ; - + private: //General Data members - + TList * fOutputContainer ; // output histograms container TList * fAnalysisContainer ; // List with analysis pointers Bool_t fMakeHisto ; // If true makes final analysis with histograms as output diff --git a/PWG4/PartCorrBase/AliAnaScale.cxx b/PWG4/PartCorrBase/AliAnaScale.cxx index 6899facbd04..625d6468b2f 100755 --- a/PWG4/PartCorrBase/AliAnaScale.cxx +++ b/PWG4/PartCorrBase/AliAnaScale.cxx @@ -21,15 +21,13 @@ //*-- Yves Schutz ////////////////////////////////////////////////////////////////////////////// -#include +//Root system #include #include -#include -#include +//#include "Riostream.h" +//Analysis system #include "AliAnaScale.h" -#include "AliAnalysisManager.h" -#include "Riostream.h" //______________________________________________________________________________ AliAnaScale::AliAnaScale() : diff --git a/PWG4/PartCorrBase/AliAnaScale.h b/PWG4/PartCorrBase/AliAnaScale.h index 5d3e08d0ba2..bbbd0d78d07 100755 --- a/PWG4/PartCorrBase/AliAnaScale.h +++ b/PWG4/PartCorrBase/AliAnaScale.h @@ -9,9 +9,6 @@ ////////////////////////////////////////////////////////////////////////////// #include "AliAnalysisTask.h" - -class TH1D ; -class TH1I ; class TH1F ; class AliAnaScale : public AliAnalysisTask { @@ -38,7 +35,7 @@ private: // input and output - Int_t fDebug ; // Debug flag + Int_t fDebug ; // Debug flag // task parameters Float_t fScale ; // Scaling factor diff --git a/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.cxx b/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.cxx index 0a7172f885c..789a399d68b 100755 --- a/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.cxx +++ b/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.cxx @@ -25,25 +25,13 @@ // root #include -#include #include -#include -#include //#include // analysis #include "AliAnalysisTaskParticleCorrelation.h" -#include "AliAnalysisManager.h" -#include "AliESDInputHandler.h" -#include "AliMCEventHandler.h" -#include "AliMCEvent.h" #include "AliAnaPartCorrMaker.h" #include "AliCaloTrackReader.h" -#include "AliESDEvent.h" -#include "AliAODEvent.h" -#include "AliAODHandler.h" -#include "AliStack.h" -#include "AliLog.h" #include "AliPDG.h" ClassImp(AliAnalysisTaskParticleCorrelation) @@ -54,7 +42,6 @@ ClassImp(AliAnalysisTaskParticleCorrelation) AliAnalysisTaskSE(), fAna(0x0), fOutputContainer(0x0), - //fAODBranch(0x0), fConfigName(0) { // Default constructor @@ -62,23 +49,22 @@ ClassImp(AliAnalysisTaskParticleCorrelation) //_____________________________________________________ AliAnalysisTaskParticleCorrelation::AliAnalysisTaskParticleCorrelation(const char* name): - AliAnalysisTaskSE(name), - fAna(0x0), - fOutputContainer(0x0), - // fAODBranch(0x0), - fConfigName("ConfigAnalysis") + AliAnalysisTaskSE(name), + fAna(0x0), + fOutputContainer(0x0), + fConfigName("") { // Default constructor - + DefineOutput(1, TList::Class()); - + } //_____________________________________________________ AliAnalysisTaskParticleCorrelation::~AliAnalysisTaskParticleCorrelation() { // Remove all pointers - + if(fOutputContainer){ fOutputContainer->Clear() ; delete fOutputContainer ; @@ -89,47 +75,42 @@ AliAnalysisTaskParticleCorrelation::~AliAnalysisTaskParticleCorrelation() //_____________________________________________________ void AliAnalysisTaskParticleCorrelation::UserCreateOutputObjects() { - // Create the output container - if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::CreateOutputData() \n"); - - -// TClonesArray * aodBranch = new TClonesArray(fAna->GetAODBranchClassName(), 0); -// aodBranch->SetName(fAna->GetAODBranchName()); -// AddAODBranch("TClonesArray", &aodBranch); -// fAna->SetAODBranch(aodBranch); - - //Get list of aod arrays, add each aod array to analysis frame - TClonesArray * array = 0; - TList * list = fAna->GetAODBranchList(); - for(Int_t iaod = 0; iaod < list->GetEntries(); iaod++){ - array = (TClonesArray*) list->At(iaod); - AddAODBranch("TClonesArray", &array); - } - - //Histograms container - OpenFile(1); - fOutputContainer = fAna->GetOutputContainer(); - + // Create the output container + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::CreateOutputData() - Begin \n"); + + //Get list of aod arrays, add each aod array to analysis frame + TClonesArray * array = 0; + TList * list = fAna->GetAODBranchList(); + for(Int_t iaod = 0; iaod < list->GetEntries(); iaod++){ + array = (TClonesArray*) list->At(iaod); + AddAODBranch("TClonesArray", &array); + } + + //Histograms container + OpenFile(1); + fOutputContainer = fAna->GetOutputContainer(); + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::CreateOutputData() - End \n"); } //_____________________________________________________ void AliAnalysisTaskParticleCorrelation::Init() { // Initialization - if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::Init() \n"); - // Call configuration file - - if(fConfigName == ""){ - fConfigName="ConfigAnalysis"; + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::Init() - Begin \n"); + + // Call configuration file if specified + + if (fConfigName.Length()) { + printf("AliAnalysisTaskParticleCorrelation::Init() - ### Configuration file is %s.C ###", fConfigName.Data()); + gROOT->LoadMacro(fConfigName+".C"); + fAna = (AliAnaPartCorrMaker*) gInterpreter->ProcessLine("ConfigAnalysis()"); } - - AliInfo(Form("### Configuration file is %s.C ###", fConfigName.Data())); - gROOT->LoadMacro(fConfigName+".C"); - fAna = (AliAnaPartCorrMaker*) gInterpreter->ProcessLine("ConfigAnalysis()"); - if(!fAna) - AliFatal("Analysis pointer not initialized, abort analysis!"); + if(!fAna){ + printf("AliAnalysisTaskParticleCorrelation::Init() Analysis maker pointer not initialized, no analysis specified, abort analysis!\n"); + abort(); + } // Add different generator particles to PDG Data Base // to avoid problems when reading MC generator particles @@ -138,7 +119,7 @@ void AliAnalysisTaskParticleCorrelation::Init() // Initialise analysis fAna->Init(); - AliDebug(1,"End"); + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::Init() - End \n"); } @@ -148,21 +129,22 @@ void AliAnalysisTaskParticleCorrelation::UserExec(Option_t */*option*/) { // Execute analysis for current event // - if (fDebug > 1) printf("AnalysisTaskParticleCorrelation::Exec() \n"); + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::Exec() - Begin \n"); //Get the type of data, check if type is correct Int_t datatype = fAna->GetReader()->GetDataType(); if(datatype != AliCaloTrackReader::kESD && datatype != AliCaloTrackReader::kAOD && datatype != AliCaloTrackReader::kMC){ - AliFatal("Wrong type of data"); + printf("AliAnalysisTaskParticleCorrelation::Exec() - Wrong type of data\n"); return ; } - - fAna->GetReader()->SetInputEvent(InputEvent(), AODEvent(), MCEvent()); + fAna->GetReader()->SetInputOutputMCEvent(InputEvent(), AODEvent(), MCEvent()); //Process event fAna->ProcessEvent((Int_t) Entry()); + if (fDebug > 1) printf("AliAnalysisTaskParticleCorrelation::Exec() - End \n"); + PostData(1, fOutputContainer); } diff --git a/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.h b/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.h index 757f4d288b4..942ecfd92b7 100755 --- a/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.h +++ b/PWG4/PartCorrBase/AliAnalysisTaskParticleCorrelation.h @@ -21,30 +21,31 @@ class TList; class AliAnalysisTaskParticleCorrelation : public AliAnalysisTaskSE { public: - AliAnalysisTaskParticleCorrelation(); - AliAnalysisTaskParticleCorrelation(const char* name); - virtual ~AliAnalysisTaskParticleCorrelation() ;// virtual dtor - - // Implementation of interface methods - virtual void UserCreateOutputObjects(); - virtual void Init(); - virtual void LocalInit() {Init();} - virtual void UserExec(Option_t *option); - virtual void Terminate(Option_t *option); - - void SetConfigFileName(TString name ) {fConfigName = name ; } - TString GetConfigFileName() const {return fConfigName ; } + AliAnalysisTaskParticleCorrelation(); + AliAnalysisTaskParticleCorrelation(const char* name); + virtual ~AliAnalysisTaskParticleCorrelation() ;// virtual dtor + + // Implementation of interface methods + virtual void UserCreateOutputObjects(); + virtual void Init(); + virtual void LocalInit() {Init();} + virtual void UserExec(Option_t *option); + virtual void Terminate(Option_t *option); + + void SetConfigFileName(TString name ) {fConfigName = name ; } + TString GetConfigFileName() const {return fConfigName ; } + void SetAnalysisMaker(AliAnaPartCorrMaker *maker) {fAna = maker;} + private: - AliAnalysisTaskParticleCorrelation(const AliAnalysisTaskParticleCorrelation&); // Not implemented - AliAnalysisTaskParticleCorrelation& operator=(const AliAnalysisTaskParticleCorrelation&); // Not implemented - - AliAnaPartCorrMaker* fAna; // Pointer to the jet finder - TList * fOutputContainer ; //! Histogram container - //TClonesArray * fAODBranch; //! AOD branch - TString fConfigName ; //Configuration file name - - ClassDef(AliAnalysisTaskParticleCorrelation, 2); // Analysis task for standard gamma correlation analysis + AliAnalysisTaskParticleCorrelation(const AliAnalysisTaskParticleCorrelation&); // Not implemented + AliAnalysisTaskParticleCorrelation& operator=(const AliAnalysisTaskParticleCorrelation&); // Not implemented + + AliAnaPartCorrMaker* fAna; // Pointer to the manager class + TList * fOutputContainer ; //! Histogram container + TString fConfigName ; //Configuration file name + + ClassDef(AliAnalysisTaskParticleCorrelation, 2); // Analysis task for standard gamma correlation analysis }; - + #endif //ALIANALYSISTASKPARTICLECORRELATION_H diff --git a/PWG4/PartCorrBase/AliCaloPID.cxx b/PWG4/PartCorrBase/AliCaloPID.cxx index ee0efe8c47c..0a5eb46f5f1 100755 --- a/PWG4/PartCorrBase/AliCaloPID.cxx +++ b/PWG4/PartCorrBase/AliCaloPID.cxx @@ -24,12 +24,10 @@ // --- ROOT system --- #include -#include #include #include //---- ANALYSIS system ---- -#include "AliLog.h" #include "AliCaloPID.h" #include "AliAODCaloCluster.h" #include "AliAODPWG4Particle.h" @@ -48,10 +46,10 @@ fPHOSNeutralWeight(0.), fPHOSWeightFormula(0), fPHOSPhotonWeightFormula(0x0), fPHOSPi0WeightFormula(0x0), fDispCut(0.),fTOFCut(0.), fDebug(-1) { - //Ctor - - //Initialize parameters - InitParameters(); + //Ctor + + //Initialize parameters + InitParameters(); } //____________________________________________________________________________ @@ -72,274 +70,274 @@ fPHOSPi0WeightFormula(pid.fPHOSPi0WeightFormula), fDispCut(pid.fDispCut),fTOFCut(pid.fTOFCut), fDebug(pid.fDebug) { - // cpy ctor + // cpy ctor } //_________________________________________________________________________ AliCaloPID & AliCaloPID::operator = (const AliCaloPID & pid) { - // assignment operator - - if(&pid == this) return *this; - - fEMCALPhotonWeight = pid. fEMCALPhotonWeight ; - fEMCALPi0Weight = pid.fEMCALPi0Weight ; - fEMCALElectronWeight = pid.fEMCALElectronWeight; - fEMCALChargeWeight = pid.fEMCALChargeWeight; - fEMCALNeutralWeight = pid.fEMCALNeutralWeight; - - fPHOSPhotonWeight = pid.fPHOSPhotonWeight ; - fPHOSPi0Weight = pid.fPHOSPi0Weight ; - fPHOSElectronWeight = pid.fPHOSElectronWeight; - fPHOSChargeWeight = pid.fPHOSChargeWeight; - fPHOSNeutralWeight = pid.fPHOSNeutralWeight; - - fPHOSWeightFormula = pid.fPHOSWeightFormula; - fPHOSPhotonWeightFormula = pid.fPHOSPhotonWeightFormula; - fPHOSPi0WeightFormula = pid.fPHOSPi0WeightFormula; - - fDispCut = pid.fDispCut; - fTOFCut = pid.fTOFCut; - fDebug = pid.fDebug; - - return *this; - + // assignment operator + + if(&pid == this) return *this; + + fEMCALPhotonWeight = pid. fEMCALPhotonWeight ; + fEMCALPi0Weight = pid.fEMCALPi0Weight ; + fEMCALElectronWeight = pid.fEMCALElectronWeight; + fEMCALChargeWeight = pid.fEMCALChargeWeight; + fEMCALNeutralWeight = pid.fEMCALNeutralWeight; + + fPHOSPhotonWeight = pid.fPHOSPhotonWeight ; + fPHOSPi0Weight = pid.fPHOSPi0Weight ; + fPHOSElectronWeight = pid.fPHOSElectronWeight; + fPHOSChargeWeight = pid.fPHOSChargeWeight; + fPHOSNeutralWeight = pid.fPHOSNeutralWeight; + + fPHOSWeightFormula = pid.fPHOSWeightFormula; + fPHOSPhotonWeightFormula = pid.fPHOSPhotonWeightFormula; + fPHOSPi0WeightFormula = pid.fPHOSPi0WeightFormula; + + fDispCut = pid.fDispCut; + fTOFCut = pid.fTOFCut; + fDebug = pid.fDebug; + + return *this; + } //_________________________________ AliCaloPID::~AliCaloPID() { - //Dtor - - if(fPHOSPhotonWeightFormula) delete fPHOSPhotonWeightFormula ; - if(fPHOSPi0WeightFormula) delete fPHOSPi0WeightFormula ; - + //Dtor + + if(fPHOSPhotonWeightFormula) delete fPHOSPhotonWeightFormula ; + if(fPHOSPi0WeightFormula) delete fPHOSPi0WeightFormula ; + } //_______________________________________________________________ void AliCaloPID::InitParameters() { - //Initialize the parameters of the PID. - - fEMCALPhotonWeight = 0.8 ; - fEMCALPi0Weight = 0.5 ; - fEMCALElectronWeight = 0.8 ; - fEMCALChargeWeight = 0.5 ; - fEMCALNeutralWeight = 0.5 ; - - fPHOSPhotonWeight = 0.75 ; - fPHOSPi0Weight = 0.8 ; - fPHOSElectronWeight = 0.5 ; - fPHOSChargeWeight = 0.5 ; - fPHOSNeutralWeight = 0.5 ; - - //Formula to set the PID weight threshold for photon or pi0 - fPHOSWeightFormula = kTRUE; - fPHOSPhotonWeightFormula = + //Initialize the parameters of the PID. + + fEMCALPhotonWeight = 0.8 ; + fEMCALPi0Weight = 0.5 ; + fEMCALElectronWeight = 0.8 ; + fEMCALChargeWeight = 0.5 ; + fEMCALNeutralWeight = 0.5 ; + + fPHOSPhotonWeight = 0.75 ; + fPHOSPi0Weight = 0.8 ; + fPHOSElectronWeight = 0.5 ; + fPHOSChargeWeight = 0.5 ; + fPHOSNeutralWeight = 0.5 ; + + //Formula to set the PID weight threshold for photon or pi0 + fPHOSWeightFormula = kTRUE; + fPHOSPhotonWeightFormula = new TFormula("photonWeight","0.98*(x<40)+ 0.68*(x>=100)+(x>=40 && x<100)*(0.98+x*(6e-3)-x*x*(2e-04)+x*x*x*(1.1e-06))"); - fPHOSPi0WeightFormula = + fPHOSPi0WeightFormula = new TFormula("pi0Weight","0.98*(x<65)+ 0.915*(x>=100)+(x>=65 && x-x*(1.95e-3)-x*x*(4.31e-05)+x*x*x*(3.61e-07))"); - - fDispCut = 1.5; - fTOFCut = 5.e-9; - fDebug = -1; + + fDispCut = 1.5; + fTOFCut = 5.e-9; + fDebug = -1; } //_______________________________________________________________ Int_t AliCaloPID::GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const { - //Return most probable identity of the particle. - - if(!pid) AliFatal("pid pointer not initialized!!!"); - - Float_t wPh = fPHOSPhotonWeight ; - Float_t wPi0 = fPHOSPi0Weight ; - Float_t wE = fPHOSElectronWeight ; - Float_t wCh = fPHOSChargeWeight ; - Float_t wNe = fPHOSNeutralWeight ; - - - if(calo == "PHOS" && fPHOSWeightFormula){ - wPh = fPHOSPhotonWeightFormula->Eval(energy) ; - wPi0 = fPHOSPi0WeightFormula->Eval(energy); - } - - if(calo == "EMCAL"){ - - wPh = fEMCALPhotonWeight ; - wPi0 = fEMCALPi0Weight ; - wE = fEMCALElectronWeight ; - wCh = fEMCALChargeWeight ; - wNe = fEMCALNeutralWeight ; - - } - - if(fDebug > 0) printf("AliCaloPID::GetPdg: calo %s, ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f, hadrons: pion %0.2f, kaon %0.2f, proton %0.2f , neutron %0.2f, kaon %0.2f \n", - calo.Data(),pid[AliAODCluster::kPhoton], pid[AliAODCluster::kPi0], - pid[AliAODCluster::kElectron], pid[AliAODCluster::kEleCon], - pid[AliAODCluster::kPion], pid[AliAODCluster::kKaon], pid[AliAODCluster::kProton], - pid[AliAODCluster::kNeutron], pid[AliAODCluster::kKaon0]); - - Int_t pdg = kNeutralUnknown ; - Float_t chargedHadronWeight = pid[AliAODCluster::kProton]+pid[AliAODCluster::kKaon]+ + //Return most probable identity of the particle. + + if(!pid){ + printf("AliCaloPID::GetPdg() - pid pointer not initialized!!!\n"); + abort(); + } + + Float_t wPh = fPHOSPhotonWeight ; + Float_t wPi0 = fPHOSPi0Weight ; + Float_t wE = fPHOSElectronWeight ; + Float_t wCh = fPHOSChargeWeight ; + Float_t wNe = fPHOSNeutralWeight ; + + + if(calo == "PHOS" && fPHOSWeightFormula){ + wPh = fPHOSPhotonWeightFormula->Eval(energy) ; + wPi0 = fPHOSPi0WeightFormula->Eval(energy); + } + + if(calo == "EMCAL"){ + + wPh = fEMCALPhotonWeight ; + wPi0 = fEMCALPi0Weight ; + wE = fEMCALElectronWeight ; + wCh = fEMCALChargeWeight ; + wNe = fEMCALNeutralWeight ; + + } + + if(fDebug > 0) printf("AliCaloPID::GetPdg: calo %s, ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f, hadrons: pion %0.2f, kaon %0.2f, proton %0.2f , neutron %0.2f, kaon %0.2f \n", + calo.Data(),pid[AliAODCluster::kPhoton], pid[AliAODCluster::kPi0], + pid[AliAODCluster::kElectron], pid[AliAODCluster::kEleCon], + pid[AliAODCluster::kPion], pid[AliAODCluster::kKaon], pid[AliAODCluster::kProton], + pid[AliAODCluster::kNeutron], pid[AliAODCluster::kKaon0]); + + Int_t pdg = kNeutralUnknown ; + Float_t chargedHadronWeight = pid[AliAODCluster::kProton]+pid[AliAODCluster::kKaon]+ pid[AliAODCluster::kPion]+pid[AliAODCluster::kMuon]; - Float_t neutralHadronWeight = pid[AliAODCluster::kNeutron]+pid[AliAODCluster::kKaon0]; - Float_t allChargedWeight = pid[AliAODCluster::kElectron]+pid[AliAODCluster::kEleCon]+ chargedHadronWeight; - Float_t allNeutralWeight = pid[AliAODCluster::kPhoton]+pid[AliAODCluster::kPi0]+ neutralHadronWeight; - - //Select most probable ID - if(calo=="PHOS"){ - if(pid[AliAODCluster::kPhoton] > wPh) pdg = kPhoton ; - else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ; - else if(pid[AliAODCluster::kElectron] > wE) pdg = kElectron ; - else if(pid[AliAODCluster::kEleCon] > wE) pdg = kEleCon ; - else if(chargedHadronWeight > wCh) pdg = kChargedHadron ; - else if(neutralHadronWeight > wNe) pdg = kNeutralHadron ; - else if(allChargedWeight > allNeutralWeight) - pdg = kChargedUnknown ; - else - pdg = kNeutralUnknown ; - } - else{//EMCAL - if(pid[AliAODCluster::kPhoton] > wPh) pdg = kPhoton ; - else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ; - else if(pid[AliAODCluster::kElectron] > wE) pdg = kElectron ; - else if(chargedHadronWeight + neutralHadronWeight > wCh) pdg = kChargedHadron ; - else if(neutralHadronWeight + chargedHadronWeight > wNe) pdg = kNeutralHadron ; - else pdg = kNeutralUnknown ; - - } - - - if(fDebug > 0)printf("AliCaloPID::GetPdg:Final Pdg: %d \n", pdg); - - - - return pdg ; - + Float_t neutralHadronWeight = pid[AliAODCluster::kNeutron]+pid[AliAODCluster::kKaon0]; + Float_t allChargedWeight = pid[AliAODCluster::kElectron]+pid[AliAODCluster::kEleCon]+ chargedHadronWeight; + Float_t allNeutralWeight = pid[AliAODCluster::kPhoton]+pid[AliAODCluster::kPi0]+ neutralHadronWeight; + + //Select most probable ID + if(calo=="PHOS"){ + if(pid[AliAODCluster::kPhoton] > wPh) pdg = kPhoton ; + else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ; + else if(pid[AliAODCluster::kElectron] > wE) pdg = kElectron ; + else if(pid[AliAODCluster::kEleCon] > wE) pdg = kEleCon ; + else if(chargedHadronWeight > wCh) pdg = kChargedHadron ; + else if(neutralHadronWeight > wNe) pdg = kNeutralHadron ; + else if(allChargedWeight > allNeutralWeight) + pdg = kChargedUnknown ; + else + pdg = kNeutralUnknown ; + } + else{//EMCAL + if(pid[AliAODCluster::kPhoton] > wPh) pdg = kPhoton ; + else if(pid[AliAODCluster::kPi0] > wPi0) pdg = kPi0 ; + else if(pid[AliAODCluster::kElectron] > wE) pdg = kElectron ; + else if(chargedHadronWeight + neutralHadronWeight > wCh) pdg = kChargedHadron ; + else if(neutralHadronWeight + chargedHadronWeight > wNe) pdg = kNeutralHadron ; + else pdg = kNeutralUnknown ; + + } + + if(fDebug > 0)printf("AliCaloPID::GetPdg:Final Pdg: %d \n", pdg); + + return pdg ; + } //_______________________________________________________________ Int_t AliCaloPID::GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) const { - //Recalculated PID with all parameters - if(fDebug > 0)printf("AliCaloPID::GetPdg: Calorimeter %s, E %3.2f, l0 %3.2f, l1 %3.2f, disp %3.2f, tof %1.11f, distCPV %3.2f, distToBC %1.1f, NMax %d\n", - calo.Data(),mom.E(),cluster->GetM02(),cluster->GetM20(),cluster->GetDispersion(),cluster->GetTOF(), - cluster->GetEmcCpvDistance(), cluster->GetDistToBadChannel(),cluster->GetNExMax()); - - if(calo == "EMCAL") { - if(cluster->GetM02()< 0.25) return kPhoton ; - else return kNeutralHadron ; - } - - // if(calo == "PHOS") { - // if(cluster->GetM02()< 0.25) return kPhoton ; - // else return kNeutralHadron ; - // } - - return kNeutralHadron ; - + //Recalculated PID with all parameters + if(fDebug > 0)printf("AliCaloPID::GetPdg: Calorimeter %s, E %3.2f, l0 %3.2f, l1 %3.2f, disp %3.2f, tof %1.11f, distCPV %3.2f, distToBC %1.1f, NMax %d\n", + calo.Data(),mom.E(),cluster->GetM02(),cluster->GetM20(),cluster->GetDispersion(),cluster->GetTOF(), + cluster->GetEmcCpvDistance(), cluster->GetDistToBadChannel(),cluster->GetNExMax()); + + if(calo == "EMCAL") { + if(cluster->GetM02()< 0.25) return kPhoton ; + else return kNeutralHadron ; + } + + // if(calo == "PHOS") { + // if(cluster->GetM02()< 0.25) return kPhoton ; + // else return kNeutralHadron ; + // } + + return kNeutralHadron ; + } //__________________________________________________ TString AliCaloPID::GetPIDParametersList() { - //Put data member values in string to keep in output container - - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - sprintf(onePar,"--- AliCaloPID ---\n") ; - parList+=onePar ; - sprintf(onePar,"fDispCut =%2.2f (Cut on dispersion, used in PID evaluation) \n",fDispCut) ; - parList+=onePar ; - sprintf(onePar,"fTOFCut =%e (Cut on TOF, used in PID evaluation) \n",fTOFCut) ; - parList+=onePar ; - sprintf(onePar,"fEMCALPhotonWeight =%2.2f (EMCAL bayesian weight for photons)\n",fEMCALPhotonWeight) ; - parList+=onePar ; - sprintf(onePar,"fEMCALPi0Weight =%2.2f (EMCAL bayesian weight for pi0)\n",fEMCALPi0Weight) ; - parList+=onePar ; - sprintf(onePar,"fEMCALElectronWeight =%2.2f(EMCAL bayesian weight for electrons)\n",fEMCALElectronWeight) ; - parList+=onePar ; - sprintf(onePar,"fEMCALChargeWeight =%2.2f (EMCAL bayesian weight for charged hadrons)\n",fEMCALChargeWeight) ; - parList+=onePar ; - sprintf(onePar,"fEMCALNeutralWeight =%2.2f (EMCAL bayesian weight for neutral hadrons)\n",fEMCALNeutralWeight) ; - parList+=onePar ; - sprintf(onePar,"fPHOSPhotonWeight =%2.2f (PHOS bayesian weight for photons)\n",fPHOSPhotonWeight) ; - parList+=onePar ; - sprintf(onePar,"fPHOSPi0Weight =%2.2f (PHOS bayesian weight for pi0)\n",fPHOSPi0Weight) ; - parList+=onePar ; - sprintf(onePar,"fPHOSElectronWeight =%2.2f(PHOS bayesian weight for electrons)\n",fPHOSElectronWeight) ; - parList+=onePar ; - sprintf(onePar,"fPHOSChargeWeight =%2.2f (PHOS bayesian weight for charged hadrons)\n",fPHOSChargeWeight) ; - parList+=onePar ; - sprintf(onePar,"fPHOSNeutralWeight =%2.2f (PHOS bayesian weight for neutral hadrons)\n",fPHOSNeutralWeight) ; - parList+=onePar ; - - if(fPHOSWeightFormula){ - parList+="PHOS Photon Weight Formula: "+(fPHOSPhotonWeightFormula->GetExpFormula("p")); - parList+="PHOS Pi0 Weight Formula: "+(fPHOSPi0WeightFormula->GetExpFormula("p")); - } - - return parList; - + //Put data member values in string to keep in output container + + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + sprintf(onePar,"--- AliCaloPID ---\n") ; + parList+=onePar ; + sprintf(onePar,"fDispCut =%2.2f (Cut on dispersion, used in PID evaluation) \n",fDispCut) ; + parList+=onePar ; + sprintf(onePar,"fTOFCut =%e (Cut on TOF, used in PID evaluation) \n",fTOFCut) ; + parList+=onePar ; + sprintf(onePar,"fEMCALPhotonWeight =%2.2f (EMCAL bayesian weight for photons)\n",fEMCALPhotonWeight) ; + parList+=onePar ; + sprintf(onePar,"fEMCALPi0Weight =%2.2f (EMCAL bayesian weight for pi0)\n",fEMCALPi0Weight) ; + parList+=onePar ; + sprintf(onePar,"fEMCALElectronWeight =%2.2f(EMCAL bayesian weight for electrons)\n",fEMCALElectronWeight) ; + parList+=onePar ; + sprintf(onePar,"fEMCALChargeWeight =%2.2f (EMCAL bayesian weight for charged hadrons)\n",fEMCALChargeWeight) ; + parList+=onePar ; + sprintf(onePar,"fEMCALNeutralWeight =%2.2f (EMCAL bayesian weight for neutral hadrons)\n",fEMCALNeutralWeight) ; + parList+=onePar ; + sprintf(onePar,"fPHOSPhotonWeight =%2.2f (PHOS bayesian weight for photons)\n",fPHOSPhotonWeight) ; + parList+=onePar ; + sprintf(onePar,"fPHOSPi0Weight =%2.2f (PHOS bayesian weight for pi0)\n",fPHOSPi0Weight) ; + parList+=onePar ; + sprintf(onePar,"fPHOSElectronWeight =%2.2f(PHOS bayesian weight for electrons)\n",fPHOSElectronWeight) ; + parList+=onePar ; + sprintf(onePar,"fPHOSChargeWeight =%2.2f (PHOS bayesian weight for charged hadrons)\n",fPHOSChargeWeight) ; + parList+=onePar ; + sprintf(onePar,"fPHOSNeutralWeight =%2.2f (PHOS bayesian weight for neutral hadrons)\n",fPHOSNeutralWeight) ; + parList+=onePar ; + + if(fPHOSWeightFormula){ + parList+="PHOS Photon Weight Formula: "+(fPHOSPhotonWeightFormula->GetExpFormula("p")); + parList+="PHOS Pi0 Weight Formula: "+(fPHOSPi0WeightFormula->GetExpFormula("p")); + } + + return parList; + } //________________________________________________________________ void AliCaloPID::Print(const Option_t * opt) const { - - //Print some relevant parameters set for the analysis - if(! opt) - return; - - printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; - - printf("PHOS PID weight , photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f \n", - fPHOSPhotonWeight, fPHOSPi0Weight, - fPHOSElectronWeight, fPHOSChargeWeight, fPHOSNeutralWeight) ; - printf("EMCAL PID weight, photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f\n", - fEMCALPhotonWeight, fEMCALPi0Weight, - fEMCALElectronWeight, fEMCALChargeWeight, fEMCALNeutralWeight) ; - - printf("PHOS Parametrized weight on? = %d\n", fPHOSWeightFormula) ; - if(fPHOSWeightFormula){ - printf("Photon weight formula = %s\n", (fPHOSPhotonWeightFormula->GetExpFormula("p")).Data()); - printf("Pi0 weight formula = %s\n", (fPHOSPhotonWeightFormula->GetExpFormula("p")).Data()); - } - - printf("TOF cut = %e\n",fTOFCut); - printf("Dispersion cut = %2.2f\n",fDispCut); - printf("Debug level = %d\n",fDebug); - - printf(" \n"); - + + //Print some relevant parameters set for the analysis + if(! opt) + return; + + printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; + + printf("PHOS PID weight , photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f \n", + fPHOSPhotonWeight, fPHOSPi0Weight, + fPHOSElectronWeight, fPHOSChargeWeight, fPHOSNeutralWeight) ; + printf("EMCAL PID weight, photon %0.2f, pi0 %0.2f, e %0.2f, charge %0.2f, neutral %0.2f\n", + fEMCALPhotonWeight, fEMCALPi0Weight, + fEMCALElectronWeight, fEMCALChargeWeight, fEMCALNeutralWeight) ; + + printf("PHOS Parametrized weight on? = %d\n", fPHOSWeightFormula) ; + if(fPHOSWeightFormula){ + printf("Photon weight formula = %s\n", (fPHOSPhotonWeightFormula->GetExpFormula("p")).Data()); + printf("Pi0 weight formula = %s\n", (fPHOSPhotonWeightFormula->GetExpFormula("p")).Data()); + } + + printf("TOF cut = %e\n",fTOFCut); + printf("Dispersion cut = %2.2f\n",fDispCut); + printf("Debug level = %d\n",fDebug); + + printf(" \n"); + } //_______________________________________________________________ void AliCaloPID::SetPIDBits(const TString calo, const AliAODCaloCluster * cluster, AliAODPWG4Particle * ph) { - //Set Bits for PID selection - - //Dispersion/lambdas - Double_t disp=cluster->GetDispersion() ; + //Set Bits for PID selection + + //Dispersion/lambdas + Double_t disp=cluster->GetDispersion() ; // Double_t m20=calo->GetM20() ; // Double_t m02=calo->GetM02() ; - ph->SetDispBit(dispGetTOF() ; - ph->SetTOFBit(TMath::Abs(tof)GetEmcCpvDistance() ; - Int_t ntr=cluster->GetNTracksMatched(); //number of track matched - ph->SetChargedBit(ntr>0) ; //Temporary cut, should we evaluate distance? - - //Set PID pdg - ph->SetPdg(GetPdg(calo,cluster->PID(),ph->E())); - - if(fDebug > 0){ - printf("AliCaloPID::SetPIDBits: TOF %e, Dispersion %2.2f, NTracks %d\n",tof , disp, ntr); - printf("AliCaloPID::SetPIDBits: pdg %d, bits: TOF %d, Dispersion %d, Charge %d\n", + ph->SetDispBit(dispGetTOF() ; + ph->SetTOFBit(TMath::Abs(tof)GetEmcCpvDistance() ; + Int_t ntr=cluster->GetNTracksMatched(); //number of track matched + ph->SetChargedBit(ntr>0) ; //Temporary cut, should we evaluate distance? + + //Set PID pdg + ph->SetPdg(GetPdg(calo,cluster->PID(),ph->E())); + + if(fDebug > 0){ + printf("AliCaloPID::SetPIDBits: TOF %e, Dispersion %2.2f, NTracks %d\n",tof , disp, ntr); + printf("AliCaloPID::SetPIDBits: pdg %d, bits: TOF %d, Dispersion %d, Charge %d\n", ph->GetPdg(), ph->GetTOFBit() , ph->GetDispBit() , ph->GetChargedBit()); - } + } } diff --git a/PWG4/PartCorrBase/AliCaloPID.h b/PWG4/PartCorrBase/AliCaloPID.h index 9c36bb65b3b..e190c38a1b9 100755 --- a/PWG4/PartCorrBase/AliCaloPID.h +++ b/PWG4/PartCorrBase/AliCaloPID.h @@ -17,111 +17,110 @@ class TLorentzVector ; class TFormula ; //--- AliRoot system --- -class AliLog ; class AliAODCaloCluster; class AliAODPWG4Particle; class AliCaloPID : public TObject { -public: - - AliCaloPID() ; // ctor - AliCaloPID(const AliCaloPID & g) ; // cpy ctor - AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment - virtual ~AliCaloPID() ;//virtual dtor - - enum PidType { - kPhoton = 22, - kPi0 = 111, - kEta = 221, - kElectron = 11, - kEleCon = -11, - kNeutralHadron = 2112, - kChargedHadron = 211, - kNeutralUnknown = 130, - kChargedUnknown=321 - }; - - enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1}; - - void InitParameters(); - - Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const ; - - Int_t GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) const ; - - TString GetPIDParametersList(); - - void SetPIDBits(const TString calo, const AliAODCaloCluster * cluster, AliAODPWG4Particle *aodph); - - void Print(const Option_t * opt)const; - - //Weight getters - Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; } - Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; } - Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight ; } - Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; } - Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; } - Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; } - Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; } - Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; } - Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; } - Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; } - - Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; } - TFormula * GetPHOSPhotonWeightFormula() const { return fPHOSPhotonWeightFormula ; } - TFormula * GetPHOSPi0WeightFormula() const { return fPHOSPi0WeightFormula ; } - - //Weight setters - void SetEMCALPhotonWeight(Float_t w){ fEMCALPhotonWeight = w ; } - void SetEMCALPi0Weight(Float_t w){ fEMCALPi0Weight = w ; } - void SetEMCALElectronWeight(Float_t w){ fEMCALElectronWeight = w ; } - void SetEMCALChargeWeight(Float_t w){ fEMCALChargeWeight = w ; } - void SetEMCALNeutralWeight(Float_t w){ fEMCALNeutralWeight = w ; } - void SetPHOSPhotonWeight(Float_t w){ fPHOSPhotonWeight = w ; } - void SetPHOSPi0Weight(Float_t w){ fPHOSPi0Weight = w ; } - void SetPHOSElectronWeight(Float_t w){ fPHOSElectronWeight = w ; } - void SetPHOSChargeWeight(Float_t w){ fPHOSChargeWeight = w ; } - void SetPHOSNeutralWeight(Float_t w){ fPHOSNeutralWeight = w ; } - - void UsePHOSPIDWeightFormula(Bool_t par) { fPHOSWeightFormula = par; } - void SetPHOSPhotonWeightFormula(TFormula * photon) { fPHOSPhotonWeightFormula = photon; } - void SetPHOSPi0WeightFormula(TFormula * pi0) { fPHOSPi0WeightFormula = pi0; } - - //PID bits setters and getters - void SetDispersionCut(Float_t dcut ) {fDispCut = dcut; } - Float_t GetDispersionCut() const {return fDispCut ;} - - void SetTOFCut(Float_t tcut ) {fTOFCut = tcut; } - Float_t GetTOFCut() const {return fTOFCut ;} - - void SetDebug(Int_t deb) {fDebug=deb;} - Int_t GetDebug() const {return fDebug;} - -private: - - Float_t fEMCALPhotonWeight; //Bayesian PID weight for photons in EMCAL - Float_t fEMCALPi0Weight; //Bayesian PID weight for pi0 in EMCAL - Float_t fEMCALElectronWeight; //Bayesian PID weight for electrons in EMCAL - Float_t fEMCALChargeWeight; //Bayesian PID weight for charged hadrons in EMCAL - Float_t fEMCALNeutralWeight; //Bayesian PID weight for neutral hadrons in EMCAL - Float_t fPHOSPhotonWeight; //Bayesian PID weight for photons in PHOS - Float_t fPHOSPi0Weight; //Bayesian PID weight for pi0 in PHOS - Float_t fPHOSElectronWeight; //Bayesian PID weight for electrons in PHOS - Float_t fPHOSChargeWeight; //Bayesian PID weight for charged hadrons in PHOS - Float_t fPHOSNeutralWeight; //Bayesian PID weight for neutral hadrons in PHOS - - Bool_t fPHOSWeightFormula ; //Use parametrized weight threshold, function of energy - TFormula * fPHOSPhotonWeightFormula ; //Formula for photon weight - TFormula * fPHOSPi0WeightFormula ; //Formula for pi0 weight - - Float_t fDispCut; //Cut on dispersion, used in PID evaluation - Float_t fTOFCut; //Cut on TOF, used in PID evaluation - - Int_t fDebug; //Debug level - - ClassDef(AliCaloPID,3) -} ; + public: + + AliCaloPID() ; // ctor + AliCaloPID(const AliCaloPID & g) ; // cpy ctor + AliCaloPID & operator = (const AliCaloPID & g) ;//cpy assignment + virtual ~AliCaloPID() ;//virtual dtor + + enum PidType { + kPhoton = 22, + kPi0 = 111, + kEta = 221, + kElectron = 11, + kEleCon = -11, + kNeutralHadron = 2112, + kChargedHadron = 211, + kNeutralUnknown = 130, + kChargedUnknown=321 + }; + + enum TagType {kPi0Decay, kEtaDecay, kOtherDecay, kConversion, kNoTag = -1}; + + void InitParameters(); + + Int_t GetPdg(const TString calo, const Double_t * pid, const Float_t energy) const ; + + Int_t GetPdg(const TString calo,const TLorentzVector mom, const AliAODCaloCluster * cluster) const ; + + TString GetPIDParametersList(); + + void SetPIDBits(const TString calo, const AliAODCaloCluster * cluster, AliAODPWG4Particle *aodph); + + void Print(const Option_t * opt)const; + + //Weight getters + Float_t GetEMCALPhotonWeight() const { return fEMCALPhotonWeight ; } + Float_t GetEMCALPi0Weight() const { return fEMCALPi0Weight ; } + Float_t GetEMCALElectronWeight() const { return fEMCALElectronWeight ; } + Float_t GetEMCALChargeWeight() const { return fEMCALChargeWeight ; } + Float_t GetEMCALNeutralWeight() const { return fEMCALNeutralWeight ; } + Float_t GetPHOSPhotonWeight() const { return fPHOSPhotonWeight ; } + Float_t GetPHOSPi0Weight() const { return fPHOSPi0Weight ; } + Float_t GetPHOSElectronWeight() const { return fPHOSElectronWeight ; } + Float_t GetPHOSChargeWeight() const { return fPHOSChargeWeight ; } + Float_t GetPHOSNeutralWeight() const { return fPHOSNeutralWeight ; } + + Bool_t IsPHOSPIDWeightFormulaOn() const { return fPHOSWeightFormula ; } + TFormula * GetPHOSPhotonWeightFormula() const { return fPHOSPhotonWeightFormula ; } + TFormula * GetPHOSPi0WeightFormula() const { return fPHOSPi0WeightFormula ; } + + //Weight setters + void SetEMCALPhotonWeight(Float_t w){ fEMCALPhotonWeight = w ; } + void SetEMCALPi0Weight(Float_t w){ fEMCALPi0Weight = w ; } + void SetEMCALElectronWeight(Float_t w){ fEMCALElectronWeight = w ; } + void SetEMCALChargeWeight(Float_t w){ fEMCALChargeWeight = w ; } + void SetEMCALNeutralWeight(Float_t w){ fEMCALNeutralWeight = w ; } + void SetPHOSPhotonWeight(Float_t w){ fPHOSPhotonWeight = w ; } + void SetPHOSPi0Weight(Float_t w){ fPHOSPi0Weight = w ; } + void SetPHOSElectronWeight(Float_t w){ fPHOSElectronWeight = w ; } + void SetPHOSChargeWeight(Float_t w){ fPHOSChargeWeight = w ; } + void SetPHOSNeutralWeight(Float_t w){ fPHOSNeutralWeight = w ; } + + void UsePHOSPIDWeightFormula(Bool_t par) { fPHOSWeightFormula = par; } + void SetPHOSPhotonWeightFormula(TFormula * photon) { fPHOSPhotonWeightFormula = photon; } + void SetPHOSPi0WeightFormula(TFormula * pi0) { fPHOSPi0WeightFormula = pi0; } + + //PID bits setters and getters + void SetDispersionCut(Float_t dcut ) {fDispCut = dcut; } + Float_t GetDispersionCut() const {return fDispCut ;} + + void SetTOFCut(Float_t tcut ) {fTOFCut = tcut; } + Float_t GetTOFCut() const {return fTOFCut ;} + + void SetDebug(Int_t deb) {fDebug=deb;} + Int_t GetDebug() const {return fDebug;} + + private: + + Float_t fEMCALPhotonWeight; //Bayesian PID weight for photons in EMCAL + Float_t fEMCALPi0Weight; //Bayesian PID weight for pi0 in EMCAL + Float_t fEMCALElectronWeight; //Bayesian PID weight for electrons in EMCAL + Float_t fEMCALChargeWeight; //Bayesian PID weight for charged hadrons in EMCAL + Float_t fEMCALNeutralWeight; //Bayesian PID weight for neutral hadrons in EMCAL + Float_t fPHOSPhotonWeight; //Bayesian PID weight for photons in PHOS + Float_t fPHOSPi0Weight; //Bayesian PID weight for pi0 in PHOS + Float_t fPHOSElectronWeight; //Bayesian PID weight for electrons in PHOS + Float_t fPHOSChargeWeight; //Bayesian PID weight for charged hadrons in PHOS + Float_t fPHOSNeutralWeight; //Bayesian PID weight for neutral hadrons in PHOS + + Bool_t fPHOSWeightFormula ; //Use parametrized weight threshold, function of energy + TFormula * fPHOSPhotonWeightFormula ; //Formula for photon weight + TFormula * fPHOSPi0WeightFormula ; //Formula for pi0 weight + + Float_t fDispCut; //Cut on dispersion, used in PID evaluation + Float_t fTOFCut; //Cut on TOF, used in PID evaluation + + Int_t fDebug; //Debug level + + ClassDef(AliCaloPID,3) + } ; #endif //ALICALOPID_H diff --git a/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx b/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx index 74a5f606126..161ad92e27f 100755 --- a/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackAODReader.cxx @@ -30,12 +30,9 @@ //---- ANALYSIS system ---- #include "AliCaloTrackAODReader.h" #include "AliAODEvent.h" -#include "AliAODVertex.h" -#include "AliAODCaloCluster.h" #include "AliAODCaloCluster.h" #include "AliAODTrack.h" -#include "AliMCEvent.h" -#include "AliLog.h" +#include "AliFidutialCut.h" ClassImp(AliCaloTrackAODReader) @@ -71,14 +68,13 @@ AliCaloTrackAODReader::AliCaloTrackAODReader(const AliCaloTrackAODReader & g) : //____________________________________________________________________________ void AliCaloTrackAODReader::FillInputCTS() { //Return array with CTS tracks - fAODCTS = new TClonesArray("AliAODTrack",0); - Int_t nTracks = fAOD->GetNumberOfTracks() ; - Int_t naod = 0; + Int_t nTracks = fInputEvent->GetNumberOfTracks() ; + Bool_t first = kTRUE; Double_t p[3]; for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop - AliAODTrack * track = fAOD->GetTrack(itrack) ; // retrieve track from esd + AliAODTrack * track = ((AliAODEvent*)fInputEvent)->GetTrack(itrack) ; // retrieve track from esd // //We want tracks fitted in the detectors: // ULong_t status=AliAODTrack::kTPCrefit; @@ -98,7 +94,11 @@ void AliCaloTrackAODReader::FillInputCTS() { if(fDebug > 2 && momentum.Pt() > 0.1)printf("FillInputCTS():: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - new((*fAODCTS)[naod++]) AliAODTrack(*track); + if(first){ + new (fAODCTS) TRefArray(TProcessID::GetProcessWithUID(track)); + first=kFALSE; + } + fAODCTS->Add(track); }//Pt and Fidutial cut passed. //}// track status @@ -110,29 +110,34 @@ void AliCaloTrackAODReader::FillInputCTS() { void AliCaloTrackAODReader::FillInputEMCAL() { //Return array with EMCAL clusters in aod format - fAODEMCAL = new TClonesArray("AliAODCaloCluster",0); - TRefArray * caloClusters = new TRefArray(); - fAOD->GetEMCALClusters(caloClusters); - + Bool_t first = kTRUE; + //Get vertex for momentum calculation Double_t v[3] ; //vertex ; GetVertex(v); - + //Loop to select clusters in fidutial cut and fill container with aodClusters - Int_t naod = 0; - for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) { - AliAODCaloCluster * clus = (AliAODCaloCluster *) caloClusters->At(iclus) ; - TLorentzVector momentum ; - clus->GetMomentum(momentum, v); + //Int_t naod = 0; + for (Int_t iclus = 0; iclus < ((AliAODEvent*)fInputEvent)->GetNCaloClusters(); iclus++) { + AliAODCaloCluster * clus = 0; + if ( (clus = ((AliAODEvent*)fInputEvent)->GetCaloCluster(iclus)) ) { + if (clus->IsEMCALCluster()){ + TLorentzVector momentum ; + clus->GetMomentum(momentum, v); + + if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){ - if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){ - - if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - - new((*fAODEMCAL)[naod++]) AliAODCaloCluster(*clus); - - }//Pt and Fidutial cut passed. + if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + + if(first){ + new (fAODEMCAL) TRefArray(TProcessID::GetProcessWithUID(clus)); + first=kFALSE; + } + fAODEMCAL->Add(clus); + }//Pt and Fidutial cut passed. + }//EMCAL cluster + }// cluster exists }//esd cluster loop if(fDebug > 1) printf("FillInputEMCAL():: aod entries %d\n", fAODEMCAL->GetEntriesFast()); @@ -143,30 +148,35 @@ void AliCaloTrackAODReader::FillInputEMCAL() { void AliCaloTrackAODReader::FillInputPHOS() { //Return array with PHOS clusters in aod format - fAODPHOS = new TClonesArray("AliAODCaloCluster",0); - TRefArray * caloClusters = new TRefArray(); - fAOD->GetPHOSClusters(caloClusters); - + Bool_t first = kTRUE; + //Get vertex for momentum calculation Double_t v[3] ; //vertex ; GetVertex(v); //Loop to select clusters in fidutial cut and fill container with aodClusters - Int_t naod = 0; - - for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) { - AliAODCaloCluster * clus = (AliAODCaloCluster *) caloClusters->At(iclus) ; - TLorentzVector momentum ; - clus->GetMomentum(momentum, v); - - if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){ - - if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - - new((*fAODPHOS)[naod++]) AliAODCaloCluster(*clus); - - }//Pt and Fidutial cut passed. + //Int_t naod = 0; + + for (Int_t iclus = 0; iclus < ((AliAODEvent*)fInputEvent)->GetNCaloClusters(); iclus++) { + AliAODCaloCluster * clus = 0; + if ( (clus = ((AliAODEvent*)fInputEvent)->GetCaloCluster(iclus)) ) { + if (clus->IsPHOSCluster()){ + TLorentzVector momentum ; + clus->GetMomentum(momentum, v); + + if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){ + + if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + + if(first){ + new (fAODPHOS) TRefArray(TProcessID::GetProcessWithUID(clus)); + first=kFALSE; + } + fAODPHOS->Add(clus); + }//Pt and Fidutial cut passed. + }//PHOS cluster + }//cluster exists }//esd cluster loop if(fDebug > 1) printf("FillInputPHOS():: aod entries %d\n", fAODPHOS->GetEntriesFast()); @@ -178,7 +188,7 @@ void AliCaloTrackAODReader::FillInputPHOS() { void AliCaloTrackAODReader::FillInputEMCALCells() { //Return array with EMCAL cells in aod format - fEMCALCells = (TNamed*) fAOD->GetEMCALCells(); + fEMCALCells = (TNamed*) ((AliAODEvent*)fInputEvent)->GetEMCALCells(); } @@ -186,7 +196,7 @@ void AliCaloTrackAODReader::FillInputEMCALCells() { void AliCaloTrackAODReader::FillInputPHOSCells() { //Return array with PHOS cells in aod format - fPHOSCells = (TNamed*) fAOD->GetPHOSCells(); + fPHOSCells = (TNamed*) ((AliAODEvent*)fInputEvent)->GetPHOSCells(); } @@ -194,21 +204,29 @@ void AliCaloTrackAODReader::FillInputPHOSCells() { void AliCaloTrackAODReader::GetVertex(Double_t v[3]) const { //Return vertex position - v[0]=fAOD->GetVertex(0)->GetX() ;//CHECK!!! - v[1]=fAOD->GetVertex(0)->GetY() ;//CHECK!!! - v[2]=fAOD->GetVertex(0)->GetZ() ;//CHECK!!! + v[0] = ((AliAODEvent*)fInputEvent)->GetVertex(0)->GetX() ;//CHECK!!! + v[1] = ((AliAODEvent*)fInputEvent)->GetVertex(0)->GetY() ;//CHECK!!! + v[2] = ((AliAODEvent*)fInputEvent)->GetVertex(0)->GetZ() ;//CHECK!!! } //____________________________________________________________________________ -void AliCaloTrackAODReader::SetInputEvent(TObject* input, TObject* aod, TObject* mc) { +void AliCaloTrackAODReader::SetInputOutputMCEvent(AliVEvent* input, AliAODEvent* aod, AliMCEvent* mc) { // Connect the data pointers - - //If input is AOD, do analysis with input, if not, do analysis with the output aod. - if(!strcmp(input->GetName(),"AliESDEvent")) SetAOD((AliAODEvent*) aod); - else if(!strcmp(input->GetName(),"AliAODEvent")) SetAOD((AliAODEvent*) input); - else AliFatal(Form("Unknown data format: %s",input->GetName())); + // If input is AOD, do analysis with input, if not, do analysis with the output aod. + if(!strcmp(input->GetName(),"AliESDEvent")) { + SetInputEvent(aod); + SetOutputEvent(aod); + } + else if(!strcmp(input->GetName(),"AliAODEvent")){ + SetInputEvent(input); + SetOutputEvent(aod); + } + else{ + printf("AliCaloTrackAODReader::SetInputOutputMCEvent() - ABORT::Unknown data format: %s",input->GetName()); + abort(); + } + + SetMC(mc); - SetMC((AliMCEvent*) mc); - } diff --git a/PWG4/PartCorrBase/AliCaloTrackAODReader.h b/PWG4/PartCorrBase/AliCaloTrackAODReader.h index e8ebc8c5124..798195a1bcd 100755 --- a/PWG4/PartCorrBase/AliCaloTrackAODReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackAODReader.h @@ -20,25 +20,23 @@ class AliCaloTrackAODReader : public AliCaloTrackReader { public: - AliCaloTrackAODReader() ; // ctor - AliCaloTrackAODReader(const AliCaloTrackAODReader & g) ; // cpy ctor - //AliCaloTrackAODReader & operator = (const AliCaloTrackAODReader & g) ;//cpy assignment - virtual ~AliCaloTrackAODReader() {;} //virtual dtor - - void FillInputCTS() ; - void FillInputEMCAL() ; - void FillInputPHOS() ; - void FillInputEMCALCells() ; - void FillInputPHOSCells() ; - - void GetVertex(Double_t v[3]) const ; - - AliVEvent* GetInputEvent() const {return GetAOD();} - void SetInputEvent(TObject* esd, TObject* aod, TObject* mc) ; - - - ClassDef(AliCaloTrackAODReader,1) -} ; + AliCaloTrackAODReader() ; // ctor + AliCaloTrackAODReader(const AliCaloTrackAODReader & g) ; // cpy ctor + //AliCaloTrackAODReader & operator = (const AliCaloTrackAODReader & g) ;//cpy assignment + virtual ~AliCaloTrackAODReader() {;} //virtual dtor + + void FillInputCTS() ; + void FillInputEMCAL() ; + void FillInputPHOS() ; + void FillInputEMCALCells() ; + void FillInputPHOSCells() ; + + void GetVertex(Double_t v[3]) const ; + void SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ; + + + ClassDef(AliCaloTrackAODReader,1) + } ; #endif //ALICALOTRACKAODREADER_H diff --git a/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx b/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx index ad4791d1948..0a2bd83662e 100755 --- a/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackESDReader.cxx @@ -30,13 +30,11 @@ //---- ANALYSIS system ---- #include "AliCaloTrackESDReader.h" #include "AliESDEvent.h" -#include "AliESDVertex.h" #include "AliESDCaloCluster.h" #include "AliAODCaloCluster.h" #include "AliAODTrack.h" #include "AliAODEvent.h" -#include "AliMCEvent.h" -#include "AliLog.h" +#include "AliFidutialCut.h" ClassImp(AliCaloTrackESDReader) @@ -53,9 +51,9 @@ AliCaloTrackReader() //____________________________________________________________________________ AliCaloTrackESDReader::AliCaloTrackESDReader(const AliCaloTrackESDReader & g) : -AliCaloTrackReader(g) + AliCaloTrackReader(g) { - // cpy ctor + // cpy ctor } //_________________________________________________________________________ @@ -71,249 +69,263 @@ AliCaloTrackReader(g) //____________________________________________________________________________ void AliCaloTrackESDReader::FillInputCTS() { - //Return array with CTS tracks + //Return array with CTS tracks + //TRefArray * fAODCTS = new TRefArray(); + Int_t nTracks = fInputEvent->GetNumberOfTracks() ; + Int_t naod = 0; + Double_t pos[3]; + Double_t p[3]; + Double_t covTr[21]; + Double_t pid[10]; + for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop + AliESDtrack * track = (AliESDtrack*) ((AliESDEvent*)fInputEvent)->GetTrack(itrack) ; // retrieve track from esd + + //We want tracks fitted in the detectors: + ULong_t status=AliESDtrack::kTPCrefit; + status|=AliESDtrack::kITSrefit; + + if ( (track->GetStatus() & status) == status) {//Check if the bits we want are set + + track->GetPxPyPz(p) ; + TLorentzVector momentum(p[0],p[1],p[2],0); + + if(fCTSPtMin < momentum.Pt() &&fFidutialCut->IsInFidutialCut(momentum,"CTS")){ - fAODCTS = new TClonesArray("AliAODTrack",0); + if(fDebug > 3 && momentum.Pt() > 0.2)printf("FillInputCTS():: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - Int_t nTracks = fESD->GetNumberOfTracks() ; - Int_t naod = 0; - Double_t pos[3]; - Double_t p[3]; - Double_t covTr[21]; - Double_t pid[10]; - for (Int_t itrack = 0; itrack < nTracks; itrack++) {////////////// track loop - AliESDtrack * track = fESD->GetTrack(itrack) ; // retrieve track from esd - - //We want tracks fitted in the detectors: - ULong_t status=AliESDtrack::kTPCrefit; - status|=AliESDtrack::kITSrefit; - - if ( (track->GetStatus() & status) == status) {//Check if the bits we want are set - - track->GetPxPyPz(p) ; - TLorentzVector momentum(p[0],p[1],p[2],0); - - if(fCTSPtMin < momentum.Pt() &&fFidutialCut->IsInFidutialCut(momentum,"CTS")){ - - if(fDebug > 3 && momentum.Pt() > 0.2)printf("FillInputCTS():: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - - track->GetXYZ(pos); - track->GetCovarianceXYZPxPyPz(covTr); - track->GetESDpid(pid); - - Float_t impactXY, impactZ; - - track->GetImpactParameters(impactXY,impactZ); - - if (impactXY<3) { - // track inside the beam pipe - - AliAODTrack *aodTrack = new((*fAODCTS)[naod++]) - AliAODTrack(track->GetID(), track->GetLabel(), p, kTRUE, pos, kFALSE,covTr, (Short_t)track->GetSign(), track->GetITSClusterMap(), - pid, - 0x0,//primary, - kTRUE, // check if this is right - kTRUE, // check if this is right - AliAODTrack::kPrimary, - 0); - - aodTrack->SetFlags(track->GetStatus()); - aodTrack->ConvertAliPIDtoAODPID(); - } - else continue; // outside the beam pipe: orphan track - }//Pt and Fidutial cut passed. - }// track status - }// track loop - if(fDebug > 1) printf("FillInputCTS():: aod entries %d\n", fAODCTS->GetEntriesFast()); + track->GetXYZ(pos); + track->GetCovarianceXYZPxPyPz(covTr); + track->GetESDpid(pid); + + Float_t impactXY, impactZ; + + track->GetImpactParameters(impactXY,impactZ); + + if (impactXY<3) { + // track inside the beam pipe + //Put new aod object in file in AOD tracks array + AliAODTrack *aodTrack = new((*(fOutputEvent->GetTracks()))[naod++]) + AliAODTrack(track->GetID(), track->GetLabel(), p, kTRUE, pos, kFALSE,covTr, (Short_t)track->GetSign(), track->GetITSClusterMap(), + pid, + 0x0,//primary, + kTRUE, // check if this is right + kTRUE, // check if this is right + AliAODTrack::kPrimary, + 0); + + aodTrack->SetFlags(track->GetStatus()); + aodTrack->ConvertAliPIDtoAODPID(); + + fAODCTS->Add(aodTrack); } + else continue; // outside the beam pipe: orphan track + }//Pt and Fidutial cut passed. + }// track status + }// track loop + + //Put references to selected tracks in array + for(Int_t itrack = 0; itrack < (fOutputEvent->GetTracks())->GetEntriesFast(); itrack++){ + AliAODTrack * track = (AliAODTrack*) (fOutputEvent->GetTracks())->At(itrack); + fAODCTS->Add(track); + } + + if(fDebug > 1) printf("FillInputCTS():: aod entries %d\n", fAODCTS->GetEntriesFast()); } //____________________________________________________________________________ void AliCaloTrackESDReader::FillInputEMCAL() { - //Return array with EMCAL clusters in aod format - - fAODEMCAL = new TClonesArray("AliAODCaloCluster",0); - - TRefArray * caloClusters = new TRefArray(); - fESD->GetEMCALClusters(caloClusters); - - //Get vertex for momentum calculation - Double_t v[3] ; //vertex ; - GetVertex(v); - - //Loop to select clusters in fidutial cut and fill container with aodClusters - Int_t naod = 0; - Float_t pos[3] ; - // Double_t * pid = new Double_t[AliPID::kSPECIESN]; - - for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) { - AliESDCaloCluster * clus = (AliESDCaloCluster *) caloClusters->At(iclus) ; - TLorentzVector momentum ; - clus->GetMomentum(momentum, v); - if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputEMCAL():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){ - - if(fDebug > 2 && momentum.E() > 0.2)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - // pid=clus->GetPid(); - clus->GetPosition(pos) ; - // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", - // pid[AliPID::kPhoton],pid[AliPID::kPi0], - // pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], - // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0], - // pid[AliPID::kNeutron], pid[AliPID::kMuon]); - Int_t id = clus->GetID(); - Int_t nLabel = clus->GetNLabels(); - Int_t *labels=0x0; - if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray(); - - Float_t energy = clus->E(); - Char_t ttype= AliAODCluster::kEMCALClusterv1; - AliAODCaloCluster *caloCluster = new((*fAODEMCAL)[naod++]) - AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL,ttype,0); - - caloCluster->SetPIDFromESD(clus->GetPid()); - caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(), - clus->GetM20(), clus->GetM02(), - clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()) ; - - - if(fDebug > 3 && momentum.E() > 0.2) - printf("FillInputEMCAL():: Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, NexMax %d, TOF %e\n", - clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),clus->GetM20(), clus->GetM02(), - clus->GetNExMax(), clus->GetTOF()); - - caloCluster->SetNCells(clus->GetNCells()); - caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); - caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); - - TArrayI* matchedT = clus->GetTracksMatched(); - if (matchedT && clus->GetTrackMatched() > 0) { - for (Int_t im = 0; im < matchedT->GetSize(); im++) { - caloCluster->AddTrackMatched((fESD->GetTrack(im))); - } - } - - }//Pt and Fidutial cut passed. - }//esd cluster loop - - if(fDebug > 1) printf("FillInputEMCAL():: aod entries %d\n", fAODEMCAL->GetEntriesFast()); - + //Return array with EMCAL clusters in aod format + + //Get vertex for momentum calculation + Double_t v[3] ; //vertex ; + GetVertex(v); + + //Loop to select clusters in fidutial cut and fill container with aodClusters + Int_t naod = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); + Float_t pos[3] ; + // Double_t * pid = new Double_t[AliPID::kSPECIESN]; + for (Int_t iclus = 0; iclus < ((AliESDEvent*)fInputEvent)->GetNumberOfCaloClusters(); iclus++) { + AliESDCaloCluster * clus = 0; + if ( (clus = ((AliESDEvent*)fInputEvent)->GetCaloCluster(iclus)) ) { + if (clus->IsEMCAL()){ + TLorentzVector momentum ; + clus->GetMomentum(momentum, v); + if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputEMCAL():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + if(fEMCALPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"EMCAL")){ + + if(fDebug > 2 && momentum.E() > 0.2)printf("FillInputEMCAL():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + // pid=clus->GetPid(); + clus->GetPosition(pos) ; + // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", + // pid[AliPID::kPhoton],pid[AliPID::kPi0],pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], + // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],pid[AliPID::kNeutron], pid[AliPID::kMuon]); + Int_t id = clus->GetID(); + Int_t nLabel = clus->GetNLabels(); + Int_t *labels=0x0; + if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray(); + + Float_t energy = clus->E(); + Char_t ttype= AliAODCluster::kEMCALClusterv1; + + //Put new aod object in file in AOD calo clusters array + AliAODCaloCluster *caloCluster = new((*(fOutputEvent->GetCaloClusters()))[naod++]) + AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL,ttype,0); + + caloCluster->SetPIDFromESD(clus->GetPid()); + caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(), + clus->GetM20(), clus->GetM02(), + clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()) ; + + + if(fDebug > 3 && momentum.E() > 0.2) + printf("FillInputEMCAL():: Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, NexMax %d, TOF %e\n", + clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),clus->GetM20(), clus->GetM02(), + clus->GetNExMax(), clus->GetTOF()); + + caloCluster->SetNCells(clus->GetNCells()); + caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); + caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); + + TArrayI* matchedT = clus->GetTracksMatched(); + if (matchedT && clus->GetTrackMatched() > 0) { + for (Int_t im = 0; im < matchedT->GetSize(); im++) { + caloCluster->AddTrackMatched((fInputEvent->GetTrack(im))); + } + } + //Fill reference array + }//Pt and Fidutial cut passed. + }//EMCAL cluster + }//cluster exists + }//esd cluster loop + + //Put references to selected clusters in array + for(Int_t iclus = 0; iclus < (fOutputEvent->GetCaloClusters())->GetEntriesFast(); iclus++){ + AliAODCaloCluster * clus = (AliAODCaloCluster*) (fOutputEvent->GetCaloClusters())->At(iclus); + fAODEMCAL->Add(clus); + } + if(fDebug > 1) printf("FillInputEMCAL():: aod entries %d\n", fAODEMCAL->GetEntriesFast()); + } //____________________________________________________________________________ void AliCaloTrackESDReader::FillInputPHOS() { - //Return array with PHOS clusters in aod format - fAODPHOS = new TClonesArray("AliAODCaloCluster",0); - - TRefArray * caloClusters = new TRefArray(); - fESD->GetPHOSClusters(caloClusters); - - //Get vertex for momentum calculation - Double_t v[3] ; //vertex ; - GetVertex(v); - - //Loop to select clusters in fidutial cut and fill container with aodClusters - Int_t naod = 0; - Float_t pos[3] ; - Double_t * pid = new Double_t[AliPID::kSPECIESN]; - - for (Int_t iclus = 0; iclus < caloClusters->GetEntriesFast(); iclus++) { - AliESDCaloCluster * clus = (AliESDCaloCluster *) caloClusters->At(iclus) ; - TLorentzVector momentum ; - clus->GetMomentum(momentum, v); - if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputPHOS():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){ - - if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - - pid=clus->GetPid(); - // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", - // pid[AliPID::kPhoton],pid[AliPID::kPi0], - // pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], - // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0], - // pid[AliPID::kNeutron], pid[AliPID::kMuon]); - - clus->GetPosition(pos) ; - Int_t id = clus->GetID(); - Int_t nLabel = clus->GetNLabels(); - Int_t *labels=0x0; - if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray(); - Float_t energy = clus->E(); - - //Phos cluster type - Char_t ttype= AliAODCluster::kPHOSNeutral; - Float_t wNeutral = pid[AliPID::kNeutron]+ pid[AliPID::kKaon0]+pid[AliPID::kPhoton]+pid[AliPID::kPi0]; - Float_t wCharged = pid[AliPID::kMuon] + pid[AliPID::kElectron] + pid[AliPID::kEleCon]+ - pid[AliPID::kProton]+pid[AliPID::kKaon]+pid[AliPID::kPion]; - if( wCharged > wNeutral) ttype= AliAODCluster::kPHOSCharged; - - AliAODCaloCluster *caloCluster = new((*fAODPHOS)[naod++]) - AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL, ttype, 0); - caloCluster->SetPIDFromESD(clus->GetPid()); - caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(), - clus->GetM20(), clus->GetM02(), - clus->GetEmcCpvDistance(), clus->GetNExMax()) ; - - if(fDebug > 3 && momentum.E() > 0.2) - printf("FillInputPHOS():: Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, EmcCpvDist %3.3f, NexMax %d, TOF %e\n", - clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),clus->GetM20(), clus->GetM02(), - clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()); - - caloCluster->SetNCells(clus->GetNCells()); - caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); - caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); - TArrayI* matchedT = clus->GetTracksMatched(); - if (matchedT) { - for (Int_t im = 0; im < matchedT->GetSize(); im++) { - caloCluster->AddTrackMatched((fESD->GetTrack(im))); - } - } - - }//Pt and Fidutial cut passed. - }//esd cluster loop - if(fDebug > 1) printf("FillInputPHOS():: aod entries %d\n", fAODPHOS->GetEntriesFast()); - - + //Return array with PHOS clusters in aod format + + //Get vertex for momentum calculation + Double_t v[3] ; //vertex ; + GetVertex(v); + + //Loop to select clusters in fidutial cut and fill container with aodClusters + Int_t naod = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); + Float_t pos[3] ; + Double_t * pid = new Double_t[AliPID::kSPECIESN]; + + for (Int_t iclus = 0; iclus < ((AliESDEvent*)fInputEvent)->GetNumberOfCaloClusters(); iclus++) { + AliESDCaloCluster * clus = 0; + if ( (clus = ((AliESDEvent*)fInputEvent)->GetCaloCluster(iclus)) ) { + if (clus->IsPHOS()){ + TLorentzVector momentum ; + clus->GetMomentum(momentum, v); + if(fDebug > 3 && momentum.E() > 0.1)printf("FillInputPHOS():: all clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + if(fPHOSPtMin < momentum.Pt() && fFidutialCut->IsInFidutialCut(momentum,"PHOS")){ + + if(fDebug > 2 && momentum.E() > 0.1)printf("FillInputPHOS():: Selected clusters E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + + pid=clus->GetPid(); + // printf("Reader PID ESD: ph %0.2f, pi0 %0.2f, el %0.2f, conv el %0.2f,pi %0.2f, k %0.2f, p %0.2f, k0 %0.2f, n %0.2f, mu %0.2f \n", + // pid[AliPID::kPhoton],pid[AliPID::kPi0],pid[AliPID::kElectron],pid[AliPID::kEleCon],pid[AliPID::kPion], + // pid[AliPID::kKaon],pid[AliPID::kProton], pid[AliPID::kKaon0],pid[AliPID::kNeutron], pid[AliPID::kMuon]); + + clus->GetPosition(pos) ; + Int_t id = clus->GetID(); + Int_t nLabel = clus->GetNLabels(); + Int_t *labels=0x0; + if(clus->GetLabels()) labels = (clus->GetLabels())->GetArray(); + Float_t energy = clus->E(); + + //Phos cluster type + Char_t ttype= AliAODCluster::kPHOSNeutral; + Float_t wNeutral = pid[AliPID::kNeutron]+ pid[AliPID::kKaon0]+pid[AliPID::kPhoton]+pid[AliPID::kPi0]; + Float_t wCharged = pid[AliPID::kMuon] + pid[AliPID::kElectron] + pid[AliPID::kEleCon]+ + pid[AliPID::kProton]+pid[AliPID::kKaon]+pid[AliPID::kPion]; + if( wCharged > wNeutral) ttype= AliAODCluster::kPHOSCharged; + + //Put new aod object in file in AOD calo clusters array + AliAODCaloCluster *caloCluster = new((*(fOutputEvent->GetCaloClusters()))[naod++]) + AliAODCaloCluster(id,nLabel,labels,energy, pos, NULL, ttype, 0); + caloCluster->SetPIDFromESD(clus->GetPid()); + caloCluster->SetCaloCluster(clus->GetDistanceToBadChannel(), clus->GetClusterDisp(), + clus->GetM20(), clus->GetM02(), + clus->GetEmcCpvDistance(), clus->GetNExMax()) ; + + if(fDebug > 3 && momentum.E() > 0.2) + printf("FillInputPHOS():: Selected clusters Distance BC %2.2f, dispersion %2.2f, M20 %f, M02 %3.2f, EmcCpvDist %3.3f, NexMax %d, TOF %e\n", + clus->GetDistanceToBadChannel(), clus->GetClusterDisp(),clus->GetM20(), clus->GetM02(), + clus->GetEmcCpvDistance(), clus->GetNExMax(), clus->GetTOF()); + + caloCluster->SetNCells(clus->GetNCells()); + caloCluster->SetCellsAbsId(clus->GetCellsAbsId()); + caloCluster->SetCellsAmplitudeFraction(clus->GetCellsAmplitudeFraction()); + TArrayI* matchedT = clus->GetTracksMatched(); + if (matchedT) { + for (Int_t im = 0; im < matchedT->GetSize(); im++) { + caloCluster->AddTrackMatched((fInputEvent->GetTrack(im))); + } + } + }//Pt and Fidutial cut passed. + }//PHOS cluster + }//cluster exists + }//esd cluster loop + + //Put references to selected clusters in array + for(Int_t iclus = 0; iclus < (fOutputEvent->GetCaloClusters())->GetEntriesFast(); iclus++){ + AliAODCaloCluster * clus = (AliAODCaloCluster*) (fOutputEvent->GetCaloClusters())->At(iclus); + fAODPHOS->Add(clus); + } + if(fDebug > 1) printf("FillInputPHOS():: aod entries %d\n", fAODPHOS->GetEntriesFast()); + } //____________________________________________________________________________ void AliCaloTrackESDReader::FillInputEMCALCells() { - //Return array with EMCAL cells in esd format - - fEMCALCells = (TNamed*) fESD->GetEMCALCells(); - + //Return array with EMCAL cells in esd format + + fEMCALCells = (TNamed*) ((AliESDEvent*)fInputEvent)->GetEMCALCells(); + } //____________________________________________________________________________ void AliCaloTrackESDReader::FillInputPHOSCells() { - //Return array with PHOS cells in esd format - - fPHOSCells = (TNamed*) fESD->GetPHOSCells(); - + //Return array with PHOS cells in esd format + + fPHOSCells = (TNamed*) ((AliESDEvent*)fInputEvent)->GetPHOSCells(); + } //____________________________________________________________________________ void AliCaloTrackESDReader::GetVertex(Double_t v[3]) const { - //Return vertex position - - fESD->GetVertex()->GetXYZ(v) ; - + //Return vertex position + + ((AliESDEvent*)fInputEvent)->GetVertex()->GetXYZ(v) ; + } //____________________________________________________________________________ -void AliCaloTrackESDReader::SetInputEvent(TObject* esd, TObject* aod, TObject* mc) { - // Connect the data pointers - - if(strcmp(esd->GetName(),"AliESDEvent")) - AliFatal(Form("Wrong reader, here only ESDs. Input name: %s != AliESDEvent \n",esd->GetName())); - - SetESD((AliESDEvent*) esd); - SetAOD ((AliAODEvent*) aod); - SetMC((AliMCEvent*) mc); - +void AliCaloTrackESDReader::SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) { + // Connect the data pointers + + if(strcmp(esd->GetName(),"AliESDEvent")){ + printf("ABORT::Wrong reader, here only ESDs. Input name: %s != AliESDEvent \n",esd->GetName()); + abort(); + } + + SetInputEvent(esd); + SetOutputEvent(aod); + SetMC(mc); + } diff --git a/PWG4/PartCorrBase/AliCaloTrackESDReader.h b/PWG4/PartCorrBase/AliCaloTrackESDReader.h index 6c7135f10b3..193c64cef60 100755 --- a/PWG4/PartCorrBase/AliCaloTrackESDReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackESDReader.h @@ -17,27 +17,25 @@ #include "AliCaloTrackReader.h" class AliCaloTrackESDReader : public AliCaloTrackReader { - -public: - - AliCaloTrackESDReader() ; // ctor - AliCaloTrackESDReader(const AliCaloTrackESDReader & g) ; // cpy ctor - //AliCaloTrackESDReader & operator = (const AliCaloTrackESDReader & g) ;//cpy assignment - virtual ~AliCaloTrackESDReader() {;} //virtual dtor - - void FillInputCTS () ; - void FillInputEMCAL() ; - void FillInputPHOS () ; - void FillInputEMCALCells() ; - void FillInputPHOSCells() ; - - void GetVertex(Double_t v[3]) const ; - - AliVEvent* GetInputEvent() const {return GetESD();} - void SetInputEvent(TObject* esd, TObject* aod, TObject* mc) ; - - ClassDef(AliCaloTrackESDReader,1) -} ; + + public: + + AliCaloTrackESDReader() ; // ctor + AliCaloTrackESDReader(const AliCaloTrackESDReader & g) ; // cpy ctor + //AliCaloTrackESDReader & operator = (const AliCaloTrackESDReader & g) ;//cpy assignment + virtual ~AliCaloTrackESDReader() {;} //virtual dtor + + void FillInputCTS () ; + void FillInputEMCAL() ; + void FillInputPHOS () ; + void FillInputEMCALCells() ; + void FillInputPHOSCells() ; + + void GetVertex(Double_t v[3]) const ; + void SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ; + + ClassDef(AliCaloTrackESDReader,1) + } ; #endif //ALICALOTRACKESDREADER_H diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx index b7c5fa45231..e24e0117e00 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx @@ -9,7 +9,7 @@ * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * + * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id: $ */ @@ -26,26 +26,27 @@ #include #include -#include +#include //#include "Riostream.h" //---- ANALYSIS system ---- #include "AliCaloTrackMCReader.h" -#include "AliLog.h" #include "AliGenEventHeader.h" #include "AliStack.h" #include "AliAODCaloCluster.h" #include "AliAODTrack.h" +#include "AliFidutialCut.h" +#include "AliAODEvent.h" +#include "TParticle.h" -ClassImp(AliCaloTrackMCReader) + ClassImp(AliCaloTrackMCReader) //____________________________________________________________________________ AliCaloTrackMCReader::AliCaloTrackMCReader() : AliCaloTrackReader(), fDecayPi0(0), - fNeutralParticlesArray(0x0), fChargedParticlesArray(0x0), - fStatusArray(0x0), fKeepAllStatus(0), fClonesArrayType(0), - fCheckOverlap(0), fEMCALOverlapAngle(0),fPHOSOverlapAngle(0), - fIndex2ndPhoton(0) + fNeutralParticlesArray(0x0), fChargedParticlesArray(0x0), + fStatusArray(0x0), fKeepAllStatus(0), fCheckOverlap(0), + fEMCALOverlapAngle(0),fPHOSOverlapAngle(0), fIndex2ndPhoton(0) { //Ctor @@ -61,8 +62,7 @@ AliCaloTrackMCReader::AliCaloTrackMCReader(const AliCaloTrackMCReader & g) : fNeutralParticlesArray(g.fNeutralParticlesArray?new TArrayI(*g.fNeutralParticlesArray):0x0), fChargedParticlesArray(g.fChargedParticlesArray?new TArrayI(*g.fChargedParticlesArray):0x0), fStatusArray(g.fStatusArray?new TArrayI(*g.fStatusArray):0x0), - fKeepAllStatus(g.fKeepAllStatus), fClonesArrayType(g.fClonesArrayType), - fCheckOverlap(g.fCheckOverlap), + fKeepAllStatus(g.fKeepAllStatus), fCheckOverlap(g.fCheckOverlap), fEMCALOverlapAngle( g.fEMCALOverlapAngle), fPHOSOverlapAngle(g.fPHOSOverlapAngle), fIndex2ndPhoton(g.fIndex2ndPhoton) { @@ -88,7 +88,6 @@ AliCaloTrackMCReader & AliCaloTrackMCReader::operator = (const AliCaloTrackMCRea fStatusArray = source.fStatusArray?new TArrayI(*source.fStatusArray):0x0; fKeepAllStatus = source.fKeepAllStatus ; - fClonesArrayType = source.fClonesArrayType ; return *this; @@ -135,7 +134,6 @@ void AliCaloTrackMCReader::InitParameters() fStatusArray->SetAt(1,0); fKeepAllStatus = kTRUE; - fClonesArrayType = kAliAOD ; fCheckOverlap = kFALSE; fEMCALOverlapAngle = 2.5 * TMath::DegToRad(); @@ -186,159 +184,139 @@ void AliCaloTrackMCReader::CheckOverlap(const Float_t anglethres, const Int_t i //____________________________________________________________________________ void AliCaloTrackMCReader::FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum, - Int_t &indexPHOS, Int_t &indexEMCAL) { - //Fill AODCaloClusters or TParticles lists of PHOS or EMCAL - //In PHOS - if(fFillPHOS && fFidutialCut->IsInFidutialCut(momentum,"PHOS") && momentum.Pt() > fPHOSPtMin){ - - if(fClonesArrayType == kTParticle) new((*fAODPHOS)[indexPHOS++]) TParticle(*particle) ; - else{ - Int_t index = iParticle ; - Int_t pdg = TMath::Abs(particle->GetPdgCode()); - if(fCheckOverlap) - CheckOverlap(fPHOSOverlapAngle,particle->GetFirstMother(),index, iParticle, momentum, pdg); - - Char_t ttype= AliAODCluster::kPHOSNeutral; - Int_t labels[] = {index}; - Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; - AliAODCaloCluster *calo = new((*fAODPHOS)[indexPHOS++]) - AliAODCaloCluster(index,1,labels,momentum.E(), x, NULL, ttype, 0); - - SetCaloClusterPID(pdg,calo) ; - if(fDebug > 3 && momentum.Pt() > 0.2) - printf("Fill MC PHOS :: Selected tracks %s E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - particle->GetName(),momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - } - } - //In EMCAL - else if(fFillEMCAL && fFidutialCut->IsInFidutialCut(momentum,"EMCAL") && momentum.Pt() > fEMCALPtMin){ - if(fClonesArrayType == kTParticle) new((*fAODEMCAL)[indexEMCAL++]) TParticle(*particle) ; - else{ - Int_t index = iParticle ; - Int_t pdg = TMath::Abs(particle->GetPdgCode()); - //Int_t pdgorg=pdg; - if(fCheckOverlap) - CheckOverlap(fEMCALOverlapAngle,particle->GetFirstMother(),iParticle, index, momentum, pdg); - - Char_t ttype= AliAODCluster::kEMCALClusterv1; - Int_t labels[] = {index}; - Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; - AliAODCaloCluster *calo = new((*fAODEMCAL)[indexEMCAL++]) - AliAODCaloCluster(iParticle,1,labels,momentum.E(), x, NULL, ttype, 0); - - SetCaloClusterPID(pdg,calo) ; - if(fDebug > 3 && momentum.Pt() > 0.2) - printf("Fill MC EMCAL :: Selected tracks %s E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - particle->GetName(),momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - } - } + Int_t &ncalo) { + //Fill AODCaloClusters or TParticles lists of PHOS or EMCAL + //In PHOS + if(fFillPHOS && fFidutialCut->IsInFidutialCut(momentum,"PHOS") && momentum.Pt() > fPHOSPtMin){ + Int_t index = iParticle ; + Int_t pdg = TMath::Abs(particle->GetPdgCode()); + if(fCheckOverlap) + CheckOverlap(fPHOSOverlapAngle,particle->GetFirstMother(),index, iParticle, momentum, pdg); + + Char_t ttype= AliAODCluster::kPHOSNeutral; + Int_t labels[] = {index}; + Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; + //Create object and write it to file + AliAODCaloCluster *calo = new((*(fOutputEvent->GetCaloClusters()))[ncalo++]) + AliAODCaloCluster(index,1,labels,momentum.E(), x, NULL, ttype, 0); + + SetCaloClusterPID(pdg,calo) ; + if(fDebug > 3 && momentum.Pt() > 0.2) + printf("Fill MC PHOS :: Selected tracks %s E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + particle->GetName(),momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + fAODPHOS->Add(calo);//reference the selected object to the list + } + //In EMCAL + else if(fFillEMCAL && fFidutialCut->IsInFidutialCut(momentum,"EMCAL") && momentum.Pt() > fEMCALPtMin){ + Int_t index = iParticle ; + Int_t pdg = TMath::Abs(particle->GetPdgCode()); + //Int_t pdgorg=pdg; + if(fCheckOverlap) + CheckOverlap(fEMCALOverlapAngle,particle->GetFirstMother(),iParticle, index, momentum, pdg); + + Char_t ttype= AliAODCluster::kEMCALClusterv1; + Int_t labels[] = {index}; + Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; + //Create object and write it to file + AliAODCaloCluster *calo = new((*(fOutputEvent->GetCaloClusters()))[ncalo++]) + AliAODCaloCluster(iParticle,1,labels,momentum.E(), x, NULL, ttype, 0); + + SetCaloClusterPID(pdg,calo) ; + if(fDebug > 3 && momentum.Pt() > 0.2) + printf("Fill MC EMCAL :: Selected tracks %s E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + particle->GetName(),momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + fAODEMCAL->Add(calo);//reference the selected object to the list + } } //____________________________________________________________________________ void AliCaloTrackMCReader::FillInputEvent(Int_t iEntry){ - //Fill the event counter and input lists that are needed, called by the analysis maker. + //Fill the event counter and input lists that are needed, called by the analysis maker. + + fEventNumber = iEntry; + Int_t iParticle = 0 ; + Double_t charge = 0.; + Int_t ncalo = (fOutputEvent->GetCaloClusters())->GetEntriesFast(); + Int_t ntrack = (fOutputEvent->GetTracks())->GetEntriesFast(); - fEventNumber = iEntry; + for (iParticle = 0 ; iParticle < GetStack()->GetNtrack() ; iParticle++) { + TParticle * particle = GetStack()->Particle(iParticle); + TLorentzVector momentum; + Float_t p[3]; + Float_t x[3]; + Int_t pdg = particle->GetPdgCode(); + + //Keep particles with a given status + if(KeepParticleWithStatus(particle->GetStatusCode()) && (particle->Pt() > 0) ){ + + //Skip bizarre particles, they crash when charge is calculated + // if(TMath::Abs(pdg) == 3124 || TMath::Abs(pdg) > 10000000) continue ; + + charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge(); + particle->Momentum(momentum); + //---------- Charged particles ---------------------- + if((charge != 0) && (momentum.Pt() > fCTSPtMin) && (fFidutialCut->IsInFidutialCut(momentum,"CTS"))){ + if(fFillCTS){ + //Particles in CTS acceptance + if(fDebug > 3 && momentum.Pt() > 0.2) + printf("Fill MC CTS :: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", + momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); + + x[0] = particle->Vx(); x[1] = particle->Vy(); x[2] = particle->Vz(); + p[0] = particle->Px(); p[1] = particle->Py(); p[2] = particle->Pz(); + //Create object and write it to file + AliAODTrack *aodTrack = new((*(fOutputEvent->GetTracks()))[ntrack++]) + AliAODTrack(0, iParticle, p, kTRUE, x, kFALSE,NULL, 0, 0, + NULL, + 0x0,//primary, + kFALSE, // No fit performed + kFALSE, // No fit performed + AliAODTrack::kPrimary, + 0); + SetTrackChargeAndPID(pdg, aodTrack); + fAODCTS->Add(aodTrack);//reference the selected object to the list + } + //Keep some charged particles in calorimeters lists + if((fFillPHOS || fFillEMCAL) && KeepChargedParticles(pdg)) FillCalorimeters(iParticle, particle, momentum, ncalo); - if(fClonesArrayType == kTParticle){ - fAODCTS = new TClonesArray("TParticle",0); - fAODEMCAL = new TClonesArray("TParticle",0); - fAODPHOS = new TClonesArray("TParticle",0); + }//Charged + + //-------------Neutral particles ---------------------- + else if(charge == 0 && (fFillPHOS || fFillEMCAL)){ + //Skip neutrinos or other neutral particles + //if(SkipNeutralParticles(pdg) || particle->IsPrimary()) continue ; // protection added (MG) + if(SkipNeutralParticles(pdg)) continue ; + //Fill particle/calocluster arrays + if(!fDecayPi0) { + FillCalorimeters(iParticle, particle, momentum, ncalo); } - else if(fClonesArrayType == kAliAOD){ - fAODCTS = new TClonesArray("AliAODTrack",0); - fAODPHOS = new TClonesArray("AliAODCaloCluster",0); - fAODEMCAL = new TClonesArray("AliAODCaloCluster",0); + else { + //Sometimes pi0 are stable for the generator, if needed decay it by hand + if(pdg == 111 ){ + if(momentum.Pt() > fPHOSPtMin || momentum.Pt() > fEMCALPtMin){ + TLorentzVector lvGamma1, lvGamma2 ; + //Double_t angle = 0; + + //Decay + MakePi0Decay(momentum,lvGamma1,lvGamma2);//,angle); + + //Check if Pi0 is in the acceptance of the calorimeters, if aperture angle is small, keep it + TParticle * pPhoton1 = new TParticle(22,1,iParticle,0,0,0,lvGamma1.Px(),lvGamma1.Py(), + lvGamma1.Pz(),lvGamma1.E(),0,0,0,0); + TParticle * pPhoton2 = new TParticle(22,1,iParticle,0,0,0,lvGamma2.Px(),lvGamma2.Py(), + lvGamma2.Pz(),lvGamma2.E(),0,0,0,0); + //Fill particle/calocluster arrays + FillCalorimeters(iParticle,pPhoton1,lvGamma1, ncalo); + FillCalorimeters(iParticle,pPhoton2,lvGamma2, ncalo); + }//pt cut + }//pi0 + else FillCalorimeters(iParticle,particle, momentum, ncalo); //Add the rest } - else {AliFatal("Wrong clones type");} - - - Int_t indexCh = 0 ; - Int_t indexEMCAL = 0 ; - Int_t indexPHOS = 0 ; - - Int_t iParticle = 0 ; - Double_t charge = 0.; - - for (iParticle = 0 ; iParticle < GetStack()->GetNtrack() ; iParticle++) { - TParticle * particle = GetStack()->Particle(iParticle); - TLorentzVector momentum; - Float_t p[3]; - Float_t x[3]; - Int_t pdg = particle->GetPdgCode(); - - //Keep particles with a given status - if(KeepParticleWithStatus(particle->GetStatusCode()) && (particle->Pt() > 0) ){ - - //Skip bizarre particles, they crash when charge is calculated - // if(TMath::Abs(pdg) == 3124 || TMath::Abs(pdg) > 10000000) continue ; - - charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge(); - particle->Momentum(momentum); - //---------- Charged particles ---------------------- - if((charge != 0) && (momentum.Pt() > fCTSPtMin) && (fFidutialCut->IsInFidutialCut(momentum,"CTS"))){ - if(fFillCTS){ - //Particles in CTS acceptance - if(fDebug > 3 && momentum.Pt() > 0.2) - printf("Fill MC CTS :: Selected tracks E %3.2f, pt %3.2f, phi %3.2f, eta %3.2f\n", - momentum.E(),momentum.Pt(),momentum.Phi()*TMath::RadToDeg(),momentum.Eta()); - - if(fClonesArrayType == kTParticle) new((*fAODCTS)[indexCh++]) TParticle(*particle) ; - else{ - x[0] = particle->Vx(); x[1] = particle->Vy(); x[2] = particle->Vz(); - p[0] = particle->Px(); p[1] = particle->Py(); p[2] = particle->Pz(); - AliAODTrack *aodTrack = new((*fAODCTS)[indexCh++]) - AliAODTrack(0, iParticle, p, kTRUE, x, kFALSE,NULL, 0, 0, - NULL, - 0x0,//primary, - kFALSE, // No fit performed - kFALSE, // No fit performed - AliAODTrack::kPrimary, - 0); - SetTrackChargeAndPID(pdg, aodTrack); - } - } - //Keep some charged particles in calorimeters lists - if((fFillPHOS || fFillEMCAL) && KeepChargedParticles(pdg)) FillCalorimeters(iParticle, particle, momentum, indexPHOS, indexEMCAL); - - }//Charged - - //-------------Neutral particles ---------------------- - else if(charge == 0 && (fFillPHOS || fFillEMCAL)){ - //Skip neutrinos or other neutral particles - //if(SkipNeutralParticles(pdg) || particle->IsPrimary()) continue ; // protection added (MG) - if(SkipNeutralParticles(pdg)) continue ; - //Fill particle/calocluster arrays - if(!fDecayPi0) { - FillCalorimeters(iParticle, particle, momentum, indexPHOS, indexEMCAL); - } - else { - //Sometimes pi0 are stable for the generator, if needed decay it by hand - if(pdg == 111 ){ - if(momentum.Pt() > fPHOSPtMin || momentum.Pt() > fEMCALPtMin){ - TLorentzVector lvGamma1, lvGamma2 ; - //Double_t angle = 0; - - //Decay - MakePi0Decay(momentum,lvGamma1,lvGamma2);//,angle); - - //Check if Pi0 is in the acceptance of the calorimeters, if aperture angle is small, keep it - TParticle * pPhoton1 = new TParticle(22,1,iParticle,0,0,0,lvGamma1.Px(),lvGamma1.Py(), - lvGamma1.Pz(),lvGamma1.E(),0,0,0,0); - TParticle * pPhoton2 = new TParticle(22,1,iParticle,0,0,0,lvGamma2.Px(),lvGamma2.Py(), - lvGamma2.Pz(),lvGamma2.E(),0,0,0,0); - //Fill particle/calocluster arrays - FillCalorimeters(iParticle,pPhoton1,lvGamma1, indexPHOS, indexEMCAL); - FillCalorimeters(iParticle,pPhoton2,lvGamma2, indexPHOS, indexEMCAL); - }//pt cut - }//pi0 - else FillCalorimeters(iParticle,particle, momentum, indexPHOS, indexEMCAL); //Add the rest - } - }//neutral particles - } //particle with correct status - }//particle loop - - fIndex2ndPhoton = -1; //In case of overlapping studies, reset for each event + }//neutral particles + } //particle with correct status + }//particle loop + + fIndex2ndPhoton = -1; //In case of overlapping studies, reset for each event } //________________________________________________________________ @@ -378,7 +356,6 @@ void AliCaloTrackMCReader::Print(const Option_t * opt) const Info("**** Print **** ", "%s %s", GetName(), GetTitle() ) ; printf("Decay Pi0? : %d\n", fDecayPi0) ; - printf("TClonesArray type : %d\n", fClonesArrayType) ; printf("Check Overlap in Calo? : %d\n", fCheckOverlap) ; printf("Keep all status? : %d\n", fKeepAllStatus) ; @@ -441,10 +418,10 @@ void AliCaloTrackMCReader::MakePi0Decay(TLorentzVector &p0, TLorentzVector &p1, } //____________________________________________________________________________ -void AliCaloTrackMCReader::SetInputEvent(TObject* /*esd*/, TObject* aod, TObject* mc) { +void AliCaloTrackMCReader::SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* aod, AliMCEvent* mc) { // Connect the data pointer - SetMC((AliMCEvent*) mc); - SetAOD((AliAODEvent*) aod); + SetMC(mc); + SetOutputEvent(aod); } diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.h b/PWG4/PartCorrBase/AliCaloTrackMCReader.h index 6e76e6b60a3..d0bca55bed5 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.h @@ -11,11 +11,16 @@ //-- Author: Gustavo Conesa (INFN-LNF) // --- ROOT system --- +class TArrayI ; +class TParticle ; // --- AliRoot system --- #include "AliCaloTrackReader.h" class AliAODCaloCluster ; class AliAODTrack ; +class AliAODEvent ; +class AliMCEvent ; +class AliVEvent ; class AliCaloTrackMCReader : public AliCaloTrackReader { @@ -25,9 +30,7 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { AliCaloTrackMCReader(const AliCaloTrackMCReader & g) ; // cpy ctor AliCaloTrackMCReader & operator = (const AliCaloTrackMCReader & g) ;//cpy assignment virtual ~AliCaloTrackMCReader() ;//virtual dtor - - enum clonesType {kTParticle, kAliAOD}; - + void InitParameters(); void Print(const Option_t * opt) const; @@ -36,9 +39,6 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { void SwitchOffPi0Decay() { fDecayPi0 = kFALSE ; } Int_t IsPi0DecaySwitchedOn() const { return fDecayPi0 ; } - void SetClonesArrayType(Int_t type){fClonesArrayType = type ;} - Bool_t GetClonesArrayType() const {return fClonesArrayType ;} - void AddNeutralParticlesArray(TArrayI & array) { fNeutralParticlesArray = new TArrayI(array) ; } TArrayI * GetNeutralParticlesArray() const {return fNeutralParticlesArray;} @@ -60,8 +60,8 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { void GetVertex(Double_t v[3]) const ; void FillInputEvent(Int_t iEntry) ; - AliVEvent* GetInputEvent() const {return GetMC();} - void SetInputEvent(TObject* esd, TObject* aod, TObject* mc) ; + AliVEvent* GetInputEvent() const {return (AliVEvent *) GetMC();} + void SetInputOutputMCEvent(AliVEvent* esd, AliAODEvent* aod, AliMCEvent* mc) ; void SetCaloClusterPID(const Int_t pdgCode, AliAODCaloCluster *calo) const ; void SetTrackChargeAndPID(const Int_t pdgCode, AliAODTrack *track) const ; @@ -79,22 +79,21 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { void CheckOverlap(const Float_t anglethres, const Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg); void MakePi0Decay(TLorentzVector &p0, TLorentzVector &p1, TLorentzVector &p2) const ;//, Double_t &angle); void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum, - Int_t &indexPHOS, Int_t &indexEMCAL) ; + Int_t &naod) ; private: - Bool_t fDecayPi0; //If not decayed, decay pi0 by hand - TArrayI * fNeutralParticlesArray ; //Do not keep neutral particles of this list in calorimeter. - TArrayI * fChargedParticlesArray ; //Keep charged particles of this list in calorimeter. - TArrayI * fStatusArray ; //Keep particles with status of the list. - Bool_t fKeepAllStatus ; //Do or do not select particles depending on their status code. - Int_t fClonesArrayType; //Analysis with TParticles or AliAODCaloCluster/Track? - Bool_t fCheckOverlap; //Check of overlapped photons from pi0 enter the calorimeter - Float_t fEMCALOverlapAngle; //Aperture angle of photons from decay that is not resolved by EMCAL, in radians - Float_t fPHOSOverlapAngle; //Aperture angle of photons from decay that is not resolved by PHOS, in radians - Int_t fIndex2ndPhoton; //Check overlap of first decay photon already done, internal use. + Bool_t fDecayPi0 ; // If not decayed, decay pi0 by hand + TArrayI * fNeutralParticlesArray ; // Do not keep neutral particles of this list in calorimeter. + TArrayI * fChargedParticlesArray ; // Keep charged particles of this list in calorimeter. + TArrayI * fStatusArray ; // Keep particles with status of the list. + Bool_t fKeepAllStatus ; // Do or do not select particles depending on their status code. + Bool_t fCheckOverlap; // Check of overlapped photons from pi0 enter the calorimeter + Float_t fEMCALOverlapAngle; // Aperture angle of photons from decay that is not resolved by EMCAL, in radians + Float_t fPHOSOverlapAngle; // Aperture angle of photons from decay that is not resolved by PHOS, in radians + Int_t fIndex2ndPhoton; // Check overlap of first decay photon already done, internal use. - ClassDef(AliCaloTrackMCReader,2) - } ; + ClassDef(AliCaloTrackMCReader,3) +} ; #endif //ALICALOTRACKMCREADER_H diff --git a/PWG4/PartCorrBase/AliCaloTrackReader.cxx b/PWG4/PartCorrBase/AliCaloTrackReader.cxx index a61d8caa5a2..44ede348d18 100755 --- a/PWG4/PartCorrBase/AliCaloTrackReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackReader.cxx @@ -18,25 +18,22 @@ // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and // Central Barrel Tracking detectors (CTS). // Not all MC particles/tracks/clusters are kept, some kinematical/fidutial restrictions are done. -// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS) -// : AliCaloTrackMCReader: Fills Kinematics data in 3 TClonesArrays (PHOS, EMCAL, CTS) -// : AliCaloTrackAODReader: Fills AOD data in 3 TClonesArrays (PHOS, EMCAL, CTS) +// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TRefArrays (PHOS, EMCAL, CTS) +// : AliCaloTrackMCReader: Fills Kinematics data in 3 TRefArrays (PHOS, EMCAL, CTS) +// : AliCaloTrackAODReader: Fills AOD data in 3 TRefArrays (PHOS, EMCAL, CTS) // //-- Author: Gustavo Conesa (LNF-INFN) ////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- -#include -#include -#include +#include //---- ANALYSIS system ---- #include "AliCaloTrackReader.h" -#include "AliLog.h" -#include "AliStack.h" -#include "AliHeader.h" -#include "AliGenEventHeader.h" +#include "AliFidutialCut.h" +#include "AliAODEvent.h" +#include "AliMCEvent.h" ClassImp(AliCaloTrackReader) @@ -44,11 +41,11 @@ ClassImp(AliCaloTrackReader) //____________________________________________________________________________ AliCaloTrackReader::AliCaloTrackReader() : TObject(), fEventNumber(-1), fDataType(0), fDebug(0), - fFidutialCut(0x0), + fFidutialCut(0x0), fCTSPtMin(0), fEMCALPtMin(0),fPHOSPtMin(0), - fAODCTS(0x0), fAODEMCAL(0x0), fAODPHOS(0x0), + fAODCTS(new TRefArray()), fAODEMCAL(new TRefArray()), fAODPHOS(new TRefArray()), fEMCALCells(0x0), fPHOSCells(0x0), - fESD(0x0), fAOD(0x0),fMC(0x0), + fInputEvent(0x0), fOutputEvent(0x0),fMC(0x0), fFillCTS(0),fFillEMCAL(0),fFillPHOS(0), fFillEMCALCells(0),fFillPHOSCells(0) { @@ -63,12 +60,12 @@ AliCaloTrackReader::AliCaloTrackReader(const AliCaloTrackReader & g) : TObject(g), fEventNumber(g.fEventNumber), fDataType(g.fDataType), fDebug(g.fDebug), fFidutialCut(g.fFidutialCut), fCTSPtMin(g.fCTSPtMin), fEMCALPtMin(g.fEMCALPtMin),fPHOSPtMin(g.fPHOSPtMin), - fAODCTS(new TClonesArray(*g.fAODCTS)), - fAODEMCAL(new TClonesArray(*g.fAODEMCAL)), - fAODPHOS(new TClonesArray(*g.fAODPHOS)), + fAODCTS(new TRefArray(*g.fAODCTS)), + fAODEMCAL(new TRefArray(*g.fAODEMCAL)), + fAODPHOS(new TRefArray(*g.fAODPHOS)), fEMCALCells(new TNamed(*g.fEMCALCells)), fPHOSCells(new TNamed(*g.fPHOSCells)), - fESD(g.fESD), fAOD(g.fAOD), fMC(g.fMC), + fInputEvent(g.fInputEvent), fOutputEvent(g.fOutputEvent), fMC(g.fMC), fFillCTS(g.fFillCTS),fFillEMCAL(g.fFillEMCAL),fFillPHOS(g.fFillPHOS), fFillEMCALCells(g.fFillEMCALCells),fFillPHOSCells(g.fFillPHOSCells) { @@ -92,15 +89,15 @@ AliCaloTrackReader & AliCaloTrackReader::operator = (const AliCaloTrackReader & fEMCALPtMin = source.fEMCALPtMin ; fPHOSPtMin = source.fPHOSPtMin ; - fAODCTS = new TClonesArray(*source.fAODCTS) ; - fAODEMCAL = new TClonesArray(*source.fAODEMCAL) ; - fAODPHOS = new TClonesArray(*source.fAODPHOS) ; + fAODCTS = new TRefArray(*source.fAODCTS) ; + fAODEMCAL = new TRefArray(*source.fAODEMCAL) ; + fAODPHOS = new TRefArray(*source.fAODPHOS) ; fEMCALCells = new TNamed(*source.fEMCALCells) ; fPHOSCells = new TNamed(*source.fPHOSCells) ; - fESD = source.fESD; - fAOD = source.fAOD; - fMC = source.fMC; + fInputEvent = source.fInputEvent; + fOutputEvent = source.fOutputEvent; + fMC = source.fMC; fFillCTS = source.fFillCTS; fFillEMCAL = source.fFillEMCAL; @@ -143,18 +140,19 @@ AliCaloTrackReader::~AliCaloTrackReader() { delete fPHOSCells ; } - if(fESD) delete fESD ; - if(fAOD) delete fAOD ; - if(fMC) delete fMC ; + if(fInputEvent) delete fInputEvent ; + if(fOutputEvent) delete fOutputEvent ; + if(fMC) delete fMC ; } + //____________________________________________________________________________ AliStack* AliCaloTrackReader::GetStack() const { //Return pointer to stack if(fMC) return fMC->Stack(); else{ - printf("stack is not available"); + if(fDebug > 1) printf("AliCaloTrackReader::GetStack() - Stack is not available\n"); return 0x0 ; } } @@ -165,7 +163,7 @@ AliHeader* AliCaloTrackReader::GetHeader() const { if(fMC) return fMC->Header(); else{ - printf("Header is not available\n"); + printf("AliCaloTrackReader::Header is not available\n"); return 0x0 ; } } @@ -175,7 +173,7 @@ AliGenEventHeader* AliCaloTrackReader::GetGenEventHeader() const { if(fMC) return fMC->GenEventHeader(); else{ - printf("GenEventHeader is not available\n"); + printf("AliCaloTrackReader::GenEventHeader is not available\n"); return 0x0 ; } } @@ -228,11 +226,15 @@ void AliCaloTrackReader::FillInputEvent(Int_t iEntry) { //Fill the event counter and input lists that are needed, called by the analysis maker. fEventNumber = iEntry; - if(fFillCTS) FillInputCTS(); + if((fDataType != kAOD) && ((fOutputEvent->GetCaloClusters())->GetEntriesFast()!=0 ||(fOutputEvent->GetTracks())->GetEntriesFast()!=0)){ + printf("ABORT: AliCaloTrackReader::AODCaloClusters or AODTracks already filled by the filter, do not use the ESD reader, use the AOD reader\n"); + abort(); + } + if(fFillCTS) FillInputCTS(); if(fFillEMCAL) FillInputEMCAL(); - if(fFillPHOS) FillInputPHOS(); + if(fFillPHOS) FillInputPHOS(); if(fFillEMCALCells) FillInputEMCALCells(); - if(fFillPHOSCells) FillInputPHOSCells(); + if(fFillPHOSCells) FillInputPHOSCells(); } @@ -240,10 +242,10 @@ void AliCaloTrackReader::FillInputEvent(Int_t iEntry) { void AliCaloTrackReader::ResetLists() { // Reset lists, called by the analysis maker - if(fAODCTS) fAODCTS -> Clear(); + if(fAODCTS) fAODCTS -> Clear(); if(fAODEMCAL) fAODEMCAL -> Clear(); - if(fAODPHOS) fAODPHOS -> Clear(); + if(fAODPHOS) fAODPHOS -> Clear(); if(fEMCALCells) fEMCALCells -> Clear(); - if(fPHOSCells) fPHOSCells -> Clear(); + if(fPHOSCells) fPHOSCells -> Clear(); } diff --git a/PWG4/PartCorrBase/AliCaloTrackReader.h b/PWG4/PartCorrBase/AliCaloTrackReader.h index 5bcf7367980..a81a48d11ed 100755 --- a/PWG4/PartCorrBase/AliCaloTrackReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackReader.h @@ -8,33 +8,33 @@ // Base class for reading data: MonteCarlo, ESD or AOD, of PHOS EMCAL and // Central Barrel Tracking detectors. // Not all MC particles/tracks/clusters are kept, some kinematical restrictions are done. -// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TClonesArrays (PHOS, EMCAL, CTS) -// : AliCaloTrackMCReader: Fills Kinematics data in 3 TClonesArrays (PHOS, EMCAL, CTS) -// : AliCaloTrackAODReader: Fills AOD data in 3 TClonesArrays (PHOS, EMCAL, CTS) +// Mother class of : AliCaloTrackESDReader: Fills ESD data in 3 TRefArrays (PHOS, EMCAL, CTS) +// : AliCaloTrackMCReader: Fills Kinematics data in 3 TRefArrays (PHOS, EMCAL, CTS) +// : AliCaloTrackAODReader: Fills AOD data in 3 TRefArrays (PHOS, EMCAL, CTS) // // -- Author: Gustavo Conesa (INFN-LNF) // --- ROOT system --- #include "TObject.h" -class TClonesArray ; +class TRefArray ; class TLorentzVector ; class TString ; -#include "TArrayF.h" +class TRefArray; +class TArrayF; //--- ANALYSIS system --- class AliStack ; class AliHeader ; class AliGenEventHeader ; -#include "AliESDEvent.h" -#include "AliAODEvent.h" -#include "AliMCEvent.h" -class AliLog ; -#include "AliFidutialCut.h" +class AliVEvent; +class AliAODEvent; +class AliMCEvent; +class AliFidutialCut; class AliCaloTrackReader : public TObject { -public: - + public: + AliCaloTrackReader() ; // ctor AliCaloTrackReader(const AliCaloTrackReader & g) ; // cpy ctor AliCaloTrackReader & operator = (const AliCaloTrackReader & g) ;//cpy assignment @@ -90,50 +90,49 @@ public: virtual void FillInputEMCALCells() {;} virtual void FillInputPHOSCells() {;} - virtual TClonesArray* GetAODCTS() const {return fAODCTS ;} - virtual TClonesArray* GetAODEMCAL() const {return fAODEMCAL ;} - virtual TClonesArray* GetAODPHOS() const {return fAODPHOS ;} - virtual TNamed* GetEMCALCells() const {return fEMCALCells ;} - virtual TNamed* GetPHOSCells() const {return fPHOSCells ;} + virtual TRefArray* GetAODCTS() const {return fAODCTS ;} + virtual TRefArray* GetAODEMCAL() const {return fAODEMCAL ;} + virtual TRefArray* GetAODPHOS() const {return fAODPHOS ;} + virtual TNamed* GetEMCALCells() const {return fEMCALCells ;} + virtual TNamed* GetPHOSCells() const {return fPHOSCells ;} - virtual AliStack* GetStack() const ; - virtual AliHeader* GetHeader() const ; + virtual AliStack* GetStack() const ; + virtual AliHeader* GetHeader() const ; virtual AliGenEventHeader* GetGenEventHeader() const ; - virtual AliESDEvent* GetESD() const {return fESD;} - virtual AliAODEvent* GetAOD() const {return fAOD;} - virtual AliMCEvent* GetMC() const {return fMC;} - virtual AliVEvent* GetInputEvent() const {return (new AliESDEvent());} + virtual AliVEvent* GetInputEvent() const {return fInputEvent;} + virtual AliAODEvent* GetOutputEvent() const {return fOutputEvent;} + virtual AliMCEvent* GetMC() const {return fMC;} virtual void GetVertex(Double_t * ) const {;} - virtual void SetESD( AliESDEvent* esd) {fESD = esd;} - virtual void SetAOD(AliAODEvent* aod) {fAOD = aod;} - virtual void SetMC(AliMCEvent* mc) {fMC = mc;} + virtual void SetInputEvent(AliVEvent* input) {fInputEvent = input;} + virtual void SetOutputEvent(AliAODEvent* aod) {fOutputEvent = aod;} + virtual void SetMC(AliMCEvent* mc) {fMC = mc;} virtual void ResetLists(); virtual AliFidutialCut * GetFidutialCut() const {return fFidutialCut ;} virtual void SetFidutialCut(AliFidutialCut * fc) { fFidutialCut = fc ;} - virtual void SetInputEvent(TObject* /*esd*/, TObject* /*aod*/, TObject* /*mc*/) {;} + virtual void SetInputOutputMCEvent(AliVEvent* /*esd*/, AliAODEvent* /*aod*/, AliMCEvent* /*mc*/) {;} protected: - Int_t fEventNumber; // Event number + Int_t fEventNumber; // Event number Int_t fDataType ; // Select MC:Kinematics, Data:ESD/AOD, MCData:Both Int_t fDebug; // Debugging level AliFidutialCut * fFidutialCut; // Acceptance cuts - Float_t fCTSPtMin; // pT Threshold on charged particles + Float_t fCTSPtMin; // pT Threshold on charged particles Float_t fEMCALPtMin; // pT Threshold on emcal clusters - Float_t fPHOSPtMin; // pT Threshold on phos clusters + Float_t fPHOSPtMin; // pT Threshold on phos clusters - TClonesArray * fAODCTS ; //! temporal array with tracks - TClonesArray * fAODEMCAL ; //! temporal array with EMCAL CaloClusters - TClonesArray * fAODPHOS ; //! temporal array with PHOS CaloClusters + TRefArray * fAODCTS ; //! temporal referenced array with tracks + TRefArray * fAODEMCAL ; //! temporal referenced array with EMCAL CaloClusters + TRefArray * fAODPHOS ; //! temporal referenced array with PHOS CaloClusters TNamed * fEMCALCells ; //! temporal array with EMCAL CaloCells, ESD or AOD TNamed * fPHOSCells ; //! temporal array with PHOS CaloCells, ESD or AOD - AliESDEvent * fESD; //! pointer to esd - AliAODEvent * fAOD; //! pointer to aod + AliVEvent * fInputEvent; //! pointer to esd or aod input + AliAODEvent * fOutputEvent; //! pointer to aod output AliMCEvent * fMC; //! Monte Carlo Event Handler Bool_t fFillCTS; // use data from CTS @@ -142,7 +141,7 @@ public: Bool_t fFillEMCALCells; // use data from EMCAL Bool_t fFillPHOSCells; // use data from PHOS - ClassDef(AliCaloTrackReader,1) + ClassDef(AliCaloTrackReader,3) } ; diff --git a/PWG4/PartCorrBase/AliFidutialCut.cxx b/PWG4/PartCorrBase/AliFidutialCut.cxx index b6f73a9a800..fb725e75b52 100755 --- a/PWG4/PartCorrBase/AliFidutialCut.cxx +++ b/PWG4/PartCorrBase/AliFidutialCut.cxx @@ -29,7 +29,6 @@ //#include //---- ANALYSIS system ---- -#include "AliLog.h" #include "AliFidutialCut.h" ClassImp(AliFidutialCut) @@ -144,8 +143,8 @@ Bool_t AliFidutialCut::IsInFidutialCut(TLorentzVector momentum, TString det) con netaregions = fCTSFidCutMaxEta->GetSize(); nphiregions = fCTSFidCutMaxPhi->GetSize(); if(netaregions != fCTSFidCutMinEta->GetSize() || nphiregions != fCTSFidCutMinPhi->GetSize()) - AliFatal(Form("Wrong number of CTS fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", - netaregions, fCTSFidCutMinEta->GetSize(), nphiregions, fCTSFidCutMinPhi->GetSize())); + printf("AliFidutialCut::IsInFidutialCut() - Wrong number of CTS fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", + netaregions, fCTSFidCutMinEta->GetSize(), nphiregions, fCTSFidCutMinPhi->GetSize()); maxeta = fCTSFidCutMaxEta->GetArray(); maxphi = fCTSFidCutMaxPhi->GetArray(); @@ -157,8 +156,8 @@ Bool_t AliFidutialCut::IsInFidutialCut(TLorentzVector momentum, TString det) con netaregions = fEMCALFidCutMaxEta->GetSize(); nphiregions = fEMCALFidCutMaxPhi->GetSize(); if(netaregions != fEMCALFidCutMinEta->GetSize() || nphiregions != fEMCALFidCutMinPhi->GetSize()) - AliFatal(Form("Wrong number of EMCAL fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", - netaregions, fEMCALFidCutMinEta->GetSize(), nphiregions, fEMCALFidCutMinPhi->GetSize())); + printf("AliFidutialCut::IsInFidutialCut() - Wrong number of EMCAL fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", + netaregions, fEMCALFidCutMinEta->GetSize(), nphiregions, fEMCALFidCutMinPhi->GetSize()); maxeta = fEMCALFidCutMaxEta->GetArray(); maxphi = fEMCALFidCutMaxPhi->GetArray(); @@ -170,8 +169,8 @@ Bool_t AliFidutialCut::IsInFidutialCut(TLorentzVector momentum, TString det) con netaregions = fPHOSFidCutMaxEta->GetSize(); nphiregions = fPHOSFidCutMaxPhi->GetSize(); if(netaregions != fPHOSFidCutMinEta->GetSize() || nphiregions != fPHOSFidCutMinPhi->GetSize()) - AliFatal(Form("Wrong number of PHOS fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", - netaregions, fPHOSFidCutMinEta->GetSize(), nphiregions, fPHOSFidCutMinPhi->GetSize())); + printf("AliFidutialCut::IsInFidutialCut() - Wrong number of PHOS fidutial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d", + netaregions, fPHOSFidCutMinEta->GetSize(), nphiregions, fPHOSFidCutMinPhi->GetSize()); maxeta = fPHOSFidCutMaxEta->GetArray(); maxphi = fPHOSFidCutMaxPhi->GetArray(); @@ -180,7 +179,7 @@ Bool_t AliFidutialCut::IsInFidutialCut(TLorentzVector momentum, TString det) con selection = fPHOSFidutialCut ; } else - AliFatal(Form("Wrong detector name = %s", det.Data())); + printf("AliFidutialCut::IsInFidutialCut() - Wrong detector name = %s", det.Data()); //printf("IsInFidutialCut::nphiregions = %d, netaregions = %d\n",nphiregions, netaregions); diff --git a/PWG4/PartCorrBase/AliFidutialCut.h b/PWG4/PartCorrBase/AliFidutialCut.h index 881c5245705..da2719a502e 100755 --- a/PWG4/PartCorrBase/AliFidutialCut.h +++ b/PWG4/PartCorrBase/AliFidutialCut.h @@ -19,7 +19,6 @@ class TLorentzVector ; //--- AliRoot system --- -class AliLog ; class AliFidutialCut : public TObject { @@ -102,27 +101,26 @@ public: //Detector acceptance cuts Bool_t fEMCALFidutialCut ; // Apply fidutial cuts to EMCAL clusters - Bool_t fPHOSFidutialCut ;// Apply fidutial cuts to PHOS clusters - Bool_t fCTSFidutialCut ;//Apply fidutial cuts to CTS tracks - - TArrayF * fCTSFidCutMinEta ; //Take particles in CTS with eta > fCTSFidCutMinEta - TArrayF * fCTSFidCutMinPhi ; //Take particles in CTS with phi > fCTSFidCutMinPhi - TArrayF * fCTSFidCutMaxEta ; //Take particles in CTS with eta < fCTSFidCutMaxEta - TArrayF * fCTSFidCutMaxPhi ; //Take particles in CTS with phi > fCTSFidCutMaxPhi - - TArrayF * fEMCALFidCutMinEta ; //Take particles in EMCAL with eta > fEMCALFidCutMinEta - TArrayF * fEMCALFidCutMinPhi ; //Take particles in EMCAL with phi > fEMCALFidCutMinPhi - TArrayF * fEMCALFidCutMaxEta ; //Take particles in EMCAL with eta < fEMCALFidCutMaxEta - TArrayF * fEMCALFidCutMaxPhi ; //Take particles in EMCAL with phi > fEMCALFidCutMaxPhi - - TArrayF * fPHOSFidCutMinEta ; //Take particles in PHOS with eta > fPHOSFidCutMinEta - TArrayF * fPHOSFidCutMinPhi ; //Take particles in PHOS with phi > fPHOSFidCutMinPhi - TArrayF * fPHOSFidCutMaxEta ; //Take particles in PHOS with eta < fPHOSFidCutMaxEta - TArrayF * fPHOSFidCutMaxPhi ; //Take particles in PHOS with phi > fPHOSFidCutMaxPhi - + Bool_t fPHOSFidutialCut ;// Apply fidutial cuts to PHOS clusters + Bool_t fCTSFidutialCut ;//Apply fidutial cuts to CTS tracks + + TArrayF * fCTSFidCutMinEta ; //Take particles in CTS with eta > fCTSFidCutMinEta + TArrayF * fCTSFidCutMinPhi ; //Take particles in CTS with phi > fCTSFidCutMinPhi + TArrayF * fCTSFidCutMaxEta ; //Take particles in CTS with eta < fCTSFidCutMaxEta + TArrayF * fCTSFidCutMaxPhi ; //Take particles in CTS with phi > fCTSFidCutMaxPhi + + TArrayF * fEMCALFidCutMinEta ; //Take particles in EMCAL with eta > fEMCALFidCutMinEta + TArrayF * fEMCALFidCutMinPhi ; //Take particles in EMCAL with phi > fEMCALFidCutMinPhi + TArrayF * fEMCALFidCutMaxEta ; //Take particles in EMCAL with eta < fEMCALFidCutMaxEta + TArrayF * fEMCALFidCutMaxPhi ; //Take particles in EMCAL with phi > fEMCALFidCutMaxPhi + + TArrayF * fPHOSFidCutMinEta ; //Take particles in PHOS with eta > fPHOSFidCutMinEta + TArrayF * fPHOSFidCutMinPhi ; //Take particles in PHOS with phi > fPHOSFidCutMinPhi + TArrayF * fPHOSFidCutMaxEta ; //Take particles in PHOS with eta < fPHOSFidCutMaxEta + TArrayF * fPHOSFidCutMaxPhi ; //Take particles in PHOS with phi > fPHOSFidCutMaxPhi ClassDef(AliFidutialCut,1) -} ; + } ; #endif //ALIFIDUTIALCUT_H diff --git a/PWG4/PartCorrBase/AliIsolationCut.cxx b/PWG4/PartCorrBase/AliIsolationCut.cxx index 51aa77b3cf5..aefbcf6a419 100755 --- a/PWG4/PartCorrBase/AliIsolationCut.cxx +++ b/PWG4/PartCorrBase/AliIsolationCut.cxx @@ -25,11 +25,10 @@ // --- ROOT system --- //#include #include -#include +#include // --- AliRoot system --- #include "AliIsolationCut.h" -class AliLog ; #include "AliAODPWG4ParticleCorrelation.h" #include "AliAODTrack.h" #include "AliAODCaloCluster.h" @@ -58,7 +57,7 @@ AliIsolationCut::AliIsolationCut(const AliIsolationCut & g) : fICMethod(g.fICMethod) { // cpy ctor - + } //_________________________________________________________________________ @@ -67,7 +66,7 @@ AliIsolationCut & AliIsolationCut::operator = (const AliIsolationCut & source) // assignment operator if(&source == this) return *this; - + fConeSize = source.fConeSize ; fPtThreshold = source.fPtThreshold ; fICMethod = source.fICMethod ; @@ -77,132 +76,144 @@ AliIsolationCut & AliIsolationCut::operator = (const AliIsolationCut & source) } - //____________________________________________________________________________ TString AliIsolationCut::GetICParametersList() { - //Put data member values in string to keep in output container - - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - - sprintf(onePar,"--- AliIsolationCut ---\n") ; - parList+=onePar ; - sprintf(onePar,"fConeSize: (isolation cone size) %1.2f\n",fConeSize) ; - parList+=onePar ; - sprintf(onePar,"fPtThreshold =%1.2f (isolation pt threshold) \n",fPtThreshold) ; - parList+=onePar ; - sprintf(onePar,"fPtFraction=%1.2f (isolation pt threshold fraction ) \n",fPtFraction) ; - parList+=onePar ; - sprintf(onePar,"fICMethod=%d (isolation cut case) \n",fICMethod) ; - parList+=onePar ; - - return parList; + //Put data member values in string to keep in output container + + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + + sprintf(onePar,"--- AliIsolationCut ---\n") ; + parList+=onePar ; + sprintf(onePar,"fConeSize: (isolation cone size) %1.2f\n",fConeSize) ; + parList+=onePar ; + sprintf(onePar,"fPtThreshold =%1.2f (isolation pt threshold) \n",fPtThreshold) ; + parList+=onePar ; + sprintf(onePar,"fPtFraction=%1.2f (isolation pt threshold fraction ) \n",fPtFraction) ; + parList+=onePar ; + sprintf(onePar,"fICMethod=%d (isolation cut case) \n",fICMethod) ; + parList+=onePar ; + + return parList; } //____________________________________________________________________________ void AliIsolationCut::InitParameters() { //Initialize the parameters of the analysis. - + fConeSize = 0.4 ; fPtThreshold = 1. ; fPtFraction = 0.1 ; - + fICMethod = kPtThresIC; // 0 pt threshol method, 1 cone pt sum method - + } //__________________________________________________________________ -void AliIsolationCut::MakeIsolationCut(TSeqCollection * plCTS, TSeqCollection * plNe, Double_t * vertex, +void AliIsolationCut::MakeIsolationCut(TRefArray * plCTS, TRefArray * plNe, Double_t * vertex, const Bool_t fillAOD, AliAODPWG4ParticleCorrelation *pCandidate, Int_t & n, Int_t & nfrac, Float_t &coneptsum, Bool_t &isolated) const { - //Search in cone around a candidate particle if it is isolated - Float_t phiC = pCandidate->Phi() ; - Float_t etaC = pCandidate->Eta() ; - Float_t ptC = pCandidate->Pt() ; - Float_t pt = -100. ; - Float_t eta = -100. ; - Float_t phi = -100. ; - Float_t rad = -100 ; - - n = 0 ; - coneptsum = 0.; - isolated = kFALSE; - - //Check charged particles in cone. - if(plCTS){ - TVector3 p3; - for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ ){ - AliAODTrack* track = (AliAODTrack *)(plCTS->At(ipr)) ; - //Do not count the candidate (pion, conversion photon) or the daughters of the candidate - if(track->GetID() == pCandidate->GetTrackLabel(0) || track->GetID() == pCandidate->GetTrackLabel(1)) continue ; - p3.SetXYZ(track->Px(),track->Py(),track->Pz()); - pt = p3.Pt(); - eta = p3.Eta(); - phi = p3.Phi() ; - if(phi<0) phi+=TMath::TwoPi(); - - //Check if there is any particle inside cone with pt larger than fPtThreshold - rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC)); - - if(rad < fConeSize){ - if(fillAOD) pCandidate->AddIsolationConeTrack(track); - //printf("charged in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); - coneptsum+=pt; - if(pt > fPtThreshold ) n++; - if(pt > fPtFraction*ptC ) nfrac++; - } - }// charged particle loop - }//Tracks - - //Check neutral particles in cone. - if(plNe){ - TLorentzVector mom ; - for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){ - AliAODCaloCluster * calo = (AliAODCaloCluster *)(plNe->At(ipr)) ; - - //Do not count the candidate (photon or pi0) or the daughters of the candidate - if(calo->GetID() == pCandidate->GetCaloLabel(0) || calo->GetID() == pCandidate->GetCaloLabel(1)) continue ; //Skip matched clusters with tracks - - if(calo->GetNTracksMatched() > 0) continue ; - - calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line - pt = mom.Pt(); - eta = mom.Eta(); - phi = mom.Phi() ; - if(phi<0) phi+=TMath::TwoPi(); - - //Check if there is any particle inside cone with pt larger than fPtThreshold - rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC)); - if(rad < fConeSize){ - if(fillAOD) pCandidate->AddIsolationConeCluster(calo); - //printf("neutral in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); - coneptsum+=pt; - if(pt > fPtThreshold ) n++; - if(pt > fPtFraction*ptC ) nfrac++; - }//in cone - }// neutral particle loop - }//neutrals - - //printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac); - - //Check isolation, depending on method. - if( fICMethod == kPtThresIC){ - if(n==0) isolated = kTRUE ; - } - else if( fICMethod == kSumPtIC){ - if(coneptsum < fPtThreshold) - isolated = kTRUE ; - } - else if( fICMethod == kPtFracIC){ - if(nfrac==0) isolated = kTRUE ; + //Search in cone around a candidate particle if it is isolated + Float_t phiC = pCandidate->Phi() ; + Float_t etaC = pCandidate->Eta() ; + Float_t ptC = pCandidate->Pt() ; + Float_t pt = -100. ; + Float_t eta = -100. ; + Float_t phi = -100. ; + Float_t rad = -100 ; + Bool_t first = kTRUE; + n = 0 ; + coneptsum = 0.; + isolated = kFALSE; + + //Check charged particles in cone. + if(plCTS){ + TVector3 p3; + for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ ){ + AliAODTrack* track = (AliAODTrack *)(plCTS->At(ipr)) ; + //Do not count the candidate (pion, conversion photon) or the daughters of the candidate + if(track->GetID() == pCandidate->GetTrackLabel(0) || track->GetID() == pCandidate->GetTrackLabel(1)) continue ; + p3.SetXYZ(track->Px(),track->Py(),track->Pz()); + pt = p3.Pt(); + eta = p3.Eta(); + phi = p3.Phi() ; + if(phi<0) phi+=TMath::TwoPi(); + + //Check if there is any particle inside cone with pt larger than fPtThreshold + rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC)); + + if(rad < fConeSize){ + if(fillAOD) { + if(first) { + new (pCandidate->GetRefIsolationConeTracks()) TRefArray(TProcessID::GetProcessWithUID(track)); + first = kFALSE; + } + pCandidate->AddIsolationConeTrack(track); } - else if( fICMethod == kSumPtFracIC){ - if(coneptsum < fPtFraction*ptC) - isolated = kTRUE ; + //printf("charged in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); + coneptsum+=pt; + if(pt > fPtThreshold ) n++; + if(pt > fPtFraction*ptC ) nfrac++; + } + }// charged particle loop + }//Tracks + + //Check neutral particles in cone. + if(plNe){ + first= kTRUE; + TLorentzVector mom ; + for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){ + AliAODCaloCluster * calo = (AliAODCaloCluster *)(plNe->At(ipr)) ; + + //Do not count the candidate (photon or pi0) or the daughters of the candidate + if(calo->GetID() == pCandidate->GetCaloLabel(0) || calo->GetID() == pCandidate->GetCaloLabel(1)) continue ; //Skip matched clusters with tracks + + if(calo->GetNTracksMatched() > 0) continue ; + + calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line + pt = mom.Pt(); + eta = mom.Eta(); + phi = mom.Phi() ; + if(phi<0) phi+=TMath::TwoPi(); + + //Check if there is any particle inside cone with pt larger than fPtThreshold + rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC)); + if(rad < fConeSize){ + if(fillAOD) { + if(first) { + new (pCandidate->GetRefIsolationConeClusters()) TRefArray(TProcessID::GetProcessWithUID(calo)); + first = kFALSE; + } + pCandidate->AddIsolationConeCluster(calo); } + //printf("neutral in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); + coneptsum+=pt; + if(pt > fPtThreshold ) n++; + if(pt > fPtFraction*ptC ) nfrac++; + }//in cone + }// neutral particle loop + }//neutrals + + //printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac); + + //Check isolation, depending on method. + if( fICMethod == kPtThresIC){ + if(n==0) isolated = kTRUE ; + } + else if( fICMethod == kSumPtIC){ + if(coneptsum < fPtThreshold) + isolated = kTRUE ; + } + else if( fICMethod == kPtFracIC){ + if(nfrac==0) isolated = kTRUE ; + } + else if( fICMethod == kSumPtFracIC){ + if(coneptsum < fPtFraction*ptC) + isolated = kTRUE ; + } } //__________________________________________________________________ diff --git a/PWG4/PartCorrBase/AliIsolationCut.h b/PWG4/PartCorrBase/AliIsolationCut.h index c464f486d78..de4c4430eb3 100755 --- a/PWG4/PartCorrBase/AliIsolationCut.h +++ b/PWG4/PartCorrBase/AliIsolationCut.h @@ -15,7 +15,7 @@ // --- ROOT system --- #include -class TSeqCollection ; +class TRefArray ; // --- ANALYSIS system --- class AliAODPWG4ParticleCorrelation ; @@ -24,47 +24,47 @@ class AliIsolationCut : public TObject { public: - AliIsolationCut() ; // default ctor - AliIsolationCut(const AliIsolationCut & g) ; // cpy ctor - AliIsolationCut & operator = (const AliIsolationCut & g) ;//cpy assignment - virtual ~AliIsolationCut() {;} //virtual dtalr - - enum type {kPtThresIC, kSumPtIC, kPtFracIC, kSumPtFracIC}; - - Float_t GetConeSize() const {return fConeSize ; } - Float_t GetPtThreshold() const {return fPtThreshold ; } - Float_t GetPtFraction() const {return fPtFraction ; } - Int_t GetICMethod() const {return fICMethod ; } - TString GetICParametersList() ; - - void MakeIsolationCut(TSeqCollection * plCTS, TSeqCollection * plNe, Double_t * vertex, - const Bool_t fillAOD, AliAODPWG4ParticleCorrelation * pCandidate, - Int_t &n, Int_t & nfrac, Float_t &ptsum, Bool_t & isolated) const ; - - void Print(const Option_t * opt)const; - - void SetConeSize(Float_t r) {fConeSize = r ; } - void SetPtThreshold(Float_t pt) {fPtThreshold = pt; } - void SetPtFraction(Float_t pt) {fPtFraction = pt; } - void SetICMethod(Int_t i ) {fICMethod = i ; } - - void InitParameters(); - + AliIsolationCut() ; // default ctor + AliIsolationCut(const AliIsolationCut & g) ; // cpy ctor + AliIsolationCut & operator = (const AliIsolationCut & g) ;//cpy assignment + virtual ~AliIsolationCut() {;} //virtual dtalr - private: - - Float_t fConeSize ; //Size of the isolation cone + enum type {kPtThresIC, kSumPtIC, kPtFracIC, kSumPtFracIC}; + + Float_t GetConeSize() const {return fConeSize ; } + Float_t GetPtThreshold() const {return fPtThreshold ; } + Float_t GetPtFraction() const {return fPtFraction ; } + Int_t GetICMethod() const {return fICMethod ; } + TString GetICParametersList() ; + + void MakeIsolationCut(TRefArray * plCTS, TRefArray * plNe, Double_t * vertex, + const Bool_t fillAOD, AliAODPWG4ParticleCorrelation * pCandidate, + Int_t &n, Int_t & nfrac, Float_t &ptsum, Bool_t & isolated) const ; + + void Print(const Option_t * opt)const; + + void SetConeSize(Float_t r) {fConeSize = r ; } + void SetPtThreshold(Float_t pt) {fPtThreshold = pt; } + void SetPtFraction(Float_t pt) {fPtFraction = pt; } + void SetICMethod(Int_t i ) {fICMethod = i ; } + + void InitParameters(); + + + private: + + Float_t fConeSize ; //Size of the isolation cone Float_t fPtThreshold ; //Mimium pt of the particles in the cone or sum in cone - Float_t fPtFraction ; //Fraction of the momentum of particles in cone or sum in cone - Int_t fICMethod ; //Isolation cut method to be used - // kPtIC: Pt threshold method - // kSumPtIC: Cone pt sum method - // kPtFracIC: Pt threshold, fraction of candidate pt, method - // kSumPtFracIC: Cone pt sum , fraction of cone sum, method - + Float_t fPtFraction ; //Fraction of the momentum of particles in cone or sum in cone + Int_t fICMethod ; //Isolation cut method to be used + // kPtIC: Pt threshold method + // kSumPtIC: Cone pt sum method + // kPtFracIC: Pt threshold, fraction of candidate pt, method + // kSumPtFracIC: Cone pt sum , fraction of cone sum, method + ClassDef(AliIsolationCut,1) } ; - + #endif //ALIISOLATIONCUT_H diff --git a/PWG4/PartCorrBase/AliMCAnalysisUtils.cxx b/PWG4/PartCorrBase/AliMCAnalysisUtils.cxx index e0dcff2e5c3..c5ee124beaa 100755 --- a/PWG4/PartCorrBase/AliMCAnalysisUtils.cxx +++ b/PWG4/PartCorrBase/AliMCAnalysisUtils.cxx @@ -23,65 +23,60 @@ // //*-- Author: Gustavo Conesa (LNF-INFN) ////////////////////////////////////////////////////////////////////////////// - + // --- ROOT system --- #include -#include #include //---- ANALYSIS system ---- -#include "AliLog.h" #include "AliMCAnalysisUtils.h" #include "AliStack.h" #include "TParticle.h" #include "AliGenPythiaEventHeader.h" -ClassImp(AliMCAnalysisUtils) - + ClassImp(AliMCAnalysisUtils) -//________________________________________________ -AliMCAnalysisUtils::AliMCAnalysisUtils() : -TObject(), fCurrentEvent(-1), fDebug(-1), -fJetsList(new TList), fMCGenerator("PYTHIA") + //________________________________________________ + AliMCAnalysisUtils::AliMCAnalysisUtils() : + TObject(), fCurrentEvent(-1), fDebug(-1), + fJetsList(new TList), fMCGenerator("PYTHIA") { - //Ctor + //Ctor } //____________________________________________________________________________ AliMCAnalysisUtils::AliMCAnalysisUtils(const AliMCAnalysisUtils & mcutils) : -TObject(mcutils), fCurrentEvent(mcutils.fCurrentEvent), fDebug(mcutils.fDebug), -fJetsList(mcutils.fJetsList), fMCGenerator(mcutils.fMCGenerator) + TObject(mcutils), fCurrentEvent(mcutils.fCurrentEvent), fDebug(mcutils.fDebug), + fJetsList(mcutils.fJetsList), fMCGenerator(mcutils.fMCGenerator) { - // cpy ctor - + // cpy ctor + } //_________________________________________________________________________ AliMCAnalysisUtils & AliMCAnalysisUtils::operator = (const AliMCAnalysisUtils & mcutils) { - // assignment operator - - if(&mcutils == this) return *this; - fCurrentEvent = mcutils.fCurrentEvent ; - fDebug = mcutils.fDebug; - fJetsList = mcutils.fJetsList; - fMCGenerator = mcutils.fMCGenerator; - - return *this; - + // assignment operator + + if(&mcutils == this) return *this; + fCurrentEvent = mcutils.fCurrentEvent ; + fDebug = mcutils.fDebug; + fJetsList = mcutils.fJetsList; + fMCGenerator = mcutils.fMCGenerator; + + return *this; } //____________________________________________________________________________ AliMCAnalysisUtils::~AliMCAnalysisUtils() { - // Remove all pointers. - - if (fJetsList) { - fJetsList->Clear(); - delete fJetsList ; - } - + // Remove all pointers. + + if (fJetsList) { + fJetsList->Clear(); + delete fJetsList ; + } } //_________________________________________________________________________ @@ -89,12 +84,15 @@ Int_t AliMCAnalysisUtils::CheckOrigin(const Int_t label, AliStack * stack) const //Play with the MC stack if available //Check origin of the candidates, good for PYTHIA - if(!stack) AliFatal("Stack is not available, check analysis settings in configuration file, STOP!!"); + if(!stack) { + printf("AliMCAnalysisUtils::CheckOrigin() - Stack is not available, check analysis settings in configuration file, STOP!!"); + abort(); + } // printf("label %d, ntrack %d, nprim %d\n",label, stack->GetNtrack(), stack->GetNprimary()); -// for(Int_t i = 0; i< stack->GetNprimary(); i++){ -// TParticle *particle = stack->Particle(i); -// //particle->Print(); -// } + // for(Int_t i = 0; i< stack->GetNprimary(); i++){ + // TParticle *particle = stack->Particle(i); + // //particle->Print(); + // } if(label >= 0 && label < stack->GetNtrack()){ //Mother TParticle * mom = stack->Particle(label); @@ -195,22 +193,22 @@ Int_t AliMCAnalysisUtils::CheckOrigin(const Int_t label, AliStack * stack) const TList * AliMCAnalysisUtils::GetJets(Int_t iEvent, AliStack * stack, AliGenEventHeader * geh) { //Return list of jets (TParticles) and index of most likely parton that originated it. - if(fCurrentEvent!=iEvent){ - fCurrentEvent = iEvent; - fJetsList = new TList; - Int_t nTriggerJets = 0; - Float_t tmpjet[]={0,0,0,0}; + if(fCurrentEvent!=iEvent){ + fCurrentEvent = iEvent; + fJetsList = new TList; + Int_t nTriggerJets = 0; + Float_t tmpjet[]={0,0,0,0}; - //printf("Event %d %d\n",fCurrentEvent,iEvent); - //Get outgoing partons - if(stack->GetNtrack() < 8) return fJetsList; - TParticle * parton1 = stack->Particle(6); - TParticle * parton2 = stack->Particle(7); - if(fDebug > 2){ - printf("parton 6 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", - parton1->GetName(),parton1->Pt(),parton1->Energy(),parton1->Phi()*TMath::RadToDeg(),parton1->Eta()); - printf("parton 7 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", - parton2->GetName(),parton2->Pt(),parton2->Energy(),parton2->Phi()*TMath::RadToDeg(),parton2->Eta()); + //printf("Event %d %d\n",fCurrentEvent,iEvent); + //Get outgoing partons + if(stack->GetNtrack() < 8) return fJetsList; + TParticle * parton1 = stack->Particle(6); + TParticle * parton2 = stack->Particle(7); + if(fDebug > 2){ + printf("parton 6 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", + parton1->GetName(),parton1->Pt(),parton1->Energy(),parton1->Phi()*TMath::RadToDeg(),parton1->Eta()); + printf("parton 7 : %s, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", + parton2->GetName(),parton2->Pt(),parton2->Energy(),parton2->Phi()*TMath::RadToDeg(),parton2->Eta()); } // //Trace the jet from the mother parton // Float_t pt = 0; @@ -251,76 +249,76 @@ TList * AliMCAnalysisUtils::GetJets(Int_t iEvent, AliStack * stack, AliGenEventH //Get the jet, different way for different generator //PYTHIA - if(fMCGenerator == "PYTHIA"){ - TParticle * jet = new TParticle; - AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) geh; - nTriggerJets = pygeh->NTriggerJets(); - //if(fDebug > 1) - printf("PythiaEventHeader: Njets: %d\n",nTriggerJets); - Int_t iparton = -1; - for(Int_t i = 0; i< nTriggerJets; i++){ - iparton=-1; - pygeh->TriggerJet(i, tmpjet); - jet = new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0); - //Assign an outgoing parton as mother - Float_t phidiff1 = TMath::Abs(jet->Phi()-parton1->Phi()); - Float_t phidiff2 = TMath::Abs(jet->Phi()-parton2->Phi()); - if(phidiff1 > phidiff2) jet->SetFirstMother(7); - else jet->SetFirstMother(6); - //jet->Print(); - if(fDebug > 1) - printf("PYTHIA Jet %d: mother %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", - i, jet->GetFirstMother(),jet->Pt(),jet->Energy(),jet->Phi()*TMath::RadToDeg(),jet->Eta()); - fJetsList->Add(jet); - } - }//Pythia triggered jets - //HERWIG - else if (fMCGenerator=="HERWIG"){ - Int_t pdg = -1; - //Check parton 1 - TParticle * tmp = parton1; - if(parton1->GetPdgCode()!=22){ - while(pdg != 94){ - if(tmp->GetFirstDaughter()==-1) return fJetsList; - tmp = stack->Particle(tmp->GetFirstDaughter()); - pdg = tmp->GetPdgCode(); - }//while - - //Add found jet to list - TParticle *jet1 = new TParticle(*tmp); - jet1->SetFirstMother(6); - fJetsList->Add(jet1); - //printf("jet 1: first daughter %d, last daughter %d\n", tmp->GetFirstDaughter(), tmp->GetLastDaughter()); - //tmp = stack->Particle(tmp->GetFirstDaughter()); - //tmp->Print(); - //jet1->Print(); - if(fDebug > 1) - printf("HERWIG Jet 1: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", - jet1->GetFirstMother(),jet1->GetStatusCode(),jet1->Pt(),jet1->Energy(),jet1->Phi()*TMath::RadToDeg(),jet1->Eta()); - }//not photon - - //Check parton 2 - pdg = -1; - tmp = parton2; - Int_t i = -1; - if(parton2->GetPdgCode()!=22){ - while(pdg != 94){ - if(tmp->GetFirstDaughter()==-1) return fJetsList; - i = tmp->GetFirstDaughter(); - tmp = stack->Particle(tmp->GetFirstDaughter()); - pdg = tmp->GetPdgCode(); - }//while - //Add found jet to list - TParticle *jet2 = new TParticle(*tmp); - jet2->SetFirstMother(7); - fJetsList->Add(jet2); - //jet2->Print(); - if(fDebug > 1) - printf("HERWIG Jet 2: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", - jet2->GetFirstMother(),jet2->GetStatusCode(),jet2->Pt(),jet2->Energy(),jet2->Phi()*TMath::RadToDeg(),jet2->Eta()); - Int_t first = tmp->GetFirstDaughter(); - Int_t last = tmp->GetLastDaughter(); - printf("jet 2: first daughter %d, last daughter %d, pdg %d\n",first, last, tmp->GetPdgCode()); + if(fMCGenerator == "PYTHIA"){ + TParticle * jet = new TParticle; + AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) geh; + nTriggerJets = pygeh->NTriggerJets(); + //if(fDebug > 1) + printf("PythiaEventHeader: Njets: %d\n",nTriggerJets); + Int_t iparton = -1; + for(Int_t i = 0; i< nTriggerJets; i++){ + iparton=-1; + pygeh->TriggerJet(i, tmpjet); + jet = new TParticle(94, 21, -1, -1, -1, -1, tmpjet[0],tmpjet[1],tmpjet[2],tmpjet[3], 0,0,0,0); + //Assign an outgoing parton as mother + Float_t phidiff1 = TMath::Abs(jet->Phi()-parton1->Phi()); + Float_t phidiff2 = TMath::Abs(jet->Phi()-parton2->Phi()); + if(phidiff1 > phidiff2) jet->SetFirstMother(7); + else jet->SetFirstMother(6); + //jet->Print(); + if(fDebug > 1) + printf("PYTHIA Jet %d: mother %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", + i, jet->GetFirstMother(),jet->Pt(),jet->Energy(),jet->Phi()*TMath::RadToDeg(),jet->Eta()); + fJetsList->Add(jet); + } + }//Pythia triggered jets + //HERWIG + else if (fMCGenerator=="HERWIG"){ + Int_t pdg = -1; + //Check parton 1 + TParticle * tmp = parton1; + if(parton1->GetPdgCode()!=22){ + while(pdg != 94){ + if(tmp->GetFirstDaughter()==-1) return fJetsList; + tmp = stack->Particle(tmp->GetFirstDaughter()); + pdg = tmp->GetPdgCode(); + }//while + + //Add found jet to list + TParticle *jet1 = new TParticle(*tmp); + jet1->SetFirstMother(6); + fJetsList->Add(jet1); + //printf("jet 1: first daughter %d, last daughter %d\n", tmp->GetFirstDaughter(), tmp->GetLastDaughter()); + //tmp = stack->Particle(tmp->GetFirstDaughter()); + //tmp->Print(); + //jet1->Print(); + if(fDebug > 1) + printf("HERWIG Jet 1: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", + jet1->GetFirstMother(),jet1->GetStatusCode(),jet1->Pt(),jet1->Energy(),jet1->Phi()*TMath::RadToDeg(),jet1->Eta()); + }//not photon + + //Check parton 2 + pdg = -1; + tmp = parton2; + Int_t i = -1; + if(parton2->GetPdgCode()!=22){ + while(pdg != 94){ + if(tmp->GetFirstDaughter()==-1) return fJetsList; + i = tmp->GetFirstDaughter(); + tmp = stack->Particle(tmp->GetFirstDaughter()); + pdg = tmp->GetPdgCode(); + }//while + //Add found jet to list + TParticle *jet2 = new TParticle(*tmp); + jet2->SetFirstMother(7); + fJetsList->Add(jet2); + //jet2->Print(); + if(fDebug > 1) + printf("HERWIG Jet 2: mother %d, status %d, pt %2.2f,E %2.2f, phi %2.2f, eta %2.2f \n", + jet2->GetFirstMother(),jet2->GetStatusCode(),jet2->Pt(),jet2->Energy(),jet2->Phi()*TMath::RadToDeg(),jet2->Eta()); + Int_t first = tmp->GetFirstDaughter(); + Int_t last = tmp->GetLastDaughter(); + printf("jet 2: first daughter %d, last daughter %d, pdg %d\n",first, last, tmp->GetPdgCode()); // for(Int_t d = first ; d < last+1; d++){ // tmp = stack->Particle(d); // if(i == tmp->GetFirstMother()) @@ -328,28 +326,28 @@ TList * AliMCAnalysisUtils::GetJets(Int_t iEvent, AliStack * stack, AliGenEventH // d,tmp->GetFirstMother(), tmp->GetName(), tmp->GetStatusCode(),tmp->Pt(),tmp->Energy(),tmp->Phi()*TMath::RadToDeg(),tmp->Eta()); // } //tmp->Print(); - }//not photon - }//Herwig generated jets - } - - return fJetsList; + }//not photon + }//Herwig generated jets + } + + return fJetsList; } //________________________________________________________________ void AliMCAnalysisUtils::Print(const Option_t * opt) const { - - //Print some relevant parameters set for the analysis - if(! opt) - return; - - printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; - - printf("Debug level = %d\n",fDebug); - printf("MC Generator = %s\n",fMCGenerator.Data()); - - printf(" \n"); - + //Print some relevant parameters set for the analysis + + if(! opt) + return; + + printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ; + + printf("Debug level = %d\n",fDebug); + printf("MC Generator = %s\n",fMCGenerator.Data()); + + printf(" \n"); + } diff --git a/PWG4/PartCorrBase/AliMCAnalysisUtils.h b/PWG4/PartCorrBase/AliMCAnalysisUtils.h index a6484227f70..22f0bbbd653 100755 --- a/PWG4/PartCorrBase/AliMCAnalysisUtils.h +++ b/PWG4/PartCorrBase/AliMCAnalysisUtils.h @@ -19,10 +19,7 @@ class TString ; class TList ; //--- AliRoot system --- -class AliLog ; -//#include "AliStack.h" class AliStack ; -//#include "AliGenPythiaEventHeader.h" class AliGenEventHeader ; class AliMCAnalysisUtils : public TObject { diff --git a/PWG4/PartCorrBase/AliNeutralMesonSelection.cxx b/PWG4/PartCorrBase/AliNeutralMesonSelection.cxx index 93f8b4be469..0613b5356a4 100755 --- a/PWG4/PartCorrBase/AliNeutralMesonSelection.cxx +++ b/PWG4/PartCorrBase/AliNeutralMesonSelection.cxx @@ -24,11 +24,9 @@ #include #include #include -#include //---- AliRoot system ---- #include "AliNeutralMesonSelection.h" -#include "AliLog.h" ClassImp(AliNeutralMesonSelection) @@ -42,10 +40,11 @@ ClassImp(AliNeutralMesonSelection) fhAnglePairAllCut(0), fhInvMassPairNoCut(0), fhInvMassPairOpeningAngleCut(0), fhInvMassPairAllCut(0), - fHistoNEBins(0), fHistoEMax(0.), fHistoEMin(0.), - fHistoNPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.), - fHistoNAngleBins(0), fHistoAngleMax(0.), fHistoAngleMin(0.), - fHistoNIMBins(0), fHistoIMMax(0.), fHistoIMMin(0.){ + fHistoNEBins(0), fHistoEMax(0.), fHistoEMin(0.), + fHistoNPtBins(0), fHistoPtMax(0.), fHistoPtMin(0.), + fHistoNAngleBins(0), fHistoAngleMax(0.), fHistoAngleMin(0.), + fHistoNIMBins(0), fHistoIMMax(0.), fHistoIMMin(0.) +{ //Default Ctor //Initialize parameters @@ -130,72 +129,71 @@ AliNeutralMesonSelection::~AliNeutralMesonSelection() //________________________________________________________________________ TList * AliNeutralMesonSelection::GetCreateOutputObjects() { - - // Create histograms to be saved in output file and - // store them in outputContainer of the analysis class that calls this class. - - TList * outputContainer = new TList() ; - outputContainer->SetName("MesonDecayHistos") ; - - fhAnglePairNoCut = new TH2F + // Create histograms to be saved in output file and + // store them in outputContainer of the analysis class that calls this class. + + TList * outputContainer = new TList() ; + outputContainer->SetName("MesonDecayHistos") ; + + fhAnglePairNoCut = new TH2F ("AnglePairNoCut", "Angle between all #gamma pair vs E_{#pi^{0}}",fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax); - fhAnglePairNoCut->SetYTitle("Angle (rad)"); - fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)"); - - fhAnglePairOpeningAngleCut = new TH2F + fhAnglePairNoCut->SetYTitle("Angle (rad)"); + fhAnglePairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)"); + + fhAnglePairOpeningAngleCut = new TH2F ("AnglePairOpeningAngleCut", "Angle between all #gamma pair (opening angle + azimuth cut) vs E_{#pi^{0}}" ,fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax); - fhAnglePairOpeningAngleCut->SetYTitle("Angle (rad)"); - fhAnglePairOpeningAngleCut->SetXTitle("E_{ #pi^{0}} (GeV)"); - - fhAnglePairAllCut = new TH2F + fhAnglePairOpeningAngleCut->SetYTitle("Angle (rad)"); + fhAnglePairOpeningAngleCut->SetXTitle("E_{ #pi^{0}} (GeV)"); + + fhAnglePairAllCut = new TH2F ("AnglePairAllCut", "Angle between all #gamma pair (opening angle + inv mass cut+azimuth) vs E_{#pi^{0}}" ,fHistoNEBins,fHistoEMin,fHistoEMax,fHistoNAngleBins,fHistoAngleMin,fHistoAngleMax); - fhAnglePairAllCut->SetYTitle("Angle (rad)"); - fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV)"); - - // - fhInvMassPairNoCut = new TH2F + fhAnglePairAllCut->SetYTitle("Angle (rad)"); + fhAnglePairAllCut->SetXTitle("E_{ #pi^{0}} (GeV)"); + + // + fhInvMassPairNoCut = new TH2F ("InvMassPairNoCut","Invariant Mass of all #gamma pair vs E_{#pi^{0}}", fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax); - fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})"); - fhInvMassPairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)"); - - fhInvMassPairOpeningAngleCut = new TH2F + fhInvMassPairNoCut->SetYTitle("Invariant Mass (GeV/c^{2})"); + fhInvMassPairNoCut->SetXTitle("E_{ #pi^{0}} (GeV)"); + + fhInvMassPairOpeningAngleCut = new TH2F ("InvMassPairOpeningAngleCut", "Invariant Mass of #gamma pair (angle cut) vs E_{#pi^{0}}", fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax); - fhInvMassPairOpeningAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})"); - fhInvMassPairOpeningAngleCut->SetXTitle(" E_{#pi^{0}}(GeV)"); - - fhInvMassPairAllCut = new TH2F + fhInvMassPairOpeningAngleCut->SetYTitle("Invariant Mass (GeV/c^{2})"); + fhInvMassPairOpeningAngleCut->SetXTitle(" E_{#pi^{0}}(GeV)"); + + fhInvMassPairAllCut = new TH2F ("InvMassPairAllCut", "Invariant Mass of #gamma pair (opening angle+invmass cut) vs E_{#pi^{0}}", fHistoNPtBins,fHistoPtMin,fHistoPtMax,fHistoNIMBins,fHistoIMMin,fHistoIMMax); - fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})"); - fhInvMassPairAllCut->SetXTitle("E_{#pi^{0}}(GeV)"); - - outputContainer->Add(fhAnglePairNoCut) ; - outputContainer->Add(fhAnglePairOpeningAngleCut) ; - outputContainer->Add(fhAnglePairAllCut) ; - - outputContainer->Add(fhInvMassPairNoCut) ; - outputContainer->Add(fhInvMassPairOpeningAngleCut) ; - outputContainer->Add(fhInvMassPairAllCut) ; - - return outputContainer; + fhInvMassPairAllCut->SetYTitle("Invariant Mass (GeV/c^{2})"); + fhInvMassPairAllCut->SetXTitle("E_{#pi^{0}}(GeV)"); + + outputContainer->Add(fhAnglePairNoCut) ; + outputContainer->Add(fhAnglePairOpeningAngleCut) ; + outputContainer->Add(fhAnglePairAllCut) ; + + outputContainer->Add(fhInvMassPairNoCut) ; + outputContainer->Add(fhInvMassPairOpeningAngleCut) ; + outputContainer->Add(fhInvMassPairAllCut) ; + + return outputContainer; } - //____________________________________________________________________________ +//____________________________________________________________________________ void AliNeutralMesonSelection::InitParameters() { - + //Initialize the parameters of the analysis. fKeepNeutralMesonHistos = kFALSE ; - + fAngleMaxParam.Set(4) ; fAngleMaxParam.AddAt(0.4,0);//={0.4,-0.25,0.025,-2e-4}; fAngleMaxParam.AddAt(-0.25,1) ; @@ -251,7 +249,7 @@ Bool_t AliNeutralMesonSelection::SelectPair(TLorentzVector gammai, TLorentzVect //Search for the neutral pion within selection cuts Bool_t goodpair = kFALSE ; - Double_t pt = (gammai+gammaj).Pt(); +// Double_t pt = (gammai+gammaj).Pt(); Double_t phi = (gammai+gammaj).Phi(); if(phi < 0) phi+=TMath::TwoPi(); @@ -267,14 +265,14 @@ Bool_t AliNeutralMesonSelection::SelectPair(TLorentzVector gammai, TLorentzVect if(IsAngleInWindow(angle,e)){ fhAnglePairOpeningAngleCut ->Fill(e,angle); fhInvMassPairOpeningAngleCut->Fill(e,invmass); - AliDebug(2,Form("Angle cut: pt %f, phi %f",pt,phi)); + //AliDebug(2,Form("Angle cut: pt %f, phi %f",pt,phi)); //Cut on the invariant mass of the pair if((invmass>fInvMassMinCut) && (invmassFill(e,invmass); fhAnglePairAllCut ->Fill(e,angle); goodpair = kTRUE; - AliDebug(2,Form("IM cut: pt %f, phi %f",pt,phi)); + //AliDebug(2,Form("IM cut: pt %f, phi %f",pt,phi)); }//(invmass>0.125) && (invmass<0.145) }//Opening angle cut @@ -303,11 +301,11 @@ void AliNeutralMesonSelection::Print(const Option_t * opt) const printf("Keep Neutral Meson Histos = %d\n",fKeepNeutralMesonHistos); if(fKeepNeutralMesonHistos){ - printf("Histograms: %3.1f < E < %3.1f, Nbin = %d\n", fHistoEMin, fHistoEMax, fHistoNEBins); - printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoNPtBins); - printf("Histograms: %3.1f < angle < %3.1f, Nbin = %d\n", fHistoAngleMin, fHistoAngleMax, fHistoNAngleBins); - printf("Histograms: %3.1f < IM < %3.1f, Nbin = %d\n", fHistoIMMin, fHistoIMMax, fHistoNIMBins); - + printf("Histograms: %3.1f < E < %3.1f, Nbin = %d\n", fHistoEMin, fHistoEMax, fHistoNEBins); + printf("Histograms: %3.1f < pT < %3.1f, Nbin = %d\n", fHistoPtMin, fHistoPtMax, fHistoNPtBins); + printf("Histograms: %3.1f < angle < %3.1f, Nbin = %d\n", fHistoAngleMin, fHistoAngleMax, fHistoNAngleBins); + printf("Histograms: %3.1f < IM < %3.1f, Nbin = %d\n", fHistoIMMin, fHistoIMMax, fHistoNIMBins); + } - + } diff --git a/PWG4/PartCorrBase/AliNeutralMesonSelection.h b/PWG4/PartCorrBase/AliNeutralMesonSelection.h index e26b3d2ba3a..fbb8b43caeb 100755 --- a/PWG4/PartCorrBase/AliNeutralMesonSelection.h +++ b/PWG4/PartCorrBase/AliNeutralMesonSelection.h @@ -20,115 +20,114 @@ class TList ; class TH2F ; //--- ANALYSIS system --- -class AliLog ; class AliNeutralMesonSelection : public TObject { - -public: - - AliNeutralMesonSelection() ; // default ctor - AliNeutralMesonSelection(const AliNeutralMesonSelection & g) ; // cpy ctor - AliNeutralMesonSelection & operator = (const AliNeutralMesonSelection & g) ;//cpy assignment - virtual ~AliNeutralMesonSelection() ; //virtual dtor - - TList * GetCreateOutputObjects(); - - Double_t GetAngleMaxParam(Int_t i) const {return fAngleMaxParam.At(i) ; } - void SetAngleMaxParam(Int_t i, Double_t par){fAngleMaxParam.AddAt(par,i) ; } - - Double_t GetInvMassMaxCut() const {return fInvMassMaxCut ; } - Double_t GetInvMassMinCut() const {return fInvMassMinCut ; } - void SetInvMassCutRange(Double_t invmassmin, Double_t invmassmax) - {fInvMassMaxCut =invmassmax; fInvMassMinCut =invmassmin;} - - Double_t GetMass() const {return fM ; } - void SetMass(Double_t m) { fM =m ; } - - Bool_t AreNeutralMesonSelectionHistosKept() const { return fKeepNeutralMesonHistos ; } - void KeepNeutralMesonSelectionHistos(Bool_t keep) { fKeepNeutralMesonHistos = keep ; } - - void InitParameters(); - Bool_t IsAngleInWindow(const Float_t angle, const Float_t e) const ; - void Print(const Option_t * opt) const; - - Bool_t SelectPair(TLorentzVector particlei, TLorentzVector particlej) ; - - //Histogrammes setters and getters - - virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNEBins = n ; - fHistoEMax = max ; - fHistoEMin = min ; - } - - Int_t GetHistoNEBins() const { return fHistoNEBins ; } - Float_t GetHistoEMin() const { return fHistoEMin ; } - Float_t GetHistoEMax() const { return fHistoEMax ; } - - virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNPtBins = n ; - fHistoPtMax = max ; - fHistoPtMin = min ; - } - - Int_t GetHistoNPtBins() const { return fHistoNPtBins ; } - Float_t GetHistoPtMin() const { return fHistoPtMin ; } - Float_t GetHistoPtMax() const { return fHistoPtMax ; } - - virtual void SetHistoAngleRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNAngleBins = n ; - fHistoAngleMax = max ; - fHistoAngleMin = min ; - } - - Int_t GetHistoNAngleBins() const { return fHistoNAngleBins ; } - Float_t GetHistoAngleMin() const { return fHistoAngleMin ; } - Float_t GetHistoAngleMax() const { return fHistoAngleMax ; } - - virtual void SetHistoIMRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNIMBins = n ; - fHistoIMMax = max ; - fHistoIMMin = min ; - } - - Int_t GetHistoNIMBins() const { return fHistoNIMBins ; } - Float_t GetHistoIMMin() const { return fHistoIMMin ; } - Float_t GetHistoIMMax() const { return fHistoIMMax ; } - - -private: - Double_t fM ; //mass of the neutral meson - Double_t fInvMassMaxCut ; // Invariant Mass cut maximum - Double_t fInvMassMinCut ; // Invariant Masscut minimun - TArrayD fAngleMaxParam ; //Max opening angle selection parameters - - Bool_t fKeepNeutralMesonHistos ; // Keep neutral meson selection histograms - - //Histograms - TH2F * fhAnglePairNoCut ; //Aperture angle of decay photons, no cuts - TH2F * fhAnglePairOpeningAngleCut ; //Aperture angle of decay photons, cut on opening angle - TH2F * fhAnglePairAllCut ; //Aperture angle of decay photons, all cuts - TH2F * fhInvMassPairNoCut ; //Invariant mass of decay photons, no cuts - TH2F * fhInvMassPairOpeningAngleCut ; //Invariant mass of decay photons, cut on opening angle - TH2F * fhInvMassPairAllCut ; //Invariant mass of decay photons, all cuts - - //Histograms binning and range - Int_t fHistoNEBins ; //Number of bins in pi0 E axis - Float_t fHistoEMax ; //Maximum value of pi0 E histogram range - Float_t fHistoEMin ; //Minimum value of pi0 E histogram range - Int_t fHistoNPtBins ; //Number of bins in Pt trigger axis - Float_t fHistoPtMax ; //Maximum value of Pt trigger histogram range - Float_t fHistoPtMin ; //Minimum value of Pt trigger histogram range - Int_t fHistoNAngleBins ; //Number of bins in angle axis - Float_t fHistoAngleMax ;//Maximum value of angle histogram range - Float_t fHistoAngleMin ;//Minimum value of angle histogram range - Int_t fHistoNIMBins ; //Number of bins in Invariant Mass axis - Float_t fHistoIMMax ; //Maximum value of Invariant Mass histogram range - Float_t fHistoIMMin ; //Minimum value of Invariant Mass histogram range - - ClassDef(AliNeutralMesonSelection,2) + + public: + + AliNeutralMesonSelection() ; // default ctor + AliNeutralMesonSelection(const AliNeutralMesonSelection & g) ; // cpy ctor + AliNeutralMesonSelection & operator = (const AliNeutralMesonSelection & g) ;//cpy assignment + virtual ~AliNeutralMesonSelection() ; //virtual dtor + + TList * GetCreateOutputObjects(); + + Double_t GetAngleMaxParam(Int_t i) const {return fAngleMaxParam.At(i) ; } + void SetAngleMaxParam(Int_t i, Double_t par){fAngleMaxParam.AddAt(par,i) ; } + + Double_t GetInvMassMaxCut() const {return fInvMassMaxCut ; } + Double_t GetInvMassMinCut() const {return fInvMassMinCut ; } + void SetInvMassCutRange(Double_t invmassmin, Double_t invmassmax) + {fInvMassMaxCut =invmassmax; fInvMassMinCut =invmassmin;} + + Double_t GetMass() const {return fM ; } + void SetMass(Double_t m) { fM =m ; } + + Bool_t AreNeutralMesonSelectionHistosKept() const { return fKeepNeutralMesonHistos ; } + void KeepNeutralMesonSelectionHistos(Bool_t keep) { fKeepNeutralMesonHistos = keep ; } + + void InitParameters(); + Bool_t IsAngleInWindow(const Float_t angle, const Float_t e) const ; + void Print(const Option_t * opt) const; + + Bool_t SelectPair(TLorentzVector particlei, TLorentzVector particlej) ; + + //Histogrammes setters and getters + + virtual void SetHistoERangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNEBins = n ; + fHistoEMax = max ; + fHistoEMin = min ; + } + + Int_t GetHistoNEBins() const { return fHistoNEBins ; } + Float_t GetHistoEMin() const { return fHistoEMin ; } + Float_t GetHistoEMax() const { return fHistoEMax ; } + + virtual void SetHistoPtRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNPtBins = n ; + fHistoPtMax = max ; + fHistoPtMin = min ; + } + + Int_t GetHistoNPtBins() const { return fHistoNPtBins ; } + Float_t GetHistoPtMin() const { return fHistoPtMin ; } + Float_t GetHistoPtMax() const { return fHistoPtMax ; } + + virtual void SetHistoAngleRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNAngleBins = n ; + fHistoAngleMax = max ; + fHistoAngleMin = min ; + } + + Int_t GetHistoNAngleBins() const { return fHistoNAngleBins ; } + Float_t GetHistoAngleMin() const { return fHistoAngleMin ; } + Float_t GetHistoAngleMax() const { return fHistoAngleMax ; } + + virtual void SetHistoIMRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNIMBins = n ; + fHistoIMMax = max ; + fHistoIMMin = min ; + } + + Int_t GetHistoNIMBins() const { return fHistoNIMBins ; } + Float_t GetHistoIMMin() const { return fHistoIMMin ; } + Float_t GetHistoIMMax() const { return fHistoIMMax ; } + + + private: + Double_t fM ; //mass of the neutral meson + Double_t fInvMassMaxCut ; // Invariant Mass cut maximum + Double_t fInvMassMinCut ; // Invariant Masscut minimun + TArrayD fAngleMaxParam ; //Max opening angle selection parameters + + Bool_t fKeepNeutralMesonHistos ; // Keep neutral meson selection histograms + + //Histograms + TH2F * fhAnglePairNoCut ; //Aperture angle of decay photons, no cuts + TH2F * fhAnglePairOpeningAngleCut ; //Aperture angle of decay photons, cut on opening angle + TH2F * fhAnglePairAllCut ; //Aperture angle of decay photons, all cuts + TH2F * fhInvMassPairNoCut ; //Invariant mass of decay photons, no cuts + TH2F * fhInvMassPairOpeningAngleCut ; //Invariant mass of decay photons, cut on opening angle + TH2F * fhInvMassPairAllCut ; //Invariant mass of decay photons, all cuts + + //Histograms binning and range + Int_t fHistoNEBins ; //Number of bins in pi0 E axis + Float_t fHistoEMax ; //Maximum value of pi0 E histogram range + Float_t fHistoEMin ; //Minimum value of pi0 E histogram range + Int_t fHistoNPtBins ; //Number of bins in Pt trigger axis + Float_t fHistoPtMax ; //Maximum value of Pt trigger histogram range + Float_t fHistoPtMin ; //Minimum value of Pt trigger histogram range + Int_t fHistoNAngleBins ; //Number of bins in angle axis + Float_t fHistoAngleMax ;//Maximum value of angle histogram range + Float_t fHistoAngleMin ;//Minimum value of angle histogram range + Int_t fHistoNIMBins ; //Number of bins in Invariant Mass axis + Float_t fHistoIMMax ; //Maximum value of Invariant Mass histogram range + Float_t fHistoIMMin ; //Minimum value of Invariant Mass histogram range + + ClassDef(AliNeutralMesonSelection,2) -} ; + } ; #endif //ALINEUTRALMESONSELECTION_H diff --git a/PWG4/PartCorrDep/AliAnaCaloTrigger.cxx b/PWG4/PartCorrDep/AliAnaCaloTrigger.cxx index a941a8d9ed2..3ed46c59dc6 100755 --- a/PWG4/PartCorrDep/AliAnaCaloTrigger.cxx +++ b/PWG4/PartCorrDep/AliAnaCaloTrigger.cxx @@ -29,7 +29,6 @@ //Aliroot #include "AliAnaCaloTrigger.h" #include "AliStack.h" -#include "AliLog.h" #include "AliESDCaloCluster.h" #include "AliMCEvent.h" #include "AliESDEvent.h" @@ -40,7 +39,6 @@ AliAnaCaloTrigger::AliAnaCaloTrigger() : fCalorimeter("PHOS"), fNtTrigger22(0), fNtTriggerNN(0) - { // Default Constructor. @@ -53,7 +51,6 @@ AliAnaCaloTrigger::AliAnaCaloTrigger(const char *name) : fCalorimeter("PHOS"), fNtTrigger22(0), fNtTriggerNN(0) - { // Constructor. // Output slot @@ -93,10 +90,10 @@ AliAnaCaloTrigger & AliAnaCaloTrigger::operator = (const AliAnaCaloTrigger & sou AliAnaCaloTrigger::~AliAnaCaloTrigger() { // dtor - if(fOutputContainer){ - fOutputContainer->Clear() ; - delete fOutputContainer ; - } + if(fOutputContainer){ + fOutputContainer->Clear() ; + delete fOutputContainer ; + } } @@ -125,116 +122,116 @@ void AliAnaCaloTrigger::UserCreateOutputObjects() //______________________________________________________________________________ void AliAnaCaloTrigger::UserExec(Option_t *) { - // Processing of one event - - if ( !((Entry()-1)%100) ) - printf(" Processing event # %lld\n", Entry()) ; - AliESDEvent* esd = (AliESDEvent*)InputEvent(); + // Processing of one event + + if ( !((Entry()-1)%100) ) + printf(" Processing event # %lld\n", Entry()) ; + AliESDEvent* esd = (AliESDEvent*)InputEvent(); + + //Get MC data, if available + AliStack* stack = 0x0; + if(MCEvent()) + stack = MCEvent()->Stack(); + + // Get trigger information of fCalorimeter + TArrayF * triggerAmplitudes = 0x0 ; + TArrayF * triggerPosition = 0x0 ; + Int_t numberOfCaloClusters = esd->GetNumberOfCaloClusters() ; + + if(fCalorimeter == "PHOS"){ + triggerAmplitudes = esd->GetPHOSTriggerAmplitudes(); + triggerPosition = esd->GetPHOSTriggerPosition(); + } + else if(fCalorimeter == "EMCAL"){ + triggerAmplitudes = esd->GetEMCALTriggerAmplitudes(); + triggerPosition = esd->GetEMCALTriggerPosition(); + } + + if( triggerAmplitudes && triggerPosition ){ + // trigger amplitudes + const Float_t ka22 = static_cast(triggerAmplitudes->At(0)) ; + const Float_t ka22O = static_cast(triggerAmplitudes->At(1)) ; + const Float_t kaNN = static_cast(triggerAmplitudes->At(2)) ; + const Float_t kaNNO = static_cast(triggerAmplitudes->At(3)) ; + + // trigger position + const Float_t kx22 = static_cast(triggerPosition->At(0)) ; + const Float_t ky22 = static_cast(triggerPosition->At(1)) ; + const Float_t kz22 = static_cast(triggerPosition->At(2)) ; + const Float_t kxNN = static_cast(triggerPosition->At(3)) ; + const Float_t kyNN = static_cast(triggerPosition->At(4)) ; + const Float_t kzNN = static_cast(triggerPosition->At(5)) ; + + //printf("ka22 %f, ka220 %f, kaNN %f, kaNN0 %f\n",ka22,ka22O,kaNN,kaNNO); + //printf("kx22 %f, ky22 %f, kz22 %f, kxNN %f, kyNN %f, kzNN %f \n",kx22,ky22,kz22,kxNN,kyNN,kzNN); + + Float_t enMax = 0. ; + Float_t phEnMax = 0. ; + Float_t etaMax = 0.5 ; + Float_t phiMax = 0. ; + Float_t phEtaMax = 0.5 ; + Float_t phPhiMax = 0. ; + + TVector3 vpos22(kx22, ky22, kz22) ; + TVector3 vposNN(kxNN, kyNN, kzNN) ; + Float_t eta22 = vpos22.Eta() ; + Float_t phi22 = vpos22.Phi() * TMath::RadToDeg() + 360. ; + Float_t etaNN = vposNN.Eta() ; + Float_t phiNN = vposNN.Phi() * TMath::RadToDeg() + 360. ; + + + Int_t icaloCluster = 0 ; + Int_t labelmax = -1 ; + // loop over the Calorimeters Clusters + + for(icaloCluster = 0 ; icaloCluster < numberOfCaloClusters ; icaloCluster++) { + + AliESDCaloCluster * cluster = esd->GetCaloCluster(icaloCluster) ; + + if (cluster && ( (fCalorimeter == "PHOS" && cluster->IsPHOS()) || + (fCalorimeter == "EMCAL" && cluster->IsEMCAL()))) { - //Get MC data, if available - AliStack* stack = 0x0; - if(MCEvent()) - stack = MCEvent()->Stack(); + Float_t cluEnergy = cluster->E() ; + Float_t pos[3] ; + TVector3 vpos ; - // Get trigger information of fCalorimeter - TArrayF * triggerAmplitudes = 0x0 ; - TArrayF * triggerPosition = 0x0 ; - Int_t numberOfCaloClusters = esd->GetNumberOfCaloClusters() ; + cluster->GetPosition( pos ) ; - if(fCalorimeter == "PHOS"){ - triggerAmplitudes = esd->GetPHOSTriggerAmplitudes(); - triggerPosition = esd->GetPHOSTriggerPosition(); + if ( cluEnergy > enMax) { + enMax = cluEnergy ; + vpos.SetXYZ(pos[0], pos[1], pos[2]) ; + etaMax = vpos.Eta() ; + phiMax = vpos.Phi() ; + labelmax = cluster->GetLabel(); } - else if(fCalorimeter == "EMCAL"){ - triggerAmplitudes = esd->GetEMCALTriggerAmplitudes(); - triggerPosition = esd->GetEMCALTriggerPosition(); - } - - if( triggerAmplitudes && triggerPosition ){ - // trigger amplitudes - const Float_t ka22 = static_cast(triggerAmplitudes->At(0)) ; - const Float_t ka22O = static_cast(triggerAmplitudes->At(1)) ; - const Float_t kaNN = static_cast(triggerAmplitudes->At(2)) ; - const Float_t kaNNO = static_cast(triggerAmplitudes->At(3)) ; - - // trigger position - const Float_t kx22 = static_cast(triggerPosition->At(0)) ; - const Float_t ky22 = static_cast(triggerPosition->At(1)) ; - const Float_t kz22 = static_cast(triggerPosition->At(2)) ; - const Float_t kxNN = static_cast(triggerPosition->At(3)) ; - const Float_t kyNN = static_cast(triggerPosition->At(4)) ; - const Float_t kzNN = static_cast(triggerPosition->At(5)) ; - - //printf("ka22 %f, ka220 %f, kaNN %f, kaNN0 %f\n",ka22,ka22O,kaNN,kaNNO); - //printf("kx22 %f, ky22 %f, kz22 %f, kxNN %f, kyNN %f, kzNN %f \n",kx22,ky22,kz22,kxNN,kyNN,kzNN); - - Float_t enMax = 0. ; - Float_t phEnMax = 0. ; - Float_t etaMax = 0.5 ; - Float_t phiMax = 0. ; - Float_t phEtaMax = 0.5 ; - Float_t phPhiMax = 0. ; - - TVector3 vpos22(kx22, ky22, kz22) ; - TVector3 vposNN(kxNN, kyNN, kzNN) ; - Float_t eta22 = vpos22.Eta() ; - Float_t phi22 = vpos22.Phi() * TMath::RadToDeg() + 360. ; - Float_t etaNN = vposNN.Eta() ; - Float_t phiNN = vposNN.Phi() * TMath::RadToDeg() + 360. ; - - - Int_t icaloCluster = 0 ; - Int_t labelmax = -1 ; - // loop over the Calorimeters Clusters - - for(icaloCluster = 0 ; icaloCluster < numberOfCaloClusters ; icaloCluster++) { - - AliESDCaloCluster * cluster = esd->GetCaloCluster(icaloCluster) ; - - if (cluster && ( (fCalorimeter == "PHOS" && cluster->IsPHOS()) || - (fCalorimeter == "EMCAL" && cluster->IsEMCAL()))) { - - Float_t cluEnergy = cluster->E() ; - Float_t pos[3] ; - TVector3 vpos ; - - cluster->GetPosition( pos ) ; - - if ( cluEnergy > enMax) { - enMax = cluEnergy ; - vpos.SetXYZ(pos[0], pos[1], pos[2]) ; - etaMax = vpos.Eta() ; - phiMax = vpos.Phi() ; - labelmax = cluster->GetLabel(); - } - - Double_t * pid = cluster->GetPid() ; - - if(pid[AliPID::kPhoton] > 0.9) { - if ( cluEnergy > phEnMax) { - phEnMax = cluEnergy ; - vpos.SetXYZ(pos[0], pos[1], pos[2]) ; - phEtaMax = vpos.Eta() ; - phPhiMax = vpos.Phi() ; - } - } - }//if cluster - - Float_t ptGen = -1; - if(stack && labelmax < stack->GetNtrack() && labelmax >= 0 ){ - TParticle * particle = stack->Particle(labelmax); - ptGen = particle->Energy(); - } - - fNtTrigger22->Fill(ka22, ka22O, ptGen, enMax, phEnMax, eta22, phi22, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.); - fNtTriggerNN->Fill(kaNN, kaNNO, ptGen, enMax, phEnMax, etaNN, phiNN, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.); - - }//CaloCluster loop - - }//If trigger arrays filled - PostData(1, fOutputContainer); + Double_t * pid = cluster->GetPid() ; + if(pid[AliPID::kPhoton] > 0.9) { + if ( cluEnergy > phEnMax) { + phEnMax = cluEnergy ; + vpos.SetXYZ(pos[0], pos[1], pos[2]) ; + phEtaMax = vpos.Eta() ; + phPhiMax = vpos.Phi() ; + } + } + }//if cluster + + Float_t ptGen = -1; + if(stack && labelmax < stack->GetNtrack() && labelmax >= 0 ){ + TParticle * particle = stack->Particle(labelmax); + ptGen = particle->Energy(); + } + + fNtTrigger22->Fill(ka22, ka22O, ptGen, enMax, phEnMax, eta22, phi22, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.); + fNtTriggerNN->Fill(kaNN, kaNNO, ptGen, enMax, phEnMax, etaNN, phiNN, etaMax, phiMax * TMath::RadToDeg() + 360., phEtaMax, phPhiMax * TMath::RadToDeg() + 360.); + + }//CaloCluster loop + + }//If trigger arrays filled + + PostData(1, fOutputContainer); + } //______________________________________________________________________________ diff --git a/PWG4/PartCorrDep/AliAnaChargedParticles.cxx b/PWG4/PartCorrDep/AliAnaChargedParticles.cxx new file mode 100755 index 00000000000..684b3aa9b66 --- /dev/null +++ b/PWG4/PartCorrDep/AliAnaChargedParticles.cxx @@ -0,0 +1,321 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: $ */ + +//_________________________________________________________________________ +// +// Class for track selection and identification (not done now) +// Tracks from the CTS are kept in the AOD. +// Few histograms produced. +// +//-- Author: Gustavo Conesa (INFN-LNF) +//_________________________________________________________________________ + + +// --- ROOT system --- +#include "TClonesArray.h" +#include "TParticle.h" +#include "TH2F.h" + +//---- AliRoot system ---- +#include "AliAnaChargedParticles.h" +#include "AliCaloTrackReader.h" +#include "AliAODPWG4Particle.h" +#include "AliStack.h" +#include "AliCaloPID.h" +#include "AliFidutialCut.h" +#include "AliAODTrack.h" + +ClassImp(AliAnaChargedParticles) + +//____________________________________________________________________________ + AliAnaChargedParticles::AliAnaChargedParticles() : + AliAnaPartCorrBaseClass(),fPdg(0), fhPt(0),fhPhi(0),fhEta(0), + fhPtPion(0),fhPhiPion(0),fhEtaPion(0), + fhPtProton(0),fhPhiProton(0),fhEtaProton(0), + fhPtElectron(0),fhPhiElectron(0),fhEtaElectron(0), + fhPtKaon(0),fhPhiKaon(0),fhEtaKaon(0), + fhPtUnknown(0),fhPhiUnknown(0),fhEtaUnknown(0) + +{ + //Default Ctor + + //Initialize parameters + InitParameters(); +} + +//____________________________________________________________________________ +AliAnaChargedParticles::AliAnaChargedParticles(const AliAnaChargedParticles & ch) : + AliAnaPartCorrBaseClass(ch), fPdg(ch.fPdg), fhPt(ch.fhPt), fhPhi(ch.fhPhi),fhEta(ch.fhEta), + fhPtPion(ch. fhPtPion),fhPhiPion(ch.fhPhiPion),fhEtaPion(ch.fhEtaPion), + fhPtProton(ch.fhPtProton),fhPhiProton(ch.fhPhiProton),fhEtaProton(ch.fhEtaProton), + fhPtElectron(ch. fhPtElectron),fhPhiElectron(ch.fhPhiElectron),fhEtaElectron(ch.fhEtaElectron), + fhPtKaon(ch. fhPtKaon),fhPhiKaon(ch.fhPhiKaon),fhEtaKaon(ch.fhEtaKaon), + fhPtUnknown(ch.fhPtUnknown),fhPhiUnknown(ch.fhPhiUnknown),fhEtaUnknown(ch.fhEtaUnknown) + +{ + // cpy ctor + +} + +//_________________________________________________________________________ +AliAnaChargedParticles & AliAnaChargedParticles::operator = (const AliAnaChargedParticles & ch) +{ + // assignment operator + + if(this == &ch)return *this; + ((AliAnaPartCorrBaseClass *)this)->operator=(ch); + + fPdg = ch.fPdg; + fhPt = ch.fhPt; + fhPhi = ch.fhPhi; + fhEta = ch.fhEta; + + fhPtPion = ch. fhPtPion; fhPhiPion = ch.fhPhiPion; fhEtaPion = ch.fhEtaPion; + fhPtProton = ch.fhPtProton; fhPhiProton = ch.fhPhiProton; fhEtaProton = ch.fhEtaProton; + fhPtElectron = ch. fhPtElectron; fhPhiElectron = ch.fhPhiElectron; fhEtaElectron = ch.fhEtaElectron; + fhPtKaon = ch. fhPtKaon; fhPhiKaon = ch.fhPhiKaon; fhEtaKaon = ch.fhEtaKaon; + fhPtUnknown = ch.fhPtUnknown; fhPhiUnknown = ch.fhPhiUnknown; fhEtaUnknown = ch.fhEtaUnknown; + + return *this; + +} + +//________________________________________________________________________ +TList * AliAnaChargedParticles::GetCreateOutputObjects() +{ + // Create histograms to be saved in output file and + // store them in fOutputContainer + + + TList * outputContainer = new TList() ; + outputContainer->SetName("ExampleHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + fhPt = new TH1F ("hPtCharged","p_T distribution", nptbins,ptmin,ptmax); + fhPt->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPt); + + fhPhi = new TH2F ("hPhiCharged","#phi distribution",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhi->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhi); + + fhEta = new TH2F ("hEtaCharged","#eta distribution",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEta->SetXTitle("#eta "); + outputContainer->Add(fhEta); + + + if(IsDataMC()){ + + fhPtPion = new TH1F ("hPtChargedPion","p_T distribution from #pi", nptbins,ptmin,ptmax); + fhPtPion->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtPion); + + fhPhiPion = new TH2F ("hPhiChargedPion","#phi distribution from #pi",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhiPion->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhiPion); + + fhEtaPion = new TH2F ("hEtaChargedPion","#eta distribution from #pi",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEtaPion->SetXTitle("#eta "); + outputContainer->Add(fhEtaPion); + + fhPtProton = new TH1F ("hPtChargedProton","p_T distribution from proton", nptbins,ptmin,ptmax); + fhPtProton->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtProton); + + fhPhiProton = new TH2F ("hPhiChargedProton","#phi distribution from proton",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhiProton->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhiProton); + + fhEtaProton = new TH2F ("hEtaChargedProton","#eta distribution from proton",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEtaProton->SetXTitle("#eta "); + outputContainer->Add(fhEtaProton); + + fhPtKaon = new TH1F ("hPtChargedKaon","p_T distribution from kaon", nptbins,ptmin,ptmax); + fhPtKaon->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtKaon); + + fhPhiKaon = new TH2F ("hPhiChargedKaon","#phi distribution from kaon",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhiKaon->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhiKaon); + + fhEtaKaon = new TH2F ("hEtaChargedKaon","#eta distribution from kaon",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEtaKaon->SetXTitle("#eta "); + outputContainer->Add(fhEtaKaon); + + + fhPtElectron = new TH1F ("hPtChargedElectron","p_T distribution from electron", nptbins,ptmin,ptmax); + fhPtElectron->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtElectron); + + fhPhiElectron = new TH2F ("hPhiChargedElectron","#phi distribution from electron",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhiElectron->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhiElectron); + + fhEtaElectron = new TH2F ("hEtaChargedElectron","#eta distribution from electron",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEtaElectron->SetXTitle("#eta "); + outputContainer->Add(fhEtaElectron); + + fhPtUnknown = new TH1F ("hPtChargedUnknown","p_T distribution from unknown", nptbins,ptmin,ptmax); + fhPtUnknown->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtUnknown); + + fhPhiUnknown = new TH2F ("hPhiChargedUnknown","#phi distribution from unknown",nptbins,ptmin,ptmax, nphibins,phimin,phimax); + fhPhiUnknown->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhiUnknown); + + fhEtaUnknown = new TH2F ("hEtaChargedUnknown","#eta distribution from unknown",nptbins,ptmin,ptmax, netabins,etamin,etamax); + fhEtaUnknown->SetXTitle("#eta "); + outputContainer->Add(fhEtaUnknown); + + } + return outputContainer; +} + +//__________________________________________________ +void AliAnaChargedParticles::InitParameters() +{ + //Initialize the parameters of the analysis. + SetOutputAODClassName("AliAODPWG4Particle"); + SetOutputAODName("Charged"); + fPdg = -1; //Select all tracks + +} + +//__________________________________________________________________ +void AliAnaChargedParticles::Print(const Option_t * opt) const +{ + //Print some relevant parameters set for the analysis + if(! opt) + return; + + printf("Min Pt = %3.2f\n", GetMinPt()); + printf("Max Pt = %3.2f\n", GetMaxPt()); + printf("Select clusters with pdg %d \n",fPdg); + +} + +//____________________________________________________________________________ +void AliAnaChargedParticles::Init() +{ + //Init + //Do some checks + if(!GetReader()->IsCTSSwitchedOn()){ + printf("!!ABORT: You want to use CTS tracks in analysis but not read!! \n!!Check the configuration file!!\n"); + abort(); + } + +} + +//__________________________________________________________________ +void AliAnaChargedParticles::MakeAnalysisFillAOD() +{ + //Do analysis and fill aods + if(!GetAODCTS() || GetAODCTS()->GetEntriesFast() == 0) return ; + Int_t ntracks = GetAODCTS()->GetEntriesFast(); + + //Some prints + if(GetDebug() > 0) + printf("AliAnaChargedParticles : in CTS aod entries %d\n", ntracks); + + //Fill AODParticle with CTS aods + TVector3 p3; + for(Int_t i = 0; i < ntracks; i++){ + + AliAODTrack * track = (AliAODTrack*) (GetAODCTS()->At(i)); + + //Fill AODParticle after some selection + Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; + p3.SetXYZ(mom[0],mom[1],mom[2]); + + //Acceptance selection + Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ; + if(GetDebug() > 1) printf("track pt %2.2f, phi %2.2f, in fidutial cut %d\n",p3.Pt(), p3.Phi(), in); + if(p3.Pt() > GetMinPt() && in) { + //Keep only particles identified with fPdg + //Selection not done for the moment + //Should be done here. + + AliAODPWG4Particle tr = AliAODPWG4Particle(mom[0],mom[1],mom[2],0); + tr.SetDetector("CTS"); + tr.SetLabel(track->GetLabel()); + tr.SetTrackLabel(track->GetID(),-1); + AddAODParticle(tr); + }//selection + }//loop + + if(GetDebug() > 0) + printf("AliAnaChargedParticles: final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); +} + +//__________________________________________________________________ +void AliAnaChargedParticles::MakeAnalysisFillHistograms() +{ + //Do analysis and fill histograms + + //Loop on stored AODParticles + Int_t naod = GetOutputAODBranch()->GetEntriesFast(); + if(GetDebug() > 0) printf("AliAnaChargedParticles::histo aod branch entries %d\n", naod); + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4Particle* tr = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); + + fhPt->Fill(tr->Pt()); + fhPhi->Fill(tr->Pt(), tr->Phi()); + fhEta->Fill(tr->Pt(), tr->Eta()); + + if(IsDataMC()){ + //Play with the MC stack if available + TParticle * mom = GetMCStack()->Particle(tr->GetLabel()); + Int_t mompdg =TMath::Abs(mom->GetPdgCode()); + + if(mompdg==211){ + fhPtPion->Fill(tr->Pt()); + fhPhiPion->Fill(tr->Pt(), tr->Phi()); + fhEtaPion->Fill(tr->Pt(), tr->Eta()); + } + else if(mompdg==2212){ + fhPtProton->Fill(tr->Pt()); + fhPhiProton->Fill(tr->Pt(), tr->Phi()); + fhEtaProton->Fill(tr->Pt(), tr->Eta()); + } + else if(mompdg==321){ + fhPtKaon->Fill(tr->Pt()); + fhPhiKaon->Fill(tr->Pt(), tr->Phi()); + fhEtaKaon->Fill(tr->Pt(), tr->Eta()); + } + else if(mompdg==11){ + fhPtElectron->Fill(tr->Pt()); + fhPhiElectron->Fill(tr->Pt(), tr->Phi()); + fhEtaElectron->Fill(tr->Pt(), tr->Eta()); + } + else { + //printf("unknown pdg %d\n",mompdg); + fhPtUnknown->Fill(tr->Pt()); + fhPhiUnknown->Fill(tr->Pt(), tr->Phi()); + fhEtaUnknown->Fill(tr->Pt(), tr->Eta()); + } + }//Work with stack also + }// aod branch loop + +} diff --git a/PWG4/PartCorrDep/AliAnaChargedParticles.h b/PWG4/PartCorrDep/AliAnaChargedParticles.h new file mode 100755 index 00000000000..78d264ec002 --- /dev/null +++ b/PWG4/PartCorrDep/AliAnaChargedParticles.h @@ -0,0 +1,81 @@ +#ifndef ALIANACHARGEDPARTICLES_H +#define ALIANACHARGEDPARTICLES_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +/* $Id: $ */ + +//_________________________________________________________________________ +// Example class on how to read AODCaloClusters, ESDCaloCells and AODTracks and how +// fill AODs with PWG4PartCorr analysis frame +// Select the type of detector information that you want to analyze, CTS (tracking), PHOS or EMCAL +// Select the PID custer type of the calorimeters +// Set min momentum of the cluster/tracks +// Fill few histograms +// +//-- Author: Gustavo Conesa (INFN-LNF) + +class TH2F; +#include "AliAnaPartCorrBaseClass.h" + +class AliAnaChargedParticles : public AliAnaPartCorrBaseClass { + + public: + + AliAnaChargedParticles() ; // default ctor + AliAnaChargedParticles(const AliAnaChargedParticles & g) ; // cpy ctor + AliAnaChargedParticles & operator = (const AliAnaChargedParticles & g) ;//cpy assignment + virtual ~AliAnaChargedParticles() {;} //virtual dtor + + TList * GetCreateOutputObjects(); + + void Init(); + void InitParameters(); + + void Print(const Option_t * opt) const; + + void MakeAnalysisFillAOD() ; + + void MakeAnalysisFillHistograms() ; + + Int_t GetPdgOfSelectedCharged() const {return fPdg ;} + void SelectChargedWithPdg( Int_t pdg ) {fPdg = pdg; } + + //void Terminate(); + + private: + + Int_t fPdg ; //identified particle id + //Histograms + TH1F * fhPt; //! pT distribution + TH2F * fhPhi; //! phi distribution vs pT + TH2F * fhEta; //! eta distribution vs pT + + //MC + TH1F * fhPtPion; //! pT distribution + TH2F * fhPhiPion; //! phi distribution vs pT + TH2F * fhEtaPion; //! eta distribution vs pT + + TH1F * fhPtProton; //! pT distribution + TH2F * fhPhiProton; //! phi distribution vs pT + TH2F * fhEtaProton; //! eta distribution vs pT + + TH1F * fhPtElectron; //! pT distribution + TH2F * fhPhiElectron; //! phi distribution vs pT + TH2F * fhEtaElectron; //! eta distribution vs pT + + TH1F * fhPtKaon; //! pT distribution + TH2F * fhPhiKaon; //! phi distribution vs pT + TH2F * fhEtaKaon; //! eta distribution vs pT + + TH1F * fhPtUnknown; //! pT distribution + TH2F * fhPhiUnknown; //! phi distribution vs pT + TH2F * fhEtaUnknown; //! eta distribution vs pT + + ClassDef(AliAnaChargedParticles,1) + } ; + + +#endif //ALIANACHARGEDPARTICLES_H + + + diff --git a/PWG4/PartCorrDep/AliAnaExample.cxx b/PWG4/PartCorrDep/AliAnaExample.cxx index b26c5ea1f67..32c62d315f0 100755 --- a/PWG4/PartCorrDep/AliAnaExample.cxx +++ b/PWG4/PartCorrDep/AliAnaExample.cxx @@ -28,20 +28,24 @@ // --- ROOT system --- //#include "Riostream.h" -#include "TClonesArray.h" +#include "TRefArray.h" #include "TParticle.h" #include "TCanvas.h" #include "TPad.h" #include "TROOT.h" +#include "TH2F.h" //---- AliRoot system ---- #include "AliAnaExample.h" #include "AliCaloTrackReader.h" -#include "AliLog.h" #include "AliAODPWG4Particle.h" #include "AliESDCaloCells.h" #include "AliStack.h" #include "AliCaloPID.h" +#include "AliFidutialCut.h" +#include "AliAODCaloCells.h" +#include "AliAODCaloCluster.h" +#include "AliAODTrack.h" ClassImp(AliAnaExample) @@ -100,69 +104,67 @@ AliAnaExample & AliAnaExample::operator = (const AliAnaExample & ex) //________________________________________________________________________ TList * AliAnaExample::GetCreateOutputObjects() { - // Create histograms to be saved in output file and - // store them in fOutputContainer - - AliDebug(1,"Init parton histograms"); - - TList * outputContainer = new TList() ; - outputContainer->SetName("ExampleHistos") ; - - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); - - fhPt = new TH1F ("hPt","p_T distribution", nptbins,ptmin,ptmax); - fhPt->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPt); - - fhPhi = new TH1F ("hPhi","#phi distribution",nphibins,phimin,phimax); - fhPhi->SetXTitle("#phi (rad)"); - outputContainer->Add(fhPhi); - - fhEta = new TH1F ("hEta","#eta distribution",netabins,etamin,etamax); - fhEta->SetXTitle("#eta "); - outputContainer->Add(fhEta); - - if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { - - //Calo cells - fhNCells = new TH1F ("hNCells","# cells per event", 100,0,1000); - fhNCells->SetXTitle("n cells"); - outputContainer->Add(fhNCells); - - fhAmplitude = new TH1F ("hAmplitude","#eta distribution", 100,0,1000); - fhAmplitude->SetXTitle("Amplitude "); - outputContainer->Add(fhAmplitude); - } - - if(IsDataMC()){ - fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fh2Pt->SetXTitle("p_{T,rec} (GeV/c)"); - fh2Pt->SetYTitle("p_{T,gen} (GeV/c)"); - outputContainer->Add(fh2Pt); - - fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax); - fh2Phi->SetXTitle("#phi_{rec} (rad)"); - fh2Phi->SetYTitle("#phi_{gen} (rad)"); - outputContainer->Add(fh2Phi); - - fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax); - fh2Eta->SetXTitle("#eta_{rec} "); - fh2Eta->SetYTitle("#eta_{gen} "); - outputContainer->Add(fh2Eta); - - } - return outputContainer; + // Create histograms to be saved in output file and + // store them in fOutputContainer + + TList * outputContainer = new TList() ; + outputContainer->SetName("ExampleHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + fhPt = new TH1F ("hPt","p_T distribution", nptbins,ptmin,ptmax); + fhPt->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPt); + + fhPhi = new TH1F ("hPhi","#phi distribution",nphibins,phimin,phimax); + fhPhi->SetXTitle("#phi (rad)"); + outputContainer->Add(fhPhi); + + fhEta = new TH1F ("hEta","#eta distribution",netabins,etamin,etamax); + fhEta->SetXTitle("#eta "); + outputContainer->Add(fhEta); + + if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { + + //Calo cells + fhNCells = new TH1F ("hNCells","# cells per event", 100,0,1000); + fhNCells->SetXTitle("n cells"); + outputContainer->Add(fhNCells); + + fhAmplitude = new TH1F ("hAmplitude","#eta distribution", 100,0,1000); + fhAmplitude->SetXTitle("Amplitude "); + outputContainer->Add(fhAmplitude); + } + + if(IsDataMC()){ + fh2Pt = new TH2F ("h2Pt","p_T distribution, reconstructed vs generated", nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fh2Pt->SetXTitle("p_{T,rec} (GeV/c)"); + fh2Pt->SetYTitle("p_{T,gen} (GeV/c)"); + outputContainer->Add(fh2Pt); + + fh2Phi = new TH2F ("h2Phi","#phi distribution, reconstructed vs generated", nphibins,phimin,phimax, nphibins,phimin,phimax); + fh2Phi->SetXTitle("#phi_{rec} (rad)"); + fh2Phi->SetYTitle("#phi_{gen} (rad)"); + outputContainer->Add(fh2Phi); + + fh2Eta = new TH2F ("h2Eta","#eta distribution, reconstructed vs generated", netabins,etamin,etamax,netabins,etamin,etamax); + fh2Eta->SetXTitle("#eta_{rec} "); + fh2Eta->SetYTitle("#eta_{gen} "); + outputContainer->Add(fh2Eta); + + } + return outputContainer; } - //__________________________________________________ +//__________________________________________________ void AliAnaExample::InitParameters() { //Initialize the parameters of the analysis. @@ -190,198 +192,191 @@ void AliAnaExample::Print(const Option_t * opt) const //__________________________________________________________________ void AliAnaExample::MakeAnalysisFillAOD() { - //Do analysis and fill aods - - //Some prints - if(GetDebug() > 0){ - if(fDetector == "EMCAL" && GetAODEMCAL())printf("Example : in EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); - if(fDetector == "CTS" && GetAODCTS())printf("Example : in CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); - if(fDetector == "PHOS" && GetAODPHOS())printf("Example : in PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast()); - } - - //Get List with tracks or clusters - TClonesArray * partList = new TClonesArray; - if(fDetector == "CTS") partList = GetAODCTS(); - else if(fDetector == "EMCAL") partList = GetAODEMCAL(); - else if(fDetector == "PHOS") partList = GetAODPHOS(); - - if(!partList || partList->GetEntriesFast() == 0) return ; - - //Fill AODCaloClusters and AODParticle with PHOS/EMCAL aods - if(fDetector == "EMCAL" || fDetector == "PHOS"){ - - //WORK WITH CALOCLUSTERS - if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC){ - ConnectAODCaloClusters(); //Do Only when filling AODCaloClusters - if(GetDebug() > 0) printf("Example: in calo clusters aod entries %d\n", GetAODCaloClusters()->GetEntriesFast()); - } - //Get vertex for photon momentum calculation - Double_t v[3] ; //vertex ; - GetReader()->GetVertex(v); - - TLorentzVector mom ; - for(Int_t i = 0; i < partList->GetEntriesFast(); i++){ - - AliAODCaloCluster * calo = (AliAODCaloCluster*) (partList->At(i)); - - //Fill AODCaloClusters - if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) - AddAODCaloCluster(AliAODCaloCluster(*(calo))); - - //Fill AODParticle after some selection - calo->GetMomentum(mom,v); - Int_t pdg = fPdg; - - if(IsCaloPIDOn()){ - Double_t pid[13]; - calo->GetPID(pid); - pdg = GetCaloPID()->GetPdg(fDetector,pid,mom.E()); - //pdg = GetCaloPID()->GetPdg(fDetector,mom, - // calo->GetM02(), calo->GetM02(), - // calo->GetDispersion(), 0, 0); - } - - //Acceptance selection - Bool_t in = kTRUE; - if(IsFidutialCutOn()) - in = GetFidutialCut()->IsInFidutialCut(mom,fDetector) ; - - if(GetDebug() > 1) printf("cluster pt %2.2f, phi %2.2f, pdg %d, in fidutial cut %d \n",mom.Pt(), mom.Phi(), pdg, in); - - //Select cluster if momentum, pdg and acceptance are good - if(mom.Pt() > GetMinPt() && pdg ==fPdg && in) { - AliAODPWG4Particle ph = AliAODPWG4Particle(mom); - //AddAODParticleCorrelation(AliAODPWG4ParticleCorrelation(mom)); - ph.SetLabel(calo->GetLabel(0)); - ph.SetPdg(pdg); - ph.SetDetector(fDetector); - AddAODParticle(ph); - }//selection - }//loop - - if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { - //WORK WITH ESDCALOCELLS - //Don't connect in the same analysis PHOS and EMCAL cells. - - AliESDCaloCells * esdCell = new AliESDCaloCells ; - if(fDetector == "PHOS") { - ConnectAODPHOSCells(); //Do Only when filling AODCaloCells - esdCell = (AliESDCaloCells *) GetPHOSCells(); - } - else { - ConnectAODEMCALCells(); //Do Only when filling AODCaloCells - esdCell = (AliESDCaloCells *) GetEMCALCells(); - } - - if(!esdCell) AliFatal("No CELLS available for analysis"); - - //Some prints - if(GetDebug() > 0 && esdCell ) - printf("Example : in ESD %s cell entries %d\n", fDetector.Data(), esdCell->GetNumberOfCells()); - - //Fill AODCells in file - Int_t ncells = esdCell->GetNumberOfCells() ; - GetAODCaloCells()->CreateContainer(ncells); - - GetAODCaloCells()->SetType((AliAODCaloCells::AODCells_t) esdCell->GetType()); - - for (Int_t iCell = 0; iCell < ncells; iCell++) { - if(GetDebug() > 2) printf("cell : amp %f, absId %d, time %f\n", esdCell->GetAmplitude(iCell), esdCell->GetCellNumber(iCell), esdCell->GetTime(iCell)); - - GetAODCaloCells()->SetCell(iCell,esdCell->GetCellNumber(iCell),esdCell->GetAmplitude(iCell)); - } - GetAODCaloCells()->Sort(); - } - }//cluster-cell analysis - else if(fDetector == "CTS"){ //Track analysis - //Fill AODParticle with CTS aods - TVector3 p3; - for(Int_t i = 0; i < GetAODCTS()->GetEntriesFast(); i++){ - - AliAODTrack * track = (AliAODTrack*) (GetAODCTS()->At(i)); - - //Fill AODParticle after some selection - Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; - p3.SetXYZ(mom[0],mom[1],mom[2]); - - //Acceptance selection - Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ; - if(GetDebug() > 1) printf("track pt %2.2f, phi %2.2f, in fidutial cut %d\n",p3.Pt(), p3.Phi(), in); - if(p3.Pt() > GetMinPt() && in) { - AliAODPWG4Particle tr = AliAODPWG4Particle(mom[0],mom[1],mom[2],0); - tr.SetDetector("CTS"); - AddAODParticle(tr); - }//selection - }//loop - }//CTS analysis + //Do analysis and fill aods + + //Some prints + if(GetDebug() > 0){ + if(fDetector == "EMCAL" && GetAODEMCAL())printf("Example : in EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); + if(fDetector == "CTS" && GetAODCTS())printf("Example : in CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); + if(fDetector == "PHOS" && GetAODPHOS())printf("Example : in PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast()); + } + + //Get List with tracks or clusters + TRefArray * partList = new TRefArray(); + if(fDetector == "CTS") partList = GetAODCTS(); + else if(fDetector == "EMCAL") partList = GetAODEMCAL(); + else if(fDetector == "PHOS") partList = GetAODPHOS(); + + if(!partList || partList->GetEntriesFast() == 0) return ; + + //Fill AODCaloClusters and AODParticle with PHOS/EMCAL aods + if(fDetector == "EMCAL" || fDetector == "PHOS"){ + + //Get vertex for photon momentum calculation + Double_t v[3] ; //vertex ; + GetReader()->GetVertex(v); + + TLorentzVector mom ; + for(Int_t i = 0; i < partList->GetEntriesFast(); i++){ + + AliAODCaloCluster * calo = (AliAODCaloCluster*) (partList->At(i)); + + //Fill AODParticle after some selection + calo->GetMomentum(mom,v); + Int_t pdg = fPdg; + + if(IsCaloPIDOn()){ + Double_t pid[13]; + calo->GetPID(pid); + pdg = GetCaloPID()->GetPdg(fDetector,pid,mom.E()); + //pdg = GetCaloPID()->GetPdg(fDetector,mom, + // calo->GetM02(), calo->GetM02(), + // calo->GetDispersion(), 0, 0); + } + + //Acceptance selection + Bool_t in = kTRUE; + if(IsFidutialCutOn()) + in = GetFidutialCut()->IsInFidutialCut(mom,fDetector) ; + + if(GetDebug() > 1) printf("cluster pt %2.2f, phi %2.2f, pdg %d, in fidutial cut %d \n",mom.Pt(), mom.Phi(), pdg, in); + + //Select cluster if momentum, pdg and acceptance are good + if(mom.Pt() > GetMinPt() && pdg ==fPdg && in) { + AliAODPWG4Particle ph = AliAODPWG4Particle(mom); + //AddAODParticleCorrelation(AliAODPWG4ParticleCorrelation(mom)); + ph.SetLabel(calo->GetLabel(0)); + ph.SetPdg(pdg); + ph.SetDetector(fDetector); + AddAODParticle(ph); + }//selection + }//loop + + if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { + //WORK WITH ESDCALOCELLS + //Don't connect in the same analysis PHOS and EMCAL cells. + + AliESDCaloCells * esdCell = new AliESDCaloCells ; + if(fDetector == "PHOS") { + //ConnectAODPHOSCells(); //Do Only when filling AODCaloCells + esdCell = (AliESDCaloCells *) GetPHOSCells(); + } + else { + //ConnectAODEMCALCells(); //Do Only when filling AODCaloCells + esdCell = (AliESDCaloCells *) GetEMCALCells(); + } + + if(!esdCell) { + printf("FillAOD ABORT: No CELLS available for analysis"); + abort(); + } + //Some prints + if(GetDebug() > 0 && esdCell ) + printf("Example : in ESD %s cell entries %d\n", fDetector.Data(), esdCell->GetNumberOfCells()); + + //Fill AODCells in file + Int_t ncells = esdCell->GetNumberOfCells() ; + GetAODCaloCells()->CreateContainer(ncells); + + GetAODCaloCells()->SetType((AliAODCaloCells::AODCells_t) esdCell->GetType()); + + for (Int_t iCell = 0; iCell < ncells; iCell++) { + if(GetDebug() > 2) printf("cell : amp %f, absId %d, time %f\n", esdCell->GetAmplitude(iCell), esdCell->GetCellNumber(iCell), esdCell->GetTime(iCell)); - if(GetDebug() > 0) { - if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) - printf("Example: final aod calocluster entries %d\n", GetAODCaloClusters()->GetEntriesFast()); - printf("Example: final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); - // if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) - //printf("Example: final aod cell entries %d\n", GetAODCaloCells()->GetNumberOfCells()); - } + GetAODCaloCells()->SetCell(iCell,esdCell->GetCellNumber(iCell),esdCell->GetAmplitude(iCell)); + } + GetAODCaloCells()->Sort(); + } + }//cluster-cell analysis + else if(fDetector == "CTS"){ //Track analysis + //Fill AODParticle with CTS aods + TVector3 p3; + for(Int_t i = 0; i < GetAODCTS()->GetEntriesFast(); i++){ + + AliAODTrack * track = (AliAODTrack*) (GetAODCTS()->At(i)); + + //Fill AODParticle after some selection + Double_t mom[3] = {track->Px(),track->Py(),track->Pz()}; + p3.SetXYZ(mom[0],mom[1],mom[2]); + + //Acceptance selection + Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ; + if(GetDebug() > 1) printf("track pt %2.2f, phi %2.2f, in fidutial cut %d\n",p3.Pt(), p3.Phi(), in); + if(p3.Pt() > GetMinPt() && in) { + AliAODPWG4Particle tr = AliAODPWG4Particle(mom[0],mom[1],mom[2],0); + tr.SetDetector("CTS"); + AddAODParticle(tr); + }//selection + }//loop + }//CTS analysis + + if(GetDebug() > 0) { + if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) + //printf("Example: final aod calocluster entries %d\n", GetAODCaloClusters()->GetEntriesFast()); + printf("Example: final aod branch entries %d\n", GetOutputAODBranch()->GetEntriesFast()); + // if(fDetector!="CTS" && GetReader()->GetDataType()!= AliCaloTrackReader::kMC) + //printf("Example: final aod cell entries %d\n", GetAODCaloCells()->GetNumberOfCells()); + } } //__________________________________________________________________ void AliAnaExample::MakeAnalysisFillHistograms() { - //Do analysis and fill histograms - - //Loop on stored AODParticles - Int_t naod = GetOutputAODBranch()->GetEntriesFast(); - if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod); - for(Int_t iaod = 0; iaod < naod ; iaod++){ - AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); - - fhPt->Fill(ph->Pt()); - fhPhi->Fill(ph->Phi()); - fhEta->Fill(ph->Eta()); - - if(IsDataMC()){ - //Play with the MC stack if available - AliStack * stack = GetMCStack() ; - - if(ph->GetLabel() < 0 || !stack) { - printf("*** bad label or no stack ***: label %d \n", ph->GetLabel()); - continue; - } - - if(ph->GetLabel() >= stack->GetNtrack()) { - printf("*** large label ***: label %d, n tracks %d \n", ph->GetLabel(), stack->GetNtrack()); - continue ; - } - - TParticle * mom = GetMCStack()->Particle(ph->GetLabel()); - - fh2Pt->Fill(ph->Pt(), mom->Pt()); - fh2Phi->Fill(ph->Phi(), mom->Phi()); - fh2Eta->Fill(ph->Eta(), mom->Eta()); - }//Work with stack also - }// aod branch loop - - // CaloCells histograms - if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { - if(GetAODCaloCells()){ - - Int_t ncells = GetAODCaloCells()->GetNumberOfCells(); - fhNCells->Fill(ncells) ; - - for (Int_t iCell = 0; iCell < ncells; iCell++) { - if(GetDebug() > 2) printf("cell : amp %f, absId %d \n", GetAODCaloCells()->GetAmplitude(iCell), GetAODCaloCells()->GetCellNumber(iCell)); - fhAmplitude->Fill(GetAODCaloCells()->GetAmplitude(iCell)); - } - }//calo cells container exist - } + //Do analysis and fill histograms + + //Loop on stored AODParticles + Int_t naod = GetOutputAODBranch()->GetEntriesFast(); + if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod); + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); + + fhPt->Fill(ph->Pt()); + fhPhi->Fill(ph->Phi()); + fhEta->Fill(ph->Eta()); + + if(IsDataMC()){ + //Play with the MC stack if available + AliStack * stack = GetMCStack() ; + + if(ph->GetLabel() < 0 || !stack) { + printf("*** bad label or no stack ***: label %d \n", ph->GetLabel()); + continue; + } + + if(ph->GetLabel() >= stack->GetNtrack()) { + printf("*** large label ***: label %d, n tracks %d \n", ph->GetLabel(), stack->GetNtrack()); + continue ; + } + + TParticle * mom = GetMCStack()->Particle(ph->GetLabel()); + + fh2Pt->Fill(ph->Pt(), mom->Pt()); + fh2Phi->Fill(ph->Phi(), mom->Phi()); + fh2Eta->Fill(ph->Eta(), mom->Eta()); + }//Work with stack also + }// aod branch loop + + // CaloCells histograms + if(GetReader()->GetDataType()!= AliCaloTrackReader::kMC) { + if(GetAODCaloCells()){ + + Int_t ncells = GetAODCaloCells()->GetNumberOfCells(); + fhNCells->Fill(ncells) ; + + for (Int_t iCell = 0; iCell < ncells; iCell++) { + if(GetDebug() > 2) printf("cell : amp %f, absId %d \n", GetAODCaloCells()->GetAmplitude(iCell), GetAODCaloCells()->GetCellNumber(iCell)); + fhAmplitude->Fill(GetAODCaloCells()->GetAmplitude(iCell)); + } + }//calo cells container exist + } } //__________________________________________________________________ void AliAnaExample::Terminate() { - + //Do some plots to end - + printf(" *** %s Report:", GetName()) ; printf(" pt : %5.3f , RMS : %5.3f \n", fhPt->GetMean(), fhPt->GetRMS() ) ; diff --git a/PWG4/PartCorrDep/AliAnaExample.h b/PWG4/PartCorrDep/AliAnaExample.h index a034079c6b0..891a4110a22 100755 --- a/PWG4/PartCorrDep/AliAnaExample.h +++ b/PWG4/PartCorrDep/AliAnaExample.h @@ -14,53 +14,57 @@ // //-- Author: Gustavo Conesa (INFN-LNF) -#include "TH2F.h" +// --- Root system --- +class TH2F; +class TH1F; + +// --- Analysis system --- #include "AliAnaPartCorrBaseClass.h" class AliAnaExample : public AliAnaPartCorrBaseClass { - - public: - - AliAnaExample() ; // default ctor - AliAnaExample(const AliAnaExample & g) ; // cpy ctor - AliAnaExample & operator = (const AliAnaExample & g) ;//cpy assignment - virtual ~AliAnaExample() {;} //virtual dtor - - TList * GetCreateOutputObjects(); - - void InitParameters(); - - void Print(const Option_t * opt) const; - - void MakeAnalysisFillAOD() ; - - void MakeAnalysisFillHistograms() ; - - Int_t GetPdg() const {return fPdg ;} - void SetPdg( Int_t pdg ) {fPdg = pdg; } - - TString GetDetector() const {return fDetector ;} - void SetDetector( TString calo ) {fDetector = calo; } - - void Terminate(); - + + public: + + AliAnaExample() ; // default ctor + AliAnaExample(const AliAnaExample & g) ; // cpy ctor + AliAnaExample & operator = (const AliAnaExample & g) ;//cpy assignment + virtual ~AliAnaExample() {;} //virtual dtor + + TList * GetCreateOutputObjects(); + + void InitParameters(); + + void Print(const Option_t * opt) const; + + void MakeAnalysisFillAOD() ; + + void MakeAnalysisFillHistograms() ; + + Int_t GetPdg() const {return fPdg ;} + void SetPdg( Int_t pdg ) {fPdg = pdg; } + + TString GetDetector() const {return fDetector ;} + void SetDetector( TString calo ) {fDetector = calo; } + + void Terminate(); + private: - - Int_t fPdg ; //identified particle id - TString fDetector ; //detector selection - //Histograms - //CaloClusters - TH1F * fhPt; //! pT distribution - TH1F * fhPhi; //! phi distribution - TH1F * fhEta; //! eta distribution - TH2F * fh2Pt; //!pT distribution, reconstructed vs generated - TH2F * fh2Phi; //! phi distribution, reconstructed vs generated - TH2F * fh2Eta; //! eta distribution, reconstructed vs generated - //Calo Cells - TH1F * fhNCells; //! Number of towers/crystals with signal - TH1F * fhAmplitude; //! Amplitude measured in towers/crystals - ClassDef(AliAnaExample,1) - } ; + + Int_t fPdg ; //identified particle id + TString fDetector ; //detector selection + //Histograms + //CaloClusters + TH1F * fhPt; //! pT distribution + TH1F * fhPhi; //! phi distribution + TH1F * fhEta; //! eta distribution + TH2F * fh2Pt; //!pT distribution, reconstructed vs generated + TH2F * fh2Phi; //! phi distribution, reconstructed vs generated + TH2F * fh2Eta; //! eta distribution, reconstructed vs generated + //Calo Cells + TH1F * fhNCells; //! Number of towers/crystals with signal + TH1F * fhAmplitude; //! Amplitude measured in towers/crystals + ClassDef(AliAnaExample,1) + } ; #endif //ALIANAEXAMPLE_H diff --git a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx index 1e8607ab6b0..249cb41b724 100755 --- a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.cxx @@ -23,14 +23,17 @@ // --- ROOT system --- #include "TH2F.h" +#include "TClonesArray.h" //---- ANALYSIS system ---- -#include "AliLog.h" #include "AliNeutralMesonSelection.h" #include "AliAnaParticleHadronCorrelation.h" #include "AliCaloTrackReader.h" #include "AliCaloPID.h" #include "AliAODPWG4ParticleCorrelation.h" +#include "AliFidutialCut.h" +#include "AliAODTrack.h" +#include "AliAODCaloCluster.h" ClassImp(AliAnaParticleHadronCorrelation) @@ -39,14 +42,14 @@ ClassImp(AliAnaParticleHadronCorrelation) AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation() : AliAnaPartCorrBaseClass(), fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.), fSelectIsolated(0), - fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0), + fhPhiCharged(0), fhPhiNeutral(0), fhEtaCharged(0), fhEtaNeutral(0), fhDeltaPhiCharged(0), fhDeltaPhiNeutral(0), fhDeltaEtaCharged(0), fhDeltaEtaNeutral(0), fhDeltaPhiChargedPt(0), fhDeltaPhiNeutralPt(0), fhPtImbalanceNeutral(0), fhPtImbalanceCharged(0) { //Default Ctor - + //Initialize parameters InitParameters(); } @@ -68,21 +71,21 @@ AliAnaParticleHadronCorrelation::AliAnaParticleHadronCorrelation(const AliAnaPar fhPtImbalanceCharged(g.fhPtImbalanceCharged) { // cpy ctor - + } //_________________________________________________________________________ AliAnaParticleHadronCorrelation & AliAnaParticleHadronCorrelation::operator = (const AliAnaParticleHadronCorrelation & source) { // assignment operator - + if(this == &source)return *this; ((AliAnaPartCorrBaseClass *)this)->operator=(source); fDeltaPhiMaxCut = source.fDeltaPhiMaxCut ; fDeltaPhiMinCut = source.fDeltaPhiMinCut ; fSelectIsolated = source.fSelectIsolated ; - + fhPhiCharged = source.fhPhiCharged ; fhPhiNeutral = source.fhPhiNeutral ; fhEtaCharged = source.fhEtaCharged ; fhEtaNeutral = source.fhEtaNeutral ; fhDeltaPhiCharged = source.fhDeltaPhiCharged ; @@ -91,7 +94,7 @@ AliAnaParticleHadronCorrelation & AliAnaParticleHadronCorrelation::operator = (c fhDeltaEtaCharged = source.fhDeltaEtaCharged ; fhDeltaEtaNeutral = source.fhDeltaEtaNeutral ; fhDeltaPhiChargedPt = source.fhDeltaPhiChargedPt ; - + fhPtImbalanceNeutral = source.fhPtImbalanceNeutral ; fhPtImbalanceCharged = source.fhPtImbalanceCharged ; @@ -102,131 +105,131 @@ AliAnaParticleHadronCorrelation & AliAnaParticleHadronCorrelation::operator = (c //________________________________________________________________________ TList * AliAnaParticleHadronCorrelation::GetCreateOutputObjects() { - - // Create histograms to be saved in output file and - // store them in fOutputContainer - TList * outputContainer = new TList() ; - outputContainer->SetName("CorrelationHistos") ; - - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); - - //Correlation with charged hadrons - if(GetReader()->IsCTSSwitchedOn()) { - fhPhiCharged = new TH2F - ("PhiCharged","#phi_{h^{#pm}} vs p_{T trigger}", - nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)"); - fhPhiCharged->SetXTitle("p_{T trigger} (GeV/c)"); - - fhEtaCharged = new TH2F - ("EtaCharged","#eta_{h^{#pm}} vs p_{T trigger}", - nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)"); - fhEtaCharged->SetXTitle("p_{T trigger} (GeV/c)"); - - fhDeltaPhiCharged = new TH2F - ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}", - nptbins,ptmin,ptmax,200,0,6.4); - fhDeltaPhiCharged->SetYTitle("#Delta #phi"); - fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)"); - - fhDeltaPhiChargedPt = new TH2F - ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#p^{#pm}i} vs p_{T h^{#pm}}", - nptbins,ptmin,ptmax,200,0,6.4); - fhDeltaPhiChargedPt->SetYTitle("#Delta #phi"); - fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)"); - - fhDeltaEtaCharged = new TH2F - ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}", - nptbins,ptmin,ptmax,200,-2,2); - fhDeltaEtaCharged->SetYTitle("#Delta #eta"); - fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)"); - - fhPtImbalanceCharged = - new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}", - nptbins,ptmin,ptmax,1000,0.,1.2); - fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}"); - fhPtImbalanceCharged->SetXTitle("p_{T trigger}"); - - outputContainer->Add(fhPhiCharged) ; - outputContainer->Add(fhEtaCharged) ; - outputContainer->Add(fhDeltaPhiCharged) ; - outputContainer->Add(fhDeltaEtaCharged) ; - outputContainer->Add(fhPtImbalanceCharged) ; - outputContainer->Add(fhDeltaPhiChargedPt) ; - } //Correlation with charged hadrons - - //Correlation with neutral hadrons - if(GetReader()->IsEMCALSwitchedOn() || GetReader()->IsPHOSSwitchedOn()){ - - fhPhiNeutral = new TH2F - ("PhiNeutral","#phi_{#pi^{0}} vs p_{T trigger}", - nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)"); - fhPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)"); - - fhEtaNeutral = new TH2F - ("EtaNeutral","#eta_{#pi^{0}} vs p_{T trigger}", - nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)"); - fhEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)"); - - fhDeltaPhiNeutral = new TH2F - ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}", - nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhDeltaPhiNeutral->SetYTitle("#Delta #phi"); - fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)"); - - fhDeltaPhiNeutralPt = new TH2F - ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}", - nptbins,ptmin,ptmax,200,0,6.4); - fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi"); - fhDeltaPhiNeutralPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhDeltaEtaNeutral = new TH2F - ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}", - nptbins,ptmin,ptmax,200,-2,2); - fhDeltaEtaNeutral->SetYTitle("#Delta #eta"); - fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)"); - - fhPtImbalanceNeutral = - new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}", - nptbins,ptmin,ptmax,1000,0.,1.2); - fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}"); - fhPtImbalanceNeutral->SetXTitle("p_{T trigger}"); - - outputContainer->Add(fhPhiNeutral) ; - outputContainer->Add(fhEtaNeutral) ; - outputContainer->Add(fhDeltaPhiNeutral) ; - outputContainer->Add(fhDeltaEtaNeutral) ; - outputContainer->Add(fhPtImbalanceNeutral) ; - - - //Keep neutral meson selection histograms if requiered - //Setting done in AliNeutralMesonSelection - if(GetNeutralMesonSelection()){ - TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; - if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) - for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; - } - - }//Correlation with neutral hadrons - - return outputContainer; + + // Create histograms to be saved in output file and + // store them in fOutputContainer + TList * outputContainer = new TList() ; + outputContainer->SetName("CorrelationHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + //Correlation with charged hadrons + if(GetReader()->IsCTSSwitchedOn()) { + fhPhiCharged = new TH2F + ("PhiCharged","#phi_{h^{#pm}} vs p_{T trigger}", + nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiCharged->SetYTitle("#phi_{h^{#pm}} (rad)"); + fhPhiCharged->SetXTitle("p_{T trigger} (GeV/c)"); + + fhEtaCharged = new TH2F + ("EtaCharged","#eta_{h^{#pm}} vs p_{T trigger}", + nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaCharged->SetYTitle("#eta_{h^{#pm}} (rad)"); + fhEtaCharged->SetXTitle("p_{T trigger} (GeV/c)"); + + fhDeltaPhiCharged = new TH2F + ("DeltaPhiCharged","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}", + nptbins,ptmin,ptmax,200,0,6.4); + fhDeltaPhiCharged->SetYTitle("#Delta #phi"); + fhDeltaPhiCharged->SetXTitle("p_{T trigger} (GeV/c)"); + + fhDeltaPhiChargedPt = new TH2F + ("DeltaPhiChargedPt","#phi_{trigger} - #phi_{#p^{#pm}i} vs p_{T h^{#pm}}", + nptbins,ptmin,ptmax,200,0,6.4); + fhDeltaPhiChargedPt->SetYTitle("#Delta #phi"); + fhDeltaPhiChargedPt->SetXTitle("p_{T h^{#pm}} (GeV/c)"); + + fhDeltaEtaCharged = new TH2F + ("DeltaEtaCharged","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}", + nptbins,ptmin,ptmax,200,-2,2); + fhDeltaEtaCharged->SetYTitle("#Delta #eta"); + fhDeltaEtaCharged->SetXTitle("p_{T trigger} (GeV/c)"); + + fhPtImbalanceCharged = + new TH2F("CorrelationCharged","z_{trigger h^{#pm}} = p_{T h^{#pm}} / p_{T trigger}", + nptbins,ptmin,ptmax,1000,0.,1.2); + fhPtImbalanceCharged->SetYTitle("z_{trigger h^{#pm}}"); + fhPtImbalanceCharged->SetXTitle("p_{T trigger}"); + + outputContainer->Add(fhPhiCharged) ; + outputContainer->Add(fhEtaCharged) ; + outputContainer->Add(fhDeltaPhiCharged) ; + outputContainer->Add(fhDeltaEtaCharged) ; + outputContainer->Add(fhPtImbalanceCharged) ; + outputContainer->Add(fhDeltaPhiChargedPt) ; + } //Correlation with charged hadrons + + //Correlation with neutral hadrons + if(GetReader()->IsEMCALSwitchedOn() || GetReader()->IsPHOSSwitchedOn()){ + + fhPhiNeutral = new TH2F + ("PhiNeutral","#phi_{#pi^{0}} vs p_{T trigger}", + nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiNeutral->SetYTitle("#phi_{#pi^{0}} (rad)"); + fhPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)"); + + fhEtaNeutral = new TH2F + ("EtaNeutral","#eta_{#pi^{0}} vs p_{T trigger}", + nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaNeutral->SetYTitle("#eta_{#pi^{0}} (rad)"); + fhEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)"); + + fhDeltaPhiNeutral = new TH2F + ("DeltaPhiNeutral","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}", + nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhDeltaPhiNeutral->SetYTitle("#Delta #phi"); + fhDeltaPhiNeutral->SetXTitle("p_{T trigger} (GeV/c)"); + + fhDeltaPhiNeutralPt = new TH2F + ("DeltaPhiNeutralPt","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T #pi^{0}}}", + nptbins,ptmin,ptmax,200,0,6.4); + fhDeltaPhiNeutralPt->SetYTitle("#Delta #phi"); + fhDeltaPhiNeutralPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhDeltaEtaNeutral = new TH2F + ("DeltaEtaNeutral","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}", + nptbins,ptmin,ptmax,200,-2,2); + fhDeltaEtaNeutral->SetYTitle("#Delta #eta"); + fhDeltaEtaNeutral->SetXTitle("p_{T trigger} (GeV/c)"); + + fhPtImbalanceNeutral = + new TH2F("CorrelationNeutral","z_{trigger #pi} = p_{T #pi^{0}} / p_{T trigger}", + nptbins,ptmin,ptmax,1000,0.,1.2); + fhPtImbalanceNeutral->SetYTitle("z_{trigger #pi^{0}}"); + fhPtImbalanceNeutral->SetXTitle("p_{T trigger}"); + + outputContainer->Add(fhPhiNeutral) ; + outputContainer->Add(fhEtaNeutral) ; + outputContainer->Add(fhDeltaPhiNeutral) ; + outputContainer->Add(fhDeltaEtaNeutral) ; + outputContainer->Add(fhPtImbalanceNeutral) ; + + + //Keep neutral meson selection histograms if requiered + //Setting done in AliNeutralMesonSelection + if(GetNeutralMesonSelection()){ + TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; + if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) + for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; + } + + }//Correlation with neutral hadrons + + return outputContainer; } - //____________________________________________________________________________ +//____________________________________________________________________________ void AliAnaParticleHadronCorrelation::InitParameters() { - + //Initialize the parameters of the analysis. SetInputAODName("photons"); SetPtCutRange(2,300); @@ -254,85 +257,87 @@ void AliAnaParticleHadronCorrelation::Print(const Option_t * opt) const //____________________________________________________________________________ void AliAnaParticleHadronCorrelation::MakeAnalysisFillAOD() { - //Particle-Hadron Correlation Analysis, fill AODs - - if(!GetInputAODBranch()) - AliFatal(Form("ParticleHadronCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - - if(GetDebug() > 1){ - printf("Begin hadron correlation analysis, fill AODs \n"); - printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); - printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); - printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); - printf("In PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast()); - } - - //Loop on stored AOD particles, trigger - Int_t naod = GetInputAODBranch()->GetEntriesFast(); - for(Int_t iaod = 0; iaod < naod ; iaod++){ - AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - //Make correlation with charged hadrons - if(GetReader()->IsCTSSwitchedOn() ) - MakeChargedCorrelation(particle, (TSeqCollection*)GetAODCTS(),kFALSE); - - //Make correlation with neutral pions - //Trigger particle in PHOS, correlation with EMCAL - if(particle->GetDetector()=="PHOS" && GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0) - MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE); - //Trigger particle in EMCAL, correlation with PHOS - else if(particle->GetDetector()=="EMCAL" && GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0) - MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE); - //Trigger particle in CTS, correlation with PHOS, EMCAL and CTS - else if(particle->GetDetector()=="CTS" ){ - if(GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0) - MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE); - if(GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0) - MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE); - } - - }//Aod branch loop - - if(GetDebug() > 1) printf("End hadron correlation analysis, fill AODs \n"); - + //Particle-Hadron Correlation Analysis, fill AODs + + if(!GetInputAODBranch()){ + printf("ParticleHadronCorrelation::FillAOD: No input particles in AOD with name branch < %s >, ABORT \n",GetInputAODName().Data()); + abort(); + } + if(GetDebug() > 1){ + printf("Begin hadron correlation analysis, fill AODs \n"); + printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); + printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); + printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); + printf("In PHOS aod entries %d\n", GetAODPHOS()->GetEntriesFast()); + } + + //Loop on stored AOD particles, trigger + Int_t naod = GetInputAODBranch()->GetEntriesFast(); + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + //Make correlation with charged hadrons + if(GetReader()->IsCTSSwitchedOn() ) + MakeChargedCorrelation(particle, (TSeqCollection*)GetAODCTS(),kFALSE); + + //Make correlation with neutral pions + //Trigger particle in PHOS, correlation with EMCAL + if(particle->GetDetector()=="PHOS" && GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0) + MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE); + //Trigger particle in EMCAL, correlation with PHOS + else if(particle->GetDetector()=="EMCAL" && GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0) + MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE); + //Trigger particle in CTS, correlation with PHOS, EMCAL and CTS + else if(particle->GetDetector()=="CTS" ){ + if(GetReader()->IsPHOSSwitchedOn() && GetAODPHOS()->GetEntriesFast() > 0) + MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODPHOS(),kFALSE); + if(GetReader()->IsEMCALSwitchedOn() && GetAODEMCAL()->GetEntriesFast() > 0) + MakeNeutralCorrelation(particle,(TSeqCollection*)GetAODEMCAL(),kFALSE); + } + + }//Aod branch loop + + if(GetDebug() > 1) printf("End hadron correlation analysis, fill AODs \n"); + } //____________________________________________________________________________ void AliAnaParticleHadronCorrelation::MakeAnalysisFillHistograms() { - //Particle-Hadron Correlation Analysis, fill histograms - - if(!GetInputAODBranch()) - AliFatal(Form("ParticleHadronCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - - if(GetDebug() > 1){ - printf("Begin hadron correlation analysis, fill histograms \n"); - printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); - } - - //Loop on stored AOD particles - Int_t naod = GetInputAODBranch()->GetEntriesFast(); - for(Int_t iaod = 0; iaod < naod ; iaod++){ - AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - - if(GetDebug() > 1){ - printf("Particle %d, In Track Refs entries %d\n", iaod, (particle->GetRefTracks())->GetEntriesFast()); - printf("Particle %d, In Cluster Refs entries %d\n",iaod, (particle->GetRefClusters())->GetEntriesFast()); - } - - if(OnlyIsolated() && !particle->IsIsolated()) continue; - - //Make correlation with charged hadrons - if((particle->GetRefTracks())->GetEntriesFast() > 0) - MakeChargedCorrelation(particle, (TSeqCollection*) (particle->GetRefTracks()),kTRUE); - - //Make correlation with neutral pions - if((particle->GetRefClusters())->GetEntriesFast() > 0) - MakeNeutralCorrelation(particle, (TSeqCollection*) (particle->GetRefClusters()), kTRUE); - - }//Aod branch loop - - if(GetDebug() > 1) printf("End hadron correlation analysis, fill histograms \n"); - + //Particle-Hadron Correlation Analysis, fill histograms + + if(!GetInputAODBranch()){ + printf("ParticleHadronCorrelation::FillHistos: No input particles in AOD with name branch < %s >, ABORT \n",GetInputAODName().Data()); + abort(); + } + if(GetDebug() > 1){ + printf("Begin hadron correlation analysis, fill histograms \n"); + printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); + } + + //Loop on stored AOD particles + Int_t naod = GetInputAODBranch()->GetEntriesFast(); + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + + if(GetDebug() > 1){ + printf("Particle %d, In Track Refs entries %d\n", iaod, (particle->GetRefTracks())->GetEntriesFast()); + printf("Particle %d, In Cluster Refs entries %d\n",iaod, (particle->GetRefClusters())->GetEntriesFast()); + } + + if(OnlyIsolated() && !particle->IsIsolated()) continue; + + //Make correlation with charged hadrons + if((particle->GetRefTracks())->GetEntriesFast() > 0) + MakeChargedCorrelation(particle, (TSeqCollection*) (particle->GetRefTracks()),kTRUE); + + //Make correlation with neutral pions + if((particle->GetRefClusters())->GetEntriesFast() > 0) + MakeNeutralCorrelation(particle, (TSeqCollection*) (particle->GetRefClusters()), kTRUE); + + }//Aod branch loop + + if(GetDebug() > 1) printf("End hadron correlation analysis, fill histograms \n"); + } //____________________________________________________________________________ @@ -348,6 +353,7 @@ void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Particle Double_t phi = -100. ; Double_t eta = -100. ; Double_t p[3]; + Bool_t first=kTRUE; //Track loop, select tracks with good pt, phi and fill AODs or histograms for(Int_t ipr = 0;ipr < pl->GetEntries() ; ipr ++ ){ @@ -359,7 +365,7 @@ void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Particle phi = mom.Phi() ; if(phi<0) phi+=TMath::TwoPi(); rat = pt/ptTrig ; - + if(IsFidutialCutOn()){ Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,"CTS") ; if(! in ) continue ; @@ -387,6 +393,12 @@ void AliAnaParticleHadronCorrelation::MakeChargedCorrelation(AliAODPWG4Particle } else{ //Fill AODs + + if(first) { + new (aodParticle->GetRefTracks()) TRefArray(TProcessID::GetProcessWithUID(track)); + first = kFALSE; + } + aodParticle->AddTrack(track); }//aod particle loop @@ -406,7 +418,8 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Particle Double_t ptTrig = aodParticle->Pt(); Double_t phiTrig = aodParticle->Phi(); Double_t etaTrig = aodParticle->Eta(); - + Bool_t first = kTRUE; + TLorentzVector gammai; TLorentzVector gammaj; @@ -418,26 +431,31 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Particle for(Int_t iclus = 0;iclus < pl->GetEntries() ; iclus ++ ){ AliAODCaloCluster * calo = (AliAODCaloCluster *) (pl->At(iclus)) ; if(!bFillHisto){ - + //Cluster selection, not charged, with photon or pi0 id and in fidutial cut Int_t pdg=0; if(!SelectCluster(calo, vertex, gammai, pdg)) continue ; - if(GetDebug() > 2) - printf("neutral cluster: pt %f, phi %f, phi trigger %f. Cuts: delta phi min %2.2f, max%2.2f, pT min %2.2f \n", - gammai.Pt(),gammai.Phi(),phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt()); - + if(GetDebug() > 2) + printf("neutral cluster: pt %f, phi %f, phi trigger %f. Cuts: delta phi min %2.2f, max%2.2f, pT min %2.2f \n", + gammai.Pt(),gammai.Phi(),phiTrig,fDeltaPhiMinCut, fDeltaPhiMaxCut, GetMinPt()); + //2 gamma overlapped, found with PID if(pdg == AliCaloPID::kPi0){ - + //Select only hadrons in pt range if(gammai.Pt() < GetMinPt() || gammai.Pt() > GetMaxPt()) continue ; - + + if(first) { + new (aodParticle->GetRefClusters()) TRefArray(TProcessID::GetProcessWithUID(calo)); + first = kFALSE; + } + aodParticle->AddCluster(calo); if(GetDebug() > 2) printf("Correlated with selected pi0 (pid): pt %f, phi %f",gammai.Pt(),gammai.Phi()); - + }// pdg = 111 - + //Make invariant mass analysis else if(pdg == AliCaloPID::kPhoton){ //Search the photon companion in case it comes from a Pi0 decay @@ -448,21 +466,29 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Particle //Cluster selection, not charged with photon or pi0 id and in fidutial cut Int_t pdgj=0; if(!SelectCluster(calo2,vertex, gammaj, pdgj)) continue ; - + if(pdgj == AliCaloPID::kPhoton ){ if((gammai+gammaj).Pt() < GetMinPt() || (gammai+gammaj).Pt() > GetMaxPt()) continue ; //Select good pair (aperture and invariant mass) if(GetNeutralMesonSelection()->SelectPair(gammai, gammaj)){ - + if(GetDebug() > 2 ) printf("Neutral Hadron Correlation: AOD Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f", (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M()); Int_t labels[]={calo->GetLabel(0),calo2->GetLabel(0)}; Float_t pid[]={0,0,0,0,0,0,1,0,0,0,0,0,0};//Pi0 weight 1 Float_t pos[]={(gammai+gammaj).X(), (gammai+gammaj).Y(), (gammai+gammaj).Z()}; - + AliAODCaloCluster *caloCluster = new AliAODCaloCluster(0,2,labels,(gammai+gammaj).E(), pos, pid,calo->GetType(),0); + //Put this new object in file, need to think better how to do this!!!! + GetReader()->GetAODEMCAL()->Add(caloCluster); + + if(first) { + new (aodParticle->GetRefClusters()) TRefArray(TProcessID::GetProcessWithUID(caloCluster)); + first = kFALSE; + } + aodParticle->AddCluster(caloCluster); }//Pair selected }//if pair of gammas @@ -479,7 +505,7 @@ void AliAnaParticleHadronCorrelation::MakeNeutralCorrelation(AliAODPWG4Particle rat = pt/ptTrig ; phi = gammai.Phi() ; eta = gammai.Eta() ; - + if(GetDebug() > 2 ) printf("Neutral Hadron Correlation: Histograms selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f",pt,phi,eta); fhEtaNeutral->Fill(ptTrig,eta); diff --git a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h index dab3d945a92..6add712ebfd 100755 --- a/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h +++ b/PWG4/PartCorrDep/AliAnaParticleHadronCorrelation.h @@ -17,43 +17,43 @@ class TH2F; class AliAODPWG4ParticleCorrelation ; class AliAnaParticleHadronCorrelation : public AliAnaPartCorrBaseClass { - -public: + + public: AliAnaParticleHadronCorrelation() ; // default ctor AliAnaParticleHadronCorrelation(const AliAnaParticleHadronCorrelation & ph) ; // cpy ctor AliAnaParticleHadronCorrelation & operator = (const AliAnaParticleHadronCorrelation & ph) ;//cpy assignment virtual ~AliAnaParticleHadronCorrelation() {;} //virtual dtor - + TList * GetCreateOutputObjects(); - + Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; } Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; } void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax) {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;} - + Bool_t OnlyIsolated() const {return fSelectIsolated ; } void SelectIsolated(Bool_t select) {fSelectIsolated = select ; } void InitParameters(); - + void Print(const Option_t * opt) const; - + void MakeChargedCorrelation(AliAODPWG4ParticleCorrelation * aodParticle,TSeqCollection* pl, const Bool_t bFillHisto) ; void MakeNeutralCorrelation(AliAODPWG4ParticleCorrelation * aodParticle,TSeqCollection* pl, const Bool_t bFillHisto) ; - + void MakeAnalysisFillAOD() ; void MakeAnalysisFillHistograms() ; - + Bool_t SelectCluster(AliAODCaloCluster * calo, Double_t *vertex, TLorentzVector & mom, Int_t & pdg) const ; - - private: + + private: Double_t fDeltaPhiMaxCut ; // Minimum Delta Phi Gamma-Hadron Double_t fDeltaPhiMinCut ; // Maximum Delta Phi Gamma-Hadron Bool_t fSelectIsolated ; // Select only trigger particles isolated - + //Histograms TH2F * fhPhiCharged ; //! Phi distribution of selected charged particles TH2F * fhPhiNeutral ; //! Phi distribution of selected neutral particles diff --git a/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx b/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx index 3e937102b32..0572f9b5c6e 100755 --- a/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleIsolation.cxx @@ -1,988 +1,993 @@ /************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ -/* $Id: AliAnaParticleIsolation.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ - -//_________________________________________________________________________ -// Class for analysis of particle isolation -// Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation) -// -// Class created from old AliPHOSGammaJet -// (see AliRoot versions previous Release 4-09) -// -// -- Author: Gustavo Conesa (LNF-INFN) -////////////////////////////////////////////////////////////////////////////// - - -// --- ROOT system --- -#include - -// --- Analysis system --- -#include "AliAnaParticleIsolation.h" -#include "AliLog.h" -#include "AliCaloTrackReader.h" -#include "AliIsolationCut.h" -#include "AliNeutralMesonSelection.h" -#include "AliAODPWG4ParticleCorrelation.h" -#include "AliMCAnalysisUtils.h" - -ClassImp(AliAnaParticleIsolation) - -//____________________________________________________________________________ - AliAnaParticleIsolation::AliAnaParticleIsolation() : - AliAnaPartCorrBaseClass(), fCalorimeter(""), fVertex(), - fReMakeIC(0), fMakeSeveralIC(0), fMakeInvMass(0), - fhPtIso(0),fhPhiIso(0),fhEtaIso(0), fhConeSumPt(0), fhPtInCone(0), - //Several IC - fNCones(0),fNPtThresFrac(0), fConeSizes(), fPtThresholds(), fPtFractions(), - //MC - fhPtIsoPrompt(0),fhPhiIsoPrompt(0),fhEtaIsoPrompt(0), - fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(), - fhPtIsoFragmentation(0),fhPhiIsoFragmentation(0),fhEtaIsoFragmentation(0), - fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(), - fhPtIsoPi0Decay(0),fhPhiIsoPi0Decay(0),fhEtaIsoPi0Decay(0), - fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(), - fhPtIsoOtherDecay(0),fhPhiIsoOtherDecay(0),fhEtaIsoOtherDecay(0), - fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(), - fhPtIsoConversion(0),fhPhiIsoConversion(0),fhEtaIsoConversion(0), - fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(), - fhPtIsoUnknown(0),fhPhiIsoUnknown(0),fhEtaIsoUnknown(0), - fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown(), - //Histograms settings - fHistoNPtSumBins(0), fHistoPtSumMax(0.), fHistoPtSumMin(0.), - fHistoNPtInConeBins(0), fHistoPtInConeMax(0.), fHistoPtInConeMin(0.) -{ - //default ctor - - //Initialize parameters - InitParameters(); - - fVertex[0] = 0.; fVertex[1] = 0.; fVertex[2] = 0.; - - for(Int_t i = 0; i < 5 ; i++){ - fConeSizes[i] = 0 ; - fhPtSumIsolated[i] = 0 ; - - fhPtSumIsolatedPrompt[i] = 0 ; - fhPtSumIsolatedFragmentation[i] = 0 ; - fhPtSumIsolatedPi0Decay[i] = 0 ; - fhPtSumIsolatedOtherDecay[i] = 0 ; - fhPtSumIsolatedConversion[i] = 0 ; - fhPtSumIsolatedUnknown[i] = 0 ; - - for(Int_t j = 0; j < 5 ; j++){ - fhPtThresIsolated[i][j] = 0 ; - fhPtFracIsolated[i][j] = 0 ; - - fhPtThresIsolatedPrompt[i][j] = 0 ; - fhPtThresIsolatedFragmentation[i][j] = 0 ; - fhPtThresIsolatedPi0Decay[i][j] = 0 ; - fhPtThresIsolatedOtherDecay[i][j] = 0 ; - fhPtThresIsolatedConversion[i][j] = 0 ; - fhPtThresIsolatedUnknown[i][j] = 0 ; - - fhPtFracIsolatedPrompt[i][j] = 0 ; - fhPtFracIsolatedFragmentation[i][j] = 0 ; - fhPtFracIsolatedPi0Decay[i][j] = 0 ; - fhPtFracIsolatedOtherDecay[i][j] = 0 ; - fhPtFracIsolatedConversion[i][j] = 0 ; - fhPtFracIsolatedUnknown[i][j] = 0 ; - - } - } - - for(Int_t i = 0; i < 5 ; i++){ - fPtFractions[i]= 0 ; - fPtThresholds[i]= 0 ; - } - - -} - -//____________________________________________________________________________ -AliAnaParticleIsolation::AliAnaParticleIsolation(const AliAnaParticleIsolation & g) : - AliAnaPartCorrBaseClass(g), fCalorimeter(g.fCalorimeter),fVertex(), - fReMakeIC(g.fReMakeIC), fMakeSeveralIC(g.fMakeSeveralIC), fMakeInvMass(g.fMakeInvMass), - fhPtIso(g.fhPtIso),fhPhiIso(g.fhPhiIso),fhEtaIso(g.fhEtaIso), - fhConeSumPt(g.fhConeSumPt), fhPtInCone(g.fhPtInCone), - //Several IC - fNCones(g.fNCones),fNPtThresFrac(g.fNPtThresFrac), fConeSizes(), fPtThresholds(), fPtFractions(), - fhPtThresIsolated(), fhPtFracIsolated(), fhPtSumIsolated(), - //MC - fhPtIsoPrompt(g.fhPtIsoPrompt),fhPhiIsoPrompt(g.fhPhiIsoPrompt),fhEtaIsoPrompt(g.fhEtaIsoPrompt), - fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(), - fhPtIsoFragmentation(g.fhPtIsoFragmentation),fhPhiIsoFragmentation(g.fhPhiIsoFragmentation),fhEtaIsoFragmentation(g.fhEtaIsoFragmentation), - fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(), - fhPtIsoPi0Decay(g.fhPtIsoPi0Decay),fhPhiIsoPi0Decay(g.fhPhiIsoPi0Decay),fhEtaIsoPi0Decay(g.fhEtaIsoPi0Decay), - fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(), - fhPtIsoOtherDecay(g.fhPtIsoOtherDecay),fhPhiIsoOtherDecay(g.fhPhiIsoOtherDecay),fhEtaIsoOtherDecay(g.fhEtaIsoOtherDecay), - fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(), - fhPtIsoConversion(g. fhPtIsoConversion),fhPhiIsoConversion(g.fhPhiIsoConversion),fhEtaIsoConversion(g.fhEtaIsoConversion), - fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(), - fhPtIsoUnknown(g.fhPtIsoUnknown),fhPhiIsoUnknown(g.fhPhiIsoUnknown),fhEtaIsoUnknown(g.fhEtaIsoUnknown), - fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown(), - //Histograms - fHistoNPtSumBins(g.fHistoNPtSumBins), fHistoPtSumMax(g.fHistoPtSumMax), fHistoPtSumMin(g.fHistoPtSumMax), - fHistoNPtInConeBins(g.fHistoNPtInConeBins), fHistoPtInConeMax(g.fHistoPtInConeMax), fHistoPtInConeMin(g.fHistoPtInConeMin) -{ - // cpy ctor - - fVertex[0] = g.fVertex[0]; - fVertex[1] = g.fVertex[1]; - fVertex[2] = g.fVertex[2]; - - //Several IC - for(Int_t i = 0; i < fNCones ; i++){ - fConeSizes[i] = g.fConeSizes[i]; - fhPtSumIsolated[i] = g.fhPtSumIsolated[i]; - - fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i]; - fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i]; - fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i]; - fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i]; - fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i]; - fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i]; - - for(Int_t j = 0; j < fNPtThresFrac ; j++){ - fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j]; - fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j]; - - fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j]; - fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j]; - fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j]; - fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j]; - fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j]; - fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j]; - - fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j]; - fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j]; - fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j]; - fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j]; - fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j]; - fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j]; - - } - } - - for(Int_t i = 0; i < fNPtThresFrac ; i++){ - fPtFractions[i]= g.fPtFractions[i]; - fPtThresholds[i]= g.fPtThresholds[i]; - } - -} - -//_________________________________________________________________________ -AliAnaParticleIsolation & AliAnaParticleIsolation::operator = (const AliAnaParticleIsolation & g) -{ - // assignment operator - - if(&g == this) return *this; - - fReMakeIC = g.fReMakeIC ; - fMakeSeveralIC = g.fMakeSeveralIC ; - fMakeInvMass = g.fMakeInvMass ; - fCalorimeter = g.fCalorimeter ; - fVertex[0] = g.fVertex[0]; - fVertex[1] = g.fVertex[1]; - fVertex[2] = g.fVertex[2]; - - fhConeSumPt = g.fhConeSumPt ; - fhPtInCone = g.fhPtInCone; - - fhPtIso = g.fhPtIso ; - fhPhiIso = g.fhPhiIso ; - fhEtaIso = g.fhEtaIso ; - - fhPtIsoPrompt = g.fhPtIsoPrompt; - fhPhiIsoPrompt = g.fhPhiIsoPrompt; - fhEtaIsoPrompt = g.fhEtaIsoPrompt; - fhPtIsoFragmentation = g.fhPtIsoFragmentation; - fhPhiIsoFragmentation = g.fhPhiIsoFragmentation; - fhEtaIsoFragmentation = g.fhEtaIsoFragmentation; - fhPtIsoPi0Decay = g.fhPtIsoPi0Decay; - fhPhiIsoPi0Decay = g.fhPhiIsoPi0Decay; - fhEtaIsoPi0Decay = g.fhEtaIsoPi0Decay; - fhPtIsoOtherDecay = g.fhPtIsoOtherDecay; - fhPhiIsoOtherDecay = g.fhPhiIsoOtherDecay; - fhEtaIsoOtherDecay = g.fhEtaIsoOtherDecay; - fhPtIsoConversion = g. fhPtIsoConversion; - fhPhiIsoConversion = g.fhPhiIsoConversion; - fhEtaIsoConversion = g.fhEtaIsoConversion; - fhPtIsoUnknown = g.fhPtIsoUnknown; - fhPhiIsoUnknown = g.fhPhiIsoUnknown; - fhEtaIsoUnknown = g.fhEtaIsoUnknown; - - //Several IC - fNCones = g.fNCones ; - fNPtThresFrac = g.fNPtThresFrac ; - - for(Int_t i = 0; i < fNCones ; i++){ - fConeSizes[i] = g.fConeSizes[i]; - fhPtSumIsolated[i] = g.fhPtSumIsolated[i] ; - - fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i]; - fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i]; - fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i]; - fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i]; - fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i]; - fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i]; - - for(Int_t j = 0; j < fNPtThresFrac ; j++){ - fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j] ; - fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j] ; - - fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j]; - fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j]; - fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j]; - fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j]; - fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j]; - fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j]; - - fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j]; - fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j]; - fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j]; - fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j]; - fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j]; - fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j]; - - } - } - - for(Int_t i = 0; i < fNPtThresFrac ; i++){ - fPtThresholds[i]= g.fPtThresholds[i]; - fPtFractions[i]= g.fPtFractions[i]; - } - - - fHistoNPtSumBins = g.fHistoNPtSumBins; - fHistoPtSumMax = g.fHistoPtSumMax; - fHistoPtSumMin = g.fHistoPtSumMax; - fHistoNPtInConeBins = g.fHistoNPtInConeBins; - fHistoPtInConeMax = g.fHistoPtInConeMax; - fHistoPtInConeMin = g.fHistoPtInConeMin; - - return *this; - -} - -//____________________________________________________________________________ -AliAnaParticleIsolation::~AliAnaParticleIsolation() -{ - //dtor - //do not delete histograms - - delete [] fConeSizes ; - delete [] fPtThresholds ; - delete [] fPtFractions ; - delete [] fVertex ; -} - -//_________________________________________________________________________ -Bool_t AliAnaParticleIsolation::CheckInvMass(const Int_t iaod, const AliAODPWG4ParticleCorrelation * part1) const -{ - // Search if there is a companion decay photon to the candidate - // and discard it in such case - // Use it only if isolation candidates are photons - // Make sure that no selection on photon pt is done in the input aod photon list. - TLorentzVector mom1 = *(part1->Momentum()); - TLorentzVector mom2 ; - for(Int_t jaod = 0; jaod < GetInputAODBranch()->GetEntriesFast(); jaod++){ - if(iaod == jaod) continue ; - AliAODPWG4ParticleCorrelation * part2 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(jaod)); - mom2 = *(part2->Momentum()); - //Select good pair (good phi, pt cuts, aperture and invariant mass) - if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)){ - if(GetDebug() > 1)printf("Selected gamma pair: pt %f, phi %f, eta%f",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); - return kTRUE ; - } - }//loop - - return kFALSE; -} - -//________________________________________________________________________ -TList * AliAnaParticleIsolation::GetCreateOutputObjects() -{ - // Create histograms to be saved in output file and - // store them in outputContainer - TList * outputContainer = new TList() ; - outputContainer->SetName("IsolatedParticleHistos") ; - - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); - - Int_t nptsumbins = fHistoNPtSumBins; - Float_t ptsummax = fHistoPtSumMax; - Float_t ptsummin = fHistoPtSumMin; - Int_t nptinconebins = fHistoNPtInConeBins; - Float_t ptinconemax = fHistoPtInConeMax; - Float_t ptinconemin = fHistoPtInConeMin; - - if(!fMakeSeveralIC){ - - fhConeSumPt = new TH2F - ("hConePtSum","#Sigma p_{T} in cone ",nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhConeSumPt->SetYTitle("#Sigma p_{T}"); - fhConeSumPt->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhConeSumPt) ; - - fhPtInCone = new TH2F - ("hPtInCone","p_{T} in cone ",nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax); - fhPtInCone->SetYTitle("p_{T in cone} (GeV/c)"); - fhPtInCone->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPtInCone) ; - - fhPtIso = new TH1F("hPtIso","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIso->SetYTitle("N"); - fhPtIso->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIso) ; - - fhPhiIso = new TH2F - ("hPhiIso","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIso->SetYTitle("#phi"); - fhPhiIso->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIso) ; - - fhEtaIso = new TH2F - ("hEtaIso","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIso->SetYTitle("#eta"); - fhEtaIso->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIso) ; - - if(IsDataMC()){ - - fhPtIsoPrompt = new TH1F("hPtIsoPrompt","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoPrompt->SetYTitle("N"); - fhPtIsoPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoPrompt) ; - - fhPhiIsoPrompt = new TH2F - ("hPhiIsoPrompt","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoPrompt->SetYTitle("#phi"); - fhPhiIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoPrompt) ; - - fhEtaIsoPrompt = new TH2F - ("hEtaIsoPrompt","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoPrompt->SetYTitle("#eta"); - fhEtaIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoPrompt) ; - - fhPtIsoFragmentation = new TH1F("hPtIsoFragmentation","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoFragmentation->SetYTitle("N"); - fhPtIsoFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoFragmentation) ; - - fhPhiIsoFragmentation = new TH2F - ("hPhiIsoFragmentation","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoFragmentation->SetYTitle("#phi"); - fhPhiIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoFragmentation) ; - - fhEtaIsoFragmentation = new TH2F - ("hEtaIsoFragmentation","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoFragmentation->SetYTitle("#eta"); - fhEtaIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoFragmentation) ; - - fhPtIsoPi0Decay = new TH1F("hPtIsoPi0Decay","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoPi0Decay->SetYTitle("N"); - fhPtIsoPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoPi0Decay) ; - - fhPhiIsoPi0Decay = new TH2F - ("hPhiIsoPi0Decay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoPi0Decay->SetYTitle("#phi"); - fhPhiIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoPi0Decay) ; - - fhEtaIsoPi0Decay = new TH2F - ("hEtaIsoPi0Decay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoPi0Decay->SetYTitle("#eta"); - fhEtaIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoPi0Decay) ; - - fhPtIsoOtherDecay = new TH1F("hPtIsoOtherDecay","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoOtherDecay->SetYTitle("N"); - fhPtIsoOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoOtherDecay) ; - - fhPhiIsoOtherDecay = new TH2F - ("hPhiIsoOtherDecay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoOtherDecay->SetYTitle("#phi"); - fhPhiIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoOtherDecay) ; - - fhEtaIsoOtherDecay = new TH2F - ("hEtaIsoOtherDecay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoOtherDecay->SetYTitle("#eta"); - fhEtaIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoOtherDecay) ; - - fhPtIsoConversion = new TH1F("hPtIsoConversion","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoConversion->SetYTitle("N"); - fhPtIsoConversion->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoConversion) ; - - fhPhiIsoConversion = new TH2F - ("hPhiIsoConversion","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoConversion->SetYTitle("#phi"); - fhPhiIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoConversion) ; - - fhEtaIsoConversion = new TH2F - ("hEtaIsoConversion","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoConversion->SetYTitle("#eta"); - fhEtaIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoConversion) ; - - fhPtIsoUnknown = new TH1F("hPtIsoUnknown","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtIsoUnknown->SetYTitle("N"); - fhPtIsoUnknown->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtIsoUnknown) ; - - fhPhiIsoUnknown = new TH2F - ("hPhiIsoUnknown","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiIsoUnknown->SetYTitle("#phi"); - fhPhiIsoUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiIsoUnknown) ; - - fhEtaIsoUnknown = new TH2F - ("hEtaIsoUnknown","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaIsoUnknown->SetYTitle("#eta"); - fhEtaIsoUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaIsoUnknown) ; - }//Histos with MC - - } - - if(fMakeSeveralIC){ - char name[128]; - char title[128]; - for(Int_t icone = 0; iconeSetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolated[icone]) ; - - if(IsDataMC()){ - sprintf(name,"hPtSumIsolatedPrompt_Cone_%d",icone); - sprintf(title,"Candidate Prompt cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedPrompt[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedPrompt[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedPrompt[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedPrompt[icone]) ; - - sprintf(name,"hPtSumIsolatedFragmentation_Cone_%d",icone); - sprintf(title,"Candidate Fragmentation cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedFragmentation[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedFragmentation[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedFragmentation[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedFragmentation[icone]) ; - - sprintf(name,"hPtSumIsolatedPi0Decay_Cone_%d",icone); - sprintf(title,"Candidate Pi0Decay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedPi0Decay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedPi0Decay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedPi0Decay[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedPi0Decay[icone]) ; - - sprintf(name,"hPtSumIsolatedOtherDecay_Cone_%d",icone); - sprintf(title,"Candidate OtherDecay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedOtherDecay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedOtherDecay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedOtherDecay[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedOtherDecay[icone]) ; - - sprintf(name,"hPtSumIsolatedConversion_Cone_%d",icone); - sprintf(title,"Candidate Conversion cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedConversion[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedConversion[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedConversion[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedConversion[icone]) ; - - sprintf(name,"hPtSumIsolatedUnknown_Cone_%d",icone); - sprintf(title,"Candidate Unknown cone sum p_{T} for cone size %d vs candidate p_{T}",icone); - fhPtSumIsolatedUnknown[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); - fhPtSumIsolatedUnknown[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); - fhPtSumIsolatedUnknown[icone]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtSumIsolatedUnknown[icone]) ; - - }//Histos with MC - - for(Int_t ipt = 0; iptSetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolated[icone][ipt]) ; - - sprintf(name,"hPtFracIsol_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolated[icone][ipt]) ; - - if(IsDataMC()){ - sprintf(name,"hPtThresIsolPrompt_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedPrompt[icone][ipt]) ; - - sprintf(name,"hPtFracIsolPrompt_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedPrompt[icone][ipt]) ; - - sprintf(name,"hPtThresIsolFragmentation_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedFragmentation[icone][ipt]) ; - - sprintf(name,"hPtFracIsolFragmentation_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedFragmentation[icone][ipt]) ; - - sprintf(name,"hPtThresIsolPi0Decay_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedPi0Decay[icone][ipt]) ; - - sprintf(name,"hPtFracIsolPi0Decay_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedPi0Decay[icone][ipt]) ; - - sprintf(name,"hPtThresIsolOtherDecay_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedOtherDecay[icone][ipt]) ; - - sprintf(name,"hPtFracIsolOtherDecay_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedOtherDecay[icone][ipt]) ; - - sprintf(name,"hPtThresIsolConversion_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedConversion[icone][ipt]) ; - - sprintf(name,"hPtFracIsolConversion_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedConversion[icone][ipt]) ; - - sprintf(name,"hPtThresIsolUnknown_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtThresIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtThresIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtThresIsolatedUnknown[icone][ipt]) ; - - sprintf(name,"hPtFracIsolUnknown_Cone_%d_Pt%d",icone,ipt); - sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); - fhPtFracIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); - fhPtFracIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); - outputContainer->Add(fhPtFracIsolatedUnknown[icone][ipt]) ; - - }//Histos with MC - - }//icone loop - }//ipt loop - } - - //Keep neutral meson selection histograms if requiered - //Setting done in AliNeutralMesonSelection - if(fMakeInvMass && GetNeutralMesonSelection()){ - TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; - if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) - for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; - } - - - //Save parameters used for analysis - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - - sprintf(onePar,"--- AliAnaParticleIsolation ---\n") ; - parList+=onePar ; - sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; - parList+=onePar ; - sprintf(onePar,"fReMakeIC =%d (Flag for reisolation during histogram filling) \n",fReMakeIC) ; - parList+=onePar ; - sprintf(onePar,"fMakeSeveralIC=%d (Flag for isolation with several cuts at the same time ) \n",fMakeSeveralIC) ; - parList+=onePar ; - sprintf(onePar,"fMakeInvMass=%d (Flag for rejection of candidates with a pi0 inv mass pair) \n",fMakeInvMass) ; - parList+=onePar ; - - if(fMakeSeveralIC){ - sprintf(onePar,"fNCones =%d (Number of cone sizes) \n",fNCones) ; - parList+=onePar ; - sprintf(onePar,"fNPtThresFrac=%d (Flag for isolation with several cuts at the same time ) \n",fNPtThresFrac) ; - parList+=onePar ; - - for(Int_t icone = 0; icone < fNCones ; icone++){ - sprintf(onePar,"fConeSizes[%d]=%1.2f (isolation cone size) \n",icone, fConeSizes[icone]) ; - parList+=onePar ; - } - for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ - sprintf(onePar,"fPtThresholds[%d]=%1.2f (isolation pt threshold) \n",ipt, fPtThresholds[ipt]) ; - parList+=onePar ; - } - for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ - sprintf(onePar,"fPtFractions[%d]=%1.2f (isolation pt fraction threshold) \n",ipt, fPtFractions[ipt]) ; - parList+=onePar ; - } - } - - //Get parameters set in base class. - parList += GetBaseParametersList() ; - - //Get parameters set in IC class. - if(!fMakeSeveralIC)parList += GetIsolationCut()->GetICParametersList() ; - - TObjString *oString= new TObjString(parList) ; - outputContainer->Add(oString); - - - return outputContainer ; - -} - -//__________________________________________________________________ -void AliAnaParticleIsolation::MakeAnalysisFillAOD() -{ - //Do analysis and fill aods - //Search for the isolated photon in fCalorimeter with pt > GetMinPt() - - if(!GetInputAODBranch()) - AliFatal(Form("ParticleIsolation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - - Int_t n = 0, nfrac = 0; - Bool_t isolated = kFALSE ; - Float_t coneptsum = 0 ; - TClonesArray * pl = new TClonesArray; - - //Select the calorimeter for candidate isolation with neutral particles - if(fCalorimeter == "PHOS") - pl = GetAODPHOS(); - else if (fCalorimeter == "EMCAL") - pl = GetAODEMCAL(); - - //Get vertex for photon momentum calculation - if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(fVertex); - - //Loop on AOD branch, filled previously in AliAnaPhoton - TLorentzVector mom ; - - for(Int_t iaod = 0; iaod < GetInputAODBranch()->GetEntriesFast(); iaod++){ - AliAODPWG4ParticleCorrelation * aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - - //If too small or too large pt, skip - if(aod->Pt() < GetMinPt() || aod->Pt() > GetMaxPt() ) continue ; - - //Check invariant mass, if pi0, skip. - Bool_t decay = kFALSE ; - if(fMakeInvMass) decay = CheckInvMass(iaod,aod); - if(decay) continue ; - - n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; - GetIsolationCut()->MakeIsolationCut((TSeqCollection*)GetAODCTS(), (TSeqCollection*)pl, - fVertex, kTRUE, aod, n,nfrac,coneptsum, isolated); - aod->SetIsolated(isolated); - - }//loop - - if(GetDebug() > 1) printf("End fill AODs "); - -} - -//__________________________________________________________________ -void AliAnaParticleIsolation::MakeAnalysisFillHistograms() -{ - //Do analysis and fill histograms - Int_t n = 0, nfrac = 0; - Bool_t isolated = kFALSE ; - Float_t coneptsum = 0 ; - //cout<<"MakeAnalysisFillHistograms"<GetEntriesFast(); - if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod); - for(Int_t iaod = 0; iaod < naod ; iaod++){ - AliAODPWG4ParticleCorrelation* aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - Bool_t isolation = aod->IsIsolated(); - Float_t ptcluster = aod->Pt(); - Float_t phicluster = aod->Phi(); - Float_t etacluster = aod->Eta(); - - //is pt too small skip it - if(ptcluster < GetMinPt() || ptcluster > GetMaxPt() ) continue ; - - if(fMakeSeveralIC) { - //Analysis of multiple IC at same time - MakeSeveralICAnalysis(aod); - continue; - } - else if(fReMakeIC){ - //In case a more strict IC is needed in the produced AOD - n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; - GetIsolationCut()->MakeIsolationCut((TSeqCollection*)aod->GetRefIsolationConeTracks(), - (TSeqCollection*)aod->GetRefIsolationConeClusters(), - fVertex, kFALSE, aod, - n,nfrac,coneptsum, isolated); - fhConeSumPt->Fill(ptcluster,coneptsum); - } - - //Fill pt distribution of particles in cone - //Tracks - coneptsum=0; - for(Int_t itrack=0; itrack < (aod->GetRefIsolationConeTracks())->GetEntriesFast(); itrack++){ - AliAODTrack* track = (AliAODTrack *)((aod->GetRefIsolationConeTracks())->At(itrack)); - fhPtInCone->Fill(ptcluster,TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py())); - coneptsum+=track->Pt(); - } - //CaloClusters - TLorentzVector mom ; - for(Int_t icalo=0; icalo < (aod->GetRefIsolationConeClusters())->GetEntriesFast(); icalo++){ - AliAODCaloCluster* calo = (AliAODCaloCluster *)((aod->GetRefIsolationConeClusters())->At(icalo)); - calo->GetMomentum(mom,fVertex);//Assume that come from vertex in straight line - fhPtInCone->Fill(ptcluster, mom.Pt()); - coneptsum+=mom.Pt(); - } - - if(!fReMakeIC) fhConeSumPt->Fill(ptcluster,coneptsum); - - if(isolation){ - fhPtIso ->Fill(ptcluster); - fhPhiIso ->Fill(ptcluster,phicluster); - fhEtaIso ->Fill(ptcluster,etacluster); - - if(IsDataMC()){ - Int_t tag =aod->GetTag(); - - if(tag == AliMCAnalysisUtils::kMCPrompt){ - fhPtIsoPrompt ->Fill(ptcluster); - fhPhiIsoPrompt ->Fill(ptcluster,phicluster); - fhEtaIsoPrompt ->Fill(ptcluster,etacluster); - } - else if(tag == AliMCAnalysisUtils::kMCFragmentation) - { - fhPtIsoFragmentation ->Fill(ptcluster); - fhPhiIsoFragmentation ->Fill(ptcluster,phicluster); - fhEtaIsoFragmentation ->Fill(ptcluster,etacluster); - } - else if(tag == AliMCAnalysisUtils::kMCPi0Decay) - { - fhPtIsoPi0Decay ->Fill(ptcluster); - fhPhiIsoPi0Decay ->Fill(ptcluster,phicluster); - fhEtaIsoPi0Decay ->Fill(ptcluster,etacluster); - } - else if(tag == AliMCAnalysisUtils::kMCEtaDecay || tag == AliMCAnalysisUtils::kMCOtherDecay) - { - fhPtIsoOtherDecay ->Fill(ptcluster); - fhPhiIsoOtherDecay ->Fill(ptcluster,phicluster); - fhEtaIsoOtherDecay ->Fill(ptcluster,etacluster); - } - else if(tag == AliMCAnalysisUtils::kMCConversion) - { - fhPtIsoConversion ->Fill(ptcluster); - fhPhiIsoConversion ->Fill(ptcluster,phicluster); - fhEtaIsoConversion ->Fill(ptcluster,etacluster); - } - else - { - fhPtIsoUnknown ->Fill(ptcluster); - fhPhiIsoUnknown ->Fill(ptcluster,phicluster); - fhEtaIsoUnknown ->Fill(ptcluster,etacluster); - } - }//Histograms with MC - - }//Isolated histograms - - }// aod loop - -} - -//____________________________________________________________________________ -void AliAnaParticleIsolation::InitParameters() -{ - - //Initialize the parameters of the analysis. - SetInputAODName("photons"); - - fCalorimeter = "PHOS" ; - fReMakeIC = kFALSE ; - fMakeSeveralIC = kFALSE ; - fMakeInvMass = kFALSE ; - - //----------- Several IC----------------- - fNCones = 5 ; - fNPtThresFrac = 5 ; - fConeSizes[0] = 0.1; fConeSizes[1] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4; fConeSizes[4] = 0.5; - fPtThresholds[0] = 1.; fPtThresholds[1] = 2.; fPtThresholds[2] = 3.; fPtThresholds[3] = 4.; fPtThresholds[4] = 5.; - fPtFractions[0] = 0.05; fPtFractions[1] = 0.075; fPtFractions[2] = 0.1; fPtFractions[3] = 1.25; fPtFractions[4] = 1.5; - -//------------- Histograms settings ------- - fHistoNPtSumBins = 100 ; - fHistoPtSumMax = 50 ; - fHistoPtSumMin = 0. ; - - fHistoNPtInConeBins = 100 ; - fHistoPtInConeMax = 50 ; - fHistoPtInConeMin = 0. ; - -} - -//__________________________________________________________________ -void AliAnaParticleIsolation::MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelation* ph) -{ - //Isolation Cut Analysis for both methods and different pt cuts and cones - Float_t ptC = ph->Pt(); - Int_t tag = ph->GetTag(); - - //Keep original setting used when filling AODs, reset at end of analysis - Float_t ptthresorg = GetIsolationCut()->GetPtThreshold(); - Float_t ptfracorg = GetIsolationCut()->GetPtFraction(); - Float_t rorg = GetIsolationCut()->GetConeSize(); - - Float_t coneptsum = 0 ; - Int_t n[10][10];//[fNCones][fNPtThresFrac]; - Int_t nfrac[10][10];//[fNCones][fNPtThresFrac]; - Bool_t isolated = kFALSE; - - //Loop on cone sizes - for(Int_t icone = 0; iconeSetConeSize(fConeSizes[icone]); - coneptsum = 0 ; - //Loop on ptthresholds - for(Int_t ipt = 0; iptSetPtThreshold(fPtThresholds[ipt]); - GetIsolationCut()->MakeIsolationCut((TSeqCollection*)ph->GetRefIsolationConeTracks(), - (TSeqCollection*)ph->GetRefIsolationConeClusters(), - fVertex, kFALSE, ph, - n[icone][ipt],nfrac[icone][ipt],coneptsum, isolated); - //Normal ptThreshold cut - if(n[icone][ipt] == 0) { - fhPtThresIsolated[icone][ipt]->Fill(ptC); - if(IsDataMC()){ - if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtThresIsolatedPrompt[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtThresIsolatedConversion[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtThresIsolatedFragmentation[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtThresIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtThresIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; - else fhPtThresIsolatedUnknown[icone][ipt]->Fill(ptC) ; - } - } - - //Pt threshold on pt cand/ pt in cone fraction - if(nfrac[icone][ipt] == 0) { - fhPtFracIsolated[icone][ipt]->Fill(ptC); - if(IsDataMC()){ - if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtFracIsolatedPrompt[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtFracIsolatedConversion[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtFracIsolatedFragmentation[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtFracIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; - else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtFracIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; - else fhPtFracIsolatedUnknown[icone][ipt]->Fill(ptC) ; - } - } - }//pt thresh loop - - //Sum in cone histograms - fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ; - if(IsDataMC()){ - if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtSumIsolatedPrompt[icone]->Fill(ptC,coneptsum) ; - else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtSumIsolatedConversion[icone]->Fill(ptC,coneptsum) ; - else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtSumIsolatedFragmentation[icone]->Fill(ptC,coneptsum) ; - else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtSumIsolatedPi0Decay[icone]->Fill(ptC,coneptsum) ; - else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtSumIsolatedOtherDecay[icone]->Fill(ptC,coneptsum) ; - else fhPtSumIsolatedUnknown[icone]->Fill(ptC,coneptsum) ; - } - - }//cone size loop - - //Reset original parameters for AOD analysis - GetIsolationCut()->SetPtThreshold(ptthresorg); - GetIsolationCut()->SetPtFraction(ptfracorg); - GetIsolationCut()->SetConeSize(rorg); - -} - -//__________________________________________________________________ -void AliAnaParticleIsolation::Print(const Option_t * opt) const -{ - - //Print some relevant parameters set for the analysis - if(! opt) - return; - - printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; - - printf("Min Gamma pT = %2.2f\n", GetMinPt()) ; - printf("Max Gamma pT = %3.2f\n", GetMaxPt()) ; - - printf("ReMake Isolation = %d \n", fReMakeIC) ; - printf("Make Several Isolation = %d \n", fMakeSeveralIC) ; - printf("Calorimeter for isolation = %s \n", fCalorimeter.Data()) ; - - if(fMakeSeveralIC){ - printf("N Cone Sizes = %d\n", fNCones) ; - printf("Cone Sizes = \n") ; - for(Int_t i = 0; i < fNCones; i++) - printf(" %1.2f;", fConeSizes[i]) ; - printf(" \n") ; - - printf("N pT thresholds/fractions = %d\n", fNPtThresFrac) ; - printf(" pT thresholds = \n") ; - for(Int_t i = 0; i < fNPtThresFrac; i++) - printf(" %2.2f;", fPtThresholds[i]) ; - - printf(" \n") ; - - printf(" pT fractions = \n") ; - for(Int_t i = 0; i < fNPtThresFrac; i++) - printf(" %2.2f;", fPtFractions[i]) ; - - } - - printf("Histograms: %3.1f < pT sum < %3.1f, Nbin = %d\n", fHistoPtSumMin, fHistoPtSumMax, fHistoNPtSumBins); - printf("Histograms: %3.1f < pT in cone < %3.1f, Nbin = %d\n", fHistoPtInConeMin, fHistoPtInConeMax, fHistoNPtInConeBins); - - printf(" \n") ; - -} - + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: AliAnaParticleIsolation.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ + +//_________________________________________________________________________ +// Class for analysis of particle isolation +// Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation) +// +// Class created from old AliPHOSGammaJet +// (see AliRoot versions previous Release 4-09) +// +// -- Author: Gustavo Conesa (LNF-INFN) +////////////////////////////////////////////////////////////////////////////// + + +// --- ROOT system --- +#include +#include +#include +#include + +// --- Analysis system --- +#include "AliAnaParticleIsolation.h" +#include "AliCaloTrackReader.h" +#include "AliIsolationCut.h" +#include "AliNeutralMesonSelection.h" +#include "AliAODPWG4ParticleCorrelation.h" +#include "AliMCAnalysisUtils.h" +#include "AliAODTrack.h" +#include "AliAODCaloCluster.h" + +ClassImp(AliAnaParticleIsolation) + +//____________________________________________________________________________ + AliAnaParticleIsolation::AliAnaParticleIsolation() : + AliAnaPartCorrBaseClass(), fCalorimeter(""), fVertex(), + fReMakeIC(0), fMakeSeveralIC(0), fMakeInvMass(0), + fhPtIso(0),fhPhiIso(0),fhEtaIso(0), fhConeSumPt(0), fhPtInCone(0), + //Several IC + fNCones(0),fNPtThresFrac(0), fConeSizes(), fPtThresholds(), fPtFractions(), + //MC + fhPtIsoPrompt(0),fhPhiIsoPrompt(0),fhEtaIsoPrompt(0), + fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(), + fhPtIsoFragmentation(0),fhPhiIsoFragmentation(0),fhEtaIsoFragmentation(0), + fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(), + fhPtIsoPi0Decay(0),fhPhiIsoPi0Decay(0),fhEtaIsoPi0Decay(0), + fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(), + fhPtIsoOtherDecay(0),fhPhiIsoOtherDecay(0),fhEtaIsoOtherDecay(0), + fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(), + fhPtIsoConversion(0),fhPhiIsoConversion(0),fhEtaIsoConversion(0), + fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(), + fhPtIsoUnknown(0),fhPhiIsoUnknown(0),fhEtaIsoUnknown(0), + fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown(), + //Histograms settings + fHistoNPtSumBins(0), fHistoPtSumMax(0.), fHistoPtSumMin(0.), + fHistoNPtInConeBins(0), fHistoPtInConeMax(0.), fHistoPtInConeMin(0.) +{ + //default ctor + + //Initialize parameters + InitParameters(); + + fVertex[0] = 0.; fVertex[1] = 0.; fVertex[2] = 0.; + + for(Int_t i = 0; i < 5 ; i++){ + fConeSizes[i] = 0 ; + fhPtSumIsolated[i] = 0 ; + + fhPtSumIsolatedPrompt[i] = 0 ; + fhPtSumIsolatedFragmentation[i] = 0 ; + fhPtSumIsolatedPi0Decay[i] = 0 ; + fhPtSumIsolatedOtherDecay[i] = 0 ; + fhPtSumIsolatedConversion[i] = 0 ; + fhPtSumIsolatedUnknown[i] = 0 ; + + for(Int_t j = 0; j < 5 ; j++){ + fhPtThresIsolated[i][j] = 0 ; + fhPtFracIsolated[i][j] = 0 ; + + fhPtThresIsolatedPrompt[i][j] = 0 ; + fhPtThresIsolatedFragmentation[i][j] = 0 ; + fhPtThresIsolatedPi0Decay[i][j] = 0 ; + fhPtThresIsolatedOtherDecay[i][j] = 0 ; + fhPtThresIsolatedConversion[i][j] = 0 ; + fhPtThresIsolatedUnknown[i][j] = 0 ; + + fhPtFracIsolatedPrompt[i][j] = 0 ; + fhPtFracIsolatedFragmentation[i][j] = 0 ; + fhPtFracIsolatedPi0Decay[i][j] = 0 ; + fhPtFracIsolatedOtherDecay[i][j] = 0 ; + fhPtFracIsolatedConversion[i][j] = 0 ; + fhPtFracIsolatedUnknown[i][j] = 0 ; + + } + } + + for(Int_t i = 0; i < 5 ; i++){ + fPtFractions[i]= 0 ; + fPtThresholds[i]= 0 ; + } + + +} + +//____________________________________________________________________________ +AliAnaParticleIsolation::AliAnaParticleIsolation(const AliAnaParticleIsolation & g) : + AliAnaPartCorrBaseClass(g), fCalorimeter(g.fCalorimeter),fVertex(), + fReMakeIC(g.fReMakeIC), fMakeSeveralIC(g.fMakeSeveralIC), fMakeInvMass(g.fMakeInvMass), + fhPtIso(g.fhPtIso),fhPhiIso(g.fhPhiIso),fhEtaIso(g.fhEtaIso), + fhConeSumPt(g.fhConeSumPt), fhPtInCone(g.fhPtInCone), + //Several IC + fNCones(g.fNCones),fNPtThresFrac(g.fNPtThresFrac), fConeSizes(), fPtThresholds(), fPtFractions(), + fhPtThresIsolated(), fhPtFracIsolated(), fhPtSumIsolated(), + //MC + fhPtIsoPrompt(g.fhPtIsoPrompt),fhPhiIsoPrompt(g.fhPhiIsoPrompt),fhEtaIsoPrompt(g.fhEtaIsoPrompt), + fhPtThresIsolatedPrompt(), fhPtFracIsolatedPrompt(), fhPtSumIsolatedPrompt(), + fhPtIsoFragmentation(g.fhPtIsoFragmentation),fhPhiIsoFragmentation(g.fhPhiIsoFragmentation),fhEtaIsoFragmentation(g.fhEtaIsoFragmentation), + fhPtThresIsolatedFragmentation(), fhPtFracIsolatedFragmentation(), fhPtSumIsolatedFragmentation(), + fhPtIsoPi0Decay(g.fhPtIsoPi0Decay),fhPhiIsoPi0Decay(g.fhPhiIsoPi0Decay),fhEtaIsoPi0Decay(g.fhEtaIsoPi0Decay), + fhPtThresIsolatedPi0Decay(), fhPtFracIsolatedPi0Decay(), fhPtSumIsolatedPi0Decay(), + fhPtIsoOtherDecay(g.fhPtIsoOtherDecay),fhPhiIsoOtherDecay(g.fhPhiIsoOtherDecay),fhEtaIsoOtherDecay(g.fhEtaIsoOtherDecay), + fhPtThresIsolatedOtherDecay(), fhPtFracIsolatedOtherDecay(), fhPtSumIsolatedOtherDecay(), + fhPtIsoConversion(g. fhPtIsoConversion),fhPhiIsoConversion(g.fhPhiIsoConversion),fhEtaIsoConversion(g.fhEtaIsoConversion), + fhPtThresIsolatedConversion(), fhPtFracIsolatedConversion(), fhPtSumIsolatedConversion(), + fhPtIsoUnknown(g.fhPtIsoUnknown),fhPhiIsoUnknown(g.fhPhiIsoUnknown),fhEtaIsoUnknown(g.fhEtaIsoUnknown), + fhPtThresIsolatedUnknown(), fhPtFracIsolatedUnknown(), fhPtSumIsolatedUnknown(), + //Histograms + fHistoNPtSumBins(g.fHistoNPtSumBins), fHistoPtSumMax(g.fHistoPtSumMax), fHistoPtSumMin(g.fHistoPtSumMax), + fHistoNPtInConeBins(g.fHistoNPtInConeBins), fHistoPtInConeMax(g.fHistoPtInConeMax), fHistoPtInConeMin(g.fHistoPtInConeMin) +{ + // cpy ctor + + fVertex[0] = g.fVertex[0]; + fVertex[1] = g.fVertex[1]; + fVertex[2] = g.fVertex[2]; + + //Several IC + for(Int_t i = 0; i < fNCones ; i++){ + fConeSizes[i] = g.fConeSizes[i]; + fhPtSumIsolated[i] = g.fhPtSumIsolated[i]; + + fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i]; + fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i]; + fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i]; + fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i]; + fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i]; + fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i]; + + for(Int_t j = 0; j < fNPtThresFrac ; j++){ + fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j]; + fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j]; + + fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j]; + fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j]; + fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j]; + fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j]; + fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j]; + fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j]; + + fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j]; + fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j]; + fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j]; + fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j]; + fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j]; + fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j]; + + } + } + + for(Int_t i = 0; i < fNPtThresFrac ; i++){ + fPtFractions[i]= g.fPtFractions[i]; + fPtThresholds[i]= g.fPtThresholds[i]; + } + +} + +//_________________________________________________________________________ +AliAnaParticleIsolation & AliAnaParticleIsolation::operator = (const AliAnaParticleIsolation & g) +{ + // assignment operator + + if(&g == this) return *this; + + fReMakeIC = g.fReMakeIC ; + fMakeSeveralIC = g.fMakeSeveralIC ; + fMakeInvMass = g.fMakeInvMass ; + fCalorimeter = g.fCalorimeter ; + fVertex[0] = g.fVertex[0]; + fVertex[1] = g.fVertex[1]; + fVertex[2] = g.fVertex[2]; + + fhConeSumPt = g.fhConeSumPt ; + fhPtInCone = g.fhPtInCone; + + fhPtIso = g.fhPtIso ; + fhPhiIso = g.fhPhiIso ; + fhEtaIso = g.fhEtaIso ; + + fhPtIsoPrompt = g.fhPtIsoPrompt; + fhPhiIsoPrompt = g.fhPhiIsoPrompt; + fhEtaIsoPrompt = g.fhEtaIsoPrompt; + fhPtIsoFragmentation = g.fhPtIsoFragmentation; + fhPhiIsoFragmentation = g.fhPhiIsoFragmentation; + fhEtaIsoFragmentation = g.fhEtaIsoFragmentation; + fhPtIsoPi0Decay = g.fhPtIsoPi0Decay; + fhPhiIsoPi0Decay = g.fhPhiIsoPi0Decay; + fhEtaIsoPi0Decay = g.fhEtaIsoPi0Decay; + fhPtIsoOtherDecay = g.fhPtIsoOtherDecay; + fhPhiIsoOtherDecay = g.fhPhiIsoOtherDecay; + fhEtaIsoOtherDecay = g.fhEtaIsoOtherDecay; + fhPtIsoConversion = g. fhPtIsoConversion; + fhPhiIsoConversion = g.fhPhiIsoConversion; + fhEtaIsoConversion = g.fhEtaIsoConversion; + fhPtIsoUnknown = g.fhPtIsoUnknown; + fhPhiIsoUnknown = g.fhPhiIsoUnknown; + fhEtaIsoUnknown = g.fhEtaIsoUnknown; + + //Several IC + fNCones = g.fNCones ; + fNPtThresFrac = g.fNPtThresFrac ; + + for(Int_t i = 0; i < fNCones ; i++){ + fConeSizes[i] = g.fConeSizes[i]; + fhPtSumIsolated[i] = g.fhPtSumIsolated[i] ; + + fhPtSumIsolatedPrompt[i] = g.fhPtSumIsolatedPrompt[i]; + fhPtSumIsolatedFragmentation[i] = g.fhPtSumIsolatedFragmentation[i]; + fhPtSumIsolatedPi0Decay[i] = g.fhPtSumIsolatedPi0Decay[i]; + fhPtSumIsolatedOtherDecay[i] = g.fhPtSumIsolatedOtherDecay[i]; + fhPtSumIsolatedConversion[i] = g.fhPtSumIsolatedConversion[i]; + fhPtSumIsolatedUnknown[i] = g.fhPtSumIsolatedUnknown[i]; + + for(Int_t j = 0; j < fNPtThresFrac ; j++){ + fhPtThresIsolated[i][j] = g.fhPtThresIsolated[i][j] ; + fhPtFracIsolated[i][j] = g.fhPtFracIsolated[i][j] ; + + fhPtThresIsolatedPrompt[i][j] = g.fhPtThresIsolatedPrompt[i][j]; + fhPtThresIsolatedFragmentation[i][j] = g.fhPtThresIsolatedFragmentation[i][j]; + fhPtThresIsolatedPi0Decay[i][j] = g.fhPtThresIsolatedPi0Decay[i][j]; + fhPtThresIsolatedOtherDecay[i][j] = g.fhPtThresIsolatedOtherDecay[i][j]; + fhPtThresIsolatedConversion[i][j] = g.fhPtThresIsolatedConversion[i][j]; + fhPtThresIsolatedUnknown[i][j] = g.fhPtThresIsolatedUnknown[i][j]; + + fhPtFracIsolatedPrompt[i][j] = g.fhPtFracIsolatedPrompt[i][j]; + fhPtFracIsolatedFragmentation[i][j] = g.fhPtFracIsolatedFragmentation[i][j]; + fhPtFracIsolatedPi0Decay[i][j] = g.fhPtFracIsolatedPi0Decay[i][j]; + fhPtFracIsolatedOtherDecay[i][j] = g.fhPtFracIsolatedOtherDecay[i][j]; + fhPtFracIsolatedConversion[i][j] = g.fhPtFracIsolatedConversion[i][j]; + fhPtFracIsolatedUnknown[i][j] = g.fhPtFracIsolatedUnknown[i][j]; + + } + } + + for(Int_t i = 0; i < fNPtThresFrac ; i++){ + fPtThresholds[i]= g.fPtThresholds[i]; + fPtFractions[i]= g.fPtFractions[i]; + } + + + fHistoNPtSumBins = g.fHistoNPtSumBins; + fHistoPtSumMax = g.fHistoPtSumMax; + fHistoPtSumMin = g.fHistoPtSumMax; + fHistoNPtInConeBins = g.fHistoNPtInConeBins; + fHistoPtInConeMax = g.fHistoPtInConeMax; + fHistoPtInConeMin = g.fHistoPtInConeMin; + + return *this; + +} + +//____________________________________________________________________________ +AliAnaParticleIsolation::~AliAnaParticleIsolation() +{ + //dtor + //do not delete histograms + + delete [] fConeSizes ; + delete [] fPtThresholds ; + delete [] fPtFractions ; + delete [] fVertex ; +} + +//_________________________________________________________________________ +Bool_t AliAnaParticleIsolation::CheckInvMass(const Int_t iaod, const AliAODPWG4ParticleCorrelation * part1) const +{ + // Search if there is a companion decay photon to the candidate + // and discard it in such case + // Use it only if isolation candidates are photons + // Make sure that no selection on photon pt is done in the input aod photon list. + TLorentzVector mom1 = *(part1->Momentum()); + TLorentzVector mom2 ; + for(Int_t jaod = 0; jaod < GetInputAODBranch()->GetEntriesFast(); jaod++){ + if(iaod == jaod) continue ; + AliAODPWG4ParticleCorrelation * part2 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(jaod)); + mom2 = *(part2->Momentum()); + //Select good pair (good phi, pt cuts, aperture and invariant mass) + if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)){ + if(GetDebug() > 1)printf("Selected gamma pair: pt %f, phi %f, eta%f",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); + return kTRUE ; + } + }//loop + + return kFALSE; +} + +//________________________________________________________________________ +TList * AliAnaParticleIsolation::GetCreateOutputObjects() +{ + // Create histograms to be saved in output file and + // store them in outputContainer + TList * outputContainer = new TList() ; + outputContainer->SetName("IsolatedParticleHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + Int_t nptsumbins = fHistoNPtSumBins; + Float_t ptsummax = fHistoPtSumMax; + Float_t ptsummin = fHistoPtSumMin; + Int_t nptinconebins = fHistoNPtInConeBins; + Float_t ptinconemax = fHistoPtInConeMax; + Float_t ptinconemin = fHistoPtInConeMin; + + if(!fMakeSeveralIC){ + + fhConeSumPt = new TH2F + ("hConePtSum","#Sigma p_{T} in cone ",nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhConeSumPt->SetYTitle("#Sigma p_{T}"); + fhConeSumPt->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhConeSumPt) ; + + fhPtInCone = new TH2F + ("hPtInCone","p_{T} in cone ",nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax); + fhPtInCone->SetYTitle("p_{T in cone} (GeV/c)"); + fhPtInCone->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPtInCone) ; + + fhPtIso = new TH1F("hPtIso","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIso->SetYTitle("N"); + fhPtIso->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIso) ; + + fhPhiIso = new TH2F + ("hPhiIso","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIso->SetYTitle("#phi"); + fhPhiIso->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIso) ; + + fhEtaIso = new TH2F + ("hEtaIso","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIso->SetYTitle("#eta"); + fhEtaIso->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIso) ; + + if(IsDataMC()){ + + fhPtIsoPrompt = new TH1F("hPtIsoPrompt","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoPrompt->SetYTitle("N"); + fhPtIsoPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoPrompt) ; + + fhPhiIsoPrompt = new TH2F + ("hPhiIsoPrompt","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoPrompt->SetYTitle("#phi"); + fhPhiIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoPrompt) ; + + fhEtaIsoPrompt = new TH2F + ("hEtaIsoPrompt","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoPrompt->SetYTitle("#eta"); + fhEtaIsoPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoPrompt) ; + + fhPtIsoFragmentation = new TH1F("hPtIsoFragmentation","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoFragmentation->SetYTitle("N"); + fhPtIsoFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoFragmentation) ; + + fhPhiIsoFragmentation = new TH2F + ("hPhiIsoFragmentation","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoFragmentation->SetYTitle("#phi"); + fhPhiIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoFragmentation) ; + + fhEtaIsoFragmentation = new TH2F + ("hEtaIsoFragmentation","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoFragmentation->SetYTitle("#eta"); + fhEtaIsoFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoFragmentation) ; + + fhPtIsoPi0Decay = new TH1F("hPtIsoPi0Decay","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoPi0Decay->SetYTitle("N"); + fhPtIsoPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoPi0Decay) ; + + fhPhiIsoPi0Decay = new TH2F + ("hPhiIsoPi0Decay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoPi0Decay->SetYTitle("#phi"); + fhPhiIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoPi0Decay) ; + + fhEtaIsoPi0Decay = new TH2F + ("hEtaIsoPi0Decay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoPi0Decay->SetYTitle("#eta"); + fhEtaIsoPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoPi0Decay) ; + + fhPtIsoOtherDecay = new TH1F("hPtIsoOtherDecay","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoOtherDecay->SetYTitle("N"); + fhPtIsoOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoOtherDecay) ; + + fhPhiIsoOtherDecay = new TH2F + ("hPhiIsoOtherDecay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoOtherDecay->SetYTitle("#phi"); + fhPhiIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoOtherDecay) ; + + fhEtaIsoOtherDecay = new TH2F + ("hEtaIsoOtherDecay","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoOtherDecay->SetYTitle("#eta"); + fhEtaIsoOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoOtherDecay) ; + + fhPtIsoConversion = new TH1F("hPtIsoConversion","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoConversion->SetYTitle("N"); + fhPtIsoConversion->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoConversion) ; + + fhPhiIsoConversion = new TH2F + ("hPhiIsoConversion","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoConversion->SetYTitle("#phi"); + fhPhiIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoConversion) ; + + fhEtaIsoConversion = new TH2F + ("hEtaIsoConversion","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoConversion->SetYTitle("#eta"); + fhEtaIsoConversion->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoConversion) ; + + fhPtIsoUnknown = new TH1F("hPtIsoUnknown","Isolated Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtIsoUnknown->SetYTitle("N"); + fhPtIsoUnknown->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtIsoUnknown) ; + + fhPhiIsoUnknown = new TH2F + ("hPhiIsoUnknown","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiIsoUnknown->SetYTitle("#phi"); + fhPhiIsoUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiIsoUnknown) ; + + fhEtaIsoUnknown = new TH2F + ("hEtaIsoUnknown","Isolated #phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaIsoUnknown->SetYTitle("#eta"); + fhEtaIsoUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaIsoUnknown) ; + }//Histos with MC + + } + + if(fMakeSeveralIC){ + char name[128]; + char title[128]; + for(Int_t icone = 0; iconeSetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolated[icone]) ; + + if(IsDataMC()){ + sprintf(name,"hPtSumIsolatedPrompt_Cone_%d",icone); + sprintf(title,"Candidate Prompt cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedPrompt[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedPrompt[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedPrompt[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedPrompt[icone]) ; + + sprintf(name,"hPtSumIsolatedFragmentation_Cone_%d",icone); + sprintf(title,"Candidate Fragmentation cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedFragmentation[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedFragmentation[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedFragmentation[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedFragmentation[icone]) ; + + sprintf(name,"hPtSumIsolatedPi0Decay_Cone_%d",icone); + sprintf(title,"Candidate Pi0Decay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedPi0Decay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedPi0Decay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedPi0Decay[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedPi0Decay[icone]) ; + + sprintf(name,"hPtSumIsolatedOtherDecay_Cone_%d",icone); + sprintf(title,"Candidate OtherDecay cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedOtherDecay[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedOtherDecay[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedOtherDecay[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedOtherDecay[icone]) ; + + sprintf(name,"hPtSumIsolatedConversion_Cone_%d",icone); + sprintf(title,"Candidate Conversion cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedConversion[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedConversion[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedConversion[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedConversion[icone]) ; + + sprintf(name,"hPtSumIsolatedUnknown_Cone_%d",icone); + sprintf(title,"Candidate Unknown cone sum p_{T} for cone size %d vs candidate p_{T}",icone); + fhPtSumIsolatedUnknown[icone] = new TH2F(name, title,nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax); + fhPtSumIsolatedUnknown[icone]->SetYTitle("#Sigma p_{T} (GeV/c)"); + fhPtSumIsolatedUnknown[icone]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtSumIsolatedUnknown[icone]) ; + + }//Histos with MC + + for(Int_t ipt = 0; iptSetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolated[icone][ipt]) ; + + sprintf(name,"hPtFracIsol_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolated[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolated[icone][ipt]) ; + + if(IsDataMC()){ + sprintf(name,"hPtThresIsolPrompt_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedPrompt[icone][ipt]) ; + + sprintf(name,"hPtFracIsolPrompt_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Prompt p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedPrompt[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedPrompt[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedPrompt[icone][ipt]) ; + + sprintf(name,"hPtThresIsolFragmentation_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedFragmentation[icone][ipt]) ; + + sprintf(name,"hPtFracIsolFragmentation_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Fragmentation p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedFragmentation[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedFragmentation[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedFragmentation[icone][ipt]) ; + + sprintf(name,"hPtThresIsolPi0Decay_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedPi0Decay[icone][ipt]) ; + + sprintf(name,"hPtFracIsolPi0Decay_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Pi0Decay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedPi0Decay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedPi0Decay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedPi0Decay[icone][ipt]) ; + + sprintf(name,"hPtThresIsolOtherDecay_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedOtherDecay[icone][ipt]) ; + + sprintf(name,"hPtFracIsolOtherDecay_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate OtherDecay p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedOtherDecay[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedOtherDecay[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedOtherDecay[icone][ipt]) ; + + sprintf(name,"hPtThresIsolConversion_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedConversion[icone][ipt]) ; + + sprintf(name,"hPtFracIsolConversion_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Conversion p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedConversion[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedConversion[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedConversion[icone][ipt]) ; + + sprintf(name,"hPtThresIsolUnknown_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtThresIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtThresIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtThresIsolatedUnknown[icone][ipt]) ; + + sprintf(name,"hPtFracIsolUnknown_Cone_%d_Pt%d",icone,ipt); + sprintf(title,"Isolated candidate Unknown p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt); + fhPtFracIsolatedUnknown[icone][ipt] = new TH1F(name, title,nptbins,ptmin,ptmax); + fhPtFracIsolatedUnknown[icone][ipt]->SetXTitle("p_{T} (GeV/c)"); + outputContainer->Add(fhPtFracIsolatedUnknown[icone][ipt]) ; + + }//Histos with MC + + }//icone loop + }//ipt loop + } + + //Keep neutral meson selection histograms if requiered + //Setting done in AliNeutralMesonSelection + if(fMakeInvMass && GetNeutralMesonSelection()){ + TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; + if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) + for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; + } + + + //Save parameters used for analysis + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + + sprintf(onePar,"--- AliAnaParticleIsolation ---\n") ; + parList+=onePar ; + sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; + parList+=onePar ; + sprintf(onePar,"fReMakeIC =%d (Flag for reisolation during histogram filling) \n",fReMakeIC) ; + parList+=onePar ; + sprintf(onePar,"fMakeSeveralIC=%d (Flag for isolation with several cuts at the same time ) \n",fMakeSeveralIC) ; + parList+=onePar ; + sprintf(onePar,"fMakeInvMass=%d (Flag for rejection of candidates with a pi0 inv mass pair) \n",fMakeInvMass) ; + parList+=onePar ; + + if(fMakeSeveralIC){ + sprintf(onePar,"fNCones =%d (Number of cone sizes) \n",fNCones) ; + parList+=onePar ; + sprintf(onePar,"fNPtThresFrac=%d (Flag for isolation with several cuts at the same time ) \n",fNPtThresFrac) ; + parList+=onePar ; + + for(Int_t icone = 0; icone < fNCones ; icone++){ + sprintf(onePar,"fConeSizes[%d]=%1.2f (isolation cone size) \n",icone, fConeSizes[icone]) ; + parList+=onePar ; + } + for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ + sprintf(onePar,"fPtThresholds[%d]=%1.2f (isolation pt threshold) \n",ipt, fPtThresholds[ipt]) ; + parList+=onePar ; + } + for(Int_t ipt = 0; ipt < fNPtThresFrac ; ipt++){ + sprintf(onePar,"fPtFractions[%d]=%1.2f (isolation pt fraction threshold) \n",ipt, fPtFractions[ipt]) ; + parList+=onePar ; + } + } + + //Get parameters set in base class. + parList += GetBaseParametersList() ; + + //Get parameters set in IC class. + if(!fMakeSeveralIC)parList += GetIsolationCut()->GetICParametersList() ; + + TObjString *oString= new TObjString(parList) ; + outputContainer->Add(oString); + + + return outputContainer ; + +} + +//__________________________________________________________________ +void AliAnaParticleIsolation::MakeAnalysisFillAOD() +{ + //Do analysis and fill aods + //Search for the isolated photon in fCalorimeter with pt > GetMinPt() + + if(!GetInputAODBranch()){ + printf("ParticleIsolation::FillAOD: No input particles in AOD with name branch < %s >, STOP \n",GetInputAODName().Data()); + abort(); + } + Int_t n = 0, nfrac = 0; + Bool_t isolated = kFALSE ; + Float_t coneptsum = 0 ; + TRefArray * pl = new TRefArray(); + + //Select the calorimeter for candidate isolation with neutral particles + if(fCalorimeter == "PHOS") + pl = GetAODPHOS(); + else if (fCalorimeter == "EMCAL") + pl = GetAODEMCAL(); + + //Get vertex for photon momentum calculation + if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(fVertex); + + //Loop on AOD branch, filled previously in AliAnaPhoton + TLorentzVector mom ; + + for(Int_t iaod = 0; iaod < GetInputAODBranch()->GetEntriesFast(); iaod++){ + AliAODPWG4ParticleCorrelation * aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + + //If too small or too large pt, skip + if(aod->Pt() < GetMinPt() || aod->Pt() > GetMaxPt() ) continue ; + + //Check invariant mass, if pi0, skip. + Bool_t decay = kFALSE ; + if(fMakeInvMass) decay = CheckInvMass(iaod,aod); + if(decay) continue ; + + n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; + GetIsolationCut()->MakeIsolationCut(GetAODCTS(),pl, + fVertex, kTRUE, aod, n,nfrac,coneptsum, isolated); + aod->SetIsolated(isolated); + + }//loop + + if(GetDebug() > 1) printf("End fill AODs "); + +} + +//__________________________________________________________________ +void AliAnaParticleIsolation::MakeAnalysisFillHistograms() +{ + //Do analysis and fill histograms + Int_t n = 0, nfrac = 0; + Bool_t isolated = kFALSE ; + Float_t coneptsum = 0 ; + //cout<<"MakeAnalysisFillHistograms"<GetEntriesFast(); + if(GetDebug() > 0) printf("histo aod branch entries %d\n", naod); + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4ParticleCorrelation* aod = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + Bool_t isolation = aod->IsIsolated(); + Float_t ptcluster = aod->Pt(); + Float_t phicluster = aod->Phi(); + Float_t etacluster = aod->Eta(); + + //is pt too small skip it + if(ptcluster < GetMinPt() || ptcluster > GetMaxPt() ) continue ; + + if(fMakeSeveralIC) { + //Analysis of multiple IC at same time + MakeSeveralICAnalysis(aod); + continue; + } + else if(fReMakeIC){ + //In case a more strict IC is needed in the produced AOD + n=0; nfrac = 0; isolated = kFALSE; coneptsum = 0; + GetIsolationCut()->MakeIsolationCut(aod->GetRefIsolationConeTracks(), + aod->GetRefIsolationConeClusters(), + fVertex, kFALSE, aod, + n,nfrac,coneptsum, isolated); + fhConeSumPt->Fill(ptcluster,coneptsum); + } + + //Fill pt distribution of particles in cone + //Tracks + coneptsum=0; + for(Int_t itrack=0; itrack < (aod->GetRefIsolationConeTracks())->GetEntriesFast(); itrack++){ + AliAODTrack* track = (AliAODTrack *)((aod->GetRefIsolationConeTracks())->At(itrack)); + fhPtInCone->Fill(ptcluster,TMath::Sqrt(track->Px()*track->Px()+track->Py()*track->Py())); + coneptsum+=track->Pt(); + } + //CaloClusters + TLorentzVector mom ; + for(Int_t icalo=0; icalo < (aod->GetRefIsolationConeClusters())->GetEntriesFast(); icalo++){ + AliAODCaloCluster* calo = (AliAODCaloCluster *)((aod->GetRefIsolationConeClusters())->At(icalo)); + calo->GetMomentum(mom,fVertex);//Assume that come from vertex in straight line + fhPtInCone->Fill(ptcluster, mom.Pt()); + coneptsum+=mom.Pt(); + } + + if(!fReMakeIC) fhConeSumPt->Fill(ptcluster,coneptsum); + + if(isolation){ + fhPtIso ->Fill(ptcluster); + fhPhiIso ->Fill(ptcluster,phicluster); + fhEtaIso ->Fill(ptcluster,etacluster); + + if(IsDataMC()){ + Int_t tag =aod->GetTag(); + + if(tag == AliMCAnalysisUtils::kMCPrompt){ + fhPtIsoPrompt ->Fill(ptcluster); + fhPhiIsoPrompt ->Fill(ptcluster,phicluster); + fhEtaIsoPrompt ->Fill(ptcluster,etacluster); + } + else if(tag == AliMCAnalysisUtils::kMCFragmentation) + { + fhPtIsoFragmentation ->Fill(ptcluster); + fhPhiIsoFragmentation ->Fill(ptcluster,phicluster); + fhEtaIsoFragmentation ->Fill(ptcluster,etacluster); + } + else if(tag == AliMCAnalysisUtils::kMCPi0Decay) + { + fhPtIsoPi0Decay ->Fill(ptcluster); + fhPhiIsoPi0Decay ->Fill(ptcluster,phicluster); + fhEtaIsoPi0Decay ->Fill(ptcluster,etacluster); + } + else if(tag == AliMCAnalysisUtils::kMCEtaDecay || tag == AliMCAnalysisUtils::kMCOtherDecay) + { + fhPtIsoOtherDecay ->Fill(ptcluster); + fhPhiIsoOtherDecay ->Fill(ptcluster,phicluster); + fhEtaIsoOtherDecay ->Fill(ptcluster,etacluster); + } + else if(tag == AliMCAnalysisUtils::kMCConversion) + { + fhPtIsoConversion ->Fill(ptcluster); + fhPhiIsoConversion ->Fill(ptcluster,phicluster); + fhEtaIsoConversion ->Fill(ptcluster,etacluster); + } + else + { + fhPtIsoUnknown ->Fill(ptcluster); + fhPhiIsoUnknown ->Fill(ptcluster,phicluster); + fhEtaIsoUnknown ->Fill(ptcluster,etacluster); + } + }//Histograms with MC + + }//Isolated histograms + + }// aod loop + +} + +//____________________________________________________________________________ +void AliAnaParticleIsolation::InitParameters() +{ + + //Initialize the parameters of the analysis. + SetInputAODName("photons"); + + fCalorimeter = "PHOS" ; + fReMakeIC = kFALSE ; + fMakeSeveralIC = kFALSE ; + fMakeInvMass = kFALSE ; + + //----------- Several IC----------------- + fNCones = 5 ; + fNPtThresFrac = 5 ; + fConeSizes[0] = 0.1; fConeSizes[1] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4; fConeSizes[4] = 0.5; + fPtThresholds[0] = 1.; fPtThresholds[1] = 2.; fPtThresholds[2] = 3.; fPtThresholds[3] = 4.; fPtThresholds[4] = 5.; + fPtFractions[0] = 0.05; fPtFractions[1] = 0.075; fPtFractions[2] = 0.1; fPtFractions[3] = 1.25; fPtFractions[4] = 1.5; + +//------------- Histograms settings ------- + fHistoNPtSumBins = 100 ; + fHistoPtSumMax = 50 ; + fHistoPtSumMin = 0. ; + + fHistoNPtInConeBins = 100 ; + fHistoPtInConeMax = 50 ; + fHistoPtInConeMin = 0. ; + +} + +//__________________________________________________________________ +void AliAnaParticleIsolation::MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelation* ph) +{ + //Isolation Cut Analysis for both methods and different pt cuts and cones + Float_t ptC = ph->Pt(); + Int_t tag = ph->GetTag(); + + //Keep original setting used when filling AODs, reset at end of analysis + Float_t ptthresorg = GetIsolationCut()->GetPtThreshold(); + Float_t ptfracorg = GetIsolationCut()->GetPtFraction(); + Float_t rorg = GetIsolationCut()->GetConeSize(); + + Float_t coneptsum = 0 ; + Int_t n[10][10];//[fNCones][fNPtThresFrac]; + Int_t nfrac[10][10];//[fNCones][fNPtThresFrac]; + Bool_t isolated = kFALSE; + + //Loop on cone sizes + for(Int_t icone = 0; iconeSetConeSize(fConeSizes[icone]); + coneptsum = 0 ; + //Loop on ptthresholds + for(Int_t ipt = 0; iptSetPtThreshold(fPtThresholds[ipt]); + GetIsolationCut()->MakeIsolationCut(ph->GetRefIsolationConeTracks(), + ph->GetRefIsolationConeClusters(), + fVertex, kFALSE, ph, + n[icone][ipt],nfrac[icone][ipt],coneptsum, isolated); + //Normal ptThreshold cut + if(n[icone][ipt] == 0) { + fhPtThresIsolated[icone][ipt]->Fill(ptC); + if(IsDataMC()){ + if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtThresIsolatedPrompt[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtThresIsolatedConversion[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtThresIsolatedFragmentation[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtThresIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtThresIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; + else fhPtThresIsolatedUnknown[icone][ipt]->Fill(ptC) ; + } + } + + //Pt threshold on pt cand/ pt in cone fraction + if(nfrac[icone][ipt] == 0) { + fhPtFracIsolated[icone][ipt]->Fill(ptC); + if(IsDataMC()){ + if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtFracIsolatedPrompt[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtFracIsolatedConversion[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtFracIsolatedFragmentation[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtFracIsolatedPi0Decay[icone][ipt]->Fill(ptC) ; + else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtFracIsolatedOtherDecay[icone][ipt]->Fill(ptC) ; + else fhPtFracIsolatedUnknown[icone][ipt]->Fill(ptC) ; + } + } + }//pt thresh loop + + //Sum in cone histograms + fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ; + if(IsDataMC()){ + if(tag == AliMCAnalysisUtils::kMCPrompt) fhPtSumIsolatedPrompt[icone]->Fill(ptC,coneptsum) ; + else if(tag == AliMCAnalysisUtils::kMCConversion) fhPtSumIsolatedConversion[icone]->Fill(ptC,coneptsum) ; + else if(tag == AliMCAnalysisUtils::kMCFragmentation) fhPtSumIsolatedFragmentation[icone]->Fill(ptC,coneptsum) ; + else if(tag == AliMCAnalysisUtils::kMCPi0Decay) fhPtSumIsolatedPi0Decay[icone]->Fill(ptC,coneptsum) ; + else if(tag == AliMCAnalysisUtils::kMCOtherDecay || tag == AliMCAnalysisUtils::kMCEtaDecay) fhPtSumIsolatedOtherDecay[icone]->Fill(ptC,coneptsum) ; + else fhPtSumIsolatedUnknown[icone]->Fill(ptC,coneptsum) ; + } + + }//cone size loop + + //Reset original parameters for AOD analysis + GetIsolationCut()->SetPtThreshold(ptthresorg); + GetIsolationCut()->SetPtFraction(ptfracorg); + GetIsolationCut()->SetConeSize(rorg); + +} + +//__________________________________________________________________ +void AliAnaParticleIsolation::Print(const Option_t * opt) const +{ + + //Print some relevant parameters set for the analysis + if(! opt) + return; + + printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; + + printf("Min Gamma pT = %2.2f\n", GetMinPt()) ; + printf("Max Gamma pT = %3.2f\n", GetMaxPt()) ; + + printf("ReMake Isolation = %d \n", fReMakeIC) ; + printf("Make Several Isolation = %d \n", fMakeSeveralIC) ; + printf("Calorimeter for isolation = %s \n", fCalorimeter.Data()) ; + + if(fMakeSeveralIC){ + printf("N Cone Sizes = %d\n", fNCones) ; + printf("Cone Sizes = \n") ; + for(Int_t i = 0; i < fNCones; i++) + printf(" %1.2f;", fConeSizes[i]) ; + printf(" \n") ; + + printf("N pT thresholds/fractions = %d\n", fNPtThresFrac) ; + printf(" pT thresholds = \n") ; + for(Int_t i = 0; i < fNPtThresFrac; i++) + printf(" %2.2f;", fPtThresholds[i]) ; + + printf(" \n") ; + + printf(" pT fractions = \n") ; + for(Int_t i = 0; i < fNPtThresFrac; i++) + printf(" %2.2f;", fPtFractions[i]) ; + + } + + printf("Histograms: %3.1f < pT sum < %3.1f, Nbin = %d\n", fHistoPtSumMin, fHistoPtSumMax, fHistoNPtSumBins); + printf("Histograms: %3.1f < pT in cone < %3.1f, Nbin = %d\n", fHistoPtInConeMin, fHistoPtInConeMax, fHistoNPtInConeBins); + + printf(" \n") ; + +} + diff --git a/PWG4/PartCorrDep/AliAnaParticleIsolation.h b/PWG4/PartCorrDep/AliAnaParticleIsolation.h index 32724095919..99eba20431b 100755 --- a/PWG4/PartCorrDep/AliAnaParticleIsolation.h +++ b/PWG4/PartCorrDep/AliAnaParticleIsolation.h @@ -1,180 +1,179 @@ -#ifndef ALIANAPARTICLEISOLATION_H -#define ALIANAPARTICLEISOLATION_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ -/* $Id: AliAnaParticleIsolation.h 27413 2008-07-18 13:28:12Z gconesab $ */ - -//_________________________________________________________________________ - -// Class for the analysis of particle isolation -// Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation) -// -// Class created from old AliPHOSGammaJet -// (see AliRoot versions previous Release 4-09) - -//-- Author: Gustavo Conesa (INFN-LNF) - -// --- ROOT system --- -#include -#include - -// --- ANALYSIS system --- -#include "AliAnaPartCorrBaseClass.h" -class AliAODPWG4ParticleCorrelation ; - -class TList ; - -class AliAnaParticleIsolation : public AliAnaPartCorrBaseClass { - -public: - - AliAnaParticleIsolation() ; // default ctor - AliAnaParticleIsolation(const AliAnaParticleIsolation & g) ; // cpy ctor - AliAnaParticleIsolation & operator = (const AliAnaParticleIsolation & g) ;//cpy assignment - virtual ~AliAnaParticleIsolation() ; //virtual dtor - - Bool_t CheckInvMass(const Int_t icalo,const AliAODPWG4ParticleCorrelation * ph) const ; - - TList * GetCreateOutputObjects(); - - void MakeAnalysisFillAOD() ; - - void MakeAnalysisFillHistograms() ; - - void MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelation * ph); - - void Print(const Option_t * opt)const; - - TString GetCalorimeter() const {return fCalorimeter ; } - void SetCalorimeter(TString det) {fCalorimeter = det ; } - - Int_t GetNCones() const {return fNCones ; } - Int_t GetNPtThresFrac() const {return fNPtThresFrac ; } - Float_t GetConeSizes(Int_t i) const {return fConeSizes[i] ; } - Float_t GetPtThresholds(Int_t i) const {return fPtThresholds[i] ; } - Float_t GetPtFractions(Int_t i) const {return fPtFractions[i] ; } - - void InitParameters(); - - void SetNCones(Int_t ncs) {fNCones = ncs ; } - void SetNPtThresFrac(Int_t npt) {fNPtThresFrac = npt; } - void SetConeSizes(Int_t i, Float_t r) {fConeSizes[i] = r ; } - void SetPtThresholds(Int_t i, Float_t pt) {fPtThresholds[i] = pt; } - void SetPtFractions(Int_t i, Float_t pt) {fPtFractions[i] = pt; } - - Bool_t IsReIsolationOn() const {return fReMakeIC ; } - void SwitchOnReIsolation() { fReMakeIC = kTRUE;} - void SwitchOffReIsolation() { fReMakeIC = kFALSE;} - - Bool_t IsSeveralIsolationOn() const {return fMakeSeveralIC ; } - void SwitchOnSeveralIsolation() { fMakeSeveralIC = kTRUE;} - void SwitchOffSeveralIsolation() { fMakeSeveralIC = kFALSE;} - - Bool_t IsInvariantMassOn() const {return fMakeInvMass ; } - void SwitchOnInvariantMass() { fMakeInvMass = kTRUE;} - void SwitchOffInvariantMass() { fMakeInvMass = kFALSE;} - - //Histogrammes setters and getters - virtual void SetHistoPtSumRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNPtSumBins = n ; - fHistoPtSumMax = max ; - fHistoPtSumMin = min ; - } - - Int_t GetHistoNPtSumBins() const { return fHistoNPtSumBins ; } - Float_t GetHistoPtSumMin() const { return fHistoPtSumMin ; } - Float_t GetHistoPtSumMax() const { return fHistoPtSumMax ; } - - virtual void SetHistoPtInConeRangeAndNBins(Float_t min, Float_t max, Int_t n) { - fHistoNPtInConeBins = n ; - fHistoPtInConeMax = max ; - fHistoPtInConeMin = min ; - } - - Int_t GetHistoNPtInConeBins() const { return fHistoNPtInConeBins ; } - Float_t GetHistoPtInConeMin() const { return fHistoPtInConeMin ; } - Float_t GetHistoPtInConeMax() const { return fHistoPtInConeMax ; } - - -private: - - TString fCalorimeter ; // Calorimeter where neutral particles in cone for isolation are; - Double_t fVertex[3] ; //! Event Vertex - Bool_t fReMakeIC ; // Do isolation analysis - Bool_t fMakeSeveralIC ; // Do analysis for different IC - Bool_t fMakeInvMass; // Select candidate if no pair from decay - - //Histograms - - TH1F * fhPtIso ; //! Number of isolated particles - TH2F * fhPhiIso ; //! Phi of isolated particles - TH2F * fhEtaIso ; //! eta of isolated particles - TH2F * fhConeSumPt ; //! Sum Pt in the cone - TH2F * fhPtInCone ; //! Particle Pt in the cone - - //Prompt photon analysis data members for multiple cones and pt thresholds - Int_t fNCones ; //! Number of cone sizes to test - Int_t fNPtThresFrac ; //! Number of ptThres and ptFrac to test - - Float_t fConeSizes[5] ; //! Array with cones to test - Float_t fPtThresholds[5] ; //! Array with pt thresholds to test - Float_t fPtFractions[5] ; //! Array with pt thresholds to test - - TH1F* fhPtThresIsolated[5][5] ; //! Isolated particle with pt threshold - TH1F* fhPtFracIsolated[5][5] ; //! Isolated particle with pt threshold - TH2F* fhPtSumIsolated[5] ; //! Isolated particle with threshold on cone pt sum - - //MC - TH1F * fhPtIsoPrompt; //! Number of isolated prompt gamma - TH2F * fhPhiIsoPrompt; //! Phi of isolated prompt gamma - TH2F * fhEtaIsoPrompt; //! eta of isolated prompt gamma - TH1F * fhPtThresIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt threshold - TH1F * fhPtFracIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt frac - TH2F * fhPtSumIsolatedPrompt[5]; //! Isolated prompt gamma with threshold on cone pt sume - TH1F * fhPtIsoFragmentation; //! Number of isolated fragmentation gamma - TH2F * fhPhiIsoFragmentation; //! Phi of isolated fragmentation gamma - TH2F * fhEtaIsoFragmentation; //! eta of isolated fragmentation gamma - TH1F * fhPtThresIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt threshold - TH1F * fhPtFracIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt frac - TH2F * fhPtSumIsolatedFragmentation[5]; //! Isolated fragmentation gamma with threshold on cone pt sume - TH1F * fhPtIsoPi0Decay; //!Number of isolated Pi0Decay gamma - TH2F * fhPhiIsoPi0Decay; //! Phi of isolated Pi0Decay gamma - TH2F * fhEtaIsoPi0Decay; //! eta of isolated Pi0Decay gamma - TH1F * fhPtThresIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt threshold - TH1F * fhPtFracIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt frac - TH2F * fhPtSumIsolatedPi0Decay[5]; //! Isolated Pi0Decay gamma with threshold on cone pt sume - TH1F * fhPtIsoOtherDecay; //! Number of isolated OtherDecay gamma - TH2F * fhPhiIsoOtherDecay; //! Phi of isolated OtherDecay gamma - TH2F * fhEtaIsoOtherDecay; //! eta of isolated OtherDecay gamma - TH1F * fhPtThresIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt threshold - TH1F * fhPtFracIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt frac - TH2F * fhPtSumIsolatedOtherDecay[5]; //! Isolated OtherDecay gamma with threshold on cone pt sume - TH1F * fhPtIsoConversion; //! Number of isolated Conversion gamma - TH2F * fhPhiIsoConversion; //! Phi of isolated Conversion gamma - TH2F * fhEtaIsoConversion; //! eta of isolated Conversion gamma - TH1F * fhPtThresIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt threshold - TH1F * fhPtFracIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt frac - TH2F * fhPtSumIsolatedConversion[5]; //! Isolated Conversion gamma with threshold on cone pt sume - TH1F * fhPtIsoUnknown; //! Number of isolated Unknown - TH2F * fhPhiIsoUnknown; //! Phi of isolated Unknown - TH2F * fhEtaIsoUnknown; //! eta of isolated Unknown - TH1F * fhPtThresIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt threshold - TH1F * fhPtFracIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt frac - TH2F * fhPtSumIsolatedUnknown[5]; //! Isolated Unknown gamma with threshold on cone pt sume - - //Histograms settings - Int_t fHistoNPtSumBins; // Number of bins in PtSum histograms - Float_t fHistoPtSumMax; // PtSum maximum in histogram - Float_t fHistoPtSumMin; // PtSum minimum in histogram - Int_t fHistoNPtInConeBins; // Number of bins in PtInCone histogram - Float_t fHistoPtInConeMax; // PtInCone maximum in histogram - Float_t fHistoPtInConeMin; // PtInCone maximum in histogram - - ClassDef(AliAnaParticleIsolation,2) -} ; - - -#endif //ALIANAPARTICLEISOLATION_H - - - +#ifndef ALIANAPARTICLEISOLATION_H +#define ALIANAPARTICLEISOLATION_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +/* $Id: AliAnaParticleIsolation.h 27413 2008-07-18 13:28:12Z gconesab $ */ + +//_________________________________________________________________________ + +// Class for the analysis of particle isolation +// Input is selected particles put in AOD branch (AliAODPWG4ParticleCorrelation) +// +// Class created from old AliPHOSGammaJet +// (see AliRoot versions previous Release 4-09) + +//-- Author: Gustavo Conesa (INFN-LNF) + +// --- ROOT system --- +class TH2F; +class TList ; + +// --- ANALYSIS system --- +#include "AliAnaPartCorrBaseClass.h" +class AliAODPWG4ParticleCorrelation ; + + +class AliAnaParticleIsolation : public AliAnaPartCorrBaseClass { + +public: + + AliAnaParticleIsolation() ; // default ctor + AliAnaParticleIsolation(const AliAnaParticleIsolation & g) ; // cpy ctor + AliAnaParticleIsolation & operator = (const AliAnaParticleIsolation & g) ;//cpy assignment + virtual ~AliAnaParticleIsolation() ; //virtual dtor + + Bool_t CheckInvMass(const Int_t icalo,const AliAODPWG4ParticleCorrelation * ph) const ; + + TList * GetCreateOutputObjects(); + + void MakeAnalysisFillAOD() ; + + void MakeAnalysisFillHistograms() ; + + void MakeSeveralICAnalysis(AliAODPWG4ParticleCorrelation * ph); + + void Print(const Option_t * opt)const; + + TString GetCalorimeter() const {return fCalorimeter ; } + void SetCalorimeter(TString det) {fCalorimeter = det ; } + + Int_t GetNCones() const {return fNCones ; } + Int_t GetNPtThresFrac() const {return fNPtThresFrac ; } + Float_t GetConeSizes(Int_t i) const {return fConeSizes[i] ; } + Float_t GetPtThresholds(Int_t i) const {return fPtThresholds[i] ; } + Float_t GetPtFractions(Int_t i) const {return fPtFractions[i] ; } + + void InitParameters(); + + void SetNCones(Int_t ncs) {fNCones = ncs ; } + void SetNPtThresFrac(Int_t npt) {fNPtThresFrac = npt; } + void SetConeSizes(Int_t i, Float_t r) {fConeSizes[i] = r ; } + void SetPtThresholds(Int_t i, Float_t pt) {fPtThresholds[i] = pt; } + void SetPtFractions(Int_t i, Float_t pt) {fPtFractions[i] = pt; } + + Bool_t IsReIsolationOn() const {return fReMakeIC ; } + void SwitchOnReIsolation() { fReMakeIC = kTRUE;} + void SwitchOffReIsolation() { fReMakeIC = kFALSE;} + + Bool_t IsSeveralIsolationOn() const {return fMakeSeveralIC ; } + void SwitchOnSeveralIsolation() { fMakeSeveralIC = kTRUE;} + void SwitchOffSeveralIsolation() { fMakeSeveralIC = kFALSE;} + + Bool_t IsInvariantMassOn() const {return fMakeInvMass ; } + void SwitchOnInvariantMass() { fMakeInvMass = kTRUE;} + void SwitchOffInvariantMass() { fMakeInvMass = kFALSE;} + + //Histogrammes setters and getters + virtual void SetHistoPtSumRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNPtSumBins = n ; + fHistoPtSumMax = max ; + fHistoPtSumMin = min ; + } + + Int_t GetHistoNPtSumBins() const { return fHistoNPtSumBins ; } + Float_t GetHistoPtSumMin() const { return fHistoPtSumMin ; } + Float_t GetHistoPtSumMax() const { return fHistoPtSumMax ; } + + virtual void SetHistoPtInConeRangeAndNBins(Float_t min, Float_t max, Int_t n) { + fHistoNPtInConeBins = n ; + fHistoPtInConeMax = max ; + fHistoPtInConeMin = min ; + } + + Int_t GetHistoNPtInConeBins() const { return fHistoNPtInConeBins ; } + Float_t GetHistoPtInConeMin() const { return fHistoPtInConeMin ; } + Float_t GetHistoPtInConeMax() const { return fHistoPtInConeMax ; } + + + private: + + TString fCalorimeter ; // Calorimeter where neutral particles in cone for isolation are; + Double_t fVertex[3] ; //! Event Vertex + Bool_t fReMakeIC ; // Do isolation analysis + Bool_t fMakeSeveralIC ; // Do analysis for different IC + Bool_t fMakeInvMass; // Select candidate if no pair from decay + + //Histograms + + TH1F * fhPtIso ; //! Number of isolated particles + TH2F * fhPhiIso ; //! Phi of isolated particles + TH2F * fhEtaIso ; //! eta of isolated particles + TH2F * fhConeSumPt ; //! Sum Pt in the cone + TH2F * fhPtInCone ; //! Particle Pt in the cone + + //Prompt photon analysis data members for multiple cones and pt thresholds + Int_t fNCones ; //! Number of cone sizes to test + Int_t fNPtThresFrac ; //! Number of ptThres and ptFrac to test + + Float_t fConeSizes[5] ; //! Array with cones to test + Float_t fPtThresholds[5] ; //! Array with pt thresholds to test + Float_t fPtFractions[5] ; //! Array with pt thresholds to test + + TH1F* fhPtThresIsolated[5][5] ; //! Isolated particle with pt threshold + TH1F* fhPtFracIsolated[5][5] ; //! Isolated particle with pt threshold + TH2F* fhPtSumIsolated[5] ; //! Isolated particle with threshold on cone pt sum + + //MC + TH1F * fhPtIsoPrompt; //! Number of isolated prompt gamma + TH2F * fhPhiIsoPrompt; //! Phi of isolated prompt gamma + TH2F * fhEtaIsoPrompt; //! eta of isolated prompt gamma + TH1F * fhPtThresIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt threshold + TH1F * fhPtFracIsolatedPrompt[5][5]; //! Isolated prompt gamma with pt frac + TH2F * fhPtSumIsolatedPrompt[5]; //! Isolated prompt gamma with threshold on cone pt sume + TH1F * fhPtIsoFragmentation; //! Number of isolated fragmentation gamma + TH2F * fhPhiIsoFragmentation; //! Phi of isolated fragmentation gamma + TH2F * fhEtaIsoFragmentation; //! eta of isolated fragmentation gamma + TH1F * fhPtThresIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt threshold + TH1F * fhPtFracIsolatedFragmentation[5][5]; //! Isolated fragmentation gamma with pt frac + TH2F * fhPtSumIsolatedFragmentation[5]; //! Isolated fragmentation gamma with threshold on cone pt sume + TH1F * fhPtIsoPi0Decay; //!Number of isolated Pi0Decay gamma + TH2F * fhPhiIsoPi0Decay; //! Phi of isolated Pi0Decay gamma + TH2F * fhEtaIsoPi0Decay; //! eta of isolated Pi0Decay gamma + TH1F * fhPtThresIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt threshold + TH1F * fhPtFracIsolatedPi0Decay[5][5]; //! Isolated Pi0Decay gamma with pt frac + TH2F * fhPtSumIsolatedPi0Decay[5]; //! Isolated Pi0Decay gamma with threshold on cone pt sume + TH1F * fhPtIsoOtherDecay; //! Number of isolated OtherDecay gamma + TH2F * fhPhiIsoOtherDecay; //! Phi of isolated OtherDecay gamma + TH2F * fhEtaIsoOtherDecay; //! eta of isolated OtherDecay gamma + TH1F * fhPtThresIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt threshold + TH1F * fhPtFracIsolatedOtherDecay[5][5]; //! Isolated OtherDecay gamma with pt frac + TH2F * fhPtSumIsolatedOtherDecay[5]; //! Isolated OtherDecay gamma with threshold on cone pt sume + TH1F * fhPtIsoConversion; //! Number of isolated Conversion gamma + TH2F * fhPhiIsoConversion; //! Phi of isolated Conversion gamma + TH2F * fhEtaIsoConversion; //! eta of isolated Conversion gamma + TH1F * fhPtThresIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt threshold + TH1F * fhPtFracIsolatedConversion[5][5]; //! Isolated Conversion gamma with pt frac + TH2F * fhPtSumIsolatedConversion[5]; //! Isolated Conversion gamma with threshold on cone pt sume + TH1F * fhPtIsoUnknown; //! Number of isolated Unknown + TH2F * fhPhiIsoUnknown; //! Phi of isolated Unknown + TH2F * fhEtaIsoUnknown; //! eta of isolated Unknown + TH1F * fhPtThresIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt threshold + TH1F * fhPtFracIsolatedUnknown[5][5]; //! Isolated Unknown gamma with pt frac + TH2F * fhPtSumIsolatedUnknown[5]; //! Isolated Unknown gamma with threshold on cone pt sume + + //Histograms settings + Int_t fHistoNPtSumBins; // Number of bins in PtSum histograms + Float_t fHistoPtSumMax; // PtSum maximum in histogram + Float_t fHistoPtSumMin; // PtSum minimum in histogram + Int_t fHistoNPtInConeBins; // Number of bins in PtInCone histogram + Float_t fHistoPtInConeMax; // PtInCone maximum in histogram + Float_t fHistoPtInConeMin; // PtInCone maximum in histogram + + ClassDef(AliAnaParticleIsolation,2) + } ; + + +#endif //ALIANAPARTICLEISOLATION_H + + + diff --git a/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx index 24deede89f6..74ba6462af7 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx @@ -22,79 +22,84 @@ // --- ROOT system --- #include "TH2F.h" +#include "TClonesArray.h" //#include "Riostream.h" //---- AliRoot system ---- #include "AliCaloTrackReader.h" #include "AliAODJet.h" #include "AliAnaParticleJetFinderCorrelation.h" -#include "AliLog.h" #include "AliAODPWG4ParticleCorrelation.h" +#include "AliAODTrack.h" +#include "AliAODCaloCluster.h" +#include "AliAODEvent.h" - ClassImp(AliAnaParticleJetFinderCorrelation) +ClassImp(AliAnaParticleJetFinderCorrelation) //____________________________________________________________________________ AliAnaParticleJetFinderCorrelation::AliAnaParticleJetFinderCorrelation() : - AliAnaPartCorrBaseClass(), + AliAnaPartCorrBaseClass(), fDeltaPhiMaxCut(0.), fDeltaPhiMinCut(0.), fRatioMaxCut(0.), fRatioMinCut(0.), - fConeSize(0), fPtThresholdInCone(0),fUseJetRefTracks(0), fMakeCorrelationInHistoMaker(0), - fhDeltaEta(0), fhDeltaPhi(0), fhDeltaPt(0), fhPtRatio(0), fhPt(0), - fhFFz(0),fhFFxi(0),fhFFpt(0),fhNTracksInCone(0) + fConeSize(0), fPtThresholdInCone(0),fUseJetRefTracks(0), fMakeCorrelationInHistoMaker(0), fSelectIsolated(0), + fhDeltaEta(0), fhDeltaPhi(0), fhDeltaPt(0), fhPtRatio(0), fhPt(0), + fhFFz(0),fhFFxi(0),fhFFpt(0),fhNTracksInCone(0) { - //Default Ctor - - //Initialize parameters - InitParameters(); + //Default Ctor + + //Initialize parameters + InitParameters(); } //____________________________________________________________________________ AliAnaParticleJetFinderCorrelation::AliAnaParticleJetFinderCorrelation(const AliAnaParticleJetFinderCorrelation & pjf) : - AliAnaPartCorrBaseClass(pjf), - fDeltaPhiMaxCut(pjf.fDeltaPhiMaxCut), fDeltaPhiMinCut(pjf.fDeltaPhiMinCut), - fRatioMaxCut(pjf.fRatioMaxCut), fRatioMinCut(pjf.fRatioMinCut), - fConeSize(pjf.fConeSize), fPtThresholdInCone(pjf.fPtThresholdInCone), - fUseJetRefTracks(pjf.fUseJetRefTracks), fMakeCorrelationInHistoMaker(pjf.fMakeCorrelationInHistoMaker), - fhDeltaEta(pjf.fhDeltaEta), fhDeltaPhi(pjf.fhDeltaPhi), - fhDeltaPt(pjf.fhDeltaPt), fhPtRatio(pjf.fhPtRatio), fhPt(pjf.fhPt), - fhFFz(pjf.fhFFz),fhFFxi(pjf.fhFFxi),fhFFpt(pjf.fhFFpt), - fhNTracksInCone(pjf.fhNTracksInCone) + AliAnaPartCorrBaseClass(pjf), + fDeltaPhiMaxCut(pjf.fDeltaPhiMaxCut), fDeltaPhiMinCut(pjf.fDeltaPhiMinCut), + fRatioMaxCut(pjf.fRatioMaxCut), fRatioMinCut(pjf.fRatioMinCut), + fConeSize(pjf.fConeSize), fPtThresholdInCone(pjf.fPtThresholdInCone), + fUseJetRefTracks(pjf.fUseJetRefTracks), fMakeCorrelationInHistoMaker(pjf.fMakeCorrelationInHistoMaker), + fSelectIsolated(pjf.fSelectIsolated), + fhDeltaEta(pjf.fhDeltaEta), fhDeltaPhi(pjf.fhDeltaPhi), + fhDeltaPt(pjf.fhDeltaPt), fhPtRatio(pjf.fhPtRatio), fhPt(pjf.fhPt), + fhFFz(pjf.fhFFz),fhFFxi(pjf.fhFFxi),fhFFpt(pjf.fhFFpt), + fhNTracksInCone(pjf.fhNTracksInCone) { - // cpy ctor - + // cpy ctor + } //_________________________________________________________________________ AliAnaParticleJetFinderCorrelation & AliAnaParticleJetFinderCorrelation::operator = (const AliAnaParticleJetFinderCorrelation & pjf) { - // assignment operator - - if(this == &pjf)return *this; - ((AliAnaPartCorrBaseClass *)this)->operator=(pjf); + // assignment operator + + if(this == &pjf)return *this; + ((AliAnaPartCorrBaseClass *)this)->operator=(pjf); - fDeltaPhiMaxCut = pjf.fDeltaPhiMaxCut ; - fDeltaPhiMinCut = pjf.fDeltaPhiMinCut ; - fRatioMaxCut = pjf.fRatioMaxCut ; - fRatioMinCut = pjf.fRatioMinCut ; - fConeSize = pjf.fConeSize ; - fPtThresholdInCone = pjf.fPtThresholdInCone ; - fUseJetRefTracks = pjf.fUseJetRefTracks ; - fMakeCorrelationInHistoMaker = pjf.fMakeCorrelationInHistoMaker ; - - //Histograms - fhDeltaEta = pjf.fhDeltaEta; - fhDeltaPhi = pjf.fhDeltaPhi; - fhDeltaPt = pjf.fhDeltaPt; - fhPtRatio = pjf.fhPtRatio; - fhPt = pjf.fhPt; + fDeltaPhiMaxCut = pjf.fDeltaPhiMaxCut ; + fDeltaPhiMinCut = pjf.fDeltaPhiMinCut ; + fRatioMaxCut = pjf.fRatioMaxCut ; + fRatioMinCut = pjf.fRatioMinCut ; + fConeSize = pjf.fConeSize ; + fPtThresholdInCone = pjf.fPtThresholdInCone ; + fUseJetRefTracks = pjf.fUseJetRefTracks ; + fMakeCorrelationInHistoMaker = pjf.fMakeCorrelationInHistoMaker ; + fSelectIsolated = pjf.fSelectIsolated ; - fhFFz = pjf.fhFFz; - fhFFxi = pjf.fhFFxi; - fhFFpt = pjf.fhFFpt; - fhNTracksInCone = pjf.fhNTracksInCone; + //Histograms + fhDeltaEta = pjf.fhDeltaEta; + fhDeltaPhi = pjf.fhDeltaPhi; + fhDeltaPt = pjf.fhDeltaPt; + fhPtRatio = pjf.fhPtRatio; + fhPt = pjf.fhPt; + + fhFFz = pjf.fhFFz; + fhFFxi = pjf.fhFFxi; + fhFFpt = pjf.fhFFpt; + fhNTracksInCone = pjf.fhNTracksInCone; return *this; - + } //____________________________________________________________________________ @@ -108,76 +113,76 @@ AliAnaParticleJetFinderCorrelation & AliAnaParticleJetFinderCorrelation::operato //________________________________________________________________________ TList * AliAnaParticleJetFinderCorrelation::GetCreateOutputObjects() { - // Create histograms to be saved in output file and - // store them in fOutputContainer - - if(GetDebug()>1) printf("Init histograms \n"); - - TList * outputContainer = new TList() ; - outputContainer->SetName("ParticleJetFinderHistos") ; - - Int_t nptbins = GetHistoNPtBins(); -// Int_t nphibins = GetHistoNPhiBins(); -// Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); -// Float_t phimax = GetHistoPhiMax(); -// Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); -// Float_t phimin = GetHistoPhiMin(); + // Create histograms to be saved in output file and + // store them in fOutputContainer + + if(GetDebug()>1) printf("Init histograms \n"); + + TList * outputContainer = new TList() ; + outputContainer->SetName("ParticleJetFinderHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + // Int_t nphibins = GetHistoNPhiBins(); + // Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + // Float_t phimax = GetHistoPhiMax(); + // Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + // Float_t phimin = GetHistoPhiMin(); // Float_t etamin = GetHistoEtaMin(); + + fhDeltaPhi = new TH2F("DeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-4,4); + fhDeltaPhi->SetYTitle("#Delta #phi"); + fhDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + outputContainer->Add(fhDeltaPhi); + + fhDeltaEta = new TH2F("DeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-5,5); + fhDeltaEta->SetYTitle("#Delta #eta"); + fhDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + outputContainer->Add(fhDeltaEta); + + fhDeltaPt = new TH2F("DeltaPt","#p_{T trigger} - #p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-100,100); + fhDeltaPt->SetYTitle("#Delta #p_{T}"); + fhDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); + outputContainer->Add(fhDeltaPt); + + fhPtRatio = new TH2F("PtRatio","#p_{T jet} / #p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0,2.); + fhPtRatio->SetYTitle("ratio"); + fhPtRatio->SetXTitle("p_{T trigger} (GeV/c)"); + outputContainer->Add(fhPtRatio); + + fhPt = new TH2F("Pt","#p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhPt->SetYTitle("#p_{T jet}(GeV/c)"); + fhPt->SetXTitle("p_{T trigger} (GeV/c)"); + outputContainer->Add(fhPt); + + fhFFz = new TH2F("FFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,2); + fhFFz->SetYTitle("z"); + fhFFz->SetXTitle("p_{T trigger}"); + outputContainer->Add(fhFFz) ; - fhDeltaPhi = new TH2F("DeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-4,4); - fhDeltaPhi->SetYTitle("#Delta #phi"); - fhDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - outputContainer->Add(fhDeltaPhi); - - fhDeltaEta = new TH2F("DeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-5,5); - fhDeltaEta->SetYTitle("#Delta #eta"); - fhDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - outputContainer->Add(fhDeltaEta); - - fhDeltaPt = new TH2F("DeltaPt","#p_{T trigger} - #p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,200,-100,100); - fhDeltaPt->SetYTitle("#Delta #p_{T}"); - fhDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); - outputContainer->Add(fhDeltaPt); - - fhPtRatio = new TH2F("PtRatio","#p_{T jet} / #p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0,2.); - fhPtRatio->SetYTitle("ratio"); - fhPtRatio->SetXTitle("p_{T trigger} (GeV/c)"); - outputContainer->Add(fhPtRatio); - - fhPt = new TH2F("Pt","#p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhPt->SetYTitle("#p_{T jet}(GeV/c)"); - fhPt->SetXTitle("p_{T trigger} (GeV/c)"); - outputContainer->Add(fhPt); - - fhFFz = new TH2F("FFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,2); - fhFFz->SetYTitle("z"); - fhFFz->SetXTitle("p_{T trigger}"); - outputContainer->Add(fhFFz) ; - - fhFFxi = new TH2F("FFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,100,0.,10.); - fhFFxi->SetYTitle("#xi"); - fhFFxi->SetXTitle("p_{T trigger}"); - outputContainer->Add(fhFFxi) ; - - fhFFpt = new TH2F("FFpt","#xi = p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); - fhFFpt->SetYTitle("p_{T charged hadron}"); - fhFFpt->SetXTitle("p_{T trigger}"); - outputContainer->Add(fhFFpt) ; - - fhNTracksInCone = new TH2F("NTracksInCone","#xi = p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); - fhNTracksInCone->SetYTitle("p_{T charged hadron}"); - fhNTracksInCone->SetXTitle("p_{T trigger}"); - outputContainer->Add(fhNTracksInCone) ; - - return outputContainer; + fhFFxi = new TH2F("FFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,100,0.,10.); + fhFFxi->SetYTitle("#xi"); + fhFFxi->SetXTitle("p_{T trigger}"); + outputContainer->Add(fhFFxi) ; + + fhFFpt = new TH2F("FFpt","#xi = p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); + fhFFpt->SetYTitle("p_{T charged hadron}"); + fhFFpt->SetXTitle("p_{T trigger}"); + outputContainer->Add(fhFFpt) ; + + fhNTracksInCone = new TH2F("NTracksInCone","#xi = p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); + fhNTracksInCone->SetYTitle("p_{T charged hadron}"); + fhNTracksInCone->SetXTitle("p_{T trigger}"); + outputContainer->Add(fhNTracksInCone) ; + + return outputContainer; } - //____________________________________________________________________________ +//____________________________________________________________________________ void AliAnaParticleJetFinderCorrelation::InitParameters() { - + //Initialize the parameters of the analysis. SetInputAODName("photons"); fDeltaPhiMinCut = 1.5 ; @@ -188,171 +193,178 @@ void AliAnaParticleJetFinderCorrelation::InitParameters() fPtThresholdInCone = 0.5 ; fUseJetRefTracks = kFALSE ; fMakeCorrelationInHistoMaker = kFALSE ; + fSelectIsolated = kFALSE; } //__________________________________________________________________ Int_t AliAnaParticleJetFinderCorrelation::SelectJet(AliAODPWG4ParticleCorrelation * particle) const { - //Returns the index of the jet that is opposite to the particle - - Int_t njets = (GetReader()->GetAOD())->GetNJets() ; - - AliAODJet * jet = new AliAODJet ; - Int_t index = -1; - for(Int_t ijet = 0; ijet < njets ; ijet++){ - jet = (GetReader()->GetAOD())->GetJet(ijet) ; - Float_t dphi = TMath::Abs(particle->Phi()-jet->Phi()); - Float_t ratio = jet->Pt()/particle->Pt(); - if(GetDebug() > 3) - printf("Jet %d, Ratio pT %2.3f, Delta phi %2.3f\n",ijet,ratio,dphi); - Float_t dphiprev= 10000; - if((dphi > fDeltaPhiMinCut) && (dphi fRatioMinCut) && (ratio < fRatioMaxCut) && - (TMath::Abs(dphi-3.14159) < TMath::Abs(dphiprev-3.14159))){//In case there is more than one jet select the most opposite. - dphiprev = dphi; - index = ijet ; - }//Selection cuts - }//AOD Jet loop + //Returns the index of the jet that is opposite to the particle + + Int_t njets = (GetReader()->GetOutputEvent())->GetNJets() ; + + AliAODJet * jet = new AliAODJet ; + Int_t index = -1; + for(Int_t ijet = 0; ijet < njets ; ijet++){ + jet = (GetReader()->GetOutputEvent())->GetJet(ijet) ; + Float_t dphi = TMath::Abs(particle->Phi()-jet->Phi()); + Float_t ratio = jet->Pt()/particle->Pt(); + if(GetDebug() > 3) + printf("Jet %d, Ratio pT %2.3f, Delta phi %2.3f\n",ijet,ratio,dphi); + Float_t dphiprev= 10000; + if((dphi > fDeltaPhiMinCut) && (dphi fRatioMinCut) && (ratio < fRatioMaxCut) && + (TMath::Abs(dphi-3.14159) < TMath::Abs(dphiprev-3.14159))){//In case there is more than one jet select the most opposite. + dphiprev = dphi; + index = ijet ; + }//Selection cuts +}//AOD Jet loop - return index ; +return index ; } //__________________________________________________________________ void AliAnaParticleJetFinderCorrelation::MakeAnalysisFillAOD() { - //Particle-Jet Correlation Analysis, fill AODs - if(!GetInputAODBranch()) - AliFatal(Form("ParticleJetCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - - Int_t ntrig = GetInputAODBranch()->GetEntriesFast() ; - if(GetDebug() > 3){ + //Particle-Jet Correlation Analysis, fill AODs + if(!GetInputAODBranch()){ + printf("ParticleJetCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()); + abort(); + } + Int_t ntrig = GetInputAODBranch()->GetEntriesFast() ; + if(GetDebug() > 3){ printf("Begin jet finder correlation analysis, fill AODs \n"); printf("In particle branch aod entries %d\n", ntrig); - printf("In jet branch aod entries %d\n", (GetReader()->GetAOD())->GetNJets()); - } - - //Loop on stored AOD particles, trigger - for(Int_t iaod = 0; iaod < ntrig ; iaod++){ - AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - - //Correlate with jets - Int_t ijet = SelectJet(particle); - if(ijet > -1){ - if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet); - AliAODJet *jet = (GetReader()->GetAOD())->GetJet(ijet); - particle->SetRefJet(jet); - } - } + printf("In jet branch aod entries %d\n", (GetReader()->GetOutputEvent())->GetNJets()); + } - if(GetDebug() >1)printf("End of jet leading cone analysis, fill AODs \n"); + //Loop on stored AOD particles, trigger + for(Int_t iaod = 0; iaod < ntrig ; iaod++){ + AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + + //Correlate with jets + Int_t ijet = SelectJet(particle); + if(ijet > -1){ + if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet); + AliAODJet *jet = (GetReader()->GetOutputEvent())->GetJet(ijet); + particle->SetRefJet(jet); + } + } + + if(GetDebug() >1)printf("End of jet leading cone analysis, fill AODs \n"); } //__________________________________________________________________ void AliAnaParticleJetFinderCorrelation::MakeAnalysisFillHistograms() { - //Particle-Jet Correlation Analysis, fill histograms - - if(!GetInputAODBranch()) - AliFatal(Form("ParticleJetCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - - Int_t ntrig = GetInputAODBranch()->GetEntriesFast() ; - if(GetDebug() > 1){ - printf("Begin jet finder correlation analysis, fill histograms \n"); - printf("In particle branch aod entries %d\n", ntrig); - printf("In jet branch aod entries %d\n", (GetReader()->GetAOD())->GetNJets()); - } - - //Loop on stored AOD particles, trigger - for(Int_t iaod = 0; iaod < ntrig ; iaod++){ - AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); - - //Recover the jet correlated, found previously. - AliAODJet * jet = particle->GetJet(); - //If correlation not made before, do it now. - if(fMakeCorrelationInHistoMaker){ - //Correlate with jets - Int_t ijet = SelectJet(particle); - if(ijet > -1){ - if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet); - jet = (GetReader()->GetAOD())->GetJet(ijet); - particle->SetRefJet(jet); - } - } - - if (!jet) continue ; - - //Fill Histograms - - Double_t ptTrig = particle->Pt(); - Double_t ptJet = jet->Pt(); - Double_t phiTrig = particle->Phi(); - Double_t phiJet = jet->Phi(); - Double_t etaTrig = particle->Eta(); - Double_t etaJet = jet->Eta(); - //printf("pT trigger %2.3f, pT jet %2.3f, Delta phi %2.3f, Delta eta %2.3f, Delta pT %2.3f, ratio %2.3f \n", - // ptTrig,ptJet, phiJet-phiTrig, etaJet-etaTrig, ptTrig-ptJet, ptJet/ptTrig); - fhDeltaPt ->Fill(ptTrig, ptTrig-ptJet); - fhDeltaPhi->Fill(ptTrig, phiJet-phiTrig); - fhDeltaEta->Fill(ptTrig, etaJet-etaTrig); - fhPtRatio ->Fill(ptTrig, ptJet/ptTrig); - fhPt ->Fill(ptTrig, ptJet); - - //Fragmentation function - Float_t rad = 0, pt = 0, eta = 0, phi = 0; - Int_t npartcone = 0; - TVector3 p3; - AliAODTrack* track = new AliAODTrack ; - - Int_t ntracks = 0; - if(!fUseJetRefTracks) - ntracks =GetAODCTS()->GetEntriesFast(); - else //If you want to use jet tracks from JETAN - ntracks = (jet->GetRefTracks())->GetEntriesFast(); - - for(Int_t ipr = 0;ipr < ntracks ; ipr ++ ){ - if(!fUseJetRefTracks) - track = (AliAODTrack *) (GetAODCTS()->At(ipr)) ; - else //If you want to use jet tracks from JETAN - track = (AliAODTrack *) ((jet->GetRefTracks())->At(ipr)); - - p3.SetXYZ(track->Px(),track->Py(),track->Pz()); - pt = p3.Pt(); - eta = p3.Eta(); - phi = p3.Phi() ; - if(phi < 0) phi+=TMath::TwoPi(); - - //Check if there is any particle inside cone with pt larger than fPtThreshold - rad = TMath::Sqrt((eta-etaJet)*(eta-etaJet)+ (phi-phiJet)*(phi-phiJet)); - if(rad < fConeSize && pt > fPtThresholdInCone){ - //printf("charged in jet cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); - npartcone++; - fhFFz ->Fill(ptTrig, pt/ptTrig); - fhFFxi->Fill(ptTrig, TMath::Log(ptTrig/pt)); - fhFFpt->Fill(ptTrig, pt); - } - }//Tracks - fhNTracksInCone->Fill(ptTrig, npartcone); - }//AOD trigger particle loop - if(GetDebug() >1) printf("End of jet leading cone analysis, fill histograms \n"); + //Particle-Jet Correlation Analysis, fill histograms + + if(!GetInputAODBranch()){ + printf("ParticleJetCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()); + abort(); + } + Int_t ntrig = GetInputAODBranch()->GetEntriesFast() ; + if(GetDebug() > 1){ + printf("Begin jet finder correlation analysis, fill histograms \n"); + printf("In particle branch aod entries %d\n", ntrig); + printf("In jet branch aod entries %d\n", (GetReader()->GetOutputEvent())->GetNJets()); + } + + //Loop on stored AOD particles, trigger + for(Int_t iaod = 0; iaod < ntrig ; iaod++){ + AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + + if(OnlyIsolated() && !particle->IsIsolated()) continue; + + //Recover the jet correlated, found previously. + AliAODJet * jet = particle->GetJet(); + //If correlation not made before, do it now. + if(fMakeCorrelationInHistoMaker){ + //Correlate with jets + Int_t ijet = SelectJet(particle); + if(ijet > -1){ + if(GetDebug() > 2) printf ("Jet with index %d selected \n",ijet); + jet = (GetReader()->GetOutputEvent())->GetJet(ijet); + particle->SetRefJet(jet); + } + } + + if (!jet) continue ; + + //Fill Histograms + + Double_t ptTrig = particle->Pt(); + Double_t ptJet = jet->Pt(); + Double_t phiTrig = particle->Phi(); + Double_t phiJet = jet->Phi(); + Double_t etaTrig = particle->Eta(); + Double_t etaJet = jet->Eta(); + //printf("pT trigger %2.3f, pT jet %2.3f, Delta phi %2.3f, Delta eta %2.3f, Delta pT %2.3f, ratio %2.3f \n", + // ptTrig,ptJet, phiJet-phiTrig, etaJet-etaTrig, ptTrig-ptJet, ptJet/ptTrig); + fhDeltaPt ->Fill(ptTrig, ptTrig-ptJet); + fhDeltaPhi->Fill(ptTrig, phiJet-phiTrig); + fhDeltaEta->Fill(ptTrig, etaJet-etaTrig); + fhPtRatio ->Fill(ptTrig, ptJet/ptTrig); + fhPt ->Fill(ptTrig, ptJet); + + //Fragmentation function + Float_t rad = 0, pt = 0, eta = 0, phi = 0; + Int_t npartcone = 0; + TVector3 p3; + AliAODTrack* track = new AliAODTrack ; + + Int_t ntracks = 0; + if(!fUseJetRefTracks) + ntracks =GetAODCTS()->GetEntriesFast(); + else //If you want to use jet tracks from JETAN + ntracks = (jet->GetRefTracks())->GetEntriesFast(); + + for(Int_t ipr = 0;ipr < ntracks ; ipr ++ ){ + if(!fUseJetRefTracks) + track = (AliAODTrack *) (GetAODCTS()->At(ipr)) ; + else //If you want to use jet tracks from JETAN + track = (AliAODTrack *) ((jet->GetRefTracks())->At(ipr)); + + p3.SetXYZ(track->Px(),track->Py(),track->Pz()); + pt = p3.Pt(); + eta = p3.Eta(); + phi = p3.Phi() ; + if(phi < 0) phi+=TMath::TwoPi(); + + //Check if there is any particle inside cone with pt larger than fPtThreshold + rad = TMath::Sqrt((eta-etaJet)*(eta-etaJet)+ (phi-phiJet)*(phi-phiJet)); + if(rad < fConeSize && pt > fPtThresholdInCone){ + //printf("charged in jet cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad); + npartcone++; + fhFFz ->Fill(ptTrig, pt/ptTrig); + fhFFxi->Fill(ptTrig, TMath::Log(ptTrig/pt)); + fhFFpt->Fill(ptTrig, pt); + } + }//Tracks + fhNTracksInCone->Fill(ptTrig, npartcone); + }//AOD trigger particle loop + if(GetDebug() >1) printf("End of jet leading cone analysis, fill histograms \n"); } //__________________________________________________________________ void AliAnaParticleJetFinderCorrelation::Print(const Option_t * opt) const { - - //Print some relevant parameters set for the analysis - if(! opt) - return; - printf("Phi trigger-jet < %3.2f\n", fDeltaPhiMaxCut) ; - printf("Phi trigger-jet > %3.2f\n", fDeltaPhiMinCut) ; - printf("pT Ratio trigger/jet < %3.2f\n", fRatioMaxCut) ; - printf("pT Ratio trigger/jet > %3.2f\n", fRatioMinCut) ; - printf("fConeSize = %3.2f\n", fConeSize) ; - printf("fPtThresholdInCone = %3.2f\n", fPtThresholdInCone) ; - printf("fUseJetRefTracks = %d\n", fUseJetRefTracks) ; - printf("fMakeCorrelationInHistoMaker = %d\n", fMakeCorrelationInHistoMaker) ; + //Print some relevant parameters set for the analysis + if(! opt) + return; + + printf("Phi trigger-jet < %3.2f\n", fDeltaPhiMaxCut) ; + printf("Phi trigger-jet > %3.2f\n", fDeltaPhiMinCut) ; + printf("pT Ratio trigger/jet < %3.2f\n", fRatioMaxCut) ; + printf("pT Ratio trigger/jet > %3.2f\n", fRatioMinCut) ; + printf("fConeSize = %3.2f\n", fConeSize) ; + printf("fPtThresholdInCone = %3.2f\n", fPtThresholdInCone) ; + printf("fUseJetRefTracks = %d\n", fUseJetRefTracks) ; + printf("fMakeCorrelationInHistoMaker = %d\n", fMakeCorrelationInHistoMaker) ; + printf("Isolated Trigger? %d\n", fSelectIsolated) ; + } diff --git a/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.h b/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.h index 9b60fe7d2d1..f8338b8b496 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.h +++ b/PWG4/PartCorrDep/AliAnaParticleJetFinderCorrelation.h @@ -17,75 +17,78 @@ class TH2F; //---- Analysis system ---- -class AliLog; #include "AliAnaPartCorrBaseClass.h" class AliAODPWG4ParticleCorrelation ; class AliAnaParticleJetFinderCorrelation : public AliAnaPartCorrBaseClass { - public: - - AliAnaParticleJetFinderCorrelation() ; // default ctor - AliAnaParticleJetFinderCorrelation(const AliAnaParticleJetFinderCorrelation & g) ; // cpy ctor - AliAnaParticleJetFinderCorrelation & operator = (const AliAnaParticleJetFinderCorrelation & g) ;//cpy assignment - virtual ~AliAnaParticleJetFinderCorrelation() {;} //virtual dtor - - TList * GetCreateOutputObjects(); - - void InitParameters(); - - void Print(const Option_t * opt) const; - - Float_t GetConeSize() const {return fConeSize ; } - Float_t GetPtThresholdInCone() const {return fPtThresholdInCone ; } - Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; } - Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; } - Double_t GetRatioMaxCut() const {return fRatioMaxCut ; } - Double_t GetRatioMinCut() const {return fRatioMinCut ; } - Bool_t AreJetRefTracks() const {return fUseJetRefTracks ; } - Bool_t IsCorrelationMadeInHistoMaker() const {return fMakeCorrelationInHistoMaker ;} - - void SetConeSize(Float_t cone) {fConeSize = cone; } - void SetPtThresholdInCone(Float_t pt){fPtThresholdInCone = pt; }; - void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax) - {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;} - void SetRatioCutRange(Double_t ratiomin, Double_t ratiomax) - {fRatioMaxCut =ratiomax; fRatioMinCut = ratiomin ; } - void UseJetRefTracks(Bool_t use) {fUseJetRefTracks = use ; } - void SetMakeCorrelationInHistoMaker(Bool_t make) {fMakeCorrelationInHistoMaker = make ;} - - private: - - Int_t SelectJet(AliAODPWG4ParticleCorrelation * particle) const ; - - void MakeAnalysisFillAOD() ; - void MakeAnalysisFillHistograms() ; - - private: - - //selection parameters - Double_t fDeltaPhiMaxCut ; //! Minimum Delta Phi Gamma-Leading - Double_t fDeltaPhiMinCut ; //! Maximum Delta Phi Gamma-Leading - Double_t fRatioMaxCut ; //! Jet/ particle Ratio cut maximum - Double_t fRatioMinCut ; //! Jet/particle Ratio cut minimum - - Double_t fConeSize ; //! Jet cone size - Double_t fPtThresholdInCone ; //! Jet pT threshold in jet cone - Bool_t fUseJetRefTracks ; //! Use track references from JETAN not the AOD tracks - Bool_t fMakeCorrelationInHistoMaker ; //!Make particle-jet correlation in histogram maker - - TH2F * fhDeltaEta; //! Difference of jet eta and trigger particle eta as function of trigger particle pT - TH2F * fhDeltaPhi; //! Difference of jet phi and trigger particle phi as function of trigger particle pT - TH2F * fhDeltaPt; //! Difference of jet pT and trigger particle pT as function of trigger particle pT - TH2F * fhPtRatio; //! Ratio of jet pT and trigger particle pT as function of trigger particle pT - TH2F * fhPt; //! jet pT vs trigger particle pT - - TH2F * fhFFz ; //! Accepted reconstructed jet fragmentation function, z=ptjet/pttrig - TH2F * fhFFxi; //! Accepted reconstructed jet fragmentation function, xsi = ln(pttrig/ptjet) - TH2F * fhFFpt; //! Jet particle pt distribution in cone - TH2F * fhNTracksInCone ; //! jet multiplicity in cone - - ClassDef(AliAnaParticleJetFinderCorrelation,1) + public: + + AliAnaParticleJetFinderCorrelation() ; // default ctor + AliAnaParticleJetFinderCorrelation(const AliAnaParticleJetFinderCorrelation & g) ; // cpy ctor + AliAnaParticleJetFinderCorrelation & operator = (const AliAnaParticleJetFinderCorrelation & g) ;//cpy assignment + virtual ~AliAnaParticleJetFinderCorrelation() {;} //virtual dtor + + TList * GetCreateOutputObjects(); + + Bool_t OnlyIsolated() const {return fSelectIsolated ; } + void SelectIsolated(Bool_t select) {fSelectIsolated = select ; } + + void InitParameters(); + + void Print(const Option_t * opt) const; + + Float_t GetConeSize() const {return fConeSize ; } + Float_t GetPtThresholdInCone() const {return fPtThresholdInCone ; } + Double_t GetDeltaPhiMaxCut() const {return fDeltaPhiMaxCut ; } + Double_t GetDeltaPhiMinCut() const {return fDeltaPhiMinCut ; } + Double_t GetRatioMaxCut() const {return fRatioMaxCut ; } + Double_t GetRatioMinCut() const {return fRatioMinCut ; } + Bool_t AreJetRefTracks() const {return fUseJetRefTracks ; } + Bool_t IsCorrelationMadeInHistoMaker() const {return fMakeCorrelationInHistoMaker ;} + + void SetConeSize(Float_t cone) {fConeSize = cone; } + void SetPtThresholdInCone(Float_t pt){fPtThresholdInCone = pt; }; + void SetDeltaPhiCutRange(Double_t phimin, Double_t phimax) + {fDeltaPhiMaxCut =phimax; fDeltaPhiMinCut =phimin;} + void SetRatioCutRange(Double_t ratiomin, Double_t ratiomax) + {fRatioMaxCut =ratiomax; fRatioMinCut = ratiomin ; } + void UseJetRefTracks(Bool_t use) {fUseJetRefTracks = use ; } + void SetMakeCorrelationInHistoMaker(Bool_t make) {fMakeCorrelationInHistoMaker = make ;} + + private: + + Int_t SelectJet(AliAODPWG4ParticleCorrelation * particle) const ; + + void MakeAnalysisFillAOD() ; + void MakeAnalysisFillHistograms() ; + + private: + + //selection parameters + Double_t fDeltaPhiMaxCut ; //! Minimum Delta Phi Gamma-Leading + Double_t fDeltaPhiMinCut ; //! Maximum Delta Phi Gamma-Leading + Double_t fRatioMaxCut ; //! Jet/ particle Ratio cut maximum + Double_t fRatioMinCut ; //! Jet/particle Ratio cut minimum + + Double_t fConeSize ; //! Jet cone size + Double_t fPtThresholdInCone ; //! Jet pT threshold in jet cone + Bool_t fUseJetRefTracks ; //! Use track references from JETAN not the AOD tracks + Bool_t fMakeCorrelationInHistoMaker ; //!Make particle-jet correlation in histogram maker + Bool_t fSelectIsolated ; // Select only trigger particles isolated + + TH2F * fhDeltaEta; //! Difference of jet eta and trigger particle eta as function of trigger particle pT + TH2F * fhDeltaPhi; //! Difference of jet phi and trigger particle phi as function of trigger particle pT + TH2F * fhDeltaPt; //! Difference of jet pT and trigger particle pT as function of trigger particle pT + TH2F * fhPtRatio; //! Ratio of jet pT and trigger particle pT as function of trigger particle pT + TH2F * fhPt; //! jet pT vs trigger particle pT + + TH2F * fhFFz ; //! Accepted reconstructed jet fragmentation function, z=ptjet/pttrig + TH2F * fhFFxi; //! Accepted reconstructed jet fragmentation function, xsi = ln(pttrig/ptjet) + TH2F * fhFFpt; //! Jet particle pt distribution in cone + TH2F * fhNTracksInCone ; //! jet multiplicity in cone + + ClassDef(AliAnaParticleJetFinderCorrelation,2) } ; diff --git a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx index 99d7c17b831..2bb502919da 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx @@ -30,16 +30,19 @@ // --- ROOT system --- #include "TH2F.h" +#include "TClonesArray.h" //---- Analysis system ---- #include "AliAODTrack.h" #include "AliAODCaloCluster.h" #include "AliCaloTrackReader.h" #include "AliNeutralMesonSelection.h" -#include "AliLog.h" #include "AliAnaParticleJetLeadingConeCorrelation.h" #include "AliCaloPID.h" #include "AliAODPWG4ParticleCorrelation.h" +#include "AliFidutialCut.h" +#include "AliAODTrack.h" +#include "AliAODCaloCluster.h" ClassImp(AliAnaParticleJetLeadingConeCorrelation) @@ -55,6 +58,7 @@ ClassImp(AliAnaParticleJetLeadingConeCorrelation) fJetNCone(0),fJetNPt(0), fJetCone(0), fJetPtThreshold(0),fJetPtThresPbPb(0), fPtTriggerSelectionCut(0.0), fSelect(0), + fSelectIsolated(0), //Histograms fOutCont(0x0), fhChargedLeadingPt(0),fhChargedLeadingPhi(0),fhChargedLeadingEta(0), @@ -78,7 +82,7 @@ ClassImp(AliAnaParticleJetLeadingConeCorrelation) fhBkgFFzs(),fhBkgFFxis(),fhBkgFFpts(),fhBkgNTracksInCones() { //Default Ctor - + //Initialize parameters for(Int_t i = 0; i<6; i++){ @@ -95,7 +99,7 @@ ClassImp(AliAnaParticleJetLeadingConeCorrelation) fJetSigma2[i] = 0.0 ; } } - + //Several cones and thres histograms for(Int_t i = 0; i<5; i++){ fJetCones[i] = 0.0 ; @@ -143,7 +147,8 @@ AliAnaParticleJetLeadingConeCorrelation::AliAnaParticleJetLeadingConeCorrelation fJetRatioMinCut(jetlc.fJetRatioMinCut), fJetNCone(jetlc.fJetNCone), fJetNPt(jetlc.fJetNPt), fJetCone(jetlc.fJetCone), fJetPtThreshold(jetlc.fJetPtThreshold),fJetPtThresPbPb(jetlc.fJetPtThresPbPb), - fPtTriggerSelectionCut(jetlc.fPtTriggerSelectionCut), fSelect(jetlc.fSelect), + fPtTriggerSelectionCut(jetlc.fPtTriggerSelectionCut), fSelect(jetlc.fSelect), + fSelectIsolated(jetlc.fSelectIsolated), //Histograms fOutCont(jetlc. fOutCont), fhChargedLeadingPt(jetlc.fhChargedLeadingPt), fhChargedLeadingPhi(jetlc.fhChargedLeadingPhi), @@ -188,7 +193,7 @@ AliAnaParticleJetLeadingConeCorrelation::AliAnaParticleJetLeadingConeCorrelation fJetSigma2[i] = jetlc.fJetSigma2[i] ; } } - + //Several cones and thres histograms for(Int_t i = 0; i<5; i++){ fJetCones[i] = jetlc.fJetCones[i] ; @@ -226,31 +231,32 @@ AliAnaParticleJetLeadingConeCorrelation::AliAnaParticleJetLeadingConeCorrelation AliAnaParticleJetLeadingConeCorrelation & AliAnaParticleJetLeadingConeCorrelation::operator = (const AliAnaParticleJetLeadingConeCorrelation & jetlc) { // assignment operator - + if(this == &jetlc)return *this; ((AliAnaPartCorrBaseClass *)this)->operator=(jetlc); - - fSeveralConeAndPtCuts = jetlc.fSeveralConeAndPtCuts ; - fPbPb = jetlc.fPbPb ; - fReMakeJet = jetlc.fReMakeJet ; - fJetsOnlyInCTS = jetlc.fJetsOnlyInCTS; - - fDeltaPhiMaxCut = jetlc.fDeltaPhiMaxCut ; - fDeltaPhiMinCut = jetlc.fDeltaPhiMinCut ; - fLeadingRatioMaxCut = jetlc.fLeadingRatioMaxCut ; - fLeadingRatioMinCut = jetlc.fLeadingRatioMinCut ; - fJetCTSRatioMaxCut = jetlc.fJetCTSRatioMaxCut ; - fJetCTSRatioMinCut = jetlc.fJetCTSRatioMinCut ; - fJetRatioMaxCut = jetlc.fJetRatioMaxCut ; - fJetRatioMinCut = jetlc.fJetRatioMinCut ; + fSeveralConeAndPtCuts = jetlc.fSeveralConeAndPtCuts ; + fPbPb = jetlc.fPbPb ; + fReMakeJet = jetlc.fReMakeJet ; + fJetsOnlyInCTS = jetlc.fJetsOnlyInCTS; + + fDeltaPhiMaxCut = jetlc.fDeltaPhiMaxCut ; + fDeltaPhiMinCut = jetlc.fDeltaPhiMinCut ; + fLeadingRatioMaxCut = jetlc.fLeadingRatioMaxCut ; + fLeadingRatioMinCut = jetlc.fLeadingRatioMinCut ; + + fJetCTSRatioMaxCut = jetlc.fJetCTSRatioMaxCut ; + fJetCTSRatioMinCut = jetlc.fJetCTSRatioMinCut ; + fJetRatioMaxCut = jetlc.fJetRatioMaxCut ; + fJetRatioMinCut = jetlc.fJetRatioMinCut ; - fJetNCone = jetlc.fJetNCone ; - fJetNPt = jetlc.fJetNPt ; fJetCone = jetlc.fJetCone ; - fJetPtThreshold = jetlc.fJetPtThreshold ; - fJetPtThresPbPb = jetlc.fJetPtThresPbPb ; + fJetNCone = jetlc.fJetNCone ; + fJetNPt = jetlc.fJetNPt ; fJetCone = jetlc.fJetCone ; + fJetPtThreshold = jetlc.fJetPtThreshold ; + fJetPtThresPbPb = jetlc.fJetPtThresPbPb ; fPtTriggerSelectionCut = jetlc.fPtTriggerSelectionCut ; - fSelect = jetlc.fSelect ; + fSelect = jetlc.fSelect ; + fSelectIsolated = jetlc.fSelectIsolated ; for(Int_t i = 0; i<6; i++){ fJetXMin1[i] = jetlc.fJetXMin1[i] ; @@ -438,353 +444,353 @@ TList * AliAnaParticleJetLeadingConeCorrelation::GetCreateOutputObjects() // Create histograms to be saved in output file and // store them in fOutCont - if(GetDebug()>1) printf("Init histograms \n"); + if(GetDebug()>1) printf("AliAnaParticleJetLeadingConeCorrelation::GetCreateOutputObjects() - Init histograms \n"); + + fOutCont = new TList() ; + fOutCont->SetName("ParticleJetLeadingInConeCorrelationHistograms") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + fhChargedLeadingPt = new TH2F("ChargedLeadingPt","p_{T leading charge} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhChargedLeadingPt->SetYTitle("p_{T leading charge} /p_{T trigger}"); + fhChargedLeadingPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingPhi = new TH2F("ChargedLeadingPhi","#phi_{h^{#pm}} vs p_{T trigger}", nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhChargedLeadingPhi->SetYTitle("#phi_{h^{#pm}} (rad)"); + fhChargedLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingEta = new TH2F("ChargedLeadingEta","#eta_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhChargedLeadingEta->SetYTitle("#eta_{h^{#pm}} "); + fhChargedLeadingEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingDeltaPt = new TH2F("ChargedLeadingDeltaPt","#p_{T trigger} - #p_{T h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhChargedLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)"); + fhChargedLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingDeltaPhi = new TH2F("ChargedLeadingDeltaPhi","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhChargedLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhChargedLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingDeltaEta = new TH2F("ChargedLeadingDeltaEta","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhChargedLeadingDeltaEta->SetYTitle("#Delta #eta"); + fhChargedLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhChargedLeadingRatioPt = new TH2F("ChargedLeadingRatioPt","p_{T leading charge} /p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhChargedLeadingRatioPt->SetYTitle("p_{T lead charge} /p_{T trigger}"); + fhChargedLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fOutCont->Add(fhChargedLeadingPt) ; + fOutCont->Add(fhChargedLeadingPhi) ; + fOutCont->Add(fhChargedLeadingEta) ; + fOutCont->Add(fhChargedLeadingDeltaPt) ; + fOutCont->Add(fhChargedLeadingDeltaPhi) ; + fOutCont->Add(fhChargedLeadingDeltaEta) ; + fOutCont->Add(fhChargedLeadingRatioPt) ; + + if(!fJetsOnlyInCTS){ + + fhNeutralLeadingPt = new TH2F("NeutralLeadingPt","p_{T leading #pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhNeutralLeadingPt->SetYTitle("p_{T leading #pi^{0}} /p_{T trigger}"); + fhNeutralLeadingPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingPhi = new TH2F("NeutralLeadingPhi","#phi_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhNeutralLeadingPhi->SetYTitle("#phi_{#pi^{0}} (rad)"); + fhNeutralLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingEta = new TH2F("NeutralLeadingEta","#eta_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhNeutralLeadingEta->SetYTitle("#eta_{#pi^{0}} "); + fhNeutralLeadingEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingDeltaPt = new TH2F("NeutralLeadingDeltaPt","#p_{T trigger} - #p_{T #pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhNeutralLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)"); + fhNeutralLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingDeltaPhi = new TH2F("NeutralLeadingDeltaPhi","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhNeutralLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhNeutralLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingDeltaEta = new TH2F("NeutralLeadingDeltaEta","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhNeutralLeadingDeltaEta->SetYTitle("#Delta #eta"); + fhNeutralLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhNeutralLeadingRatioPt = new TH2F("NeutralLeadingRatioPt","p_{T leading #pi^{0}} /p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhNeutralLeadingRatioPt->SetYTitle("p_{T lead #pi^{0}} /p_{T trigger}"); + fhNeutralLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fOutCont->Add(fhNeutralLeadingPt) ; + fOutCont->Add(fhNeutralLeadingPhi) ; + fOutCont->Add(fhNeutralLeadingEta) ; + fOutCont->Add(fhNeutralLeadingDeltaPt) ; + fOutCont->Add(fhNeutralLeadingDeltaPhi) ; + fOutCont->Add(fhNeutralLeadingDeltaEta) ; + fOutCont->Add(fhNeutralLeadingRatioPt) ; + + } + + if(!fSeveralConeAndPtCuts){// not several cones + + //Jet Distributions + fhJetPt = new TH2F("JetPt","p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhJetPt->SetYTitle("p_{T jet}"); + fhJetPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetRatioPt = new TH2F("JetRatioPt","p_{T jet}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhJetRatioPt->SetYTitle("p_{T jet}/p_{T trigger}"); + fhJetRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetDeltaPhi = new TH2F("JetDeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhJetDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhJetDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetDeltaEta = new TH2F("JetDeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhJetDeltaEta->SetYTitle("#Delta #eta"); + fhJetDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetLeadingRatioPt = new TH2F("JetLeadingRatioPt","p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhJetLeadingRatioPt->SetYTitle("p_{T leading}/p_{T jet}"); + fhJetLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetLeadingDeltaPhi = new TH2F("JetLeadingDeltaPhi","#phi_{jet} - #phi_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhJetLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhJetLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetLeadingDeltaEta = new TH2F("JetLeadingDeltaEta","#eta_{jet} - #eta_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhJetLeadingDeltaEta->SetYTitle("#Delta #eta"); + fhJetLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhJetFFz = new TH2F("JetFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,2); + fhJetFFz->SetYTitle("z"); + fhJetFFz->SetXTitle("p_{T trigger}"); + + fhJetFFxi = new TH2F("JetFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}",nptbins,ptmin,ptmax,100,0.,10.); + fhJetFFxi->SetYTitle("#xi"); + fhJetFFxi->SetXTitle("p_{T trigger}"); + + fhJetFFpt = new TH2F("JetFFpt","#xi = p_{T i charged}) vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,50.); + fhJetFFpt->SetYTitle("p_{T charged hadron}"); + fhJetFFpt->SetXTitle("p_{T trigger}"); + + fhJetNTracksInCone = new TH2F("JetNTracksInCone","N particles in cone vs p_{T trigger}",nptbins,ptmin,ptmax,5000,0, 5000); + fhJetNTracksInCone->SetYTitle("N tracks in jet cone"); + fhJetNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)"); + + fOutCont->Add(fhJetPt) ; + fOutCont->Add(fhJetRatioPt) ; + fOutCont->Add(fhJetDeltaPhi) ; + fOutCont->Add(fhJetDeltaEta) ; + fOutCont->Add(fhJetLeadingRatioPt) ; + fOutCont->Add(fhJetLeadingDeltaPhi) ; + fOutCont->Add(fhJetLeadingDeltaEta) ; + fOutCont->Add(fhJetFFz) ; + fOutCont->Add(fhJetFFxi) ; + fOutCont->Add(fhJetFFpt) ; + fOutCont->Add(fhJetNTracksInCone) ; + + //Bkg Distributions + fhBkgPt = new TH2F("BkgPt","p_{T bkg} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhBkgPt->SetYTitle("p_{T bkg}"); + fhBkgPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgRatioPt = new TH2F("BkgRatioPt","p_{T bkg}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhBkgRatioPt->SetYTitle("p_{T bkg}/p_{T trigger}"); + fhBkgRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgDeltaPhi = new TH2F("BkgDeltaPhi","#phi_{bkg} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhBkgDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhBkgDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgDeltaEta = new TH2F("BkgDeltaEta","#eta_{bkg} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhBkgDeltaEta->SetYTitle("#Delta #eta"); + fhBkgDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingRatioPt = new TH2F("BkgLeadingRatioPt","p_{T bkg} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); + fhBkgLeadingRatioPt->SetYTitle("p_{T leading}/p_{T bkg}"); + fhBkgLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingDeltaPhi = new TH2F("BkgLeadingDeltaPhi","#phi_{bkg} - #phi_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhBkgLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); + fhBkgLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingDeltaEta = new TH2F("BkgLeadingDeltaEta","#eta_{bkg} - #eta_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); + fhBkgLeadingDeltaEta->SetYTitle("#Delta #eta"); + fhBkgLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgFFz = new TH2F("BkgFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,2); + fhBkgFFz->SetYTitle("z"); + fhBkgFFz->SetXTitle("p_{T trigger}"); + + fhBkgFFxi = new TH2F("BkgFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,100,0.,10.); + fhBkgFFxi->SetYTitle("#xi"); + fhBkgFFxi->SetXTitle("p_{T trigger}"); + + fhBkgFFpt = new TH2F("BkgFFpt","p_{T charged hadron } vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); + fhBkgFFpt->SetYTitle("p_{T charged} hadron"); + fhBkgFFpt->SetXTitle("p_{T trigger}"); + + fhBkgNTracksInCone = new TH2F("BkgNTracksInCone","N particles in cone vs p_{T trigger}",nptbins,ptmin,ptmax,5000,0, 5000); + fhBkgNTracksInCone->SetYTitle("N tracks in bkg cone"); + fhBkgNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)"); + + fOutCont->Add(fhBkgPt) ; + fOutCont->Add(fhBkgRatioPt) ; + fOutCont->Add(fhBkgDeltaPhi) ; + fOutCont->Add(fhBkgDeltaEta) ; + fOutCont->Add(fhBkgLeadingRatioPt) ; + fOutCont->Add(fhBkgLeadingDeltaPhi) ; + fOutCont->Add(fhBkgLeadingDeltaEta) ; + fOutCont->Add(fhBkgFFz) ; + fOutCont->Add(fhBkgFFxi) ; + fOutCont->Add(fhBkgFFpt) ; + fOutCont->Add(fhBkgNTracksInCone) ; + + }//not several cones + else{ //If we want to study the jet for different cones and pt + for(Int_t icone = 0; iconeSetName("ParticleJetLeadingInConeCorrelationHistograms") ; + TString lastnamehist ="Cone"+ fJetNameCones[icone]+"Pt"+ fJetNamePtThres[ipt]; + TString lastnametitle =", cone ="+fJetNameCones[icone]+", pt > " +fJetNamePtThres[ipt]+" GeV/c"; - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); + //Jet Distributions + fhJetPts[icone][ipt] = new TH2F("JetPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhJetPts[icone][ipt]->SetYTitle("p_{T jet}"); + fhJetPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingPt = new TH2F("ChargedLeadingPt","p_{T leading charge} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhChargedLeadingPt->SetYTitle("p_{T leading charge} /p_{T trigger}"); - fhChargedLeadingPt->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetRatioPts[icone][ipt] = new TH2F("JetRatioPt"+lastnamehist,"p_{T jet}/p_{T trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); + fhJetRatioPts[icone][ipt]->SetYTitle("p_{T jet}/p_{T trigger}"); + fhJetRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingPhi = new TH2F("ChargedLeadingPhi","#phi_{h^{#pm}} vs p_{T trigger}", nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhChargedLeadingPhi->SetYTitle("#phi_{h^{#pm}} (rad)"); - fhChargedLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetDeltaPhis[icone][ipt] = new TH2F("JetDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhJetDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); + fhJetDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingEta = new TH2F("ChargedLeadingEta","#eta_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhChargedLeadingEta->SetYTitle("#eta_{h^{#pm}} "); - fhChargedLeadingEta->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetDeltaEtas[icone][ipt] = new TH2F("JetDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); + fhJetDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); + fhJetDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingDeltaPt = new TH2F("ChargedLeadingDeltaPt","#p_{T trigger} - #p_{T h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhChargedLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)"); - fhChargedLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetLeadingRatioPts[icone][ipt] = new TH2F("JetLeadingRatioPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); + fhJetLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T jet}"); + fhJetLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingDeltaPhi = new TH2F("ChargedLeadingDeltaPhi","#phi_{trigger} - #phi_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhChargedLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhChargedLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetLeadingDeltaPhis[icone][ipt] = new TH2F("JetLeadingDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhJetLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); + fhJetLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingDeltaEta = new TH2F("ChargedLeadingDeltaEta","#eta_{trigger} - #eta_{h^{#pm}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhChargedLeadingDeltaEta->SetYTitle("#Delta #eta"); - fhChargedLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetLeadingDeltaEtas[icone][ipt] = new TH2F("JetLeadingDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); + fhJetLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); + fhJetLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - fhChargedLeadingRatioPt = new TH2F("ChargedLeadingRatioPt","p_{T leading charge} /p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhChargedLeadingRatioPt->SetYTitle("p_{T lead charge} /p_{T trigger}"); - fhChargedLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); + fhJetFFzs[icone][ipt] = new TH2F("JetFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2); + fhJetFFzs[icone][ipt]->SetYTitle("z"); + fhJetFFzs[icone][ipt]->SetXTitle("p_{T trigger}"); - fOutCont->Add(fhChargedLeadingPt) ; - fOutCont->Add(fhChargedLeadingPhi) ; - fOutCont->Add(fhChargedLeadingEta) ; - fOutCont->Add(fhChargedLeadingDeltaPt) ; - fOutCont->Add(fhChargedLeadingDeltaPhi) ; - fOutCont->Add(fhChargedLeadingDeltaEta) ; - fOutCont->Add(fhChargedLeadingRatioPt) ; + fhJetFFxis[icone][ipt] = new TH2F("JetFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.); + fhJetFFxis[icone][ipt]->SetYTitle("#xi"); + fhJetFFxis[icone][ipt]->SetXTitle("p_{T trigger}"); - if(!fJetsOnlyInCTS){ - - fhNeutralLeadingPt = new TH2F("NeutralLeadingPt","p_{T leading #pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhNeutralLeadingPt->SetYTitle("p_{T leading #pi^{0}} /p_{T trigger}"); - fhNeutralLeadingPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingPhi = new TH2F("NeutralLeadingPhi","#phi_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhNeutralLeadingPhi->SetYTitle("#phi_{#pi^{0}} (rad)"); - fhNeutralLeadingPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingEta = new TH2F("NeutralLeadingEta","#eta_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhNeutralLeadingEta->SetYTitle("#eta_{#pi^{0}} "); - fhNeutralLeadingEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingDeltaPt = new TH2F("NeutralLeadingDeltaPt","#p_{T trigger} - #p_{T #pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhNeutralLeadingDeltaPt->SetYTitle("#Delta p_{T} (GeV/c)"); - fhNeutralLeadingDeltaPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingDeltaPhi = new TH2F("NeutralLeadingDeltaPhi","#phi_{trigger} - #phi_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhNeutralLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhNeutralLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingDeltaEta = new TH2F("NeutralLeadingDeltaEta","#eta_{trigger} - #eta_{#pi^{0}} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhNeutralLeadingDeltaEta->SetYTitle("#Delta #eta"); - fhNeutralLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhNeutralLeadingRatioPt = new TH2F("NeutralLeadingRatioPt","p_{T leading #pi^{0}} /p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhNeutralLeadingRatioPt->SetYTitle("p_{T lead #pi^{0}} /p_{T trigger}"); - fhNeutralLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fOutCont->Add(fhNeutralLeadingPt) ; - fOutCont->Add(fhNeutralLeadingPhi) ; - fOutCont->Add(fhNeutralLeadingEta) ; - fOutCont->Add(fhNeutralLeadingDeltaPt) ; - fOutCont->Add(fhNeutralLeadingDeltaPhi) ; - fOutCont->Add(fhNeutralLeadingDeltaEta) ; - fOutCont->Add(fhNeutralLeadingRatioPt) ; - - } + fhJetFFpts[icone][ipt] = new TH2F("JetFFpt"+lastnamehist,"p_{T charged hadron } in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.); + fhJetFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}"); + fhJetFFpts[icone][ipt]->SetXTitle("p_{T trigger}"); - if(!fSeveralConeAndPtCuts){// not several cones - - //Jet Distributions - fhJetPt = new TH2F("JetPt","p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhJetPt->SetYTitle("p_{T jet}"); - fhJetPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetRatioPt = new TH2F("JetRatioPt","p_{T jet}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhJetRatioPt->SetYTitle("p_{T jet}/p_{T trigger}"); - fhJetRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetDeltaPhi = new TH2F("JetDeltaPhi","#phi_{jet} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhJetDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhJetDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetDeltaEta = new TH2F("JetDeltaEta","#eta_{jet} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhJetDeltaEta->SetYTitle("#Delta #eta"); - fhJetDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingRatioPt = new TH2F("JetLeadingRatioPt","p_{T jet} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhJetLeadingRatioPt->SetYTitle("p_{T leading}/p_{T jet}"); - fhJetLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingDeltaPhi = new TH2F("JetLeadingDeltaPhi","#phi_{jet} - #phi_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhJetLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhJetLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingDeltaEta = new TH2F("JetLeadingDeltaEta","#eta_{jet} - #eta_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhJetLeadingDeltaEta->SetYTitle("#Delta #eta"); - fhJetLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetFFz = new TH2F("JetFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,2); - fhJetFFz->SetYTitle("z"); - fhJetFFz->SetXTitle("p_{T trigger}"); - - fhJetFFxi = new TH2F("JetFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}",nptbins,ptmin,ptmax,100,0.,10.); - fhJetFFxi->SetYTitle("#xi"); - fhJetFFxi->SetXTitle("p_{T trigger}"); - - fhJetFFpt = new TH2F("JetFFpt","#xi = p_{T i charged}) vs p_{T trigger}",nptbins,ptmin,ptmax,200,0.,50.); - fhJetFFpt->SetYTitle("p_{T charged hadron}"); - fhJetFFpt->SetXTitle("p_{T trigger}"); - - fhJetNTracksInCone = new TH2F("JetNTracksInCone","N particles in cone vs p_{T trigger}",nptbins,ptmin,ptmax,5000,0, 5000); - fhJetNTracksInCone->SetYTitle("N tracks in jet cone"); - fhJetNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)"); - - fOutCont->Add(fhJetPt) ; - fOutCont->Add(fhJetRatioPt) ; - fOutCont->Add(fhJetDeltaPhi) ; - fOutCont->Add(fhJetDeltaEta) ; - fOutCont->Add(fhJetLeadingRatioPt) ; - fOutCont->Add(fhJetLeadingDeltaPhi) ; - fOutCont->Add(fhJetLeadingDeltaEta) ; - fOutCont->Add(fhJetFFz) ; - fOutCont->Add(fhJetFFxi) ; - fOutCont->Add(fhJetFFpt) ; - fOutCont->Add(fhJetNTracksInCone) ; - - //Bkg Distributions - fhBkgPt = new TH2F("BkgPt","p_{T bkg} vs p_{T trigger}",nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhBkgPt->SetYTitle("p_{T bkg}"); - fhBkgPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgRatioPt = new TH2F("BkgRatioPt","p_{T bkg}/p_{T trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhBkgRatioPt->SetYTitle("p_{T bkg}/p_{T trigger}"); - fhBkgRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgDeltaPhi = new TH2F("BkgDeltaPhi","#phi_{bkg} - #phi_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhBkgDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhBkgDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgDeltaEta = new TH2F("BkgDeltaEta","#eta_{bkg} - #eta_{trigger} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhBkgDeltaEta->SetYTitle("#Delta #eta"); - fhBkgDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingRatioPt = new TH2F("BkgLeadingRatioPt","p_{T bkg} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,2); - fhBkgLeadingRatioPt->SetYTitle("p_{T leading}/p_{T bkg}"); - fhBkgLeadingRatioPt->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingDeltaPhi = new TH2F("BkgLeadingDeltaPhi","#phi_{bkg} - #phi_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhBkgLeadingDeltaPhi->SetYTitle("#Delta #phi (rad)"); - fhBkgLeadingDeltaPhi->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingDeltaEta = new TH2F("BkgLeadingDeltaEta","#eta_{bkg} - #eta_{leading} vs p_{T trigger}",nptbins,ptmin,ptmax,120,-2,2); - fhBkgLeadingDeltaEta->SetYTitle("#Delta #eta"); - fhBkgLeadingDeltaEta->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgFFz = new TH2F("BkgFFz","z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,2); - fhBkgFFz->SetYTitle("z"); - fhBkgFFz->SetXTitle("p_{T trigger}"); - - fhBkgFFxi = new TH2F("BkgFFxi","#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", nptbins,ptmin,ptmax,100,0.,10.); - fhBkgFFxi->SetYTitle("#xi"); - fhBkgFFxi->SetXTitle("p_{T trigger}"); - - fhBkgFFpt = new TH2F("BkgFFpt","p_{T charged hadron } vs p_{T trigger}", nptbins,ptmin,ptmax,200,0.,50.); - fhBkgFFpt->SetYTitle("p_{T charged} hadron"); - fhBkgFFpt->SetXTitle("p_{T trigger}"); - - fhBkgNTracksInCone = new TH2F("BkgNTracksInCone","N particles in cone vs p_{T trigger}",nptbins,ptmin,ptmax,5000,0, 5000); - fhBkgNTracksInCone->SetYTitle("N tracks in bkg cone"); - fhBkgNTracksInCone->SetXTitle("p_{T trigger} (GeV/c)"); - - fOutCont->Add(fhBkgPt) ; - fOutCont->Add(fhBkgRatioPt) ; - fOutCont->Add(fhBkgDeltaPhi) ; - fOutCont->Add(fhBkgDeltaEta) ; - fOutCont->Add(fhBkgLeadingRatioPt) ; - fOutCont->Add(fhBkgLeadingDeltaPhi) ; - fOutCont->Add(fhBkgLeadingDeltaEta) ; - fOutCont->Add(fhBkgFFz) ; - fOutCont->Add(fhBkgFFxi) ; - fOutCont->Add(fhBkgFFpt) ; - fOutCont->Add(fhBkgNTracksInCone) ; - - }//not several cones - else{ //If we want to study the jet for different cones and pt - for(Int_t icone = 0; icone " +fJetNamePtThres[ipt]+" GeV/c"; - - //Jet Distributions - fhJetPts[icone][ipt] = new TH2F("JetPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhJetPts[icone][ipt]->SetYTitle("p_{T jet}"); - fhJetPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetRatioPts[icone][ipt] = new TH2F("JetRatioPt"+lastnamehist,"p_{T jet}/p_{T trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); - fhJetRatioPts[icone][ipt]->SetYTitle("p_{T jet}/p_{T trigger}"); - fhJetRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetDeltaPhis[icone][ipt] = new TH2F("JetDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhJetDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); - fhJetDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetDeltaEtas[icone][ipt] = new TH2F("JetDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); - fhJetDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); - fhJetDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingRatioPts[icone][ipt] = new TH2F("JetLeadingRatioPt"+lastnamehist,"p_{T jet} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); - fhJetLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T jet}"); - fhJetLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingDeltaPhis[icone][ipt] = new TH2F("JetLeadingDeltaPhi"+lastnamehist,"#phi_{jet} - #phi_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhJetLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); - fhJetLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetLeadingDeltaEtas[icone][ipt] = new TH2F("JetLeadingDeltaEta"+lastnamehist,"#eta_{jet} - #eta_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); - fhJetLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); - fhJetLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhJetFFzs[icone][ipt] = new TH2F("JetFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2); - fhJetFFzs[icone][ipt]->SetYTitle("z"); - fhJetFFzs[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhJetFFxis[icone][ipt] = new TH2F("JetFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.); - fhJetFFxis[icone][ipt]->SetYTitle("#xi"); - fhJetFFxis[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhJetFFpts[icone][ipt] = new TH2F("JetFFpt"+lastnamehist,"p_{T charged hadron } in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.); - fhJetFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}"); - fhJetFFpts[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhJetNTracksInCones[icone][ipt] = new TH2F("JetNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,5000,0, 5000); - fhJetNTracksInCones[icone][ipt]->SetYTitle("N tracks in jet cone"); - fhJetNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fOutCont->Add(fhJetPts[icone][ipt]) ; - fOutCont->Add(fhJetRatioPts[icone][ipt]) ; - fOutCont->Add(fhJetDeltaPhis[icone][ipt]) ; - fOutCont->Add(fhJetDeltaEtas[icone][ipt]) ; - fOutCont->Add(fhJetLeadingRatioPts[icone][ipt]) ; - fOutCont->Add(fhJetLeadingDeltaPhis[icone][ipt]) ; - fOutCont->Add(fhJetLeadingDeltaEtas[icone][ipt]) ; - fOutCont->Add(fhJetFFzs[icone][ipt]) ; - fOutCont->Add(fhJetFFxis[icone][ipt]) ; - fOutCont->Add(fhJetFFpts[icone][ipt]) ; - fOutCont->Add(fhJetNTracksInCones[icone][ipt]) ; - - //Bkg Distributions - fhBkgPts[icone][ipt] = new TH2F("BkgPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); - fhBkgPts[icone][ipt]->SetYTitle("p_{T bkg}"); - fhBkgPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgRatioPts[icone][ipt] = new TH2F("BkgRatioPt"+lastnamehist,"p_{T bkg}/p_{T trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); - fhBkgRatioPts[icone][ipt]->SetYTitle("p_{T bkg}/p_{T trigger}"); - fhBkgRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgDeltaPhis[icone][ipt] = new TH2F("BkgDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhBkgDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); - fhBkgDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgDeltaEtas[icone][ipt] = new TH2F("BkgDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); - fhBkgDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); - fhBkgDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingRatioPts[icone][ipt] = new TH2F("BkgLeadingRatioPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); - fhBkgLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T bkg}"); - fhBkgLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingDeltaPhis[icone][ipt] = new TH2F("BkgLeadingDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); - fhBkgLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); - fhBkgLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgLeadingDeltaEtas[icone][ipt] = new TH2F("BkgLeadingDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); - fhBkgLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); - fhBkgLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fhBkgFFzs[icone][ipt] = new TH2F("BkgFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2); - fhBkgFFzs[icone][ipt]->SetYTitle("z"); - fhBkgFFzs[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhBkgFFxis[icone][ipt] = new TH2F("BkgFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.); - fhBkgFFxis[icone][ipt]->SetYTitle("#xi"); - fhBkgFFxis[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhBkgFFpts[icone][ipt] = new TH2F("BkgFFpt"+lastnamehist,"p_{T charged hadron} in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.); - fhBkgFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}"); - fhBkgFFpts[icone][ipt]->SetXTitle("p_{T trigger}"); - - fhBkgNTracksInCones[icone][ipt] = new TH2F("BkgNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,5000,0, 5000); - fhBkgNTracksInCones[icone][ipt]->SetYTitle("N tracks in bkg cone"); - fhBkgNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - - fOutCont->Add(fhBkgPts[icone][ipt]) ; - fOutCont->Add(fhBkgRatioPts[icone][ipt]) ; - fOutCont->Add(fhBkgDeltaPhis[icone][ipt]) ; - fOutCont->Add(fhBkgDeltaEtas[icone][ipt]) ; - fOutCont->Add(fhBkgLeadingRatioPts[icone][ipt]) ; - fOutCont->Add(fhBkgLeadingDeltaPhis[icone][ipt]) ; - fOutCont->Add(fhBkgLeadingDeltaEtas[icone][ipt]) ; - fOutCont->Add(fhBkgFFzs[icone][ipt]) ; - fOutCont->Add(fhBkgFFxis[icone][ipt]) ; - fOutCont->Add(fhBkgFFpts[icone][ipt]) ; - fOutCont->Add(fhBkgNTracksInCones[icone][ipt]) ; - - }//ipt - } //icone - }//If we want to study any cone or pt threshold + fhJetNTracksInCones[icone][ipt] = new TH2F("JetNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,5000,0, 5000); + fhJetNTracksInCones[icone][ipt]->SetYTitle("N tracks in jet cone"); + fhJetNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); - if(GetDebug()>2){ - printf("All histograms names \n"); - - for(Int_t i = 0 ; i< fOutCont->GetEntries(); i++) - printf("Histo i %d name %s",i,((fOutCont->At(i))->GetName())); - //cout<< (fOutCont->At(i))->GetName()<Add(fhJetPts[icone][ipt]) ; + fOutCont->Add(fhJetRatioPts[icone][ipt]) ; + fOutCont->Add(fhJetDeltaPhis[icone][ipt]) ; + fOutCont->Add(fhJetDeltaEtas[icone][ipt]) ; + fOutCont->Add(fhJetLeadingRatioPts[icone][ipt]) ; + fOutCont->Add(fhJetLeadingDeltaPhis[icone][ipt]) ; + fOutCont->Add(fhJetLeadingDeltaEtas[icone][ipt]) ; + fOutCont->Add(fhJetFFzs[icone][ipt]) ; + fOutCont->Add(fhJetFFxis[icone][ipt]) ; + fOutCont->Add(fhJetFFpts[icone][ipt]) ; + fOutCont->Add(fhJetNTracksInCones[icone][ipt]) ; + + //Bkg Distributions + fhBkgPts[icone][ipt] = new TH2F("BkgPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,nptbins,ptmin,ptmax); + fhBkgPts[icone][ipt]->SetYTitle("p_{T bkg}"); + fhBkgPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgRatioPts[icone][ipt] = new TH2F("BkgRatioPt"+lastnamehist,"p_{T bkg}/p_{T trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); + fhBkgRatioPts[icone][ipt]->SetYTitle("p_{T bkg}/p_{T trigger}"); + fhBkgRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgDeltaPhis[icone][ipt] = new TH2F("BkgDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhBkgDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); + fhBkgDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgDeltaEtas[icone][ipt] = new TH2F("BkgDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{trigger} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); + fhBkgDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); + fhBkgDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingRatioPts[icone][ipt] = new TH2F("BkgLeadingRatioPt"+lastnamehist,"p_{T bkg} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,2); + fhBkgLeadingRatioPts[icone][ipt]->SetYTitle("p_{T leading}/p_{T bkg}"); + fhBkgLeadingRatioPts[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingDeltaPhis[icone][ipt] = new TH2F("BkgLeadingDeltaPhi"+lastnamehist,"#phi_{bkg} - #phi_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,0,TMath::TwoPi()); + fhBkgLeadingDeltaPhis[icone][ipt]->SetYTitle("#Delta #phi (rad)"); + fhBkgLeadingDeltaPhis[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgLeadingDeltaEtas[icone][ipt] = new TH2F("BkgLeadingDeltaEta"+lastnamehist,"#eta_{bkg} - #eta_{leading} vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,120,-2,2); + fhBkgLeadingDeltaEtas[icone][ipt]->SetYTitle("#Delta #eta"); + fhBkgLeadingDeltaEtas[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fhBkgFFzs[icone][ipt] = new TH2F("BkgFFz"+lastnamehist,"z = p_{T i charged}/p_{T trigger} vs p_{T trigger}", 120,0.,120.,200,0.,2); + fhBkgFFzs[icone][ipt]->SetYTitle("z"); + fhBkgFFzs[icone][ipt]->SetXTitle("p_{T trigger}"); + + fhBkgFFxis[icone][ipt] = new TH2F("BkgFFxi"+lastnamehist,"#xi = ln(p_{T trigger}/p_{T i charged}) vs p_{T trigger}", 120,0.,120.,100,0.,10.); + fhBkgFFxis[icone][ipt]->SetYTitle("#xi"); + fhBkgFFxis[icone][ipt]->SetXTitle("p_{T trigger}"); + + fhBkgFFpts[icone][ipt] = new TH2F("BkgFFpt"+lastnamehist,"p_{T charged hadron} in jet vs p_{T trigger}", 120,0.,120.,200,0.,50.); + fhBkgFFpts[icone][ipt]->SetYTitle("p_{T charged hadron}"); + fhBkgFFpts[icone][ipt]->SetXTitle("p_{T trigger}"); + + fhBkgNTracksInCones[icone][ipt] = new TH2F("BkgNTracksInCone"+lastnamehist,"N particles in cone vs p_{T trigger}"+lastnametitle,nptbins,ptmin,ptmax,5000,0, 5000); + fhBkgNTracksInCones[icone][ipt]->SetYTitle("N tracks in bkg cone"); + fhBkgNTracksInCones[icone][ipt]->SetXTitle("p_{T trigger} (GeV/c)"); + + fOutCont->Add(fhBkgPts[icone][ipt]) ; + fOutCont->Add(fhBkgRatioPts[icone][ipt]) ; + fOutCont->Add(fhBkgDeltaPhis[icone][ipt]) ; + fOutCont->Add(fhBkgDeltaEtas[icone][ipt]) ; + fOutCont->Add(fhBkgLeadingRatioPts[icone][ipt]) ; + fOutCont->Add(fhBkgLeadingDeltaPhis[icone][ipt]) ; + fOutCont->Add(fhBkgLeadingDeltaEtas[icone][ipt]) ; + fOutCont->Add(fhBkgFFzs[icone][ipt]) ; + fOutCont->Add(fhBkgFFxis[icone][ipt]) ; + fOutCont->Add(fhBkgFFpts[icone][ipt]) ; + fOutCont->Add(fhBkgNTracksInCones[icone][ipt]) ; - return fOutCont; + }//ipt + } //icone + }//If we want to study any cone or pt threshold + + if(GetDebug()>2){ + printf("AliAnaParticleJetLeadingConeCorrelation::GetCreateOutputObjects() - All histograms names : \n"); + + for(Int_t i = 0 ; i< fOutCont->GetEntries(); i++) + printf("Histo i %d name %s",i,((fOutCont->At(i))->GetName())); + //cout<< (fOutCont->At(i))->GetName()< 0 || ptpi > 0){ if((ptch >= ptpi)){ - if(GetDebug() > 1)printf("Leading found in CTS \n"); + if(GetDebug() > 1)printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle() - Leading found in CTS \n"); pLeading = pLeadingCh; - if(GetDebug() > 1) printf("Found Leading: pt %f, phi %f deg, eta %f\n", pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ; + if(GetDebug() > 1) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle() - Found Leading: pt %f, phi %f deg, eta %f\n", + pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ; //Put leading in AOD - particle->SetLeading(pLeadingCh); - particle->SetLeadingDetector("CTS"); - return kTRUE; + particle->SetLeading(pLeadingCh); + particle->SetLeadingDetector("CTS"); + return kTRUE; } else{ - if(GetDebug() > 1)printf("Leading found in EMCAL \n"); + if(GetDebug() > 1)printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle() - Leading found in EMCAL \n"); pLeading = pLeadingPi0; - if(GetDebug() > 1) printf("Found Leading: pt %f, phi %f, eta %f\n", pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ; + if(GetDebug() > 1) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle() - Found Leading: pt %f, phi %f, eta %f\n", + pLeading.Pt(),pLeading.Phi()*TMath::RadToDeg(),pLeading.Eta()) ; //Put leading in AOD particle->SetLeading(pLeadingPi0); particle->SetLeadingDetector("EMCAL"); @@ -817,7 +825,7 @@ Bool_t AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle(AliAODPWG4Pa } } - if(GetDebug() > 1)printf ("NO LEADING PARTICLE FOUND \n"); + if(GetDebug() > 1)printf ("AliAnaParticleJetLeadingConeCorrelation::GetLeadingParticle() - NO LEADING PARTICLE FOUND \n"); return kFALSE; @@ -846,7 +854,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingCharge(AliAODPWG4Partic phi = p3.Phi() ; if(phi<0) phi+=TMath::TwoPi(); rat = pt/ptTrig ; - + //Selection within angular and energy limits if(((phiTrig-phi) > fDeltaPhiMinCut) && ((phiTrig-phi) fLeadingRatioMinCut) && (rat < fLeadingRatioMaxCut) && (pt > ptl)) { @@ -856,7 +864,8 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingCharge(AliAODPWG4Partic } }// track loop - if(GetDebug() > 1&& ptl>0 ) printf("Leading in CTS: pt %f eta %f phi %f pt/ptTrig %f \n", ptl, pLeading.Eta(), phil,ptl/ptTrig) ; + if(GetDebug() > 1&& ptl>0 ) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingCharge() - Leading in CTS: pt %f eta %f phi %f pt/ptTrig %f \n", + ptl, pLeading.Eta(), phil,ptl/ptTrig) ; }//CTS list exist } @@ -866,7 +875,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC { //Search for the neutral pion with highest pt and with //Phi=Phi_trigger-Pi and pT=0.1E_gamma - + if(GetAODEMCAL()){ Double_t ptTrig = particle->Pt(); Double_t phiTrig = particle->Phi(); @@ -890,7 +899,8 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC Int_t pdgi=0; if(!SelectCluster(calo,vertex, gammai, pdgi)) continue ; - if(GetDebug() > 2) printf("neutral cluster: pt %f, phi %f \n", gammai.Pt(),gammai.Phi()); + if(GetDebug() > 2) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0() - Neutral cluster: pt %f, phi %f \n", + gammai.Pt(),gammai.Phi()); //2 gamma overlapped, found with PID if(pdgi == AliCaloPID::kPi0){ @@ -908,7 +918,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC pLeading.SetPxPyPzE(gammai.Px(),gammai.Py(),gammai.Pz(),gammai.E()); }// cuts }// pdg = AliCaloPID::kPi0 - //Make invariant mass analysis + //Make invariant mass analysis else if(pdgi == AliCaloPID::kPhoton){ //Search the photon companion in case it comes from a Pi0 decay //Apply several cuts to select the good pair @@ -935,7 +945,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC pLeading=(gammai+gammaj); }//pi0 selection - if(GetDebug() > 3 ) printf("Neutral Hadron Correlation: Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f\n", + if(GetDebug() > 3 ) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0() - Neutral Hadron Correlation: Selected gamma pair: pt %2.2f, phi %2.2f, eta %2.2f, M %2.3f\n", (gammai+gammaj).Pt(),(gammai+gammaj).Phi(),(gammai+gammaj).Eta(), (gammai+gammaj).M()); }//Pair selected as leading }//if pair of gammas @@ -943,7 +953,7 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC }// if pdg = 22 }// 1st Loop - if(GetDebug()>2 && pLeading.Pt() >0 ) printf("Leading EMCAL: pt %f eta %f phi %f pt/Eg %f \n", pLeading.Pt(), pLeading.Eta(), pLeading.Phi(), pLeading.Pt()/ptTrig) ; + if(GetDebug()>2 && pLeading.Pt() >0 ) printf("AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0() - Leading EMCAL: pt %f eta %f phi %f pt/Eg %f \n", pLeading.Pt(), pLeading.Eta(), pLeading.Phi(), pLeading.Pt()/ptTrig) ; }//EMCAL list exists @@ -952,13 +962,13 @@ void AliAnaParticleJetLeadingConeCorrelation::GetLeadingPi0(AliAODPWG4ParticleC //____________________________________________________________________________ void AliAnaParticleJetLeadingConeCorrelation::InitParameters() { -//Initialize the parameters of the analysis. + //Initialize the parameters of the analysis. SetInputAODName("photons"); fJetsOnlyInCTS = kFALSE ; fPbPb = kFALSE ; fReMakeJet = kFALSE ; - + //Leading selection parameters fDeltaPhiMinCut = 2.9 ; fDeltaPhiMaxCut = 3.4 ; @@ -973,6 +983,8 @@ void AliAnaParticleJetLeadingConeCorrelation::InitParameters() fJetCTSRatioMinCut = 0.3 ; fSelect = 0 ; //0, Accept all jets, 1, selection depends on energy, 2 fixed selection + fSelectIsolated = kFALSE; + //Cut depending on gamma energy fPtTriggerSelectionCut = 10.; //For Low pt jets+BKG, another limits applied //Reconstructed jet energy dependence parameters @@ -1037,7 +1049,7 @@ Bool_t AliAnaParticleJetLeadingConeCorrelation::IsJetSelected(const Double_t ptT //function energy dependent and fSelect=2 selects on simple fixed cuts if(ptjet == 0) return kFALSE; - + Double_t rat = ptTrig / ptjet ; //############################################################### @@ -1115,7 +1127,7 @@ Bool_t AliAnaParticleJetLeadingConeCorrelation::IsJetSelected(const Double_t ptT Double_t min = CalculateJetRatioLimit(ptTrig, par, xmin); Double_t max = CalculateJetRatioLimit(ptTrig, par, xmax); - AliDebug(3,Form("Jet selection? : Limits min %f, max %f, pt_jet %f, pt_gamma %f, pt_jet / pt_gamma %f",min,max,ptjet,ptTrig,rat)); + if(GetDebug() > 3)printf("Jet selection? : Limits min %f, max %f, pt_jet %f, pt_gamma %f, pt_jet / pt_gamma %f",min,max,ptjet,ptTrig,rat); if(( min < rat ) && ( max > ptjet/rat)) return kTRUE; @@ -1171,11 +1183,13 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD() { //Particle-Hadron Correlation Analysis, fill AODs - if(!GetInputAODBranch()) - AliFatal(Form("ParticleJetLCCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - + if(!GetInputAODBranch()){ + printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD() - No input particles in AOD with name branch < %s > \n", + GetInputAODName().Data()); + abort(); + } if(GetDebug() > 1){ - printf("Begin jet leading cone correlation analysis, fill AODs \n"); + printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD() - Begin jet leading cone correlation analysis, fill AODs \n"); printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); @@ -1198,7 +1212,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD() }//Leading found }//AOD trigger particle loop - if(GetDebug() >1)printf("End of jet leading cone analysis, fill AODs \n"); + if(GetDebug() >1)printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillAOD() - End of jet leading cone analysis, fill AODs \n"); } @@ -1208,16 +1222,18 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() //Particle-Hadron Correlation Analysis, fill histograms - if(!GetInputAODBranch()) - AliFatal(Form("ParticleJetLCCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - + if(!GetInputAODBranch()){ + printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() - No input particles in AOD with name branch < %s > \n", + GetInputAODName().Data()); + abort(); + } if(GetDebug() > 1){ - printf("Begin jet leading cone correlation analysis, fill histograms \n"); + printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() - Begin jet leading cone correlation analysis, fill histograms \n"); printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); printf("In CTS aod entries %d\n", GetAODCTS()->GetEntriesFast()); printf("In EMCAL aod entries %d\n", GetAODEMCAL()->GetEntriesFast()); } - + TLorentzVector pLeading(0,0,0,0) ; //Loop on stored AOD particles, trigger @@ -1225,6 +1241,8 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() for(Int_t iaod = 0; iaod < naod ; iaod++){ AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); + if(OnlyIsolated() && !particle->IsIsolated()) continue; + Double_t pt = particle->Pt(); Double_t phi = particle->Phi(); Double_t eta = particle->Eta(); @@ -1232,14 +1250,15 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() //Get leading particle, fill histograms pLeading = particle->GetLeading(); TString det = particle->GetLeadingDetector(); - + if(det!="" && pLeading.Pt() > 0){ Double_t ptL = pLeading.Pt(); Double_t phiL = pLeading.Phi(); if(phiL < 0 ) phiL+=TMath::TwoPi(); Double_t etaL = pLeading.Eta(); - if(GetDebug() > 1) printf("Leading found in %s, with pt %3.2f, phi %2.2f, eta %2.2f\n",det.Data(), ptL, phiL, etaL); + if(GetDebug() > 1) printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() - Leading found in %s, with pt %3.2f, phi %2.2f, eta %2.2f\n", + det.Data(), ptL, phiL, etaL); if(det == "CTS"){ fhChargedLeadingPt->Fill(pt,ptL); fhChargedLeadingPhi->Fill(pt,phiL); @@ -1291,7 +1310,7 @@ void AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() }//Leading }//AOD trigger particle loop - if(GetDebug() >1)printf("End of jet leading cone analysis, fill histograms \n"); + if(GetDebug() >1)printf("AliAnaParticleJetLeadingConeCorrelation::MakeAnalysisFillHistograms() - End of jet leading cone analysis, fill histograms \n"); } @@ -1306,19 +1325,21 @@ const { TLorentzVector jet(0,0,0,0); TLorentzVector lv (0,0,0,0); //Temporal container for jet particles kinematics - Double_t ptTrig = particle->Pt(); - Double_t phiTrig = particle->Phi(); - Double_t phil = pLeading.Phi(); + Double_t ptTrig = particle->Pt(); + Double_t phiTrig = particle->Phi(); + Double_t phil = pLeading.Phi(); if(phil<0) phil+=TMath::TwoPi(); - Double_t etal = pLeading.Eta(); - + Double_t etal = pLeading.Eta(); + Bool_t first = kTRUE; + Bool_t firstbkg = kTRUE; + //Different pt cut for jet particles in different collisions systems Float_t ptcut = fJetPtThreshold; if(fPbPb && !fSeveralConeAndPtCuts && ptTrig > fPtTriggerSelectionCut) ptcut = fJetPtThresPbPb ; //Add charged particles to jet if they are in cone around the leading particle if(!GetAODCTS()) { - AliFatal("Cannot construct jets without tracks, STOP analysis"); + printf("AliAnaParticleJetLeadingConeCorrelation::MakeAODJet() - Cannot construct jets without tracks, STOP analysis"); return; } @@ -1330,6 +1351,12 @@ const { //Particles in jet if(IsParticleInJetCone(p3.Eta(), p3.Phi(), etal, phil)){ + + if(first) { + new (particle->GetRefTracks()) TRefArray(TProcessID::GetProcessWithUID(track)); + first = kFALSE; + } + particle->AddTrack(track); if(p3.Pt() > ptcut ){ lv.SetVect(p3); @@ -1338,6 +1365,12 @@ const { } //Background around (phi_gamma-pi, eta_leading) else if(IsParticleInJetCone(p3.Eta(),p3.Phi(),etal, phiTrig)) { + + if(firstbkg) { + new (particle->GetRefBackgroundTracks()) TRefArray(TProcessID::GetProcessWithUID(track)); + firstbkg = kFALSE; + } + particle->AddBackgroundTrack(track); if(p3.Pt() > ptcut ){ lv.SetVect(p3); @@ -1351,7 +1384,9 @@ const { Double_t vertex[] = {0,0,0}; if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); - + + first = kTRUE; + firstbkg = kTRUE; for(Int_t iclus = 0;iclus < (GetAODEMCAL())->GetEntriesFast() ; iclus ++ ){ AliAODCaloCluster * calo = (AliAODCaloCluster *) (GetAODEMCAL()->At(iclus)) ; @@ -1361,11 +1396,23 @@ const { calo->GetMomentum(lv,vertex); //Particles in jet if(IsParticleInJetCone(lv.Eta(),lv.Phi(), etal, phil)){ + + if(first) { + new (particle->GetRefClusters()) TRefArray(TProcessID::GetProcessWithUID(calo)); + first = kFALSE; + } + particle->AddCluster(calo); if(lv.Pt() > ptcut ) jet+=lv; } //Background around (phi_gamma-pi, eta_leading) else if(IsParticleInJetCone(lv.Eta(),lv.Phi(),etal, phiTrig)){ + + if(firstbkg) { + new (particle->GetRefBackgroundClusters()) TRefArray(TProcessID::GetProcessWithUID(calo)); + firstbkg = kFALSE; + } + particle->AddBackgroundCluster(calo); if(lv.Pt() > ptcut ) bkg+=lv; } @@ -1377,7 +1424,7 @@ const { if(IsJetSelected(particle->Pt(), jet.Pt())) { particle->SetCorrelatedJet(jet); particle->SetCorrelatedBackground(bkg); - if(GetDebug()>1) printf("Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt()); + if(GetDebug()>1) printf("AliAnaParticleJetLeadingConeCorrelation::MakeAODJet() - Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt()); } } @@ -1450,7 +1497,7 @@ const { bkg.SetPxPyPzE(0.,0.,0.,0.); } else - if(GetDebug()>1) printf("Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt()); + if(GetDebug()>1) printf("AliAnaParticleJetLeadingConeCorrelation::MakeJetFromAOD()::Found jet: Trigger pt %f, Jet pt %f, Bkg pt %f\n",ptTrig,jet.Pt(),bkg.Pt()); } @@ -1472,7 +1519,7 @@ Bool_t AliAnaParticleJetLeadingConeCorrelation::SelectCluster(AliAODCaloCluster else pdg = GetCaloPID()->GetPdg("EMCAL",mom,calo);//PID recalculated - if(GetDebug() > 1) printf("PDG of identified particle %d\n",pdg); + if(GetDebug() > 1) printf("AliAnaParticleJetLeadingConeCorrelation::SelectCluster() - PDG of identified particle %d\n",pdg); //If it does not pass pid, skip if(pdg != AliCaloPID::kPhoton || pdg != AliCaloPID::kPi0) return kFALSE ; @@ -1484,7 +1531,7 @@ Bool_t AliAnaParticleJetLeadingConeCorrelation::SelectCluster(AliAODCaloCluster if(! in ) return kFALSE ; } - if(GetDebug() > 1) printf("cluster selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg); + if(GetDebug() > 1) printf("AliAnaParticleJetLeadingConeCorrelation::SelectCluster() - Cluster selection cuts passed: pT %3.2f, pdg %d\n",mom.Pt(), pdg); return kTRUE; @@ -1525,5 +1572,7 @@ void AliAnaParticleJetLeadingConeCorrelation::Print(const Option_t * opt) const printf("Accept jets depending on trigger energy \n") ; else printf("Wrong jet selection option: %d \n", fSelect) ; + + printf("Isolated Trigger? %d\n", fSelectIsolated) ; } diff --git a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h index 752a2ed05dc..dd2dbdafa43 100755 --- a/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h +++ b/PWG4/PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.h @@ -24,7 +24,6 @@ class AliAODTrack; class AliAODCaloCluster; class AliCaloTrackReader; class AliNeutralMesonSelection; -class AliLog; class AliAODPWG4ParticleCorrelation ; #include "AliAnaPartCorrBaseClass.h" @@ -101,6 +100,9 @@ public: void SetJetCTSRatioCutRange(Double_t ratiomin, Double_t ratiomax) {fJetCTSRatioMaxCut =ratiomax; fJetCTSRatioMinCut = ratiomin ; } + Bool_t OnlyIsolated() const {return fSelectIsolated ; } + void SelectIsolated(Bool_t select) {fSelectIsolated = select ; } + private: Double_t CalculateJetRatioLimit(const Double_t ptTrig, const Double_t *param, const Double_t *x) const ; @@ -167,7 +169,8 @@ public: TString fJetNamePtThres[5]; // String name of pt th to append to histos Double_t fPtTriggerSelectionCut; // Jet pt to change to low pt jets analysis UInt_t fSelect ; //kTRUE: Selects all jets, no limits. - + Bool_t fSelectIsolated ; // Select only trigger particles isolated + //Histograms //Leading particle distributions TList * fOutCont ; //! Container for histograms diff --git a/PWG4/PartCorrDep/AliAnaParticlePartonCorrelation.cxx b/PWG4/PartCorrDep/AliAnaParticlePartonCorrelation.cxx index d1178973ffe..a27d840f808 100755 --- a/PWG4/PartCorrDep/AliAnaParticlePartonCorrelation.cxx +++ b/PWG4/PartCorrDep/AliAnaParticlePartonCorrelation.cxx @@ -27,7 +27,6 @@ //---- ANALYSIS system ---- #include "AliAnaParticlePartonCorrelation.h" -#include "AliLog.h" #include "AliStack.h" #include "AliAODPWG4ParticleCorrelation.h" @@ -87,8 +86,6 @@ TList * AliAnaParticlePartonCorrelation::GetCreateOutputObjects() { // Create histograms to be saved in output file - AliDebug(1,"Init parton histograms"); - TList * outputContainer = new TList() ; outputContainer->SetName("ParticlePartonHistos") ; @@ -177,9 +174,10 @@ void AliAnaParticlePartonCorrelation::MakeAnalysisFillAOD() //Add partons to the reference list of the trigger particle //Partons are considered those in the first eight possitions in the stack //being 0, and 1 the 2 protons, and 6 and 7 the outgoing final partons. - if(!GetInputAODBranch()) - AliFatal(Form("ParticlePartonCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - + if(!GetInputAODBranch()){ + printf("ParticlePartonCorrelation::FillAOD: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()); + abort(); + } if(GetDebug() > 1){ printf("Begin parton correlation analysis, fill AODs \n"); printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); @@ -191,8 +189,10 @@ void AliAnaParticlePartonCorrelation::MakeAnalysisFillAOD() AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); AliStack * stack = GetMCStack() ; - if(!stack) AliFatal("No Stack available, STOP"); - + if(!stack){ + printf("No Stack available, STOP"); + abort(); + } if(stack->GetNtrack() < 8) { printf("*** small number of particles, not a PYTHIA simulation? ***: n tracks %d \n", stack->GetNprimary()); continue ; @@ -200,37 +200,46 @@ void AliAnaParticlePartonCorrelation::MakeAnalysisFillAOD() //Fill AOD reference only with partons TParticle * parton = new TParticle ; - + Bool_t first = kTRUE; for(Int_t ipr = 0;ipr < 8; ipr ++ ){ parton = stack->Particle(ipr) ; + + if(first) { + new (particle->GetRefTracks()) TRefArray(TProcessID::GetProcessWithUID(parton)); + first = kFALSE; + } + particle->AddTrack(parton); - //parton->Print(); } - + }//Aod branch loop - - if(GetDebug() > 1) printf("End parton correlation analysis, fill AODs \n"); + + if(GetDebug() > 1) printf("End parton correlation analysis, fill AODs \n"); } //__________________________________________________________________ void AliAnaParticlePartonCorrelation::MakeAnalysisFillHistograms() { //Particle-Parton Correlation Analysis, fill histograms - if(!GetInputAODBranch()) - AliFatal(Form("ParticlePartonCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data())); - + if(!GetInputAODBranch()){ + printf("ParticlePartonCorrelation::FillHistos: No input particles in AOD with name branch < %s > \n",GetInputAODName().Data()); + abort(); + } if(GetDebug() > 1){ printf("Begin parton correlation analysis, fill histograms \n"); printf("In particle branch aod entries %d\n", GetInputAODBranch()->GetEntriesFast()); } - + AliStack * stack = GetMCStack() ; - if(!stack) AliFatal("No Stack available, STOP"); - + if(!stack) { + printf("ParticlePartonCorrelation::FillHistos - No Stack available, STOP"); + abort(); + } + //Loop on stored AOD particles Int_t naod = GetInputAODBranch()->GetEntriesFast(); TParticle * mom =new TParticle ; - + for(Int_t iaod = 0; iaod < naod ; iaod++){ AliAODPWG4ParticleCorrelation* particle = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(iaod)); @@ -240,9 +249,11 @@ void AliAnaParticlePartonCorrelation::MakeAnalysisFillHistograms() Int_t imom = particle->GetLabel(); Int_t iparent = 2000; Int_t iawayparent = -1; - - if(!(particle->GetRefTracks()) || (particle->GetRefTracks())->GetEntriesFast() < 7) AliFatal("Reference list with partons not filled, STOP analysis"); - + + if(!(particle->GetRefTracks()) || (particle->GetRefTracks())->GetEntriesFast() < 7) { + printf("ParticlePartonCorrelation::FillHistos - Reference list with partons not filled, STOP analysis"); + abort(); + } //Check and get indeces of mother and parton if(imom < 8 ) iparent = imom ; //mother is already a parton else if (imom < stack->GetNtrack()) { @@ -258,7 +269,7 @@ void AliAnaParticlePartonCorrelation::MakeAnalysisFillHistograms() } if(GetDebug() > 1) printf("N reference partons %d; labels: mother %d, parent %d \n", (particle->GetRefTracks())->GetEntriesFast(), imom, iparent); - + if(iparent < 0 || iparent > 8) { if(GetDebug() > 0 ) printf("Failed to find appropriate parton, index %d", iparent); diff --git a/PWG4/PartCorrDep/AliAnaPhoton.cxx b/PWG4/PartCorrDep/AliAnaPhoton.cxx index 655c6e1faf2..d4847e15a55 100755 --- a/PWG4/PartCorrDep/AliAnaPhoton.cxx +++ b/PWG4/PartCorrDep/AliAnaPhoton.cxx @@ -26,13 +26,17 @@ // --- ROOT system --- #include +#include +#include +//#include // --- Analysis system --- #include "AliAnaPhoton.h" #include "AliCaloTrackReader.h" #include "AliCaloPID.h" #include "AliMCAnalysisUtils.h" -#include "AliStack.h" +#include "AliFidutialCut.h" +#include "AliAODCaloCluster.h" ClassImp(AliAnaPhoton) @@ -129,191 +133,191 @@ AliAnaPhoton::~AliAnaPhoton() //________________________________________________________________________ TList * AliAnaPhoton::GetCreateOutputObjects() { - // Create histograms to be saved in output file and - // store them in outputContainer - TList * outputContainer = new TList() ; - outputContainer->SetName("PhotonHistos") ; - - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); - - //Histograms of highest Photon identified in Event - fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtPhoton->SetYTitle("N"); - fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtPhoton) ; - - fhPhiPhoton = new TH2F - ("hPhiPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiPhoton->SetYTitle("#phi"); - fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiPhoton) ; - - fhEtaPhoton = new TH2F - ("hEtaPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaPhoton->SetYTitle("#eta"); - fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaPhoton) ; - - if(IsDataMC()){ - - fhPtPrompt = new TH1F("hPtPrompt","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtPrompt->SetYTitle("N"); - fhPtPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtPrompt) ; - - fhPhiPrompt = new TH2F - ("hPhiPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiPrompt->SetYTitle("#phi"); - fhPhiPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiPrompt) ; - - fhEtaPrompt = new TH2F - ("hEtaPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaPrompt->SetYTitle("#eta"); - fhEtaPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaPrompt) ; - - fhPtFragmentation = new TH1F("hPtFragmentation","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtFragmentation->SetYTitle("N"); - fhPtFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtFragmentation) ; - - fhPhiFragmentation = new TH2F - ("hPhiFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiFragmentation->SetYTitle("#phi"); - fhPhiFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiFragmentation) ; - - fhEtaFragmentation = new TH2F - ("hEtaFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaFragmentation->SetYTitle("#eta"); - fhEtaFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaFragmentation) ; - - fhPtISR = new TH1F("hPtISR","Number of initial state radiation #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtISR->SetYTitle("N"); - fhPtISR->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtISR) ; - - fhPhiISR = new TH2F - ("hPhiISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiISR->SetYTitle("#phi"); - fhPhiISR->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiISR) ; - - fhEtaISR = new TH2F - ("hEtaISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaISR->SetYTitle("#eta"); - fhEtaISR->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaISR) ; - - fhPtPi0Decay = new TH1F("hPtPi0Decay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtPi0Decay->SetYTitle("N"); - fhPtPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtPi0Decay) ; - - fhPhiPi0Decay = new TH2F - ("hPhiPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiPi0Decay->SetYTitle("#phi"); - fhPhiPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiPi0Decay) ; - - fhEtaPi0Decay = new TH2F - ("hEtaPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaPi0Decay->SetYTitle("#eta"); - fhEtaPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaPi0Decay) ; - - fhPtOtherDecay = new TH1F("hPtOtherDecay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtOtherDecay->SetYTitle("N"); - fhPtOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtOtherDecay) ; - - fhPhiOtherDecay = new TH2F - ("hPhiOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiOtherDecay->SetYTitle("#phi"); - fhPhiOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiOtherDecay) ; - - fhEtaOtherDecay = new TH2F - ("hEtaOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaOtherDecay->SetYTitle("#eta"); - fhEtaOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaOtherDecay) ; - - fhPtConversion = new TH1F("hPtConversion","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtConversion->SetYTitle("N"); - fhPtConversion->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtConversion) ; - - fhPhiConversion = new TH2F - ("hPhiConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiConversion->SetYTitle("#phi"); - fhPhiConversion->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiConversion) ; - - fhEtaConversion = new TH2F - ("hEtaConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaConversion->SetYTitle("#eta"); - fhEtaConversion->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaConversion) ; - - fhPtUnknown = new TH1F("hPtUnknown","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); - fhPtUnknown->SetYTitle("N"); - fhPtUnknown->SetXTitle("p_{T #gamma}(GeV/c)"); - outputContainer->Add(fhPtUnknown) ; - - fhPhiUnknown = new TH2F - ("hPhiUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiUnknown->SetYTitle("#phi"); - fhPhiUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhPhiUnknown) ; - - fhEtaUnknown = new TH2F - ("hEtaUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaUnknown->SetYTitle("#eta"); - fhEtaUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); - outputContainer->Add(fhEtaUnknown) ; - - }//Histos with MC - - //Save parameters used for analysis - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - - sprintf(onePar,"--- AliAnaPhoton ---\n") ; - parList+=onePar ; - sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; - parList+=onePar ; - sprintf(onePar,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ; - parList+=onePar ; - sprintf(onePar,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ; - parList+=onePar ; - sprintf(onePar,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ; - parList+=onePar ; - - //Get parameters set in base class. - parList += GetBaseParametersList() ; - - //Get parameters set in PID class. - parList += GetCaloPID()->GetPIDParametersList() ; - - //Get parameters set in FidutialCut class (not available yet) - //parlist += GetFidCut()->GetFidCutParametersList() - - TObjString *oString= new TObjString(parList) ; - outputContainer->Add(oString); - - return outputContainer ; - + // Create histograms to be saved in output file and + // store them in outputContainer + TList * outputContainer = new TList() ; + outputContainer->SetName("PhotonHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + //Histograms of highest Photon identified in Event + fhPtPhoton = new TH1F("hPtPhoton","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtPhoton->SetYTitle("N"); + fhPtPhoton->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtPhoton) ; + + fhPhiPhoton = new TH2F + ("hPhiPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiPhoton->SetYTitle("#phi"); + fhPhiPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiPhoton) ; + + fhEtaPhoton = new TH2F + ("hEtaPhoton","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaPhoton->SetYTitle("#eta"); + fhEtaPhoton->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaPhoton) ; + + if(IsDataMC()){ + + fhPtPrompt = new TH1F("hPtPrompt","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtPrompt->SetYTitle("N"); + fhPtPrompt->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtPrompt) ; + + fhPhiPrompt = new TH2F + ("hPhiPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiPrompt->SetYTitle("#phi"); + fhPhiPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiPrompt) ; + + fhEtaPrompt = new TH2F + ("hEtaPrompt","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaPrompt->SetYTitle("#eta"); + fhEtaPrompt->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaPrompt) ; + + fhPtFragmentation = new TH1F("hPtFragmentation","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtFragmentation->SetYTitle("N"); + fhPtFragmentation->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtFragmentation) ; + + fhPhiFragmentation = new TH2F + ("hPhiFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiFragmentation->SetYTitle("#phi"); + fhPhiFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiFragmentation) ; + + fhEtaFragmentation = new TH2F + ("hEtaFragmentation","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaFragmentation->SetYTitle("#eta"); + fhEtaFragmentation->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaFragmentation) ; + + fhPtISR = new TH1F("hPtISR","Number of initial state radiation #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtISR->SetYTitle("N"); + fhPtISR->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtISR) ; + + fhPhiISR = new TH2F + ("hPhiISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiISR->SetYTitle("#phi"); + fhPhiISR->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiISR) ; + + fhEtaISR = new TH2F + ("hEtaISR","#phi_{#gamma} initial state radiation",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaISR->SetYTitle("#eta"); + fhEtaISR->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaISR) ; + + fhPtPi0Decay = new TH1F("hPtPi0Decay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtPi0Decay->SetYTitle("N"); + fhPtPi0Decay->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtPi0Decay) ; + + fhPhiPi0Decay = new TH2F + ("hPhiPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiPi0Decay->SetYTitle("#phi"); + fhPhiPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiPi0Decay) ; + + fhEtaPi0Decay = new TH2F + ("hEtaPi0Decay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaPi0Decay->SetYTitle("#eta"); + fhEtaPi0Decay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaPi0Decay) ; + + fhPtOtherDecay = new TH1F("hPtOtherDecay","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtOtherDecay->SetYTitle("N"); + fhPtOtherDecay->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtOtherDecay) ; + + fhPhiOtherDecay = new TH2F + ("hPhiOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiOtherDecay->SetYTitle("#phi"); + fhPhiOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiOtherDecay) ; + + fhEtaOtherDecay = new TH2F + ("hEtaOtherDecay","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaOtherDecay->SetYTitle("#eta"); + fhEtaOtherDecay->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaOtherDecay) ; + + fhPtConversion = new TH1F("hPtConversion","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtConversion->SetYTitle("N"); + fhPtConversion->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtConversion) ; + + fhPhiConversion = new TH2F + ("hPhiConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiConversion->SetYTitle("#phi"); + fhPhiConversion->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiConversion) ; + + fhEtaConversion = new TH2F + ("hEtaConversion","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaConversion->SetYTitle("#eta"); + fhEtaConversion->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaConversion) ; + + fhPtUnknown = new TH1F("hPtUnknown","Number of #gamma over calorimeter",nptbins,ptmin,ptmax); + fhPtUnknown->SetYTitle("N"); + fhPtUnknown->SetXTitle("p_{T #gamma}(GeV/c)"); + outputContainer->Add(fhPtUnknown) ; + + fhPhiUnknown = new TH2F + ("hPhiUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiUnknown->SetYTitle("#phi"); + fhPhiUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhPhiUnknown) ; + + fhEtaUnknown = new TH2F + ("hEtaUnknown","#phi_{#gamma}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaUnknown->SetYTitle("#eta"); + fhEtaUnknown->SetXTitle("p_{T #gamma} (GeV/c)"); + outputContainer->Add(fhEtaUnknown) ; + + }//Histos with MC + + //Save parameters used for analysis + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + + sprintf(onePar,"--- AliAnaPhoton ---\n") ; + parList+=onePar ; + sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; + parList+=onePar ; + sprintf(onePar,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ; + parList+=onePar ; + sprintf(onePar,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ; + parList+=onePar ; + sprintf(onePar,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ; + parList+=onePar ; + + //Get parameters set in base class. + parList += GetBaseParametersList() ; + + //Get parameters set in PID class. + parList += GetCaloPID()->GetPIDParametersList() ; + + //Get parameters set in FidutialCut class (not available yet) + //parlist += GetFidCut()->GetFidCutParametersList() + + TObjString *oString= new TObjString(parList) ; + outputContainer->Add(oString); + + return outputContainer ; + } //____________________________________________________________________________ @@ -351,211 +355,210 @@ void AliAnaPhoton::InitParameters() //__________________________________________________________________ void AliAnaPhoton::MakeAnalysisFillAOD() { - //Do analysis and fill aods - //Search for photons in fCalorimeter - - TClonesArray * pl = new TClonesArray; - - //Get vertex for photon momentum calculation - Double_t vertex[]={0,0,0} ; //vertex ; - if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); - - //Select the Calorimeter of the photon - if(fCalorimeter == "PHOS") - pl = GetAODPHOS(); - else if (fCalorimeter == "EMCAL") - pl = GetAODEMCAL(); - //Fill AODCaloClusters and AODParticle with PHOS aods - TLorentzVector mom ; - for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ - AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); - - //Cluster selection, not charged, with photon id and in fidutial cut - //Get Momentum vector, - calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line - //If too small or big pt, skip it - if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; - //Check acceptance selection - if(IsFidutialCutOn()){ - Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ; - if(! in ) continue ; - } - - //Create AOD for analysis - AliAODPWG4Particle aodph = AliAODPWG4Particle(mom); - aodph.SetLabel(calo->GetLabel(0)); - //printf("Index %d, Id %d\n",icalo, calo->GetID()); - //Set the indeces of the original caloclusters - aodph.SetCaloLabel(calo->GetID(),-1); - aodph.SetDetector(fCalorimeter); - if(GetDebug() > 1) - printf("AliAnaPhoton::FillAOD: Min pt cut and fidutial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodph.Pt(),aodph.Phi(),aodph.Eta()); - - //Check Distance to Bad channel, set bit. - Double_t distBad=calo->GetDistToBadChannel() ; //Distance to bad channel - if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ; - if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm) - continue ; - - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: Bad channel cut passed %4.2f\n",distBad); - - if(distBad > fMinDist3) aodph.SetDistToBad(2) ; - else if(distBad > fMinDist2) aodph.SetDistToBad(1) ; - else aodph.SetDistToBad(0) ; - - //Check PID - //PID selection or bit setting - if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){ - //Get most probable PID, check PID weights (in MC this option is mandatory) - aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PDG of identified particle %d\n",aodph.GetPdg()); - //If primary is not photon, skip it. - if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; - } - else if(IsCaloPIDOn()){ - //Skip matched clusters with tracks - if(calo->GetNTracksMatched() > 0) continue ; - - //Get most probable PID, 2 options check PID weights - //or redo PID, recommended option for EMCal. - if(!IsCaloPIDRecalculationOn()) - aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights - else - aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated - - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PDG of identified particle %d\n",aodph.GetPdg()); - - //If cluster does not pass pid, not photon, skip it. - if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; - - } - else{ - //Set PID bits for later selection (AliAnaPi0 for example) - //GetPDG already called in SetPIDBits. - GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodph); - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PID Bits set \n"); - } - - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: Photon selection cuts passed: pT %3.2f, pdg %d\n",aodph.Pt(), aodph.GetPdg()); - - //Play with the MC stack if available - //Check origin of the candidates - if(IsDataMC()){ - aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack())); - if(GetDebug() > 0) printf("AliAnaPhoton::FillAOD: Origin of candidate %d\n",aodph.GetTag()); - }//Work with stack also - - //Add AOD with photon object to aod branch - AddAODParticle(aodph); - - }//loop - -if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: End fill AODs \n"); - + //Do analysis and fill aods + //Search for photons in fCalorimeter + TRefArray * pl = new TRefArray(); + + //Get vertex for photon momentum calculation + Double_t vertex[]={0,0,0} ; //vertex ; + if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); + //Select the Calorimeter of the photon + if(fCalorimeter == "PHOS") + pl = GetAODPHOS(); + else if (fCalorimeter == "EMCAL") + pl = GetAODEMCAL(); + + //Fill AODCaloClusters and AODParticle with PHOS aods + TLorentzVector mom ; + + for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ + AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); + //Cluster selection, not charged, with photon id and in fidutial cut + //Get Momentum vector, + calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line + //If too small or big pt, skip it + if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; + //Check acceptance selection + if(IsFidutialCutOn()){ + Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ; + if(! in ) continue ; + } + + //Create AOD for analysis + AliAODPWG4Particle aodph = AliAODPWG4Particle(mom); + aodph.SetLabel(calo->GetLabel(0)); + //printf("Index %d, Id %d\n",icalo, calo->GetID()); + //Set the indeces of the original caloclusters + aodph.SetCaloLabel(calo->GetID(),-1); + aodph.SetDetector(fCalorimeter); + if(GetDebug() > 1) + printf("AliAnaPhoton::FillAOD: Min pt cut and fidutial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodph.Pt(),aodph.Phi(),aodph.Eta()); + + //Check Distance to Bad channel, set bit. + Double_t distBad=calo->GetDistToBadChannel() ; //Distance to bad channel + if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ; + if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm) + continue ; + + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: Bad channel cut passed %4.2f\n",distBad); + + if(distBad > fMinDist3) aodph.SetDistToBad(2) ; + else if(distBad > fMinDist2) aodph.SetDistToBad(1) ; + else aodph.SetDistToBad(0) ; + + //Check PID + //PID selection or bit setting + if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){ + //Get most probable PID, check PID weights (in MC this option is mandatory) + aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PDG of identified particle %d\n",aodph.GetPdg()); + //If primary is not photon, skip it. + if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; + } + else if(IsCaloPIDOn()){ + //Skip matched clusters with tracks + if(calo->GetNTracksMatched() > 0) continue ; + + //Get most probable PID, 2 options check PID weights + //or redo PID, recommended option for EMCal. + if(!IsCaloPIDRecalculationOn()) + aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights + else + aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated + + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PDG of identified particle %d\n",aodph.GetPdg()); + + //If cluster does not pass pid, not photon, skip it. + if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; + + } + else{ + //Set PID bits for later selection (AliAnaPi0 for example) + //GetPDG already called in SetPIDBits. + GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodph); + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PID Bits set \n"); + } + + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: Photon selection cuts passed: pT %3.2f, pdg %d\n",aodph.Pt(), aodph.GetPdg()); + + //Play with the MC stack if available + //Check origin of the candidates + if(IsDataMC()){ + aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack())); + if(GetDebug() > 0) printf("AliAnaPhoton::FillAOD: Origin of candidate %d\n",aodph.GetTag()); + }//Work with stack also + + //Add AOD with photon object to aod branch + AddAODParticle(aodph); + + }//loop + + if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: End fill AODs \n"); + } //__________________________________________________________________ void AliAnaPhoton::MakeAnalysisFillHistograms() { - //Do analysis and fill histograms - - //Get vertex for photon momentum calculation - //Double_t v[]={0,0,0} ; //vertex ; - //if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) - //GetReader()->GetVertex(v); - - //Loop on stored AOD photons - Int_t naod = GetOutputAODBranch()->GetEntriesFast(); - if(GetDebug() > 0) printf("AliAnaPhoton::FillHistos: aod branch entries %d\n", naod); - - for(Int_t iaod = 0; iaod < naod ; iaod++){ - AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); - Int_t pdg = ph->GetPdg(); - - if(GetDebug() > 3) - printf("AliAnaPhoton::FillHistos: PDG %d, MC TAG %d, Calorimeter %s\n", ph->GetPdg(),ph->GetTag(), (ph->GetDetector()).Data()) ; - - //If PID used, fill histos with photons in Calorimeter fCalorimeter - if(IsCaloPIDOn()) - if(pdg != AliCaloPID::kPhoton) continue; - if(ph->GetDetector() != fCalorimeter) continue; - - if(GetDebug() > 1) - printf("AliAnaPhoton::FillHistos: ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ; - - //Fill photon histograms - Float_t ptcluster = ph->Pt(); - Float_t phicluster = ph->Phi(); - Float_t etacluster = ph->Eta(); - - fhPtPhoton ->Fill(ptcluster); - fhPhiPhoton ->Fill(ptcluster,phicluster); - fhEtaPhoton ->Fill(ptcluster,etacluster); - - if(IsDataMC()){ - Int_t tag =ph->GetTag(); - if(tag == AliMCAnalysisUtils::kMCPrompt){ - fhPtPrompt ->Fill(ptcluster); - fhPhiPrompt ->Fill(ptcluster,phicluster); - fhEtaPrompt ->Fill(ptcluster,etacluster); - } - else if(tag==AliMCAnalysisUtils::kMCFragmentation) - { - fhPtFragmentation ->Fill(ptcluster); - fhPhiFragmentation ->Fill(ptcluster,phicluster); - fhEtaFragmentation ->Fill(ptcluster,etacluster); - } - else if(tag==AliMCAnalysisUtils::kMCISR) - { - fhPtISR ->Fill(ptcluster); - fhPhiISR ->Fill(ptcluster,phicluster); - fhEtaISR ->Fill(ptcluster,etacluster); - } - else if(tag==AliMCAnalysisUtils::kMCPi0Decay) - { - fhPtPi0Decay ->Fill(ptcluster); - fhPhiPi0Decay ->Fill(ptcluster,phicluster); - fhEtaPi0Decay ->Fill(ptcluster,etacluster); - } - else if(tag==AliMCAnalysisUtils::kMCEtaDecay || tag==AliMCAnalysisUtils::kMCOtherDecay) - { - fhPtOtherDecay ->Fill(ptcluster); - fhPhiOtherDecay ->Fill(ptcluster,phicluster); - fhEtaOtherDecay ->Fill(ptcluster,etacluster); - } - else if(tag==AliMCAnalysisUtils::kMCConversion) - { - fhPtConversion ->Fill(ptcluster); - fhPhiConversion ->Fill(ptcluster,phicluster); - fhEtaConversion ->Fill(ptcluster,etacluster); - - } - else{ - fhPtUnknown ->Fill(ptcluster); - fhPhiUnknown ->Fill(ptcluster,phicluster); - fhEtaUnknown ->Fill(ptcluster,etacluster); - } - }//Histograms with MC - - }// aod loop - + //Do analysis and fill histograms + + //Get vertex for photon momentum calculation + //Double_t v[]={0,0,0} ; //vertex ; + //if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) + //GetReader()->GetVertex(v); + + //Loop on stored AOD photons + Int_t naod = GetOutputAODBranch()->GetEntriesFast(); + if(GetDebug() > 0) printf("AliAnaPhoton::FillHistos: aod branch entries %d\n", naod); + + for(Int_t iaod = 0; iaod < naod ; iaod++){ + AliAODPWG4Particle* ph = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); + Int_t pdg = ph->GetPdg(); + + if(GetDebug() > 3) + printf("AliAnaPhoton::FillHistos: PDG %d, MC TAG %d, Calorimeter %s\n", ph->GetPdg(),ph->GetTag(), (ph->GetDetector()).Data()) ; + + //If PID used, fill histos with photons in Calorimeter fCalorimeter + if(IsCaloPIDOn()) + if(pdg != AliCaloPID::kPhoton) continue; + if(ph->GetDetector() != fCalorimeter) continue; + + if(GetDebug() > 1) + printf("AliAnaPhoton::FillHistos: ID Photon: pt %f, phi %f, eta %f\n", ph->Pt(),ph->Phi(),ph->Eta()) ; + + //Fill photon histograms + Float_t ptcluster = ph->Pt(); + Float_t phicluster = ph->Phi(); + Float_t etacluster = ph->Eta(); + + fhPtPhoton ->Fill(ptcluster); + fhPhiPhoton ->Fill(ptcluster,phicluster); + fhEtaPhoton ->Fill(ptcluster,etacluster); + + if(IsDataMC()){ + Int_t tag =ph->GetTag(); + if(tag == AliMCAnalysisUtils::kMCPrompt){ + fhPtPrompt ->Fill(ptcluster); + fhPhiPrompt ->Fill(ptcluster,phicluster); + fhEtaPrompt ->Fill(ptcluster,etacluster); + } + else if(tag==AliMCAnalysisUtils::kMCFragmentation) + { + fhPtFragmentation ->Fill(ptcluster); + fhPhiFragmentation ->Fill(ptcluster,phicluster); + fhEtaFragmentation ->Fill(ptcluster,etacluster); + } + else if(tag==AliMCAnalysisUtils::kMCISR) + { + fhPtISR ->Fill(ptcluster); + fhPhiISR ->Fill(ptcluster,phicluster); + fhEtaISR ->Fill(ptcluster,etacluster); + } + else if(tag==AliMCAnalysisUtils::kMCPi0Decay) + { + fhPtPi0Decay ->Fill(ptcluster); + fhPhiPi0Decay ->Fill(ptcluster,phicluster); + fhEtaPi0Decay ->Fill(ptcluster,etacluster); + } + else if(tag==AliMCAnalysisUtils::kMCEtaDecay || tag==AliMCAnalysisUtils::kMCOtherDecay) + { + fhPtOtherDecay ->Fill(ptcluster); + fhPhiOtherDecay ->Fill(ptcluster,phicluster); + fhEtaOtherDecay ->Fill(ptcluster,etacluster); + } + else if(tag==AliMCAnalysisUtils::kMCConversion) + { + fhPtConversion ->Fill(ptcluster); + fhPhiConversion ->Fill(ptcluster,phicluster); + fhEtaConversion ->Fill(ptcluster,etacluster); + + } + else{ + fhPtUnknown ->Fill(ptcluster); + fhPhiUnknown ->Fill(ptcluster,phicluster); + fhEtaUnknown ->Fill(ptcluster,etacluster); + } + }//Histograms with MC + + }// aod loop + } //__________________________________________________________________ void AliAnaPhoton::Print(const Option_t * opt) const { - //Print some relevant parameters set for the analysis - - if(! opt) - return; - - printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; - AliAnaPartCorrBaseClass::Print(" "); - printf("Calorimeter = %s\n", fCalorimeter.Data()) ; - printf("Min Distance to Bad Channel = %2.1f\n",fMinDist); - printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2); - printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3); - printf(" \n") ; + //Print some relevant parameters set for the analysis + + if(! opt) + return; + + printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; + AliAnaPartCorrBaseClass::Print(" "); + printf("Calorimeter = %s\n", fCalorimeter.Data()) ; + printf("Min Distance to Bad Channel = %2.1f\n",fMinDist); + printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2); + printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3); + printf(" \n") ; } diff --git a/PWG4/PartCorrDep/AliAnaPi0.cxx b/PWG4/PartCorrDep/AliAnaPi0.cxx index 0a6fb14cc2d..14955b85fc8 100755 --- a/PWG4/PartCorrDep/AliAnaPi0.cxx +++ b/PWG4/PartCorrDep/AliAnaPi0.cxx @@ -30,12 +30,18 @@ #include "TCanvas.h" #include "TPad.h" #include "TROOT.h" +#include "TClonesArray.h" +#include "TObjString.h" //---- AliRoot system ---- #include "AliAnaPi0.h" #include "AliCaloTrackReader.h" #include "AliCaloPID.h" #include "AliStack.h" +#include "AliFidutialCut.h" +#include "TParticle.h" +#include "AliAODCaloCluster.h" +#include "AliVEvent.h" #ifdef __PHOSGEO__ #include "AliPHOSGeoUtils.h" @@ -65,48 +71,48 @@ fhRe1(ex.fhRe1),fhMi1(ex.fhMi1),fhRe2(ex.fhRe2),fhMi2(ex.fhMi2),fhRe3(ex.fhRe3), fhPrimPt(ex.fhPrimPt), fhPrimAccPt(ex.fhPrimAccPt), fhPrimY(ex.fhPrimY), fhPrimAccY(ex.fhPrimAccY), fhPrimPhi(ex.fhPrimPhi), fhPrimAccPhi(ex.fhPrimAccPhi) { - // cpy ctor - //Do not need it + // cpy ctor + //Do not need it } //________________________________________________________________________________________________________________________________________________ AliAnaPi0 & AliAnaPi0::operator = (const AliAnaPi0 & ex) { - // assignment operator - - if(this == &ex)return *this; - ((AliAnaPartCorrBaseClass *)this)->operator=(ex); - - fNCentrBin = ex.fNCentrBin ; fNZvertBin = ex.fNZvertBin ; fNrpBin = ex.fNrpBin ; - fNPID = ex.fNPID ; fNmaxMixEv = ex.fNmaxMixEv ; fZvtxCut = ex.fZvtxCut ; fCalorimeter = ex.fCalorimeter ; - fEventsList = ex.fEventsList ; fhEtalon = ex.fhEtalon ; - fhRe1 = ex.fhRe1 ; fhMi1 = ex.fhMi1 ; fhRe2 = ex.fhRe2 ; fhMi2 = ex.fhMi2 ; - fhRe3 = ex.fhRe3 ; fhMi3 = ex.fhMi3 ; fhEvents = ex.fhEvents ; - fhPrimPt = ex.fhPrimPt ; fhPrimAccPt = ex.fhPrimAccPt ; fhPrimY = ex.fhPrimY ; - fhPrimAccY = ex.fhPrimAccY ; fhPrimPhi = ex.fhPrimPhi ; fhPrimAccPhi = ex.fhPrimAccPhi ; - - return *this; - + // assignment operator + + if(this == &ex)return *this; + ((AliAnaPartCorrBaseClass *)this)->operator=(ex); + + fNCentrBin = ex.fNCentrBin ; fNZvertBin = ex.fNZvertBin ; fNrpBin = ex.fNrpBin ; + fNPID = ex.fNPID ; fNmaxMixEv = ex.fNmaxMixEv ; fZvtxCut = ex.fZvtxCut ; fCalorimeter = ex.fCalorimeter ; + fEventsList = ex.fEventsList ; fhEtalon = ex.fhEtalon ; + fhRe1 = ex.fhRe1 ; fhMi1 = ex.fhMi1 ; fhRe2 = ex.fhRe2 ; fhMi2 = ex.fhMi2 ; + fhRe3 = ex.fhRe3 ; fhMi3 = ex.fhMi3 ; fhEvents = ex.fhEvents ; + fhPrimPt = ex.fhPrimPt ; fhPrimAccPt = ex.fhPrimAccPt ; fhPrimY = ex.fhPrimY ; + fhPrimAccY = ex.fhPrimAccY ; fhPrimPhi = ex.fhPrimPhi ; fhPrimAccPhi = ex.fhPrimAccPhi ; + + return *this; + } //________________________________________________________________________________________________________________________________________________ AliAnaPi0::~AliAnaPi0() { - // Remove event containers - if(fEventsList){ - for(Int_t ic=0; icDelete() ; - delete fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] ; - } - } - } - delete[] fEventsList; - fEventsList=0 ; + // Remove event containers + if(fEventsList){ + for(Int_t ic=0; icDelete() ; + delete fEventsList[ic*fNZvertBin*fNrpBin+iz*fNrpBin+irp] ; } - + } + } + delete[] fEventsList; + fEventsList=0 ; + } + #ifdef __PHOSGEO__ - if(fPHOSGeo) delete fPHOSGeo ; + if(fPHOSGeo) delete fPHOSGeo ; #endif } @@ -115,369 +121,367 @@ void AliAnaPi0::InitParameters() { //Init parameters when first called the analysis //Set default parameters - SetInputAODName("photons"); - fNCentrBin = 1; - fNZvertBin = 1; - fNrpBin = 1; - fNPID = 9; - fNmaxMixEv = 10; - fZvtxCut = 40; - fCalorimeter = "PHOS"; + SetInputAODName("photons"); + fNCentrBin = 1; + fNZvertBin = 1; + fNrpBin = 1; + fNPID = 9; + fNmaxMixEv = 10; + fZvtxCut = 40; + fCalorimeter = "PHOS"; } //________________________________________________________________________________________________________________________________________________ void AliAnaPi0::Init() { -//Init some data members needed in analysis - -//Histograms binning and range - if(!fhEtalon){ // p_T alpha d m_gg - fhEtalon = new TH3D("hEtalon","Histo with binning parameters",50,0.,25.,10,0.,1.,200,0.,1.) ; - fhEtalon->SetXTitle("P_{T} (GeV)") ; - fhEtalon->SetYTitle("#alpha") ; - fhEtalon->SetZTitle("m_{#gamma#gamma} (GeV)") ; - } - + //Init some data members needed in analysis + + //Histograms binning and range + if(!fhEtalon){ // p_T alpha d m_gg + fhEtalon = new TH3D("hEtalon","Histo with binning parameters",50,0.,25.,10,0.,1.,200,0.,1.) ; + fhEtalon->SetXTitle("P_{T} (GeV)") ; + fhEtalon->SetYTitle("#alpha") ; + fhEtalon->SetZTitle("m_{#gamma#gamma} (GeV)") ; + } + } //________________________________________________________________________________________________________________________________________________ TList * AliAnaPi0::GetCreateOutputObjects() { - // Create histograms to be saved in output file and - // store them in fOutputContainer - - //create event containers - fEventsList = new TList*[fNCentrBin*fNZvertBin*fNrpBin] ; - - for(Int_t ic=0; icSetName(GetName()); - - fhRe1=new TH3D*[fNCentrBin*fNPID] ; - fhRe2=new TH3D*[fNCentrBin*fNPID] ; - fhRe3=new TH3D*[fNCentrBin*fNPID] ; - fhMi1=new TH3D*[fNCentrBin*fNPID] ; - fhMi2=new TH3D*[fNCentrBin*fNPID] ; - fhMi3=new TH3D*[fNCentrBin*fNPID] ; - - char key[255] ; - char title[255] ; - - for(Int_t ic=0; icClone(key); - fhRe1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhRe1[ic*fNPID+ipid]->SetName(key) ; - fhRe1[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhRe1[ic*fNPID+ipid]) ; - - sprintf(key,"hMi_cen%d_pid%d_dist1",ic,ipid) ; - sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; - fhMi1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhMi1[ic*fNPID+ipid]->SetName(key) ; - fhMi1[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhMi1[ic*fNPID+ipid]) ; - - //Distance to bad module 2 - sprintf(key,"hRe_cen%d_pid%d_dist2",ic,ipid) ; - sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; - fhRe2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhRe2[ic*fNPID+ipid]->SetName(key) ; - fhRe2[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhRe2[ic*fNPID+ipid]) ; - - sprintf(key,"hMi_cen%d_pid%d_dist2",ic,ipid) ; - sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; - fhMi2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhMi2[ic*fNPID+ipid]->SetName(key) ; - fhMi2[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhMi2[ic*fNPID+ipid]) ; - - //Distance to bad module 3 - sprintf(key,"hRe_cen%d_pid%d_dist3",ic,ipid) ; - sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; - fhRe3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhRe3[ic*fNPID+ipid]->SetName(key) ; - fhRe3[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhRe3[ic*fNPID+ipid]) ; - - sprintf(key,"hMi_cen%d_pid%d_dist3",ic,ipid) ; - sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; - fhMi3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; - fhMi3[ic*fNPID+ipid]->SetName(key) ; - fhMi3[ic*fNPID+ipid]->SetTitle(title) ; - outputContainer->Add(fhMi3[ic*fNPID+ipid]) ; - } + + TList * outputContainer = new TList() ; + outputContainer->SetName(GetName()); + + fhRe1=new TH3D*[fNCentrBin*fNPID] ; + fhRe2=new TH3D*[fNCentrBin*fNPID] ; + fhRe3=new TH3D*[fNCentrBin*fNPID] ; + fhMi1=new TH3D*[fNCentrBin*fNPID] ; + fhMi2=new TH3D*[fNCentrBin*fNPID] ; + fhMi3=new TH3D*[fNCentrBin*fNPID] ; + + char key[255] ; + char title[255] ; + + for(Int_t ic=0; icClone(key); + fhRe1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhRe1[ic*fNPID+ipid]->SetName(key) ; + fhRe1[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhRe1[ic*fNPID+ipid]) ; + + sprintf(key,"hMi_cen%d_pid%d_dist1",ic,ipid) ; + sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; + fhMi1[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhMi1[ic*fNPID+ipid]->SetName(key) ; + fhMi1[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhMi1[ic*fNPID+ipid]) ; + + //Distance to bad module 2 + sprintf(key,"hRe_cen%d_pid%d_dist2",ic,ipid) ; + sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; + fhRe2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhRe2[ic*fNPID+ipid]->SetName(key) ; + fhRe2[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhRe2[ic*fNPID+ipid]) ; + + sprintf(key,"hMi_cen%d_pid%d_dist2",ic,ipid) ; + sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; + fhMi2[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhMi2[ic*fNPID+ipid]->SetName(key) ; + fhMi2[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhMi2[ic*fNPID+ipid]) ; + + //Distance to bad module 3 + sprintf(key,"hRe_cen%d_pid%d_dist3",ic,ipid) ; + sprintf(title,"Real m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; + fhRe3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhRe3[ic*fNPID+ipid]->SetName(key) ; + fhRe3[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhRe3[ic*fNPID+ipid]) ; + + sprintf(key,"hMi_cen%d_pid%d_dist3",ic,ipid) ; + sprintf(title,"Mixed m_{#gamma#gamma} distr. for centrality=%d and PID=%d",ic,ipid) ; + fhMi3[ic*fNPID+ipid]=(TH3D*)fhEtalon->Clone(key) ; + fhMi3[ic*fNPID+ipid]->SetName(key) ; + fhMi3[ic*fNPID+ipid]->SetTitle(title) ; + outputContainer->Add(fhMi3[ic*fNPID+ipid]) ; } - - - fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin, - fNZvertBin,0.,1.*fNZvertBin,fNrpBin,0.,1.*fNrpBin) ; - outputContainer->Add(fhEvents) ; - - //Histograms filled only if MC data is requested - if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){ - if(fhEtalon->GetXaxis()->GetXbins() && fhEtalon->GetXaxis()->GetXbins()->GetSize()){ //Variable bin size - fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXbins()->GetArray()) ; - fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",fhEtalon->GetXaxis()->GetNbins(), - fhEtalon->GetXaxis()->GetXbins()->GetArray()) ; - } - else{ - fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ; - fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance", - fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ; - } - outputContainer->Add(fhPrimPt) ; - outputContainer->Add(fhPrimAccPt) ; - - fhPrimY = new TH1D("hPrimaryRapidity","Rapidity of primary pi0",100,-5.,5.) ; - outputContainer->Add(fhPrimY) ; - - fhPrimAccY = new TH1D("hPrimAccRapidity","Rapidity of primary pi0",100,-5.,5.) ; - outputContainer->Add(fhPrimAccY) ; - - fhPrimPhi = new TH1D("hPrimaryPhi","Azimithal of primary pi0",180,0.,360.) ; - outputContainer->Add(fhPrimPhi) ; - - fhPrimAccPhi = new TH1D("hPrimAccPhi","Azimithal of primary pi0 with accepted daughters",180,-0.,360.) ; - outputContainer->Add(fhPrimAccPhi) ; - } - - //Save parameters used for analysis - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - sprintf(onePar,"--- AliAnaPi0 ---\n") ; - parList+=onePar ; - sprintf(onePar,"Number of bins in Centrality: %d \n",fNCentrBin) ; - parList+=onePar ; - sprintf(onePar,"Number of bins in Z vert. pos: %d \n",fNZvertBin) ; - parList+=onePar ; - sprintf(onePar,"Number of bins in Reac. Plain: %d \n",fNrpBin) ; - parList+=onePar ; - sprintf(onePar,"Depth of event buffer: %d \n",fNmaxMixEv) ; - parList+=onePar ; - sprintf(onePar,"Number of different PID used: %d \n",fNPID) ; - parList+=onePar ; - sprintf(onePar,"Cuts: \n") ; - parList+=onePar ; - sprintf(onePar,"Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ; - parList+=onePar ; - sprintf(onePar,"Calorimeter: %s \n",fCalorimeter.Data()) ; - parList+=onePar ; - - TObjString *oString= new TObjString(parList) ; - outputContainer->Add(oString); - - return outputContainer; + } + + + fhEvents=new TH3D("hEvents","Number of events",fNCentrBin,0.,1.*fNCentrBin, + fNZvertBin,0.,1.*fNZvertBin,fNrpBin,0.,1.*fNrpBin) ; + outputContainer->Add(fhEvents) ; + + //Histograms filled only if MC data is requested + if(IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC) ){ + if(fhEtalon->GetXaxis()->GetXbins() && fhEtalon->GetXaxis()->GetXbins()->GetSize()){ //Variable bin size + fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXbins()->GetArray()) ; + fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance",fhEtalon->GetXaxis()->GetNbins(), + fhEtalon->GetXaxis()->GetXbins()->GetArray()) ; + } + else{ + fhPrimPt = new TH1D("hPrimPt","Primary pi0 pt",fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ; + fhPrimAccPt = new TH1D("hPrimAccPt","Primary pi0 pt with both photons in acceptance", + fhEtalon->GetXaxis()->GetNbins(),fhEtalon->GetXaxis()->GetXmin(),fhEtalon->GetXaxis()->GetXmax()) ; + } + outputContainer->Add(fhPrimPt) ; + outputContainer->Add(fhPrimAccPt) ; + + fhPrimY = new TH1D("hPrimaryRapidity","Rapidity of primary pi0",100,-5.,5.) ; + outputContainer->Add(fhPrimY) ; + + fhPrimAccY = new TH1D("hPrimAccRapidity","Rapidity of primary pi0",100,-5.,5.) ; + outputContainer->Add(fhPrimAccY) ; + + fhPrimPhi = new TH1D("hPrimaryPhi","Azimithal of primary pi0",180,0.,360.) ; + outputContainer->Add(fhPrimPhi) ; + + fhPrimAccPhi = new TH1D("hPrimAccPhi","Azimithal of primary pi0 with accepted daughters",180,-0.,360.) ; + outputContainer->Add(fhPrimAccPhi) ; + } + + //Save parameters used for analysis + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + sprintf(onePar,"--- AliAnaPi0 ---\n") ; + parList+=onePar ; + sprintf(onePar,"Number of bins in Centrality: %d \n",fNCentrBin) ; + parList+=onePar ; + sprintf(onePar,"Number of bins in Z vert. pos: %d \n",fNZvertBin) ; + parList+=onePar ; + sprintf(onePar,"Number of bins in Reac. Plain: %d \n",fNrpBin) ; + parList+=onePar ; + sprintf(onePar,"Depth of event buffer: %d \n",fNmaxMixEv) ; + parList+=onePar ; + sprintf(onePar,"Number of different PID used: %d \n",fNPID) ; + parList+=onePar ; + sprintf(onePar,"Cuts: \n") ; + parList+=onePar ; + sprintf(onePar,"Z vertex position: -%f < z < %f \n",fZvtxCut,fZvtxCut) ; + parList+=onePar ; + sprintf(onePar,"Calorimeter: %s \n",fCalorimeter.Data()) ; + parList+=onePar ; + + TObjString *oString= new TObjString(parList) ; + outputContainer->Add(oString); + + return outputContainer; } //_________________________________________________________________________________________________________________________________________________ void AliAnaPi0::Print(const Option_t * /*opt*/) const { - //Print some relevant parameters set for the analysis - AliAnaPartCorrBaseClass::Print(" "); - printf("Class AliAnaPi0 for gamma-gamma inv.mass construction \n") ; - printf("Number of bins in Centrality: %d \n",fNCentrBin) ; - printf("Number of bins in Z vert. pos: %d \n",fNZvertBin) ; - printf("Number of bins in Reac. Plain: %d \n",fNrpBin) ; - printf("Depth of event buffer: %d \n",fNmaxMixEv) ; - printf("Number of different PID used: %d \n",fNPID) ; - printf("Cuts: \n") ; - printf("Z vertex position: -%2.3f < z < %2.3f \n",fZvtxCut,fZvtxCut) ; - printf("------------------------------------------------------\n") ; + //Print some relevant parameters set for the analysis + AliAnaPartCorrBaseClass::Print(" "); + printf("Class AliAnaPi0 for gamma-gamma inv.mass construction \n") ; + printf("Number of bins in Centrality: %d \n",fNCentrBin) ; + printf("Number of bins in Z vert. pos: %d \n",fNZvertBin) ; + printf("Number of bins in Reac. Plain: %d \n",fNrpBin) ; + printf("Depth of event buffer: %d \n",fNmaxMixEv) ; + printf("Number of different PID used: %d \n",fNPID) ; + printf("Cuts: \n") ; + printf("Z vertex position: -%2.3f < z < %2.3f \n",fZvtxCut,fZvtxCut) ; + printf("------------------------------------------------------\n") ; } //____________________________________________________________________________________________________________________________________________________ void AliAnaPi0::MakeAnalysisFillHistograms() { - //Process one event and extract photons from AOD branch - // filled with AliAnaPhoton and fill histos with invariant mass - - //Apply some cuts on event: vertex position and centrality range - Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ; - if(IsBadRun(iRun)) return ; - - Double_t vert[]={0,0,0} ; //vertex ; - GetReader()->GetVertex(vert); - if(vert[2]<-fZvtxCut || vert[2]> fZvtxCut) return ; //Event can not be used (vertex, centrality,... cuts not fulfilled) - - //Get Centrality and calculate centrality bin - //Does not exist in ESD yet??????? - Int_t curCentrBin=0 ; - - //Get Reaction Plain position and calculate RP bin - //does not exist in ESD yet???? - Int_t curRPBin=0 ; - - Int_t curZvertBin=(Int_t)(0.5*fNZvertBin*(vert[2]+fZvtxCut)/fZvtxCut) ; - - fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ; - - Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ; - if(GetDebug() > 1) printf("AliAnaPi0::FillHistos: photon entries %d\n", nPhot); + //Process one event and extract photons from AOD branch + // filled with AliAnaPhoton and fill histos with invariant mass + + //Apply some cuts on event: vertex position and centrality range + Int_t iRun=(GetReader()->GetInputEvent())->GetRunNumber() ; + if(IsBadRun(iRun)) return ; + + Double_t vert[]={0,0,0} ; //vertex ; + GetReader()->GetVertex(vert); + if(vert[2]<-fZvtxCut || vert[2]> fZvtxCut) return ; //Event can not be used (vertex, centrality,... cuts not fulfilled) + + //Get Centrality and calculate centrality bin + //Does not exist in ESD yet??????? + Int_t curCentrBin=0 ; + + //Get Reaction Plain position and calculate RP bin + //does not exist in ESD yet???? + Int_t curRPBin=0 ; + + Int_t curZvertBin=(Int_t)(0.5*fNZvertBin*(vert[2]+fZvtxCut)/fZvtxCut) ; + + fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ; + + Int_t nPhot = GetInputAODBranch()->GetEntriesFast() ; + if(GetDebug() > 1) printf("AliAnaPi0::FillHistos: photon entries %d\n", nPhot); + + for(Int_t i1=0; i1At(i1)) ; + TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); + for(Int_t i2=i1+1; i2At(i2)) ; + TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); + Double_t m = (photon1 + photon2).M() ; + Double_t pt = (photon1 + photon2).Pt(); + Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; + if(GetDebug() > 2) + printf("AliAnaPi0::FillHistos: Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", + p1->Pt(), p2->Pt(), pt,m,a); + for(Int_t ipid=0; ipidIsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ + fhRe1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + if(p1->DistToBad()>0 && p2->DistToBad()>0){ + fhRe2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + if(p1->DistToBad()>1 && p2->DistToBad()>1){ + fhRe3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + } + } + } + } + } + } + + //Fill mixed + + TList * evMixList=fEventsList[curCentrBin*fNZvertBin*fNrpBin+curZvertBin*fNrpBin+curRPBin] ; + Int_t nMixed = evMixList->GetSize() ; + for(Int_t ii=0; iiAt(ii)); + Int_t nPhot2=ev2->GetEntriesFast() ; + Double_t m = -999; + if(GetDebug() > 1) printf("AliAnaPi0::FillHistos: Mixed event %d photon entries %d\n", ii, nPhot); + + for(Int_t i1=0; i1At(i1)) ; + TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); + for(Int_t i2=0; i2At(i2)) ; - for(Int_t i1=0; i1At(i1)) ; - TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); - for(Int_t i2=i1+1; i2At(i2)) ; - TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); - Double_t m = (photon1 + photon2).M() ; - Double_t pt = (photon1 + photon2).Pt(); - Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; - if(GetDebug() > 2) - printf("AliAnaPi0::FillHistos: Current Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", - p1->Pt(), p2->Pt(), pt,m,a); - for(Int_t ipid=0; ipidIsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ - fhRe1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - if(p1->DistToBad()>0 && p2->DistToBad()>0){ - fhRe2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - if(p1->DistToBad()>1 && p2->DistToBad()>1){ - fhRe3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - } - } - } - } - } + TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); + m = (photon1+photon2).M() ; + Double_t pt = (photon1 + photon2).Pt(); + Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; + if(GetDebug() > 2) + printf("AliAnaPi0::FillHistos: Mixed Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", + p1->Pt(), p2->Pt(), pt,m,a); + for(Int_t ipid=0; ipidIsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ + fhMi1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + if(p1->DistToBad()>0 && p2->DistToBad()>0){ + fhMi2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + if(p1->DistToBad()>1 && p2->DistToBad()>1){ + fhMi3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; + } + + } + } } - - //Fill mixed - - TList * evMixList=fEventsList[curCentrBin*fNZvertBin*fNrpBin+curZvertBin*fNrpBin+curRPBin] ; - Int_t nMixed = evMixList->GetSize() ; - for(Int_t ii=0; iiAt(ii)); - Int_t nPhot2=ev2->GetEntriesFast() ; - Double_t m = -999; - if(GetDebug() > 1) printf("AliAnaPi0::FillHistos: Mixed event %d photon entries %d\n", ii, nPhot); - - for(Int_t i1=0; i1At(i1)) ; - TLorentzVector photon1(p1->Px(),p1->Py(),p1->Pz(),p1->E()); - for(Int_t i2=0; i2At(i2)) ; - - TLorentzVector photon2(p2->Px(),p2->Py(),p2->Pz(),p2->E()); - m = (photon1+photon2).M() ; - Double_t pt = (photon1 + photon2).Pt(); - Double_t a = TMath::Abs(p1->E()-p2->E())/(p1->E()+p2->E()) ; - if(GetDebug() > 2) - printf("AliAnaPi0::FillHistos: Mixed Event: pT: photon1 %2.2f, photon2 %2.2f; Pair: pT %2.2f, mass %2.3f, a %f2.3\n", - p1->Pt(), p2->Pt(), pt,m,a); - for(Int_t ipid=0; ipidIsPIDOK(ipid,AliCaloPID::kPhoton)) && (p2->IsPIDOK(ipid,AliCaloPID::kPhoton))){ - fhMi1[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - if(p1->DistToBad()>0 && p2->DistToBad()>0){ - fhMi2[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - if(p1->DistToBad()>1 && p2->DistToBad()>1){ - fhMi3[curCentrBin*fNPID+ipid]->Fill(pt,a,m) ; - } - - } - } - } - } - } + } + } + } + + TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch()); + //Add current event to buffer and Remove redandant events + if(currentEvent->GetEntriesFast()>0){ + evMixList->AddFirst(currentEvent) ; + currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer + if(evMixList->GetSize()>=fNmaxMixEv) + { + TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ; + evMixList->RemoveLast() ; + delete tmp ; + } + } + else{ //empty event + delete currentEvent ; + currentEvent=0 ; + } + + //Acceptance + AliStack * stack = GetMCStack(); + if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){ + for(Int_t i=0 ; iGetNprimary(); i++){ + TParticle * prim = stack->Particle(i) ; + if(prim->GetPdgCode() == 111){ + Double_t pi0Pt = prim->Pt() ; + //printf("pi0, pt %2.2f\n",pi0Pt); + if(prim->Energy() == TMath::Abs(prim->Pz())) continue ; //Protection against floating point exception + Double_t pi0Y = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ; + Double_t phi = TMath::RadToDeg()*prim->Phi() ; + if(TMath::Abs(pi0Y) < 0.5){ + fhPrimPt->Fill(pi0Pt) ; } + fhPrimY ->Fill(pi0Y) ; + fhPrimPhi->Fill(phi) ; - TClonesArray *currentEvent = new TClonesArray(*GetInputAODBranch()); - //Add current event to buffer and Remove redandant events - if(currentEvent->GetEntriesFast()>0){ - evMixList->AddFirst(currentEvent) ; - currentEvent=0 ; //Now list of particles belongs to buffer and it will be deleted with buffer - if(evMixList->GetSize()>=fNmaxMixEv) - { - TClonesArray * tmp = (TClonesArray*) (evMixList->Last()) ; - evMixList->RemoveLast() ; - delete tmp ; - } - } - else{ //empty event - delete currentEvent ; - currentEvent=0 ; - } - - //Acceptance - AliStack * stack = GetMCStack(); - if(stack && (IsDataMC() || (GetReader()->GetDataType() == AliCaloTrackReader::kMC)) ){ - for(Int_t i=0 ; iGetNprimary(); i++){ - TParticle * prim = stack->Particle(i) ; - if(prim->GetPdgCode() == 111){ - Double_t pi0Pt = prim->Pt() ; - //printf("pi0, pt %2.2f\n",pi0Pt); - Double_t pi0Y = 0.5*TMath::Log((prim->Energy()-prim->Pz())/(prim->Energy()+prim->Pz())) ; - Double_t phi = TMath::RadToDeg()*prim->Phi() ; - if(TMath::Abs(pi0Y) < 0.5){ - fhPrimPt->Fill(pi0Pt) ; - } - fhPrimY ->Fill(pi0Y) ; - fhPrimPhi->Fill(phi) ; - - //Check if both photons hit Calorimeter - Int_t iphot1=prim->GetFirstDaughter() ; - Int_t iphot2=prim->GetLastDaughter() ; - if(iphot1>-1 && iphot1GetNtrack() && iphot2>-1 && iphot2GetNtrack()){ - TParticle * phot1 = stack->Particle(iphot1) ; - TParticle * phot2 = stack->Particle(iphot2) ; - if(phot1 && phot2 && phot1->GetPdgCode()==22 && phot2->GetPdgCode()==22){ - //printf("2 photons: photon 1: pt %2.2f, phi %3.2f, eta %1.2f; photon 2: pt %2.2f, phi %3.2f, eta %1.2f\n", - // phot1->Pt(), phot1->Phi()*180./3.1415, phot1->Eta(), phot2->Pt(), phot2->Phi()*180./3.1415, phot2->Eta()); - Bool_t inacceptance = kFALSE; + //Check if both photons hit Calorimeter + Int_t iphot1=prim->GetFirstDaughter() ; + Int_t iphot2=prim->GetLastDaughter() ; + if(iphot1>-1 && iphot1GetNtrack() && iphot2>-1 && iphot2GetNtrack()){ + TParticle * phot1 = stack->Particle(iphot1) ; + TParticle * phot2 = stack->Particle(iphot2) ; + if(phot1 && phot2 && phot1->GetPdgCode()==22 && phot2->GetPdgCode()==22){ + //printf("2 photons: photon 1: pt %2.2f, phi %3.2f, eta %1.2f; photon 2: pt %2.2f, phi %3.2f, eta %1.2f\n", + // phot1->Pt(), phot1->Phi()*180./3.1415, phot1->Eta(), phot2->Pt(), phot2->Phi()*180./3.1415, phot2->Eta()); + Bool_t inacceptance = kFALSE; #ifdef __PHOSGEO__ - Int_t mod ; - Double_t x,z ; - if(fCalorimeter == "PHOS" && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x) && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x)) - inacceptance = kTRUE; - //printf("In REAL PHOS acceptance? %d\n",inacceptance); + Int_t mod ; + Double_t x,z ; + if(fCalorimeter == "PHOS" && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x) && fPHOSGeo->ImpactOnEmc(phot1,mod,z,x)) + inacceptance = kTRUE; + //printf("In REAL PHOS acceptance? %d\n",inacceptance); #else - TLorentzVector lv1, lv2; - phot1->Momentum(lv1); - phot2->Momentum(lv2); - if(GetFidutialCut()->IsInFidutialCut(lv1,fCalorimeter) && GetFidutialCut()->IsInFidutialCut(lv2,fCalorimeter)) - inacceptance = kTRUE ; - //printf("In %s fidutial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance); + TLorentzVector lv1, lv2; + phot1->Momentum(lv1); + phot2->Momentum(lv2); + if(GetFidutialCut()->IsInFidutialCut(lv1,fCalorimeter) && GetFidutialCut()->IsInFidutialCut(lv2,fCalorimeter)) + inacceptance = kTRUE ; + //printf("In %s fidutial cut acceptance? %d\n",fCalorimeter.Data(),inacceptance); #endif - if(inacceptance){ - fhPrimAccPt->Fill(pi0Pt) ; - fhPrimAccPhi->Fill(phi) ; - fhPrimAccY->Fill(pi0Y) ; - }//Accepted - }// 2 photons - }//Check daughters exist - }// Primary pi0 - }//loop on primaries - }//stack exists and data is MC - + if(inacceptance){ + fhPrimAccPt->Fill(pi0Pt) ; + fhPrimAccPhi->Fill(phi) ; + fhPrimAccY->Fill(pi0Y) ; + }//Accepted + }// 2 photons + }//Check daughters exist + }// Primary pi0 + }//loop on primaries + }//stack exists and data is MC + } - - - //____________________________________________________________________________________________________________________________________________________ void AliAnaPi0::Terminate() { //Do some calculations and plots from the final histograms. - + printf(" *** %s Terminate:", GetName()) ; if (!fhRe1) { diff --git a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx index e9d50156557..6cadfd9f661 100755 --- a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx +++ b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx @@ -1,569 +1,579 @@ -/************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes iGetEntriesFast(s hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ -/* $Id: AliAnaPi0EbE.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ - -//_________________________________________________________________________ -// Class for the analysis of high pT pi0 event by event -// Pi0 identified by one of the following: -// -Invariant mass of 2 cluster in calorimeter -// -Shower shape analysis in calorimeter -// -Invariant mass of one cluster in calorimeter and one photon reconstructed in TPC (in near future) -// -// -- Author: Gustavo Conesa (LNF-INFN) & Raphaelle Ichou (SUBATECH) -////////////////////////////////////////////////////////////////////////////// - - -// --- ROOT system --- -#include -//#include "Riostream.h" - -// --- Analysis system --- -#include "AliAnaPi0EbE.h" -#include "AliLog.h" -#include "AliCaloTrackReader.h" -#include "AliIsolationCut.h" -#include "AliNeutralMesonSelection.h" -#include "AliCaloPID.h" -#include "AliMCAnalysisUtils.h" -#include "AliAODPWG4ParticleCorrelation.h" - #include "AliStack.h" -ClassImp(AliAnaPi0EbE) - -//____________________________________________________________________________ -AliAnaPi0EbE::AliAnaPi0EbE() : -AliAnaPartCorrBaseClass(), fAnaType(kIMCalo),fCalorimeter(""), -fMinDist(0.),fMinDist2(0.),fMinDist3(0.), -fInputAODGammaConv(0x0),fInputAODGammaConvName(""), -fhPtPi0(0),fhPhiPi0(0),fhEtaPi0(0), -fhPtMCNoPi0(0),fhPhiMCNoPi0(0),fhEtaMCNoPi0(0), -fhPtMCPi0(0),fhPhiMCPi0(0),fhEtaMCPi0(0) -{ - //default ctor - - //Initialize parameters - InitParameters(); - -} - -//____________________________________________________________________________ -AliAnaPi0EbE::AliAnaPi0EbE(const AliAnaPi0EbE & p) : -AliAnaPartCorrBaseClass(p), fAnaType(p.fAnaType), fCalorimeter(p.fCalorimeter), -fMinDist(p.fMinDist),fMinDist2(p.fMinDist2), fMinDist3(p.fMinDist3), -fInputAODGammaConv(new TClonesArray(*p.fInputAODGammaConv)), -fInputAODGammaConvName(p.fInputAODGammaConvName), -fhPtPi0(p.fhPtPi0),fhPhiPi0(p.fhPhiPi0),fhEtaPi0(p.fhEtaPi0), -fhPtMCNoPi0(p.fhPtMCNoPi0),fhPhiMCNoPi0(p.fhPhiMCNoPi0),fhEtaMCNoPi0(p.fhEtaMCNoPi0), -fhPtMCPi0(p.fhPtMCPi0),fhPhiMCPi0(p.fhPhiMCPi0),fhEtaMCPi0(p.fhEtaMCPi0) -{ - // cpy ctor -} - -//_________________________________________________________________________ -AliAnaPi0EbE & AliAnaPi0EbE::operator = (const AliAnaPi0EbE & p) -{ - // assignment operator - - if(&p == this) return *this; - - fAnaType = p.fAnaType ; - fCalorimeter = p.fCalorimeter ; - fMinDist = p.fMinDist; - fMinDist2 = p.fMinDist2; - fMinDist3 = p.fMinDist3; - - fInputAODGammaConv = new TClonesArray(*p.fInputAODGammaConv) ; - fInputAODGammaConvName = p.fInputAODGammaConvName ; - - fhPtPi0 = p.fhPtPi0; fhPhiPi0 = p.fhPhiPi0; fhEtaPi0 = p.fhEtaPi0; - fhPtMCNoPi0 = p.fhPtMCNoPi0; fhPhiMCNoPi0 = p.fhPhiMCNoPi0; fhEtaMCNoPi0 = p.fhEtaMCPi0; - fhPtMCPi0 = p.fhPtMCPi0; fhPhiMCPi0 = p.fhPhiMCPi0; fhEtaMCPi0 = p.fhEtaMCPi0; - - return *this; - -} - -//____________________________________________________________________________ -AliAnaPi0EbE::~AliAnaPi0EbE() -{ - //dtor - if(fInputAODGammaConv){ - fInputAODGammaConv->Clear() ; - delete fInputAODGammaConv ; - } -} - -//________________________________________________________________________ -TList * AliAnaPi0EbE::GetCreateOutputObjects() -{ - // Create histograms to be saved in output file and - // store them in outputContainer - TList * outputContainer = new TList() ; - outputContainer->SetName("Pi0EbEHistos") ; - - Int_t nptbins = GetHistoNPtBins(); - Int_t nphibins = GetHistoNPhiBins(); - Int_t netabins = GetHistoNEtaBins(); - Float_t ptmax = GetHistoPtMax(); - Float_t phimax = GetHistoPhiMax(); - Float_t etamax = GetHistoEtaMax(); - Float_t ptmin = GetHistoPtMin(); - Float_t phimin = GetHistoPhiMin(); - Float_t etamin = GetHistoEtaMin(); - - fhPtPi0 = new TH1F("hPtPi0","Number of identified #pi^{0} decay",nptbins,ptmin,ptmax); - fhPtPi0->SetYTitle("N"); - fhPtPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); - outputContainer->Add(fhPtPi0) ; - - fhPhiPi0 = new TH2F - ("hPhiPi0","#phi_{#pi^{0}}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiPi0->SetYTitle("#phi"); - fhPhiPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhPhiPi0) ; - - fhEtaPi0 = new TH2F - ("hEtaPi0","#phi_{#pi^{0}}",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaPi0->SetYTitle("#eta"); - fhEtaPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhEtaPi0) ; - - if(IsDataMC()) { - if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || - GetReader()->GetDataType() != AliCaloTrackReader::kMC){ - - fhPtMCPi0 = new TH1F("hPtMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax); - fhPtMCPi0->SetYTitle("N"); - fhPtMCPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); - outputContainer->Add(fhPtMCPi0) ; - - fhPhiMCPi0 = new TH2F - ("hPhiMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiMCPi0->SetYTitle("#phi"); - fhPhiMCPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhPhiMCPi0) ; - - fhEtaMCPi0 = new TH2F - ("hEtaMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaMCPi0->SetYTitle("#eta"); - fhEtaMCPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhEtaMCPi0) ; - - fhPtMCNoPi0 = new TH1F("hPtMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax); - fhPtMCNoPi0->SetYTitle("N"); - fhPtMCNoPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); - outputContainer->Add(fhPtMCNoPi0) ; - - fhPhiMCNoPi0 = new TH2F - ("hPhiMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax,nphibins,phimin,phimax); - fhPhiMCNoPi0->SetYTitle("#phi"); - fhPhiMCNoPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhPhiMCNoPi0) ; - - fhEtaMCNoPi0 = new TH2F - ("hEtaMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax,netabins,etamin,etamax); - fhEtaMCNoPi0->SetYTitle("#eta"); - fhEtaMCNoPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); - outputContainer->Add(fhEtaMCNoPi0) ; - - } - }//Histos with MC - - - //Keep neutral meson selection histograms if requiered - //Setting done in AliNeutralMesonSelection - - if(fAnaType!=kSSCalo && GetNeutralMesonSelection()){ - - TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; - if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) - for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; - } - - //Save parameters used for analysis - TString parList ; //this will be list of parameters used for this analysis. - char onePar[255] ; - - sprintf(onePar,"--- AliAnaPi0EbE ---\n") ; - parList+=onePar ; - sprintf(onePar,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ; - parList+=onePar ; - - if(fAnaType == kSSCalo){ - sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; - parList+=onePar ; - sprintf(onePar,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ; - parList+=onePar ; - sprintf(onePar,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ; - parList+=onePar ; - sprintf(onePar,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ; - parList+=onePar ; - } - - //Get parameters set in base class. - parList += GetBaseParametersList() ; - - //Get parameters set in PID class. - if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ; - - TObjString *oString= new TObjString(parList) ; - outputContainer->Add(oString); - - return outputContainer ; - -} - -//__________________________________________________________________ -void AliAnaPi0EbE::MakeAnalysisFillAOD() -{ - //Do analysis and fill aods - - switch(fAnaType) - { - case kIMCalo: - MakeInvMassInCalorimeter(); - break; - - case kSSCalo: - MakeShowerShapeIdentification(); - break; - - case kIMCaloTracks: - MakeInvMassInCalorimeterAndCTS(); - break; - - } -} - -//__________________________________________________________________ -void AliAnaPi0EbE::MakeInvMassInCalorimeter() -{ - //Do analysis and fill aods - //Search for the photon decay in calorimeters - //Read photon list from AOD, produced in class AliAnaPhoton - //Check if 2 photons have the mass of the pi0. - - TLorentzVector mom1; - TLorentzVector mom2; - TLorentzVector mom ; - Int_t tag1 =-1; - Int_t tag2 =-1; - Int_t tag = -1; - - if(!GetInputAODBranch()) - AliFatal(Form("MakeInvMassInCalo: No input calo photons in AOD with name branch < %s > \n",GetInputAODName().Data())); - - for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){ - AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton)); - mom1 = *(photon1->Momentum()); - - - for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast()-1; jphoton++){ - - AliAODPWG4ParticleCorrelation * photon2 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(jphoton)); - mom2 = *(photon2->Momentum()); - - //Select good pair (good phi, pt cuts, aperture and invariant mass) - if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)) - { - if(GetDebug()>1) - printf("AliAnaPi0EbE::kIMCalo::Selected gamma pair: pt %f, phi %f, eta%f \n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); - - //Play with the MC stack if available - if(IsDataMC()){ - //Check origin of the candidates - tag1 = GetMCAnalysisUtils()->CheckOrigin(photon1->GetLabel(), GetMCStack()); - tag2 = GetMCAnalysisUtils()->CheckOrigin(photon2->GetLabel(), GetMCStack()); - - if(GetDebug() > 0) printf("AliAnaPi0EbE::kIMCalo::Origin of: photon1 %d; photon2 %d \n",tag1, tag2); - if(tag1 == AliMCAnalysisUtils::kMCPi0Decay && tag2 == AliMCAnalysisUtils::kMCPi0Decay){ - - //Check if pi0 mother is the same - Int_t label1 = photon1->GetLabel(); - TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree - label1 = mother1->GetFirstMother(); - //mother1 = GetMCStack()->Particle(label1);//pi0 - - Int_t label2 = photon2->GetLabel(); - TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree - label2 = mother2->GetFirstMother(); - //mother2 = GetMCStack()->Particle(label2);//pi0 - - //printf("mother1 %d, mother2 %d\n",label1,label2); - if(label1 == label2) - tag = AliMCAnalysisUtils::kMCPi0; - } - }//Work with stack also - - //Create AOD for analysis - mom = mom1+mom2; - AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom); - //pi0.SetLabel(calo->GetLabel(0)); - pi0.SetPdg(AliCaloPID::kPi0); - pi0.SetDetector(photon1->GetDetector()); - pi0.SetTag(tag); - //Set the indeces of the original caloclusters - pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0)); - AddAODParticle(pi0); - }//pi0 - }//2n photon loop - - }//1st photon loop - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCalo::End fill AODs \n"); - -} - -//__________________________________________________________________ -void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() -{ - //Do analysis and fill aods - //Search for the photon decay in calorimeters - //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion - //Check if 2 photons have the mass of the pi0. - - TLorentzVector mom1; - TLorentzVector mom2; - TLorentzVector mom ; - Int_t tag1 =-1; - Int_t tag2 =-1; - Int_t tag = -1; - - if(!GetInputAODBranch()) - AliFatal(Form("MakeInvMassInCalo: No input calo photons in AOD branch with name < %s > \n",GetInputAODName().Data())); - - for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){ - AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton)); - mom1 = *(photon1->Momentum()); - - //Play with the MC stack if available - fInputAODGammaConv = (TClonesArray *) GetReader()->GetAOD()->FindListObject(fInputAODGammaConvName); - if(!fInputAODGammaConv) - AliFatal(Form("MakeInvMassInCaloAndCTS: No input gamma conversions in AOD branch with name < %s >",fInputAODGammaConvName.Data())); - - for(Int_t jphoton = iphoton+1; jphoton < fInputAODGammaConv->GetEntriesFast()-1; jphoton++){ - AliAODPWG4ParticleCorrelation * photon2 = (AliAODPWG4ParticleCorrelation*) (fInputAODGammaConv->At(jphoton)); - mom2 = *(photon2->Momentum()); - //Select good pair (good phi, pt cuts, aperture and invariant mass) - if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)){ - if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCaloCTS::Selected gamma pair: pt %f, phi %f, eta%f\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); - - if(IsDataMC()){ - //Check origin of the candidates - tag1 = GetMCAnalysisUtils()->CheckOrigin(photon1->GetLabel(), GetMCStack()); - tag2 = GetMCAnalysisUtils()->CheckOrigin(photon2->GetLabel(), GetMCStack()); - if(GetDebug() > 0) printf("AliAnaPi0EbE::kIMCaloCTS::Origin of: photon1 %d; photon2 %d \n",tag1, tag2); - if(tag1 == AliMCAnalysisUtils::kMCPi0Decay && tag2 == AliMCAnalysisUtils::kMCPi0Decay){ - //Check if pi0 mother is the same - Int_t label1 = photon1->GetLabel(); - TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree - label1 = mother1->GetFirstMother(); - //mother1 = GetMCStack()->Particle(label1);//pi0 - - Int_t label2 = photon2->GetLabel(); - TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree - label2 = mother2->GetFirstMother(); - //mother2 = GetMCStack()->Particle(label2);//pi0 - - //printf("mother1 %d, mother2 %d\n",label1,label2); - if(label1 == label2) - tag = AliMCAnalysisUtils::kMCPi0; - } - }//Work with stack also - - //Create AOD for analysis - mom = mom1+mom2; - AliAODPWG4ParticleCorrelation pi0 = AliAODPWG4ParticleCorrelation(mom); - //pi0.SetLabel(calo->GetLabel(0)); - pi0.SetPdg(AliCaloPID::kPi0); - pi0.SetDetector(photon1->GetDetector()); - pi0.SetTag(tag); - //Set the indeces of the original tracks or caloclusters - pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1); - pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1)); - AddAODParticle(pi0); - }//pi0 - }//2n photon loop - - }//1st photon loop - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCaloCTS::End fill AODs \n"); - -} - - -//__________________________________________________________________ -void AliAnaPi0EbE::MakeShowerShapeIdentification() -{ - //Search for pi0 in fCalorimeter with shower shape analysis - - TClonesArray * pl = new TClonesArray; - - //Get vertex for photon momentum calculation - Double_t vertex[]={0,0,0} ; //vertex ; - if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); - - //Select the Calorimeter of the photon - if(fCalorimeter == "PHOS") - pl = GetAODPHOS(); - else if (fCalorimeter == "EMCAL") - pl = GetAODEMCAL(); - //Fill AODCaloClusters and AODParticle with PHOS aods - TLorentzVector mom ; - for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ - AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); - - //Cluster selection, not charged, with pi0 id and in fidutial cut - //Get Momentum vector, - calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line - //If too small or big pt, skip it - if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; - //Check acceptance selection - if(IsFidutialCutOn()){ - Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ; - if(! in ) continue ; - } - - //Create AOD for analysis - AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom); - aodpi0.SetLabel(calo->GetLabel(0)); - //Set the indeces of the original caloclusters - aodpi0.SetCaloLabel(calo->GetID(),-1); - aodpi0.SetDetector(fCalorimeter); - if(GetDebug() > 1) - printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Min pt cut and fidutial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodpi0.Pt(),aodpi0.Phi(),aodpi0.Eta()); - - //Check Distance to Bad channel, set bit. - Double_t distBad=calo->GetDistToBadChannel() ; //Distance to bad channel - if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ; - if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm) - continue ; - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Bad channel cut passed %4.2f\n",distBad); - - if(distBad > fMinDist3) aodpi0.SetDistToBad(2) ; - else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ; - else aodpi0.SetDistToBad(0) ; - - //Check PID - //PID selection or bit setting - if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){ - //Get most probable PID, check PID weights (in MC this option is mandatory) - aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights - if(GetDebug() > 1) - printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PDG of identified particle %d\n",aodpi0.GetPdg()); - //If primary is not pi0, skip it. - if(aodpi0.GetPdg() != AliCaloPID::kPi0) continue ; - } - else if(IsCaloPIDOn()){ - //Skip matched clusters with tracks - if(calo->GetNTracksMatched() > 0) continue ; - - //Get most probable PID, 2 options check PID weights - //or redo PID, recommended option for EMCal. - if(!IsCaloPIDRecalculationOn()) - aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights - else - aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PDG of identified particle %d\n",aodpi0.GetPdg()); - - //If cluster does not pass pid, not pi0, skip it. - if(aodpi0.GetPdg() != AliCaloPID::kPi0) continue ; - - } - else{ - //Set PID bits for later selection (AliAnaPi0 for example) - //GetPDG already called in SetPIDBits. - GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodpi0); - if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PID Bits set \n"); - } - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Pi0 selection cuts passed: pT %3.2f, pdg %d\n",aodpi0.Pt(), aodpi0.GetPdg()); - - //Play with the MC stack if available - //Check origin of the candidates - if(IsDataMC()){ - if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || - GetReader()->GetDataType() != AliCaloTrackReader::kMC){ - aodpi0.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack())); - if(GetDebug() > 0) printf("AliAnaPi0EbE::kSSCalo::EbE::FillAOD: Origin of candidate %d\n",aodpi0.GetTag()); - } - }//Work with stack also - - //Add AOD with pi0 object to aod branch - AddAODParticle(aodpi0); - - }//loop - - if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: End fill AODs \n"); - -} -//__________________________________________________________________ -void AliAnaPi0EbE::MakeAnalysisFillHistograms() -{ - //Do analysis and fill histograms - - if(!GetOutputAODBranch()) - AliFatal(Form("MakeInvMassInCalo: No output pi0 in AOD branch with name < %s > \n",GetOutputAODName().Data())); - - //Loop on stored AOD pi0 - Int_t naod = GetOutputAODBranch()->GetEntriesFast(); - if(GetDebug() > 0) printf("AliAnaPi0EbE::Histo::pi0 aod branch entries %d\n", naod); - - for(Int_t iaod = 0; iaod < naod ; iaod++){ - - AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); - Int_t pdg = pi0->GetPdg(); - - if(pdg != AliCaloPID::kPi0) continue; - - //Fill pi0 histograms - Float_t pt = pi0->Pt(); - Float_t phi = pi0->Phi(); - Float_t eta = pi0->Eta(); - - - fhPtPi0 ->Fill(pt); - fhPhiPi0 ->Fill(pt,phi); - fhEtaPi0 ->Fill(pt,eta); - - if(IsDataMC()){ - if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || - GetReader()->GetDataType() != AliCaloTrackReader::kMC){ - if(pi0->GetTag()== AliMCAnalysisUtils::kMCPi0){ - fhPtMCPi0 ->Fill(pt); - fhPhiMCPi0 ->Fill(pt,phi); - fhEtaMCPi0 ->Fill(pt,eta); - } - else{ - fhPtMCNoPi0 ->Fill(pt); - fhPhiMCNoPi0 ->Fill(pt,phi); - fhEtaMCNoPi0 ->Fill(pt,eta); - } - } - }//Histograms with MC - - }// aod loop - -} - - +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes iGetEntriesFast(s hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ +/* $Id: AliAnaPi0EbE.cxx 28688 2008-09-11 15:04:07Z gconesab $ */ + +//_________________________________________________________________________ +// Class for the analysis of high pT pi0 event by event +// Pi0 identified by one of the following: +// -Invariant mass of 2 cluster in calorimeter +// -Shower shape analysis in calorimeter +// -Invariant mass of one cluster in calorimeter and one photon reconstructed in TPC (in near future) +// +// -- Author: Gustavo Conesa (LNF-INFN) & Raphaelle Ichou (SUBATECH) +////////////////////////////////////////////////////////////////////////////// + + +// --- ROOT system --- +#include +#include +#include +#include +//#include "Riostream.h" + +// --- Analysis system --- +#include "AliAnaPi0EbE.h" +#include "AliCaloTrackReader.h" +#include "AliIsolationCut.h" +#include "AliNeutralMesonSelection.h" +#include "AliCaloPID.h" +#include "AliMCAnalysisUtils.h" +#include "AliAODPWG4ParticleCorrelation.h" +#include "AliStack.h" +#include "AliFidutialCut.h" +#include "TParticle.h" +#include "AliAODCaloCluster.h" +#include "AliAODEvent.h" + +ClassImp(AliAnaPi0EbE) + //____________________________________________________________________________ -void AliAnaPi0EbE::Init() +AliAnaPi0EbE::AliAnaPi0EbE() : +AliAnaPartCorrBaseClass(), fAnaType(kIMCalo),fCalorimeter(""), +fMinDist(0.),fMinDist2(0.),fMinDist3(0.), +fInputAODGammaConv(0x0),fInputAODGammaConvName(""), +fhPtPi0(0),fhPhiPi0(0),fhEtaPi0(0), +fhPtMCNoPi0(0),fhPhiMCNoPi0(0),fhEtaMCNoPi0(0), +fhPtMCPi0(0),fhPhiMCPi0(0),fhEtaMCPi0(0) +{ + //default ctor + + //Initialize parameters + InitParameters(); + +} + +//____________________________________________________________________________ +AliAnaPi0EbE::AliAnaPi0EbE(const AliAnaPi0EbE & p) : +AliAnaPartCorrBaseClass(p), fAnaType(p.fAnaType), fCalorimeter(p.fCalorimeter), +fMinDist(p.fMinDist),fMinDist2(p.fMinDist2), fMinDist3(p.fMinDist3), +fInputAODGammaConv(new TClonesArray(*p.fInputAODGammaConv)), +fInputAODGammaConvName(p.fInputAODGammaConvName), +fhPtPi0(p.fhPtPi0),fhPhiPi0(p.fhPhiPi0),fhEtaPi0(p.fhEtaPi0), +fhPtMCNoPi0(p.fhPtMCNoPi0),fhPhiMCNoPi0(p.fhPhiMCNoPi0),fhEtaMCNoPi0(p.fhEtaMCNoPi0), +fhPtMCPi0(p.fhPtMCPi0),fhPhiMCPi0(p.fhPhiMCPi0),fhEtaMCPi0(p.fhEtaMCPi0) +{ + // cpy ctor +} + +//_________________________________________________________________________ +AliAnaPi0EbE & AliAnaPi0EbE::operator = (const AliAnaPi0EbE & p) +{ + // assignment operator + + if(&p == this) return *this; + + fAnaType = p.fAnaType ; + fCalorimeter = p.fCalorimeter ; + fMinDist = p.fMinDist; + fMinDist2 = p.fMinDist2; + fMinDist3 = p.fMinDist3; + + fInputAODGammaConv = new TClonesArray(*p.fInputAODGammaConv) ; + fInputAODGammaConvName = p.fInputAODGammaConvName ; + + fhPtPi0 = p.fhPtPi0; fhPhiPi0 = p.fhPhiPi0; fhEtaPi0 = p.fhEtaPi0; + fhPtMCNoPi0 = p.fhPtMCNoPi0; fhPhiMCNoPi0 = p.fhPhiMCNoPi0; fhEtaMCNoPi0 = p.fhEtaMCPi0; + fhPtMCPi0 = p.fhPtMCPi0; fhPhiMCPi0 = p.fhPhiMCPi0; fhEtaMCPi0 = p.fhEtaMCPi0; + + return *this; + +} + +//____________________________________________________________________________ +AliAnaPi0EbE::~AliAnaPi0EbE() +{ + //dtor + if(fInputAODGammaConv){ + fInputAODGammaConv->Clear() ; + delete fInputAODGammaConv ; + } +} + +//________________________________________________________________________ +TList * AliAnaPi0EbE::GetCreateOutputObjects() +{ + // Create histograms to be saved in output file and + // store them in outputContainer + TList * outputContainer = new TList() ; + outputContainer->SetName("Pi0EbEHistos") ; + + Int_t nptbins = GetHistoNPtBins(); + Int_t nphibins = GetHistoNPhiBins(); + Int_t netabins = GetHistoNEtaBins(); + Float_t ptmax = GetHistoPtMax(); + Float_t phimax = GetHistoPhiMax(); + Float_t etamax = GetHistoEtaMax(); + Float_t ptmin = GetHistoPtMin(); + Float_t phimin = GetHistoPhiMin(); + Float_t etamin = GetHistoEtaMin(); + + fhPtPi0 = new TH1F("hPtPi0","Number of identified #pi^{0} decay",nptbins,ptmin,ptmax); + fhPtPi0->SetYTitle("N"); + fhPtPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); + outputContainer->Add(fhPtPi0) ; + + fhPhiPi0 = new TH2F + ("hPhiPi0","#phi_{#pi^{0}}",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiPi0->SetYTitle("#phi"); + fhPhiPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhPhiPi0) ; + + fhEtaPi0 = new TH2F + ("hEtaPi0","#phi_{#pi^{0}}",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaPi0->SetYTitle("#eta"); + fhEtaPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhEtaPi0) ; + + if(IsDataMC()) { + if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || + GetReader()->GetDataType() != AliCaloTrackReader::kMC){ + + fhPtMCPi0 = new TH1F("hPtMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax); + fhPtMCPi0->SetYTitle("N"); + fhPtMCPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); + outputContainer->Add(fhPtMCPi0) ; + + fhPhiMCPi0 = new TH2F + ("hPhiMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiMCPi0->SetYTitle("#phi"); + fhPhiMCPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhPhiMCPi0) ; + + fhEtaMCPi0 = new TH2F + ("hEtaMCPi0","Identified pi0 from pi0",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaMCPi0->SetYTitle("#eta"); + fhEtaMCPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhEtaMCPi0) ; + + fhPtMCNoPi0 = new TH1F("hPtMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax); + fhPtMCNoPi0->SetYTitle("N"); + fhPtMCNoPi0->SetXTitle("p_{T #pi^{0}}(GeV/c)"); + outputContainer->Add(fhPtMCNoPi0) ; + + fhPhiMCNoPi0 = new TH2F + ("hPhiMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax,nphibins,phimin,phimax); + fhPhiMCNoPi0->SetYTitle("#phi"); + fhPhiMCNoPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhPhiMCNoPi0) ; + + fhEtaMCNoPi0 = new TH2F + ("hEtaMCNoPi0","Identified pi0 not from pi0",nptbins,ptmin,ptmax,netabins,etamin,etamax); + fhEtaMCNoPi0->SetYTitle("#eta"); + fhEtaMCNoPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); + outputContainer->Add(fhEtaMCNoPi0) ; + + } + }//Histos with MC + + + //Keep neutral meson selection histograms if requiered + //Setting done in AliNeutralMesonSelection + + if(fAnaType!=kSSCalo && GetNeutralMesonSelection()){ + + TList * nmsHistos = GetNeutralMesonSelection()->GetCreateOutputObjects() ; + if(GetNeutralMesonSelection()->AreNeutralMesonSelectionHistosKept()) + for(Int_t i = 0; i < nmsHistos->GetEntries(); i++) outputContainer->Add(nmsHistos->At(i)) ; + } + + //Save parameters used for analysis + TString parList ; //this will be list of parameters used for this analysis. + char onePar[255] ; + + sprintf(onePar,"--- AliAnaPi0EbE ---\n") ; + parList+=onePar ; + sprintf(onePar,"fAnaType=%d (Pi0 selection type) \n",fAnaType) ; + parList+=onePar ; + + if(fAnaType == kSSCalo){ + sprintf(onePar,"Calorimeter: %s\n",fCalorimeter.Data()) ; + parList+=onePar ; + sprintf(onePar,"fMinDist =%2.2f (Minimal distance to bad channel to accept cluster) \n",fMinDist) ; + parList+=onePar ; + sprintf(onePar,"fMinDist2=%2.2f (Cuts on Minimal distance to study acceptance evaluation) \n",fMinDist2) ; + parList+=onePar ; + sprintf(onePar,"fMinDist3=%2.2f (One more cut on distance used for acceptance-efficiency study) \n",fMinDist3) ; + parList+=onePar ; + } + + //Get parameters set in base class. + parList += GetBaseParametersList() ; + + //Get parameters set in PID class. + if(fAnaType == kSSCalo) parList += GetCaloPID()->GetPIDParametersList() ; + + TObjString *oString= new TObjString(parList) ; + outputContainer->Add(oString); + + return outputContainer ; + +} + +//__________________________________________________________________ +void AliAnaPi0EbE::MakeAnalysisFillAOD() +{ + //Do analysis and fill aods + + switch(fAnaType) + { + case kIMCalo: + MakeInvMassInCalorimeter(); + break; + + case kSSCalo: + MakeShowerShapeIdentification(); + break; + + case kIMCaloTracks: + MakeInvMassInCalorimeterAndCTS(); + break; + + } +} + +//__________________________________________________________________ +void AliAnaPi0EbE::MakeInvMassInCalorimeter() +{ + //Do analysis and fill aods + //Search for the photon decay in calorimeters + //Read photon list from AOD, produced in class AliAnaPhoton + //Check if 2 photons have the mass of the pi0. + + TLorentzVector mom1; + TLorentzVector mom2; + TLorentzVector mom ; + Int_t tag1 =-1; + Int_t tag2 =-1; + Int_t tag = -1; + + if(!GetInputAODBranch()){ + printf("AliAnaPi0EbE::kIMCalo:: No input calo photons in AOD with name branch < %s >, STOP \n",GetInputAODName().Data()); + abort(); + } + for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){ + AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton)); + mom1 = *(photon1->Momentum()); + + + for(Int_t jphoton = iphoton+1; jphoton < GetInputAODBranch()->GetEntriesFast()-1; jphoton++){ + + AliAODPWG4ParticleCorrelation * photon2 = (AliAODPWG4ParticleCorrelation*) (GetInputAODBranch()->At(jphoton)); + mom2 = *(photon2->Momentum()); + + //Select good pair (good phi, pt cuts, aperture and invariant mass) + if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)) + { + if(GetDebug()>1) + printf("AliAnaPi0EbE::kIMCalo::Selected gamma pair: pt %f, phi %f, eta%f \n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); + + //Play with the MC stack if available + if(IsDataMC()){ + //Check origin of the candidates + tag1 = GetMCAnalysisUtils()->CheckOrigin(photon1->GetLabel(), GetMCStack()); + tag2 = GetMCAnalysisUtils()->CheckOrigin(photon2->GetLabel(), GetMCStack()); + + if(GetDebug() > 0) printf("AliAnaPi0EbE::kIMCalo::Origin of: photon1 %d; photon2 %d \n",tag1, tag2); + if(tag1 == AliMCAnalysisUtils::kMCPi0Decay && tag2 == AliMCAnalysisUtils::kMCPi0Decay){ + + //Check if pi0 mother is the same + Int_t label1 = photon1->GetLabel(); + TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree + label1 = mother1->GetFirstMother(); + //mother1 = GetMCStack()->Particle(label1);//pi0 + + Int_t label2 = photon2->GetLabel(); + TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree + label2 = mother2->GetFirstMother(); + //mother2 = GetMCStack()->Particle(label2);//pi0 + + //printf("mother1 %d, mother2 %d\n",label1,label2); + if(label1 == label2) + tag = AliMCAnalysisUtils::kMCPi0; + } + }//Work with stack also + + //Create AOD for analysis + mom = mom1+mom2; + AliAODPWG4Particle pi0 = AliAODPWG4Particle(mom); + //pi0.SetLabel(calo->GetLabel(0)); + pi0.SetPdg(AliCaloPID::kPi0); + pi0.SetDetector(photon1->GetDetector()); + pi0.SetTag(tag); + //Set the indeces of the original caloclusters + pi0.SetCaloLabel(photon1->GetCaloLabel(0), photon2->GetCaloLabel(0)); + AddAODParticle(pi0); + }//pi0 + }//2n photon loop + + }//1st photon loop + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCalo::End fill AODs \n"); + +} + +//__________________________________________________________________ +void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() +{ + //Do analysis and fill aods + //Search for the photon decay in calorimeters + //Read photon list from AOD, produced in class AliAnaPhoton and AliGammaConversion + //Check if 2 photons have the mass of the pi0. + + TLorentzVector mom1; + TLorentzVector mom2; + TLorentzVector mom ; + Int_t tag1 =-1; + Int_t tag2 =-1; + Int_t tag = -1; + + if(!GetInputAODBranch()){ + printf("AliAnaPi0EbE::kIMCaloCTS: No input calo photons in AOD branch with name < %s > , STOP\n",GetInputAODName().Data()); + abort(); + } + for(Int_t iphoton = 0; iphoton < GetInputAODBranch()->GetEntriesFast(); iphoton++){ + AliAODPWG4Particle * photon1 = (AliAODPWG4Particle*) (GetInputAODBranch()->At(iphoton)); + mom1 = *(photon1->Momentum()); + + //Play with the MC stack if available + fInputAODGammaConv = (TClonesArray *) GetReader()->GetOutputEvent()->FindListObject(fInputAODGammaConvName); + if(!fInputAODGammaConv) { + printf("AliAnaPi0EbE::kIMCaloCTS: No input gamma conversions in AOD branch with name < %s >, STOP",fInputAODGammaConvName.Data()); + abort(); + } + for(Int_t jphoton = iphoton+1; jphoton < fInputAODGammaConv->GetEntriesFast()-1; jphoton++){ + AliAODPWG4ParticleCorrelation * photon2 = (AliAODPWG4ParticleCorrelation*) (fInputAODGammaConv->At(jphoton)); + mom2 = *(photon2->Momentum()); + //Select good pair (good phi, pt cuts, aperture and invariant mass) + if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)){ + if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCaloCTS::Selected gamma pair: pt %f, phi %f, eta%f\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); + + if(IsDataMC()){ + //Check origin of the candidates + tag1 = GetMCAnalysisUtils()->CheckOrigin(photon1->GetLabel(), GetMCStack()); + tag2 = GetMCAnalysisUtils()->CheckOrigin(photon2->GetLabel(), GetMCStack()); + if(GetDebug() > 0) printf("AliAnaPi0EbE::kIMCaloCTS::Origin of: photon1 %d; photon2 %d \n",tag1, tag2); + if(tag1 == AliMCAnalysisUtils::kMCPi0Decay && tag2 == AliMCAnalysisUtils::kMCPi0Decay){ + //Check if pi0 mother is the same + Int_t label1 = photon1->GetLabel(); + TParticle * mother1 = GetMCStack()->Particle(label1);//photon in kine tree + label1 = mother1->GetFirstMother(); + //mother1 = GetMCStack()->Particle(label1);//pi0 + + Int_t label2 = photon2->GetLabel(); + TParticle * mother2 = GetMCStack()->Particle(label2);//photon in kine tree + label2 = mother2->GetFirstMother(); + //mother2 = GetMCStack()->Particle(label2);//pi0 + + //printf("mother1 %d, mother2 %d\n",label1,label2); + if(label1 == label2) + tag = AliMCAnalysisUtils::kMCPi0; + } + }//Work with stack also + + //Create AOD for analysis + mom = mom1+mom2; + AliAODPWG4ParticleCorrelation pi0 = AliAODPWG4ParticleCorrelation(mom); + //pi0.SetLabel(calo->GetLabel(0)); + pi0.SetPdg(AliCaloPID::kPi0); + pi0.SetDetector(photon1->GetDetector()); + pi0.SetTag(tag); + //Set the indeces of the original tracks or caloclusters + pi0.SetCaloLabel(photon1->GetCaloLabel(0), -1); + pi0.SetTrackLabel(photon2->GetTrackLabel(0), photon2->GetTrackLabel(1)); + AddAODParticle(pi0); + }//pi0 + }//2n photon loop + + }//1st photon loop + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCaloCTS::End fill AODs \n"); + +} + + +//__________________________________________________________________ +void AliAnaPi0EbE::MakeShowerShapeIdentification() +{ + //Search for pi0 in fCalorimeter with shower shape analysis + + TRefArray * pl = new TRefArray; + + //Get vertex for photon momentum calculation + Double_t vertex[]={0,0,0} ; //vertex ; + if(!GetReader()->GetDataType()== AliCaloTrackReader::kMC) GetReader()->GetVertex(vertex); + + //Select the Calorimeter of the photon + if(fCalorimeter == "PHOS") + pl = GetAODPHOS(); + else if (fCalorimeter == "EMCAL") + pl = GetAODEMCAL(); + //Fill AODCaloClusters and AODParticle with PHOS aods + TLorentzVector mom ; + for(Int_t icalo = 0; icalo < pl->GetEntriesFast(); icalo++){ + AliAODCaloCluster * calo = (AliAODCaloCluster*) (pl->At(icalo)); + + //Cluster selection, not charged, with pi0 id and in fidutial cut + //Get Momentum vector, + calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line + //If too small or big pt, skip it + if(mom.Pt() < GetMinPt() || mom.Pt() > GetMaxPt() ) continue ; + //Check acceptance selection + if(IsFidutialCutOn()){ + Bool_t in = GetFidutialCut()->IsInFidutialCut(mom,fCalorimeter) ; + if(! in ) continue ; + } + + //Create AOD for analysis + AliAODPWG4Particle aodpi0 = AliAODPWG4Particle(mom); + aodpi0.SetLabel(calo->GetLabel(0)); + //Set the indeces of the original caloclusters + aodpi0.SetCaloLabel(calo->GetID(),-1); + aodpi0.SetDetector(fCalorimeter); + if(GetDebug() > 1) + printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Min pt cut and fidutial cut passed: pt %3.2f, phi %2.2f, eta %1.2f\n",aodpi0.Pt(),aodpi0.Phi(),aodpi0.Eta()); + + //Check Distance to Bad channel, set bit. + Double_t distBad=calo->GetDistToBadChannel() ; //Distance to bad channel + if(distBad < 0.) distBad=9999. ; //workout strange convension dist = -1. ; + if(distBad < fMinDist) //In bad channel (PHOS cristal size 2.2x2.2 cm) + continue ; + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Bad channel cut passed %4.2f\n",distBad); + + if(distBad > fMinDist3) aodpi0.SetDistToBad(2) ; + else if(distBad > fMinDist2) aodpi0.SetDistToBad(1) ; + else aodpi0.SetDistToBad(0) ; + + //Check PID + //PID selection or bit setting + if(GetReader()->GetDataType() == AliCaloTrackReader::kMC){ + //Get most probable PID, check PID weights (in MC this option is mandatory) + aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights + if(GetDebug() > 1) + printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PDG of identified particle %d\n",aodpi0.GetPdg()); + //If primary is not pi0, skip it. + if(aodpi0.GetPdg() != AliCaloPID::kPi0) continue ; + } + else if(IsCaloPIDOn()){ + //Skip matched clusters with tracks + if(calo->GetNTracksMatched() > 0) continue ; + + //Get most probable PID, 2 options check PID weights + //or redo PID, recommended option for EMCal. + if(!IsCaloPIDRecalculationOn()) + aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights + else + aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PDG of identified particle %d\n",aodpi0.GetPdg()); + + //If cluster does not pass pid, not pi0, skip it. + if(aodpi0.GetPdg() != AliCaloPID::kPi0) continue ; + + } + else{ + //Set PID bits for later selection (AliAnaPi0 for example) + //GetPDG already called in SetPIDBits. + GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodpi0); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PID Bits set \n"); + } + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: Pi0 selection cuts passed: pT %3.2f, pdg %d\n",aodpi0.Pt(), aodpi0.GetPdg()); + + //Play with the MC stack if available + //Check origin of the candidates + if(IsDataMC()){ + if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || + GetReader()->GetDataType() != AliCaloTrackReader::kMC){ + aodpi0.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack())); + if(GetDebug() > 0) printf("AliAnaPi0EbE::kSSCalo::EbE::FillAOD: Origin of candidate %d\n",aodpi0.GetTag()); + } + }//Work with stack also + + //Add AOD with pi0 object to aod branch + AddAODParticle(aodpi0); + + }//loop + + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: End fill AODs \n"); + +} +//__________________________________________________________________ +void AliAnaPi0EbE::MakeAnalysisFillHistograms() { + //Do analysis and fill histograms + if(!GetOutputAODBranch()){ + printf("AliAnaPi0EbE::FillHistos - No output pi0 in AOD branch with name < %s >,STOP \n",GetOutputAODName().Data()); + abort(); + } + //Loop on stored AOD pi0 + Int_t naod = GetOutputAODBranch()->GetEntriesFast(); + if(GetDebug() > 0) printf("AliAnaPi0EbE::Histo::pi0 aod branch entries %d\n", naod); + + for(Int_t iaod = 0; iaod < naod ; iaod++){ + + AliAODPWG4Particle* pi0 = (AliAODPWG4Particle*) (GetOutputAODBranch()->At(iaod)); + Int_t pdg = pi0->GetPdg(); + + if(pdg != AliCaloPID::kPi0) continue; + + //Fill pi0 histograms + Float_t pt = pi0->Pt(); + Float_t phi = pi0->Phi(); + Float_t eta = pi0->Eta(); + + + fhPtPi0 ->Fill(pt); + fhPhiPi0 ->Fill(pt,phi); + fhEtaPi0 ->Fill(pt,eta); + + if(IsDataMC()){ + if((GetReader()->GetDataType() == AliCaloTrackReader::kMC && fAnaType!=kSSCalo) || + GetReader()->GetDataType() != AliCaloTrackReader::kMC){ + if(pi0->GetTag()== AliMCAnalysisUtils::kMCPi0){ + fhPtMCPi0 ->Fill(pt); + fhPhiMCPi0 ->Fill(pt,phi); + fhEtaMCPi0 ->Fill(pt,eta); + } + else{ + fhPtMCNoPi0 ->Fill(pt); + fhPhiMCNoPi0 ->Fill(pt,phi); + fhEtaMCNoPi0 ->Fill(pt,eta); + } + } + }//Histograms with MC + + }// aod loop + +} + + +//____________________________________________________________________________ +void AliAnaPi0EbE::Init() +{ //Init //Do some checks if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn()){ @@ -577,39 +587,37 @@ void AliAnaPi0EbE::Init() } -//____________________________________________________________________________ -void AliAnaPi0EbE::InitParameters() -{ - - //Initialize the parameters of the analysis. - SetOutputAODClassName("AliAODPWG4Particle"); - SetOutputAODName("pi0s"); - fInputAODGammaConvName = "gammaconv" ; - fAnaType = kIMCalo ; - fCalorimeter = "EMCAL" ; - fMinDist = 2.; - fMinDist2 = 4.; - fMinDist3 = 5.; - -} - -//__________________________________________________________________ -void AliAnaPi0EbE::Print(const Option_t * opt) const -{ - - //Print some relevant parameters set for the analysis - if(! opt) - return; - - printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; - AliAnaPartCorrBaseClass::Print(""); - printf("Analysis Type = %d \n", fAnaType) ; - if(fAnaType == kSSCalo){ - printf("Calorimeter = %s\n", fCalorimeter.Data()) ; - printf("Min Distance to Bad Channel = %2.1f\n",fMinDist); - printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2); - printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3); - } - printf(" \n") ; - -} +//____________________________________________________________________________ +void AliAnaPi0EbE::InitParameters() +{ + //Initialize the parameters of the analysis. + SetOutputAODClassName("AliAODPWG4Particle"); + SetOutputAODName("pi0s"); + fInputAODGammaConvName = "gammaconv" ; + fAnaType = kIMCalo ; + fCalorimeter = "EMCAL" ; + fMinDist = 2.; + fMinDist2 = 4.; + fMinDist3 = 5.; + +} + +//__________________________________________________________________ +void AliAnaPi0EbE::Print(const Option_t * opt) const +{ + //Print some relevant parameters set for the analysis + if(! opt) + return; + + printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; + AliAnaPartCorrBaseClass::Print(""); + printf("Analysis Type = %d \n", fAnaType) ; + if(fAnaType == kSSCalo){ + printf("Calorimeter = %s\n", fCalorimeter.Data()) ; + printf("Min Distance to Bad Channel = %2.1f\n",fMinDist); + printf("Min Distance to Bad Channel 2 = %2.1f\n",fMinDist2); + printf("Min Distance to Bad Channel 3 = %2.1f\n",fMinDist3); + } + printf(" \n") ; + +} diff --git a/PWG4/PartCorrDep/AliAnaPi0EbE.h b/PWG4/PartCorrDep/AliAnaPi0EbE.h index 5a34a946efc..d1b0da709b0 100755 --- a/PWG4/PartCorrDep/AliAnaPi0EbE.h +++ b/PWG4/PartCorrDep/AliAnaPi0EbE.h @@ -1,103 +1,101 @@ -#ifndef ALIANAPI0EBE_H -#define ALIANAPI0EBE_H -/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ -/* $Id: AliAnaPi0EbE.h 27413 2008-07-18 13:28:12Z gconesab $ */ - -//_________________________________________________________________________ -// -// Class for the analysis of high pT pi0 event by event -// Pi0 identified by one of the following: -// -Invariant mass of 2 cluster in calorimeter -// -Shower shape analysis in calorimeter -// -Invariant mass of one cluster in calorimeter and one photon reconstructed in TPC (in near future) -// -//-- Author: Gustavo Conesa (INFN-LNF) & Raphaelle Ichou (SUBATECH) -//_________________________________________________________________________ - - -// --- ROOT system --- -#include -#include - -// --- ANALYSIS system --- -#include "AliAnaPartCorrBaseClass.h" -class AliAODPWG4ParticleCorrelation ; - -class TList ; - -class AliAnaPi0EbE : public AliAnaPartCorrBaseClass { - -public: - - AliAnaPi0EbE() ; // default ctor - AliAnaPi0EbE(const AliAnaPi0EbE & g) ; // cpy ctor - AliAnaPi0EbE & operator = (const AliAnaPi0EbE & g) ;//cpy assignment - virtual ~AliAnaPi0EbE() ; //virtual dtor - - enum anaTypes {kIMCalo, kSSCalo, kIMCaloTracks}; - - TList * GetCreateOutputObjects(); - - void Init(); - void InitParameters(); - - void MakeAnalysisFillAOD() ; - void MakeAnalysisFillHistograms() ; - - void MakeInvMassInCalorimeter() ; - void MakeInvMassInCalorimeterAndCTS() ; - void MakeShowerShapeIdentification() ; - - void Print(const Option_t * opt)const; - - anaTypes GetAnalysisType() const {return fAnaType ; } - void SetAnalysisType(anaTypes ana) {fAnaType = ana ; } - - TString GetInputAODGammaConvName() const {return fInputAODGammaConvName ; } - void SetInputAODGammaConvName(TString name) {fInputAODGammaConvName = name ; } - - //Only for pi0 SS identification case - void SetCalorimeter(TString det) {fCalorimeter = det ; } - - void SetMinDistanceToBadChannel(Float_t m1, Float_t m2, Float_t m3) { - fMinDist = m1; - fMinDist2 = m2; - fMinDist3 = m3; - } - -private: - - anaTypes fAnaType; //Select analysis type - - //Only for pi0 SS identification case, kSSCalo - TString fCalorimeter ; // Calorimeter where the gamma is searched; - Float_t fMinDist ; // Minimal distance to bad channel to accept cluster - Float_t fMinDist2; // Cuts on Minimal distance to study acceptance evaluation - Float_t fMinDist3; // One more cut on distance used for acceptance-efficiency study - - //Only for combination of calorimeter and conversion photons, kIMCaloTracks - TClonesArray * fInputAODGammaConv; //AOD array with conversion photons reconstructed in CTS - TString fInputAODGammaConvName; //Name of AOD branch with conversion photons - - //Histograms - TH1F * fhPtPi0 ; //! Number of identified pi0 - TH2F * fhPhiPi0 ; //! Phi of identified pi0 - TH2F * fhEtaPi0 ; //! eta of identified pi0 - - //MC - TH1F * fhPtMCNoPi0; //! Number of identified pi0, not coming from pi0 - TH2F * fhPhiMCNoPi0; //! Phi of identified pi0, not coming from pi0 - TH2F * fhEtaMCNoPi0; //! eta of identified pi0, not coming from pi0 - TH1F * fhPtMCPi0; //! Number of identified pi0, coming from pi0 - TH2F * fhPhiMCPi0; //! Phi of identified pi0, coming from pi0 - TH2F * fhEtaMCPi0; //! eta of identified pi0, coming from pi0 - - ClassDef(AliAnaPi0EbE,1) -} ; - - -#endif //ALIANAPI0EBE_H - - - +#ifndef ALIANAPI0EBE_H +#define ALIANAPI0EBE_H +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ +/* $Id: AliAnaPi0EbE.h 27413 2008-07-18 13:28:12Z gconesab $ */ + +//_________________________________________________________________________ +// +// Class for the analysis of high pT pi0 event by event +// Pi0 identified by one of the following: +// -Invariant mass of 2 cluster in calorimeter +// -Shower shape analysis in calorimeter +// -Invariant mass of one cluster in calorimeter and one photon reconstructed in TPC (in near future) +// +//-- Author: Gustavo Conesa (INFN-LNF) & Raphaelle Ichou (SUBATECH) +//_________________________________________________________________________ + + +// --- ROOT system --- +class TH2F ; +class TList ; + +// --- ANALYSIS system --- +#include "AliAnaPartCorrBaseClass.h" +class AliAODPWG4ParticleCorrelation ; + +class AliAnaPi0EbE : public AliAnaPartCorrBaseClass { + + public: + + AliAnaPi0EbE() ; // default ctor + AliAnaPi0EbE(const AliAnaPi0EbE & g) ; // cpy ctor + AliAnaPi0EbE & operator = (const AliAnaPi0EbE & g) ;//cpy assignment + virtual ~AliAnaPi0EbE() ; //virtual dtor + + enum anaTypes {kIMCalo, kSSCalo, kIMCaloTracks}; + + TList * GetCreateOutputObjects(); + + void Init(); + void InitParameters(); + + void MakeAnalysisFillAOD() ; + void MakeAnalysisFillHistograms() ; + + void MakeInvMassInCalorimeter() ; + void MakeInvMassInCalorimeterAndCTS() ; + void MakeShowerShapeIdentification() ; + + void Print(const Option_t * opt)const; + + anaTypes GetAnalysisType() const {return fAnaType ; } + void SetAnalysisType(anaTypes ana) {fAnaType = ana ; } + + TString GetInputAODGammaConvName() const {return fInputAODGammaConvName ; } + void SetInputAODGammaConvName(TString name) {fInputAODGammaConvName = name ; } + + //Only for pi0 SS identification case + void SetCalorimeter(TString det) {fCalorimeter = det ; } + + void SetMinDistanceToBadChannel(Float_t m1, Float_t m2, Float_t m3) { + fMinDist = m1; + fMinDist2 = m2; + fMinDist3 = m3; + } + + private: + + anaTypes fAnaType; //Select analysis type + + //Only for pi0 SS identification case, kSSCalo + TString fCalorimeter ; // Calorimeter where the gamma is searched; + Float_t fMinDist ; // Minimal distance to bad channel to accept cluster + Float_t fMinDist2; // Cuts on Minimal distance to study acceptance evaluation + Float_t fMinDist3; // One more cut on distance used for acceptance-efficiency study + + //Only for combination of calorimeter and conversion photons, kIMCaloTracks + TClonesArray * fInputAODGammaConv; //AOD array with conversion photons reconstructed in CTS + TString fInputAODGammaConvName; //Name of AOD branch with conversion photons + + //Histograms + TH1F * fhPtPi0 ; //! Number of identified pi0 + TH2F * fhPhiPi0 ; //! Phi of identified pi0 + TH2F * fhEtaPi0 ; //! eta of identified pi0 + + //MC + TH1F * fhPtMCNoPi0; //! Number of identified pi0, not coming from pi0 + TH2F * fhPhiMCNoPi0; //! Phi of identified pi0, not coming from pi0 + TH2F * fhEtaMCNoPi0; //! eta of identified pi0, not coming from pi0 + TH1F * fhPtMCPi0; //! Number of identified pi0, coming from pi0 + TH2F * fhPhiMCPi0; //! Phi of identified pi0, coming from pi0 + TH2F * fhEtaMCPi0; //! eta of identified pi0, coming from pi0 + + ClassDef(AliAnaPi0EbE,1) + } ; + + +#endif //ALIANAPI0EBE_H + + + diff --git a/PWG4/PartCorrDep/AliAnalysisTaskPHOSExample.cxx b/PWG4/PartCorrDep/AliAnalysisTaskPHOSExample.cxx index 0b976497f17..704482950c5 100755 --- a/PWG4/PartCorrDep/AliAnalysisTaskPHOSExample.cxx +++ b/PWG4/PartCorrDep/AliAnalysisTaskPHOSExample.cxx @@ -15,7 +15,7 @@ /* $Id: */ -//_________________________________________________________________________ +//_________________________________________________________________________∫ // A basic analysis task to analyse photon detected by PHOS // A basic analysis task to analyse photon detected by PHOS // A basic analysis task to analyse photon detected by PHOS @@ -26,22 +26,19 @@ ////////////////////////////////////////////////////////////////////////////// //Root system #include -#include +#include #include -#include #include #include -#include //Analysis system #include "AliAnalysisTaskPHOSExample.h" -#include "AliAnalysisManager.h" #include "AliESDEvent.h" #include "AliESDCaloCluster.h" #include "AliAODEvent.h" #include "AliAODPhoton.h" #include "AliLog.h" -#include "AliESDVertex.h" + //______________________________________________________________________________ AliAnalysisTaskPHOSExample::AliAnalysisTaskPHOSExample() : diff --git a/PWG4/libPWG4PartCorrDep.pkg b/PWG4/libPWG4PartCorrDep.pkg index 455dff19664..fae42d1b68d 100755 --- a/PWG4/libPWG4PartCorrDep.pkg +++ b/PWG4/libPWG4PartCorrDep.pkg @@ -7,8 +7,9 @@ SRCS = PartCorrDep/AliAnaCaloTrigger.cxx \ PartCorrDep/AliAnaParticleHadronCorrelation.cxx \ PartCorrDep/AliAnaParticleJetFinderCorrelation.cxx \ PartCorrDep/AliAnaParticleJetLeadingConeCorrelation.cxx \ - PartCorrDep/AliAnaPhoton.cxx PartCorrDep/AliAnaPi0.cxx PartCorrDep/AliAnaPi0EbE.cxx - + PartCorrDep/AliAnaPhoton.cxx PartCorrDep/AliAnaPi0.cxx \ + PartCorrDep/AliAnaPi0EbE.cxx PartCorrDep/AliAnaChargedParticles.cxx + HDRS:= $(SRCS:.cxx=.h) -- 2.43.0