]>
Commit | Line | Data |
---|---|---|
c865cb1d | 1 | #ifndef ALIRSNCUTPIDNSIGMA_H |
2 | #define ALIRSNCUTPIDNSIGMA_H | |
3 | ||
4 | // | |
5 | // Class for generalized n-sigma PID cuts with detectors | |
6 | // | |
7 | ||
8 | #include "AliPID.h" | |
9 | ||
10 | #include "AliRsnCut.h" | |
11 | ||
f34f960b | 12 | class AliVTrack; |
c865cb1d | 13 | class AliPIDResponse; |
14 | ||
15 | class AliRsnCutPIDNSigma : public AliRsnCut { | |
16 | public: | |
17 | ||
18 | enum EDetector { | |
19 | kITS, | |
20 | kTPC, | |
21 | kTOF, | |
22 | kDetectors | |
23 | }; | |
24 | ||
25 | AliRsnCutPIDNSigma(const char *name = "cutPIDNsigma", AliPID::EParticleType species = AliPID::kUnknown, EDetector det = kDetectors, Double_t nsigma = 3.0); | |
26 | AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy); | |
27 | AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy); | |
28 | virtual ~AliRsnCutPIDNSigma() { } | |
29 | ||
c865cb1d | 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;} | |
34 | ||
f34f960b | 35 | Bool_t IsITS(AliVTrack *vtrack); |
36 | Bool_t IsTPC(AliVTrack *vtrack); | |
37 | Bool_t IsTOF(AliVTrack *vtrack); | |
c865cb1d | 38 | |
39 | virtual Bool_t IsSelected(TObject *object); | |
40 | virtual void Print(const Option_t *option = "") const; | |
41 | ||
42 | private: | |
43 | ||
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) | |
c865cb1d | 48 | Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut? |
49 | ||
50 | ClassDef(AliRsnCutPIDNSigma, 1) | |
51 | }; | |
52 | ||
f34f960b | 53 | inline Bool_t AliRsnCutPIDNSigma::IsITS(AliVTrack *vtrack) |
c865cb1d | 54 | { |
55 | // | |
56 | // Checks if the track has the status flags required for an ITS standalone track | |
57 | // | |
58 | ||
f34f960b | 59 | if ((vtrack->GetStatus() & AliESDtrack::kITSin) == 0) return kFALSE; |
60 | if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE; | |
c865cb1d | 61 | |
f34f960b | 62 | return kTRUE; |
c865cb1d | 63 | } |
64 | ||
f34f960b | 65 | inline Bool_t AliRsnCutPIDNSigma::IsTPC(AliVTrack *vtrack) |
c865cb1d | 66 | { |
67 | // | |
68 | // Checks if the track has the status flags required for a TPC track | |
69 | // | |
70 | ||
f34f960b | 71 | if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE; |
72 | ||
73 | return kTRUE; | |
c865cb1d | 74 | } |
75 | ||
f34f960b | 76 | inline Bool_t AliRsnCutPIDNSigma::IsTOF(AliVTrack *vtrack) |
c865cb1d | 77 | { |
78 | // | |
79 | // Checks if the track has the status flags required for an ITS standalone track | |
80 | // | |
81 | ||
f34f960b | 82 | if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE; |
83 | if ((vtrack->GetStatus() & AliESDtrack::kTIME) == 0) return kFALSE; | |
c865cb1d | 84 | |
f34f960b | 85 | return kTRUE; |
c865cb1d | 86 | } |
87 | ||
88 | #endif |