From a39c9b1b33958d6436db806a676ad04274727fe5 Mon Sep 17 00:00:00 2001 From: gconesab Date: Thu, 21 Aug 2014 10:31:12 +0200 Subject: [PATCH] move the decay bit definition from AliAnaPi0EbE to AliNeutralSelection, define there the methods to set or check if the bit was set, adapt AliAnaPi0EbE to those new Set/Check methods --- .../AliNeutralMesonSelection.cxx | 18 ++-- .../AliNeutralMesonSelection.h | 40 +++++++-- PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.cxx | 83 +++++++++---------- PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.h | 6 +- 4 files changed, 86 insertions(+), 61 deletions(-) diff --git a/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.cxx b/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.cxx index de3d3d2cc48..b97642f7795 100755 --- a/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.cxx +++ b/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.cxx @@ -39,8 +39,9 @@ ClassImp(AliNeutralMesonSelection) fLeftBandMinCut(0.), fLeftBandMaxCut(0.), fRightBandMinCut(0.), fRightBandMaxCut(0.), fAngleMaxParam(), fUseAngleCut(0), - fKeepNeutralMesonHistos(0), fParticle(""), - // histograms + fKeepNeutralMesonHistos(0), + fParticle(""), fDecayBit(0), + // histograms fhAnglePairNoCut(0), fhAnglePairOpeningAngleCut(0), fhAnglePairAsymmetryCut(0), fhAnglePairAllCut(0), fhInvMassPairNoCut(0), fhInvMassPairOpeningAngleCut(0), @@ -336,7 +337,8 @@ void AliNeutralMesonSelection::SetParticle(TString particleName) // Set some default parameters for selection of pi0 or eta fParticle = particleName ; - + fDecayBit = kPi0; + if(particleName.Contains("Pi0")) { fHistoNIMBins = 150 ; @@ -363,6 +365,9 @@ void AliNeutralMesonSelection::SetParticle(TString particleName) fAngleMaxParam.AddAt(-1, 1) ; fAngleMaxParam.AddAt( 0.09, 2) ; //for pi0 shift, for eta maybe 0.09 fAngleMaxParam.AddAt(-2.e-3,3) ; + + fDecayBit = kPi0; + if(particleName.Contains("Side")) fDecayBit = kPi0Side; } else if(particleName.Contains("Eta")) @@ -389,14 +394,15 @@ void AliNeutralMesonSelection::SetParticle(TString particleName) fAngleMaxParam.AddAt( 0.80, 0) ; // Same as pi0 fAngleMaxParam.AddAt(-0.25, 1) ; // Same as pi0 - fAngleMaxParam.AddAt( 0.12, 2) ; // Shifted with respect to pi0 + fAngleMaxParam.AddAt( 0.12, 2) ; // Shifted with respect to pi0 fAngleMaxParam.AddAt(-5.e-4, 3) ; // Same as pi0 + fDecayBit = kEta; + if(particleName.Contains("Side")) fDecayBit = kEtaSide; } else printf("AliAnaNeutralMesonSelection::SetParticle(%s) *** Particle NOT defined (Pi0 or Eta), Pi0 settings by default *** \n",particleName.Data()); - } //______________________________________________________________ @@ -409,7 +415,7 @@ void AliNeutralMesonSelection::Print(const Option_t * opt) const printf("**** Print %s %s ****\n", GetName(), GetTitle() ) ; - printf("Particle %s, mass : %f \n", fParticle.Data(), fM ); + printf("Particle %s, bit %d, mass : %f \n", fParticle.Data(), fDecayBit, fM ); printf("Invariant mass limits : %f < m < %f \n", fInvMassMinCut , fInvMassMinCut ); printf("Use asymmetry cut? : %d ; A < %f \n", fUseAngleCut, fAsymmetryCut ); diff --git a/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.h b/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.h index 0460a2e448a..c5db9988eab 100755 --- a/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.h +++ b/PWG/CaloTrackCorrBase/AliNeutralMesonSelection.h @@ -40,7 +40,7 @@ class AliNeutralMesonSelection : public TObject { Bool_t SelectPair(TLorentzVector particlei, TLorentzVector particlej, TString calo) ; void SetParticle(TString particleName) ; // Do some default settings for "Pi0" or "Eta" - TString GetParticle() const { return fParticle ; } + TString GetParticle() const { return fParticle ; } // Asymmetry selection @@ -83,8 +83,37 @@ class AliNeutralMesonSelection : public TObject { Double_t GetMass() const { return fM ; } void SetMass(Double_t m) { fM = m ; } - - //Histogrammes setters and getters + + + // Decay photon bit setting + + enum decayTypes { kPi0, kEta, kPi0Side, kEtaSide} ; + + UInt_t GetDecayBit() const { return fDecayBit ; } + + void SetDecayBit(Int_t &tag, UInt_t set) const { + // Set bit of type set (decayTypes) in tag + tag |= (1<GetParticle(); - if(particle.Contains("Pi0")) - { - fDecayTag = kPi0; - if(particle.Contains("Side")) fDecayTag = kPi0Side; - } - else if(particle.Contains("Eta")) - { - fDecayTag = kEta; - if(particle.Contains("Side")) fDecayTag = kEtaSide; - } - else - printf("AliAnaPi0EbE::GetCreateOutputObjects() - Uknown particle %s\n",particle.Data()); - } - return outputContainer ; } @@ -2913,14 +2893,19 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() FillSelectedClusterHistograms(cluster2, mom2.Pt(), nMaxima2, photon2->GetTag()); } + // // Tag both photons as decay if not done before - // Careful, if pi0, eta and side bands analysis - // run in pararel, the label can be overwritten - if( photon1->GetBtag() != fDecayTag ) // temporary + // set the corresponding bit for pi0 or eta or "side" case + // + Int_t bit1 = photon1->GetBtag(); // temporary + if( bit1 < 0 ) bit1 = 0 ; // temporary + if( !GetNeutralMesonSelection()->CheckDecayBit(bit1) ) { - photon1->SetTagged(kTRUE); - photon1->SetBtag(fDecayTag); // temporary + photon1->SetTagged(kTRUE); // temporary + GetNeutralMesonSelection()->SetDecayBit(bit1); + photon1->SetBtag(bit1); // temporary fhPtDecay->Fill(photon1->Pt()); + //Fill some histograms about shower shape if(fFillSelectClHisto && cluster1 && GetReader()->GetDataType()!=AliCaloTrackReader::kMC) FillSelectedClusterHistograms(cluster1, mom1.Pt(), nMaxima1, photon1->GetTag()); @@ -2932,10 +2917,13 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() } } - if( photon2->GetBtag() != fDecayTag ) // temporary + Int_t bit2 = photon2->GetBtag(); // temporary + if( bit2 < 0 ) bit2 = 0 ; // temporary + if( !GetNeutralMesonSelection()->CheckDecayBit(bit2) ) { - photon2->SetTagged(kTRUE); - photon2->SetBtag(fDecayTag); // temporary + photon2->SetTagged(kTRUE); // temporary + GetNeutralMesonSelection()->SetDecayBit(bit2); + photon2->SetBtag(bit2); // temporary fhPtDecay->Fill(photon2->Pt()); //Fill some histograms about shower shape @@ -2947,7 +2935,6 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeter() Int_t mcIndex2 = GetMCIndex(photon2->GetTag()); fhMCPtDecay[mcIndex2]->Fill(photon2->Pt()); } - } //Mass of selected pairs @@ -3097,38 +3084,44 @@ void AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() if(IsDataMC()) fhMCMassPt[mcIndex]->Fill(ptpair,mass); // - //Select good pair (good phi, pt cuts, aperture and invariant mass) + // Select good pair (good phi, pt cuts, aperture and invariant mass) // if(!GetNeutralMesonSelection()->SelectPair(mom1, mom2,fCalorimeter)) continue ; if(GetDebug() > 1) printf("AliAnaPi0EbE::MakeInvMassInCalorimeterAndCTS() - Selected gamma pair: pt %f, phi %f, eta%f\n", mom.Pt(), mom.Phi()*TMath::RadToDeg(), mom.Eta()); - // Tag both photons as decay - // Careful, if pi0, eta and side bands analysis - // run in pararel, the label can be overwritten - if( photon1->GetBtag() != fDecayTag ) // temporary + // + // Tag both photons as decay if not done before + // set the corresponding bit for pi0 or eta or "side" case + // + Int_t bit1 = photon1->GetBtag(); // temporary + if( bit1 < 0 ) bit1 = 0 ; // temporary + if( !GetNeutralMesonSelection()->CheckDecayBit(bit1) ) { - photon1->SetTagged(kTRUE); - photon1->SetBtag(fDecayTag); // temporary - + photon1->SetTagged(kTRUE); // temporary + GetNeutralMesonSelection()->SetDecayBit(bit1); + photon1->SetBtag(bit1); // temporary fhPtDecay->Fill(photon1->Pt()); + //Fill some histograms about shower shape + if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC) + FillSelectedClusterHistograms(cluster, mom1.Pt(), nMaxima, photon1->GetTag()); + if(IsDataMC()) { Int_t mcIndex1 = GetMCIndex(photon1->GetTag()); fhMCPtDecay[mcIndex1]->Fill(photon1->Pt()); } - - //Fill some histograms about shower shape - if(fFillSelectClHisto && cluster && GetReader()->GetDataType()!=AliCaloTrackReader::kMC) - FillSelectedClusterHistograms(cluster, mom1.Pt(), nMaxima, photon1->GetTag()); } - if( photon2->GetBtag() != fDecayTag ) // temporary + Int_t bit2 = photon2->GetBtag(); // temporary + if( bit2 < 0 ) bit2 = 0 ; // temporary + if( !GetNeutralMesonSelection()->CheckDecayBit(bit2) ) { - photon2->SetTagged(kTRUE); - photon2->SetBtag(fDecayTag); // temporary + photon2->SetTagged(kTRUE); // temporary + GetNeutralMesonSelection()->SetDecayBit(bit2); + photon2->SetBtag(bit2); // temporary } //Mass of selected pairs diff --git a/PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.h b/PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.h index dbc7baa4123..3d1c702f0a6 100755 --- a/PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.h +++ b/PWGGA/CaloTrackCorrelations/AliAnaPi0EbE.h @@ -133,15 +133,11 @@ class AliAnaPi0EbE : public AliAnaCaloTrackCorrBaseClass { enum mcTypes { kmcPi0Decay = 0, kmcEtaDecay = 1, kmcOtherDecay = 2, kmcPi0 = 3, kmcEta = 4, kmcElectron = 5, kmcHadron = 6 }; - - enum decayTypes { kNone = 0, kPi0 = 1, kEta = 2, kPi0Side = 3 , kEtaSide = 4} ; private: anaTypes fAnaType; // Select analysis type - - Int_t fDecayTag; // Decay type flag, stored in AOD SetBtag() temporarily - + //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 -- 2.39.3