From: gconesab Date: Thu, 19 Feb 2009 08:55:23 +0000 (+0000) Subject: 1)AliAODParticleCorrelation.h: Data member fIsolation changed from float to bool X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=691bdd02c60935a37d0555eff21bda8b8c79ddc6;ds=sidebyside 1)AliAODParticleCorrelation.h: Data member fIsolation changed from float to bool 2)AliCaloTrackMCReader: Possibility to keep the pi0 instead of the photon decay, in case of overlapping in calorimeters 3)AliAnaPi0EbE: In case of shower shape selection of pi0, it was selecting clusters id as photon not pi0. Added init method to check if calorimeter information is read. --- diff --git a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h index 618e78bb953..ed9eae4fae3 100755 --- a/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h +++ b/PWG4/PartCorrBase/AliAODPWG4ParticleCorrelation.h @@ -29,7 +29,7 @@ class AliAODPWG4ParticleCorrelation : public AliAODPWG4Particle { AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& photon); AliAODPWG4ParticleCorrelation& operator=(const AliAODPWG4ParticleCorrelation& photon); - virtual Float_t IsIsolated() const { return fIsolated ;} + virtual Bool_t IsIsolated() const { return fIsolated ;} virtual void SetIsolated(Bool_t iso) {fIsolated = iso ;} virtual TRefArray* GetRefTracks() const { return fRefTracks;} @@ -76,7 +76,7 @@ class AliAODPWG4ParticleCorrelation : public AliAODPWG4Particle { private: - Float_t fIsolated ; //Particle is isolated or not + 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 diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx index 05c9c2df13f..b7c5fa45231 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.cxx @@ -43,7 +43,9 @@ ClassImp(AliCaloTrackMCReader) AliCaloTrackMCReader::AliCaloTrackMCReader() : AliCaloTrackReader(), fDecayPi0(0), fNeutralParticlesArray(0x0), fChargedParticlesArray(0x0), - fStatusArray(0x0), fKeepAllStatus(0), fClonesArrayType(0) + fStatusArray(0x0), fKeepAllStatus(0), fClonesArrayType(0), + fCheckOverlap(0), fEMCALOverlapAngle(0),fPHOSOverlapAngle(0), + fIndex2ndPhoton(0) { //Ctor @@ -59,7 +61,10 @@ 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) + fKeepAllStatus(g.fKeepAllStatus), fClonesArrayType(g.fClonesArrayType), + fCheckOverlap(g.fCheckOverlap), + fEMCALOverlapAngle( g.fEMCALOverlapAngle), fPHOSOverlapAngle(g.fPHOSOverlapAngle), + fIndex2ndPhoton(g.fIndex2ndPhoton) { // cpy ctor } @@ -132,10 +137,55 @@ void AliCaloTrackMCReader::InitParameters() fKeepAllStatus = kTRUE; fClonesArrayType = kAliAOD ; + fCheckOverlap = kFALSE; + fEMCALOverlapAngle = 2.5 * TMath::DegToRad(); + fPHOSOverlapAngle = 0.5 * TMath::DegToRad(); + fIndex2ndPhoton = -1; +} +//____________________________________________________________________________ +void AliCaloTrackMCReader::CheckOverlap(const Float_t anglethres, const Int_t imom, Int_t & iPrimary, Int_t & index, TLorentzVector & mom, Int_t & pdg) { + //Check overlap of decay photons + if( fIndex2ndPhoton==iPrimary ){ + fIndex2ndPhoton=-1; + return; + } + else fIndex2ndPhoton=-1; + + + if(pdg!=22) return; + + TLorentzVector ph1, ph2; + TParticle *meson = GetStack()->Particle(imom); + Int_t mepdg = meson->GetPdgCode(); + Int_t idaug1 = meson->GetFirstDaughter(); + if((mepdg == 111 || mepdg == 221 ) && meson->GetNDaughters() == 2){ //Check only decay in 2 photons + TParticle * d1 = GetStack()->Particle(idaug1); + TParticle *d2 = GetStack()->Particle(idaug1+1); + if(d1->GetPdgCode() == 22 && d2->GetPdgCode() == 22 ){ + d1->Momentum(ph1); + d2->Momentum(ph2); + //printf("angle %2.2f\n",ph1.Angle(ph2.Vect())); + + if(anglethres > ph1.Angle(ph2.Vect())){ + //Keep the meson + pdg=mepdg; + index=imom; + meson->Momentum(mom); + //printf("Overlap:: pt %2.2f, phi %2.2f, eta %2.2f\n",mom.Pt(),mom.Phi(),mom.Eta()); + if(iPrimary == idaug1) iPrimary++; //skip next photon in list + } + else{ + //Do not check overlapping for next decay photon from same meson + if(iPrimary == idaug1) {fIndex2ndPhoton = idaug1+1; + } + + } + } + }//Meson Decay with 2 photon daughters } //____________________________________________________________________________ -void AliCaloTrackMCReader::FillCalorimeters(const Int_t iParticle, TParticle* particle, TLorentzVector momentum, +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 @@ -143,13 +193,18 @@ void AliCaloTrackMCReader::FillCalorimeters(const Int_t iParticle, TParticle* p if(fClonesArrayType == kTParticle) new((*fAODPHOS)[indexPHOS++]) TParticle(*particle) ; else{ - - Char_t ttype= AliAODCluster::kPHOSNeutral; - Int_t labels[] = {iParticle}; - Float_t x[] = {momentum.X(), momentum.Y(), momentum.Z()}; + 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(iParticle,1,labels,momentum.E(), x, NULL, ttype, 0); - SetCaloClusterPID(particle->GetPdgCode(),calo) ; + 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()); @@ -159,12 +214,19 @@ void AliCaloTrackMCReader::FillCalorimeters(const Int_t iParticle, TParticle* p 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[] = {iParticle}; + 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(particle->GetPdgCode(),calo) ; + + 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()); @@ -203,8 +265,8 @@ void AliCaloTrackMCReader::FillInputEvent(Int_t iEntry){ TLorentzVector momentum; Float_t p[3]; Float_t x[3]; - Int_t pdg = particle->GetPdgCode(); - + Int_t pdg = particle->GetPdgCode(); + //Keep particles with a given status if(KeepParticleWithStatus(particle->GetStatusCode()) && (particle->Pt() > 0) ){ @@ -246,7 +308,6 @@ void AliCaloTrackMCReader::FillInputEvent(Int_t iEntry){ //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); @@ -276,7 +337,8 @@ void AliCaloTrackMCReader::FillInputEvent(Int_t iEntry){ }//neutral particles } //particle with correct status }//particle loop - + + fIndex2ndPhoton = -1; //In case of overlapping studies, reset for each event } //________________________________________________________________ @@ -317,6 +379,7 @@ void AliCaloTrackMCReader::Print(const Option_t * opt) const 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) ; if(!fKeepAllStatus) printf("Keep particles with status : "); diff --git a/PWG4/PartCorrBase/AliCaloTrackMCReader.h b/PWG4/PartCorrBase/AliCaloTrackMCReader.h index ab879b8c5c1..6e76e6b60a3 100755 --- a/PWG4/PartCorrBase/AliCaloTrackMCReader.h +++ b/PWG4/PartCorrBase/AliCaloTrackMCReader.h @@ -66,10 +66,19 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { void SetCaloClusterPID(const Int_t pdgCode, AliAODCaloCluster *calo) const ; void SetTrackChargeAndPID(const Int_t pdgCode, AliAODTrack *track) const ; + void SwitchOnOverlapCheck() {fCheckOverlap = kTRUE;} + void SwitchOffOverlapCheck() {fCheckOverlap = kFALSE;} + + Float_t GetEMCALOverlapAngle() const {return fEMCALOverlapAngle ;} + Float_t GetPHOSOverlapAngle() const {return fPHOSOverlapAngle ;} + void SetEMCALOverlapAngle(Float_t angle) {fEMCALOverlapAngle = angle;} + void SetPHOSOverlapAngle(Float_t angle) {fPHOSOverlapAngle = angle;} + private: + 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(const Int_t iParticle, TParticle* particle, TLorentzVector momentum, + void FillCalorimeters(Int_t & iParticle, TParticle* particle, TLorentzVector momentum, Int_t &indexPHOS, Int_t &indexEMCAL) ; private: @@ -79,8 +88,12 @@ class AliCaloTrackMCReader : public AliCaloTrackReader { 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? - - ClassDef(AliCaloTrackMCReader,1) + 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) } ; diff --git a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx index 67d4b59780f..e9d50156557 100755 --- a/PWG4/PartCorrDep/AliAnaPi0EbE.cxx +++ b/PWG4/PartCorrDep/AliAnaPi0EbE.cxx @@ -139,7 +139,9 @@ TList * AliAnaPi0EbE::GetCreateOutputObjects() fhEtaPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); outputContainer->Add(fhEtaPi0) ; - if(IsDataMC()){ + 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"); @@ -175,6 +177,7 @@ TList * AliAnaPi0EbE::GetCreateOutputObjects() fhEtaMCNoPi0->SetXTitle("p_{T #pi^{0}} (GeV/c)"); outputContainer->Add(fhEtaMCNoPi0) ; + } }//Histos with MC @@ -275,7 +278,7 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() if(GetNeutralMesonSelection()->SelectPair(mom1, mom2)) { if(GetDebug()>1) - printf("Selected gamma pair: pt %f, phi %f, eta%f \n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); + 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()){ @@ -283,7 +286,7 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() tag1 = GetMCAnalysisUtils()->CheckOrigin(photon1->GetLabel(), GetMCStack()); tag2 = GetMCAnalysisUtils()->CheckOrigin(photon2->GetLabel(), GetMCStack()); - if(GetDebug() > 0) printf("Origin of: photon1 %d; photon2 %d \n",tag1, tag2); + 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 @@ -318,7 +321,7 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() }//1st photon loop - if(GetDebug() > 1) printf("End fill AODs \n"); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCalo::End fill AODs \n"); } @@ -354,13 +357,13 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() mom2 = *(photon2->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\n",(mom1+mom2).Pt(), (mom1+mom2).Phi()*180./3.1416, (mom1+mom2).Eta()); + 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("Origin of: photon1 %d; photon2 %d \n",tag1, tag2); + 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(); @@ -395,7 +398,7 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() }//1st photon loop - if(GetDebug() > 1) printf("End fill AODs \n"); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kIMCaloCTS::End fill AODs \n"); } @@ -421,7 +424,7 @@ void AliAnaPi0EbE::MakeShowerShapeIdentification() 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 + //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 @@ -433,10 +436,13 @@ void AliAnaPi0EbE::MakeShowerShapeIdentification() } //Create AOD for analysis - AliAODPWG4Particle aodph = AliAODPWG4Particle(mom); - aodph.SetLabel(calo->GetLabel(0)); - 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()); + 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 @@ -444,20 +450,21 @@ void AliAnaPi0EbE::MakeShowerShapeIdentification() 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(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::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) ; + 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) - 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 ; + 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 @@ -466,38 +473,41 @@ void AliAnaPi0EbE::MakeShowerShapeIdentification() //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 + aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,calo->PID(),mom.E()));//PID with weights else - aodph.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated + aodpi0.SetPdg(GetCaloPID()->GetPdg(fCalorimeter,mom,calo));//PID recalculated - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PDG of identified particle %d\n",aodph.GetPdg()); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: PDG of identified particle %d\n",aodpi0.GetPdg()); - //If cluster does not pass pid, not photon, skip it. - if(aodph.GetPdg() != AliCaloPID::kPhoton) continue ; + //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,&aodph); - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: PID Bits set \n"); + GetCaloPID()->SetPIDBits(fCalorimeter,calo,&aodpi0); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::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()); + 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()){ - aodph.SetTag(GetMCAnalysisUtils()->CheckOrigin(calo->GetLabel(0),GetMCStack())); - if(GetDebug() > 0) printf("AliAnaPi0EbE::FillAOD: Origin of candidate %d\n",aodph.GetTag()); + 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 photon object to aod branch - AddAODParticle(aodph); + //Add AOD with pi0 object to aod branch + AddAODParticle(aodpi0); }//loop - if(GetDebug() > 1) printf("AliAnaPhoton::FillAOD: End fill AODs \n"); + if(GetDebug() > 1) printf("AliAnaPi0EbE::kSSCalo::::FillAOD: End fill AODs \n"); } //__________________________________________________________________ @@ -510,7 +520,7 @@ void AliAnaPi0EbE::MakeAnalysisFillHistograms() //Loop on stored AOD pi0 Int_t naod = GetOutputAODBranch()->GetEntriesFast(); - if(GetDebug() > 0) printf("pi0 aod branch entries %d\n", naod); + if(GetDebug() > 0) printf("AliAnaPi0EbE::Histo::pi0 aod branch entries %d\n", naod); for(Int_t iaod = 0; iaod < naod ; iaod++){ @@ -530,6 +540,8 @@ void AliAnaPi0EbE::MakeAnalysisFillHistograms() 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); @@ -540,6 +552,7 @@ void AliAnaPi0EbE::MakeAnalysisFillHistograms() fhPhiMCNoPi0 ->Fill(pt,phi); fhEtaMCNoPi0 ->Fill(pt,eta); } + } }//Histograms with MC }// aod loop @@ -547,6 +560,23 @@ void AliAnaPi0EbE::MakeAnalysisFillHistograms() } +//____________________________________________________________________________ +void AliAnaPi0EbE::Init() +{ + + //Init + //Do some checks + if(fCalorimeter == "PHOS" && !GetReader()->IsPHOSSwitchedOn()){ + printf("!!ABORT: You want to use PHOS in analysis but it is not read!! \n!!Check the configuration file!!\n"); + abort(); + } + else if(fCalorimeter == "EMCAL" && !GetReader()->IsEMCALSwitchedOn()){ + printf("!!ABORT: You want to use EMCAL in analysis but it is not read!! \n!!Check the configuration file!!\n"); + abort(); + } + +} + //____________________________________________________________________________ void AliAnaPi0EbE::InitParameters() { @@ -556,7 +586,7 @@ void AliAnaPi0EbE::InitParameters() SetOutputAODName("pi0s"); fInputAODGammaConvName = "gammaconv" ; fAnaType = kIMCalo ; - fCalorimeter = "PHOS" ; + fCalorimeter = "EMCAL" ; fMinDist = 2.; fMinDist2 = 4.; fMinDist3 = 5.; diff --git a/PWG4/PartCorrDep/AliAnaPi0EbE.h b/PWG4/PartCorrDep/AliAnaPi0EbE.h index 26a7162b078..5a34a946efc 100755 --- a/PWG4/PartCorrDep/AliAnaPi0EbE.h +++ b/PWG4/PartCorrDep/AliAnaPi0EbE.h @@ -39,6 +39,7 @@ public: TList * GetCreateOutputObjects(); + void Init(); void InitParameters(); void MakeAnalysisFillAOD() ;