From 4e4fb2f6606b9d12fc554463d69ec9629290ae3a Mon Sep 17 00:00:00 2001 From: pulvir Date: Tue, 14 Jun 2011 15:57:17 +0000 Subject: [PATCH] Ad-hoc implementation of cuts for pions/kaons/protons for 2010 analysis --- PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx | 56 +++++++---- PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h | 37 +++++-- PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx | 5 +- PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h | 14 ++- PWG2/RESONANCES/AliRsnCutPion2010PP.cxx | 98 +++++++++++++++++++ PWG2/RESONANCES/AliRsnCutPion2010PP.h | 53 ++++++++++ PWG2/RESONANCES/AliRsnCutProton2010PP.cxx | 98 +++++++++++++++++++ PWG2/RESONANCES/AliRsnCutProton2010PP.h | 55 +++++++++++ 8 files changed, 380 insertions(+), 36 deletions(-) create mode 100644 PWG2/RESONANCES/AliRsnCutPion2010PP.cxx create mode 100644 PWG2/RESONANCES/AliRsnCutPion2010PP.h create mode 100644 PWG2/RESONANCES/AliRsnCutProton2010PP.cxx create mode 100644 PWG2/RESONANCES/AliRsnCutProton2010PP.h diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx index 4617f64065e..a390aafb810 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.cxx @@ -1,5 +1,8 @@ // -// All cuts for single kaons in phi analysis 2010 +// This cut implements all the checks done to accept a track as a Kaon +// 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. // #include @@ -13,7 +16,13 @@ ClassImp(AliRsnCutKaonForPhi2010) //__________________________________________________________________________________________________ AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010(const char *name) : AliRsnCut(name, AliRsnTarget::kDaughter, 0.0, 3.0), - fCutQuality(Form("%sQuality", name)) + fOnlyQuality(kFALSE), + fOnlyTPC(kFALSE), + fOnlyTOF(kFALSE), + fCutTPC(2.0), + fCutTOF(2.0), + fTOFthreshold(0.8), + fCutQuality(Form("%s_quality", name)) { // // Constructor @@ -62,6 +71,9 @@ Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj) // quality if (!fCutQuality.IsSelected(obj)) return kFALSE; + // if not PID is done, exit here + if (fOnlyQuality) return kTRUE; + // check initialization of PID object AliPIDResponse *pid = fEvent->GetPIDResponse(); if (!pid) { @@ -69,26 +81,28 @@ Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj) return kFALSE; } - // PID ITS : - // depends on momentum - //SetRangeD(0.0, 4.0); - //fCutValueD = TMath::Abs(pid->NumberOfSigmasITS(track, AliPID::kKaon)); - //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::kKaon)); - if (!OkRangeD()) return kFALSE; + // PID + Double_t nsigmaTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon)); + Double_t nsigmaTOF = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon)); + Bool_t matchTOF = MatchTOF(track); - // if TOF is not matched, end here - // otherwise check TOF - if (!MatchTOF(track)) + // if only one detector is chosen, do this here + if (fOnlyTPC) { + return (nsigmaTPC <= fCutTPC); + } else if (fOnlyTOF) { + return (matchTOF && (nsigmaTOF <= fCutTOF)); + } else { + // combined PID: + // below momentum threshold, start with TPC + if (track->P() < fTOFthreshold) { + if (nsigmaTPC > fCutTPC) return kFALSE; + if (matchTOF && (nsigmaTOF > fCutTOF)) return kFALSE; + return kTRUE; + } else { + if (!matchTOF) return kFALSE; + if (nsigmaTOF > fCutTOF) return kFALSE; + if (nsigmaTPC > 4.0) return kFALSE; + } return kTRUE; - else { - //SetRangeD(0.0, 3.0); - fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon)); - return OkRangeD(); } } diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h index a6a988b9eaa..085d255afbf 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010.h @@ -1,8 +1,11 @@ -#ifndef ALIRSNCUTKaonForPhi2010_H -#define ALIRSNCUTKaonForPhi2010_H +#ifndef ALIRSNCUTKAONFORPHI2010_H +#define ALIRSNCUTKAONFORPHI2010_H // -// All cuts for single kaons in phi analysis 2010 +// This cut implements all the checks done to accept a track as a Kaon +// 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. // #include "AliVTrack.h" @@ -14,23 +17,38 @@ class AliRsnCutKaonForPhi2010 : public AliRsnCut { public: AliRsnCutKaonForPhi2010(const char *name = ""); + virtual ~AliRsnCutKaonForPhi2010() { } virtual Bool_t IsSelected(TObject *obj); - AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + Double_t GetTOFthreshold() const {return fTOFthreshold;} + + void SetTOFthreshold(Double_t value) {fTOFthreshold = value;} + void SetOnlyQuality(Bool_t yn = kTRUE) {fOnlyQuality = yn;} + void SetOnlyTPC(Bool_t yn = kTRUE) {fOnlyTPC = yn;} + void SetOnlyTOF(Bool_t yn = kTRUE) {fOnlyTOF = yn;} + void SetCutTPC(Double_t cut) {fCutTPC = cut;} + void SetCutTOF(Double_t cut) {fCutTOF = cut;} private: - Bool_t MatchTOF(AliVTrack *vtrack); + Bool_t MatchTOF(const AliVTrack *vtrack); - AliRsnCutTrackQuality fCutQuality; // track quality cut + Bool_t fOnlyQuality; // switch off PID + Bool_t fOnlyTPC; // use only TPC PID + Bool_t fOnlyTOF; // use only TOF PID + Double_t fCutTPC; // nsigma cut for TPC + Double_t fCutTOF; // nsigma cut fof TOF + Double_t fTOFthreshold; // for Pt above this threshold, TOF is mandatory + AliRsnCutTrackQuality fCutQuality; // track quality cut ClassDef(AliRsnCutKaonForPhi2010,1) }; //__________________________________________________________________________________________________ -inline Bool_t AliRsnCutKaonForPhi2010::MatchTOF(AliVTrack *vtrack) +inline Bool_t AliRsnCutKaonForPhi2010::MatchTOF(const AliVTrack *vtrack) { // // Checks if the track has matched the TOF detector @@ -41,10 +59,11 @@ inline Bool_t AliRsnCutKaonForPhi2010::MatchTOF(AliVTrack *vtrack) return kFALSE; } + Bool_t isTOFpid = ((vtrack->GetStatus() & AliESDtrack::kTOFpid) != 0); Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0); - Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0); + Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0); - return (isTOFout && isTIME); + return (isTOFout && isTIME && isTOFpid); } #endif diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx index 1bc4cf06a68..1d8d9cc6756 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.cxx @@ -1,5 +1,8 @@ // -// All cuts for single kaons in phi analysis 2010 +// This cut implements all the checks done to accept a track as a Kaon +// 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. // #include diff --git a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h index 41b19b8a9d6..6c722e1d063 100644 --- a/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h +++ b/PWG2/RESONANCES/AliRsnCutKaonForPhi2010PP.h @@ -1,8 +1,11 @@ -#ifndef AliRsnCutKaonForPhi2010PP_H -#define AliRsnCutKaonForPhi2010PP_H +#ifndef ALIRSNCUTKAONFORPHI2010PP_H +#define ALIRSNCUTKAONFORPHI2010PP_H // -// All cuts for single kaons in phi analysis 2010 +// This cut implements all the checks done to accept a track as a Kaon +// 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. // #include "AliVTrack.h" @@ -14,6 +17,7 @@ class AliRsnCutKaonForPhi2010PP : public AliRsnCut { public: AliRsnCutKaonForPhi2010PP(const char *name = ""); + virtual ~AliRsnCutKaonForPhi2010PP() { } void SetTPCNSigmaLow (Double_t v) {fNSigmaTPCLow = v;} void SetTPCNSigmaHigh(Double_t v) {fNSigmaTPCHigh = v;} @@ -26,7 +30,7 @@ public: private: - Bool_t MatchTOF(AliVTrack *vtrack); + Bool_t MatchTOF(const AliVTrack *vtrack); Double_t fNSigmaTPCLow; // TPC: nsigma cut below limit Double_t fNSigmaTPCHigh; // TPC: nsigma cut above limit @@ -40,7 +44,7 @@ private: }; //__________________________________________________________________________________________________ -inline Bool_t AliRsnCutKaonForPhi2010PP::MatchTOF(AliVTrack *vtrack) +inline Bool_t AliRsnCutKaonForPhi2010PP::MatchTOF(const AliVTrack *vtrack) { // // Checks if the track has matched the TOF detector diff --git a/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx b/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx new file mode 100644 index 00000000000..6296b2354f1 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutPion2010PP.cxx @@ -0,0 +1,98 @@ +// +// All cuts for single pions in phi analysis 2010, +// based on track quality and particle identification +// with TPC and TOF. +// Author: Serguey Kiselev. +// +// + +#include + +#include "AliPID.h" +#include "AliPIDResponse.h" +#include "AliRsnCutPion2010PP.h" + +ClassImp(AliRsnCutPion2010PP) + +//__________________________________________________________________________________________________ +AliRsnCutPion2010PP::AliRsnCutPion2010PP(const char *name) : + AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0), + fCutQuality(Form("%sQuality", name)) +{ +// +// Constructor +// Initialize the contained cuts and sets defaults +// + + // track quality + //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE); + //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE); + //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE); + 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); +} + +//__________________________________________________________________________________________________ +Bool_t AliRsnCutPion2010PP::IsSelected(TObject *obj) +{ +// +// Global check +// + + // 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)) + return kTRUE; + else { + //SetRangeD(0.0, 3.0); + fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kPion)); + return OkRangeD(); + } +} diff --git a/PWG2/RESONANCES/AliRsnCutPion2010PP.h b/PWG2/RESONANCES/AliRsnCutPion2010PP.h new file mode 100644 index 00000000000..3e014de5050 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutPion2010PP.h @@ -0,0 +1,53 @@ +#ifndef ALIRSNCUTPION2010PP_H +#define ALIRSNCUTPION2010PP_H + +// +// All cuts for single pions in phi analysis 2010, +// based on track quality and particle identification +// with TPC and TOF. +// + +#include "AliVTrack.h" +#include "AliRsnCut.h" +#include "AliRsnCutTrackQuality.h" + +class AliRsnCutPion2010PP : public AliRsnCut { + +public: + + AliRsnCutPion2010PP(const char *name = ""); + virtual ~AliRsnCutPion2010PP() { } + + virtual Bool_t IsSelected(TObject *obj); + + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + +private: + + Bool_t MatchTOF(const AliVTrack *vtrack); + + AliRsnCutTrackQuality fCutQuality; // track quality cut + + ClassDef(AliRsnCutPion2010PP,1) + +}; + +//__________________________________________________________________________________________________ +inline Bool_t AliRsnCutPion2010PP::MatchTOF(const AliVTrack *vtrack) +{ +// +// Checks if the track has matched the TOF detector +// + + if (!vtrack) { + AliWarning("NULL argument: impossible to check status"); + return kFALSE; + } + + Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0); + Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0); + + return (isTOFout && isTIME); +} + +#endif diff --git a/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx b/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx new file mode 100644 index 00000000000..e8f22ecd195 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutProton2010PP.cxx @@ -0,0 +1,98 @@ +// +// All cuts for single Protons in phi analysis 2010, +// based on quality and PID using the TPC and TOF +// detectors, using default definitions for both +// kinds of cuts, for ESD and AOD +// Author: Serguey Kiselev +// + +#include + +#include "AliPID.h" +#include "AliPIDResponse.h" +#include "AliRsnCutProton2010PP.h" + +ClassImp(AliRsnCutProton2010PP) + +//__________________________________________________________________________________________________ +AliRsnCutProton2010PP::AliRsnCutProton2010PP(const char *name) : + AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0), + fCutQuality(Form("%sQuality", name)) +{ +// +// Constructor +// Initialize the contained cuts and sets defaults +// + + // track quality + //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE); + //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE); + //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE); + 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); +} + +//__________________________________________________________________________________________________ +Bool_t AliRsnCutProton2010PP::IsSelected(TObject *obj) +{ +// +// Global check +// + + // 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)) + return kTRUE; + else { + //SetRangeD(0.0, 3.0); + fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kProton)); + return OkRangeD(); + } +} diff --git a/PWG2/RESONANCES/AliRsnCutProton2010PP.h b/PWG2/RESONANCES/AliRsnCutProton2010PP.h new file mode 100644 index 00000000000..d91ab4a1bc7 --- /dev/null +++ b/PWG2/RESONANCES/AliRsnCutProton2010PP.h @@ -0,0 +1,55 @@ +#ifndef ALIRSNCUTPROTON2010PP_H +#define ALIRSNCUTPROTON2010PP_H + +// +// All cuts for single Protons in phi analysis 2010, +// based on quality and PID using the TPC and TOF +// detectors, using default definitions for both +// kinds of cuts, for ESD and AOD +// Author: Serguey Kiselev +// + +#include "AliVTrack.h" +#include "AliRsnCut.h" +#include "AliRsnCutTrackQuality.h" + +class AliRsnCutProton2010PP : public AliRsnCut { + +public: + + AliRsnCutProton2010PP(const char *name = ""); + virtual ~AliRsnCutProton2010PP(); + + virtual Bool_t IsSelected(TObject *obj); + + AliRsnCutTrackQuality *CutQuality() {return &fCutQuality;} + +private: + + Bool_t MatchTOF(const AliVTrack *vtrack); + + AliRsnCutTrackQuality fCutQuality; // track quality cut + + ClassDef(AliRsnCutProton2010PP,1) + +}; + +//__________________________________________________________________________________________________ +inline Bool_t AliRsnCutProton2010PP::MatchTOF(const AliVTrack *vtrack) +{ +// +// Checks if the track has matched the TOF detector +// + + if (!vtrack) { + AliWarning("NULL argument: impossible to check status"); + return kFALSE; + } + + Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0); + Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0); + + return (isTOFout && isTIME); +} + +#endif -- 2.43.0