1 #ifndef ALIRSNCUTPIDNSIGMA_H
2 #define ALIRSNCUTPIDNSIGMA_H
5 // Class for generalized n-sigma PID cuts with detectors
10 #include "AliRsnCut.h"
14 class AliRsnCutPIDNSigma : public AliRsnCut {
24 AliRsnCutPIDNSigma(const char *name = "cutPIDNsigma", AliPID::EParticleType species = AliPID::kUnknown, EDetector det = kDetectors, Double_t nsigma = 3.0);
25 AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy);
26 AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy);
27 virtual ~AliRsnCutPIDNSigma() { }
29 void SetRejectOutside(Bool_t yn = kTRUE) {fRejectOutside = yn;}
30 void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;}
31 void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;}
32 void SetNSigmaRange(Double_t min, Double_t max) {AliRsnCut::SetRangeD(min, max);}
33 void SetSpecies(AliPID::EParticleType type) {fSpecies = type;}
39 virtual Bool_t IsSelected(TObject *object);
40 virtual void Print(const Option_t *option = "") const;
44 AliPID::EParticleType fSpecies; // particle species
45 EDetector fDetector; // detector used for PID
46 Double_t fMomMin; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
47 Double_t fMomMax; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
48 Bool_t fRejectOutside; // tracks outside momentum range do pass the cut?
49 Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut?
51 ClassDef(AliRsnCutPIDNSigma, 1)
54 inline Bool_t AliRsnCutPIDNSigma::IsITS()
57 // Checks if the track has the status flags required for an ITS standalone track
60 AliVTrack *vtrack = fDaughter->GetRefVtrack();
63 AliWarning("NULL argument: impossible to check status");
67 Bool_t isITSin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
68 Bool_t isITSpid = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
70 return (isITSin && isITSpid);
73 inline Bool_t AliRsnCutPIDNSigma::IsTPC()
76 // Checks if the track has the status flags required for a TPC track
79 AliVTrack *vtrack = fDaughter->GetRefVtrack();
82 AliWarning("NULL argument: impossible to check status");
86 return ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
89 inline Bool_t AliRsnCutPIDNSigma::IsTOF()
92 // Checks if the track has the status flags required for an ITS standalone track
95 AliVTrack *vtrack = fDaughter->GetRefVtrack();
98 AliWarning("NULL argument: impossible to check status");
102 Bool_t isTOFout = ((vtrack->GetStatus() & AliESDtrack::kTOFout) != 0);
103 Bool_t isTIME = ((vtrack->GetStatus() & AliESDtrack::kTIME) != 0);
105 return (isTOFout && isTIME);