]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - PWG2/RESONANCES/AliRsnCutPIDNSigma.h
Some bug fixes, removal of some duplicates and clarified the logic of some pieces...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPIDNSigma.h
... / ...
CommitLineData
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
12class AliVTrack;
13class AliPIDResponse;
14
15class AliRsnCutPIDNSigma : public AliRsnCut {
16public:
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
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
35 Bool_t IsITS(AliVTrack *vtrack);
36 Bool_t IsTPC(AliVTrack *vtrack);
37 Bool_t IsTOF(AliVTrack *vtrack);
38
39 virtual Bool_t IsSelected(TObject *object);
40 virtual void Print(const Option_t *option = "") const;
41
42private:
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)
48 Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut?
49
50 ClassDef(AliRsnCutPIDNSigma, 1)
51};
52
53inline Bool_t AliRsnCutPIDNSigma::IsITS(AliVTrack *vtrack)
54{
55//
56// Checks if the track has the status flags required for an ITS standalone track
57//
58
59 if ((vtrack->GetStatus() & AliESDtrack::kITSin) == 0) return kFALSE;
60 if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
61
62 return kTRUE;
63}
64
65inline Bool_t AliRsnCutPIDNSigma::IsTPC(AliVTrack *vtrack)
66{
67//
68// Checks if the track has the status flags required for a TPC track
69//
70
71 if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
72
73 return kTRUE;
74}
75
76inline Bool_t AliRsnCutPIDNSigma::IsTOF(AliVTrack *vtrack)
77{
78//
79// Checks if the track has the status flags required for an ITS standalone track
80//
81
82 if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
83 if ((vtrack->GetStatus() & AliESDtrack::kTIME) == 0) return kFALSE;
84
85 return kTRUE;
86}
87
88#endif