From 61f275d1ea801499748637d4ac0aaff5ab0adbc4 Mon Sep 17 00:00:00 2001 From: fbellini Date: Sat, 10 Dec 2011 11:05:37 +0000 Subject: [PATCH] Added first version of cut monitoring + style format applied --- PWG2/RESONANCES/AliRsnAnalysisTask.cxx | 59 ++- PWG2/RESONANCES/AliRsnAnalysisTask.h | 10 +- PWG2/RESONANCES/AliRsnCut.cxx | 10 +- PWG2/RESONANCES/AliRsnCut.h | 4 +- .../AliRsnCutDaughterKStar2010PP.cxx | 24 +- .../RESONANCES/AliRsnCutDaughterKStar2010PP.h | 6 +- .../RESONANCES/AliRsnCutDaughterLStar2010.cxx | 16 +- PWG2/RESONANCES/AliRsnCutDaughterLStar2010.h | 2 +- .../AliRsnCutDaughterSigmaStar2010PP.cxx | 66 +-- .../AliRsnCutDaughterSigmaStar2010PP.h | 2 +- PWG2/RESONANCES/AliRsnCutKaon.cxx | 452 +++++++++--------- PWG2/RESONANCES/AliRsnCutKaon.h | 120 ++--- PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx | 26 +- PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h | 12 +- PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx | 30 +- PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h | 14 +- PWG2/RESONANCES/AliRsnCutManager.cxx | 6 +- PWG2/RESONANCES/AliRsnCutManager.h | 16 +- PWG2/RESONANCES/AliRsnCutMiniPair.cxx | 4 +- PWG2/RESONANCES/AliRsnCutMiniPair.h | 2 +- .../AliRsnCutMomentumComparison.cxx | 10 +- PWG2/RESONANCES/AliRsnCutMomentumComparison.h | 4 +- PWG2/RESONANCES/AliRsnCutPID.cxx | 4 +- PWG2/RESONANCES/AliRsnCutPID.h | 4 +- PWG2/RESONANCES/AliRsnCutPIDITS.cxx | 8 +- PWG2/RESONANCES/AliRsnCutPIDITS.h | 8 +- PWG2/RESONANCES/AliRsnCutPIDNSigma.cxx | 34 +- PWG2/RESONANCES/AliRsnCutPIDNSigma.h | 38 +- PWG2/RESONANCES/AliRsnCutPIDTOF.cxx | 8 +- PWG2/RESONANCES/AliRsnCutPIDTOF.h | 10 +- PWG2/RESONANCES/AliRsnCutPIDTPC.cxx | 8 +- PWG2/RESONANCES/AliRsnCutPIDTPC.h | 10 +- PWG2/RESONANCES/AliRsnCutPion.cxx | 445 +++++++++-------- PWG2/RESONANCES/AliRsnCutPion.h | 120 ++--- PWG2/RESONANCES/AliRsnCutPion2010PP.cxx | 16 +- PWG2/RESONANCES/AliRsnCutPion2010PP.h | 4 +- PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx | 6 +- PWG2/RESONANCES/AliRsnCutPrimaryVertex.h | 2 +- PWG2/RESONANCES/AliRsnCutProton2010PP.cxx | 16 +- PWG2/RESONANCES/AliRsnCutProton2010PP.h | 4 +- PWG2/RESONANCES/AliRsnCutSet.cxx | 64 ++- PWG2/RESONANCES/AliRsnCutSet.h | 28 +- PWG2/RESONANCES/AliRsnCutTrackQuality.cxx | 12 +- PWG2/RESONANCES/AliRsnCutTrackQuality.h | 24 +- PWG2/RESONANCES/AliRsnCutTrue.cxx | 10 +- PWG2/RESONANCES/AliRsnCutTrue.h | 10 +- PWG2/RESONANCES/AliRsnCutV0.cxx | 46 +- PWG2/RESONANCES/AliRsnCutV0.h | 10 +- PWG2/RESONANCES/AliRsnCutValue.cxx | 20 +- PWG2/RESONANCES/AliRsnCutValue.h | 6 +- PWG2/RESONANCES/AliRsnDaughter.cxx | 28 +- PWG2/RESONANCES/AliRsnDaughter.h | 70 +-- PWG2/RESONANCES/AliRsnDaughterDef.cxx | 12 +- PWG2/RESONANCES/AliRsnDaughterDef.h | 24 +- PWG2/RESONANCES/AliRsnDaughterSelector.cxx | 90 ++-- PWG2/RESONANCES/AliRsnDaughterSelector.h | 15 +- PWG2/RESONANCES/AliRsnEvent.cxx | 118 ++--- PWG2/RESONANCES/AliRsnEvent.h | 34 +- PWG2/RESONANCES/AliRsnExpression.cxx | 52 +- PWG2/RESONANCES/AliRsnExpression.h | 26 +- PWG2/RESONANCES/AliRsnInputHandler.cxx | 12 +- PWG2/RESONANCES/AliRsnInputHandler.h | 2 +- PWG2/RESONANCES/AliRsnListOutput.cxx | 121 +++-- PWG2/RESONANCES/AliRsnListOutput.h | 18 +- PWG2/RESONANCES/AliRsnLoop.cxx | 38 +- PWG2/RESONANCES/AliRsnLoop.h | 12 +- PWG2/RESONANCES/AliRsnLoopDaughter.cxx | 44 +- PWG2/RESONANCES/AliRsnLoopDaughter.h | 12 +- PWG2/RESONANCES/AliRsnLoopEff.cxx | 24 +- PWG2/RESONANCES/AliRsnLoopEff.h | 6 +- PWG2/RESONANCES/AliRsnLoopEffPair.cxx | 68 +-- PWG2/RESONANCES/AliRsnLoopEffPair.h | 8 +- PWG2/RESONANCES/AliRsnLoopEvent.cxx | 16 +- PWG2/RESONANCES/AliRsnLoopEvent.h | 6 +- PWG2/RESONANCES/AliRsnLoopPair.cxx | 4 +- PWG2/RESONANCES/AliRsnLoopPair.h | 10 +- PWG2/RESONANCES/AliRsnMiniAnalysisTask.cxx | 44 +- PWG2/RESONANCES/AliRsnMiniAnalysisTask.h | 44 +- PWG2/RESONANCES/AliRsnMiniAxis.h | 14 +- PWG2/RESONANCES/AliRsnMiniEvent.cxx | 20 +- PWG2/RESONANCES/AliRsnMiniEvent.h | 26 +- PWG2/RESONANCES/AliRsnMiniMonitor.cxx | 76 +-- PWG2/RESONANCES/AliRsnMiniMonitor.h | 14 +- PWG2/RESONANCES/AliRsnMiniMonitorTask.cxx | 68 +-- PWG2/RESONANCES/AliRsnMiniMonitorTask.h | 24 +- PWG2/RESONANCES/AliRsnMiniOutput.cxx | 116 ++--- PWG2/RESONANCES/AliRsnMiniOutput.h | 30 +- PWG2/RESONANCES/AliRsnMiniPair.cxx | 6 +- PWG2/RESONANCES/AliRsnMiniPair.h | 40 +- PWG2/RESONANCES/AliRsnMiniParticle.cxx | 6 +- PWG2/RESONANCES/AliRsnMiniParticle.h | 38 +- PWG2/RESONANCES/AliRsnMiniValue.cxx | 16 +- PWG2/RESONANCES/AliRsnMiniValue.h | 22 +- PWG2/RESONANCES/AliRsnMother.cxx | 46 +- PWG2/RESONANCES/AliRsnMother.h | 22 +- PWG2/RESONANCES/AliRsnPairDef.cxx | 38 +- PWG2/RESONANCES/AliRsnPairDef.h | 12 +- PWG2/RESONANCES/AliRsnTarget.cxx | 14 +- PWG2/RESONANCES/AliRsnTarget.h | 20 +- PWG2/RESONANCES/AliRsnValue.cxx | 6 +- PWG2/RESONANCES/AliRsnValue.h | 10 +- PWG2/RESONANCES/AliRsnValueDaughter.cxx | 16 +- PWG2/RESONANCES/AliRsnValueDaughter.h | 8 +- PWG2/RESONANCES/AliRsnValueEvent.cxx | 34 +- PWG2/RESONANCES/AliRsnValueEvent.h | 10 +- PWG2/RESONANCES/AliRsnValuePair.cxx | 16 +- PWG2/RESONANCES/AliRsnValuePair.h | 8 +- PWG2/RESONANCES/AliRsnVariableExpression.h | 2 +- 108 files changed, 1876 insertions(+), 1730 deletions(-) diff --git a/PWG2/RESONANCES/AliRsnAnalysisTask.cxx b/PWG2/RESONANCES/AliRsnAnalysisTask.cxx index dc4c2ed73c3..a08718e6c5c 100644 --- a/PWG2/RESONANCES/AliRsnAnalysisTask.cxx +++ b/PWG2/RESONANCES/AliRsnAnalysisTask.cxx @@ -48,7 +48,7 @@ AliRsnAnalysisTask::AliRsnAnalysisTask(const char *name) : } //__________________________________________________________________________________________________ -AliRsnAnalysisTask::AliRsnAnalysisTask(const AliRsnAnalysisTask& copy) : +AliRsnAnalysisTask::AliRsnAnalysisTask(const AliRsnAnalysisTask ©) : AliAnalysisTaskSE(copy), fOutput(0), fRsnObjects(copy.fRsnObjects), @@ -64,7 +64,7 @@ AliRsnAnalysisTask::AliRsnAnalysisTask(const AliRsnAnalysisTask& copy) : } //__________________________________________________________________________________________________ -AliRsnAnalysisTask& AliRsnAnalysisTask::operator=(const AliRsnAnalysisTask& copy) +AliRsnAnalysisTask &AliRsnAnalysisTask::operator=(const AliRsnAnalysisTask ©) { // // Assignment operator. @@ -73,12 +73,12 @@ AliRsnAnalysisTask& AliRsnAnalysisTask::operator=(const AliRsnAnalysisTask& copy // AliAnalysisTaskSE::operator=(copy); if (this == ©) - return *this; + return *this; fRsnObjects = copy.fRsnObjects; fInputEHMain = copy.fInputEHMain; fInputEHMix = copy.fInputEHMix; fBigOutput = copy.fBigOutput; - + return (*this); } @@ -86,7 +86,7 @@ AliRsnAnalysisTask& AliRsnAnalysisTask::operator=(const AliRsnAnalysisTask& copy AliRsnAnalysisTask::~AliRsnAnalysisTask() { // -// Destructor. +// Destructor. // Clean-up the output list, but not the histograms that are put inside // (the list is owner and will clean-up these histograms). Protect in PROOF case. // @@ -121,14 +121,31 @@ void AliRsnAnalysisTask::UserCreateOutputObjects() if (fBigOutput) OpenFile(1); fOutput = new TList(); fOutput->SetOwner(); - + // loop on computators and initialize all their outputs TObjArrayIter next(&fRsnObjects); - AliRsnLoop *obj = 0x0; - while ( (obj = (AliRsnLoop*)next()) ) { - obj->Init(GetName(), fOutput); + AliRsnLoop *objLoop = 0x0; + while ( (objLoop = (AliRsnLoop *)next()) ) { + objLoop->Init(GetName(), fOutput); } + if (fInputEHMain) { + TObjArrayIter nextIH(fInputEHMain->InputEventHandlers()); + TObject *obj = 0x0; + while ( (obj = nextIH()) ) { + if (obj->IsA() == AliRsnInputHandler::Class()) { + AliRsnInputHandler *rsnIH = (AliRsnInputHandler *) obj; + AliRsnDaughterSelector *s = rsnIH->GetSelector(); + TClonesArray *c = s->GetCutSetC(); + for (Int_t is = 0; is < c->GetEntries(); is++) { + AliRsnCutSet *cuts = (AliRsnCutSet *)c->At(is); + cuts->Init(fOutput); + } + } + } + } + + // post data for ALL output slots >0 here, to get at least an empty histogram PostData(1, fOutput); } @@ -150,28 +167,28 @@ void AliRsnAnalysisTask::UserExec(Option_t *) TObject *obj = 0x0; while ( (obj = next()) ) { if (obj->IsA() == AliRsnInputHandler::Class()) { - rsnIH = (AliRsnInputHandler*)obj; + rsnIH = (AliRsnInputHandler *)obj; //AliInfo(Form("Found object '%s' which is RSN input handler", obj->GetName())); evMain = rsnIH->GetRsnEvent(); break; } } } - + if (!evMain) return; TObjArrayIter next(&fRsnObjects); AliRsnLoop *obj = 0x0; - while ( (obj = (AliRsnLoop*)next()) ) { + while ( (obj = (AliRsnLoop *)next()) ) { if (obj->IsMixed()) continue; obj->DoLoop(evMain, rsnIH->GetSelector()); } - + PostData(1, fOutput); } //__________________________________________________________________________________________________ -void AliRsnAnalysisTask::UserExecMix(Option_t*) +void AliRsnAnalysisTask::UserExecMix(Option_t *) { // // Main loop for event-mixing computations @@ -189,7 +206,7 @@ void AliRsnAnalysisTask::UserExecMix(Option_t*) TObject *obj = 0x0; while ( (obj = next()) ) { if (obj->IsA() == AliRsnInputHandler::Class()) { - rsnIH = (AliRsnInputHandler*)obj; + rsnIH = (AliRsnInputHandler *)obj; //AliInfo(Form("Found object '%s' which is RSN input handler", obj->GetName())); evMain = rsnIH->GetRsnEvent(); id = fInputEHMain->InputEventHandlers()->IndexOf(obj); @@ -197,26 +214,26 @@ void AliRsnAnalysisTask::UserExecMix(Option_t*) } } } - + if (!evMain) return; // gets first input handler form mixing buffer - AliMultiInputEventHandler *ihMultiMix = dynamic_cast(fInputEHMix->InputEventHandler(0)); + AliMultiInputEventHandler *ihMultiMix = dynamic_cast(fInputEHMix->InputEventHandler(0)); if (ihMultiMix) { - rsnMixIH = dynamic_cast(ihMultiMix->InputEventHandler(id)); + rsnMixIH = dynamic_cast(ihMultiMix->InputEventHandler(id)); if (rsnMixIH) { evMix = rsnMixIH->GetRsnEvent(); if (!evMix) return; TObjArrayIter next(&fRsnObjects); AliRsnLoop *obj = 0x0; - while ( (obj = (AliRsnLoop*)next()) ) { + while ( (obj = (AliRsnLoop *)next()) ) { if (!obj->IsMixed()) continue; obj->DoLoop(evMain, rsnIH->GetSelector(), evMix, rsnMixIH->GetSelector()); } } } - + PostData(1, fOutput); } @@ -228,7 +245,7 @@ void AliRsnAnalysisTask::Terminate(Option_t *) // Called once at the end of the query // - fOutput = dynamic_cast(GetOutputData(1)); + fOutput = dynamic_cast(GetOutputData(1)); if (!fOutput) { AliError("Could not retrieve TList fOutput"); return; } } diff --git a/PWG2/RESONANCES/AliRsnAnalysisTask.h b/PWG2/RESONANCES/AliRsnAnalysisTask.h index cc2b5552def..4e02ed44ecf 100644 --- a/PWG2/RESONANCES/AliRsnAnalysisTask.h +++ b/PWG2/RESONANCES/AliRsnAnalysisTask.h @@ -18,21 +18,21 @@ public: AliRsnAnalysisTask(); AliRsnAnalysisTask(const char *name); - AliRsnAnalysisTask(const AliRsnAnalysisTask&); - AliRsnAnalysisTask& operator=(const AliRsnAnalysisTask&); + AliRsnAnalysisTask(const AliRsnAnalysisTask &); + AliRsnAnalysisTask &operator=(const AliRsnAnalysisTask &); virtual ~AliRsnAnalysisTask(); virtual void UserCreateOutputObjects(); virtual void UserExec(Option_t *option); - virtual void UserExecMix(Option_t*); + virtual void UserExecMix(Option_t *); virtual void Terminate(Option_t *); - + void AddLoop(AliRsnLoop *object); void InitInputHandlers(); void UseBigOutput(Bool_t b=kTRUE) { fBigOutput = b; } Bool_t IsBigOutput() { return fBigOutput; } - + private: TList *fOutput; // output list diff --git a/PWG2/RESONANCES/AliRsnCut.cxx b/PWG2/RESONANCES/AliRsnCut.cxx index 692edb5aa6b..464e092b13a 100644 --- a/PWG2/RESONANCES/AliRsnCut.cxx +++ b/PWG2/RESONANCES/AliRsnCut.cxx @@ -70,7 +70,7 @@ AliRsnCut::AliRsnCut } //______________________________________________________________________________ -AliRsnCut::AliRsnCut(const AliRsnCut& copy) : +AliRsnCut::AliRsnCut(const AliRsnCut ©) : AliRsnTarget(copy), fMinI(copy.fMinI), fMaxI(copy.fMaxI), @@ -87,16 +87,16 @@ AliRsnCut::AliRsnCut(const AliRsnCut& copy) : } //______________________________________________________________________________ -AliRsnCut& AliRsnCut::operator=(const AliRsnCut& copy) +AliRsnCut &AliRsnCut::operator=(const AliRsnCut ©) { // // Assignment operator. // Don't duplicate memory occupancy for pointer // - AliRsnTarget::operator=(copy); + AliRsnTarget::operator=(copy); if (this == ©) - return *this; + return *this; fMinI = copy.fMinI; fMaxI = copy.fMaxI; @@ -210,7 +210,7 @@ Bool_t AliRsnCut::OkRangeD() } //______________________________________________________________________________ -void AliRsnCut::Print(Option_t*) const +void AliRsnCut::Print(Option_t *) const { // // Override TObject::Print() method, diff --git a/PWG2/RESONANCES/AliRsnCut.h b/PWG2/RESONANCES/AliRsnCut.h index 1c42a478bba..b6c91ec48c9 100644 --- a/PWG2/RESONANCES/AliRsnCut.h +++ b/PWG2/RESONANCES/AliRsnCut.h @@ -26,8 +26,8 @@ public: AliRsnCut(const char *name = "dummy", RSNTARGET target = AliRsnTarget::kTargetTypes); AliRsnCut(const char *name, RSNTARGET target, Int_t imin, Int_t imax = 0 , Double_t dmin = 0., Double_t dmax = 0.); AliRsnCut(const char *name, RSNTARGET target, Double_t dmin, Double_t dmax = 0., Int_t imin = 0 , Int_t imax = 0); - AliRsnCut(const AliRsnCut& copy); - AliRsnCut& operator=(const AliRsnCut& copy); + AliRsnCut(const AliRsnCut ©); + AliRsnCut &operator=(const AliRsnCut ©); virtual ~AliRsnCut() { }; Int_t GetMinI() const {return fMinI;} diff --git a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx index 2c9ec05d72e..2ac8ffcc29c 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.cxx @@ -48,29 +48,29 @@ Bool_t AliRsnCutDaughterKStar2010PP::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // if no PID is required, accept if (fNoPID) return kTRUE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // check if TOF is matched // and computes all values used in the PID cut Bool_t isTOF = MatchTOF(track); @@ -80,7 +80,7 @@ Bool_t AliRsnCutDaughterKStar2010PP::IsSelected(TObject *obj) Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; Double_t maxTPC = 1E20; Double_t maxTOF = 1E20; - + // applies the cut differently depending on the PID and the momentum if (isTOF) { // TPC: 5sigma cut for all @@ -89,18 +89,18 @@ Bool_t AliRsnCutDaughterKStar2010PP::IsSelected(TObject *obj) if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; return (nsTOF <= maxTOF); } else { - // TPC: + // TPC: // all below 350 MeV: 5sigma // all between 350 and 500 MeV: 3sigma // pions above 500 MeV: 2sigma // kaons between 500 and 700 MeV: 2sigma // kaons above 700 MeV: rejected - if (pTPC <= 0.35) + if (pTPC <= 0.35) maxTPC = 5.0; else if (pTPC > 0.35 && pTPC <= 0.5) maxTPC = 3.0; - else { - if (fPID == AliPID::kPion) + else { + if (fPID == AliPID::kPion) maxTPC = 2.0; else if (fPID == AliPID::kKaon) { if (pTPC <= 0.7) diff --git a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h index b9c7f1b3660..2737c6d187b 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutDaughterKStar2010PP.h @@ -18,9 +18,9 @@ public: AliRsnCutDaughterKStar2010PP(const char *name = "", AliPID::EParticleType pid = AliPID::kPion); virtual ~AliRsnCutDaughterKStar2010PP() { } - + void SetNoPID(Bool_t yn = kTRUE) {fNoPID = yn;} - + void SetPID(AliPID::EParticleType type) {fPID = type;} AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} Bool_t MatchTOF(const AliVTrack *vtrack); @@ -29,7 +29,7 @@ public: private: Bool_t fNoPID; // flag to switch off PID check - + AliPID::EParticleType fPID; // PID for track AliRsnCutTrackQuality fCutQuality; // track quality cut diff --git a/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.cxx b/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.cxx index a43681ef486..cac3302fc21 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.cxx +++ b/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.cxx @@ -47,29 +47,29 @@ Bool_t AliRsnCutDaughterLStar2010::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track AliVTrack *track = fDaughter->Ref2Vtrack(); if (!track) { if (!fDaughter->GetRef()) AliWarning("NULL ref"); return kFALSE; } - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // check if TOF is matched // and computes all values used in the PID cut Bool_t isTOF = MatchTOF(track); @@ -79,7 +79,7 @@ Bool_t AliRsnCutDaughterLStar2010::IsSelected(TObject *obj) Double_t nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)); Double_t maxTPC = 1E20; Double_t maxTOF = 1E20; - + // applies the cut differently depending on the PID and the momentum if (isTOF) { // TPC: 5sigma cut for all @@ -88,14 +88,14 @@ Bool_t AliRsnCutDaughterLStar2010::IsSelected(TObject *obj) if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; return (nsTOF <= maxTOF); } else { - // TPC: + // TPC: // below 350 MeV: 5sigma // between 350 and 500 MeV: 3sigma // pions above 500 MeV: 2sigma // kaons between 500 and 700 MeV: 2sigma // kaons above 700 MeV: rejected // protons above 1200 MeV: rejected - if (pTPC <= 0.35) + if (pTPC <= 0.35) maxTPC = 5.0; else if (pTPC <= 0.5) maxTPC = 3.0; diff --git a/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.h b/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.h index 2e7cc382813..48a074c3534 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.h +++ b/PWG2/RESONANCES/AliRsnCutDaughterLStar2010.h @@ -18,7 +18,7 @@ public: AliRsnCutDaughterLStar2010(const char *name = "", AliPID::EParticleType pid = AliPID::kKaon); virtual ~AliRsnCutDaughterLStar2010() { } - + void SetPID(AliPID::EParticleType type) {fPID = type;} AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} Bool_t MatchTOF(const AliVTrack *vtrack); diff --git a/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx b/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx index 3933d10353a..8a1b0d91867 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.cxx @@ -48,29 +48,29 @@ Bool_t AliRsnCutDaughterSigmaStar2010PP::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track AliVTrack *track = fDaughter->Ref2Vtrack(); if (!track) { if (!fDaughter->GetRef()) AliWarning("NULL ref"); return kFALSE; } - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // check if TOF is matched // and computes all values used in the PID cut //Bool_t isTOF = MatchTOF(track); @@ -80,37 +80,37 @@ Bool_t AliRsnCutDaughterSigmaStar2010PP::IsSelected(TObject *obj) //Double_t nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)); //*Double_t maxTPC = 1E20; //Double_t maxTOF = 1E20; - + // applies the cut differently depending on the PID and the momentum //if (isTOF) { - // TPC: 5sigma cut for all - //if (nsTPC > 5.0) return kFALSE; - // TOF: 3sigma below 1.5 GeV, 2sigma above - //if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; - //return (nsTOF <= maxTOF); + // TPC: 5sigma cut for all + //if (nsTPC > 5.0) return kFALSE; + // TOF: 3sigma below 1.5 GeV, 2sigma above + //if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; + //return (nsTOF <= maxTOF); //} else { - + //For the moment TOF is not used - PID ONLY WITH TPC - 3 sigmas in the whole range - - // TPC: - // below 350 MeV: 5sigma - // between 350 and 500 MeV: 3sigma - // pions above 500 MeV: 2sigma - // kaons between 500 and 700 MeV: 2sigma - // kaons above 700 MeV: rejected - /*if (pTPC <= 0.35) - maxTPC = 5.0; - else if (pTPC <= 0.5) - maxTPC = 3.0; - else if (pTPC > 0.5 && fPID == AliPID::kPion) - maxTPC = 2.0; - else if (pTPC > 0.5 && pTPC <= 0.7 && fPID == AliPID::kKaon) - maxTPC = 2.0; - else - return kFALSE;*/ - //* maxTPC = 3.0; - //*return (nsTPC <= maxTPC); - + + // TPC: + // below 350 MeV: 5sigma + // between 350 and 500 MeV: 3sigma + // pions above 500 MeV: 2sigma + // kaons between 500 and 700 MeV: 2sigma + // kaons above 700 MeV: rejected + /*if (pTPC <= 0.35) + maxTPC = 5.0; + else if (pTPC <= 0.5) + maxTPC = 3.0; + else if (pTPC > 0.5 && fPID == AliPID::kPion) + maxTPC = 2.0; + else if (pTPC > 0.5 && pTPC <= 0.7 && fPID == AliPID::kKaon) + maxTPC = 2.0; + else + return kFALSE;*/ + //* maxTPC = 3.0; + //*return (nsTPC <= maxTPC); + AliDebugClass(2, "Good Pion (hallelujah)"); return kTRUE; - } +} diff --git a/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.h b/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.h index f10c70dba5a..5599bdcf235 100644 --- a/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutDaughterSigmaStar2010PP.h @@ -18,7 +18,7 @@ public: AliRsnCutDaughterSigmaStar2010PP(const char *name = "", AliPID::EParticleType pid = AliPID::kPion); virtual ~AliRsnCutDaughterSigmaStar2010PP() { } - + void SetPID(AliPID::EParticleType type) {fPID = type;} AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} Bool_t MatchTOF(const AliVTrack *vtrack); diff --git a/PWG2/RESONANCES/AliRsnCutKaon.cxx b/PWG2/RESONANCES/AliRsnCutKaon.cxx index d1bb630d75b..b43cddf3276 100644 --- a/PWG2/RESONANCES/AliRsnCutKaon.cxx +++ b/PWG2/RESONANCES/AliRsnCutKaon.cxx @@ -14,46 +14,46 @@ ClassImp(AliRsnCutKaon) -const char* AliRsnCutKaon::fgkCutName[AliRsnCutKaon::kNkaonCuts]={ - "kQuality_Std2010", - "kTOFMatch_Std2010", - "kFastTPCpid_Nsigma", - "kFastTPCpid_1point5sigma", - "kFastTPCpid_2sigma", - "kFastTPCpid_3sigma", - "kFastTOFpid_Nsigma", - "kFastTOFpid_1point5sigma", - "kFastTOFpid_2sigma", - "kFastTOFpid_3sigma", - "kTPCTOFpid_DefaultKstarPP2010" +const char *AliRsnCutKaon::fgkCutName[AliRsnCutKaon::kNkaonCuts]= { + "kQuality_Std2010", + "kTOFMatch_Std2010", + "kFastTPCpid_Nsigma", + "kFastTPCpid_1point5sigma", + "kFastTPCpid_2sigma", + "kFastTPCpid_3sigma", + "kFastTOFpid_Nsigma", + "kFastTOFpid_1point5sigma", + "kFastTOFpid_2sigma", + "kFastTOFpid_3sigma", + "kTPCTOFpid_DefaultKstarPP2010" }; //__________________________________________________________________________________________________ AliRsnCutKaon::AliRsnCutKaon(const char *name, AliRsnCutKaon::ERsnKaonCut cutID, AliPID::EParticleType pid) : - AliRsnCut(name, AliRsnTarget::kDaughter), - fNoPID(kFALSE), - fPID(pid), - fCutQuality(Form("%sQuality", name)), - fAppliedCutID(cutID), - fNsigmaCutTPC(1E6), - fNsigmaCutTOF(1E6) + AliRsnCut(name, AliRsnTarget::kDaughter), + fNoPID(kFALSE), + fPID(pid), + fCutQuality(Form("%sQuality", name)), + fAppliedCutID(cutID), + fNsigmaCutTPC(1E6), + fNsigmaCutTOF(1E6) { - // - // Constructor - // Initialize track quality cuts to 2010 defaults - // - fCutQuality.SetPtRange(0.15, 1E+20); - fCutQuality.SetEtaRange(-0.8, 0.8); - fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01"); - fCutQuality.SetDCAZmax(2.0); - fCutQuality.SetSPDminNClusters(1); - fCutQuality.SetITSminNClusters(0); - fCutQuality.SetITSmaxChi2(1E+20); - fCutQuality.SetTPCminNClusters(70); - fCutQuality.SetTPCmaxChi2(4.0); - fCutQuality.SetRejectKinkDaughters(); - fCutQuality.SetAODTestFilterBit(5); - AliInfo(Form("Applied cut on kaon candidate: %s", AliRsnCutKaon::fgkCutName[fAppliedCutID])); + // + // Constructor + // Initialize track quality cuts to 2010 defaults + // + fCutQuality.SetPtRange(0.15, 1E+20); + fCutQuality.SetEtaRange(-0.8, 0.8); + fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01"); + fCutQuality.SetDCAZmax(2.0); + fCutQuality.SetSPDminNClusters(1); + fCutQuality.SetITSminNClusters(0); + fCutQuality.SetITSmaxChi2(1E+20); + fCutQuality.SetTPCminNClusters(70); + fCutQuality.SetTPCmaxChi2(4.0); + fCutQuality.SetRejectKinkDaughters(); + fCutQuality.SetAODTestFilterBit(5); + AliInfo(Form("Applied cut on kaon candidate: %s", AliRsnCutKaon::fgkCutName[fAppliedCutID])); } //__________________________________________________________________________________________________ @@ -80,109 +80,109 @@ Bool_t AliRsnCutKaon::IsSelected(TObject *obj) // // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; - + Bool_t isSelected=kFALSE; switch (fAppliedCutID) - { - case AliRsnCutKaon::kQualityStd2010: - isSelected=IsSelectedByQualityStd2010(obj, 1, 1, 1); - break; - - case AliRsnCutKaon::kTOFMatchStd2010: - isSelected=IsSelectedByTOFMatchStd2010(obj); - break; - - case AliRsnCutKaon::kFastTPCpidNsigma: - isSelected=IsSelectedByFastTPCpidNsigma(obj,fNsigmaCutTPC); - break; - - case AliRsnCutKaon::kFastTPCpid1point5sigma: - isSelected=IsSelectedByFastTPCpid1point5sigma(obj); - break; - - case AliRsnCutKaon::kFastTPCpid2sigma: - isSelected=IsSelectedByFastTPCpid2sigma(obj); - break; - - case AliRsnCutKaon::kFastTPCpid3sigma: - isSelected=IsSelectedByFastTPCpid3sigma(obj); - break; - - case AliRsnCutKaon::kFastTOFpidNsigma: - isSelected=IsSelectedByFastTOFpidNsigma(obj,fNsigmaCutTOF); - break; - - case AliRsnCutKaon::kFastTOFpid1point5sigma: - isSelected=IsSelectedByFastTOFpid1point5sigma(obj); - break; - - case AliRsnCutKaon::kFastTOFpid2sigma: - isSelected=IsSelectedByFastTOFpid2sigma(obj); - break; - - case AliRsnCutKaon::kFastTOFpid3sigma: - isSelected=IsSelectedByFastTOFpid3sigma(obj); - break; - - case AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010: - isSelected=IsSelectedByTPCTOFpidDefaultKstarPP2010(obj); - break; - - default : - break; - } - + { + case AliRsnCutKaon::kQualityStd2010: + isSelected=IsSelectedByQualityStd2010(obj, 1, 1, 1); + break; + + case AliRsnCutKaon::kTOFMatchStd2010: + isSelected=IsSelectedByTOFMatchStd2010(obj); + break; + + case AliRsnCutKaon::kFastTPCpidNsigma: + isSelected=IsSelectedByFastTPCpidNsigma(obj,fNsigmaCutTPC); + break; + + case AliRsnCutKaon::kFastTPCpid1point5sigma: + isSelected=IsSelectedByFastTPCpid1point5sigma(obj); + break; + + case AliRsnCutKaon::kFastTPCpid2sigma: + isSelected=IsSelectedByFastTPCpid2sigma(obj); + break; + + case AliRsnCutKaon::kFastTPCpid3sigma: + isSelected=IsSelectedByFastTPCpid3sigma(obj); + break; + + case AliRsnCutKaon::kFastTOFpidNsigma: + isSelected=IsSelectedByFastTOFpidNsigma(obj,fNsigmaCutTOF); + break; + + case AliRsnCutKaon::kFastTOFpid1point5sigma: + isSelected=IsSelectedByFastTOFpid1point5sigma(obj); + break; + + case AliRsnCutKaon::kFastTOFpid2sigma: + isSelected=IsSelectedByFastTOFpid2sigma(obj); + break; + + case AliRsnCutKaon::kFastTOFpid3sigma: + isSelected=IsSelectedByFastTOFpid3sigma(obj); + break; + + case AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010: + isSelected=IsSelectedByTPCTOFpidDefaultKstarPP2010(obj); + break; + + default : + break; + } + return isSelected; } //----------------------------------------------------------- Bool_t AliRsnCutKaon::IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin=kTRUE, Bool_t requireTPCrefit=kTRUE, Bool_t requireITSrefit=kTRUE) { - //Checks if track passes the standard quality cuts - //defined for analysis in 2010 pp and PbPb data - - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - - fAppliedCutID= AliRsnCutKaon::kQualityStd2010; - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + //Checks if track passes the standard quality cuts + //defined for analysis in 2010 pp and PbPb data + + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + + fAppliedCutID= AliRsnCutKaon::kQualityStd2010; + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; - - //optionally check refit flags (to be used for Phi and kStar analysis) - if (requireTPCin && ((track->GetStatus() & AliESDtrack::kTPCin) == 0) ) return kFALSE; - if (requireTPCrefit && ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) ) return kFALSE; - if (requireITSrefit && ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) ) return kFALSE; - - // quality - if (!fCutQuality.IsSelected(obj)) return kFALSE; - return kTRUE; + + //optionally check refit flags (to be used for Phi and kStar analysis) + if (requireTPCin && ((track->GetStatus() & AliESDtrack::kTPCin) == 0) ) return kFALSE; + if (requireTPCrefit && ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) ) return kFALSE; + if (requireITSrefit && ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) ) return kFALSE; + + // quality + if (!fCutQuality.IsSelected(obj)) return kFALSE; + return kTRUE; } //----------------------------------------------------------- Bool_t AliRsnCutKaon::IsSelectedByTOFMatchStd2010(TObject *obj) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of TOF match: quality cuts 2010 + kTOFout + kTIME - (optionally) L > 350. cm cut can be added - */ + /* + fbellini@cern.ch, 05.dec.2011 + definition of TOF match: quality cuts 2010 + kTOFout + kTIME + (optionally) L > 350. cm cut can be added + */ if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; } fAppliedCutID=AliRsnCutKaon::kTOFMatchStd2010; - + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; return MatchTOF(track); } @@ -190,122 +190,122 @@ Bool_t AliRsnCutKaon::IsSelectedByTOFMatchStd2010(TObject *obj) //----------------------------------------------------------- Bool_t AliRsnCutKaon::IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut=10.) { - /* - fbellini@cern.ch, 05.dec.2011 Double_t pTPC = track->GetTPCmomentum(); - definition of fast TPC pid N-sigma: quality cuts 2010 + sigma cut on dE/dx without p dependence - */ - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - fAppliedCutID=AliRsnCutKaon::kFastTPCpidNsigma; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - - Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track,fPID)); - return (nsTPC <= nSigmaCut); + /* + fbellini@cern.ch, 05.dec.2011 Double_t pTPC = track->GetTPCmomentum(); + definition of fast TPC pid N-sigma: quality cuts 2010 + sigma cut on dE/dx without p dependence + */ + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + fAppliedCutID=AliRsnCutKaon::kFastTPCpidNsigma; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + + Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track,fPID)); + return (nsTPC <= nSigmaCut); } //----------------------------------------------------------- Bool_t AliRsnCutKaon::IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut=10.) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of fast TOF pid N-sigma: quality cuts 2010 + sigma cut on t-t_0-t_exp without p dependence - */ - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - - fAppliedCutID=AliRsnCutKaon::kFastTOFpidNsigma; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - Bool_t isTOF = MatchTOF(track); - Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; - - return (nsTOF <= nSigmaCut); + /* + fbellini@cern.ch, 05.dec.2011 + definition of fast TOF pid N-sigma: quality cuts 2010 + sigma cut on t-t_0-t_exp without p dependence + */ + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + + fAppliedCutID=AliRsnCutKaon::kFastTOFpidNsigma; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + Bool_t isTOF = MatchTOF(track); + Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; + + return (nsTOF <= nSigmaCut); } //----------------------------------------------------------- Bool_t AliRsnCutKaon::IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of TPC-TOF pid for pp phi and Kstar analysis on 2010 data: - quality cuts 2010 + sigma cut on dE/dx with pTPC dependence + sigma cut on t-t_0-t_exp with p dependence - */ - - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - fAppliedCutID=AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) //require ITS+TPCrefit and TPCin - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - - Bool_t isTOF = MatchTOF(track); - Double_t pTPC = track->GetTPCmomentum(); - Double_t p = track->P(); - Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID)); - Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; - Double_t maxTPC = 1E20; - Double_t maxTOF = 1E20; - - if (isTOF) { - // TPC: 5sigma cut for all - if (nsTPC > 5.0) return kFALSE; - // TOF: 3sigma below 1.5 GeV, 2sigma above - if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; - return (nsTOF <= maxTOF); - } else { - // TPC: - // all below 350 MeV: 5sigma - // all between 350 and 500 MeV: 3sigma - // pios above 500 MeV: 2sigma - // kaons between 500 and 700 MeV: 2sigma - // kaons above 700 MeV: rejected - if (pTPC <= 0.35) - maxTPC = 5.0; - else if (pTPC > 0.35 && pTPC <= 0.5) - maxTPC = 3.0; - else { - if (pTPC <= 0.7) maxTPC = 2.0; - else - return kFALSE; - } - return (nsTPC <= maxTPC); - } + /* + fbellini@cern.ch, 05.dec.2011 + definition of TPC-TOF pid for pp phi and Kstar analysis on 2010 data: + quality cuts 2010 + sigma cut on dE/dx with pTPC dependence + sigma cut on t-t_0-t_exp with p dependence + */ + + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + fAppliedCutID=AliRsnCutKaon::kTPCTOFpidDefaultKstarPP2010; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) //require ITS+TPCrefit and TPCin + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + + Bool_t isTOF = MatchTOF(track); + Double_t pTPC = track->GetTPCmomentum(); + Double_t p = track->P(); + Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID)); + Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; + Double_t maxTPC = 1E20; + Double_t maxTOF = 1E20; + + if (isTOF) { + // TPC: 5sigma cut for all + if (nsTPC > 5.0) return kFALSE; + // TOF: 3sigma below 1.5 GeV, 2sigma above + if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; + return (nsTOF <= maxTOF); + } else { + // TPC: + // all below 350 MeV: 5sigma + // all between 350 and 500 MeV: 3sigma + // pios above 500 MeV: 2sigma + // kaons between 500 and 700 MeV: 2sigma + // kaons above 700 MeV: rejected + if (pTPC <= 0.35) + maxTPC = 5.0; + else if (pTPC > 0.35 && pTPC <= 0.5) + maxTPC = 3.0; + else { + if (pTPC <= 0.7) maxTPC = 2.0; + else + return kFALSE; + } + return (nsTPC <= maxTPC); + } } diff --git a/PWG2/RESONANCES/AliRsnCutKaon.h b/PWG2/RESONANCES/AliRsnCutKaon.h index f40da84ea40..6bb705db332 100644 --- a/PWG2/RESONANCES/AliRsnCutKaon.h +++ b/PWG2/RESONANCES/AliRsnCutKaon.h @@ -14,66 +14,66 @@ class AliRsnCutKaon : public AliRsnCut { public: - enum ERsnKaonCut { - kQualityStd2010, - kTOFMatchStd2010, - kFastTPCpidNsigma, - kFastTPCpid1point5sigma, - kFastTPCpid2sigma, - kFastTPCpid3sigma, - kFastTOFpidNsigma, - kFastTOFpid1point5sigma, - kFastTOFpid2sigma, - kFastTOFpid3sigma, - kTPCTOFpidDefaultKstarPP2010, - kNkaonCuts - }; - - AliRsnCutKaon(const char *name = "", AliRsnCutKaon::ERsnKaonCut cutID = AliRsnCutKaon::kQualityStd2010 , AliPID::EParticleType pid = AliPID::kKaon); - virtual ~AliRsnCutKaon() { } - - void SetNoPID(Bool_t yn = kTRUE) {fNoPID = yn;} - AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} - Bool_t MatchTOF(const AliVTrack *vtrack); - - Bool_t IsSelected(TObject *obj); - - Bool_t IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin, Bool_t requireTPCrefit, Bool_t requireITSrefit ); - Bool_t IsSelectedByTOFMatchStd2010(TObject *obj); - - Bool_t IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut); - Bool_t IsSelectedByFastTPCpid1point5sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 1.5);} - Bool_t IsSelectedByFastTPCpid2sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 2.0);} - Bool_t IsSelectedByFastTPCpid3sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 3.0);} - - Bool_t IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut); - Bool_t IsSelectedByFastTOFpid1point5sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 1.5);} - Bool_t IsSelectedByFastTOFpid2sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 2.0);} - Bool_t IsSelectedByFastTOFpid3sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 3.0);} - - Bool_t IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj); - - //setters - void SetNsigmaCutTPC(Float_t nMaxSigmaCut=1E6){fNsigmaCutTPC=nMaxSigmaCut; return;} - void SetNsigmaCutTOF(Float_t nMaxSigmaCut=1E6){fNsigmaCutTOF=nMaxSigmaCut; return;} - - //getters - const char * GetAppliedKaonCutName() { if (fAppliedCutID>0){ return fgkCutName[fAppliedCutID];} else {return "none";}} - Int_t GetAppliedKaonCutId() { return fAppliedCutID;} - const char * GetKaonCutName(const AliRsnCutKaon::ERsnKaonCut cutID) { return fgkCutName[cutID];} - - private: - - Bool_t fNoPID; // flag to switch off PID check - AliPID::EParticleType fPID; // PID for track - AliRsnCutTrackQuality fCutQuality; // track quality cut - Int_t fAppliedCutID; // ID of applied cut - static const char* fgkCutName[kNkaonCuts]; //array with cuts names - Float_t fNsigmaCutTPC; // max sigma for TPC dE/dx fast cut - Float_t fNsigmaCutTOF; // max sigma for TOF t-t0-t_exp fast cut - - ClassDef(AliRsnCutKaon, 1) // cut definitions for K* - + enum ERsnKaonCut { + kQualityStd2010, + kTOFMatchStd2010, + kFastTPCpidNsigma, + kFastTPCpid1point5sigma, + kFastTPCpid2sigma, + kFastTPCpid3sigma, + kFastTOFpidNsigma, + kFastTOFpid1point5sigma, + kFastTOFpid2sigma, + kFastTOFpid3sigma, + kTPCTOFpidDefaultKstarPP2010, + kNkaonCuts + }; + + AliRsnCutKaon(const char *name = "", AliRsnCutKaon::ERsnKaonCut cutID = AliRsnCutKaon::kQualityStd2010 , AliPID::EParticleType pid = AliPID::kKaon); + virtual ~AliRsnCutKaon() { } + + void SetNoPID(Bool_t yn = kTRUE) {fNoPID = yn;} + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + Bool_t MatchTOF(const AliVTrack *vtrack); + + Bool_t IsSelected(TObject *obj); + + Bool_t IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin, Bool_t requireTPCrefit, Bool_t requireITSrefit ); + Bool_t IsSelectedByTOFMatchStd2010(TObject *obj); + + Bool_t IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut); + Bool_t IsSelectedByFastTPCpid1point5sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 1.5);} + Bool_t IsSelectedByFastTPCpid2sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 2.0);} + Bool_t IsSelectedByFastTPCpid3sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 3.0);} + + Bool_t IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut); + Bool_t IsSelectedByFastTOFpid1point5sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 1.5);} + Bool_t IsSelectedByFastTOFpid2sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 2.0);} + Bool_t IsSelectedByFastTOFpid3sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 3.0);} + + Bool_t IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj); + + //setters + void SetNsigmaCutTPC(Float_t nMaxSigmaCut=1E6) {fNsigmaCutTPC=nMaxSigmaCut; return;} + void SetNsigmaCutTOF(Float_t nMaxSigmaCut=1E6) {fNsigmaCutTOF=nMaxSigmaCut; return;} + + //getters + const char *GetAppliedKaonCutName() { if (fAppliedCutID>0) { return fgkCutName[fAppliedCutID];} else {return "none";}} + Int_t GetAppliedKaonCutId() { return fAppliedCutID;} + const char *GetKaonCutName(const AliRsnCutKaon::ERsnKaonCut cutID) { return fgkCutName[cutID];} + +private: + + Bool_t fNoPID; // flag to switch off PID check + AliPID::EParticleType fPID; // PID for track + AliRsnCutTrackQuality fCutQuality; // track quality cut + Int_t fAppliedCutID; // ID of applied cut + static const char *fgkCutName[kNkaonCuts]; //array with cuts names + Float_t fNsigmaCutTPC; // max sigma for TPC dE/dx fast cut + Float_t fNsigmaCutTOF; // max sigma for TOF t-t0-t_exp fast cut + + ClassDef(AliRsnCutKaon, 1) // cut definitions for K* + }; #endif diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx index 559671ac95d..67d098b49c2 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx @@ -1,6 +1,6 @@ // // This cut implements all the checks done to accept a track as a Kaon -// for the PbPb analysis using 2010 runs. +// for the PbPb analysis using 2010 runs. // It is based on standard cuts on track quality and nsigma cuts // with respect to the TPC and TOF signals for the PID. // @@ -65,7 +65,7 @@ AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010(const AliRsnCutKaonForPhi2010 & } //__________________________________________________________________________________________________ -AliRsnCutKaonForPhi2010& AliRsnCutKaonForPhi2010::operator=(const AliRsnCutKaonForPhi2010 ©) +AliRsnCutKaonForPhi2010 &AliRsnCutKaonForPhi2010::operator=(const AliRsnCutKaonForPhi2010 ©) { // // Assignment operator @@ -73,14 +73,14 @@ AliRsnCutKaonForPhi2010& AliRsnCutKaonForPhi2010::operator=(const AliRsnCutKaonF AliRsnCut::operator=(copy); if (this == ©) - return *this; + return *this; fMode = copy.fMode; fCutTPC = copy.fCutTPC; fCutTOF = copy.fCutTOF; fTOFthreshold = copy.fTOFthreshold; fMyPID = copy.fMyPID; fCutQuality = copy.fCutQuality; - + return *this; } @@ -91,7 +91,7 @@ void AliRsnCutKaonForPhi2010::InitMyPID(Bool_t isMC, Bool_t isESD) // Initialize manual PID object // - if (isESD) + if (isESD) fMyPID = new AliESDpid(isMC); else fMyPID = new AliAODpidUtil(isMC); @@ -106,31 +106,31 @@ Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track AliVTrack *track = fDaughter->Ref2Vtrack(); if (!track) { if (!fDaughter->GetRef()) AliWarning("NULL ref"); return kFALSE; } - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // check quality and reject always bad quality tracks if (!fCutQuality.IsSelected(obj)) { AliDebugClass(1, Form("[%s] Track quality is bad", GetName())); return kFALSE; } - + // initialize check variables Bool_t accept = kFALSE; Bool_t isTOF = MatchTOF(track); Double_t nsTPC = 1E20; Double_t nsTOF = 1E20; - + // if PID is required, compute it check initialization of PID object if (fMode >= kOnlyTPC && fMode <= kDefaultPID) { AliPIDResponse *pid = fEvent->GetPIDResponse(); @@ -139,14 +139,14 @@ Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj) return kFALSE; } // TPC PID - if (fMyPID) + if (fMyPID) nsTPC = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon)); else nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon)); // TOF PID nsTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon)); } - + // decide cut result depending on mode switch (fMode) { case kQuality: @@ -201,7 +201,7 @@ Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj) AliDebugClass(1, Form("[%s] Wrong mode", GetName())); accept = kFALSE; } - + AliDebugClass(1, Form("[%s] Track %s", GetName(), (accept ? "accepted" : "rejected"))); return accept; } diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h index 1be0709b932..0d4e3bb194e 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h @@ -3,7 +3,7 @@ // // This cut implements all the checks done to accept a track as a Kaon -// for the PbPb analysis using 2010 runs. +// for the PbPb analysis using 2010 runs. // It is based on standard cuts on track quality and nsigma cuts // with respect to the TPC and TOF signals for the PID. // @@ -26,20 +26,20 @@ public: AliRsnCutKaonForPhi2010(const char *name = "", Double_t nSigmaTPC = 3.0, Double_t nSigmaTOF = 3.0, Double_t tofLimit = 0.8); AliRsnCutKaonForPhi2010(const AliRsnCutKaonForPhi2010 ©); - AliRsnCutKaonForPhi2010& operator=(const AliRsnCutKaonForPhi2010 ©); + AliRsnCutKaonForPhi2010 &operator=(const AliRsnCutKaonForPhi2010 ©); virtual ~AliRsnCutKaonForPhi2010() { } - + virtual Bool_t IsSelected(TObject *obj); - + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} Double_t GetTOFthreshold() const {return fTOFthreshold;} AliPIDResponse *MyPID() {return fMyPID;} - + void SetMode(ECutMode mode) {fMode = mode;} void SetCutTPC(Double_t cut) {fCutTPC = cut;} void SetCutTOF(Double_t cut) {fCutTOF = cut;} void SetTOFthreshold(Double_t value) {fTOFthreshold = value;} - + void InitMyPID(Bool_t isMC, Bool_t isESD); Bool_t MatchTOF(const AliVTrack *vtrack); diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx index 39c54490286..26650e2a85a 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx @@ -1,6 +1,6 @@ // // This cut implements all the checks done to accept a track as a Kaon -// for the pp analysis using 2010 runs. +// for the pp analysis using 2010 runs. // It is based on standard cuts on track quality and nsigma cuts // with respect to the TPC and TOF signals for the PID. // @@ -64,7 +64,7 @@ AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const AliRsnCutKaonForPhi20 } //__________________________________________________________________________________________________ -AliRsnCutKaonForPhi2010PP& AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutKaonForPhi2010PP ©) +AliRsnCutKaonForPhi2010PP &AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutKaonForPhi2010PP ©) { // // Assignment operator @@ -72,14 +72,14 @@ AliRsnCutKaonForPhi2010PP& AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutK AliRsnCut::operator=(copy); if (this == ©) - return *this; + return *this; fNSigmaTPCLow = copy.fNSigmaTPCLow; fNSigmaTPCHigh = copy.fNSigmaTPCHigh; fLimitTPC = copy.fLimitTPC; fNSigmaTOF = copy.fNSigmaTOF; fMyPID = copy.fMyPID; fCutQuality = copy.fCutQuality; - + return *this; } @@ -90,7 +90,7 @@ void AliRsnCutKaonForPhi2010PP::InitMyPID(Bool_t isMC, Bool_t isESD) // Initialize manual PID object // - if (isESD) + if (isESD) fMyPID = new AliESDpid(isMC); else fMyPID = new AliAODpidUtil(isMC); @@ -105,44 +105,44 @@ Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // PID TPC : // depends on momentum // and if local PID object is initialized, it is used instead of that got from manager Double_t mom = track->GetTPCmomentum(); mom = TMath::Abs(mom); - if (mom < fLimitTPC) + if (mom < fLimitTPC) SetRangeD(0.0, fNSigmaTPCLow); else SetRangeD(0.0, fNSigmaTPCHigh); - if (fMyPID) + if (fMyPID) fCutValueD = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon)); else fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon)); if (!OkRangeD()) return kFALSE; - + // if TOF is not matched, end here // otherwise check TOF - if (!MatchTOF(track)) + if (!MatchTOF(track)) return kTRUE; else { SetRangeD(0.0, fNSigmaTOF); diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h index cf7712c65d3..c127f28f7e2 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h @@ -3,7 +3,7 @@ // // This cut implements all the checks done to accept a track as a Kaon -// for the pp analysis using 2010 runs. +// for the pp analysis using 2010 runs. // It is based on standard cuts on track quality and nsigma cuts // with respect to the TPC and TOF signals for the PID. // @@ -18,27 +18,27 @@ public: AliRsnCutKaonForPhi2010PP(const char *name = ""); AliRsnCutKaonForPhi2010PP(const AliRsnCutKaonForPhi2010PP ©); - AliRsnCutKaonForPhi2010PP& operator=(const AliRsnCutKaonForPhi2010PP ©); + AliRsnCutKaonForPhi2010PP &operator=(const AliRsnCutKaonForPhi2010PP ©); virtual ~AliRsnCutKaonForPhi2010PP() { } - + void SetTPCNSigmaLow (Double_t v) {fNSigmaTPCLow = v;} void SetTPCNSigmaHigh(Double_t v) {fNSigmaTPCHigh = v;} void SetTPCLimit(Double_t v) {fLimitTPC = v;} void SetTOFNSigma(Double_t v) {fNSigmaTOF = v;} - + virtual Bool_t IsSelected(TObject *obj); void InitMyPID(Bool_t isMC, Bool_t isESD); - + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} AliPIDResponse *MyPID() {return fMyPID;} private: Bool_t MatchTOF(const AliVTrack *vtrack); - + Double_t fNSigmaTPCLow; // TPC: nsigma cut below limit Double_t fNSigmaTPCHigh; // TPC: nsigma cut above limit - Double_t fLimitTPC; // TPC: momentum limit + Double_t fLimitTPC; // TPC: momentum limit Double_t fNSigmaTOF; // TOF: nsigma cut (unique) AliPIDResponse *fMyPID; // PID response object to be configured manyally diff --git a/PWG2/RESONANCES/AliRsnCutManager.cxx b/PWG2/RESONANCES/AliRsnCutManager.cxx index d7cf2382211..f311c03b34d 100644 --- a/PWG2/RESONANCES/AliRsnCutManager.cxx +++ b/PWG2/RESONANCES/AliRsnCutManager.cxx @@ -64,13 +64,13 @@ AliRsnCutManager::AliRsnCutManager(const AliRsnCutManager &cut) : } //_____________________________________________________________________________ -AliRsnCutManager& AliRsnCutManager::operator=(const AliRsnCutManager &cut) +AliRsnCutManager &AliRsnCutManager::operator=(const AliRsnCutManager &cut) { // // Assign operator // - if (this == &cut) - return *this; + if (this == &cut) + return *this; SetName(cut.GetName()); SetTitle(cut.GetTitle()); diff --git a/PWG2/RESONANCES/AliRsnCutManager.h b/PWG2/RESONANCES/AliRsnCutManager.h index 7bbf1de350b..3677f281a23 100644 --- a/PWG2/RESONANCES/AliRsnCutManager.h +++ b/PWG2/RESONANCES/AliRsnCutManager.h @@ -32,15 +32,15 @@ class AliRsnCutManager : public TNamed { public: AliRsnCutManager(); - AliRsnCutManager(const char *name, const char* title = ""); + AliRsnCutManager(const char *name, const char *title = ""); AliRsnCutManager(const AliRsnCutManager &cut); - AliRsnCutManager& operator=(const AliRsnCutManager& cut); + AliRsnCutManager &operator=(const AliRsnCutManager &cut); ~AliRsnCutManager(); - AliRsnCutSet* GetCommonDaughterCuts() {return &fDaughterCutsCommon;} - AliRsnCutSet* GetDaughter1Cuts() {return &fDaughterCuts1;} - AliRsnCutSet* GetDaughter2Cuts() {return &fDaughterCuts2;} - AliRsnCutSet* GetMotherCuts() {return &fMotherCuts;} + AliRsnCutSet *GetCommonDaughterCuts() {return &fDaughterCutsCommon;} + AliRsnCutSet *GetDaughter1Cuts() {return &fDaughterCuts1;} + AliRsnCutSet *GetDaughter2Cuts() {return &fDaughterCuts2;} + AliRsnCutSet *GetMotherCuts() {return &fMotherCuts;} Bool_t IsSelected(TObject *object); Bool_t PassCommonDaughterCuts(AliRsnDaughter *daughter) {return fDaughterCutsCommon.IsSelected(daughter);} @@ -67,9 +67,9 @@ inline Bool_t AliRsnCutManager::IsSelected(TObject *object) // if (object->InheritsFrom(AliRsnDaughter::Class())) { - return PassCommonDaughterCuts((AliRsnDaughter*)object); + return PassCommonDaughterCuts((AliRsnDaughter *)object); } else if (object->InheritsFrom(AliRsnMother::Class())) { - AliRsnMother *mother = (AliRsnMother*)object; + AliRsnMother *mother = (AliRsnMother *)object; if (!PassCommonDaughterCuts(mother->GetDaughter(0))) return kFALSE; if (!PassCommonDaughterCuts(mother->GetDaughter(1))) return kFALSE; if (!PassDaughter1Cuts(mother->GetDaughter(0))) return kFALSE; diff --git a/PWG2/RESONANCES/AliRsnCutMiniPair.cxx b/PWG2/RESONANCES/AliRsnCutMiniPair.cxx index e8f6225f114..bdf06c328c1 100644 --- a/PWG2/RESONANCES/AliRsnCutMiniPair.cxx +++ b/PWG2/RESONANCES/AliRsnCutMiniPair.cxx @@ -30,12 +30,12 @@ Bool_t AliRsnCutMiniPair::IsSelected(TObject *obj) // Global check // - AliRsnMiniPair *pair = dynamic_cast(obj); + AliRsnMiniPair *pair = dynamic_cast(obj); if (!pair) { AliError("This cut applies only to mini-pairs"); return kFALSE; } - + switch (fType) { case kRapidityRange: fCutValueD = pair->Y(0); diff --git a/PWG2/RESONANCES/AliRsnCutMiniPair.h b/PWG2/RESONANCES/AliRsnCutMiniPair.h index f44a8c12433..2f27c413d91 100644 --- a/PWG2/RESONANCES/AliRsnCutMiniPair.h +++ b/PWG2/RESONANCES/AliRsnCutMiniPair.h @@ -24,7 +24,7 @@ public: AliRsnCutMiniPair(const char *name = "cut", EType type = kTypes); virtual ~AliRsnCutMiniPair() { } - + virtual Bool_t IsSelected(TObject *obj); private: diff --git a/PWG2/RESONANCES/AliRsnCutMomentumComparison.cxx b/PWG2/RESONANCES/AliRsnCutMomentumComparison.cxx index b56c477f90c..220141cd20b 100644 --- a/PWG2/RESONANCES/AliRsnCutMomentumComparison.cxx +++ b/PWG2/RESONANCES/AliRsnCutMomentumComparison.cxx @@ -34,7 +34,7 @@ AliRsnCutMomentumComparison::AliRsnCutMomentumComparison(const char *name, EMode } //_________________________________________________________________________________________________ -AliRsnCutMomentumComparison::AliRsnCutMomentumComparison(const AliRsnCutMomentumComparison& copy) : +AliRsnCutMomentumComparison::AliRsnCutMomentumComparison(const AliRsnCutMomentumComparison ©) : AliRsnCut(copy), fMode(copy.fMode) { @@ -44,7 +44,7 @@ AliRsnCutMomentumComparison::AliRsnCutMomentumComparison(const AliRsnCutMomentum } //_________________________________________________________________________________________________ -AliRsnCutMomentumComparison& AliRsnCutMomentumComparison::operator=(const AliRsnCutMomentumComparison& copy) +AliRsnCutMomentumComparison &AliRsnCutMomentumComparison::operator=(const AliRsnCutMomentumComparison ©) { // // Assignment operator @@ -52,9 +52,9 @@ AliRsnCutMomentumComparison& AliRsnCutMomentumComparison::operator=(const AliRsn AliRsnCut::operator=(copy); if (this == ©) - return *this; + return *this; fMode = copy.fMode; - + return (*this); } @@ -73,7 +73,7 @@ Bool_t AliRsnCutMomentumComparison::IsSelected(TObject *object) Double_t p2 = fMother->GetDaughter(1)->GetRef()->P(); Double_t pt1 = fMother->GetDaughter(0)->GetRef()->Pt(); Double_t pt2 = fMother->GetDaughter(1)->GetRef()->Pt(); - + switch (fMode) { case kFirstLargerP : return (p1 > p2); diff --git a/PWG2/RESONANCES/AliRsnCutMomentumComparison.h b/PWG2/RESONANCES/AliRsnCutMomentumComparison.h index a4a51a5ba13..b7f76738e36 100644 --- a/PWG2/RESONANCES/AliRsnCutMomentumComparison.h +++ b/PWG2/RESONANCES/AliRsnCutMomentumComparison.h @@ -24,8 +24,8 @@ public: }; AliRsnCutMomentumComparison(const char *name = "cutMomComparison", EMode mode = kFirstLargerPt); - AliRsnCutMomentumComparison(const AliRsnCutMomentumComparison& copy); - AliRsnCutMomentumComparison& operator=(const AliRsnCutMomentumComparison& copy); + AliRsnCutMomentumComparison(const AliRsnCutMomentumComparison ©); + AliRsnCutMomentumComparison &operator=(const AliRsnCutMomentumComparison ©); virtual ~AliRsnCutMomentumComparison() {;}; virtual Bool_t IsSelected(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnCutPID.cxx b/PWG2/RESONANCES/AliRsnCutPID.cxx index b13b0231903..ce6ca92a787 100644 --- a/PWG2/RESONANCES/AliRsnCutPID.cxx +++ b/PWG2/RESONANCES/AliRsnCutPID.cxx @@ -168,7 +168,7 @@ Bool_t AliRsnCutPID::ComputeWeights(AliRsnDaughter *daughter) } //_________________________________________________________________________________________________ -Int_t AliRsnCutPID::RealisticPID(AliRsnDaughter * const daughter, Double_t &prob) +Int_t AliRsnCutPID::RealisticPID(AliRsnDaughter *const daughter, Double_t &prob) { // // Combines the weights collected from chosen detectors with the priors @@ -214,7 +214,7 @@ Int_t AliRsnCutPID::RealisticPID(AliRsnDaughter * const daughter, Double_t &prob } //_________________________________________________________________________________________________ -Int_t AliRsnCutPID::PerfectPID(AliRsnDaughter * const daughter) +Int_t AliRsnCutPID::PerfectPID(AliRsnDaughter *const daughter) { // // If MC is present, retrieve the particle corresponding to the used track diff --git a/PWG2/RESONANCES/AliRsnCutPID.h b/PWG2/RESONANCES/AliRsnCutPID.h index 772bca97dce..6a5040e0373 100644 --- a/PWG2/RESONANCES/AliRsnCutPID.h +++ b/PWG2/RESONANCES/AliRsnCutPID.h @@ -41,8 +41,8 @@ public: void ExcludeDetector(EDetector det) {if (CheckBounds(det)) fUseDetector[det] = kFALSE;} Bool_t ComputeWeights(AliRsnDaughter *daughter); - Int_t RealisticPID(AliRsnDaughter * const daughter, Double_t &prob); - Int_t PerfectPID(AliRsnDaughter * const daughter); + Int_t RealisticPID(AliRsnDaughter *const daughter, Double_t &prob); + Int_t PerfectPID(AliRsnDaughter *const daughter); Double_t GetWeight(Int_t i) const {if (i >= 0 && i < AliPID::kSPECIES) return fWeight[i]; return 0.0;} virtual Bool_t IsSelected(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnCutPIDITS.cxx b/PWG2/RESONANCES/AliRsnCutPIDITS.cxx index d27bd384a6e..f0a06757aff 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDITS.cxx +++ b/PWG2/RESONANCES/AliRsnCutPIDITS.cxx @@ -46,7 +46,7 @@ AliRsnCutPIDITS::AliRsnCutPIDITS //_________________________________________________________________________________________________ AliRsnCutPIDITS::AliRsnCutPIDITS -(const AliRsnCutPIDITS& copy) : +(const AliRsnCutPIDITS ©) : AliRsnCut(copy), fIsMC(copy.fIsMC), fRejectOutside(copy.fRejectOutside), @@ -62,15 +62,15 @@ AliRsnCutPIDITS::AliRsnCutPIDITS } //_________________________________________________________________________________________________ -AliRsnCutPIDITS& AliRsnCutPIDITS::operator=(const AliRsnCutPIDITS& copy) +AliRsnCutPIDITS &AliRsnCutPIDITS::operator=(const AliRsnCutPIDITS ©) { // // Assignment operator // AliRsnCut::operator=(copy); - if (this == ©) - return *this; + if (this == ©) + return *this; fIsMC = copy.fIsMC; fRejectOutside = copy.fRejectOutside; diff --git a/PWG2/RESONANCES/AliRsnCutPIDITS.h b/PWG2/RESONANCES/AliRsnCutPIDITS.h index 689e0ec48ab..fa4d6b045d2 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDITS.h +++ b/PWG2/RESONANCES/AliRsnCutPIDITS.h @@ -34,12 +34,12 @@ public: Double_t nSigmaMax = 3., Bool_t rejectOutside = kTRUE); - AliRsnCutPIDITS(const AliRsnCutPIDITS& copy); - AliRsnCutPIDITS& operator=(const AliRsnCutPIDITS& copy); + AliRsnCutPIDITS(const AliRsnCutPIDITS ©); + AliRsnCutPIDITS &operator=(const AliRsnCutPIDITS ©); virtual ~AliRsnCutPIDITS() { } - AliESDpid* ESDpid() {return fESDpid;} - AliAODpidUtil* AODpid() {return fAODpid;} + AliESDpid *ESDpid() {return fESDpid;} + AliAODpidUtil *AODpid() {return fAODpid;} void SetMC(Bool_t mc = kTRUE) {fIsMC = mc;} void SetRejectOutside(Bool_t yn = kTRUE) {fRejectOutside = yn;} diff --git a/PWG2/RESONANCES/AliRsnCutPIDNSigma.cxx b/PWG2/RESONANCES/AliRsnCutPIDNSigma.cxx index 4eee1408434..9eb63e2ec0a 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDNSigma.cxx +++ b/PWG2/RESONANCES/AliRsnCutPIDNSigma.cxx @@ -26,7 +26,7 @@ ClassImp(AliRsnCutPIDNSigma::AliRsnPIDRange) ClassImp(AliRsnCutPIDNSigma) //_________________________________________________________________________________________________ -AliRsnCutPIDNSigma::AliRsnCutPIDNSigma() : +AliRsnCutPIDNSigma::AliRsnCutPIDNSigma() : AliRsnCut("cut", AliRsnTarget::kDaughter), fSpecies(AliPID::kUnknown), fDetector(kDetectors), @@ -60,7 +60,7 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma //_________________________________________________________________________________________________ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma -(const AliRsnCutPIDNSigma& copy) : +(const AliRsnCutPIDNSigma ©) : AliRsnCut(copy), fSpecies(copy.fSpecies), fDetector(copy.fDetector), @@ -76,7 +76,7 @@ AliRsnCutPIDNSigma::AliRsnCutPIDNSigma } //_________________________________________________________________________________________________ -AliRsnCutPIDNSigma& AliRsnCutPIDNSigma::operator=(const AliRsnCutPIDNSigma& copy) +AliRsnCutPIDNSigma &AliRsnCutPIDNSigma::operator=(const AliRsnCutPIDNSigma ©) { // // Assignment operator @@ -84,7 +84,7 @@ AliRsnCutPIDNSigma& AliRsnCutPIDNSigma::operator=(const AliRsnCutPIDNSigma& copy AliRsnCut::operator=(copy); if (this == ©) - return *this; + return *this; fSpecies = copy.fSpecies; fDetector = copy.fDetector; fRejectUnmatched = copy.fRejectUnmatched; @@ -101,7 +101,7 @@ void AliRsnCutPIDNSigma::InitMyPID(Bool_t isMC, Bool_t isESD) // Initialize manual PID object // - if (isESD) + if (isESD) fMyPID = new AliESDpid(isMC); else fMyPID = new AliAODpidUtil(isMC); @@ -118,13 +118,13 @@ Bool_t AliRsnCutPIDNSigma::IsSelected(TObject *object) // coherence check if (!TargetOK(object)) return kFALSE; - + // check initialization of PID object // if manual PID is used, use that, otherwise get from source event AliPIDResponse *pid = 0x0; - if (fMyPID) - pid = fMyPID; - else + if (fMyPID) + pid = fMyPID; + else pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); @@ -138,7 +138,7 @@ Bool_t AliRsnCutPIDNSigma::IsSelected(TObject *object) AliDebugClass(2, "Referenced daughter is not a track"); return kFALSE; } - + // check matching, if required // a) if detector is not matched and matching is required, reject the track // b) if detector is not matched and matching is not required, accept blindly the track @@ -147,10 +147,10 @@ Bool_t AliRsnCutPIDNSigma::IsSelected(TObject *object) AliDebugClass(2, Form("Detector not matched. fRejectUnmatched = %s --> track is %s", (fRejectUnmatched ? "true" : "false"), (fRejectUnmatched ? "rejected" : "accepted"))); return (!fRejectUnmatched); } - + // get reference momentum fTrackMom = (fDetector == kTPC) ? vtrack->GetTPCmomentum() : vtrack->P(); - + // get number of sigmas switch (fDetector) { case kITS: @@ -166,13 +166,13 @@ Bool_t AliRsnCutPIDNSigma::IsSelected(TObject *object) AliError("Bad detector chosen. Rejecting track"); return kFALSE; } - + // loop on all ranges, and use the one which contains this momentum // if none is found, the cut is not passed Bool_t accept = kFALSE; Int_t i, goodRange = -1, nRanges = fRanges.GetEntriesFast(); for (i = 0; i < nRanges; i++) { - AliRsnPIDRange *range = (AliRsnPIDRange*)fRanges[i]; + AliRsnPIDRange *range = (AliRsnPIDRange *)fRanges[i]; if (!range) continue; if (!range->IsInRange(fTrackMom)) continue; else { @@ -199,12 +199,12 @@ void AliRsnCutPIDNSigma::Print(const Option_t *) const // Char_t mom[200], det[100], match[200]; - + if (fRejectUnmatched) snprintf(match, 200, "Unmatched tracks are rejected"); else snprintf(match, 200, "No check on track matching"); - + switch (fDetector) { case kITS: snprintf(det, 3, "ITS"); break; case kTPC: snprintf(det, 3, "TPC"); break; @@ -215,5 +215,5 @@ void AliRsnCutPIDNSigma::Print(const Option_t *) const AliInfo(Form("Cut name : %s", GetName())); AliInfo(Form("--> PID detector : %s", det)); AliInfo(Form("--> match criteria: %s", match)); - AliInfo(Form("--> momentum range: %s", mom)); + AliInfo(Form("--> momentum range: %s", mom)); } diff --git a/PWG2/RESONANCES/AliRsnCutPIDNSigma.h b/PWG2/RESONANCES/AliRsnCutPIDNSigma.h index 61132864724..682de29988c 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDNSigma.h +++ b/PWG2/RESONANCES/AliRsnCutPIDNSigma.h @@ -31,53 +31,53 @@ public: kTOF, kDetectors }; - + // // This allows to define several intervals // class AliRsnPIDRange : public TObject { public: - + AliRsnPIDRange(Double_t nsigma, Double_t pmin, Double_t pmax) : fPMin(pmin), fPMax(pmax), fNSigmaCut(nsigma) { } - - Double_t& PMin() {return fPMin;} - Double_t& PMax() {return fPMax;} - Double_t& NSigmaCut() {return fNSigmaCut;} - + + Double_t &PMin() {return fPMin;} + Double_t &PMax() {return fPMax;} + Double_t &NSigmaCut() {return fNSigmaCut;} + Bool_t IsInRange(Double_t mom) {return (mom >= fPMin && mom <= fPMax);} Bool_t CutPass(Double_t nsigma) {return (nsigma <= fNSigmaCut);} - + private: - + Double_t fPMin; // lower bound of momentum range Double_t fPMax; // upper bound of momentum range Double_t fNSigmaCut; // cut in number of sigmas - + ClassDef(AliRsnCutPIDNSigma::AliRsnPIDRange,1) }; AliRsnCutPIDNSigma(); AliRsnCutPIDNSigma(const char *name, AliPID::EParticleType species, EDetector det); - AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy); - AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy); + AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma ©); + AliRsnCutPIDNSigma &operator=(const AliRsnCutPIDNSigma ©); virtual ~AliRsnCutPIDNSigma() { } void SetSpecies(AliPID::EParticleType type) {fSpecies = type;} void SetDetector(EDetector det) {fDetector = det;} void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;} - + AliPIDResponse *MyPID() {return fMyPID;} void InitMyPID(Bool_t isMC, Bool_t isESD); - + void SinglePIDRange(Double_t nsigma); void AddPIDRange(Double_t nsigma, Double_t pmin = 0.0, Double_t pmax = 1E20); - + Bool_t MatchITS(const AliVTrack *vtrack) const; Bool_t MatchTPC(const AliVTrack *vtrack) const; Bool_t MatchTOF(const AliVTrack *vtrack) const; Bool_t MatchDetector(const AliVTrack *vtrack) const; - + virtual Bool_t IsSelected(TObject *object); virtual void Print(const Option_t *option = "") const; @@ -113,7 +113,7 @@ inline Bool_t AliRsnCutPIDNSigma::MatchTPC(const AliVTrack *vtrack) const // if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE; - + return kTRUE; } @@ -151,7 +151,7 @@ inline void AliRsnCutPIDNSigma::AddPIDRange(Double_t nsigma, Double_t pmin, Doub // Int_t n = fRanges.GetEntries(); - + new (fRanges[n]) AliRsnPIDRange(nsigma, pmin, pmax); } @@ -162,7 +162,7 @@ inline void AliRsnCutPIDNSigma::SinglePIDRange(Double_t nsigma) // fRanges.Delete(); - + new (fRanges[0]) AliRsnPIDRange(nsigma, 0.0, 1E20); } diff --git a/PWG2/RESONANCES/AliRsnCutPIDTOF.cxx b/PWG2/RESONANCES/AliRsnCutPIDTOF.cxx index d9f3c65e5b1..a91acd78c17 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDTOF.cxx +++ b/PWG2/RESONANCES/AliRsnCutPIDTOF.cxx @@ -42,7 +42,7 @@ AliRsnCutPIDTOF::AliRsnCutPIDTOF } //_________________________________________________________________________________________________ -AliRsnCutPIDTOF::AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy) : +AliRsnCutPIDTOF::AliRsnCutPIDTOF(const AliRsnCutPIDTOF ©) : AliRsnCut(copy), fRejectUnmatched(copy.fRejectUnmatched), fRefType(AliPID::kUnknown), @@ -60,15 +60,15 @@ AliRsnCutPIDTOF::AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy) : } //_________________________________________________________________________________________________ -AliRsnCutPIDTOF& AliRsnCutPIDTOF::operator=(const AliRsnCutPIDTOF& copy) +AliRsnCutPIDTOF &AliRsnCutPIDTOF::operator=(const AliRsnCutPIDTOF ©) { // // Assignment operator. // To set the reference PID type, calls the SetRefType method, // which sets the mass accordingly and coherently. // - if (this == ©) - return *this; + if (this == ©) + return *this; fRejectUnmatched = copy.fRejectUnmatched; fESDpid = copy.fESDpid; diff --git a/PWG2/RESONANCES/AliRsnCutPIDTOF.h b/PWG2/RESONANCES/AliRsnCutPIDTOF.h index 2811183384f..eaa0604ad2e 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDTOF.h +++ b/PWG2/RESONANCES/AliRsnCutPIDTOF.h @@ -26,12 +26,12 @@ public: Double_t nSigmaMax = 3., Bool_t rejectUnmatched = kFALSE); - AliRsnCutPIDTOF(const AliRsnCutPIDTOF& copy); - AliRsnCutPIDTOF& operator=(const AliRsnCutPIDTOF& copy); + AliRsnCutPIDTOF(const AliRsnCutPIDTOF ©); + AliRsnCutPIDTOF &operator=(const AliRsnCutPIDTOF ©); virtual ~AliRsnCutPIDTOF() { } - AliESDpid* ESDpid() {return fESDpid;} - AliAODpidUtil* AODpid() {return fAODpid;} + AliESDpid *ESDpid() {return fESDpid;} + AliAODpidUtil *AODpid() {return fAODpid;} void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;} void SetNSigmaRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max;} @@ -72,7 +72,7 @@ inline Bool_t AliRsnCutPIDTOF::IsMatched(AliVTrack *vtrack) if (!isTOFout || !isTIME) return kFALSE; // do an additional check on integrated length for ESD tracks - AliESDtrack *esdTrack = dynamic_cast(vtrack); + AliESDtrack *esdTrack = dynamic_cast(vtrack); if (esdTrack) if (esdTrack->GetIntegratedLength() < 350.) return kFALSE; // if we are here, flags are OK and length also diff --git a/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx b/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx index 9235b01305c..88ac0eafb62 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx +++ b/PWG2/RESONANCES/AliRsnCutPIDTPC.cxx @@ -46,7 +46,7 @@ AliRsnCutPIDTPC::AliRsnCutPIDTPC //_________________________________________________________________________________________________ AliRsnCutPIDTPC::AliRsnCutPIDTPC -(const AliRsnCutPIDTPC& copy) : +(const AliRsnCutPIDTPC ©) : AliRsnCut(copy), fRejectOutside(copy.fRejectOutside), fMomMin(copy.fMomMin), @@ -64,7 +64,7 @@ AliRsnCutPIDTPC::AliRsnCutPIDTPC } //_________________________________________________________________________________________________ -AliRsnCutPIDTPC& AliRsnCutPIDTPC::operator=(const AliRsnCutPIDTPC& copy) +AliRsnCutPIDTPC &AliRsnCutPIDTPC::operator=(const AliRsnCutPIDTPC ©) { // // Assignment operator @@ -72,7 +72,7 @@ AliRsnCutPIDTPC& AliRsnCutPIDTPC::operator=(const AliRsnCutPIDTPC& copy) AliRsnCut::operator=(copy); if (this == ©) - return *this; + return *this; fRejectOutside = copy.fRejectOutside; fMomMin = copy.fMomMin; @@ -80,7 +80,7 @@ AliRsnCutPIDTPC& AliRsnCutPIDTPC::operator=(const AliRsnCutPIDTPC& copy) fRefType = copy.fRefType; fESDpid = copy.fESDpid; fAODpid = copy.fAODpid; - + Int_t i; for (i = 0; i < 5; i++) fBB[i] = copy.fBB[i]; diff --git a/PWG2/RESONANCES/AliRsnCutPIDTPC.h b/PWG2/RESONANCES/AliRsnCutPIDTPC.h index cce4d7bd3d1..100612d07b7 100644 --- a/PWG2/RESONANCES/AliRsnCutPIDTPC.h +++ b/PWG2/RESONANCES/AliRsnCutPIDTPC.h @@ -28,12 +28,12 @@ public: Double_t nSigmaMax = 3., Bool_t rejectOutside = kTRUE); - AliRsnCutPIDTPC(const AliRsnCutPIDTPC& copy); - AliRsnCutPIDTPC& operator=(const AliRsnCutPIDTPC& copy); + AliRsnCutPIDTPC(const AliRsnCutPIDTPC ©); + AliRsnCutPIDTPC &operator=(const AliRsnCutPIDTPC ©); virtual ~AliRsnCutPIDTPC() { } - AliESDpid* ESDpid() {return fESDpid;} - AliAODpidUtil* AODpid() {return fAODpid;} + AliESDpid *ESDpid() {return fESDpid;} + AliAODpidUtil *AODpid() {return fAODpid;} void SetRejectOutside(Bool_t yn = kTRUE) {fRejectOutside = yn;} void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;} @@ -54,7 +54,7 @@ private: AliESDpid *fESDpid; //! ESD PID object AliAODpidUtil *fAODpid; //! AOD PID object Double_t fBB[5]; // Bethe-Bloch parameters - + ClassDef(AliRsnCutPIDTPC, 1) }; diff --git a/PWG2/RESONANCES/AliRsnCutPion.cxx b/PWG2/RESONANCES/AliRsnCutPion.cxx index e5fab0c3ae1..3d2e27ca2da 100644 --- a/PWG2/RESONANCES/AliRsnCutPion.cxx +++ b/PWG2/RESONANCES/AliRsnCutPion.cxx @@ -14,46 +14,46 @@ ClassImp(AliRsnCutPion) -const char* AliRsnCutPion::fgkCutName[AliRsnCutPion::kNpionCuts]={ - "kQuality_Std2010", - "kTOFMatch_Std2010", - "kFastTPCpid_Nsigma", - "kFastTPCpid_1point5sigma", - "kFastTPCpid_2sigma", - "kFastTPCpid_3sigma", - "kFastTOFpid_Nsigma", - "kFastTOFpid_1point5sigma", - "kFastTOFpid_2sigma", - "kFastTOFpid_3sigma", - "kTPCTOFpid_DefaultKstarPP2010" +const char *AliRsnCutPion::fgkCutName[AliRsnCutPion::kNpionCuts]= { + "kQuality_Std2010", + "kTOFMatch_Std2010", + "kFastTPCpid_Nsigma", + "kFastTPCpid_1point5sigma", + "kFastTPCpid_2sigma", + "kFastTPCpid_3sigma", + "kFastTOFpid_Nsigma", + "kFastTOFpid_1point5sigma", + "kFastTOFpid_2sigma", + "kFastTOFpid_3sigma", + "kTPCTOFpid_DefaultKstarPP2010" }; //__________________________________________________________________________________________________ AliRsnCutPion::AliRsnCutPion(const char *name, AliRsnCutPion::ERsnPionCut cutID, AliPID::EParticleType pid) : - AliRsnCut(name, AliRsnTarget::kDaughter), - fNoPID(kFALSE), - fPID(pid), - fCutQuality(Form("%sQuality", name)), - fAppliedCutID(cutID), - fNsigmaCutTPC(1E6), - fNsigmaCutTOF(1E6) + AliRsnCut(name, AliRsnTarget::kDaughter), + fNoPID(kFALSE), + fPID(pid), + fCutQuality(Form("%sQuality", name)), + fAppliedCutID(cutID), + fNsigmaCutTPC(1E6), + fNsigmaCutTOF(1E6) { - // - // Constructor - // Initialize track quality cuts to 2010 defaults - // - fCutQuality.SetPtRange(0.15, 1E+20); - fCutQuality.SetEtaRange(-0.8, 0.8); - fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01"); - fCutQuality.SetDCAZmax(2.0); - fCutQuality.SetSPDminNClusters(1); - fCutQuality.SetITSminNClusters(0); - fCutQuality.SetITSmaxChi2(1E+20); - fCutQuality.SetTPCminNClusters(70); - fCutQuality.SetTPCmaxChi2(4.0); - fCutQuality.SetRejectKinkDaughters(); - fCutQuality.SetAODTestFilterBit(5); - AliInfo(Form("Applied cut on pion candidate: %s", AliRsnCutPion::fgkCutName[fAppliedCutID])); + // + // Constructor + // Initialize track quality cuts to 2010 defaults + // + fCutQuality.SetPtRange(0.15, 1E+20); + fCutQuality.SetEtaRange(-0.8, 0.8); + fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01"); + fCutQuality.SetDCAZmax(2.0); + fCutQuality.SetSPDminNClusters(1); + fCutQuality.SetITSminNClusters(0); + fCutQuality.SetITSmaxChi2(1E+20); + fCutQuality.SetTPCminNClusters(70); + fCutQuality.SetTPCmaxChi2(4.0); + fCutQuality.SetRejectKinkDaughters(); + fCutQuality.SetAODTestFilterBit(5); + AliInfo(Form("Applied cut on pion candidate: %s", AliRsnCutPion::fgkCutName[fAppliedCutID])); } //__________________________________________________________________________________________________ @@ -80,109 +80,109 @@ Bool_t AliRsnCutPion::IsSelected(TObject *obj) // // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; - + Bool_t isSelected=kFALSE; switch (fAppliedCutID) - { - case AliRsnCutPion::kQualityStd2010: - isSelected=IsSelectedByQualityStd2010(obj, 1, 1, 1); - break; - - case AliRsnCutPion::kTOFMatchStd2010: - isSelected=IsSelectedByTOFMatchStd2010(obj); - break; - - case AliRsnCutPion::kFastTPCpidNsigma: - isSelected=IsSelectedByFastTPCpidNsigma(obj,fNsigmaCutTPC); - break; - - case AliRsnCutPion::kFastTPCpid1point5sigma: - isSelected=IsSelectedByFastTPCpid1point5sigma(obj); - break; - - case AliRsnCutPion::kFastTPCpid2sigma: - isSelected=IsSelectedByFastTPCpid2sigma(obj); - break; - - case AliRsnCutPion::kFastTPCpid3sigma: - isSelected=IsSelectedByFastTPCpid3sigma(obj); - break; - - case AliRsnCutPion::kFastTOFpidNsigma: - isSelected=IsSelectedByFastTOFpidNsigma(obj,fNsigmaCutTOF); - break; - - case AliRsnCutPion::kFastTOFpid1point5sigma: - isSelected=IsSelectedByFastTOFpid1point5sigma(obj); - break; - - case AliRsnCutPion::kFastTOFpid2sigma: - isSelected=IsSelectedByFastTOFpid2sigma(obj); - break; - - case AliRsnCutPion::kFastTOFpid3sigma: - isSelected=IsSelectedByFastTOFpid3sigma(obj); - break; - - case AliRsnCutPion::kTPCTOFpidDefaultKstarPP2010: - isSelected=IsSelectedByTPCTOFpidDefaultKstarPP2010(obj); - break; - - default : - break; - } - + { + case AliRsnCutPion::kQualityStd2010: + isSelected=IsSelectedByQualityStd2010(obj, 1, 1, 1); + break; + + case AliRsnCutPion::kTOFMatchStd2010: + isSelected=IsSelectedByTOFMatchStd2010(obj); + break; + + case AliRsnCutPion::kFastTPCpidNsigma: + isSelected=IsSelectedByFastTPCpidNsigma(obj,fNsigmaCutTPC); + break; + + case AliRsnCutPion::kFastTPCpid1point5sigma: + isSelected=IsSelectedByFastTPCpid1point5sigma(obj); + break; + + case AliRsnCutPion::kFastTPCpid2sigma: + isSelected=IsSelectedByFastTPCpid2sigma(obj); + break; + + case AliRsnCutPion::kFastTPCpid3sigma: + isSelected=IsSelectedByFastTPCpid3sigma(obj); + break; + + case AliRsnCutPion::kFastTOFpidNsigma: + isSelected=IsSelectedByFastTOFpidNsigma(obj,fNsigmaCutTOF); + break; + + case AliRsnCutPion::kFastTOFpid1point5sigma: + isSelected=IsSelectedByFastTOFpid1point5sigma(obj); + break; + + case AliRsnCutPion::kFastTOFpid2sigma: + isSelected=IsSelectedByFastTOFpid2sigma(obj); + break; + + case AliRsnCutPion::kFastTOFpid3sigma: + isSelected=IsSelectedByFastTOFpid3sigma(obj); + break; + + case AliRsnCutPion::kTPCTOFpidDefaultKstarPP2010: + isSelected=IsSelectedByTPCTOFpidDefaultKstarPP2010(obj); + break; + + default : + break; + } + return isSelected; } //----------------------------------------------------------- Bool_t AliRsnCutPion::IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin=kTRUE, Bool_t requireTPCrefit=kTRUE, Bool_t requireITSrefit=kTRUE) { - //Checks if track passes the standard quality cuts - //defined for analysis in 2010 pp and PbPb data - - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - - fAppliedCutID=AliRsnCutPion::kQualityStd2010; - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - - //optionally check refit flags (to be used for Phi and kStar analysis) - if (requireTPCin && ((track->GetStatus() & AliESDtrack::kTPCin) == 0) ) return kFALSE; - if (requireTPCrefit && ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) ) return kFALSE; - if (requireITSrefit && ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) ) return kFALSE; - - // quality - if (!fCutQuality.IsSelected(obj)) return kFALSE; - return kTRUE; + //Checks if track passes the standard quality cuts + //defined for analysis in 2010 pp and PbPb data + + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + + fAppliedCutID=AliRsnCutPion::kQualityStd2010; + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + + //optionally check refit flags (to be used for Phi and kStar analysis) + if (requireTPCin && ((track->GetStatus() & AliESDtrack::kTPCin) == 0) ) return kFALSE; + if (requireTPCrefit && ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) ) return kFALSE; + if (requireITSrefit && ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) ) return kFALSE; + + // quality + if (!fCutQuality.IsSelected(obj)) return kFALSE; + return kTRUE; } //----------------------------------------------------------- Bool_t AliRsnCutPion::IsSelectedByTOFMatchStd2010(TObject *obj) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of TOF match: quality cuts 2010 + kTOFout + kTIME - (optionally) L > 350. cm cut can be added - */ + /* + fbellini@cern.ch, 05.dec.2011 + definition of TOF match: quality cuts 2010 + kTOFout + kTIME + (optionally) L > 350. cm cut can be added + */ if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; } fAppliedCutID=AliRsnCutPion::kTOFMatchStd2010; - + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); if (!track) return kFALSE; return MatchTOF(track); } @@ -190,119 +190,118 @@ Bool_t AliRsnCutPion::IsSelectedByTOFMatchStd2010(TObject *obj) //----------------------------------------------------------- Bool_t AliRsnCutPion::IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut=10.) { - /* - fbellini@cern.ch, 05.dec.2011 Double_t pTPC = track->GetTPCmomentum(); - definition of fast TPC pid N-sigma: quality cuts 2010 + sigma cut on dE/dx without p dependence - */ - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - fAppliedCutID=AliRsnCutPion::kFastTPCpidNsigma; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - - Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track,fPID)); - return (nsTPC <= nSigmaCut); + /* + fbellini@cern.ch, 05.dec.2011 Double_t pTPC = track->GetTPCmomentum(); + definition of fast TPC pid N-sigma: quality cuts 2010 + sigma cut on dE/dx without p dependence + */ + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + fAppliedCutID=AliRsnCutPion::kFastTPCpidNsigma; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + + Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track,fPID)); + return (nsTPC <= nSigmaCut); } //----------------------------------------------------------- Bool_t AliRsnCutPion::IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut=10.) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of fast TOF pid N-sigma: quality cuts 2010 + sigma cut on t-t_0-t_exp without p dependence - */ - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - - fAppliedCutID=AliRsnCutPion::kFastTOFpidNsigma; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - Bool_t isTOF = MatchTOF(track); - Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; - - return (nsTOF <= nSigmaCut); + /* + fbellini@cern.ch, 05.dec.2011 + definition of fast TOF pid N-sigma: quality cuts 2010 + sigma cut on t-t_0-t_exp without p dependence + */ + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + + fAppliedCutID=AliRsnCutPion::kFastTOFpidNsigma; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + Bool_t isTOF = MatchTOF(track); + Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; + + return (nsTOF <= nSigmaCut); } //----------------------------------------------------------- Bool_t AliRsnCutPion::IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj) { - /* - fbellini@cern.ch, 05.dec.2011 - definition of TPC-TOF pid for pp phi and Kstar analysis on 2010 data: - quality cuts 2010 + sigma cut on dE/dx with pTPC dependence + sigma cut on t-t_0-t_exp with p dependence - */ - - if (!obj) { - AliError("Invalid track object passed to function. Please check!"); - return kFALSE; - } - fAppliedCutID=AliRsnCutPion::kTPCTOFpidDefaultKstarPP2010; - - // check initialization of PID object - AliPIDResponse *pid = fEvent->GetPIDResponse(); - if (!pid) { - AliFatal("NULL PID response"); - return kFALSE; - } - - if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) //require ITS+TPCrefit and TPCin - return kFALSE; - - AliVTrack *track = dynamic_cast(fDaughter->GetRef()); - if (!track) return kFALSE; - - Bool_t isTOF = MatchTOF(track); - Double_t pTPC = track->GetTPCmomentum(); - Double_t p = track->P(); - Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID)); - Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; - Double_t maxTPC = 1E20; - Double_t maxTOF = 1E20; - - if (isTOF) { - // TPC: 5sigma cut for all - if (nsTPC > 5.0) return kFALSE; - // TOF: 3sigma below 1.5 GeV, 2sigma above - if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; - return (nsTOF <= maxTOF); - } else { - // TPC: - // all below 350 MeV: 5sigma - // all between 350 and 500 MeV: 3sigma - // pions above 500 MeV: 2sigma - if (pTPC <= 0.35) - maxTPC = 5.0; - else - if (pTPC > 0.35 && pTPC <= 0.5) - maxTPC = 3.0; + /* + fbellini@cern.ch, 05.dec.2011 + definition of TPC-TOF pid for pp phi and Kstar analysis on 2010 data: + quality cuts 2010 + sigma cut on dE/dx with pTPC dependence + sigma cut on t-t_0-t_exp with p dependence + */ + + if (!obj) { + AliError("Invalid track object passed to function. Please check!"); + return kFALSE; + } + fAppliedCutID=AliRsnCutPion::kTPCTOFpidDefaultKstarPP2010; + + // check initialization of PID object + AliPIDResponse *pid = fEvent->GetPIDResponse(); + if (!pid) { + AliFatal("NULL PID response"); + return kFALSE; + } + + if (!IsSelectedByQualityStd2010(obj, kTRUE, kTRUE, kTRUE)) //require ITS+TPCrefit and TPCin + return kFALSE; + + AliVTrack *track = dynamic_cast(fDaughter->GetRef()); + if (!track) return kFALSE; + + Bool_t isTOF = MatchTOF(track); + Double_t pTPC = track->GetTPCmomentum(); + Double_t p = track->P(); + Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID)); + Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20; + Double_t maxTPC = 1E20; + Double_t maxTOF = 1E20; + + if (isTOF) { + // TPC: 5sigma cut for all + if (nsTPC > 5.0) return kFALSE; + // TOF: 3sigma below 1.5 GeV, 2sigma above + if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0; + return (nsTOF <= maxTOF); + } else { + // TPC: + // all below 350 MeV: 5sigma + // all between 350 and 500 MeV: 3sigma + // pions above 500 MeV: 2sigma + if (pTPC <= 0.35) + maxTPC = 5.0; + else if (pTPC > 0.35 && pTPC <= 0.5) + maxTPC = 3.0; else - maxTPC = 2.0; - - return (nsTPC <= maxTPC); - } + maxTPC = 2.0; + + return (nsTPC <= maxTPC); + } } diff --git a/PWG2/RESONANCES/AliRsnCutPion.h b/PWG2/RESONANCES/AliRsnCutPion.h index 0966a512999..d9d27e926cc 100644 --- a/PWG2/RESONANCES/AliRsnCutPion.h +++ b/PWG2/RESONANCES/AliRsnCutPion.h @@ -14,66 +14,66 @@ class AliRsnCutPion : public AliRsnCut { public: - enum ERsnPionCut { - kQualityStd2010, - kTOFMatchStd2010, - kFastTPCpidNsigma, - kFastTPCpid1point5sigma, - kFastTPCpid2sigma, - kFastTPCpid3sigma, - kFastTOFpidNsigma, - kFastTOFpid1point5sigma, - kFastTOFpid2sigma, - kFastTOFpid3sigma, - kTPCTOFpidDefaultKstarPP2010, - kNpionCuts - }; - - AliRsnCutPion(const char *name = "", AliRsnCutPion::ERsnPionCut cutID = AliRsnCutPion::kQualityStd2010, AliPID::EParticleType pid = AliPID::kPion); - virtual ~AliRsnCutPion() { } - - void SetNoPID(Bool_t yn = kTRUE) {fNoPID = yn;} - AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} - Bool_t MatchTOF(const AliVTrack *vtrack); - - Bool_t IsSelected(TObject *obj); - - Bool_t IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin, Bool_t requireTPCrefit, Bool_t requireITSrefit ); - Bool_t IsSelectedByTOFMatchStd2010(TObject *obj); - - Bool_t IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut); - Bool_t IsSelectedByFastTPCpid1point5sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 1.5);} - Bool_t IsSelectedByFastTPCpid2sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 2.0);} - Bool_t IsSelectedByFastTPCpid3sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 3.0);} - - Bool_t IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut); - Bool_t IsSelectedByFastTOFpid1point5sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 1.5);} - Bool_t IsSelectedByFastTOFpid2sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 2.0);} - Bool_t IsSelectedByFastTOFpid3sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 3.0);} - - Bool_t IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj); - - //setters - void SetNsigmaCutTPC(Float_t nMaxSigmaCut=1E6){fNsigmaCutTPC=nMaxSigmaCut; return;} - void SetNsigmaCutTOF(Float_t nMaxSigmaCut=1E6){fNsigmaCutTOF=nMaxSigmaCut; return;} - - //getters - const char * GetAppliedPionCutName() {if (fAppliedCutID>0){ return fgkCutName[fAppliedCutID];} else {return "none";}} - Int_t GetAppliedPionCutId() { return fAppliedCutID;} - const char * GetPionCutName(AliRsnCutPion::ERsnPionCut cutID) { return fgkCutName[cutID];} - - private: - - Bool_t fNoPID; // flag to switch off PID check - AliPID::EParticleType fPID; // PID for track - AliRsnCutTrackQuality fCutQuality; // track quality cut - Int_t fAppliedCutID; // ID of applied cut - static const char* fgkCutName[kNpionCuts]; //array with cuts names - Float_t fNsigmaCutTPC; // max sigma for TPC dE/dx fast cut - Float_t fNsigmaCutTOF; // max sigma for TOF t-t0-t_exp fast cut - - ClassDef(AliRsnCutPion,1) // cut definitions for K* - + enum ERsnPionCut { + kQualityStd2010, + kTOFMatchStd2010, + kFastTPCpidNsigma, + kFastTPCpid1point5sigma, + kFastTPCpid2sigma, + kFastTPCpid3sigma, + kFastTOFpidNsigma, + kFastTOFpid1point5sigma, + kFastTOFpid2sigma, + kFastTOFpid3sigma, + kTPCTOFpidDefaultKstarPP2010, + kNpionCuts + }; + + AliRsnCutPion(const char *name = "", AliRsnCutPion::ERsnPionCut cutID = AliRsnCutPion::kQualityStd2010, AliPID::EParticleType pid = AliPID::kPion); + virtual ~AliRsnCutPion() { } + + void SetNoPID(Bool_t yn = kTRUE) {fNoPID = yn;} + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + Bool_t MatchTOF(const AliVTrack *vtrack); + + Bool_t IsSelected(TObject *obj); + + Bool_t IsSelectedByQualityStd2010(TObject *obj, Bool_t requireTPCin, Bool_t requireTPCrefit, Bool_t requireITSrefit ); + Bool_t IsSelectedByTOFMatchStd2010(TObject *obj); + + Bool_t IsSelectedByFastTPCpidNsigma(TObject *obj,Float_t nSigmaCut); + Bool_t IsSelectedByFastTPCpid1point5sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 1.5);} + Bool_t IsSelectedByFastTPCpid2sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 2.0);} + Bool_t IsSelectedByFastTPCpid3sigma(TObject *obj) {return IsSelectedByFastTPCpidNsigma(obj, 3.0);} + + Bool_t IsSelectedByFastTOFpidNsigma(TObject *obj,Float_t nSigmaCut); + Bool_t IsSelectedByFastTOFpid1point5sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 1.5);} + Bool_t IsSelectedByFastTOFpid2sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 2.0);} + Bool_t IsSelectedByFastTOFpid3sigma(TObject *obj) {return IsSelectedByFastTOFpidNsigma(obj, 3.0);} + + Bool_t IsSelectedByTPCTOFpidDefaultKstarPP2010(TObject *obj); + + //setters + void SetNsigmaCutTPC(Float_t nMaxSigmaCut=1E6) {fNsigmaCutTPC=nMaxSigmaCut; return;} + void SetNsigmaCutTOF(Float_t nMaxSigmaCut=1E6) {fNsigmaCutTOF=nMaxSigmaCut; return;} + + //getters + const char *GetAppliedPionCutName() {if (fAppliedCutID>0) { return fgkCutName[fAppliedCutID];} else {return "none";}} + Int_t GetAppliedPionCutId() { return fAppliedCutID;} + const char *GetPionCutName(AliRsnCutPion::ERsnPionCut cutID) { return fgkCutName[cutID];} + +private: + + Bool_t fNoPID; // flag to switch off PID check + AliPID::EParticleType fPID; // PID for track + AliRsnCutTrackQuality fCutQuality; // track quality cut + Int_t fAppliedCutID; // ID of applied cut + static const char *fgkCutName[kNpionCuts]; //array with cuts names + Float_t fNsigmaCutTPC; // max sigma for TPC dE/dx fast cut + Float_t fNsigmaCutTOF; // max sigma for TOF t-t0-t_exp fast cut + + ClassDef(AliRsnCutPion,1) // cut definitions for K* + }; #endif diff --git a/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx b/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx index 6296b2354f1..c3cbb6d4b34 100644 --- a/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx @@ -50,45 +50,45 @@ Bool_t AliRsnCutPion2010PP::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track AliVTrack *track = fDaughter->Ref2Vtrack(); if (!track) { if (!fDaughter->GetRef()) AliWarning("NULL ref"); return kFALSE; } - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // PID ITS : // depends on momentum //SetRangeD(0.0, 4.0); //fCutValueD = TMath::Abs(pid->NumberOfSigmasITS(track, AliPID::kPion)); //if (!OkRangeD()) return kFALSE; - + // PID TPC : // depends on momentum SetRangeD(0.0, 3.0); if (track->GetTPCmomentum() < 0.350) SetRangeD(0.0, 5.0); fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kPion)); if (!OkRangeD()) return kFALSE; - + // if TOF is not matched, end here // otherwise check TOF - if (!MatchTOF(track)) + if (!MatchTOF(track)) return kTRUE; else { //SetRangeD(0.0, 3.0); diff --git a/PWG2/RESONANCES/AliRsnCutPion2010PP.h b/PWG2/RESONANCES/AliRsnCutPion2010PP.h index 3e014de5050..911a02a3701 100644 --- a/PWG2/RESONANCES/AliRsnCutPion2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutPion2010PP.h @@ -17,9 +17,9 @@ public: AliRsnCutPion2010PP(const char *name = ""); virtual ~AliRsnCutPion2010PP() { } - + virtual Bool_t IsSelected(TObject *obj); - + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} private: diff --git a/PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx b/PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx index 7a5a8162528..7dd93e63b51 100644 --- a/PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx +++ b/PWG2/RESONANCES/AliRsnCutPrimaryVertex.cxx @@ -47,8 +47,8 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object) if (!TargetOK(object)) return kFALSE; // retrieve ESD event - AliESDEvent *esd = dynamic_cast(fEvent->GetRef()); - AliAODEvent *aod = dynamic_cast(fEvent->GetRef()); + AliESDEvent *esd = dynamic_cast(fEvent->GetRef()); + AliAODEvent *aod = dynamic_cast(fEvent->GetRef()); if (esd) { // pile-up check @@ -99,7 +99,7 @@ Bool_t AliRsnCutPrimaryVertex::IsSelected(TObject *object) return kFALSE; } // now check primary vertex - aodv = (AliAODVertex*)aod->GetPrimaryVertex(); + aodv = (AliAODVertex *)aod->GetPrimaryVertex(); if (CheckVertex(aodv)) { AliDebugClass(1, "Vertex TRK is OK"); fCutValueD = aodv->GetZ(); diff --git a/PWG2/RESONANCES/AliRsnCutPrimaryVertex.h b/PWG2/RESONANCES/AliRsnCutPrimaryVertex.h index f3a2c426a0e..88cf51a917f 100644 --- a/PWG2/RESONANCES/AliRsnCutPrimaryVertex.h +++ b/PWG2/RESONANCES/AliRsnCutPrimaryVertex.h @@ -44,7 +44,7 @@ inline Bool_t AliRsnCutPrimaryVertex::CheckVertex(AliVVertex *vertex) // least one contributor // - if (!vertex) return kFALSE; + if (!vertex) return kFALSE; if (vertex->GetNContributors() < 1) return kFALSE; return kTRUE; } diff --git a/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx b/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx index e8f22ecd195..6346846b458 100644 --- a/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx @@ -50,45 +50,45 @@ Bool_t AliRsnCutProton2010PP::IsSelected(TObject *obj) // coherence check if (!TargetOK(obj)) return kFALSE; - + // check track AliVTrack *track = fDaughter->Ref2Vtrack(); if (!track) { if (!fDaughter->GetRef()) AliWarning("NULL ref"); return kFALSE; } - + // check flags if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE; if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE; - + // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; - + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { AliFatal("NULL PID response"); return kFALSE; } - + // PID ITS : // depends on momentum //SetRangeD(0.0, 4.0); //fCutValueD = TMath::Abs(pid->NumberOfSigmasITS(track, AliPID::kProton)); //if (!OkRangeD()) return kFALSE; - + // PID TPC : // depends on momentum SetRangeD(0.0, 3.0); if (track->GetTPCmomentum() < 0.350) SetRangeD(0.0, 5.0); fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kProton)); if (!OkRangeD()) return kFALSE; - + // if TOF is not matched, end here // otherwise check TOF - if (!MatchTOF(track)) + if (!MatchTOF(track)) return kTRUE; else { //SetRangeD(0.0, 3.0); diff --git a/PWG2/RESONANCES/AliRsnCutProton2010PP.h b/PWG2/RESONANCES/AliRsnCutProton2010PP.h index fefc8789eab..9e2c4215c81 100644 --- a/PWG2/RESONANCES/AliRsnCutProton2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutProton2010PP.h @@ -19,9 +19,9 @@ public: AliRsnCutProton2010PP(const char *name = ""); virtual ~AliRsnCutProton2010PP() { } - + virtual Bool_t IsSelected(TObject *obj); - + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} private: diff --git a/PWG2/RESONANCES/AliRsnCutSet.cxx b/PWG2/RESONANCES/AliRsnCutSet.cxx index 0cdec722fdc..fb681d70cfe 100644 --- a/PWG2/RESONANCES/AliRsnCutSet.cxx +++ b/PWG2/RESONANCES/AliRsnCutSet.cxx @@ -25,7 +25,8 @@ AliRsnCutSet::AliRsnCutSet() : fCutSchemeIndexed(""), fBoolValues(0), fIsScheme(kFALSE), - fExpression(0) + fExpression(0), + fMonitors(0) { // // Constructor without name (not recommended) @@ -44,7 +45,8 @@ AliRsnCutSet::AliRsnCutSet(const char *name, RSNTARGET target) : fCutSchemeIndexed(""), fBoolValues(0), fIsScheme(kFALSE), - fExpression(0) + fExpression(0), + fMonitors(0) { // // Constructor with argument name (recommended) @@ -56,7 +58,7 @@ AliRsnCutSet::AliRsnCutSet(const char *name, RSNTARGET target) : } //_____________________________________________________________________________ -AliRsnCutSet::AliRsnCutSet(const AliRsnCutSet & copy) : +AliRsnCutSet::AliRsnCutSet(const AliRsnCutSet ©) : AliRsnTarget(copy), fCuts(copy.fCuts), fNumOfCuts(copy.fNumOfCuts), @@ -64,7 +66,8 @@ AliRsnCutSet::AliRsnCutSet(const AliRsnCutSet & copy) : fCutSchemeIndexed(copy.fCutSchemeIndexed), fBoolValues(0), fIsScheme(copy.fIsScheme), - fExpression(copy.fExpression) + fExpression(copy.fExpression), + fMonitors(copy.fMonitors) { // // Copy constructor @@ -80,7 +83,7 @@ AliRsnCutSet::AliRsnCutSet(const AliRsnCutSet & copy) : } //_____________________________________________________________________________ -AliRsnCutSet& AliRsnCutSet::operator=(const AliRsnCutSet & copy) +AliRsnCutSet &AliRsnCutSet::operator=(const AliRsnCutSet ©) { // // Assignment operator. @@ -88,14 +91,15 @@ AliRsnCutSet& AliRsnCutSet::operator=(const AliRsnCutSet & copy) AliRsnTarget::operator=(copy); if (this == ©) - return *this; - + return *this; + fCuts = copy.fCuts; fNumOfCuts = copy.fNumOfCuts; fCutScheme = copy.fCutScheme; fCutSchemeIndexed = copy.fCutSchemeIndexed; fIsScheme = copy.fIsScheme; fExpression = copy.fExpression; + fMonitors = copy.fMonitors; if (fBoolValues) delete [] fBoolValues; @@ -119,6 +123,7 @@ AliRsnCutSet::~AliRsnCutSet() delete fExpression; delete [] fBoolValues; + delete fMonitors; } //_____________________________________________________________________________ @@ -164,7 +169,7 @@ void AliRsnCutSet::ShowCuts() const AliRsnCut *cut; for (Int_t i = 0; i < fCuts.GetEntriesFast() ; i++) { - cut = (AliRsnCut*)fCuts.At(i); + cut = (AliRsnCut *)fCuts.At(i); cut->Print(); } } @@ -183,11 +188,23 @@ Bool_t AliRsnCutSet::IsSelected(TObject *object) Bool_t boolReturn = kTRUE; AliRsnCut *cut; for (i = 0; i < fNumOfCuts; i++) { - cut = (AliRsnCut*)fCuts.At(i); + cut = (AliRsnCut *)fCuts.At(i); fBoolValues[i] = cut->IsSelected(object); } if (fIsScheme) boolReturn = Passed(); + + // fill monitoring info + if (boolReturn && fMonitors) { + if (TargetOK(object)) { + TIter next(fMonitors); + AliRsnListOutput *mo; + while ((mo = (AliRsnListOutput *) next())) { + mo->Fill(fEvent,fDaughter); + } + } + } + return boolReturn; } @@ -232,7 +249,7 @@ Int_t AliRsnCutSet::GetIndexByCutName(TString s) AliRsnCut *cut; for (i = 0; i < fCuts.GetEntriesFast(); i++) { - cut = (AliRsnCut*) fCuts.At(i); + cut = (AliRsnCut *) fCuts.At(i); if (!s.CompareTo(cut->GetName())) return i; } @@ -268,7 +285,7 @@ Bool_t AliRsnCutSet::IsValidScheme() TString str(fCutScheme); AliRsnCut *cut; for (Int_t i = 0; i < fNumOfCuts; i++) { - cut = (AliRsnCut*)fCuts.At(i); + cut = (AliRsnCut *)fCuts.At(i); str.ReplaceAll(cut->GetName(), ""); } str.ReplaceAll("&", ""); @@ -337,7 +354,7 @@ void AliRsnCutSet::PrintSetInfo() AliInfo("====== Cuts ======"); AliRsnCut *cut; for (i = 0; i < fCuts.GetEntriesFast(); i++) { - cut = (AliRsnCut*) fCuts.At(i); + cut = (AliRsnCut *) fCuts.At(i); if (cut) AliInfo(Form("%d %d", i, fBoolValues[i])); } AliInfo("========== END Rsn Cut Mgr info =============="); @@ -357,9 +374,30 @@ TString AliRsnCutSet::GetCutSchemeIndexed() AliDebug(AliLog::kDebug, Form("Num of cuts %d", fCuts.GetEntriesFast())); AliRsnCut *cut; for (i = 0; i < fCuts.GetEntriesFast(); i++) { - cut = (AliRsnCut*) fCuts.At(i); + cut = (AliRsnCut *) fCuts.At(i); str.ReplaceAll(cut->GetName(), Form("%d", i)); } AliDebug(AliLog::kDebug, "->"); return str; } + +Bool_t AliRsnCutSet::Init(TList *list) +{ + if (!fMonitors) return kTRUE; + + TIter next(fMonitors); + AliRsnListOutput *mo; + while ((mo = (AliRsnListOutput *) next())) { + mo->Init(GetName(),list); + } + + + return kTRUE; +} + +void AliRsnCutSet::AddMonitor(AliRsnListOutput *mon) +{ + if (!fMonitors) fMonitors = new TObjArray(); + fMonitors->Add(mon); +} + diff --git a/PWG2/RESONANCES/AliRsnCutSet.h b/PWG2/RESONANCES/AliRsnCutSet.h index 6ca9c7071e7..6173f4ba060 100644 --- a/PWG2/RESONANCES/AliRsnCutSet.h +++ b/PWG2/RESONANCES/AliRsnCutSet.h @@ -16,6 +16,7 @@ #include #include "AliRsnTarget.h" +#include "AliRsnListOutput.h" class AliRsnCut; class AliRsnDaughter; @@ -29,10 +30,11 @@ public: AliRsnCutSet(); AliRsnCutSet(const char *name, RSNTARGET target); AliRsnCutSet(const AliRsnCutSet ©); - AliRsnCutSet& operator=(const AliRsnCutSet& copy); + AliRsnCutSet &operator=(const AliRsnCutSet ©); ~AliRsnCutSet(); - void AddCut(AliRsnCut* cut); + void AddCut(AliRsnCut *cut); + Bool_t Init(TList *list); void ShowCuts() const; Int_t GetIndexByCutName(TString s); @@ -55,19 +57,23 @@ public: TObjArray *GetCuts() { return &fCuts; } -private: + void AddMonitor(AliRsnListOutput *mon); + TObjArray *GetMonitorOutput() { return fMonitors; } + void SetMonitorOutput(TObjArray *monitors) { fMonitors = monitors; } - TObjArray fCuts; // array of cuts - Int_t fNumOfCuts; // number of cuts - TString fCutScheme; // cut scheme - TString fCutSchemeIndexed; // cut scheme indexed +private: - Bool_t *fBoolValues; //[fNumOfCuts] - Bool_t fIsScheme; // is scheme + TObjArray fCuts; // array of cuts + Int_t fNumOfCuts; // number of cuts + TString fCutScheme; // cut scheme + TString fCutSchemeIndexed; // cut scheme indexed - AliRsnExpression *fExpression; // pointer to AliRsnExpression + Bool_t *fBoolValues; //[fNumOfCuts] + Bool_t fIsScheme; // is scheme - ClassDef(AliRsnCutSet, 1) // ROOT dictionary + AliRsnExpression *fExpression; // pointer to AliRsnExpression + TObjArray *fMonitors; // array of monitor object + ClassDef(AliRsnCutSet, 2) // ROOT dictionary }; #endif diff --git a/PWG2/RESONANCES/AliRsnCutTrackQuality.cxx b/PWG2/RESONANCES/AliRsnCutTrackQuality.cxx index 7736287683a..927ae56292d 100644 --- a/PWG2/RESONANCES/AliRsnCutTrackQuality.cxx +++ b/PWG2/RESONANCES/AliRsnCutTrackQuality.cxx @@ -86,16 +86,16 @@ AliRsnCutTrackQuality::AliRsnCutTrackQuality(const AliRsnCutTrackQuality ©) } //_________________________________________________________________________________________________ -AliRsnCutTrackQuality& AliRsnCutTrackQuality::operator=(const AliRsnCutTrackQuality ©) +AliRsnCutTrackQuality &AliRsnCutTrackQuality::operator=(const AliRsnCutTrackQuality ©) { // // Assignment operator. // Just copy all data member values. // - if (this == ©) - return *this; - + if (this == ©) + return *this; + fFlagsOn = copy.fFlagsOn; fFlagsOff = copy.fFlagsOff; fRejectKinkDaughters = copy.fRejectKinkDaughters; @@ -255,7 +255,7 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track) if (fAODTestFilterBit >= 0) { UInt_t bit = 1 << fAODTestFilterBit; AliDebugClass(2, Form("Required a test filter bit for AOD check: %u (result: %s)", bit, (track->TestFilterBit(bit) ? "accept" : "reject"))); - if (!track->TestFilterBit(bit)) + if (!track->TestFilterBit(bit)) return kFALSE; else { if (track->Pt() < fPt[0] || track->Pt() > fPt[1]) return kFALSE; @@ -263,7 +263,7 @@ Bool_t AliRsnCutTrackQuality::CheckAOD(AliAODTrack *track) return kTRUE; } } - + // try to retrieve the reference AOD event AliAODEvent *aodEvent = 0x0; if (fEvent) aodEvent = fEvent->GetRefAOD(); diff --git a/PWG2/RESONANCES/AliRsnCutTrackQuality.h b/PWG2/RESONANCES/AliRsnCutTrackQuality.h index 88ba13ff1f9..0157122b3df 100644 --- a/PWG2/RESONANCES/AliRsnCutTrackQuality.h +++ b/PWG2/RESONANCES/AliRsnCutTrackQuality.h @@ -24,8 +24,8 @@ class AliRsnCutTrackQuality : public AliRsnCut { public: AliRsnCutTrackQuality(const char *name = "AliRsncutTrackQuality"); - AliRsnCutTrackQuality(const AliRsnCutTrackQuality& copy); - AliRsnCutTrackQuality& operator=(const AliRsnCutTrackQuality& copy); + AliRsnCutTrackQuality(const AliRsnCutTrackQuality ©); + AliRsnCutTrackQuality &operator=(const AliRsnCutTrackQuality ©); virtual ~AliRsnCutTrackQuality() { } void DisableAll(); @@ -48,9 +48,9 @@ public: void SetTPCmaxChi2(Double_t value) {fTPCmaxChi2 = value;} void SetRejectKinkDaughters(Bool_t yn = kTRUE) {fRejectKinkDaughters = yn;} - + void SetAODTestFilterBit(Int_t value) {fAODTestFilterBit = value;} - + void SetDefaults2010(); virtual Bool_t IsSelected(TObject *obj); @@ -60,7 +60,7 @@ protected: Bool_t CheckESD(AliESDtrack *track); Bool_t CheckAOD(AliAODTrack *track); - const char* Binary(UInt_t number); + const char *Binary(UInt_t number); ULong_t fFlagsOn; // status flags which must be ON (used AliESDtrack ones, connected with '|') ULong_t fFlagsOff; // status flags which must be OFF (used AliESDtrack ones, connected with '|') @@ -88,20 +88,20 @@ protected: }; //__________________________________________________________________________________________________ -inline const char * AliRsnCutTrackQuality::Binary(UInt_t number) +inline const char *AliRsnCutTrackQuality::Binary(UInt_t number) { // // Convert an integer in binary // - static char b[50]; - b[0] = '\0'; + static char b[50]; + b[0] = '\0'; - UInt_t z; - for (z = 512; z > 0; z >>= 1) - strncat(b, ((number & z) == z) ? "1" : "0", 1); + UInt_t z; + for (z = 512; z > 0; z >>= 1) + strncat(b, ((number & z) == z) ? "1" : "0", 1); - return b; + return b; } //__________________________________________________________________________________________________ diff --git a/PWG2/RESONANCES/AliRsnCutTrue.cxx b/PWG2/RESONANCES/AliRsnCutTrue.cxx index ba5fb5d0c00..0ed07a583d4 100644 --- a/PWG2/RESONANCES/AliRsnCutTrue.cxx +++ b/PWG2/RESONANCES/AliRsnCutTrue.cxx @@ -41,7 +41,7 @@ AliRsnCutTrue::AliRsnCutTrue(const AliRsnCutTrue ©) : } //__________________________________________________________________________________________________ -AliRsnCutTrue& AliRsnCutTrue::operator=(const AliRsnCutTrue ©) +AliRsnCutTrue &AliRsnCutTrue::operator=(const AliRsnCutTrue ©) { // // Assignment operator @@ -62,17 +62,17 @@ Bool_t AliRsnCutTrue::IsSelected(TObject *obj) // convert target if (!TargetOK(obj)) return kFALSE; - + // check if MC is present if (!fDaughter->GetRefMC()) { AliError("Cannot check cut 'AliRsnCutTrue' without MC information"); return kFALSE; } - + // compare PDG fCutValueI = fDaughter->GetPDGAbs(); return OkValueI(); } - - + + diff --git a/PWG2/RESONANCES/AliRsnCutTrue.h b/PWG2/RESONANCES/AliRsnCutTrue.h index 8577e5f68fb..c03f91ab203 100644 --- a/PWG2/RESONANCES/AliRsnCutTrue.h +++ b/PWG2/RESONANCES/AliRsnCutTrue.h @@ -14,17 +14,17 @@ #include "AliRsnCut.h" class AliRsnCutTrue : public AliRsnCut { - + public: AliRsnCutTrue(const char *name, Int_t pdg); AliRsnCutTrue(const char *name, AliRsnDaughter::ESpecies species); - AliRsnCutTrue(const AliRsnCutTrue& copy); - AliRsnCutTrue& operator=(const AliRsnCutTrue ©); + AliRsnCutTrue(const AliRsnCutTrue ©); + AliRsnCutTrue &operator=(const AliRsnCutTrue ©); virtual ~AliRsnCutTrue() { } - + virtual Bool_t IsSelected(TObject *obj); - + private: ClassDef(AliRsnCutTrue,1) // AliRsnCutTrue class diff --git a/PWG2/RESONANCES/AliRsnCutV0.cxx b/PWG2/RESONANCES/AliRsnCutV0.cxx index b1bc320c51a..a93f3e2fc41 100644 --- a/PWG2/RESONANCES/AliRsnCutV0.cxx +++ b/PWG2/RESONANCES/AliRsnCutV0.cxx @@ -66,24 +66,24 @@ AliRsnCutV0::AliRsnCutV0(const AliRsnCutV0 ©) : } //_________________________________________________________________________________________________ -AliRsnCutV0& AliRsnCutV0::operator=(const AliRsnCutV0 ©) +AliRsnCutV0 &AliRsnCutV0::operator=(const AliRsnCutV0 ©) { // // Assignment operator. // Just copy all data member values. // - if (this == ©) - return *this; - - fHypothesis = copy.fHypothesis; - fMass = copy.fMass; - fTolerance = copy.fTolerance; - fMaxDCAVertex = copy.fMaxDCAVertex; - fMinCosPointAngle = copy.fMinCosPointAngle; - fMaxDaughtersDCA = copy.fMaxDaughtersDCA; - fESDtrackCuts = copy.fESDtrackCuts; - + if (this == ©) + return *this; + + fHypothesis = copy.fHypothesis; + fMass = copy.fMass; + fTolerance = copy.fTolerance; + fMaxDCAVertex = copy.fMaxDCAVertex; + fMinCosPointAngle = copy.fMinCosPointAngle; + fMaxDaughtersDCA = copy.fMaxDaughtersDCA; + fESDtrackCuts = copy.fESDtrackCuts; + return (*this); } @@ -98,12 +98,12 @@ Bool_t AliRsnCutV0::IsSelected(TObject *object) // coherence check if (!TargetOK(object)) return kFALSE; - + // check cast AliESDv0 *v0esd = fDaughter->Ref2ESDv0(); AliAODv0 *v0aod = fDaughter->Ref2AODv0(); //cout << fDaughter->GetRef()->ClassName() << ' ' << v0esd << ' ' << v0aod << endl; - + // operate depending on cast if (v0esd) { return CheckESD(v0esd); @@ -129,20 +129,20 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0) AliDebugClass(1, "Rejecting V0 in 'on fly' status"); return kFALSE; // if kTRUE, then this V0 is recontructed } - + // retrieve pointer to owner event AliESDEvent *lESDEvent = fEvent->GetRefESD(); Double_t xPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetX(); Double_t yPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetY(); Double_t zPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetZ(); AliDebugClass(2, Form("Primary vertex: %f %f %f", xPrimaryVertex, yPrimaryVertex, zPrimaryVertex)); - + // retrieve the V0 daughters UInt_t lIdxPos = (UInt_t) TMath::Abs(v0->GetPindex()); UInt_t lIdxNeg = (UInt_t) TMath::Abs(v0->GetNindex()); AliESDtrack *pTrack = lESDEvent->GetTrack(lIdxPos); AliESDtrack *nTrack = lESDEvent->GetTrack(lIdxNeg); - + // check quality cuts if (fESDtrackCuts) { AliDebugClass(2, "Checking quality cuts"); @@ -155,20 +155,20 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0) return kFALSE; } } - + // filter like-sign V0 //if ((TMath::Abs(pTrack->GetSign()) - TMath::Abs(nTrack->GetSign()) ) < 0.1) { // AliDebugClass(2, "Failed like-sign V0 check"); // return kFALSE; //} - + // check compatibility with expected species hypothesis v0->ChangeMassHypothesis(fHypothesis); if ((TMath::Abs(v0->GetEffMass() - fMass)) > fTolerance) { AliDebugClass(2, "V0 is not in the expected inv mass range"); return kFALSE; } - + // topological checks if (TMath::Abs(v0->GetD(xPrimaryVertex, yPrimaryVertex, zPrimaryVertex)) > fMaxDCAVertex) { AliDebugClass(2, "Failed check on DCA to primary vertes"); @@ -182,10 +182,10 @@ Bool_t AliRsnCutV0::CheckESD(AliESDv0 *v0) AliDebugClass(2, "Failed check on DCA between daughters"); return kFALSE; } - + // if we reach this point, all checks were successful AliDebugClass(2, "Good V0 (hallelujah)"); - return kTRUE; + return kTRUE; } //_________________________________________________________________________________________________ @@ -198,7 +198,7 @@ Bool_t AliRsnCutV0::CheckAOD(AliAODv0 *) // AliWarning("Cuts is not yet implemented for AOD"); - + return kTRUE; } diff --git a/PWG2/RESONANCES/AliRsnCutV0.h b/PWG2/RESONANCES/AliRsnCutV0.h index 8441cbf808a..05a7dfec8ed 100644 --- a/PWG2/RESONANCES/AliRsnCutV0.h +++ b/PWG2/RESONANCES/AliRsnCutV0.h @@ -14,10 +14,10 @@ class AliRsnCutV0 : public AliRsnCut { public: AliRsnCutV0(const char *name = "AliRsnCutV0", Int_t hypothesis = kLambda0); - AliRsnCutV0(const AliRsnCutV0& copy); - AliRsnCutV0& operator=(const AliRsnCutV0& copy); + AliRsnCutV0(const AliRsnCutV0 ©); + AliRsnCutV0 &operator=(const AliRsnCutV0 ©); virtual ~AliRsnCutV0() { } - + void SetESDtrackCuts(AliESDtrackCuts *cuts) {fESDtrackCuts = cuts;} void SetHypothesis(Int_t code); void SetTolerance(Double_t value) {fTolerance = value;} @@ -32,7 +32,7 @@ protected: Bool_t CheckESD(AliESDv0 *track); Bool_t CheckAOD(AliAODv0 *track); - + Int_t fHypothesis; // PDG code corresponding to expected V0 hypothesis Double_t fMass; // mass corresponding to hypothesis Double_t fTolerance; // tolerance in the difference between computed and expected mass @@ -56,7 +56,7 @@ inline void AliRsnCutV0::SetHypothesis(Int_t code) // fHypothesis = code; - + switch (fHypothesis) { case kLambda0: case kLambda0Bar: diff --git a/PWG2/RESONANCES/AliRsnCutValue.cxx b/PWG2/RESONANCES/AliRsnCutValue.cxx index b6cba21a1d3..770211588ca 100644 --- a/PWG2/RESONANCES/AliRsnCutValue.cxx +++ b/PWG2/RESONANCES/AliRsnCutValue.cxx @@ -50,7 +50,7 @@ AliRsnCutValue::AliRsnCutValue } //_________________________________________________________________________________________________ -AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue& copy) : +AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue ©) : AliRsnCut(copy), fValue(copy.fValue) { @@ -61,20 +61,20 @@ AliRsnCutValue::AliRsnCutValue(const AliRsnCutValue& copy) : } //_________________________________________________________________________________________________ -AliRsnCutValue& AliRsnCutValue::operator=(const AliRsnCutValue& copy) +AliRsnCutValue &AliRsnCutValue::operator=(const AliRsnCutValue ©) { // // Assignment operator. // Does not duplicate memory allocation. // - AliRsnCut::operator=(copy); - if (this == ©) - return *this; - - fValue = copy.fValue; - - return (*this); + AliRsnCut::operator=(copy); + if (this == ©) + return *this; + + fValue = copy.fValue; + + return (*this); } //_________________________________________________________________________________________________ @@ -87,7 +87,7 @@ Bool_t AliRsnCutValue::IsSelected(TObject *object) // skip cut if value is not initialized if (!fValue) return kTRUE; - + // match target types SetTargetType(fValue->GetTargetType()); diff --git a/PWG2/RESONANCES/AliRsnCutValue.h b/PWG2/RESONANCES/AliRsnCutValue.h index dae77129ae9..94438799c80 100644 --- a/PWG2/RESONANCES/AliRsnCutValue.h +++ b/PWG2/RESONANCES/AliRsnCutValue.h @@ -27,12 +27,12 @@ public: AliRsnCutValue(); AliRsnCutValue(const char *name, Double_t min, Double_t max); - AliRsnCutValue(const AliRsnCutValue& copy); - AliRsnCutValue& operator=(const AliRsnCutValue& copy); + AliRsnCutValue(const AliRsnCutValue ©); + AliRsnCutValue &operator=(const AliRsnCutValue ©); virtual ~AliRsnCutValue() { } Double_t GetComputedValue() {if (fValue) return fValue->GetComputedValue(); return -1E20;} - AliRsnValue* GetValueObj() {return fValue;} + AliRsnValue *GetValueObj() {return fValue;} void SetValueObj(AliRsnValue *value) {fValue = value; SetTargetType(value->GetTargetType());} virtual Bool_t IsSelected(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnDaughter.cxx b/PWG2/RESONANCES/AliRsnDaughter.cxx index 4dca2487f08..91e7d137bc9 100644 --- a/PWG2/RESONANCES/AliRsnDaughter.cxx +++ b/PWG2/RESONANCES/AliRsnDaughter.cxx @@ -6,9 +6,9 @@ // need to be accessed from ESD or AOD objects, usually in different ways. // When MC is available, AliRsnDaughter matches each reconstructed object with // its corresponding MC particle. -// +// // Currently, this interface can point to all kinds of single-particle object -// which one can have in the reconstructed event: charged tracks, V0s and +// which one can have in the reconstructed event: charged tracks, V0s and // cascades. It is care of the user to treat each of them in the correct way, // regarding cuts, functions to be computed, etc. // @@ -44,15 +44,15 @@ AliRsnDaughter::AliRsnDaughter(const AliRsnDaughter ©) : } //_____________________________________________________________________________ -AliRsnDaughter& AliRsnDaughter::operator=(const AliRsnDaughter ©) +AliRsnDaughter &AliRsnDaughter::operator=(const AliRsnDaughter ©) { // // Assignment operator. // Pointers are NOT duplicated, since they don't come from a 'new' // statement, but from just referencing something in the data source. // - if (this == ©) - return *this; + if (this == ©) + return *this; fOK = copy.fOK; fLabel = copy.fLabel; @@ -80,7 +80,7 @@ void AliRsnDaughter::Reset() fLabel = -1; fMotherPDG = 0; fRsnID = -1; - + fPsim.SetXYZT(0.0, 0.0, 0.0, 0.0); fPrec.SetXYZT(0.0, 0.0, 0.0, 0.0); @@ -97,9 +97,9 @@ Int_t AliRsnDaughter::GetPDG() // if (Match(fRefMC, AliMCParticle::Class())) - return ((AliMCParticle*)fRefMC)->Particle()->GetPdgCode(); + return ((AliMCParticle *)fRefMC)->Particle()->GetPdgCode(); else if (Match(fRefMC, AliAODMCParticle::Class())) - return ((AliAODMCParticle*)fRefMC)->GetPdgCode(); + return ((AliAODMCParticle *)fRefMC)->GetPdgCode(); else { AliWarning("Cannot retrieve PDG"); return 0; @@ -138,17 +138,17 @@ Int_t AliRsnDaughter::GetMother() if (!fRefMC) return -1; if (fRefMC->InheritsFrom(AliMCParticle::Class())) { - AliMCParticle *mc = (AliMCParticle*)fRefMC; + AliMCParticle *mc = (AliMCParticle *)fRefMC; return mc->Particle()->GetFirstMother(); } else if (fRefMC->InheritsFrom(AliAODMCParticle::Class())) { - AliAODMCParticle *mc = (AliAODMCParticle*)fRefMC; + AliAODMCParticle *mc = (AliAODMCParticle *)fRefMC; return mc->GetMother(); } else return -1; } - - + + //______________________________________________________________________________ void AliRsnDaughter::Print(Option_t *) const @@ -165,7 +165,7 @@ void AliRsnDaughter::Print(Option_t *) const } //______________________________________________________________________________ -const char* AliRsnDaughter::SpeciesName(ESpecies species) +const char *AliRsnDaughter::SpeciesName(ESpecies species) { // // Return a string with the short name of the particle @@ -215,7 +215,7 @@ Double_t AliRsnDaughter::SpeciesMass(ESpecies species) TDatabasePDG *db = TDatabasePDG::Instance(); TParticlePDG *part = 0x0; - + Int_t pdg = SpeciesPDG(species); if (pdg) { part = db->GetParticle(pdg); diff --git a/PWG2/RESONANCES/AliRsnDaughter.h b/PWG2/RESONANCES/AliRsnDaughter.h index c68e377547c..456c4f58e4b 100644 --- a/PWG2/RESONANCES/AliRsnDaughter.h +++ b/PWG2/RESONANCES/AliRsnDaughter.h @@ -34,7 +34,7 @@ public: kCascade, kNoType }; - + enum ESpecies { kElectron, kMuon, @@ -49,9 +49,9 @@ public: }; AliRsnDaughter() : fOK(kFALSE), fLabel(-1), fMotherPDG(0), fRsnID(-1), - fPrec(), fPsim(), fRef(0x0), fRefMC(0x0), fOwnerEvent(0x0) { } + fPrec(), fPsim(), fRef(0x0), fRefMC(0x0), fOwnerEvent(0x0) { } AliRsnDaughter(const AliRsnDaughter ©); - AliRsnDaughter& operator= (const AliRsnDaughter& copy); + AliRsnDaughter &operator= (const AliRsnDaughter ©); virtual ~AliRsnDaughter() { /*empty, since pointers must not be deleted*/ } // basic getters @@ -59,12 +59,12 @@ public: Int_t GetLabel() const {return fLabel;} Int_t GetMotherPDG() const {return fMotherPDG;} Int_t GetRsnID() const {return fRsnID;} - AliVParticle* GetRef() {return fRef;} - AliVParticle* GetRefMC() {return fRefMC;} - AliRsnEvent* GetOwnerEvent() {return fOwnerEvent;} - TLorentzVector& P(Bool_t mc) {return (mc ? fPsim : fPrec);} - TLorentzVector& Prec() {return fPrec;} - TLorentzVector& Psim() {return fPsim;} + AliVParticle *GetRef() {return fRef;} + AliVParticle *GetRefMC() {return fRefMC;} + AliRsnEvent *GetOwnerEvent() {return fOwnerEvent;} + TLorentzVector &P(Bool_t mc) {return (mc ? fPsim : fPrec);} + TLorentzVector &Prec() {return fPrec;} + TLorentzVector &Psim() {return fPsim;} Int_t GetPDG(); Int_t GetPDGAbs() {return TMath::Abs(GetPDG());} Int_t GetID(); @@ -81,11 +81,11 @@ public: void SetRef(AliVParticle *p) {fRef = p;} void SetRefMC(AliVParticle *p) {fRefMC = p;} void SetOwnerEvent(AliRsnEvent *e) {fOwnerEvent = e;} - + // additional functions void FillP(Double_t mass); void Print(Option_t *o = "") const; - + // getters related to charge Bool_t IsPos() const {if (fRef) return (fRef->Charge() > 0); return kFALSE;} Bool_t IsNeg() const {if (fRef) return (fRef->Charge() < 0); return kFALSE;} @@ -93,8 +93,8 @@ public: Bool_t IsNeutral() const {if (fRef) return (!IsCharged()); return kFALSE;} Short_t ChargeS() const {if (IsPos()) return 1 ; else if (IsNeg()) return -1 ; else return 0 ;} Char_t ChargeC() const {if (IsPos()) return '+'; else if (IsNeg()) return '-'; else return '0';} - - // getters which automatically convert refs into allowed types + + // getters which automatically convert refs into allowed types static Bool_t Match(AliVParticle *p, TClass *ref) {if (p) return (p->InheritsFrom(ref)); return kFALSE;} Bool_t MatchRef(TClass *ref) {return Match(fRef, ref);} Bool_t MatchRefMC(TClass *ref) {return Match(fRefMC, ref);} @@ -102,25 +102,25 @@ public: Bool_t IsESD(); Bool_t IsAOD(); - AliVTrack* Ref2Vtrack() {if (Match(fRef, AliVTrack ::Class())) return static_cast (fRef); return 0x0;} - AliESDtrack* Ref2ESDtrack() {if (Match(fRef, AliESDtrack ::Class())) return static_cast (fRef); return 0x0;} - AliAODTrack* Ref2AODtrack() {if (Match(fRef, AliAODTrack ::Class())) return static_cast (fRef); return 0x0;} - AliMCParticle* Ref2MCparticle() {if (Match(fRef, AliMCParticle::Class())) return static_cast (fRef); return 0x0;} - AliAODMCParticle* Ref2AODMCparticle() {if (Match(fRef, AliMCParticle::Class())) return static_cast(fRef); return 0x0;} - - AliESDv0* Ref2ESDv0() {if (Match(fRef, AliESDv0 ::Class())) return static_cast(fRef); return 0x0;} - AliAODv0* Ref2AODv0() {if (Match(fRef, AliAODv0 ::Class())) return static_cast(fRef); return 0x0;} - - AliESDcascade* Ref2ESDcascade() {if (Match(fRef, AliESDcascade::Class())) return static_cast(fRef); return 0x0;} - AliAODcascade* Ref2AODcascade() {if (Match(fRef, AliAODcascade::Class())) return static_cast(fRef); return 0x0;} - - AliMCParticle* RefMC2ESD() {if (Match(fRefMC, AliMCParticle ::Class())) return static_cast (fRef) ; return 0x0;} - AliAODMCParticle* RefMC2AOD() {if (Match(fRefMC, AliAODMCParticle::Class())) return static_cast(fRefMC); return 0x0;} - + AliVTrack *Ref2Vtrack() {if (Match(fRef, AliVTrack ::Class())) return static_cast (fRef); return 0x0;} + AliESDtrack *Ref2ESDtrack() {if (Match(fRef, AliESDtrack ::Class())) return static_cast (fRef); return 0x0;} + AliAODTrack *Ref2AODtrack() {if (Match(fRef, AliAODTrack ::Class())) return static_cast (fRef); return 0x0;} + AliMCParticle *Ref2MCparticle() {if (Match(fRef, AliMCParticle::Class())) return static_cast (fRef); return 0x0;} + AliAODMCParticle *Ref2AODMCparticle() {if (Match(fRef, AliMCParticle::Class())) return static_cast(fRef); return 0x0;} + + AliESDv0 *Ref2ESDv0() {if (Match(fRef, AliESDv0 ::Class())) return static_cast(fRef); return 0x0;} + AliAODv0 *Ref2AODv0() {if (Match(fRef, AliAODv0 ::Class())) return static_cast(fRef); return 0x0;} + + AliESDcascade *Ref2ESDcascade() {if (Match(fRef, AliESDcascade::Class())) return static_cast(fRef); return 0x0;} + AliAODcascade *Ref2AODcascade() {if (Match(fRef, AliAODcascade::Class())) return static_cast(fRef); return 0x0;} + + AliMCParticle *RefMC2ESD() {if (Match(fRefMC, AliMCParticle ::Class())) return static_cast (fRef) ; return 0x0;} + AliAODMCParticle *RefMC2AOD() {if (Match(fRefMC, AliAODMCParticle::Class())) return static_cast(fRefMC); return 0x0;} + // static functions related to internal ESpecies enum static ERefType RefType(ESpecies species); static Bool_t IsCharged(ESpecies species) {return (species <= kProton);} - static const char* SpeciesName(ESpecies species); + static const char *SpeciesName(ESpecies species); static Int_t SpeciesPDG(ESpecies species); static Double_t SpeciesMass(ESpecies species); static EPARTYPE ToAliPID(ESpecies species); @@ -132,7 +132,7 @@ private: Int_t fLabel; // index of MC particle Int_t fMotherPDG; // PDG code of mother (makes sense only if fRefMC is defined) Int_t fRsnID; // internal ID for monitoring purposes - + TLorentzVector fPrec; // 4-momentum for rec TLorentzVector fPsim; // 4-momentum for MC @@ -158,7 +158,7 @@ inline AliRsnDaughter::ERefType AliRsnDaughter::RefType() if (Match(fRef, AliAODv0 ::Class())) return kV0; if (Match(fRef, AliAODcascade::Class())) return kCascade; if (Match(fRef, AliMCParticle::Class())) return kTrack; - + return kNoType; } @@ -167,7 +167,7 @@ inline Bool_t AliRsnDaughter::IsESD() { // // Tells if the object pointed by fRef data member is ESD -// NOTE: it is true even when fRef is the MC corresponding +// NOTE: it is true even when fRef is the MC corresponding // object (= AliMCParticle) // @@ -175,7 +175,7 @@ inline Bool_t AliRsnDaughter::IsESD() if (Match(fRef, AliESDv0 ::Class())) return kTRUE; if (Match(fRef, AliESDcascade::Class())) return kTRUE; if (Match(fRef, AliMCParticle::Class())) return kTRUE; - + return kFALSE; } @@ -184,7 +184,7 @@ inline Bool_t AliRsnDaughter::IsAOD() { // // Tells if the object pointed by fRef data member is AOD -// NOTE: it is true even when fRef is the MC corresponding +// NOTE: it is true even when fRef is the MC corresponding // object (= AliAODMCParticle) // @@ -192,7 +192,7 @@ inline Bool_t AliRsnDaughter::IsAOD() if (Match(fRef, AliAODv0 ::Class())) return kTRUE; if (Match(fRef, AliAODcascade ::Class())) return kTRUE; if (Match(fRef, AliAODMCParticle::Class())) return kTRUE; - + return kFALSE; } diff --git a/PWG2/RESONANCES/AliRsnDaughterDef.cxx b/PWG2/RESONANCES/AliRsnDaughterDef.cxx index a189fc61c36..6a55cab2914 100644 --- a/PWG2/RESONANCES/AliRsnDaughterDef.cxx +++ b/PWG2/RESONANCES/AliRsnDaughterDef.cxx @@ -9,11 +9,11 @@ // -- defines the mass to be assigned to this object, for any purpose // (e.g.: to compute its 4-momentum to be used for a resonance mass) // -// -- track charge, which can be '+', '-', '0', +// -- track charge, which can be '+', '-', '0', // -- any other char leaves this undefined (use only in daughter monitor loops) // -- when doing resonance analysis, or when RSN Input handler needs to be used, // this must always be defined -// +// // -- object type (track/V0/cascade) // -- could be needed to select tracks when particle species is not specified // -- works only in single daughter loops @@ -99,14 +99,14 @@ AliRsnDaughterDef::AliRsnDaughterDef(const AliRsnDaughterDef ©) : } //_____________________________________________________________________________ -AliRsnDaughterDef& AliRsnDaughterDef::operator=(const AliRsnDaughterDef ©) +AliRsnDaughterDef &AliRsnDaughterDef::operator=(const AliRsnDaughterDef ©) { // // Assignment operator has standard behavior. // - if (this == ©) - return *this; - + if (this == ©) + return *this; + fMass = copy.fMass; fCharge = copy.fCharge; fPID = copy.fPID; diff --git a/PWG2/RESONANCES/AliRsnDaughterDef.h b/PWG2/RESONANCES/AliRsnDaughterDef.h index b21e5357721..d18d2f55d1d 100644 --- a/PWG2/RESONANCES/AliRsnDaughterDef.h +++ b/PWG2/RESONANCES/AliRsnDaughterDef.h @@ -12,15 +12,15 @@ // -- defines the mass to be assigned to this object, for any purpose // (e.g.: to compute its 4-momentum to be used for a resonance mass) // -// -- track charge, which can be '+', '-', '0', +// -- track charge, which can be '+', '-', '0', // -- any other char leaves this undefined (use only in daughter monitor loops) // -- when doing resonance analysis, or when RSN Input handler needs to be used, // this must always be defined -// +// // -- object type (track/V0/cascade) // -- could be needed to select tracks when particle species is not specified // -- works only in single daughter loops -// +// #include "AliRsnDaughter.h" @@ -32,7 +32,7 @@ public: AliRsnDaughterDef(AliRsnDaughter::ESpecies type, Char_t charge = 0); AliRsnDaughterDef(AliRsnDaughter::ERefType refType, Char_t charge = 0); AliRsnDaughterDef(const AliRsnDaughterDef ©); - AliRsnDaughterDef& operator= (const AliRsnDaughterDef ©); + AliRsnDaughterDef &operator= (const AliRsnDaughterDef ©); virtual ~AliRsnDaughterDef() { } AliRsnDaughter::ESpecies GetPID() const {return fPID;} @@ -40,13 +40,13 @@ public: Char_t GetChargeC() const {return fCharge;} Short_t GetChargeS() const {if (fCharge == '+') return 1; else if (fCharge == '-') return -1; else return 0;} AliRsnDaughter::ERefType GetRefType() const {return fRefType;} - virtual const char* GetName() const {return Form("%s%c", AliRsnDaughter::SpeciesName(fPID), fCharge);} + virtual const char *GetName() const {return Form("%s%c", AliRsnDaughter::SpeciesName(fPID), fCharge);} Bool_t IsChargeDefined() const {return (fCharge == '+' || fCharge == '-' || fCharge == '0');} - + void SetPID(AliRsnDaughter::ESpecies pid) {fPID = pid; fRefType = AliRsnDaughter::RefType(pid); fMass = AliRsnDaughter::SpeciesMass(pid);} void SetCharge(Char_t charge) {fCharge = charge;} void SetRefType(AliRsnDaughter::ERefType type) {fRefType = type;} - + Bool_t MatchesPID(AliRsnDaughter *daughter); Bool_t MatchesCharge(AliRsnDaughter *daughter) const; Bool_t MatchesRefType(AliRsnDaughter *daughter) const; @@ -69,7 +69,7 @@ private: inline Bool_t AliRsnDaughterDef::MatchesPID(AliRsnDaughter *daughter) { // -// Checks if the passed daughter true particle type +// Checks if the passed daughter true particle type // matches the species defined in fPID data member, // by comparing the corresponding PDG codes of both in absolute value. // Returns kTRUE when the two codes match, and kFALSE when: @@ -84,10 +84,10 @@ inline Bool_t AliRsnDaughterDef::MatchesPID(AliRsnDaughter *daughter) AliError("The passed argument has NULL MC pointer: cannot check PDG matching with this DaughterDef"); return kFALSE; } - + return MatchesPDG(daughter->GetPDGAbs()); } - + //__________________________________________________________________________________________________ inline Bool_t AliRsnDaughterDef::MatchesCharge(AliRsnDaughter *daughter) const { @@ -115,8 +115,8 @@ inline Bool_t AliRsnDaughterDef::MatchesRefType(AliRsnDaughter *daughter) const // AliRsnDaughter::ERefType type = daughter->RefType(); - - if (fRefType != AliRsnDaughter::kNoType) + + if (fRefType != AliRsnDaughter::kNoType) return (type == fRefType); else return kTRUE; diff --git a/PWG2/RESONANCES/AliRsnDaughterSelector.cxx b/PWG2/RESONANCES/AliRsnDaughterSelector.cxx index 2eba8f9ac53..d89644d47a8 100644 --- a/PWG2/RESONANCES/AliRsnDaughterSelector.cxx +++ b/PWG2/RESONANCES/AliRsnDaughterSelector.cxx @@ -11,7 +11,7 @@ ClassImp(AliRsnDaughterSelector) //__________________________________________________________________________________________________ -AliRsnDaughterSelector::AliRsnDaughterSelector(const char *name, const char *title) : +AliRsnDaughterSelector::AliRsnDaughterSelector(const char *name, const char *title) : TNamed(name, title), fCutSetsN("AliRsnCutSet", 0), fCutSetsC("AliRsnCutSet", 0), @@ -28,7 +28,7 @@ AliRsnDaughterSelector::AliRsnDaughterSelector(const char *name, const char *tit } //__________________________________________________________________________________________________ -AliRsnDaughterSelector::AliRsnDaughterSelector(const AliRsnDaughterSelector& copy) : +AliRsnDaughterSelector::AliRsnDaughterSelector(const AliRsnDaughterSelector ©) : TNamed(copy), fCutSetsN(copy.fCutSetsN), fCutSetsC(copy.fCutSetsC), @@ -45,7 +45,7 @@ AliRsnDaughterSelector::AliRsnDaughterSelector(const AliRsnDaughterSelector& cop } //__________________________________________________________________________________________________ -AliRsnDaughterSelector& AliRsnDaughterSelector::operator=(const AliRsnDaughterSelector& copy) +AliRsnDaughterSelector &AliRsnDaughterSelector::operator=(const AliRsnDaughterSelector ©) { // // Copy constructor. @@ -55,7 +55,7 @@ AliRsnDaughterSelector& AliRsnDaughterSelector::operator=(const AliRsnDaughterSe TNamed::operator=(copy); if (this == ©) - return *this; + return *this; fCutSetsN = copy.fCutSetsN; fCutSetsC = copy.fCutSetsC; fEntryListsN = copy.fEntryListsN; @@ -63,7 +63,7 @@ AliRsnDaughterSelector& AliRsnDaughterSelector::operator=(const AliRsnDaughterSe fEntryListsM = copy.fEntryListsM; AliDebug(AliLog::kDebug + 10, "->"); - + return (*this); } @@ -75,44 +75,44 @@ AliRsnDaughterSelector::~AliRsnDaughterSelector() // AliDebug(AliLog::kDebug + 10, "<-"); - + fCutSetsN.Delete(); fCutSetsC.Delete(); fEntryListsN.Delete(); fEntryListsP.Delete(); fEntryListsM.Delete(); - + AliDebug(AliLog::kDebug + 10, "->"); } //__________________________________________________________________________________________________ -void AliRsnDaughterSelector::Print(Option_t* option) const +void AliRsnDaughterSelector::Print(Option_t *option) const { // // Override TObject::Print() // TNamed::Print(option); - + Int_t i, nSets; AliRsnCutSet *set = 0x0; TEntryList *list = 0x0; - + // neutral nSets = fCutSetsN.GetEntries(); for (i = 0; i < nSets; i++) { - set = (AliRsnCutSet*)fCutSetsN[i]; - list = (TEntryList*)fEntryListsN[i]; + set = (AliRsnCutSet *)fCutSetsN[i]; + list = (TEntryList *)fEntryListsN[i]; AliInfo(Form("Neutral entry list for cut set '%s' has %d entries", set->GetName(), (Int_t)list->GetN())); } - + // charged nSets = fCutSetsC.GetEntries(); for (i = 0; i < nSets; i++) { - set = (AliRsnCutSet*)fCutSetsC[i]; - list = (TEntryList*)fEntryListsP[i]; + set = (AliRsnCutSet *)fCutSetsC[i]; + list = (TEntryList *)fEntryListsP[i]; AliInfo(Form("Positive entry list for cut set '%s' has %d entries", set->GetName(), (Int_t)list->GetN())); - list = (TEntryList*)fEntryListsM[i]; + list = (TEntryList *)fEntryListsM[i]; AliInfo(Form("Negative entry list for cut set '%s' has %d entries", set->GetName(), (Int_t)list->GetN())); } } @@ -125,24 +125,24 @@ void AliRsnDaughterSelector::Init() // of the corresponding arrays of cut sets. // If they are not empty, they are cleared. // - + Int_t i, nSets; - + // neutral nSets = fCutSetsN.GetEntries(); if (!fEntryListsN.IsEmpty()) fEntryListsN.Delete(); for (i = 0; i < nSets; i++) { - AliRsnCutSet *set = (AliRsnCutSet*)fCutSetsN[i]; + AliRsnCutSet *set = (AliRsnCutSet *)fCutSetsN[i]; new (fEntryListsN[i]) TEntryList; AliInfo(Form("Adding 1 entry list for neutrals --> cut set '%s' [scheme = '%s']", set->GetName(), set->GetCutScheme().Data())); } - + // charged nSets = fCutSetsC.GetEntries(); if (!fEntryListsP.IsEmpty()) fEntryListsP.Delete(); if (!fEntryListsM.IsEmpty()) fEntryListsM.Delete(); for (i = 0; i < nSets; i++) { - AliRsnCutSet *set = (AliRsnCutSet*)fCutSetsC[i]; + AliRsnCutSet *set = (AliRsnCutSet *)fCutSetsC[i]; new (fEntryListsP[i]) TEntryList; new (fEntryListsM[i]) TEntryList; AliInfo(Form("Adding 2 entry lists for charged --> cut set '%s' [scheme = '%s']", set->GetName(), set->GetCutScheme().Data())); @@ -154,20 +154,20 @@ void AliRsnDaughterSelector::Reset() { TEntryList *el; Int_t i, nSets; - + // N nSets = fCutSetsN.GetEntries(); for (i = 0; i < nSets; i++) { - el = (TEntryList*)fEntryListsN.At(i); + el = (TEntryList *)fEntryListsN.At(i); el->Reset(); } - + // charged nSets = fCutSetsC.GetEntries(); for (i = 0; i < nSets; i++) { - el = (TEntryList*)fEntryListsP.At(i); + el = (TEntryList *)fEntryListsP.At(i); el->Reset(); - el = (TEntryList*)fEntryListsM.At(i); + el = (TEntryList *)fEntryListsM.At(i); el->Reset(); } } @@ -180,7 +180,7 @@ Int_t AliRsnDaughterSelector::Add(AliRsnCutSet *cuts, Bool_t charged) // Int_t n = 0; - + if (!charged) { n = fCutSetsN.GetEntries(); new (fCutSetsN[n]) AliRsnCutSet(*cuts); @@ -188,7 +188,7 @@ Int_t AliRsnDaughterSelector::Add(AliRsnCutSet *cuts, Bool_t charged) n = fCutSetsC.GetEntries(); new (fCutSetsC[n]) AliRsnCutSet(*cuts); } - + return n; } @@ -200,50 +200,50 @@ Int_t AliRsnDaughterSelector::GetID(const char *name, Bool_t charged) // AliRsnCutSet *cuts; - + if (!charged) { - cuts = (AliRsnCutSet*)fCutSetsN.FindObject(name); + cuts = (AliRsnCutSet *)fCutSetsN.FindObject(name); if (cuts) return fCutSetsN.IndexOf(cuts); } else { - cuts = (AliRsnCutSet*)fCutSetsC.FindObject(name); + cuts = (AliRsnCutSet *)fCutSetsC.FindObject(name); if (cuts) return fCutSetsC.IndexOf(cuts); } - + return -1; } //__________________________________________________________________________________________________ -TEntryList* AliRsnDaughterSelector::GetSelected(Int_t i, Char_t charge) +TEntryList *AliRsnDaughterSelector::GetSelected(Int_t i, Char_t charge) { // // Retrieve a given entry list (needs charge specified as a char) // if (charge == '+') - return (TEntryList*)fEntryListsP.At(i); + return (TEntryList *)fEntryListsP.At(i); else if (charge == '-') - return (TEntryList*)fEntryListsM.At(i); + return (TEntryList *)fEntryListsM.At(i); else - return (TEntryList*)fEntryListsN.At(i); + return (TEntryList *)fEntryListsN.At(i); } //__________________________________________________________________________________________________ -TEntryList* AliRsnDaughterSelector::GetSelected(Int_t i, Short_t charge) +TEntryList *AliRsnDaughterSelector::GetSelected(Int_t i, Short_t charge) { // // Retrieve a given entry list passing charge as short // if (charge > 0) - return (TEntryList*)fEntryListsP.At(i); + return (TEntryList *)fEntryListsP.At(i); else if (charge < 0) - return (TEntryList*)fEntryListsM.At(i); + return (TEntryList *)fEntryListsM.At(i); else - return (TEntryList*)fEntryListsN.At(i); + return (TEntryList *)fEntryListsN.At(i); } //__________________________________________________________________________________________________ -void AliRsnDaughterSelector::ScanEvent(AliRsnEvent* ev) +void AliRsnDaughterSelector::ScanEvent(AliRsnEvent *ev) { // // Loop over event and fill all entry lists @@ -253,7 +253,7 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent* ev) Int_t nSel, nTot = ev->GetAbsoluteSum(); AliRsnDaughter check; TClonesArray *cutsArray = 0x0, *entryArray = 0x0; - + for (id = 0; id < nTot; id++) { ev->SetDaughter(check, id); // some checks @@ -279,13 +279,13 @@ void AliRsnDaughterSelector::ScanEvent(AliRsnEvent* ev) // check with all cuts in that charge nSel = cutsArray->GetEntries(); for (is = 0; is < nSel; is++) { - AliRsnCutSet *cuts = (AliRsnCutSet*)cutsArray->At(is); + AliRsnCutSet *cuts = (AliRsnCutSet *)cutsArray->At(is); if (cuts->IsSelected(&check)) { - TEntryList *el = (TEntryList*)entryArray->At(is); + TEntryList *el = (TEntryList *)entryArray->At(is); el->Enter(id); } } } - + //Print(); } diff --git a/PWG2/RESONANCES/AliRsnDaughterSelector.h b/PWG2/RESONANCES/AliRsnDaughterSelector.h index e8cc8ad1a2e..3acc497ceab 100644 --- a/PWG2/RESONANCES/AliRsnDaughterSelector.h +++ b/PWG2/RESONANCES/AliRsnDaughterSelector.h @@ -14,7 +14,7 @@ class AliRsnDaughterSelector : public TNamed { public: AliRsnDaughterSelector(const char *name = "name", const char *title = "title"); - AliRsnDaughterSelector(const AliRsnDaughterSelector& copy); + AliRsnDaughterSelector(const AliRsnDaughterSelector ©); AliRsnDaughterSelector &operator=(const AliRsnDaughterSelector ©); virtual ~AliRsnDaughterSelector(); @@ -22,17 +22,20 @@ public: void Reset(); Int_t Add(AliRsnCutSet *cuts, Bool_t charged); Int_t GetID(const char *cutSetName, Bool_t charged); - TEntryList* GetSelected(Int_t i, Char_t charge); - TEntryList* GetSelected(Int_t i, Short_t charge); + TEntryList *GetSelected(Int_t i, Char_t charge); + TEntryList *GetSelected(Int_t i, Short_t charge); void ScanEvent(AliRsnEvent *ev); - - virtual void Print(Option_t* option = "") const; + + virtual void Print(Option_t *option = "") const; + + TClonesArray *GetCutSetC() {return &fCutSetsC;} + TClonesArray *GetCutSetN() {return &fCutSetsN;} private: TClonesArray fCutSetsN; // cuts for neutral daughters TClonesArray fCutSetsC; // cuts for charged daughters (usually, the same) - + TClonesArray fEntryListsN; // entry lists for neutrals TClonesArray fEntryListsP; // entry lists for charged (one per sign) TClonesArray fEntryListsM; // entry lists for charged (one per sign) diff --git a/PWG2/RESONANCES/AliRsnEvent.cxx b/PWG2/RESONANCES/AliRsnEvent.cxx index 50c509da4c4..c5eeb0715a2 100644 --- a/PWG2/RESONANCES/AliRsnEvent.cxx +++ b/PWG2/RESONANCES/AliRsnEvent.cxx @@ -21,7 +21,7 @@ // which could be needed during analysis, which are not in AliVEvent but // need to be accessed from ESD or AOD objects, usually in different ways. // When MC is available, it is properly taken into account. -// +// // authors: A. Pulvirenti (alberto.pulvirenti@ct.infn.it) // M. Vala (martin.vala@cern.ch) // @@ -65,14 +65,14 @@ AliRsnEvent::AliRsnEvent(const AliRsnEvent &event) : } //_____________________________________________________________________________ -AliRsnEvent& AliRsnEvent::operator= (const AliRsnEvent & event) +AliRsnEvent &AliRsnEvent::operator= (const AliRsnEvent &event) { // // Works in the same way as the copy constructor. // TObject::operator=(event); - if (this == &event) - return *this; + if (this == &event) + return *this; fRef = event.fRef; fRefMC = event.fRefMC; fLeading = event.fLeading; @@ -105,37 +105,37 @@ void AliRsnEvent::SetDaughter(AliRsnDaughter &out, Int_t index, Bool_t fromMC) out.Reset(); out.SetRsnID(index); out.SetOwnerEvent(this); - + // check input type if (!InputOK()) return; Bool_t inputESD = IsESD(); - - Int_t trueIndex; - AliRsnDaughter::ERefType type; - if (!ConvertAbsoluteIndex(index, trueIndex, type)) { - AliError(Form("Failed to convert absolute index %d", index)); + + Int_t trueIndex; + AliRsnDaughter::ERefType type; + if (!ConvertAbsoluteIndex(index, trueIndex, type)) { + AliError(Form("Failed to convert absolute index %d", index)); + return; + } + switch (type) { + case AliRsnDaughter::kTrack: + if (inputESD) { + SetDaughterESDtrack(out, trueIndex); + + } else { + SetDaughterAODtrack(out, trueIndex); + } + break; + case AliRsnDaughter::kV0: + if (inputESD) SetDaughterESDv0(out, trueIndex); else SetDaughterAODv0(out, trueIndex); + break; + case AliRsnDaughter::kCascade: + if (inputESD) SetDaughterESDcascade(out, trueIndex); else SetDaughterAODcascade(out, trueIndex); + break; + default: + AliError("Unrecognized daughter type"); return; - } - switch (type) { - case AliRsnDaughter::kTrack: - if (inputESD) { - SetDaughterESDtrack(out, trueIndex); - - } else { - SetDaughterAODtrack(out, trueIndex); - } - break; - case AliRsnDaughter::kV0: - if (inputESD) SetDaughterESDv0(out, trueIndex); else SetDaughterAODv0(out, trueIndex); - break; - case AliRsnDaughter::kCascade: - if (inputESD) SetDaughterESDcascade(out, trueIndex); else SetDaughterAODcascade(out, trueIndex); - break; - default: - AliError("Unrecognized daughter type"); - return; - } + } // if it is pure MC, the index tells what particle // to be read in the stack of MC particles, otherwise @@ -165,8 +165,8 @@ void AliRsnEvent::SetDaughterESDtrack(AliRsnDaughter &out, Int_t i) // Version #1: ESD tracks // - AliESDEvent *esd = (AliESDEvent*)fRef; - + AliESDEvent *esd = (AliESDEvent *)fRef; + if (i >= 0 && i < esd->GetNumberOfTracks()) { AliESDtrack *track = esd->GetTrack(i); if (track) { @@ -197,7 +197,7 @@ void AliRsnEvent::SetDaughterAODtrack(AliRsnDaughter &out, Int_t i) // Version #2: AOD tracks // - AliAODEvent *aod = (AliAODEvent*)fRef; + AliAODEvent *aod = (AliAODEvent *)fRef; if (i >= 0 && i < aod->GetNumberOfTracks()) { AliAODTrack *track = aod->GetTrack(i); @@ -237,7 +237,7 @@ void AliRsnEvent::SetDaughterESDv0(AliRsnDaughter &out, Int_t i) out.SetGood(); // if MC is present, retrieve the label of V0 from those of daughters if (fRefMC) { - AliMCEvent *mc = (AliMCEvent*)fRefMC; + AliMCEvent *mc = (AliMCEvent *)fRefMC; AliESDtrack *tp = ev->GetTrack(v0->GetPindex()); AliESDtrack *tn = ev->GetTrack(v0->GetNindex()); if (mc && tp && tn) { @@ -270,21 +270,21 @@ void AliRsnEvent::SetDaughterAODv0(AliRsnDaughter &out, Int_t i) // if (i >= 0 && i < fRef->GetNumberOfV0s()) { - AliAODEvent *ev = (AliAODEvent*)fRef; + AliAODEvent *ev = (AliAODEvent *)fRef; AliAODv0 *v0 = ev->GetV0(i); if (v0) { out.SetRef(v0); out.SetGood(); if (fRefMC) { - AliAODEvent *mc = (AliAODEvent*)fRefMC; - TClonesArray *mcArray = (TClonesArray*)mc->GetList()->FindObject(AliAODMCParticle::StdBranchName()); - AliAODTrack *tp = (AliAODTrack*)v0->GetDaughter(0); - AliAODTrack *tn = (AliAODTrack*)v0->GetDaughter(1); + AliAODEvent *mc = (AliAODEvent *)fRefMC; + TClonesArray *mcArray = (TClonesArray *)mc->GetList()->FindObject(AliAODMCParticle::StdBranchName()); + AliAODTrack *tp = (AliAODTrack *)v0->GetDaughter(0); + AliAODTrack *tn = (AliAODTrack *)v0->GetDaughter(1); if (mcArray && tp && tn) { Int_t lp = TMath::Abs(tp->GetLabel()); Int_t ln = TMath::Abs(tn->GetLabel()); - AliAODMCParticle *pp = (AliAODMCParticle*)mcArray->At(lp); - AliAODMCParticle *pn = (AliAODMCParticle*)mcArray->At(ln); + AliAODMCParticle *pp = (AliAODMCParticle *)mcArray->At(lp); + AliAODMCParticle *pn = (AliAODMCParticle *)mcArray->At(ln); if (pp && pn) { // if their first mothers are the same, the V0 is true // otherwise label remains '-1' --> fake V0 @@ -316,7 +316,7 @@ void AliRsnEvent::SetDaughterESDcascade(AliRsnDaughter &out, Int_t i) out.SetRef(casc); out.SetGood(); if (fRefMC) { - + } } } @@ -339,7 +339,7 @@ void AliRsnEvent::SetDaughterAODcascade(AliRsnDaughter &out, Int_t i) out.SetRef(casc); out.SetGood(); if (fRefMC) { - + } } } @@ -357,10 +357,10 @@ Bool_t AliRsnEvent::SetMCInfoESD(AliRsnDaughter &out) // if label makes no sense --> failed Int_t label = out.GetLabel(); if (label < 0 || !fRefMC) return kFALSE; - + // get number of particles Int_t nMC = fRefMC->GetNumberOfTracks(); - + // if label too large --> failed if (label >= nMC) { AliWarning(Form("Stack overflow: track label = %d -- stack maximum = %d", label, nMC)); @@ -368,9 +368,9 @@ Bool_t AliRsnEvent::SetMCInfoESD(AliRsnDaughter &out) } // retrieve particle - AliMCEvent *mc = (AliMCEvent*)fRefMC; - AliMCParticle *mcPart = (AliMCParticle*)mc->GetTrack(label); - + AliMCEvent *mc = (AliMCEvent *)fRefMC; + AliMCParticle *mcPart = (AliMCParticle *)mc->GetTrack(label); + // if particle = NULL --> failed if (!mcPart) { AliWarning(Form("Stack discontinuity: label %d refers to a NULL object", label)); @@ -382,7 +382,7 @@ Bool_t AliRsnEvent::SetMCInfoESD(AliRsnDaughter &out) // if the particle is not primary, find the mother and get its PDG Int_t imum = mcPart->Particle()->GetFirstMother(); if (imum >= 0 && imum < nMC) { - AliMCParticle *mcMother = (AliMCParticle*)mc->GetTrack(imum); + AliMCParticle *mcMother = (AliMCParticle *)mc->GetTrack(imum); if (mcMother) { out.SetMotherPDG(TMath::Abs(mcMother->Particle()->GetPdgCode())); } else { @@ -407,22 +407,22 @@ Bool_t AliRsnEvent::SetMCInfoAOD(AliRsnDaughter &out) // if label makes no sense --> failed Int_t label = out.GetLabel(); if (label < 0 || !fRefMC) return kFALSE; - + // retrieve particle - AliAODEvent *mc = (AliAODEvent*)fRefMC; - TClonesArray *mcArray = (TClonesArray*)mc->GetList()->FindObject(AliAODMCParticle::StdBranchName()); - + AliAODEvent *mc = (AliAODEvent *)fRefMC; + TClonesArray *mcArray = (TClonesArray *)mc->GetList()->FindObject(AliAODMCParticle::StdBranchName()); + // get number of particles Int_t nMC = mcArray->GetEntriesFast(); - + // if label too large --> failed if (label >= nMC) { AliWarning(Form("Stack overflow: track label = %d -- stack maximum = %d", label, nMC)); return kFALSE; } - + // if particle = NULL --> failed - AliAODMCParticle *mcPart = (AliAODMCParticle*)mcArray->At(label); + AliAODMCParticle *mcPart = (AliAODMCParticle *)mcArray->At(label); if (!mcPart) { AliWarning(Form("Stack discontinuity: label %d refers to a NULL object", label)); return kFALSE; @@ -433,7 +433,7 @@ Bool_t AliRsnEvent::SetMCInfoAOD(AliRsnDaughter &out) // if the particle is not primary, find the mother and get its PDG Int_t imum = mcPart->GetMother(); if (imum >= 0 && imum < nMC) { - AliAODMCParticle *mcMother = (AliAODMCParticle*)mcArray->At(imum); + AliAODMCParticle *mcMother = (AliAODMCParticle *)mcArray->At(imum); if (mcMother) { out.SetMotherPDG(TMath::Abs(mcMother->GetPdgCode())); } else { @@ -543,7 +543,7 @@ Int_t AliRsnEvent::SelectLeadingParticle(AliRsnCutSet *cuts) Double_t ptMax = 0.0; Int_t i, nTracks = fRef->GetNumberOfTracks(); - + fLeading = -1; AliRsnDaughter leading; @@ -566,6 +566,6 @@ Int_t AliRsnEvent::SelectLeadingParticle(AliRsnCutSet *cuts) fLeading = i; } } - + return fLeading; } diff --git a/PWG2/RESONANCES/AliRsnEvent.h b/PWG2/RESONANCES/AliRsnEvent.h index 23750c91f4e..fd1ae51e631 100644 --- a/PWG2/RESONANCES/AliRsnEvent.h +++ b/PWG2/RESONANCES/AliRsnEvent.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Interface to full event. @@ -30,29 +30,29 @@ class AliRsnEvent : public TObject { public: AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0); - AliRsnEvent(const AliRsnEvent& copy); - AliRsnEvent& operator= (const AliRsnEvent& copy); + AliRsnEvent(const AliRsnEvent ©); + AliRsnEvent &operator= (const AliRsnEvent ©); virtual ~AliRsnEvent(); // basic setters/getters void SetRef(AliVEvent *ref) {fRef = ref;} void SetRefMC(AliVEvent *refmc); void SetPIDResponse(AliPIDResponse *pid) {fPID = pid;} - AliVEvent* GetRef() {return fRef;} - AliVEvent* GetRefMC() {return fRefMC;} + AliVEvent *GetRef() {return fRef;} + AliVEvent *GetRefMC() {return fRefMC;} Int_t GetLeadingIndex() const {return fLeading;} - AliPIDResponse* GetPIDResponse() {return fPID;} + AliPIDResponse *GetPIDResponse() {return fPID;} // getters which convert into allowed input types Bool_t Match(AliVEvent *ev, TClass *ref) {if (ev) return (ev->InheritsFrom(ref)); return kFALSE;} Bool_t IsESD() {return (Match(fRef, AliESDEvent::Class()));} Bool_t IsAOD() {return (Match(fRef, AliAODEvent::Class()));} - Bool_t InputOK(); - AliESDEvent* GetRefESD() {if (IsESD()) return (AliESDEvent*)fRef; return 0x0;} - AliMCEvent* GetRefMCESD() {if (IsESD()) return (AliMCEvent *)fRefMC; return 0x0;} - AliAODEvent* GetRefAOD() {if (IsAOD()) return (AliAODEvent*)fRef; return 0x0;} - AliAODEvent* GetRefMCAOD() {if (IsAOD()) return (AliAODEvent*)fRefMC; return 0x0;} - TClonesArray* GetAODList() {return fAODList;} + Bool_t InputOK(); + AliESDEvent *GetRefESD() {if (IsESD()) return (AliESDEvent *)fRef; return 0x0;} + AliMCEvent *GetRefMCESD() {if (IsESD()) return (AliMCEvent *)fRefMC; return 0x0;} + AliAODEvent *GetRefAOD() {if (IsAOD()) return (AliAODEvent *)fRef; return 0x0;} + AliAODEvent *GetRefMCAOD() {if (IsAOD()) return (AliAODEvent *)fRefMC; return 0x0;} + TClonesArray *GetAODList() {return fAODList;} Bool_t HasMC() {if (IsESD()) return (fRefMC != 0x0); else if (IsAOD()) return (fRefMC != 0x0 && fAODList != 0x0); return kFALSE;} // setters for a daughter @@ -68,7 +68,7 @@ public: void SetDaughterAODMCtrack(AliRsnDaughter &target, Int_t index); Bool_t SetMCInfoESD (AliRsnDaughter &target); Bool_t SetMCInfoAOD (AliRsnDaughter &target); - + // counters/converters of candidates Int_t GetAbsoluteSum() {if (fRef) return (fRef->GetNumberOfTracks() + fRef->GetNumberOfV0s() + fRef->GetNumberOfCascades()); return 0;} Bool_t ConvertAbsoluteIndex(Int_t index, Int_t &realIndex, AliRsnDaughter::ERefType &type); @@ -77,7 +77,7 @@ public: // leading particle stuff void SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading, kFALSE);} Int_t SelectLeadingParticle(AliRsnCutSet *cuts = 0x0); - + private: AliVEvent *fRef; // pointer to input event @@ -107,7 +107,7 @@ inline Bool_t AliRsnEvent::InputOK() } } -inline void AliRsnEvent::SetRefMC(AliVEvent *mc) +inline void AliRsnEvent::SetRefMC(AliVEvent *mc) { // // Assign pointer to MC event. @@ -123,8 +123,8 @@ inline void AliRsnEvent::SetRefMC(AliVEvent *mc) fRefMC = mc; fAODList = 0x0; if (fRefMC->InheritsFrom(AliAODEvent::Class())) { - AliAODEvent *aod = (AliAODEvent*)mc; - fAODList = (TClonesArray*)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); + AliAODEvent *aod = (AliAODEvent *)mc; + fAODList = (TClonesArray *)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); if (!fAODList) fRefMC = 0x0; } } diff --git a/PWG2/RESONANCES/AliRsnExpression.cxx b/PWG2/RESONANCES/AliRsnExpression.cxx index feefa15e214..d7dba97171b 100644 --- a/PWG2/RESONANCES/AliRsnExpression.cxx +++ b/PWG2/RESONANCES/AliRsnExpression.cxx @@ -29,10 +29,10 @@ AliRsnExpression::AliRsnExpression(TString exp) : fOperator(0) { // Default constructor - TObjArray* tokens = Tokenize(exp); + TObjArray *tokens = Tokenize(exp); Int_t i = -1; - AliRsnExpression* e = Expression(*tokens, i); + AliRsnExpression *e = Expression(*tokens, i); // Copy !!! fArg1 = e->fArg1; e->fArg1 = 0; fArg2 = e->fArg2; e->fArg2 = 0; @@ -49,7 +49,7 @@ AliRsnExpression::~AliRsnExpression() if (fArg2) delete fArg2; } -AliRsnExpression::AliRsnExpression(const AliRsnExpression & exp) : TObject(exp), +AliRsnExpression::AliRsnExpression(const AliRsnExpression &exp) : TObject(exp), fVname(exp.fVname), fArg1(exp.fArg1), fArg2(exp.fArg2), @@ -57,7 +57,7 @@ AliRsnExpression::AliRsnExpression(const AliRsnExpression & exp) : TObject(exp), {} //______________________________________________________________________________ -AliRsnExpression& AliRsnExpression::operator= (const AliRsnExpression& e) +AliRsnExpression &AliRsnExpression::operator= (const AliRsnExpression &e) { // AliRsnExpression assignment operator. @@ -72,7 +72,7 @@ AliRsnExpression& AliRsnExpression::operator= (const AliRsnExpression& e) } //______________________________________________________________________________ -AliRsnExpression::AliRsnExpression(int op, AliRsnExpression* a, AliRsnExpression* b) : +AliRsnExpression::AliRsnExpression(int op, AliRsnExpression *a, AliRsnExpression *b) : TObject(), fVname(""), fArg1(a), @@ -83,7 +83,7 @@ AliRsnExpression::AliRsnExpression(int op, AliRsnExpression* a, AliRsnExpression } //______________________________________________________________________________ -AliRsnExpression::AliRsnExpression(int op, AliRsnExpression* a) : +AliRsnExpression::AliRsnExpression(int op, AliRsnExpression *a) : TObject(), fVname(""), fArg1(0), @@ -154,7 +154,7 @@ TString AliRsnExpression::Unparse() const } //______________________________________________________________________________ -TObjArray* AliRsnExpression::Tokenize(TString str) const +TObjArray *AliRsnExpression::Tokenize(TString str) const { // tokenize the expression @@ -165,35 +165,35 @@ TObjArray* AliRsnExpression::Tokenize(TString str) const str1.Append(str[i]); } // get variable tokens - TObjArray* valtok = str1.Tokenize("!&|()"); + TObjArray *valtok = str1.Tokenize("!&|()"); // put all variables together Int_t nvt = valtok->GetEntriesFast(); TString sumval; for (Int_t i = 0; i < nvt; i++) { - TObjString* val = (TObjString*) valtok->At(i); + TObjString *val = (TObjString *) valtok->At(i); sumval.Append(val->String()); } // get the operator tokens - TObjArray* optok = str1.Tokenize(sumval.Data()); + TObjArray *optok = str1.Tokenize(sumval.Data()); // put all operator in one string TString operators; Int_t nopt = optok->GetEntriesFast(); for (Int_t i = 0; i < nopt; i++) { - TObjString* val1 = (TObjString*) optok->At(i); + TObjString *val1 = (TObjString *) optok->At(i); operators.Append(val1->String()); } // add more room to be safe - TObjString* blank = new TObjString(" "); + TObjString *blank = new TObjString(" "); operators.Append(" "); valtok->AddLast(blank); // Now put var. and oper. together - TObjArray* tokens = new TObjArray(valtok->GetEntriesFast() + operators.Length()); + TObjArray *tokens = new TObjArray(valtok->GetEntriesFast() + operators.Length()); int io = 0, iv = 0; int index = 0; while (1) { TString so = operators[io]; int indexO = str1.Index(so, index); - TString val2 = ((TObjString*) valtok->At(iv))->String(); + TString val2 = ((TObjString *) valtok->At(iv))->String(); int indexV = str1.Index(val2, index); if ((indexO < indexV || indexV < 0) && indexO >= 0) { tokens->AddLast(new TObjString(so)); @@ -225,19 +225,19 @@ TObjArray* AliRsnExpression::Tokenize(TString str) const //______________________________________________________________________________ -AliRsnExpression* AliRsnExpression::Element(TObjArray &st, Int_t &i) +AliRsnExpression *AliRsnExpression::Element(TObjArray &st, Int_t &i) { // create an element - AliRsnExpression* result = 0; + AliRsnExpression *result = 0; Int_t nt = st.GetEntriesFast(); TString token = "@"; - TObjString* valt; + TObjString *valt; // next token if (i < nt - 1) { i++; - valt = (TObjString*) st.At(i); + valt = (TObjString *) st.At(i); token = valt->String(); } // token type @@ -253,7 +253,7 @@ AliRsnExpression* AliRsnExpression::Element(TObjArray &st, Int_t &i) // next token if (i < nt - 1) { i++; - valt = (TObjString*) st.At(i); + valt = (TObjString *) st.At(i); token = valt->String(); } if (token[0] != ')') { @@ -273,17 +273,17 @@ AliRsnExpression* AliRsnExpression::Element(TObjArray &st, Int_t &i) } //______________________________________________________________________________ -AliRsnExpression* AliRsnExpression::Primary(TObjArray &st, Int_t &i) +AliRsnExpression *AliRsnExpression::Primary(TObjArray &st, Int_t &i) { // create a primary Int_t nt = st.GetEntriesFast(); TString token = "@"; - TObjString* valt; + TObjString *valt; // next token if (i < nt - 1) { i++; - valt = (TObjString*) st.At(i); + valt = (TObjString *) st.At(i); token = valt->String(); } @@ -297,14 +297,14 @@ AliRsnExpression* AliRsnExpression::Primary(TObjArray &st, Int_t &i) } //______________________________________________________________________________ -AliRsnExpression* AliRsnExpression::Expression(TObjArray &st, Int_t &i) +AliRsnExpression *AliRsnExpression::Expression(TObjArray &st, Int_t &i) { // create an expression - AliRsnExpression* result = 0; + AliRsnExpression *result = 0; Bool_t done = kFALSE; TString token; - TObjString* valt; + TObjString *valt; static int stack = 0; stack++; @@ -316,7 +316,7 @@ AliRsnExpression* AliRsnExpression::Expression(TObjArray &st, Int_t &i) // next token if (i < nt - 1) i++; else break; - valt = (TObjString*) st.At(i); + valt = (TObjString *) st.At(i); token = valt->String(); switch (token[0]) { case '&' : diff --git a/PWG2/RESONANCES/AliRsnExpression.h b/PWG2/RESONANCES/AliRsnExpression.h index 27dfb1521ba..9295b9672b7 100644 --- a/PWG2/RESONANCES/AliRsnExpression.h +++ b/PWG2/RESONANCES/AliRsnExpression.h @@ -30,31 +30,31 @@ public: AliRsnExpression() : fVname(0), fArg1(0), fArg2(0), fOperator(0) {} AliRsnExpression(TString exp); virtual ~AliRsnExpression(); - AliRsnExpression(const AliRsnExpression& exp); - AliRsnExpression& operator= (const AliRsnExpression& exp); + AliRsnExpression(const AliRsnExpression &exp); + AliRsnExpression &operator= (const AliRsnExpression &exp); - virtual Bool_t Value(TObjArray & vars); + virtual Bool_t Value(TObjArray &vars); virtual TString Unparse() const; - void SetCutSet(AliRsnCutSet* const theValue) { fgCutSet = theValue; } - AliRsnCutSet* GetCutSet() const { return fgCutSet; } + void SetCutSet(AliRsnCutSet *const theValue) { fgCutSet = theValue; } + AliRsnCutSet *GetCutSet() const { return fgCutSet; } TString fVname; // Variable name static AliRsnCutSet *fgCutSet; // global cutset private: - AliRsnExpression* fArg1; // left argument - AliRsnExpression* fArg2; // right argument + AliRsnExpression *fArg1; // left argument + AliRsnExpression *fArg2; // right argument Int_t fOperator; // operator - AliRsnExpression(int op, AliRsnExpression* a); - AliRsnExpression(int op, AliRsnExpression* a, AliRsnExpression* b); + AliRsnExpression(int op, AliRsnExpression *a); + AliRsnExpression(int op, AliRsnExpression *a, AliRsnExpression *b); - TObjArray* Tokenize(TString str) const; - static AliRsnExpression* Element(TObjArray &st, Int_t &i); - static AliRsnExpression* Primary(TObjArray &st, Int_t &i); - static AliRsnExpression* Expression(TObjArray &st, Int_t &i); + TObjArray *Tokenize(TString str) const; + static AliRsnExpression *Element(TObjArray &st, Int_t &i); + static AliRsnExpression *Primary(TObjArray &st, Int_t &i); + static AliRsnExpression *Expression(TObjArray &st, Int_t &i); ClassDef(AliRsnExpression, 1); // Class to evaluate an expression }; diff --git a/PWG2/RESONANCES/AliRsnInputHandler.cxx b/PWG2/RESONANCES/AliRsnInputHandler.cxx index 73855a7a087..bc92dee2dc1 100644 --- a/PWG2/RESONANCES/AliRsnInputHandler.cxx +++ b/PWG2/RESONANCES/AliRsnInputHandler.cxx @@ -48,13 +48,13 @@ AliRsnInputHandler::AliRsnInputHandler(const AliRsnInputHandler ©) : } //_____________________________________________________________________________ -AliRsnInputHandler& AliRsnInputHandler::operator=(const AliRsnInputHandler ©) +AliRsnInputHandler &AliRsnInputHandler::operator=(const AliRsnInputHandler ©) { // // Default constructor. // - if (this == ©) - return *this; + if (this == ©) + return *this; fRsnEventCuts = copy.fRsnEventCuts; return *this; } @@ -125,7 +125,7 @@ Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry) if (fParentHandler) { TString tmp = ""; AliInputEventHandler *ih = 0; - AliMultiInputEventHandler *multiIH = dynamic_cast(fParentHandler); + AliMultiInputEventHandler *multiIH = dynamic_cast(fParentHandler); if (multiIH) { ih = multiIH->GetFirstInputEventHandler(); if (ih) { @@ -137,7 +137,7 @@ Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry) if (mcH) fRsnEvent->SetRefMC(mcH->MCEvent()); } else if (fRsnEvent->GetRefAOD()) { AliAODEvent *aod = fRsnEvent->GetRefAOD(); - TClonesArray *listAOD = (TClonesArray*)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); + TClonesArray *listAOD = (TClonesArray *)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); if (listAOD) fRsnEvent->SetRefMC(fRsnEvent->GetRefAOD()); } if (fParentHandler->ParentHandler()) tmp = "MIX"; @@ -146,7 +146,7 @@ Bool_t AliRsnInputHandler::BeginEvent(Long64_t entry) //fRsnPIDManager.ApplyCuts(fRsnEvent); fRsnSelector.Reset(); - + // reject event if needed if (fRsnEventCuts) if (!fRsnEventCuts->IsSelected(fRsnEvent)) return kTRUE; fRsnSelector.ScanEvent(fRsnEvent); diff --git a/PWG2/RESONANCES/AliRsnInputHandler.h b/PWG2/RESONANCES/AliRsnInputHandler.h index 6a848d691cf..bae23f74dc2 100644 --- a/PWG2/RESONANCES/AliRsnInputHandler.h +++ b/PWG2/RESONANCES/AliRsnInputHandler.h @@ -20,7 +20,7 @@ class AliRsnInputHandler : public AliInputEventHandler { public: AliRsnInputHandler(const char *name = "rsnInputHandler"); - AliRsnInputHandler(const AliRsnInputHandler& handler); + AliRsnInputHandler(const AliRsnInputHandler &handler); AliRsnInputHandler &operator=(const AliRsnInputHandler &handler); virtual ~AliRsnInputHandler(); diff --git a/PWG2/RESONANCES/AliRsnListOutput.cxx b/PWG2/RESONANCES/AliRsnListOutput.cxx index 5ff4b67cb1c..516914b7650 100644 --- a/PWG2/RESONANCES/AliRsnListOutput.cxx +++ b/PWG2/RESONANCES/AliRsnListOutput.cxx @@ -20,15 +20,20 @@ // #include +#include +#include #include "AliLog.h" #include "AliCFContainer.h" #include "AliRsnValue.h" +#include "AliRsnValueDaughter.h" +#include "AliRsnValueEvent.h" #include "AliRsnLoop.h" #include "AliRsnListOutput.h" + ClassImp(AliRsnListOutput) //________________________________________________________________________________________ @@ -70,7 +75,7 @@ AliRsnListOutput::AliRsnListOutput(const AliRsnListOutput ©) : } //________________________________________________________________________________________ -AliRsnListOutput& AliRsnListOutput::operator=(const AliRsnListOutput& copy) +AliRsnListOutput &AliRsnListOutput::operator=(const AliRsnListOutput ©) { // // Assignment operator. @@ -79,18 +84,18 @@ AliRsnListOutput& AliRsnListOutput::operator=(const AliRsnListOutput& copy) // they are anyway reset. // - TNamed::operator=(copy); - if (this == ©) - return *this; - fSkipFailed = copy.fSkipFailed; - fType = copy.fType; - fSteps = copy.fSteps; - fValues = copy.fValues; - fNValues = copy.fNValues; - fList = copy.fList; - fIndex = copy.fIndex; - fArray = copy.fArray; - + TNamed::operator=(copy); + if (this == ©) + return *this; + fSkipFailed = copy.fSkipFailed; + fType = copy.fType; + fSteps = copy.fSteps; + fValues = copy.fValues; + fNValues = copy.fNValues; + fList = copy.fList; + fIndex = copy.fIndex; + fArray = copy.fArray; + Reset(); return (*this); @@ -155,7 +160,7 @@ Bool_t AliRsnListOutput::Init(const char *prefix, TList *list) AliInfo(Form("NValues = %d > 3 --> cannot use a normal histogram, need to use a sparse", fNValues)); fType = kHistoSparse; } - + // resize the output array fArray.Set(fNValues); @@ -171,7 +176,7 @@ Bool_t AliRsnListOutput::Init(const char *prefix, TList *list) name += '_'; name += val->GetName(); } - + // allowed objects TObject *object = 0x0; @@ -193,7 +198,7 @@ Bool_t AliRsnListOutput::Init(const char *prefix, TList *list) default: AliWarning("Wrong type output or initialization failure"); } - + if (object) { //AliInfo(Form("[%s]: initializing output '%s' (obj name = '%s') with %d values and format %d [%s]", GetName(), name.Data(), object->GetName(), fNValues, fType, object->ClassName())); fList = list; @@ -206,7 +211,7 @@ Bool_t AliRsnListOutput::Init(const char *prefix, TList *list) } //________________________________________________________________________________________ -TH1* AliRsnListOutput::CreateHistogram(const char *name) +TH1 *AliRsnListOutput::CreateHistogram(const char *name) { // // Initialize the 'default' TH1 output object. @@ -225,7 +230,7 @@ TH1* AliRsnListOutput::CreateHistogram(const char *name) nbins[i] = GetValue(i)->GetArray().GetSize() - 1; array[i] = GetValue(i)->GetArray(); } - + TH1 *hist = 0x0; // create histogram depending on the number of axes @@ -249,7 +254,7 @@ TH1* AliRsnListOutput::CreateHistogram(const char *name) } //________________________________________________________________________________________ -THnSparseF* AliRsnListOutput::CreateHistogramSparse(const char *name) +THnSparseF *AliRsnListOutput::CreateHistogramSparse(const char *name) { // // Initialize the THnSparse output object. @@ -283,7 +288,7 @@ THnSparseF* AliRsnListOutput::CreateHistogramSparse(const char *name) } //________________________________________________________________________________________ -AliCFContainer* AliRsnListOutput::CreateCFContainer(const char *name) +AliCFContainer *AliRsnListOutput::CreateCFContainer(const char *name) { // // Initialize the AliCFContainer output object. @@ -340,7 +345,7 @@ Bool_t AliRsnListOutput::Fill(TObject *target, Int_t step) fArray[i] = (Double_t)val->GetComputedValue(); } if (!globalOK && fSkipFailed) return kFALSE; - + // retrieve object if (!fList || fIndex < 0) { AliError("List not initialized"); @@ -351,29 +356,29 @@ Bool_t AliRsnListOutput::Fill(TObject *target, Int_t step) AliError("Null pointer"); return kFALSE; } - + // check //AliInfo(Form("[%s] Object index, name, type = %d, %s (%s)", GetName(), fIndex, obj->GetName(), obj->ClassName())); // fill output if (obj->IsA() == TH1F::Class()) { - TH1F *h = (TH1F*)obj; + TH1F *h = (TH1F *)obj; h->Fill(fArray[0]); return kTRUE; } else if (obj->IsA() == TH2F::Class()) { - TH2F *h = (TH2F*)obj; + TH2F *h = (TH2F *)obj; h->Fill(fArray[0], fArray[1]); return kTRUE; } else if (obj->IsA() == TH3F::Class()) { - TH3F *h = (TH3F*)obj; + TH3F *h = (TH3F *)obj; h->Fill(fArray[0], fArray[1], fArray[2]); return kTRUE; } else if (obj->InheritsFrom(THnSparse::Class())) { - THnSparseF *h = (THnSparseF*)obj; + THnSparseF *h = (THnSparseF *)obj; h->Fill(fArray.GetArray()); return kTRUE; } else if (obj->InheritsFrom(AliCFContainer::Class())) { - AliCFContainer *c = (AliCFContainer*)obj; + AliCFContainer *c = (AliCFContainer *)obj; c->Fill(fArray.GetArray(), step); return kTRUE; } else { @@ -381,3 +386,65 @@ Bool_t AliRsnListOutput::Fill(TObject *target, Int_t step) return kFALSE; } } + +//________________________________________________________________________________________ +Bool_t AliRsnListOutput::Fill(AliRsnEvent *ev, AliRsnDaughter *d) +{ +// +// Uses the passed argument to compute all values. +// If all computations were successful, fill the output +// Return value is the AND of all computation successes. +// + + // retrieve object + if (!fList || fIndex < 0) { + AliError("List not initialized"); + return kFALSE; + } + TObject *obj = fList->At(fIndex); + if (!obj) { + AliError("Null pointer"); + return kFALSE; + } + + + TIter next(&fValues); + AliRsnValue *val; + Int_t i=0; + Bool_t globalOK = kTRUE; + Double_t values[fValues.GetEntries()]; + while ((val = (AliRsnValue *)next())) { + if (val->InheritsFrom(AliRsnValueDaughter::Class())) { + if (!d && fSkipFailed) return kFALSE; + globalOK = globalOK && val->Eval(d); + } else if (val->InheritsFrom(AliRsnValueEvent::Class())) { + if (!ev && fSkipFailed) return kFALSE; + globalOK = globalOK && val->Eval(ev); + } + values[i] = (Double_t)val->GetComputedValue(); + if (!globalOK && fSkipFailed) return kFALSE; + i++; + } + + // fill output + if (obj->IsA() == TH1F::Class()) { + TH1F *h = (TH1F *)obj; + h->Fill(values[0]); + return kTRUE; + } else if (obj->IsA() == TH2F::Class()) { + TH2F *h = (TH2F *)obj; + h->Fill(values[0], values[1]); + return kTRUE; + } else if (obj->IsA() == TH3F::Class()) { + TH3F *h = (TH3F *)obj; + h->Fill(values[0], values[1], values[2]); + return kTRUE; + } else if (obj->InheritsFrom(THnSparse::Class())) { + THnSparseF *h = (THnSparseF *)obj; + h->Fill(values); + return kTRUE; + } else { + AliError(Form("Not handled class '%s'", obj->ClassName())); + return kFALSE; + } +} diff --git a/PWG2/RESONANCES/AliRsnListOutput.h b/PWG2/RESONANCES/AliRsnListOutput.h index 5e7a36a3712..34ec928f574 100644 --- a/PWG2/RESONANCES/AliRsnListOutput.h +++ b/PWG2/RESONANCES/AliRsnListOutput.h @@ -35,7 +35,8 @@ class AliCFContainer; class AliRsnValue; - +class AliRsnDaughter; +class AliRsnEvent; class AliRsnListOutput : public TNamed { public: @@ -48,14 +49,14 @@ public: AliRsnListOutput(const char *name = "", EOut type = kHistoDefault); AliRsnListOutput(const AliRsnListOutput ©); - AliRsnListOutput& operator=(const AliRsnListOutput ©); + AliRsnListOutput &operator=(const AliRsnListOutput ©); virtual ~AliRsnListOutput(); EOut GetType() const {return fType;} Int_t GetSteps() const {return fSteps;} - TObjArray* GetValues() {return &fValues;} + TObjArray *GetValues() {return &fValues;} Int_t GetNValues() {return (fNValues = fValues.GetEntries());} - AliRsnValue* GetValue(Int_t i) const {return (AliRsnValue*)fValues[i];} + AliRsnValue *GetValue(Int_t i) const {return (AliRsnValue *)fValues[i];} Int_t GetIndex() const {return fIndex;} void SetType(EOut type) {fType = type;} void SetSteps(Int_t n) {fSteps = n;} @@ -66,12 +67,13 @@ public: virtual void Reset(); virtual Bool_t Init(const char *prefix, TList *list); virtual Bool_t Fill(TObject *target, Int_t step = 0); + virtual Bool_t Fill(AliRsnEvent *ev,AliRsnDaughter *d); private: - TH1* CreateHistogram(const char *name); - THnSparseF* CreateHistogramSparse(const char *name); - AliCFContainer* CreateCFContainer(const char *name); + TH1 *CreateHistogram(const char *name); + THnSparseF *CreateHistogramSparse(const char *name); + AliCFContainer *CreateCFContainer(const char *name); Bool_t fSkipFailed; // tell to skip fills when one computation fails EOut fType; // output format among allowed ones @@ -80,7 +82,7 @@ private: Int_t fNValues; //! number of values (internal use) TList *fList; //! list containing the output Int_t fIndex; // index of object in the list - + TArrayD fArray; //! temp array of computed values ClassDef(AliRsnListOutput, 1) // AliRsnListOutput class diff --git a/PWG2/RESONANCES/AliRsnLoop.cxx b/PWG2/RESONANCES/AliRsnLoop.cxx index b59d57a8793..1ca8eebaab4 100644 --- a/PWG2/RESONANCES/AliRsnLoop.cxx +++ b/PWG2/RESONANCES/AliRsnLoop.cxx @@ -1,8 +1,8 @@ // // Base class to implement any computation within the RSN package. -// It contains only an array of output objects which must derive +// It contains only an array of output objects which must derive // from AliRsnOutput. -// Its core functions ar Init() and DoLoop() which must be +// Its core functions ar Init() and DoLoop() which must be // overloaded by any class which inherits from this. // @@ -30,7 +30,7 @@ AliRsnLoop::AliRsnLoop(const char *name, Bool_t isMixed) : } //_____________________________________________________________________________ -AliRsnLoop::AliRsnLoop(const AliRsnLoop& copy) : +AliRsnLoop::AliRsnLoop(const AliRsnLoop ©) : TNamed(copy), fIsMixed(copy.fIsMixed), fEventCuts(copy.fEventCuts), @@ -42,17 +42,17 @@ AliRsnLoop::AliRsnLoop(const AliRsnLoop& copy) : } //_____________________________________________________________________________ -AliRsnLoop& AliRsnLoop::operator=(const AliRsnLoop& copy) +AliRsnLoop &AliRsnLoop::operator=(const AliRsnLoop ©) { // // Assignment operator // - if (this == ©) - return *this; - fIsMixed = copy.fIsMixed; - fEventCuts = copy.fEventCuts; - fOutputs = copy.fOutputs; - return (*this); + if (this == ©) + return *this; + fIsMixed = copy.fIsMixed; + fEventCuts = copy.fEventCuts; + fOutputs = copy.fOutputs; + return (*this); } //_____________________________________________________________________________ @@ -73,22 +73,22 @@ void AliRsnLoop::AddOutput(TObject *object) // //fOutputs.AddLast(out); - AliRsnListOutput *out = (AliRsnListOutput*)object; + AliRsnListOutput *out = (AliRsnListOutput *)object; Int_t n = fOutputs.GetEntries(); new (fOutputs[n]) AliRsnListOutput(*out); } //_____________________________________________________________________________ -void AliRsnLoop::Print(Option_t*) const +void AliRsnLoop::Print(Option_t *) const { // // Prints info about pair // - + TObjArrayIter next(&fOutputs); AliRsnListOutput *out = 0x0; - - while ( (out = (AliRsnListOutput*)next()) ) { + + while ( (out = (AliRsnListOutput *)next()) ) { out->Print(); } } @@ -100,7 +100,7 @@ Bool_t AliRsnLoop::OkEvent(AliRsnEvent *rsn) // If event cuts are defined, check event against them // - if (fEventCuts) + if (fEventCuts) return fEventCuts->IsSelected(rsn); else return kTRUE; @@ -118,11 +118,11 @@ Bool_t AliRsnLoop::Init(const char *prefix, TList *list) TObjArrayIter next(&fOutputs); AliRsnListOutput *out; Bool_t globalOK = kTRUE; - - while ( (out = (AliRsnListOutput*)next()) ) { + + while ( (out = (AliRsnListOutput *)next()) ) { globalOK = globalOK && out->Init(prefix, list); } - + AliInfo(Form("[%s] Object initialization: %s", GetName(), (globalOK ? "successful" : "failed"))); return globalOK; } diff --git a/PWG2/RESONANCES/AliRsnLoop.h b/PWG2/RESONANCES/AliRsnLoop.h index 704d4888fda..1ca2563d98e 100644 --- a/PWG2/RESONANCES/AliRsnLoop.h +++ b/PWG2/RESONANCES/AliRsnLoop.h @@ -3,9 +3,9 @@ // // Base class to implement any computation within the RSN package. -// It contains only an array of output objects which must derive +// It contains only an array of output objects which must derive // from AliRsnOutput. -// Its core functions ar Init() and DoLoop() which must be +// Its core functions ar Init() and DoLoop() which must be // overloaded by any class which inherits from this. // @@ -32,15 +32,15 @@ public: AliRsnLoop(const char *name = "default", Bool_t isMixed = kFALSE); AliRsnLoop(const AliRsnLoop ©); - AliRsnLoop& operator=(const AliRsnLoop ©); + AliRsnLoop &operator=(const AliRsnLoop ©); ~AliRsnLoop(); - + void SetMixed(Bool_t yn = kTRUE) {fIsMixed = yn;} void SetEventCuts(AliRsnCutSet *set) {fEventCuts = set;} Bool_t IsMixed() const {return fIsMixed;} - AliRsnCutSet* GetEventCuts() {return fEventCuts;} + AliRsnCutSet *GetEventCuts() {return fEventCuts;} Bool_t OkEvent(AliRsnEvent *rsn); - + virtual void AddOutput(TObject *output); virtual void Print(Option_t *option = "") const; virtual Bool_t Init(const char *prefix, TList *list); diff --git a/PWG2/RESONANCES/AliRsnLoopDaughter.cxx b/PWG2/RESONANCES/AliRsnLoopDaughter.cxx index 07b39eb8dd9..3bec78c5cd3 100644 --- a/PWG2/RESONANCES/AliRsnLoopDaughter.cxx +++ b/PWG2/RESONANCES/AliRsnLoopDaughter.cxx @@ -35,7 +35,7 @@ AliRsnLoopDaughter::AliRsnLoopDaughter(const char *name, Int_t listID, AliRsnDau } //_____________________________________________________________________________ -AliRsnLoopDaughter::AliRsnLoopDaughter(const AliRsnLoopDaughter& copy) : +AliRsnLoopDaughter::AliRsnLoopDaughter(const AliRsnLoopDaughter ©) : AliRsnLoop(copy), fTrueMC(copy.fTrueMC), fOnlyTrue(copy.fOnlyTrue), @@ -50,7 +50,7 @@ AliRsnLoopDaughter::AliRsnLoopDaughter(const AliRsnLoopDaughter& copy) : } //_____________________________________________________________________________ -AliRsnLoopDaughter& AliRsnLoopDaughter::operator=(const AliRsnLoopDaughter& copy) +AliRsnLoopDaughter &AliRsnLoopDaughter::operator=(const AliRsnLoopDaughter ©) { // // Assignment operator @@ -58,7 +58,7 @@ AliRsnLoopDaughter& AliRsnLoopDaughter::operator=(const AliRsnLoopDaughter& copy AliRsnLoop::operator=(copy); if (this == ©) - return *this; + return *this; fTrueMC = copy.fTrueMC; fOnlyTrue = copy.fOnlyTrue; fUseMCRef = copy.fUseMCRef; @@ -110,7 +110,7 @@ Int_t AliRsnLoopDaughter::DoLoop Int_t i, il, nadd = 0, nlist = 0; TEntryList *list[2] = {0, 0}; - + if (fDef->IsChargeDefined()) { list[0] = selMain->GetSelected(fListID, fDef->GetChargeC()); list[1] = 0x0; @@ -126,13 +126,13 @@ Int_t AliRsnLoopDaughter::DoLoop nlist = 1; } } - + // if it is required to loop over True MC, do this here and skip the rest of the method if (fTrueMC) return LoopTrueMC(evMain); - + TObjArrayIter next(&fOutputs); AliRsnListOutput *out = 0x0; - + for (il = 0; il < nlist; il++) { if (!list[il]) { AliError(Form("List #%d is null", il)); @@ -148,12 +148,12 @@ Int_t AliRsnLoopDaughter::DoLoop // fill outputs nadd++; next.Reset(); - while ( (out = (AliRsnListOutput*)next()) ) { + while ( (out = (AliRsnListOutput *)next()) ) { out->Fill(&fDaughter); } } } - + return nadd; } @@ -169,14 +169,14 @@ Int_t AliRsnLoopDaughter::LoopTrueMC(AliRsnEvent *rsn) AliError("Need a MC to compute efficiency"); return 0; } - + // check event type: // must be ESD or AOD, and then use a bool to know in the rest if (!rsn->IsESD() && !rsn->IsAOD()) { AliError("Need to process ESD or AOD input"); return 0; } - + // retrieve the MC primary vertex position // and do some additional coherence checks Int_t npart = 0; @@ -185,48 +185,48 @@ Int_t AliRsnLoopDaughter::LoopTrueMC(AliRsnEvent *rsn) npart = rsn->GetRefMCESD()->GetNumberOfTracks(); } else { AliAODEvent *aod = rsn->GetRefMCAOD(); - listAOD = (TClonesArray*)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); + listAOD = (TClonesArray *)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); if (listAOD) npart = listAOD->GetEntries(); } - + // check number of particles if (!npart) { AliInfo("Empty event"); return 0; } - + // utility variables Int_t ipart, count = 0; TObjArrayIter next(&fOutputs); AliRsnListOutput *out = 0x0; Int_t pdg = AliRsnDaughter::SpeciesPDG(fDef->GetPID()); - - + + // loop over particles for (ipart = 0; ipart < npart; ipart++) { // check i-th particle if (rsn->IsESD()) { if (!rsn->GetRefMCESD()->Stack()->IsPhysicalPrimary(ipart)) continue; - AliMCParticle *part = (AliMCParticle*)rsn->GetRefMCESD()->GetTrack(ipart); + AliMCParticle *part = (AliMCParticle *)rsn->GetRefMCESD()->GetTrack(ipart); if (TMath::Abs(part->Particle()->GetPdgCode()) != pdg) continue; fDaughter.SetRef (rsn->GetRefMCESD()->GetTrack(ipart)); fDaughter.SetRefMC(rsn->GetRefMCESD()->GetTrack(ipart)); } else { - AliAODMCParticle *part = (AliAODMCParticle*)listAOD->At(ipart); + AliAODMCParticle *part = (AliAODMCParticle *)listAOD->At(ipart); if (!part->IsPhysicalPrimary()) continue; if (TMath::Abs(part->GetPdgCode()) != pdg) continue; - fDaughter.SetRef ((AliAODMCParticle*)listAOD->At(ipart)); - fDaughter.SetRefMC((AliAODMCParticle*)listAOD->At(ipart)); + fDaughter.SetRef ((AliAODMCParticle *)listAOD->At(ipart)); + fDaughter.SetRefMC((AliAODMCParticle *)listAOD->At(ipart)); } //if (fDaughter.GetPDG() != AliRsnDaughter::SpeciesPDG(fDef->GetPID())) continue; fDaughter.FillP(fDef->GetMass()); // fill outputs count++; next.Reset(); - while ( (out = (AliRsnListOutput*)next()) ) { + while ( (out = (AliRsnListOutput *)next()) ) { out->Fill(&fDaughter); } } - + return count; } diff --git a/PWG2/RESONANCES/AliRsnLoopDaughter.h b/PWG2/RESONANCES/AliRsnLoopDaughter.h index af64a2e9ea9..2a71362aa59 100644 --- a/PWG2/RESONANCES/AliRsnLoopDaughter.h +++ b/PWG2/RESONANCES/AliRsnLoopDaughter.h @@ -18,19 +18,19 @@ public: AliRsnLoopDaughter(const char *name = "default", Int_t listID = 0, AliRsnDaughterDef *def = 0); AliRsnLoopDaughter(const AliRsnLoopDaughter ©); - AliRsnLoopDaughter& operator=(const AliRsnLoopDaughter ©); + AliRsnLoopDaughter &operator=(const AliRsnLoopDaughter ©); ~AliRsnLoopDaughter(); - + Int_t GetListID() const {return fListID;} - AliRsnDaughterDef* GetDef() {return fDef;} - AliRsnDaughter* GetDaughter() {return &fDaughter;} + AliRsnDaughterDef *GetDef() {return fDef;} + AliRsnDaughter *GetDaughter() {return &fDaughter;} void SetTrueMC(Bool_t yn = kTRUE) {fTrueMC = yn;} void SetOnlyTrue(Bool_t yn = kTRUE) {fOnlyTrue = yn;} - void SetMCRefInfo(Bool_t b = kTRUE) {fUseMCRef = b;} + void SetMCRefInfo(Bool_t b = kTRUE) {fUseMCRef = b;} void SetListID(Int_t i) {fListID = i;} void SetDef(AliRsnDaughterDef *def) {fDef = def;} - + virtual void Print(Option_t *opt = "") const; virtual Bool_t Init(const char *prefix, TList *list); virtual Int_t DoLoop(AliRsnEvent *main, AliRsnDaughterSelector *smain, AliRsnEvent *mix = 0, AliRsnDaughterSelector *smix = 0); diff --git a/PWG2/RESONANCES/AliRsnLoopEff.cxx b/PWG2/RESONANCES/AliRsnLoopEff.cxx index 7735557361f..2d9f862baaf 100644 --- a/PWG2/RESONANCES/AliRsnLoopEff.cxx +++ b/PWG2/RESONANCES/AliRsnLoopEff.cxx @@ -34,7 +34,7 @@ AliRsnLoopEff::AliRsnLoopEff(const char *name, Int_t nSteps, Double_t maxDist) : } //_____________________________________________________________________________ -AliRsnLoopEff::AliRsnLoopEff(const AliRsnLoopEff& copy) : +AliRsnLoopEff::AliRsnLoopEff(const AliRsnLoopEff ©) : AliRsnLoop(copy), fAddSteps(copy.fAddSteps), fSteps(copy.fSteps), @@ -49,7 +49,7 @@ AliRsnLoopEff::AliRsnLoopEff(const AliRsnLoopEff& copy) : } //_____________________________________________________________________________ -AliRsnLoopEff& AliRsnLoopEff::operator=(const AliRsnLoopEff& copy) +AliRsnLoopEff &AliRsnLoopEff::operator=(const AliRsnLoopEff ©) { // // Assignment operator @@ -57,7 +57,7 @@ AliRsnLoopEff& AliRsnLoopEff::operator=(const AliRsnLoopEff& copy) AliRsnLoop::operator=(copy); if (this == ©) - return *this; + return *this; fAddSteps = copy.fAddSteps; fSteps = copy.fSteps; fOutput = copy.fOutput; @@ -108,16 +108,16 @@ Bool_t AliRsnLoopEff::Init(const char *prefix, TList *list) AliInfo("Clearing container of this efficiency loop."); fOutputs.Delete(); } - + Int_t nSteps = (Int_t)fSteps.GetEntries(); nSteps += fAddSteps; fOutput->SetSteps(nSteps); fOutput->SetSkipFailed(kFALSE); AliRsnLoop::AddOutput(fOutput); - + if (AliRsnLoop::Init(Form("%s_%s", prefix, GetName()), list)) { - fOutput = (AliRsnListOutput*)fOutputs[0]; + fOutput = (AliRsnListOutput *)fOutputs[0]; return kTRUE; } else { fOutput = 0x0; @@ -142,7 +142,7 @@ Int_t AliRsnLoopEff::FindTrack(Int_t label, const AliVEvent *event) if (TMath::Abs(track->GetLabel()) != label) continue; return i; } - + return -1; } @@ -155,15 +155,15 @@ Int_t AliRsnLoopEff::GetMatchedDaughter(Int_t label, AliRsnEvent *event) // if (!event) return -1; - + AliRsnDaughter out; - + Int_t i, imax = event->GetAbsoluteSum(); for (i = 0; i < imax; i++) { event->SetDaughter(out, i); if (out.IsOK() && out.GetLabel() == label) return i; } - + return -1; } @@ -179,8 +179,8 @@ Double_t AliRsnLoopEff::DistanceFromPV(Double_t x, Double_t y, Double_t z) x -= fVertex[0]; y -= fVertex[1]; z -= fVertex[2]; - + return TMath::Sqrt(x*x + y*y + z*z); } - + diff --git a/PWG2/RESONANCES/AliRsnLoopEff.h b/PWG2/RESONANCES/AliRsnLoopEff.h index 61dcefe41f4..415e85ddc61 100644 --- a/PWG2/RESONANCES/AliRsnLoopEff.h +++ b/PWG2/RESONANCES/AliRsnLoopEff.h @@ -17,12 +17,12 @@ public: AliRsnLoopEff(const char *name = "default", Int_t nSteps = 0, Double_t maxDistPV = 1E-2); AliRsnLoopEff(const AliRsnLoopEff ©); - AliRsnLoopEff& operator=(const AliRsnLoopEff ©); + AliRsnLoopEff &operator=(const AliRsnLoopEff ©); ~AliRsnLoopEff(); - AliRsnListOutput* GetOutput() {return fOutput;} + AliRsnListOutput *GetOutput() {return fOutput;} void CreateOutput(); - void AddStep(TObject *set); + void AddStep(TObject *set); void SetMaxDistanceFromPV(Double_t value) {fMaxDistPV = value;} virtual void AddOutput(TObject *) {AliWarning("In loops for efficiency it is not allowed to add outputs externally");} virtual Bool_t Init(const char *prefix, TList *list); diff --git a/PWG2/RESONANCES/AliRsnLoopEffPair.cxx b/PWG2/RESONANCES/AliRsnLoopEffPair.cxx index fb233fdf91c..db06eb7c347 100644 --- a/PWG2/RESONANCES/AliRsnLoopEffPair.cxx +++ b/PWG2/RESONANCES/AliRsnLoopEffPair.cxx @@ -34,7 +34,7 @@ AliRsnLoopEffPair::AliRsnLoopEffPair(const char *name, AliRsnPairDef *def) : } //_____________________________________________________________________________ -AliRsnLoopEffPair::AliRsnLoopEffPair(const AliRsnLoopEffPair& copy) : +AliRsnLoopEffPair::AliRsnLoopEffPair(const AliRsnLoopEffPair ©) : AliRsnLoopEff(copy), fDef(copy.fDef), fMother(copy.fMother) @@ -45,7 +45,7 @@ AliRsnLoopEffPair::AliRsnLoopEffPair(const AliRsnLoopEffPair& copy) : } //_____________________________________________________________________________ -AliRsnLoopEffPair& AliRsnLoopEffPair::operator=(const AliRsnLoopEffPair& copy) +AliRsnLoopEffPair &AliRsnLoopEffPair::operator=(const AliRsnLoopEffPair ©) { // // Assignment operator. @@ -54,7 +54,7 @@ AliRsnLoopEffPair& AliRsnLoopEffPair::operator=(const AliRsnLoopEffPair& copy) AliRsnLoopEff::operator=(copy); if (this == ©) - return *this; + return *this; fDef = copy.fDef; return (*this); @@ -98,16 +98,16 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersESD(AliRsnEvent *rsnEvent, Int AliMCEvent *mc = rsnEvent->GetRefMCESD(); AliStack *stack = mc->Stack(); - AliMCParticle *mother = (AliMCParticle*)mc->GetTrack(ipart); + AliMCParticle *mother = (AliMCParticle *)mc->GetTrack(ipart); TParticle *motherP = mother->Particle(); Int_t ntracks = stack->GetNtrack(); - + // check PDG code and exit if it is wrong if (TMath::Abs(motherP->GetPdgCode()) != fDef->GetMotherPDG()) return kFALSE; - + // check number of daughters and exit if it is not 2 if (motherP->GetNDaughters() < 2) return kFALSE; - + // check distance from primary vertex TLorentzVector vprod; motherP->ProductionVertex(vprod); @@ -115,9 +115,9 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersESD(AliRsnEvent *rsnEvent, Int AliDebugClass(1, "Distant production vertex"); return kFALSE; } - + // get the daughters and check their PDG code and charge: - // if they match one of the pair daughter definitions, + // if they match one of the pair daughter definitions, // assign them as MC reference of the 'fDaughter' objects fDaughter[0].Reset(); fDaughter[1].Reset(); @@ -132,7 +132,7 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersESD(AliRsnEvent *rsnEvent, Int return kFALSE; } // get daughter and its PDG and charge - daughter = (AliMCParticle*)mc->GetTrack(index[i]); + daughter = (AliMCParticle *)mc->GetTrack(index[i]); pdg = TMath::Abs(daughter->Particle()->GetPdgCode()); charge = (Short_t)(daughter->Particle()->GetPDG()->Charge() / 3); // check if it matches one definition @@ -146,7 +146,7 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersESD(AliRsnEvent *rsnEvent, Int fDaughter[1].SetLabel(index[i]); } } - + // return success if both daughters were assigned if (fDaughter[0].IsOK() && fDaughter[1].IsOK()) { return kTRUE; @@ -170,16 +170,16 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersAOD(AliRsnEvent *rsnEvent, Int // AliAODEvent *aod = rsnEvent->GetRefAOD(); - TClonesArray *listAOD = (TClonesArray*)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); - AliAODMCParticle *mother = (AliAODMCParticle*)listAOD->At(ipart); + TClonesArray *listAOD = (TClonesArray *)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); + AliAODMCParticle *mother = (AliAODMCParticle *)listAOD->At(ipart); Int_t ntracks = listAOD->GetEntries(); - + // check PDG code and exit if it is wrong if (TMath::Abs(mother->GetPdgCode()) != fDef->GetMotherPDG()) return kFALSE; - + // check number of daughters and exit if it is not 2 if (mother->GetNDaughters() < 2) return kFALSE; - + // check distance from primary vertex Double_t vprod[3] = {(Double_t)mother->Xv(), (Double_t)mother->Yv(), (Double_t)mother->Zv()}; Double_t dv = DistanceFromPV(vprod[0], vprod[1], vprod[2]); @@ -187,9 +187,9 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersAOD(AliRsnEvent *rsnEvent, Int AliDebugClass(1, "Distant production vertex"); return kFALSE; } - + // get the daughters and check their PDG code and charge: - // if they match one of the pair daughter definitions, + // if they match one of the pair daughter definitions, // assign them as MC reference of the 'fDaughter' objects fDaughter[0].Reset(); fDaughter[1].Reset(); @@ -204,7 +204,7 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersAOD(AliRsnEvent *rsnEvent, Int return kFALSE; } // get daughter and its PDG and charge - daughter = (AliAODMCParticle*)listAOD->At(index[i]); + daughter = (AliAODMCParticle *)listAOD->At(index[i]); pdg = TMath::Abs(daughter->GetPdgCode()); charge = (Short_t)(daughter->Charge() / 3); // check if it matches one definition @@ -218,7 +218,7 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersAOD(AliRsnEvent *rsnEvent, Int fDaughter[1].SetLabel(index[i]); } } - + // return success if both daughters were assigned if (fDaughter[0].IsOK() && fDaughter[1].IsOK()) { return kTRUE; @@ -230,7 +230,7 @@ Bool_t AliRsnLoopEffPair::AssignMotherAndDaughtersAOD(AliRsnEvent *rsnEvent, Int } //_____________________________________________________________________________ -Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector*, AliRsnEvent*, AliRsnDaughterSelector*) +Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector *, AliRsnEvent *, AliRsnDaughterSelector *) { // // Loop on event and fill containers @@ -238,29 +238,29 @@ Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector*, AliRs // check event cuts if (!OkEvent(rsn)) return 0; - + // retrieve output - fOutput = (AliRsnListOutput*)fOutputs[0]; - + fOutput = (AliRsnListOutput *)fOutputs[0]; + // check presence of MC reference if (!rsn->GetRefMC()) { AliError("Need a MC to compute efficiency"); return 0; } - + // check presence of event if (!rsn->GetRef()) { AliError("Need an event to compute efficiency"); return 0; } - + // check event type: // must be ESD or AOD, and then use a bool to know in the rest if (!rsn->IsESD() && !rsn->IsAOD()) { AliError("Need to process ESD or AOD input"); return 0; } - + // retrieve the MC primary vertex position // and do some additional coherence checks Int_t i, npart = 0; @@ -273,23 +273,23 @@ Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector*, AliRs } else { for (i = 0; i < 3; i++) fVertex[i] = 0.0; AliAODEvent *aod = rsn->GetRefMCAOD(); - TClonesArray *listAOD = (TClonesArray*)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); + TClonesArray *listAOD = (TClonesArray *)(aod->GetList()->FindObject(AliAODMCParticle::StdBranchName())); if (listAOD) npart = listAOD->GetEntries(); - AliAODMCHeader *mcH = static_cast(aod->FindListObject(AliAODMCHeader::StdBranchName())); + AliAODMCHeader *mcH = static_cast(aod->FindListObject(AliAODMCHeader::StdBranchName())); if (mcH) mcH->GetVertex(fVertex); } - + // check number of particles if (!npart) { AliInfo("Empty event"); return 0; } - + // utility variables Int_t ipart, istep, count = 0, nsteps = fSteps.GetEntries(); Int_t ntracks = rsn->GetAbsoluteSum(); AliRsnDaughter check; - + // loop over particles for (ipart = 0; ipart < npart; ipart++) { // check i-th particle @@ -303,7 +303,7 @@ Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector*, AliRs count++; // for each further step, try to find two tracks which pass the related cuts for (istep = 0; istep < nsteps; istep++) { - AliRsnCutManager *cuts = (AliRsnCutManager*)fSteps[istep]; + AliRsnCutManager *cuts = (AliRsnCutManager *)fSteps[istep]; fDaughter[0].SetBad(); fDaughter[1].SetBad(); for (i = 0; i < ntracks; i++) { @@ -328,6 +328,6 @@ Int_t AliRsnLoopEffPair::DoLoop(AliRsnEvent *rsn, AliRsnDaughterSelector*, AliRs } } } - + return count; } diff --git a/PWG2/RESONANCES/AliRsnLoopEffPair.h b/PWG2/RESONANCES/AliRsnLoopEffPair.h index e49bbe3dc8f..a52ab33b3a1 100644 --- a/PWG2/RESONANCES/AliRsnLoopEffPair.h +++ b/PWG2/RESONANCES/AliRsnLoopEffPair.h @@ -24,14 +24,14 @@ class AliRsnLoopEffPair : public AliRsnLoopEff { public: AliRsnLoopEffPair(const char *name = "default", AliRsnPairDef *def = 0x0); - AliRsnLoopEffPair(const AliRsnLoopEffPair& copy); - AliRsnLoopEffPair& operator=(const AliRsnLoopEffPair& copy); + AliRsnLoopEffPair(const AliRsnLoopEffPair ©); + AliRsnLoopEffPair &operator=(const AliRsnLoopEffPair ©); virtual ~AliRsnLoopEffPair() {;} - AliRsnPairDef* GetDef() {return fDef;} + AliRsnPairDef *GetDef() {return fDef;} void SetDef(AliRsnPairDef *def) {fDef = def;} virtual Int_t DoLoop(AliRsnEvent *main, AliRsnDaughterSelector *smain = 0, AliRsnEvent *mix = 0, AliRsnDaughterSelector *smix = 0); - + Bool_t AssignMotherAndDaughters (AliRsnEvent *event, Int_t ipart); Bool_t AssignMotherAndDaughtersESD(AliRsnEvent *event, Int_t ipart); Bool_t AssignMotherAndDaughtersAOD(AliRsnEvent *event, Int_t ipart); diff --git a/PWG2/RESONANCES/AliRsnLoopEvent.cxx b/PWG2/RESONANCES/AliRsnLoopEvent.cxx index 8679d7810eb..481b0cdbf4f 100644 --- a/PWG2/RESONANCES/AliRsnLoopEvent.cxx +++ b/PWG2/RESONANCES/AliRsnLoopEvent.cxx @@ -24,7 +24,7 @@ AliRsnLoopEvent::AliRsnLoopEvent(const char *name) : } //_____________________________________________________________________________ -AliRsnLoopEvent::AliRsnLoopEvent(const AliRsnLoopEvent& copy) : +AliRsnLoopEvent::AliRsnLoopEvent(const AliRsnLoopEvent ©) : AliRsnLoop(copy) { // @@ -33,14 +33,14 @@ AliRsnLoopEvent::AliRsnLoopEvent(const AliRsnLoopEvent& copy) : } //_____________________________________________________________________________ -AliRsnLoopEvent& AliRsnLoopEvent::operator=(const AliRsnLoopEvent& copy) +AliRsnLoopEvent &AliRsnLoopEvent::operator=(const AliRsnLoopEvent ©) { // // Assignment operator // - AliRsnLoop::operator=(copy); - return (*this); + AliRsnLoop::operator=(copy); + return (*this); } //_____________________________________________________________________________ @@ -84,13 +84,13 @@ Int_t AliRsnLoopEvent::DoLoop TObjArrayIter next(&fOutputs); AliRsnListOutput *out = 0x0; - + // check cuts if (!OkEvent(evMain)) return 0; - - while ( (out = (AliRsnListOutput*)next()) ) { + + while ( (out = (AliRsnListOutput *)next()) ) { out->Fill(evMain); } - + return 1; } diff --git a/PWG2/RESONANCES/AliRsnLoopEvent.h b/PWG2/RESONANCES/AliRsnLoopEvent.h index e516f4516cd..cfa094d847e 100644 --- a/PWG2/RESONANCES/AliRsnLoopEvent.h +++ b/PWG2/RESONANCES/AliRsnLoopEvent.h @@ -3,7 +3,7 @@ // // Computator for events. -// The simplest loop, +// The simplest loop, // which is filled once per event. // @@ -14,9 +14,9 @@ public: AliRsnLoopEvent(const char *name = "default"); AliRsnLoopEvent(const AliRsnLoopEvent ©); - AliRsnLoopEvent& operator=(const AliRsnLoopEvent ©); + AliRsnLoopEvent &operator=(const AliRsnLoopEvent ©); ~AliRsnLoopEvent(); - + virtual void Print(Option_t *opt = "") const; virtual Bool_t Init(const char *prefix, TList *list); virtual Int_t DoLoop(AliRsnEvent *main, AliRsnDaughterSelector *smain = 0, AliRsnEvent *mix = 0, AliRsnDaughterSelector *smix = 0); diff --git a/PWG2/RESONANCES/AliRsnLoopPair.cxx b/PWG2/RESONANCES/AliRsnLoopPair.cxx index 0666676f980..fd64c2b0050 100644 --- a/PWG2/RESONANCES/AliRsnLoopPair.cxx +++ b/PWG2/RESONANCES/AliRsnLoopPair.cxx @@ -77,7 +77,7 @@ AliRsnLoopPair &AliRsnLoopPair::operator=(const AliRsnLoopPair ©) AliRsnLoop::operator=(copy); if (this == ©) - return *this; + return *this; fTrueMC = copy.fTrueMC; fOnlyTrue = copy.fOnlyTrue; fUseMCRef = copy.fUseMCRef; @@ -193,7 +193,7 @@ Int_t AliRsnLoopPair::DoLoop if (!fIsMixed && list0 == list1) start = i0 + 1; for (i1 = start; i1 < list1->GetN(); i1++) { iEntry2 = list1->GetEntry(i1); - if (iEntry1 == iEntry2) continue; + if (iEntry1 == iEntry2) continue; AliDebugClass(4, Form("Checking entries pair: %d (%lld) with %d (%lld)", i0, iEntry1, i1, iEntry2)); evMix->SetDaughter(fDaughter[1], iEntry2,fUseMCRef); fDaughter[1].FillP(fPairDef->GetDef2().GetMass()); diff --git a/PWG2/RESONANCES/AliRsnLoopPair.h b/PWG2/RESONANCES/AliRsnLoopPair.h index 3574fef3352..b8c1843f7a4 100644 --- a/PWG2/RESONANCES/AliRsnLoopPair.h +++ b/PWG2/RESONANCES/AliRsnLoopPair.h @@ -18,22 +18,22 @@ public: AliRsnLoopPair(const char *name = "default", AliRsnPairDef *def = 0, Bool_t isMixed = kFALSE); AliRsnLoopPair(const AliRsnLoopPair ©); - AliRsnLoopPair& operator=(const AliRsnLoopPair ©); + AliRsnLoopPair &operator=(const AliRsnLoopPair ©); ~AliRsnLoopPair(); // getters Bool_t IsTrueMC() const {return fTrueMC;} Bool_t IsOnlyTrue() const {return fOnlyTrue;} Bool_t IsCheckDecay() const {return fCheckDecay;} - AliRsnPairDef* GetPairDef() {return fPairDef;} - AliRsnCutSet* GetPairCuts() {return fPairCuts;} - AliRsnMother* GetMother() {return &fMother;} + AliRsnPairDef *GetPairDef() {return fPairDef;} + AliRsnCutSet *GetPairCuts() {return fPairCuts;} + AliRsnMother *GetMother() {return &fMother;} // setters (not for all members) void SetPairCuts(AliRsnCutSet *cuts) {fPairCuts = cuts;} void SetTrueMC(Bool_t yn = kTRUE) {fTrueMC = yn;} void SetOnlyTrue(Bool_t onlyTrue = kTRUE) {fOnlyTrue = onlyTrue;} - void SetMCRefInfo(Bool_t b = kTRUE) {fUseMCRef = b;} + void SetMCRefInfo(Bool_t b = kTRUE) {fUseMCRef = b;} void SetCheckDecay(Bool_t check = kTRUE) {fCheckDecay = check;} void SetListID(Int_t i, Int_t val) {if (i==0||i==1) fListID[i] = val;} void SetRangeY(Double_t range) {fRangeY = range;} diff --git a/PWG2/RESONANCES/AliRsnMiniAnalysisTask.cxx b/PWG2/RESONANCES/AliRsnMiniAnalysisTask.cxx index 8a66aa54133..d57e40cfe9b 100644 --- a/PWG2/RESONANCES/AliRsnMiniAnalysisTask.cxx +++ b/PWG2/RESONANCES/AliRsnMiniAnalysisTask.cxx @@ -63,7 +63,8 @@ AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask() : fTriggerAna(0x0), fESDtrackCuts(0x0), fMiniEvent(0x0), - fBigOutput(kFALSE) + fBigOutput(kFALSE), + fMixPrintRefresh(-1) { // // Dummy constructor ALWAYS needed for I/O. @@ -93,7 +94,8 @@ AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask(const char *name, Bool_t useMC) : fTriggerAna(0x0), fESDtrackCuts(0x0), fMiniEvent(0x0), - fBigOutput(kFALSE) + fBigOutput(kFALSE), + fMixPrintRefresh(-1) { // // Default constructor. @@ -128,7 +130,8 @@ AliRsnMiniAnalysisTask::AliRsnMiniAnalysisTask(const AliRsnMiniAnalysisTask &cop fTriggerAna(copy.fTriggerAna), fESDtrackCuts(copy.fESDtrackCuts), fMiniEvent(0x0), - fBigOutput(copy.fBigOutput) + fBigOutput(copy.fBigOutput), + fMixPrintRefresh(copy.fMixPrintRefresh) { // // Copy constructor. @@ -148,7 +151,7 @@ AliRsnMiniAnalysisTask &AliRsnMiniAnalysisTask::operator=(const AliRsnMiniAnalys AliAnalysisTaskSE::operator=(copy); if (this == ©) - return *this; + return *this; fUseMC = copy.fUseMC; fUseCentrality = copy.fUseCentrality; fCentralityType = copy.fCentralityType; @@ -164,7 +167,7 @@ AliRsnMiniAnalysisTask &AliRsnMiniAnalysisTask::operator=(const AliRsnMiniAnalys fTriggerAna = copy.fTriggerAna; fESDtrackCuts = copy.fESDtrackCuts; fBigOutput = copy.fBigOutput; - + fMixPrintRefresh = copy.fMixPrintRefresh; return (*this); } @@ -242,6 +245,12 @@ void AliRsnMiniAnalysisTask::UserCreateOutputObjects() fHEventStat->GetXaxis()->SetBinLabel(4, "Accepted"); fOutput->Add(fHEventStat); + TIter next(&fTrackCuts); + AliRsnCutSet *cs; + while ((cs = (AliRsnCutSet *) next())) { + cs->Init(fOutput); + } + // create temporary tree for filtered events if (fMiniEvent) delete fMiniEvent; fEvBuffer = new TTree("EventBuffer", "Temporary buffer for mini events"); @@ -332,10 +341,13 @@ void AliRsnMiniAnalysisTask::FinishTaskOutput() AliRsnMiniOutput *def = 0x0; AliRsnMiniOutput::EComputation compType; - Int_t printNum = 0; - if (nEvents>1e5) printNum=nEvents/100; - if (nEvents>1e4) printNum=nEvents/10; - + Int_t printNum = fMixPrintRefresh; + if (printNum < 0) { + if (nEvents>1e5) printNum=nEvents/100; + else if (nEvents>1e4) printNum=nEvents/10; + else printNum = 0; + } + // loop on events, and for each one fill all outputs // using the appropriate procedure depending on its type // only mother-related histograms are filled in UserExec, @@ -346,7 +358,7 @@ void AliRsnMiniAnalysisTask::FinishTaskOutput() fEvBuffer->GetEntry(ievt); if (printNum&&(ievt%printNum==0)) { AliInfo(Form("[%s] Std.Event %d/%d",GetName(), ievt,nEvents)); - timer.Stop(); timer.Print();fflush(stdout); timer.Start(kFALSE); + timer.Stop(); timer.Print(); fflush(stdout); timer.Start(kFALSE); } // fill for (idef = 0; idef < nDefs; idef++) { @@ -400,10 +412,10 @@ void AliRsnMiniAnalysisTask::FinishTaskOutput() smatched[ievt] = "|"; nmatched[ievt] = 0; } - - + + AliInfo(Form("[%s] Std.Event %d/%d",GetName(), nEvents,nEvents)); - timer.Stop(); timer.Print(); timer.Start();fflush(stdout); + timer.Stop(); timer.Print(); timer.Start(); fflush(stdout); // search for good matchings for (ievt = 0; ievt < nEvents; ievt++) { @@ -434,9 +446,9 @@ void AliRsnMiniAnalysisTask::FinishTaskOutput() } AliDebugClass(1, Form("Matches for event %5d = %d [%s] (missing are declared above)", evMain.ID(), nmatched[ievt], smatched[ievt].Data())); } - + AliInfo(Form("[%s] EventMixing searching %d/%d",GetName(),nEvents,nEvents)); - timer.Stop(); timer.Print();fflush(stdout); timer.Start(); + timer.Stop(); timer.Print(); fflush(stdout); timer.Start(); // perform mixing TObjArray *list = 0x0; @@ -471,7 +483,7 @@ void AliRsnMiniAnalysisTask::FinishTaskOutput() delete [] smatched; AliInfo(Form("[%s] EventMixing %d/%d",GetName(),nEvents,nEvents)); - timer.Stop();timer.Print();fflush(stdout); + timer.Stop(); timer.Print(); fflush(stdout); /* OLD diff --git a/PWG2/RESONANCES/AliRsnMiniAnalysisTask.h b/PWG2/RESONANCES/AliRsnMiniAnalysisTask.h index 69bb436361d..489b1d5118c 100644 --- a/PWG2/RESONANCES/AliRsnMiniAnalysisTask.h +++ b/PWG2/RESONANCES/AliRsnMiniAnalysisTask.h @@ -32,10 +32,10 @@ public: AliRsnMiniAnalysisTask(); AliRsnMiniAnalysisTask(const char *name, Bool_t isMC = kFALSE); AliRsnMiniAnalysisTask(const AliRsnMiniAnalysisTask ©); - AliRsnMiniAnalysisTask& operator=(const AliRsnMiniAnalysisTask ©); + AliRsnMiniAnalysisTask &operator=(const AliRsnMiniAnalysisTask ©); virtual ~AliRsnMiniAnalysisTask(); - void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;} + void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;} void UseCentrality(const char *type) {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();} void UseMultiplicity(const char *type) {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();} void UseContinuousMix() {fContinuousMix = kTRUE;} @@ -45,20 +45,21 @@ public: void SetMaxDiffVz (Double_t val) {fMaxDiffVz = val;} void SetMaxDiffAngle(Double_t val) {fMaxDiffAngle = val;} void SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;} + void SetMixPrintRefresh(Int_t n) {fMixPrintRefresh = n;} Int_t AddTrackCuts(AliRsnCutSet *cuts); TClonesArray *Outputs() {return &fHistograms;} TClonesArray *Values() {return &fValues;} - + virtual void UserCreateOutputObjects(); - virtual void UserExec(Option_t*); - virtual void Terminate(Option_t*); + virtual void UserExec(Option_t *); + virtual void Terminate(Option_t *); virtual void FinishTaskOutput(); - + Int_t ValueID(AliRsnMiniValue::EType type, Bool_t useMC = kFALSE); - Int_t CreateValue(AliRsnMiniValue::EType type, Bool_t useMC = kFALSE); + Int_t CreateValue(AliRsnMiniValue::EType type, Bool_t useMC = kFALSE); AliRsnMiniOutput *CreateOutput(const char *name, AliRsnMiniOutput::EOutputType type, AliRsnMiniOutput::EComputation src); AliRsnMiniOutput *CreateOutput(const char *name, const char *outType, const char *compType); - + private: Char_t CheckCurrentEvent(); @@ -74,18 +75,18 @@ private: Int_t fEvNum; //! absolute event counter Bool_t fUseCentrality; // if true, use centrality for event, otherwise use multiplicity TString fCentralityType; // definition used to choose what centrality or multiplicity to use - + Bool_t fContinuousMix; // mixing --> technique chosen (continuous or binned) Int_t fNMix; // mixing --> required number of mixes Double_t fMaxDiffMult; // mixing --> max difference in multiplicity Double_t fMaxDiffVz; // mixing --> max difference in Vz of prim vert Double_t fMaxDiffAngle; // mixing --> max difference in reaction plane angle - + TList *fOutput; // output list TClonesArray fHistograms; // list of histogram definitions TClonesArray fValues; // list of values to be computed TH1F *fHEventStat; // histogram of event statistics - + AliRsnCutSet *fEventCuts; // cuts on events TObjArray fTrackCuts; // list of single track cuts AliRsnEvent fRsnEvent; //! interface object to the event @@ -94,8 +95,9 @@ private: AliESDtrackCuts *fESDtrackCuts; //! quality cut for ESD tracks AliRsnMiniEvent *fMiniEvent; //! mini-event cursor Bool_t fBigOutput; // flag if open file for output list + Int_t fMixPrintRefresh; // how often info in mixing part is printed - ClassDef(AliRsnMiniAnalysisTask, 2); // AliRsnMiniAnalysisTask + ClassDef(AliRsnMiniAnalysisTask, 3); // AliRsnMiniAnalysisTask }; inline Int_t AliRsnMiniAnalysisTask::CreateValue(AliRsnMiniValue::EType type, Bool_t useMC) @@ -114,7 +116,7 @@ inline Int_t AliRsnMiniAnalysisTask::CreateValue(AliRsnMiniValue::EType type, Bo AliInfo(Form("Creating value '%s' in slot #%d", AliRsnMiniValue::ValueName(type, useMC), valID)); new (fValues[valID]) AliRsnMiniValue(type, useMC); } - + return valID; } @@ -126,13 +128,13 @@ inline Int_t AliRsnMiniAnalysisTask::ValueID(AliRsnMiniValue::EType type, Bool_t const char *name = AliRsnMiniValue::ValueName(type, useMC); TObject *obj = fValues.FindObject(name); - if (obj) - return fValues.IndexOf(obj); + if (obj) + return fValues.IndexOf(obj); else return -1; } -inline AliRsnMiniOutput* AliRsnMiniAnalysisTask::CreateOutput +inline AliRsnMiniOutput *AliRsnMiniAnalysisTask::CreateOutput (const char *name, AliRsnMiniOutput::EOutputType type, AliRsnMiniOutput::EComputation src) { // @@ -140,13 +142,13 @@ inline AliRsnMiniOutput* AliRsnMiniAnalysisTask::CreateOutput // which is then returned to the user for its configuration // - Int_t n = fHistograms.GetEntries(); + Int_t n = fHistograms.GetEntries(); AliRsnMiniOutput *newDef = new (fHistograms[n]) AliRsnMiniOutput(name, type, src); - + return newDef; } -inline AliRsnMiniOutput* AliRsnMiniAnalysisTask::CreateOutput +inline AliRsnMiniOutput *AliRsnMiniAnalysisTask::CreateOutput (const char *name, const char *outType, const char *compType) { // @@ -154,9 +156,9 @@ inline AliRsnMiniOutput* AliRsnMiniAnalysisTask::CreateOutput // which is then returned to the user for its configuration // - Int_t n = fHistograms.GetEntries(); + Int_t n = fHistograms.GetEntries(); AliRsnMiniOutput *newDef = new (fHistograms[n]) AliRsnMiniOutput(name, outType, compType); - + return newDef; } #endif diff --git a/PWG2/RESONANCES/AliRsnMiniAxis.h b/PWG2/RESONANCES/AliRsnMiniAxis.h index 9089eb99527..bb5e182a4b0 100644 --- a/PWG2/RESONANCES/AliRsnMiniAxis.h +++ b/PWG2/RESONANCES/AliRsnMiniAxis.h @@ -21,25 +21,25 @@ public: AliRsnMiniAxis(Int_t valID, Int_t nbins, Double_t min, Double_t max) : fValueID(valID), fBins(0) {Set(nbins, min, max);} AliRsnMiniAxis(Int_t valID, Double_t min, Double_t max, Double_t step) : fValueID(valID), fBins(0) {Set(min, max, step);} AliRsnMiniAxis(Int_t valID, Int_t nbins, Double_t *bins) : fValueID(valID), fBins(0) {Set(nbins, bins);} - AliRsnMiniAxis(const AliRsnMiniAxis& copy) : TObject(copy), fValueID(copy.fValueID), fBins(copy.fBins) { } - AliRsnMiniAxis& operator=(const AliRsnMiniAxis& copy) {if (this==©) return *this; fValueID = copy.fValueID; fBins = copy.fBins; return (*this);} - + AliRsnMiniAxis(const AliRsnMiniAxis ©) : TObject(copy), fValueID(copy.fValueID), fBins(copy.fBins) { } + AliRsnMiniAxis &operator=(const AliRsnMiniAxis ©) {if (this==©) return *this; fValueID = copy.fValueID; fBins = copy.fBins; return (*this);} + void SetValueID(Int_t id) {fValueID = id;} Int_t GetValueID() const {return fValueID;} - + Int_t NBins() {return fBins.GetSize() - 1;} TArrayD *Bins() {return &fBins;} Double_t *BinArray() {return fBins.GetArray();} - + void Set(Int_t nbins, Double_t min, Double_t max); void Set(Int_t nbins, Double_t *bins); void Set(Double_t min, Double_t max, Double_t step); - + private: Int_t fValueID; // index of used value in task collection TArrayD fBins; // bins - + ClassDef(AliRsnMiniAxis,1) }; diff --git a/PWG2/RESONANCES/AliRsnMiniEvent.cxx b/PWG2/RESONANCES/AliRsnMiniEvent.cxx index c7e5106c42b..f59f58dc260 100644 --- a/PWG2/RESONANCES/AliRsnMiniEvent.cxx +++ b/PWG2/RESONANCES/AliRsnMiniEvent.cxx @@ -25,19 +25,19 @@ void AliRsnMiniEvent::AddParticle(AliRsnMiniParticle copy) } //__________________________________________________________________________________________________ -AliRsnMiniParticle* AliRsnMiniEvent::GetParticle(Int_t i) +AliRsnMiniParticle *AliRsnMiniEvent::GetParticle(Int_t i) { // // Return the leading particle // if (i < 0 || i > fParticles.GetEntriesFast()) return 0x0; - - return (AliRsnMiniParticle*)fParticles[i]; + + return (AliRsnMiniParticle *)fParticles[i]; } //__________________________________________________________________________________________________ -AliRsnMiniParticle* AliRsnMiniEvent::LeadingParticle() +AliRsnMiniParticle *AliRsnMiniEvent::LeadingParticle() { // // Return the leading particle @@ -45,8 +45,8 @@ AliRsnMiniParticle* AliRsnMiniEvent::LeadingParticle() if (fLeading < 0) return 0x0; if (fLeading >= fParticles.GetEntriesFast()) return 0x0; - - return (AliRsnMiniParticle*)fParticles[fLeading]; + + return (AliRsnMiniParticle *)fParticles[fLeading]; } //__________________________________________________________________________________________________ @@ -61,11 +61,11 @@ Int_t AliRsnMiniEvent::CountParticles(TArrayI &found, Char_t charge, Int_t cutID Int_t i, npart = fParticles.GetEntriesFast(); Int_t count = 0; AliRsnMiniParticle *part = 0x0; - + found.Set(npart); - + for (i = 0; i < npart; i++) { - part = (AliRsnMiniParticle*)fParticles[i]; + part = (AliRsnMiniParticle *)fParticles[i]; if (charge == '+' || charge == '-' || charge == '0') { if (part->Charge() != charge) continue; } @@ -75,7 +75,7 @@ Int_t AliRsnMiniEvent::CountParticles(TArrayI &found, Char_t charge, Int_t cutID found[count] = i; count++; } - + found.Set(count); return count; } diff --git a/PWG2/RESONANCES/AliRsnMiniEvent.h b/PWG2/RESONANCES/AliRsnMiniEvent.h index 42184774ad4..84ec4b271f5 100644 --- a/PWG2/RESONANCES/AliRsnMiniEvent.h +++ b/PWG2/RESONANCES/AliRsnMiniEvent.h @@ -18,29 +18,29 @@ public: AliRsnMiniEvent() : fID(-1), fVz(0.0), fMult(0.0), fAngle(0.0), fLeading(-1), fParticles("AliRsnMiniParticle", 0) {} ~AliRsnMiniEvent() {fParticles.Delete();} - - Int_t& ID() {return fID;} - Float_t& Vz() {return fVz;} - Float_t& Mult() {return fMult;} - Float_t& Angle() {return fAngle;} - TClonesArray& Particles() {return fParticles;} + + Int_t &ID() {return fID;} + Float_t &Vz() {return fVz;} + Float_t &Mult() {return fMult;} + Float_t &Angle() {return fAngle;} + TClonesArray &Particles() {return fParticles;} Bool_t IsEmpty() {return fParticles.IsEmpty();} - + Int_t CountParticles(TArrayI &found, Char_t charge = 0, Int_t cutID = -1); - AliRsnMiniParticle* GetParticle(Int_t i); - AliRsnMiniParticle* LeadingParticle(); + AliRsnMiniParticle *GetParticle(Int_t i); + AliRsnMiniParticle *LeadingParticle(); void AddParticle(AliRsnMiniParticle copy); - + private: - + Int_t fID; // ID number Float_t fVz; // z-position of vertex Float_t fMult; // multiplicity or centrality Float_t fAngle; // angle of reaction plane to main reference frame - + Int_t fLeading; // index of leading particle TClonesArray fParticles; // list of selected particles - + ClassDef(AliRsnMiniEvent,2) }; diff --git a/PWG2/RESONANCES/AliRsnMiniMonitor.cxx b/PWG2/RESONANCES/AliRsnMiniMonitor.cxx index 0e69018e547..acb4b2be507 100644 --- a/PWG2/RESONANCES/AliRsnMiniMonitor.cxx +++ b/PWG2/RESONANCES/AliRsnMiniMonitor.cxx @@ -56,11 +56,11 @@ ClassImp(AliRsnMiniMonitor) //__________________________________________________________________________________________________ AliRsnMiniMonitor::AliRsnMiniMonitor() : - TNamed(), - fType(kTypes), - fCutID(-1), + TNamed(), + fType(kTypes), + fCutID(-1), fCharge(0), - fListID(-1), + fListID(-1), fList(0x0) { // @@ -70,49 +70,49 @@ AliRsnMiniMonitor::AliRsnMiniMonitor() : //__________________________________________________________________________________________________ AliRsnMiniMonitor::AliRsnMiniMonitor(const char *name, EType type, Int_t cutID) : - TNamed(name, ""), - fType(type), - fCutID(cutID), + TNamed(name, ""), + fType(type), + fCutID(cutID), fCharge(0), - fListID(-1), + fListID(-1), fList(0x0) { // // Default constructor // } - + //__________________________________________________________________________________________________ -AliRsnMiniMonitor::AliRsnMiniMonitor(const AliRsnMiniMonitor& copy) : - TNamed(copy), - fType(copy.fType), - fCutID(copy.fCutID), +AliRsnMiniMonitor::AliRsnMiniMonitor(const AliRsnMiniMonitor ©) : + TNamed(copy), + fType(copy.fType), + fCutID(copy.fCutID), fCharge(copy.fCharge), - fListID(copy.fListID), + fListID(copy.fListID), fList(copy.fList) { // // Copy constructor // } - + //__________________________________________________________________________________________________ -AliRsnMiniMonitor& AliRsnMiniMonitor::operator=(const AliRsnMiniMonitor& copy) +AliRsnMiniMonitor &AliRsnMiniMonitor::operator=(const AliRsnMiniMonitor ©) { // // Assignment operator // - - TNamed::operator=(copy); + + TNamed::operator=(copy); if (this == ©) - return *this; - fType = copy.fType; - fCutID = copy.fCutID; + return *this; + fType = copy.fType; + fCutID = copy.fCutID; fCharge = copy.fCharge; - fListID = copy.fListID; - fList = copy.fList; - - return (*this); + fListID = copy.fListID; + fList = copy.fList; + + return (*this); } //__________________________________________________________________________________________________ @@ -126,14 +126,14 @@ Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list) TString sname(name); sname += '_'; sname += GetName(); - + // check list fList = list; if (!list) { AliError("No list!"); return kFALSE; } - + // reset histogram TH1 *histogram = 0x0; @@ -143,7 +143,7 @@ Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list) sname += fCutID; histogram = new TH1F(sname.Data(), "", 100, 0.0, 10.0); break; - case kdEdxTPCvsP: + case kdEdxTPCvsP: sname += "_TPCsignal"; histogram = new TH2F(sname.Data(), "", 500, 0.0, 5.0, 1000, 0.0, 1000.0); break; @@ -162,7 +162,7 @@ Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list) AliError("Wrong enum type"); return kFALSE; } - + // add to list if (histogram && fList) { histogram->Sumw2(); @@ -171,7 +171,7 @@ Bool_t AliRsnMiniMonitor::Init(const char *name, TList *list) AliInfo(Form("Histogram '%s' added to list in slot #%d", histogram->GetName(), fListID)); return kTRUE; } - + return kFALSE; } @@ -195,11 +195,11 @@ Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event) Double_t valueX, valueY; AliVTrack *vtrack = track->Ref2Vtrack(); - + AliPIDResponse *pid = event->GetPIDResponse(); switch (fType) { - case kTrackPt: + case kTrackPt: if (!vtrack) { AliWarning("Required vtrack for this value"); return kFALSE; @@ -208,16 +208,16 @@ Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event) if (fCharge == '-' && vtrack->Charge() >= 0) return kFALSE; if (fCharge == '0' && vtrack->Charge() != 0) return kFALSE; valueX = vtrack->Pt(); - ((TH1F*)obj)->Fill(valueX); + ((TH1F *)obj)->Fill(valueX); return kTRUE; - case kdEdxTPCvsP: + case kdEdxTPCvsP: if (!vtrack) { AliWarning("Required vtrack for this value"); return kFALSE; } valueX = vtrack->GetTPCmomentum(); valueY = vtrack->GetTPCsignal(); - ((TH2F*)obj)->Fill(valueX, valueY); + ((TH2F *)obj)->Fill(valueX, valueY); return kTRUE; case ktimeTOFvsPPion: if (!vtrack) { @@ -228,7 +228,7 @@ Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event) //valueY = vtrack->GetTOFsignal(); valueY = 1E20; if (pid) valueY = pid->NumberOfSigmasTOF(vtrack, AliPID::kPion); - ((TH2F*)obj)->Fill(valueX, valueY); + ((TH2F *)obj)->Fill(valueX, valueY); return kTRUE; case ktimeTOFvsPKaon: if (!vtrack) { @@ -239,7 +239,7 @@ Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event) //valueY = vtrack->GetTOFsignal(); valueY = 1E20; if (pid) valueY = pid->NumberOfSigmasTOF(vtrack, AliPID::kKaon); - ((TH2F*)obj)->Fill(valueX, valueY); + ((TH2F *)obj)->Fill(valueX, valueY); return kTRUE; case ktimeTOFvsPProton: if (!vtrack) { @@ -250,7 +250,7 @@ Bool_t AliRsnMiniMonitor::Fill(AliRsnDaughter *track, AliRsnEvent *event) //valueY = vtrack->GetTOFsignal(); valueY = 1E20; if (pid) valueY = pid->NumberOfSigmasTOF(vtrack, AliPID::kProton); - ((TH2F*)obj)->Fill(valueX, valueY); + ((TH2F *)obj)->Fill(valueX, valueY); return kTRUE; default: AliError("Invalid value type"); diff --git a/PWG2/RESONANCES/AliRsnMiniMonitor.h b/PWG2/RESONANCES/AliRsnMiniMonitor.h index 686ef6a8f7f..566143a4881 100644 --- a/PWG2/RESONANCES/AliRsnMiniMonitor.h +++ b/PWG2/RESONANCES/AliRsnMiniMonitor.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Monitors @@ -29,20 +29,20 @@ public: AliRsnMiniMonitor(); AliRsnMiniMonitor(const char *name, EType type, Int_t cutID); - AliRsnMiniMonitor(const AliRsnMiniMonitor& copy); - AliRsnMiniMonitor& operator=(const AliRsnMiniMonitor& copy); + AliRsnMiniMonitor(const AliRsnMiniMonitor ©); + AliRsnMiniMonitor &operator=(const AliRsnMiniMonitor ©); virtual ~AliRsnMiniMonitor() { } EType GetType() {return fType;} Int_t GetCutID() {return fCutID;} Char_t GetCharge() {return fCharge;} Int_t GetListID() {return fListID;} - + void SetType(EType type) {fType = type;} void SetCutID(Int_t id) {fCutID = id;} void SetCharge(Char_t ch) {fCharge = ch;} - static const char* Label(EType type); + static const char *Label(EType type); Bool_t Init(const char *name, TList *list); Bool_t Fill(AliRsnDaughter *track, AliRsnEvent *event); @@ -53,11 +53,11 @@ protected: Char_t fCharge; // charge to be used Int_t fListID; // histogram ID in the list TList *fList; //! global output list - + ClassDef(AliRsnMiniMonitor, 1) // AliRsnMiniMonitor class }; -inline const char* AliRsnMiniMonitor::Label(EType type) +inline const char *AliRsnMiniMonitor::Label(EType type) { switch (type) { case kdEdxTPCvsP : return "TPCsignal"; diff --git a/PWG2/RESONANCES/AliRsnMiniMonitorTask.cxx b/PWG2/RESONANCES/AliRsnMiniMonitorTask.cxx index 4554faa4a4f..a83ef308759 100644 --- a/PWG2/RESONANCES/AliRsnMiniMonitorTask.cxx +++ b/PWG2/RESONANCES/AliRsnMiniMonitorTask.cxx @@ -82,7 +82,7 @@ AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const char *name, Bool_t useMC) : } //__________________________________________________________________________________________________ -AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask& copy) : +AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask ©) : AliAnalysisTaskSE(copy), fUseMC(copy.fUseMC), fEvNum(0), @@ -103,7 +103,7 @@ AliRsnMiniMonitorTask::AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask& copy) } //__________________________________________________________________________________________________ -AliRsnMiniMonitorTask& AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorTask& copy) +AliRsnMiniMonitorTask &AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorTask ©) { // // Assignment operator. @@ -112,7 +112,7 @@ AliRsnMiniMonitorTask& AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorT // AliAnalysisTaskSE::operator=(copy); if (this == ©) - return *this; + return *this; fUseMC = copy.fUseMC; fUseCentrality = copy.fUseCentrality; fCentralityType = copy.fCentralityType; @@ -120,7 +120,7 @@ AliRsnMiniMonitorTask& AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorT fEventCuts = copy.fEventCuts; fTrackCuts = copy.fTrackCuts; fBigOutput = copy.fBigOutput; - + return (*this); } @@ -128,7 +128,7 @@ AliRsnMiniMonitorTask& AliRsnMiniMonitorTask::operator=(const AliRsnMiniMonitorT AliRsnMiniMonitorTask::~AliRsnMiniMonitorTask() { // -// Destructor. +// Destructor. // Clean-up the output list, but not the histograms that are put inside // (the list is owner and will clean-up these histograms). Protect in PROOF case. // @@ -152,7 +152,7 @@ Int_t AliRsnMiniMonitorTask::AddTrackCuts(AliRsnCutSet *cuts) // TObject *obj = fTrackCuts.FindObject(cuts->GetName()); - + if (obj) { AliInfo(Form("A cut set named '%s' already exists", cuts->GetName())); return fTrackCuts.IndexOf(obj); @@ -172,27 +172,27 @@ void AliRsnMiniMonitorTask::UserCreateOutputObjects() // reset counter fEvNum = 0; - + // message AliInfo(Form("Selected event characterization: %s (%s)", (fUseCentrality ? "centrality" : "multiplicity"), fCentralityType.Data())); - + // create list and set it as owner of its content (MANDATORY) if (fBigOutput) OpenFile(1); fOutput = new TList(); fOutput->SetOwner(); - + // create one histogram per each stored definition (event histograms) Int_t i, ndef = fHistograms.GetEntries(); AliRsnMiniMonitor *def = 0x0; for (i = 0; i < ndef; i++) { - def = (AliRsnMiniMonitor*)fHistograms[i]; + def = (AliRsnMiniMonitor *)fHistograms[i]; if (!def) continue; if (!def->Init(GetName(), fOutput)) { AliError(Form("Def '%s': failed initialization", def->GetName())); continue; } } - + // post data for ALL output slots >0 here, to get at least an empty histogram PostData(1, fOutput); } @@ -209,16 +209,16 @@ void AliRsnMiniMonitorTask::UserExec(Option_t *) // event counter fEvNum++; - + // check current event Char_t check = CheckCurrentEvent(); if (!check) return; - + // setup PID response - AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); - AliInputEventHandler *inputHandler = (AliInputEventHandler*)man->GetInputEventHandler(); - fRsnEvent.SetPIDResponse(inputHandler->GetPIDResponse()); - + AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler = (AliInputEventHandler *)man->GetInputEventHandler(); + fRsnEvent.SetPIDResponse(inputHandler->GetPIDResponse()); + // loop on monitors and fill them Int_t it, icut, nTracks = fRsnEvent.GetAbsoluteSum(), nCuts = fTrackCuts.GetEntriesFast(); AliRsnDaughter cursor; @@ -228,10 +228,10 @@ void AliRsnMiniMonitorTask::UserExec(Option_t *) for (it = 0; it < nTracks; it++) { fRsnEvent.SetDaughter(cursor, it, fUseMC); next.Reset(); - while ( (mon = (AliRsnMiniMonitor*)next()) ) { + while ( (mon = (AliRsnMiniMonitor *)next()) ) { icut = mon->GetCutID(); if (icut >= 0 && icut < nCuts) { - cut = (AliRsnCutSet*)fTrackCuts[icut]; + cut = (AliRsnCutSet *)fTrackCuts[icut]; if (!cut) { AliError("Cut not found"); continue; @@ -241,7 +241,7 @@ void AliRsnMiniMonitorTask::UserExec(Option_t *) mon->Fill(&cursor, &fRsnEvent); } } - + // post data for computed stuff PostData(1, fOutput); } @@ -254,10 +254,10 @@ void AliRsnMiniMonitorTask::Terminate(Option_t *) // Called once at the end of the query // - fOutput = dynamic_cast(GetOutputData(1)); - if (!fOutput) { - AliError("Could not retrieve TList fOutput"); - return; + fOutput = dynamic_cast(GetOutputData(1)); + if (!fOutput) { + AliError("Could not retrieve TList fOutput"); + return; } } @@ -283,7 +283,7 @@ Char_t AliRsnMiniMonitorTask::CheckCurrentEvent() // string to sum messages TString msg(""); - + // check input type // exit points are provided in all cases an event is bad // if this block is passed, an event can be rejected only @@ -295,7 +295,7 @@ Char_t AliRsnMiniMonitorTask::CheckCurrentEvent() output = 'E'; // ESD specific check: Physics Selection // --> if this is failed, the event is rejected - isSelected = (((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB); + isSelected = (((AliInputEventHandler *)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected() & AliVEvent::kMB); if (!isSelected) { AliDebugClass(2, "Event does not pass physics selections"); fRsnEvent.SetRef(0x0); @@ -306,7 +306,7 @@ Char_t AliRsnMiniMonitorTask::CheckCurrentEvent() fRsnEvent.SetRef(fInputEvent); // add MC if requested and available if (fUseMC) { - if (fMCEvent) + if (fMCEvent) fRsnEvent.SetRefMC(fMCEvent); else { AliWarning("MC event requested but not available"); @@ -333,7 +333,7 @@ Char_t AliRsnMiniMonitorTask::CheckCurrentEvent() fRsnEvent.SetRefMC(0x0); return 0; } - + // if event cuts are defined, they are checked here // final decision on the event depends on this isSelected = kTRUE; @@ -349,7 +349,7 @@ Char_t AliRsnMiniMonitorTask::CheckCurrentEvent() msg += " -- Local cuts = NONE"; isSelected = kTRUE; } - + // if the above exit point is not taken, the event is accepted AliDebugClass(2, Form("Stats for event %d: %s", fEvNum, msg.Data())); if (isSelected) { @@ -380,13 +380,13 @@ Double_t AliRsnMiniMonitorTask::ComputeCentrality(Bool_t isESD) return fInputEvent->GetNumberOfTracks(); else if (!fCentralityType.CompareTo("QUALITY")) if (isESD) - return AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent*)fInputEvent, kTRUE); + return AliESDtrackCuts::GetReferenceMultiplicity((AliESDEvent *)fInputEvent, kTRUE); else { Double_t count = 0.; Int_t iTrack, ntracksLoop = fInputEvent->GetNumberOfTracks(); - for (iTrack = 0; iTrack < ntracksLoop; iTrack++) { - AliVTrack *track = (AliVTrack*)fInputEvent->GetTrack(iTrack); - AliAODTrack *aodt = dynamic_cast(track); + for (iTrack = 0; iTrack < ntracksLoop; iTrack++) { + AliVTrack *track = (AliVTrack *)fInputEvent->GetTrack(iTrack); + AliAODTrack *aodt = dynamic_cast(track); if (!aodt) continue; if (!aodt->TestFilterBit(5)) continue; count++; @@ -395,7 +395,7 @@ Double_t AliRsnMiniMonitorTask::ComputeCentrality(Bool_t isESD) } else if (!fCentralityType.CompareTo("TRACKLETS")) { if (isESD) { - const AliMultiplicity *mult = ((AliESDEvent*)fInputEvent)->GetMultiplicity(); + const AliMultiplicity *mult = ((AliESDEvent *)fInputEvent)->GetMultiplicity(); Float_t nClusters[6] = {0.0,0.0,0.0,0.0,0.0,0.0}; for(Int_t ilay = 0; ilay < 6; ilay++) nClusters[ilay] = (Float_t)mult->GetNumberOfITSClusters(ilay); return AliESDUtils::GetCorrSPD2(nClusters[1], fInputEvent->GetPrimaryVertex()->GetZ()); diff --git a/PWG2/RESONANCES/AliRsnMiniMonitorTask.h b/PWG2/RESONANCES/AliRsnMiniMonitorTask.h index 549386f984c..8d5a1ca9fca 100644 --- a/PWG2/RESONANCES/AliRsnMiniMonitorTask.h +++ b/PWG2/RESONANCES/AliRsnMiniMonitorTask.h @@ -31,22 +31,22 @@ public: AliRsnMiniMonitorTask(); AliRsnMiniMonitorTask(const char *name, Bool_t isMC = kFALSE); AliRsnMiniMonitorTask(const AliRsnMiniMonitorTask ©); - AliRsnMiniMonitorTask& operator=(const AliRsnMiniMonitorTask ©); + AliRsnMiniMonitorTask &operator=(const AliRsnMiniMonitorTask ©); virtual ~AliRsnMiniMonitorTask(); - void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;} + void UseMC(Bool_t yn = kTRUE) {fUseMC = yn;} void UseCentrality(const char *type) {fUseCentrality = kTRUE; fCentralityType = type; fCentralityType.ToUpper();} void UseMultiplicity(const char *type) {fUseCentrality = kFALSE; fCentralityType = type; fCentralityType.ToUpper();} void SetEventCuts(AliRsnCutSet *cuts) {fEventCuts = cuts;} Int_t AddTrackCuts(AliRsnCutSet *cuts); TClonesArray *Outputs() {return &fHistograms;} - + virtual void UserCreateOutputObjects(); - virtual void UserExec(Option_t*); - virtual void Terminate(Option_t*); - + virtual void UserExec(Option_t *); + virtual void Terminate(Option_t *); + AliRsnMiniMonitor *CreateMonitor(const char *name, AliRsnMiniMonitor::EType type, Int_t cutID); - + private: Char_t CheckCurrentEvent(); @@ -56,10 +56,10 @@ private: Int_t fEvNum; //! absolute event counter Bool_t fUseCentrality; // if true, use centrality for event, otherwise use multiplicity TString fCentralityType; // definition used to choose what centrality or multiplicity to use - + TList *fOutput; // output list TClonesArray fHistograms; // list of histogram definitions - + AliRsnCutSet *fEventCuts; // cuts on events TObjArray fTrackCuts; // list of single track cuts AliRsnEvent fRsnEvent; //! interface object to the event @@ -68,7 +68,7 @@ private: ClassDef(AliRsnMiniMonitorTask, 1); // AliRsnMiniMonitorTask }; -inline AliRsnMiniMonitor* AliRsnMiniMonitorTask::CreateMonitor +inline AliRsnMiniMonitor *AliRsnMiniMonitorTask::CreateMonitor (const char *name, AliRsnMiniMonitor::EType type, Int_t cutID) { // @@ -76,9 +76,9 @@ inline AliRsnMiniMonitor* AliRsnMiniMonitorTask::CreateMonitor // which is then returned to the user for its configuration // - Int_t n = fHistograms.GetEntries(); + Int_t n = fHistograms.GetEntries(); AliRsnMiniMonitor *newDef = new (fHistograms[n]) AliRsnMiniMonitor(name, type, cutID); - + return newDef; } diff --git a/PWG2/RESONANCES/AliRsnMiniOutput.cxx b/PWG2/RESONANCES/AliRsnMiniOutput.cxx index b7d4f78f941..5df3ea51342 100644 --- a/PWG2/RESONANCES/AliRsnMiniOutput.cxx +++ b/PWG2/RESONANCES/AliRsnMiniOutput.cxx @@ -5,7 +5,7 @@ // -- properties of resonance (mass, PDG code if needed) // -- properties of daughters (assigned mass, charges) // -- definition of output histogram -// +// #include "Riostream.h" @@ -103,8 +103,8 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, const char *outType, const // Output: // -- "HIST" --> common histogram (up to 3 dimensions) // -- "SPARSE" --> sparse histogram -// -// Computation: +// +// Computation: // -- "EVENT" --> event-only computations // -- "PAIR" --> track pair computations (default) // -- "MIX" --> event mixing (like track pair, but different events) @@ -115,7 +115,7 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, const char *outType, const // TString input; - + // understand output type input = outType; input.ToUpper(); @@ -125,7 +125,7 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, const char *outType, const fOutputType = kHistogramSparse; else AliWarning(Form("String '%s' does not define a meaningful output type", outType)); - + // understand computation type input = compType; input.ToUpper(); @@ -145,7 +145,7 @@ AliRsnMiniOutput::AliRsnMiniOutput(const char *name, const char *outType, const fComputation = kMother; else AliWarning(Form("String '%s' does not define a meaningful computation type", compType)); - + fCutID[0] = fCutID[1] = -1; fDaughter[0] = fDaughter[1] = AliRsnDaughter::kUnknown; fCharge[0] = fCharge[1] = 0; @@ -180,33 +180,33 @@ AliRsnMiniOutput::AliRsnMiniOutput(const AliRsnMiniOutput ©) : } //__________________________________________________________________________________________________ -AliRsnMiniOutput& AliRsnMiniOutput::operator=(const AliRsnMiniOutput ©) +AliRsnMiniOutput &AliRsnMiniOutput::operator=(const AliRsnMiniOutput ©) { // // Assignment operator // - if (this == ©) - return *this; - fOutputType = copy.fOutputType; - fComputation = copy.fComputation; - fMotherPDG = copy.fMotherPDG; - fMotherMass = copy.fMotherMass; - fPairCuts = copy.fPairCuts; - fOutputID = copy.fOutputID; - fAxes = copy.fAxes; - fComputed = copy.fComputed; - fList = copy.fList; - - Int_t i; - for (i = 0; i < 2; i++) { - fCutID[i] = copy.fCutID[i]; - fDaughter[i] = copy.fDaughter[i]; - fCharge[i] = copy.fCharge[i]; - } - - fSel1.Set(0); - fSel2.Set(0); - + if (this == ©) + return *this; + fOutputType = copy.fOutputType; + fComputation = copy.fComputation; + fMotherPDG = copy.fMotherPDG; + fMotherMass = copy.fMotherMass; + fPairCuts = copy.fPairCuts; + fOutputID = copy.fOutputID; + fAxes = copy.fAxes; + fComputed = copy.fComputed; + fList = copy.fList; + + Int_t i; + for (i = 0; i < 2; i++) { + fCutID[i] = copy.fCutID[i]; + fDaughter[i] = copy.fDaughter[i]; + fCharge[i] = copy.fCharge[i]; + } + + fSel1.Set(0); + fSel2.Set(0); + return (*this); } @@ -218,7 +218,7 @@ void AliRsnMiniOutput::AddAxis(Int_t i, Int_t nbins, Double_t min, Double_t max) // Create a new axis reference // - Int_t size = fAxes.GetEntries(); + Int_t size = fAxes.GetEntries(); new (fAxes[size]) AliRsnMiniAxis(i, nbins, min, max); } @@ -229,7 +229,7 @@ void AliRsnMiniOutput::AddAxis(Int_t i, Double_t min, Double_t max, Double_t ste // Create a new axis reference // - Int_t size = fAxes.GetEntries(); + Int_t size = fAxes.GetEntries(); new (fAxes[size]) AliRsnMiniAxis(i, min, max, step); } @@ -240,7 +240,7 @@ void AliRsnMiniOutput::AddAxis(Int_t i, Int_t nbins, Double_t *values) // Create a new axis reference // - Int_t size = fAxes.GetEntries(); + Int_t size = fAxes.GetEntries(); new (fAxes[size]) AliRsnMiniAxis(i, nbins, values); } @@ -255,7 +255,7 @@ Bool_t AliRsnMiniOutput::Init(const char *prefix, TList *list) AliError("Required an output list"); return kFALSE; } - + fList = list; Int_t size = fAxes.GetEntries(); if (size < 1) { @@ -295,10 +295,10 @@ void AliRsnMiniOutput::CreateHistogram(const char *name) // we expect to have maximum 3 axes in this case AliRsnMiniAxis *xAxis = 0x0, *yAxis = 0x0, *zAxis = 0x0; - if (size >= 1) xAxis = (AliRsnMiniAxis*)fAxes[0]; - if (size >= 2) yAxis = (AliRsnMiniAxis*)fAxes[1]; - if (size >= 3) zAxis = (AliRsnMiniAxis*)fAxes[2]; - + if (size >= 1) xAxis = (AliRsnMiniAxis *)fAxes[0]; + if (size >= 2) yAxis = (AliRsnMiniAxis *)fAxes[1]; + if (size >= 3) zAxis = (AliRsnMiniAxis *)fAxes[2]; + // create histogram depending on the number of axes TH1 *h1 = 0x0; if (xAxis && yAxis && zAxis) { @@ -311,7 +311,7 @@ void AliRsnMiniOutput::CreateHistogram(const char *name) AliError("No axis was initialized"); return; } - + // switch the correct computation of errors if (h1 && fList) { h1->Sumw2(); @@ -330,13 +330,13 @@ void AliRsnMiniOutput::CreateHistogramSparse(const char *name) Int_t size = fAxes.GetEntries(); AliInfo(Form("Sparse histogram name = '%s', with %d axes", name, size)); - + // retrieve binnings and sizes of all axes // since the check for null values is done in Init(), // we assume that here they must all be well defined Int_t i, *nbins = new Int_t[size]; for (i = 0; i < size; i++) { - AliRsnMiniAxis *axis = (AliRsnMiniAxis*)fAxes[i]; + AliRsnMiniAxis *axis = (AliRsnMiniAxis *)fAxes[i]; nbins[i] = axis->NBins(); } @@ -345,13 +345,13 @@ void AliRsnMiniOutput::CreateHistogramSparse(const char *name) // update the various axes using the definitions given in the array of axes here for (i = 0; i < size; i++) { - AliRsnMiniAxis *axis = (AliRsnMiniAxis*)fAxes[i]; + AliRsnMiniAxis *axis = (AliRsnMiniAxis *)fAxes[i]; h1->GetAxis(i)->Set(nbins[i], axis->BinArray()); } // clear heap delete [] nbins; - + // add to list if (h1 && fList) { h1->Sumw2(); @@ -391,10 +391,10 @@ Bool_t AliRsnMiniOutput::FillMother(const AliRsnMiniPair *pair, AliRsnMiniEvent AliError("This method can be called only for mother-based computations"); return kFALSE; } - + // copy passed pair info fPair = (*pair); - + // check pair against cuts if (fPairCuts) if (!fPairCuts->IsSelected(&fPair)) return kFALSE; @@ -425,17 +425,17 @@ Int_t AliRsnMiniOutput::FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event AliError(Form("[%s] This method can be called only for pair-based computations", GetName())); return kFALSE; } - + // loop variables Int_t i1, i2, start, nadded = 0; AliRsnMiniParticle *p1, *p2; - + // it is necessary to know if criteria for the two daughters are the same // and if the two events are the same or not (mixing) //Bool_t sameCriteria = ((fCharge[0] == fCharge[1]) && (fCutID[0] == fCutID[1])); Bool_t sameCriteria = ((fCharge[0] == fCharge[1]) && (fDaughter[0] == fDaughter[1])); Bool_t sameEvent = (event1->ID() == event2->ID()); - + TString selList1 = ""; TString selList2 = ""; Int_t n1 = event1->CountParticles(fSel1, fCharge[0], fCutID[0]); @@ -448,7 +448,7 @@ Int_t AliRsnMiniOutput::FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event AliDebugClass(1, "No pairs to mix"); return 0; } - + // external loop for (i1 = 0; i1 < n1; i1++) { p1 = event1->GetParticle(fSel1[i1]); @@ -498,11 +498,11 @@ Int_t AliRsnMiniOutput::FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event } // get computed values & fill histogram nadded++; - if (refFirst) ComputeValues(event1, valueList); else ComputeValues(event2, valueList); + if (refFirst) ComputeValues(event1, valueList); else ComputeValues(event2, valueList); FillHistogram(); } // end internal loop } // end external loop - + AliDebugClass(1, Form("Pairs added in total = %4d", nadded)); return nadded; } @@ -520,10 +520,10 @@ void AliRsnMiniOutput::ComputeValues(AliRsnMiniEvent *event, TClonesArray *value if (fComputed.GetSize() != size) fComputed.Set(size); Int_t i, ival, nval = valueList->GetEntries(); - + for (i = 0; i < size; i++) { fComputed[i] = 1E20; - AliRsnMiniAxis *axis = (AliRsnMiniAxis*)fAxes[i]; + AliRsnMiniAxis *axis = (AliRsnMiniAxis *)fAxes[i]; if (!axis) { AliError("Null axis"); continue; @@ -533,11 +533,11 @@ void AliRsnMiniOutput::ComputeValues(AliRsnMiniEvent *event, TClonesArray *value AliError(Form("Required value #%d, while maximum is %d", ival, nval)); continue; } - AliRsnMiniValue *val = (AliRsnMiniValue*)valueList->At(ival); + AliRsnMiniValue *val = (AliRsnMiniValue *)valueList->At(ival); if (!val) { AliError(Form("Value in position #%d is NULL", ival)); continue; - } + } // if none of the above exit points is taken, compute value fComputed[i] = val->Eval(&fPair, event); } @@ -560,13 +560,13 @@ void AliRsnMiniOutput::FillHistogram() TObject *obj = fList->At(fOutputID); if (obj->InheritsFrom(TH1F::Class())) { - ((TH1F*)obj)->Fill(fComputed[0]); + ((TH1F *)obj)->Fill(fComputed[0]); } else if (obj->InheritsFrom(TH2F::Class())) { - ((TH2F*)obj)->Fill(fComputed[0], fComputed[1]); + ((TH2F *)obj)->Fill(fComputed[0], fComputed[1]); } else if (obj->InheritsFrom(TH3F::Class())) { - ((TH3F*)obj)->Fill(fComputed[0], fComputed[1], fComputed[2]); + ((TH3F *)obj)->Fill(fComputed[0], fComputed[1], fComputed[2]); } else if (obj->InheritsFrom(THnSparseF::Class())) { - ((THnSparseF*)obj)->Fill(fComputed.GetArray()); + ((THnSparseF *)obj)->Fill(fComputed.GetArray()); } else { AliError("No output initialized"); } diff --git a/PWG2/RESONANCES/AliRsnMiniOutput.h b/PWG2/RESONANCES/AliRsnMiniOutput.h index 600ee481944..93e76052668 100644 --- a/PWG2/RESONANCES/AliRsnMiniOutput.h +++ b/PWG2/RESONANCES/AliRsnMiniOutput.h @@ -8,7 +8,7 @@ // -- properties of resonance (mass, PDG code if needed) // -- properties of daughters (assigned mass, charges) // -- definition of output histogram -// +// #include "AliRsnDaughter.h" #include "AliRsnMiniParticle.h" @@ -33,7 +33,7 @@ public: kHistogramSparse, kTypes }; - + enum EComputation { kEventOnly, kTrackPair, @@ -44,13 +44,13 @@ public: kMother, kComputations }; - + AliRsnMiniOutput(); AliRsnMiniOutput(const char *name, EOutputType type, EComputation src = kTrackPair); AliRsnMiniOutput(const char *name, const char *outType, const char *compType); AliRsnMiniOutput(const AliRsnMiniOutput ©); - AliRsnMiniOutput& operator=(const AliRsnMiniOutput ©); - + AliRsnMiniOutput &operator=(const AliRsnMiniOutput ©); + Bool_t IsEventOnly() const {return (fComputation == kEventOnly);} Bool_t IsTrackPair() const {return (fComputation == kTrackPair);} Bool_t IsTrackPairMix() const {return (fComputation == kTrackPairMix);} @@ -62,7 +62,7 @@ public: Bool_t IsSameDaughter() const {return (fDaughter[0] == fDaughter[1]);} //Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameCut());} Bool_t IsSymmetric() const {return (IsLikeSign() && IsSameDaughter());} - + EOutputType GetOutputType() const {return fOutputType;} EComputation GetComputation() const {return fComputation;} Int_t GetCutID(Int_t i) const {if (i <= 0) return fCutID [0]; else return fCutID [1];} @@ -72,7 +72,7 @@ public: Int_t GetCharge(Int_t i) const {if (i <= 0) return fCharge[0]; else return fCharge[1];} Int_t GetMotherPDG() const {return fMotherPDG;} Double_t GetMotherMass() const {return fMotherMass;} - + void SetOutputType(EOutputType type) {fOutputType = type;} void SetComputation(EComputation src) {fComputation = src;} void SetCutID(Int_t i, Int_t value) {if (i <= 0) fCutID [0] = value; else fCutID [1] = value;} @@ -81,19 +81,19 @@ public: void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;} void SetMotherMass(Double_t mass) {fMotherMass = mass;} void SetPairCuts(AliRsnCutSet *set) {fPairCuts = set;} - + void AddAxis(Int_t id, Int_t nbins, Double_t min, Double_t max); void AddAxis(Int_t id, Double_t min, Double_t max, Double_t step); void AddAxis(Int_t id, Int_t nbins, Double_t *values); - AliRsnMiniAxis* GetAxis(Int_t i) {if (i >= 0 && i < fAxes.GetEntries()) return (AliRsnMiniAxis*)fAxes[i]; return 0x0;} - Double_t* GetAllComputed() {return fComputed.GetArray();} - - AliRsnMiniPair& Pair() {return fPair;} + AliRsnMiniAxis *GetAxis(Int_t i) {if (i >= 0 && i < fAxes.GetEntries()) return (AliRsnMiniAxis *)fAxes[i]; return 0x0;} + Double_t *GetAllComputed() {return fComputed.GetArray();} + + AliRsnMiniPair &Pair() {return fPair;} Bool_t Init(const char *prefix, TList *list); Bool_t FillMother(const AliRsnMiniPair *pair, AliRsnMiniEvent *event, TClonesArray *valueList); Bool_t FillEvent(AliRsnMiniEvent *event, TClonesArray *valueList); Int_t FillPair(AliRsnMiniEvent *event1, AliRsnMiniEvent *event2, TClonesArray *valueList, Bool_t refFirst = kTRUE); - + private: void CreateHistogram(const char *name); @@ -109,7 +109,7 @@ private: Int_t fMotherPDG; // PDG code of resonance Double_t fMotherMass; // nominal resonance mass AliRsnCutSet *fPairCuts; // cuts on the pair - + Int_t fOutputID; // index of output object in container list TClonesArray fAxes; // definitions for the axes of each value TArrayD fComputed; //! temporary container for all computed values @@ -117,7 +117,7 @@ private: TList *fList; //! pointer to the TList containing the output TArrayI fSel1; //! list of selected particles for definition 1 TArrayI fSel2; //! list of selected particles for definition 2 - + ClassDef(AliRsnMiniOutput,1) // AliRsnMiniOutput class }; diff --git a/PWG2/RESONANCES/AliRsnMiniPair.cxx b/PWG2/RESONANCES/AliRsnMiniPair.cxx index af3373447f8..b4b1271f172 100644 --- a/PWG2/RESONANCES/AliRsnMiniPair.cxx +++ b/PWG2/RESONANCES/AliRsnMiniPair.cxx @@ -16,13 +16,13 @@ void AliRsnMiniPair::Fill p2->Set4Vector(fP2[0], m2, kFALSE); p1->Set4Vector(fP1[1], m1, kTRUE ); p2->Set4Vector(fP2[1], m2, kTRUE ); - + fMother = -1; if (p1->Mother() == p2->Mother()) { fMother = p1->Mother(); fMotherPDG = p1->MotherPDG(); } - + Int_t i; for (i = 0; i < 2; i++) { fSum[i] = fP1[i] + fP2[i]; @@ -36,7 +36,7 @@ Double_t AliRsnMiniPair::CosThetaStar(Bool_t useMC) // // Return cosine of angle of one daughter to the resonance momentum in its rest frame // - + TLorentzVector &mother = fSum[ID(useMC)]; TLorentzVector &daughter0 = fP1[ID(useMC)]; TLorentzVector &daughter1 = fP2[ID(useMC)]; diff --git a/PWG2/RESONANCES/AliRsnMiniPair.h b/PWG2/RESONANCES/AliRsnMiniPair.h index 7b3c9a28164..7b5317f5df6 100644 --- a/PWG2/RESONANCES/AliRsnMiniPair.h +++ b/PWG2/RESONANCES/AliRsnMiniPair.h @@ -3,9 +3,9 @@ // // This object is used as lightweight temporary container -// of all information needed from any input object and +// of all information needed from any input object and // useful for resonance analysis. -// +// #include #include @@ -17,25 +17,25 @@ public: AliRsnMiniPair() : fMother(-1), fMotherPDG(0) { } - Int_t& Mother() {return fMother;} - Int_t& MotherPDG() {return fMotherPDG;} + Int_t &Mother() {return fMother;} + Int_t &MotherPDG() {return fMotherPDG;} void Fill(AliRsnMiniParticle *p1, AliRsnMiniParticle *p2, Double_t m1, Double_t m2, Double_t refMass); void FillRef(Double_t mass); void InvertP(Bool_t first); - + Int_t ID(Bool_t mc) const {if (mc) return 1; else return 0;} - - TLorentzVector& P1 (Bool_t mc) {return fP1 [ID(mc)];} - TLorentzVector& P2 (Bool_t mc) {return fP2 [ID(mc)];} - TLorentzVector& Sum(Bool_t mc) {return fSum[ID(mc)];} - TLorentzVector& Ref(Bool_t mc) {return fRef[ID(mc)];} - + + TLorentzVector &P1 (Bool_t mc) {return fP1 [ID(mc)];} + TLorentzVector &P2 (Bool_t mc) {return fP2 [ID(mc)];} + TLorentzVector &Sum(Bool_t mc) {return fSum[ID(mc)];} + TLorentzVector &Ref(Bool_t mc) {return fRef[ID(mc)];} + Double_t Pt(Bool_t mc) const {return fSum[ID(mc)].Pt();} Double_t Pz(Bool_t mc) const {return fSum[ID(mc)].Pz();} Double_t Eta(Bool_t mc) const {return fSum[ID(mc)].Eta();} Double_t InvMass(Bool_t mc) const {return fSum[ID(mc)].M();} - Double_t InvMassRes() const; - Double_t InvMassDiff() const; + Double_t InvMassRes() const; + Double_t InvMassDiff() const; Double_t Mt(Bool_t mc) const {return fRef[ID(mc)].Mt();} Double_t Y(Bool_t mc) const {return fRef[ID(mc)].Rapidity();} Double_t PtRatio(Bool_t mc) const; @@ -48,10 +48,10 @@ private: TLorentzVector fP2 [2]; // 2nd daughter momentum TLorentzVector fSum[2]; // sum of momenta TLorentzVector fRef[2]; // same as 'fSum' but with nominal resonance mass - + Int_t fMother; // label of mothers (when common) Int_t fMotherPDG; // PDG code of mother (when common) - + ClassDef(AliRsnMiniPair,1) }; @@ -74,7 +74,7 @@ inline Double_t AliRsnMiniPair::InvMassRes() const // if (fSum[1].M() <= 0.0) return 1E20; - + return (fSum[0].M() - fSum[1].M()) / fSum[1].M(); } @@ -85,7 +85,7 @@ inline Double_t AliRsnMiniPair::InvMassDiff() const // if (fSum[1].M() <= 0.0) return 1E20; - + return (fSum[0].M() - fSum[1].M()); } @@ -97,9 +97,9 @@ inline Double_t AliRsnMiniPair::PtRatio(Bool_t mc) const Double_t num = TMath::Abs(fP1[ID(mc)].Perp() - fP2[ID(mc)].Perp()); Double_t den = TMath::Abs(fP1[ID(mc)].Perp() + fP2[ID(mc)].Perp()); - + if (den <= 0.0) return 1E20; - + return num / den; } @@ -111,7 +111,7 @@ inline Double_t AliRsnMiniPair::DipAngle(Bool_t mc) const const TLorentzVector &p1 = fP1[ID(mc)]; const TLorentzVector &p2 = fP2[ID(mc)]; - + return ((p1.Perp() * p2.Perp() + p1.Z() * p2.Z()) / p1.Mag() / p2.Mag()); } diff --git a/PWG2/RESONANCES/AliRsnMiniParticle.cxx b/PWG2/RESONANCES/AliRsnMiniParticle.cxx index 5bdabb68400..4770f4a5e49 100644 --- a/PWG2/RESONANCES/AliRsnMiniParticle.cxx +++ b/PWG2/RESONANCES/AliRsnMiniParticle.cxx @@ -1,6 +1,6 @@ // // This object is used as lightweight temporary container -// of all information needed from any input object and +// of all information needed from any input object and // useful for resonance analysis. // Lists of such objects are stored in a buffer, in order // to allow an event mixing. @@ -32,14 +32,14 @@ void AliRsnMiniParticle::CopyDaughter(AliRsnDaughter *daughter) fCharge = '-'; else fCharge = '0'; - + // rec info if (daughter->GetRef()) { fPrec[0] = daughter->GetRef()->Px(); fPrec[1] = daughter->GetRef()->Py(); fPrec[2] = daughter->GetRef()->Pz(); } - + // MC info if (daughter->GetRefMC()) { fPsim[0] = daughter->GetRefMC()->Px(); diff --git a/PWG2/RESONANCES/AliRsnMiniParticle.h b/PWG2/RESONANCES/AliRsnMiniParticle.h index 2e2f58efe13..d793ea233b6 100644 --- a/PWG2/RESONANCES/AliRsnMiniParticle.h +++ b/PWG2/RESONANCES/AliRsnMiniParticle.h @@ -3,9 +3,9 @@ // // This object is used as lightweight temporary container -// of all information needed from any input object and +// of all information needed from any input object and // useful for resonance analysis. -// +// #include #include @@ -18,26 +18,26 @@ public: AliRsnMiniParticle() : fIndex(-1), fCharge(0), fPDG(0), fMother(0), fMotherPDG(0), fCutBits(0x0) {Int_t i = 3; while (i--) fPsim[i] = fPrec[i] = 0.0;} - Int_t& Index() {return fIndex;} - Char_t& Charge() {return fCharge;} - Float_t& PsimX() {return fPsim[0];} - Float_t& PsimY() {return fPsim[1];} - Float_t& PsimZ() {return fPsim[2];} - Float_t& PrecX() {return fPrec[0];} - Float_t& PrecY() {return fPrec[1];} - Float_t& PrecZ() {return fPrec[2];} - Float_t& Px(Bool_t mc) {return (mc ? fPsim[0] : fPrec[0]);} - Float_t& Py(Bool_t mc) {return (mc ? fPsim[1] : fPrec[1]);} - Float_t& Pz(Bool_t mc) {return (mc ? fPsim[2] : fPrec[2]);} - Short_t& PDG() {return fPDG;} + Int_t &Index() {return fIndex;} + Char_t &Charge() {return fCharge;} + Float_t &PsimX() {return fPsim[0];} + Float_t &PsimY() {return fPsim[1];} + Float_t &PsimZ() {return fPsim[2];} + Float_t &PrecX() {return fPrec[0];} + Float_t &PrecY() {return fPrec[1];} + Float_t &PrecZ() {return fPrec[2];} + Float_t &Px(Bool_t mc) {return (mc ? fPsim[0] : fPrec[0]);} + Float_t &Py(Bool_t mc) {return (mc ? fPsim[1] : fPrec[1]);} + Float_t &Pz(Bool_t mc) {return (mc ? fPsim[2] : fPrec[2]);} + Short_t &PDG() {return fPDG;} Short_t PDGAbs() {return TMath::Abs(fPDG);} - Short_t& Mother() {return fMother;} - Short_t& MotherPDG() {return fMotherPDG;} - UShort_t& CutBits() {return fCutBits;} + Short_t &Mother() {return fMother;} + Short_t &MotherPDG() {return fMotherPDG;} + UShort_t &CutBits() {return fCutBits;} Bool_t HasCutBit(Int_t i) {UShort_t bit = 1 << i; return ((fCutBits & bit) != 0);} void SetCutBit(Int_t i) {UShort_t bit = 1 << i; fCutBits |= bit;} void ClearCutBit(Int_t i) {UShort_t bit = 1 << i; fCutBits &= (~bit);} - + void Set4Vector(TLorentzVector &v, Float_t mass, Bool_t mc) {v.SetXYZM(Px(mc), Py(mc), Pz(mc), mass);} void CopyDaughter(AliRsnDaughter *daughter); @@ -51,7 +51,7 @@ private: Short_t fMother; // index of mother in its container Short_t fMotherPDG; // PDG code of mother UShort_t fCutBits; // list of bits used to know what cuts were passed by this track - + ClassDef(AliRsnMiniParticle,2) }; diff --git a/PWG2/RESONANCES/AliRsnMiniValue.cxx b/PWG2/RESONANCES/AliRsnMiniValue.cxx index f5de6667888..82332351355 100644 --- a/PWG2/RESONANCES/AliRsnMiniValue.cxx +++ b/PWG2/RESONANCES/AliRsnMiniValue.cxx @@ -60,7 +60,7 @@ AliRsnMiniValue::AliRsnMiniValue(EType type, Bool_t useMC) : } //_____________________________________________________________________________ -AliRsnMiniValue::AliRsnMiniValue(const AliRsnMiniValue& copy) : +AliRsnMiniValue::AliRsnMiniValue(const AliRsnMiniValue ©) : TNamed(copy), fType(copy.fType), fUseMCInfo(copy.fUseMCInfo) @@ -71,7 +71,7 @@ AliRsnMiniValue::AliRsnMiniValue(const AliRsnMiniValue& copy) : } //_____________________________________________________________________________ -AliRsnMiniValue& AliRsnMiniValue::operator=(const AliRsnMiniValue& copy) +AliRsnMiniValue &AliRsnMiniValue::operator=(const AliRsnMiniValue ©) { // // Assignment operator. @@ -79,7 +79,7 @@ AliRsnMiniValue& AliRsnMiniValue::operator=(const AliRsnMiniValue& copy) // TNamed::operator=(copy); if (this == ©) - return *this; + return *this; fType = copy.fType; fUseMCInfo = copy.fUseMCInfo; @@ -87,7 +87,7 @@ AliRsnMiniValue& AliRsnMiniValue::operator=(const AliRsnMiniValue& copy) } //_____________________________________________________________________________ -const char* AliRsnMiniValue::TypeName(EType type) +const char *AliRsnMiniValue::TypeName(EType type) { // // This method returns a string to give a name to each possible @@ -128,14 +128,14 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event) AliError("Null pair passed!"); return 1E20; } - + // compute value depending on types in the enumeration // if the type does not match any available choice, or if // the computation is not doable due to any problem // (not initialized support object, wrong values, risk of floating point errors) // the method returng kFALSE and sets the computed value to a meaningless number switch (fType) { - // ---- event values ------------------------------------------------------------------------- + // ---- event values ------------------------------------------------------------------------- case kVz: return event->Vz(); case kMult: @@ -144,8 +144,8 @@ Float_t AliRsnMiniValue::Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event) return event->Angle(); case kLeadingPt: return 0.0; - // ---- pair values -------------------------------------------------------------------------- - case kPt: + // ---- pair values -------------------------------------------------------------------------- + case kPt: return pair->Pt(fUseMCInfo); case kInvMass: return pair->InvMass(fUseMCInfo); diff --git a/PWG2/RESONANCES/AliRsnMiniValue.h b/PWG2/RESONANCES/AliRsnMiniValue.h index 684247a8370..e938d0f22db 100644 --- a/PWG2/RESONANCES/AliRsnMiniValue.h +++ b/PWG2/RESONANCES/AliRsnMiniValue.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Values which depend on 4-momentum of the pair. @@ -38,36 +38,36 @@ public: }; AliRsnMiniValue(EType type = kTypes, Bool_t useMC = kFALSE); - AliRsnMiniValue(const AliRsnMiniValue& copy); - AliRsnMiniValue& operator=(const AliRsnMiniValue& copy); + AliRsnMiniValue(const AliRsnMiniValue ©); + AliRsnMiniValue &operator=(const AliRsnMiniValue ©); virtual ~AliRsnMiniValue() { } void SetType(EType type) {fType = type;} EType GetType() const {return fType;} - const char* GetTypeName() const {return TypeName(fType);} + const char *GetTypeName() const {return TypeName(fType);} Bool_t IsEventValue() const {return (fType < kEventCuts);} - + Float_t Eval(AliRsnMiniPair *pair, AliRsnMiniEvent *event = 0x0); - - static const char* TypeName(EType type); - static const char* ValueName(EType type, Bool_t useMC); + + static const char *TypeName(EType type); + static const char *ValueName(EType type, Bool_t useMC); protected: EType fType; // type from enumeration Bool_t fUseMCInfo; // switch to use rec/sim momentum - + ClassDef(AliRsnMiniValue, 1) // AliRsnMiniValue class }; -inline const char* AliRsnMiniValue::ValueName(EType type, Bool_t useMC) +inline const char *AliRsnMiniValue::ValueName(EType type, Bool_t useMC) { // // Define a criterion to name these object. // They are not managed by the user, since each object is a singleton // - if (useMC) + if (useMC) return Form("MC_%s", TypeName(type)); else return TypeName(type); diff --git a/PWG2/RESONANCES/AliRsnMother.cxx b/PWG2/RESONANCES/AliRsnMother.cxx index 2f4374816a3..7be7ab05aca 100644 --- a/PWG2/RESONANCES/AliRsnMother.cxx +++ b/PWG2/RESONANCES/AliRsnMother.cxx @@ -56,24 +56,24 @@ AliRsnMother::AliRsnMother(const AliRsnMother &obj) : } //__________________________________________________________________________________________________ -AliRsnMother& AliRsnMother::operator=(const AliRsnMother &obj) +AliRsnMother &AliRsnMother::operator=(const AliRsnMother &obj) { // // Assignment operator. // Does not duplicate pointers. // - if (this == &obj) - return *this; - - fSum = obj.fSum; - fRef = obj.fRef; - fSumMC = obj.fSumMC; - fRefMC = obj.fRefMC; - fRefEvent = obj.fRefEvent; - fDaughter[0] = obj.fDaughter[0]; - fDaughter[1] = obj.fDaughter[1]; - - return (*this); + if (this == &obj) + return *this; + + fSum = obj.fSum; + fRef = obj.fRef; + fSumMC = obj.fSumMC; + fRefMC = obj.fRefMC; + fRefEvent = obj.fRefEvent; + fDaughter[0] = obj.fDaughter[0]; + fDaughter[1] = obj.fDaughter[1]; + + return (*this); } //__________________________________________________________________________________________________ @@ -107,21 +107,21 @@ Int_t AliRsnMother::CommonMother() const // If the mother label is the same, the function returns the PDG code of mother, // otherwise it returns 0. // The two arguments passed by reference contain the GEANT labels of the mother -// of the two particles to which the two daughters point. This is for being able +// of the two particles to which the two daughters point. This is for being able // to check if they are really coming from a resonance (indexes >= 0) or not. // Int_t m1 = fDaughter[0]->GetMother(); Int_t m2 = fDaughter[1]->GetMother(); Int_t out = 0; - + // a true mother makes sense only if both mothers // are not-negative and equal if (m1 >= 0 && m2 >= 0 && m1 == m2) { out = TMath::Abs(fDaughter[0]->GetMotherPDG()); AliDebugClass(1, Form("Mothers are: %d %d --> EQUAL (PDG = %d)", m1, m2, out)); - } - + } + return out; } @@ -140,25 +140,25 @@ Double_t AliRsnMother::AngleToLeading(Bool_t &success) success = kFALSE; return -99.0; } - + Int_t id1 = fDaughter[0]->GetID(); Int_t id2 = fDaughter[1]->GetID(); Int_t idL = fRefEvent->GetLeadingIndex(); - + if (id1 == idL || id2 == idL) { success = kFALSE; return -99.0; } - + AliRsnDaughter leading = fRefEvent->GetDaughter(idL, kFALSE); AliVParticle *ref = leading.GetRef(); Double_t angle = ref->Phi() - fSum.Phi(); - + //return angle w.r.t. leading particle in the range -pi/2, 3/2pi while (angle >= 1.5 * TMath::Pi()) angle -= 2 * TMath::Pi(); while (angle < -0.5 * TMath::Pi()) angle += 2 * TMath::Pi(); success = kTRUE; - + return angle; } @@ -177,7 +177,7 @@ void AliRsnMother::ComputeSum(Double_t mass0, Double_t mass1, Double_t motherMas // sum fSum = fDaughter[0]->Prec() + fDaughter[1]->Prec(); fSumMC = fDaughter[0]->Psim() + fDaughter[1]->Psim(); - + // reference fRef.SetXYZM(fSum.X(), fSum.Y(), fSum.Z(), motherMass); fRefMC.SetXYZM(fSumMC.X(), fSumMC.Y(), fSumMC.Z(), motherMass); diff --git a/PWG2/RESONANCES/AliRsnMother.h b/PWG2/RESONANCES/AliRsnMother.h index 14408f4c17c..834ef3fcb79 100644 --- a/PWG2/RESONANCES/AliRsnMother.h +++ b/PWG2/RESONANCES/AliRsnMother.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Interface to candidate resonance decaying into 2 bodies. @@ -22,35 +22,35 @@ public: AliRsnMother() : fRefEvent(0), fSum(), fSumMC(), fRef(), fRefMC() {fDaughter[0] = fDaughter[1] = 0;} AliRsnMother(const AliRsnMother &obj); - AliRsnMother& operator=(const AliRsnMother &obj); + AliRsnMother &operator=(const AliRsnMother &obj); virtual ~AliRsnMother(); // setters (4-vectors cannot be set) void Reset(); void SetDaughter(Int_t i, AliRsnDaughter *d) {fDaughter[CkID(i)] = d;} void SetRefEvent(AliRsnEvent *event) {fRefEvent = event;} - + // getters - AliRsnEvent* GetRefEvent() {return fRefEvent;} - AliRsnDaughter* GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];} - TLorentzVector& Sum(Bool_t mc) {return (mc ? fSumMC : fSum);} - TLorentzVector& Ref(Bool_t mc) {return (mc ? fRefMC : fRef);} + AliRsnEvent *GetRefEvent() {return fRefEvent;} + AliRsnDaughter *GetDaughter(const Int_t &i) {return fDaughter[CkID(i)];} + TLorentzVector &Sum(Bool_t mc) {return (mc ? fSumMC : fSum);} + TLorentzVector &Ref(Bool_t mc) {return (mc ? fRefMC : fRef);} Bool_t GetResolution(Double_t &value); Double_t Rapidity(Bool_t mc) {if (mc) return fRefMC.Rapidity(); else return fRef.Rapidity();} - + // checks Bool_t IsLabelEqual() const {return TMath::Abs(fDaughter[0]->GetLabel()) == TMath::Abs(fDaughter[1]->GetLabel());} Bool_t IsIndexEqual() const {return (fDaughter[0]->GetID() == fDaughter[1]->GetID());} Bool_t IsOwnerEqual() const {return (fDaughter[0]->GetOwnerEvent() == fDaughter[1]->GetOwnerEvent());} Int_t CommonMother() const; - + // angles Double_t AngleTo(AliRsnDaughter *track, Bool_t mc = kFALSE) {return track->P(mc).Angle(Sum(mc).Vect());} Double_t AngleToLeading(Bool_t &success); - + // computations void ComputeSum(Double_t mass1, Double_t mass2, Double_t motherMass); - Double_t CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE); + Double_t CosThetaStar(Bool_t first = kTRUE, Bool_t useMC = kFALSE); void PrintInfo(const Option_t *option = "ALL") const; Bool_t CheckPair(Bool_t checkMC = kFALSE) const; diff --git a/PWG2/RESONANCES/AliRsnPairDef.cxx b/PWG2/RESONANCES/AliRsnPairDef.cxx index 8ada0bcd7a8..c3d59d92c4e 100644 --- a/PWG2/RESONANCES/AliRsnPairDef.cxx +++ b/PWG2/RESONANCES/AliRsnPairDef.cxx @@ -22,7 +22,7 @@ // This object contains two AliRsnDaughterDef which define a model for each // of the two expected daughters (see also AliRsnDaughterDef class) plus a // mass hypothesis for the resonance, which is used for computin quantities -// which need it (like rapidity or Mt), and a PDG code, which is used to +// which need it (like rapidity or Mt), and a PDG code, which is used to // check for true pairs, when needed. In all other cases, these two additional // values can be left to their default (meaningless) value. // Since this object must define a decay channel, the only provided constructor @@ -41,9 +41,9 @@ ClassImp(AliRsnPairDef) //_____________________________________________________________________________ AliRsnPairDef::AliRsnPairDef() : - fMotherMass(0.0), - fMotherPDG(0), - fDef1(), + fMotherMass(0.0), + fMotherPDG(0), + fDef1(), fDef2() { // @@ -55,9 +55,9 @@ AliRsnPairDef::AliRsnPairDef() : //_____________________________________________________________________________ AliRsnPairDef::AliRsnPairDef (EPARTYPE type1, Char_t ch1, EPARTYPE type2, Char_t ch2, Int_t pdg, Double_t mass) : - fMotherMass(mass), - fMotherPDG(pdg), - fDef1(type1, ch1), + fMotherMass(mass), + fMotherPDG(pdg), + fDef1(type1, ch1), fDef2(type2, ch2) { // @@ -69,9 +69,9 @@ AliRsnPairDef::AliRsnPairDef //_____________________________________________________________________________ AliRsnPairDef::AliRsnPairDef (AliRsnDaughter::ESpecies type1, Char_t ch1, AliRsnDaughter::ESpecies type2, Char_t ch2, Int_t pdg, Double_t mass) : - fMotherMass(mass), - fMotherPDG(pdg), - fDef1(type1, ch1), + fMotherMass(mass), + fMotherPDG(pdg), + fDef1(type1, ch1), fDef2(type2, ch2) { // @@ -79,7 +79,7 @@ AliRsnPairDef::AliRsnPairDef // If the two pointers are well initialized, they are used to init the members. // } - + //_____________________________________________________________________________ AliRsnPairDef::AliRsnPairDef(const AliRsnPairDef ©) : TObject(copy), @@ -94,17 +94,17 @@ AliRsnPairDef::AliRsnPairDef(const AliRsnPairDef ©) : } //_____________________________________________________________________________ -AliRsnPairDef& AliRsnPairDef::operator=(const AliRsnPairDef ©) +AliRsnPairDef &AliRsnPairDef::operator=(const AliRsnPairDef ©) { // // Assignment operator with standard behavior. // - if (this == ©) - return *this; - fMotherMass = copy.fMotherMass; - fMotherPDG = copy.fMotherPDG; - fDef1 = copy.fDef1; - fDef2 = copy.fDef2; - + if (this == ©) + return *this; + fMotherMass = copy.fMotherMass; + fMotherPDG = copy.fMotherPDG; + fDef1 = copy.fDef1; + fDef2 = copy.fDef2; + return (*this); } diff --git a/PWG2/RESONANCES/AliRsnPairDef.h b/PWG2/RESONANCES/AliRsnPairDef.h index 32f61516c4b..e1268b361d9 100644 --- a/PWG2/RESONANCES/AliRsnPairDef.h +++ b/PWG2/RESONANCES/AliRsnPairDef.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Resonance decay tree definition. @@ -20,15 +20,15 @@ public: AliRsnPairDef(EPARTYPE type1, Char_t ch1, EPARTYPE type2, Char_t ch2, Int_t motherPDG = 0, Double_t motherMass = 0.0); AliRsnPairDef(AliRsnDaughter::ESpecies type1, Char_t ch1, AliRsnDaughter::ESpecies type2, Char_t ch2, Int_t motherPDG = 0, Double_t motherMass = 0.0); AliRsnPairDef(const AliRsnPairDef ©); - AliRsnPairDef& operator= (const AliRsnPairDef ©); + AliRsnPairDef &operator= (const AliRsnPairDef ©); virtual ~AliRsnPairDef() { } - virtual const char* GetName() const {return Form("%s_%s", fDef1.GetName(), fDef2.GetName());} + virtual const char *GetName() const {return Form("%s_%s", fDef1.GetName(), fDef2.GetName());} Int_t GetMotherPDG() const {return fMotherPDG;} Double_t GetMotherMass() const {return fMotherMass;} - AliRsnDaughterDef& GetDef1() {return fDef1;} - AliRsnDaughterDef& GetDef2() {return fDef2;} - AliRsnDaughterDef& GetDef(Int_t i) {if (i<1) return GetDef1(); else return GetDef2();} + AliRsnDaughterDef &GetDef1() {return fDef1;} + AliRsnDaughterDef &GetDef2() {return fDef2;} + AliRsnDaughterDef &GetDef(Int_t i) {if (i<1) return GetDef1(); else return GetDef2();} void SetMotherPDG(Int_t pdg) {fMotherPDG = pdg;} void SetMotherMass(Double_t mass) {fMotherMass = mass;} diff --git a/PWG2/RESONANCES/AliRsnTarget.cxx b/PWG2/RESONANCES/AliRsnTarget.cxx index 06ccce58d25..48699e90d55 100644 --- a/PWG2/RESONANCES/AliRsnTarget.cxx +++ b/PWG2/RESONANCES/AliRsnTarget.cxx @@ -16,7 +16,7 @@ //////////////////////////////////////////////////////////////////////////////// // // Base class used wherever it is needed to check the class type of -// an object w.r. to the RSN framework analysis (daughter, mother, event) +// an object w.r. to the RSN framework analysis (daughter, mother, event) // which could be used for cut checking or value computing. // Since most of these operation are implemented into classes that // operate on any of such objects, then this class helps in making sure @@ -47,7 +47,7 @@ Bool_t AliRsnTarget::TargetOK(TObject *object) // 1) check if the object class matches the required target type // 2) if (1) is successful, set the built-in pointer data member // in order to point to it, after being casted accordingly -// 3) if the target is a daughter or a mother, adjust the pointer +// 3) if the target is a daughter or a mother, adjust the pointer // to reference event accordingly // @@ -62,23 +62,23 @@ Bool_t AliRsnTarget::TargetOK(TObject *object) AliError("Passed a NULL object"); return kFALSE; } - + // checks matching between argument type and expected object type // the passed object is also casted into the appropriate pointer // when a daughter or mother is passed and the target type expects // and event, the check is yes successful and the owner event is used if (object->IsA() == AliRsnDaughter::Class() && (fTargetType == kDaughter || fTargetType == kEvent)) { - fDaughter = static_cast(object); + fDaughter = static_cast(object); fEvent = fDaughter->GetOwnerEvent(); return kTRUE; } else if (object->IsA() == AliRsnMother::Class() && (fTargetType == kMother || fTargetType == kEvent)) { - fMother = static_cast(object); + fMother = static_cast(object); fEvent = fMother->GetRefEvent(); return kTRUE; } else if (object->IsA() == AliRsnEvent::Class() && fTargetType == kEvent) { - fEvent = static_cast(object); + fEvent = static_cast(object); return kTRUE; } else { @@ -107,7 +107,7 @@ Char_t AliRsnTarget::GetTargetTypeChar() const } //______________________________________________________________________________ -const char* AliRsnTarget::GetTargetTypeName() const +const char *AliRsnTarget::GetTargetTypeName() const { // // Returns a string with the name of the cut target type- diff --git a/PWG2/RESONANCES/AliRsnTarget.h b/PWG2/RESONANCES/AliRsnTarget.h index 0b7a922cbc7..abe94476e72 100644 --- a/PWG2/RESONANCES/AliRsnTarget.h +++ b/PWG2/RESONANCES/AliRsnTarget.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // General class for cut/computation target objects (daughter/pair/event). @@ -29,22 +29,22 @@ public: AliRsnTarget() : fTargetType(kTargetTypes), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ } AliRsnTarget(const char *name, ETargetType type = kTargetTypes) : TNamed(name, ""), fTargetType(type), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ } - AliRsnTarget(const AliRsnTarget& copy) : TNamed(copy), fTargetType(copy.fTargetType), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ } - AliRsnTarget& operator=(const AliRsnTarget& copy) { TNamed::operator=(copy); if (this==©) return *this; fTargetType = copy.fTargetType; return (*this); } + AliRsnTarget(const AliRsnTarget ©) : TNamed(copy), fTargetType(copy.fTargetType), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ } + AliRsnTarget &operator=(const AliRsnTarget ©) { TNamed::operator=(copy); if (this==©) return *this; fTargetType = copy.fTargetType; return (*this); } virtual ~AliRsnTarget() { /*nothing*/ } Bool_t IsAllNull() const {return (!fDaughter && !fMother && !fEvent);} Bool_t IsTarget(ETargetType targetType) const {return (fTargetType == targetType);} Bool_t TargetOK(TObject *object); - + void SetTargetType(ETargetType type) {fTargetType = type;} ETargetType GetTargetType() const {return fTargetType;} - Char_t GetTargetTypeChar() const; - const char* GetTargetTypeName() const; - - AliRsnDaughter* GetTargetDaughter() {return fDaughter;} - AliRsnMother* GetTargetMother() {return fMother;} - AliRsnEvent* GetTargetEvent() {return fEvent;} + Char_t GetTargetTypeChar() const; + const char *GetTargetTypeName() const; + + AliRsnDaughter *GetTargetDaughter() {return fDaughter;} + AliRsnMother *GetTargetMother() {return fMother;} + AliRsnEvent *GetTargetEvent() {return fEvent;} protected: diff --git a/PWG2/RESONANCES/AliRsnValue.cxx b/PWG2/RESONANCES/AliRsnValue.cxx index e5f6730dbfd..806ff261597 100644 --- a/PWG2/RESONANCES/AliRsnValue.cxx +++ b/PWG2/RESONANCES/AliRsnValue.cxx @@ -66,7 +66,7 @@ AliRsnValue::AliRsnValue(const char *name, AliRsnTarget::ETargetType type) : } //_____________________________________________________________________________ -AliRsnValue::AliRsnValue(const AliRsnValue& copy) : +AliRsnValue::AliRsnValue(const AliRsnValue ©) : AliRsnTarget(copy), fUseMCInfo(copy.fUseMCInfo), fComputedValue(copy.fComputedValue), @@ -79,7 +79,7 @@ AliRsnValue::AliRsnValue(const AliRsnValue& copy) : } //_____________________________________________________________________________ -AliRsnValue& AliRsnValue::operator=(const AliRsnValue& copy) +AliRsnValue &AliRsnValue::operator=(const AliRsnValue ©) { // // Assignment operator. @@ -88,7 +88,7 @@ AliRsnValue& AliRsnValue::operator=(const AliRsnValue& copy) AliRsnTarget::operator=(copy); if (this == ©) - return *this; + return *this; fUseMCInfo = copy.fUseMCInfo; fComputedValue = copy.fComputedValue; fBinArray = copy.fBinArray; diff --git a/PWG2/RESONANCES/AliRsnValue.h b/PWG2/RESONANCES/AliRsnValue.h index 8ed7a93cb47..dd2c2a8757b 100644 --- a/PWG2/RESONANCES/AliRsnValue.h +++ b/PWG2/RESONANCES/AliRsnValue.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Collection of all values which can be computed within the package @@ -18,12 +18,12 @@ class AliRsnValue : public AliRsnTarget { public: AliRsnValue(const char *name = "", AliRsnTarget::ETargetType type = AliRsnTarget::kTargetTypes); - AliRsnValue(const AliRsnValue& copy); - AliRsnValue& operator=(const AliRsnValue& copy); + AliRsnValue(const AliRsnValue ©); + AliRsnValue &operator=(const AliRsnValue ©); virtual ~AliRsnValue() { } - TArrayD& GetArray() {return fBinArray;} - const Double_t* GetArrayValues() const {return fBinArray.GetArray();} + TArrayD &GetArray() {return fBinArray;} + const Double_t *GetArrayValues() const {return fBinArray.GetArray();} Double_t GetComputedValue() const {return fComputedValue;} void SetUseMCInfo(Bool_t yn = kTRUE) {fUseMCInfo = yn;} diff --git a/PWG2/RESONANCES/AliRsnValueDaughter.cxx b/PWG2/RESONANCES/AliRsnValueDaughter.cxx index e311ef81d7c..233b3b75b4f 100644 --- a/PWG2/RESONANCES/AliRsnValueDaughter.cxx +++ b/PWG2/RESONANCES/AliRsnValueDaughter.cxx @@ -68,7 +68,7 @@ AliRsnValueDaughter::AliRsnValueDaughter(const char *name, EType type) : } //_____________________________________________________________________________ -AliRsnValueDaughter::AliRsnValueDaughter(const AliRsnValueDaughter& copy) : +AliRsnValueDaughter::AliRsnValueDaughter(const AliRsnValueDaughter ©) : AliRsnValue(copy), fType(copy.fType) { @@ -78,7 +78,7 @@ AliRsnValueDaughter::AliRsnValueDaughter(const AliRsnValueDaughter& copy) : } //_____________________________________________________________________________ -AliRsnValueDaughter& AliRsnValueDaughter::operator=(const AliRsnValueDaughter& copy) +AliRsnValueDaughter &AliRsnValueDaughter::operator=(const AliRsnValueDaughter ©) { // // Assignment operator. @@ -87,14 +87,14 @@ AliRsnValueDaughter& AliRsnValueDaughter::operator=(const AliRsnValueDaughter& c AliRsnValue::operator=(copy); if (this == ©) - return *this; + return *this; fType = copy.fType; - + return (*this); } //_____________________________________________________________________________ -const char* AliRsnValueDaughter::GetTypeName() const +const char *AliRsnValueDaughter::GetTypeName() const { // // This method returns a string to give a name to each possible @@ -129,8 +129,8 @@ Bool_t AliRsnValueDaughter::Eval(TObject *object) // The output of the function tells if computing was successful, // and the values must be taken with GetValue(). // - - // coherence check, which also casts object + + // coherence check, which also casts object // to AliRsnTarget data members and returns kFALSE // in case the object is NULL if (!TargetOK(object)) return kFALSE; @@ -147,7 +147,7 @@ Bool_t AliRsnValueDaughter::Eval(TObject *object) AliError("No DATA"); return kFALSE; } - + // compute value depending on types in the enumeration // if the type does not match any available choice, or if // the computation is not doable due to any problem diff --git a/PWG2/RESONANCES/AliRsnValueDaughter.h b/PWG2/RESONANCES/AliRsnValueDaughter.h index a9f638617dc..e2f5c4cd795 100644 --- a/PWG2/RESONANCES/AliRsnValueDaughter.h +++ b/PWG2/RESONANCES/AliRsnValueDaughter.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Values which depend on 4-momentum of the daughters. @@ -33,13 +33,13 @@ public: }; AliRsnValueDaughter(const char *name = "valDaughter", EType type = kTypes); - AliRsnValueDaughter(const AliRsnValueDaughter& copy); - AliRsnValueDaughter& operator=(const AliRsnValueDaughter& copy); + AliRsnValueDaughter(const AliRsnValueDaughter ©); + AliRsnValueDaughter &operator=(const AliRsnValueDaughter ©); virtual ~AliRsnValueDaughter() { } void SetType(EType type) {fType = type;} EType GetType() const {return fType;} - const char* GetTypeName() const; + const char *GetTypeName() const; virtual Bool_t Eval(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnValueEvent.cxx b/PWG2/RESONANCES/AliRsnValueEvent.cxx index 9be11dd07c4..403cba9dd1f 100644 --- a/PWG2/RESONANCES/AliRsnValueEvent.cxx +++ b/PWG2/RESONANCES/AliRsnValueEvent.cxx @@ -66,7 +66,7 @@ AliRsnValueEvent::AliRsnValueEvent(const char *name, EType type) : } //_____________________________________________________________________________ -AliRsnValueEvent::AliRsnValueEvent(const AliRsnValueEvent& copy) : +AliRsnValueEvent::AliRsnValueEvent(const AliRsnValueEvent ©) : AliRsnValue(copy), fType(copy.fType) { @@ -76,23 +76,23 @@ AliRsnValueEvent::AliRsnValueEvent(const AliRsnValueEvent& copy) : } //_____________________________________________________________________________ -AliRsnValueEvent& AliRsnValueEvent::operator=(const AliRsnValueEvent& copy) +AliRsnValueEvent &AliRsnValueEvent::operator=(const AliRsnValueEvent ©) { // // Assignment operator. // Works like copy constructor. // - AliRsnValue::operator=(copy); - if (this == ©) - return *this; - fType = copy.fType; - - return (*this); + AliRsnValue::operator=(copy); + if (this == ©) + return *this; + fType = copy.fType; + + return (*this); } //_____________________________________________________________________________ -const char* AliRsnValueEvent::GetTypeName() const +const char *AliRsnValueEvent::GetTypeName() const { // // This method returns a string to give a name to each possible @@ -121,8 +121,8 @@ Bool_t AliRsnValueEvent::Eval(TObject *object) // In this implementation, fills the member 4-vectors with data // coming from the object passed as argument, and then returns the value // - - // coherence check, which also casts object + + // coherence check, which also casts object // to AliRsnTarget data members and returns kFALSE // in case the object is NULL if (!TargetOK(object)) return kFALSE; @@ -130,10 +130,10 @@ Bool_t AliRsnValueEvent::Eval(TObject *object) AliWarning("NULL ref"); return kFALSE; } - + // declare support variables AliCentrality *centrality = fEvent->GetRef()->GetCentrality(); - + // compute value depending on types in the enumeration // if the type does not match any available choice, or if // the computation is not doable due to any problem @@ -146,11 +146,11 @@ Bool_t AliRsnValueEvent::Eval(TObject *object) case kMultMC: fComputedValue = -999.0; if (fEvent->GetRefMC()) { - if (fEvent->IsESD()) + if (fEvent->IsESD()) fComputedValue = (Double_t)fEvent->GetRefMC()->GetNumberOfTracks(); else { - AliAODEvent *aod = (AliAODEvent*)fEvent->GetRefMC(); - TClonesArray *mcArray = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName()); + AliAODEvent *aod = (AliAODEvent *)fEvent->GetRefMC(); + TClonesArray *mcArray = (TClonesArray *)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName()); if (mcArray) fComputedValue = (Double_t)mcArray->GetEntries(); } } @@ -176,7 +176,7 @@ Bool_t AliRsnValueEvent::Eval(TObject *object) return kFALSE; } return (fComputedValue >= 0); - case kLeadingPt: + case kLeadingPt: if (fEvent->GetLeadingIndex() >= 0) { AliRsnDaughter leadingPart; fEvent->SetLeadingParticle(leadingPart); diff --git a/PWG2/RESONANCES/AliRsnValueEvent.h b/PWG2/RESONANCES/AliRsnValueEvent.h index f4a128686a2..373647ee1b0 100644 --- a/PWG2/RESONANCES/AliRsnValueEvent.h +++ b/PWG2/RESONANCES/AliRsnValueEvent.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Values which depend on 4-momentum of the pair. @@ -25,17 +25,17 @@ public: kCentralityV0, // event centrality (V0 method) kCentralityTrack, // event centrality (tracks method) kCentralityCL1, // event centrality (CL1 method) - kTypes + kTypes }; AliRsnValueEvent(const char *name = "valEvent", EType type = kTypes); - AliRsnValueEvent(const AliRsnValueEvent& copy); - AliRsnValueEvent& operator=(const AliRsnValueEvent& copy); + AliRsnValueEvent(const AliRsnValueEvent ©); + AliRsnValueEvent &operator=(const AliRsnValueEvent ©); virtual ~AliRsnValueEvent() { } void SetType(EType type) {fType = type;} EType GetType() const {return fType;} - const char* GetTypeName() const; + const char *GetTypeName() const; virtual Bool_t Eval(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnValuePair.cxx b/PWG2/RESONANCES/AliRsnValuePair.cxx index ab06659bfc3..313492aa8ee 100644 --- a/PWG2/RESONANCES/AliRsnValuePair.cxx +++ b/PWG2/RESONANCES/AliRsnValuePair.cxx @@ -67,7 +67,7 @@ AliRsnValuePair::AliRsnValuePair(const char *name, EType type) : } //_____________________________________________________________________________ -AliRsnValuePair::AliRsnValuePair(const AliRsnValuePair& copy) : +AliRsnValuePair::AliRsnValuePair(const AliRsnValuePair ©) : AliRsnValue(copy), fType(copy.fType) { @@ -77,7 +77,7 @@ AliRsnValuePair::AliRsnValuePair(const AliRsnValuePair& copy) : } //_____________________________________________________________________________ -AliRsnValuePair& AliRsnValuePair::operator=(const AliRsnValuePair& copy) +AliRsnValuePair &AliRsnValuePair::operator=(const AliRsnValuePair ©) { // // Assignment operator. @@ -86,14 +86,14 @@ AliRsnValuePair& AliRsnValuePair::operator=(const AliRsnValuePair& copy) AliRsnValue::operator=(copy); if (this == ©) - return *this; + return *this; fType = copy.fType; return (*this); } //_____________________________________________________________________________ -const char* AliRsnValuePair::GetTypeName() const +const char *AliRsnValuePair::GetTypeName() const { // // This method returns a string to give a name to each possible @@ -125,20 +125,20 @@ Bool_t AliRsnValuePair::Eval(TObject *object) // coming from the object passed as argument, and then returns the value // - // coherence check, which also casts object + // coherence check, which also casts object // to AliRsnTarget data members and returns kFALSE // in case the object is NULL if (!TargetOK(object)) return kFALSE; - + // set a reference to the mother momentum TLorentzVector &sum = fMother->Sum(fUseMCInfo); TLorentzVector &ref = fMother->Ref(fUseMCInfo); TLorentzVector &p1 = fMother->GetDaughter(0)->P(fUseMCInfo); TLorentzVector &p2 = fMother->GetDaughter(1)->P(fUseMCInfo); - + // utility variables Bool_t success; - + // compute value depending on types in the enumeration // if the type does not match any available choice, or if // the computation is not doable due to any problem diff --git a/PWG2/RESONANCES/AliRsnValuePair.h b/PWG2/RESONANCES/AliRsnValuePair.h index ec26b932dde..cf15db59861 100644 --- a/PWG2/RESONANCES/AliRsnValuePair.h +++ b/PWG2/RESONANCES/AliRsnValuePair.h @@ -3,7 +3,7 @@ /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ - + //////////////////////////////////////////////////////////////////////////////// // // Values which depend on 4-momentum of the pair. @@ -31,13 +31,13 @@ public: }; AliRsnValuePair(const char *name = "valPair", EType type = kTypes); - AliRsnValuePair(const AliRsnValuePair& copy); - AliRsnValuePair& operator=(const AliRsnValuePair& copy); + AliRsnValuePair(const AliRsnValuePair ©); + AliRsnValuePair &operator=(const AliRsnValuePair ©); virtual ~AliRsnValuePair() { } void SetType(EType type) {fType = type;} EType GetType() const {return fType;} - const char* GetTypeName() const; + const char *GetTypeName() const; virtual Bool_t Eval(TObject *object); diff --git a/PWG2/RESONANCES/AliRsnVariableExpression.h b/PWG2/RESONANCES/AliRsnVariableExpression.h index 8a15b0db796..be059276db0 100644 --- a/PWG2/RESONANCES/AliRsnVariableExpression.h +++ b/PWG2/RESONANCES/AliRsnVariableExpression.h @@ -16,7 +16,7 @@ class AliRsnVariableExpression: public AliRsnExpression { public: AliRsnVariableExpression(TString a) : AliRsnExpression() { fVname = a; }; ~AliRsnVariableExpression() {} - virtual Bool_t Value(TObjArray& pgm); + virtual Bool_t Value(TObjArray &pgm); virtual TString Unparse() const { return fVname; } ClassDef(AliRsnVariableExpression, 1); // Class to define a variable expression -- 2.43.0