]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCutPIDNSigma.h
Added a temptative task for monitors
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPIDNSigma.h
CommitLineData
c865cb1d 1#ifndef ALIRSNCUTPIDNSIGMA_H
2#define ALIRSNCUTPIDNSIGMA_H
3
4//
64129b35 5// Class for n-sigma PID cuts.
6// ---
7// Requires:
c865cb1d 8//
64129b35 9// 1) the used detector, chosen from an enumeration
10// 2) the reference charged particle species, chosen from AliPID enumeration
11// 3) a momentum range: outside it, the cut is never passed
12//
13
14#include <TMath.h>
c865cb1d 15
16#include "AliPID.h"
17
18#include "AliRsnCut.h"
19
f34f960b 20class AliVTrack;
c865cb1d 21class AliPIDResponse;
22
23class AliRsnCutPIDNSigma : public AliRsnCut {
24public:
25
26 enum EDetector {
27 kITS,
28 kTPC,
29 kTOF,
30 kDetectors
31 };
32
64129b35 33 AliRsnCutPIDNSigma();
34 AliRsnCutPIDNSigma(const char *name, AliPID::EParticleType species, EDetector det, Double_t nsigma);
c865cb1d 35 AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy);
36 AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy);
37 virtual ~AliRsnCutPIDNSigma() { }
38
c865cb1d 39 void SetSpecies(AliPID::EParticleType type) {fSpecies = type;}
64129b35 40 void SetDetector(EDetector det) {fDetector = det;}
41 void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;}
42 void SetNSigma(Double_t nsigma) {fNSigma = nsigma;}
43 void SetMomentumRange(Double_t min, Double_t max);
c865cb1d 44
b63357a0 45 Bool_t IsITS(const AliVTrack *vtrack) const;
46 Bool_t IsTPC(const AliVTrack *vtrack) const;
47 Bool_t IsTOF(const AliVTrack *vtrack) const;
c865cb1d 48
49 virtual Bool_t IsSelected(TObject *object);
50 virtual void Print(const Option_t *option = "") const;
51
52private:
53
54 AliPID::EParticleType fSpecies; // particle species
55 EDetector fDetector; // detector used for PID
c865cb1d 56 Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut?
64129b35 57 Double_t fMomMin; // momentum range (ITS/TOF: vertex momentum, TPC: mom at inner wall)
58 Double_t fMomMax; // momentum range (ITS/TOF: vertex momentum, TPC: mom at inner wall)
59 Double_t fNSigma; // nsigma range
c865cb1d 60
61 ClassDef(AliRsnCutPIDNSigma, 1)
62};
63
64129b35 64inline void AliRsnCutPIDNSigma::SetMomentumRange(Double_t min, Double_t max)
65{
66//
67// Assigns the range in total momentum used for check
68// For ITS and TOF, it is used to check momentum at vertex,
69// for TPC it is used to check momentum at TPC inner barrel
70//
71
72 fMomMin = TMath::Min(min, max);
73 fMomMax = TMath::Max(min, max);
74}
75
b63357a0 76inline Bool_t AliRsnCutPIDNSigma::IsITS(const AliVTrack *vtrack) const
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::kITSin) == 0) return kFALSE;
83 if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
c865cb1d 84
f34f960b 85 return kTRUE;
c865cb1d 86}
87
b63357a0 88inline Bool_t AliRsnCutPIDNSigma::IsTPC(const AliVTrack *vtrack) const
c865cb1d 89{
90//
91// Checks if the track has the status flags required for a TPC track
92//
93
f34f960b 94 if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
95
96 return kTRUE;
c865cb1d 97}
98
b63357a0 99inline Bool_t AliRsnCutPIDNSigma::IsTOF(const AliVTrack *vtrack) const
c865cb1d 100{
101//
102// Checks if the track has the status flags required for an ITS standalone track
103//
104
f34f960b 105 if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
106 if ((vtrack->GetStatus() & AliESDtrack::kTIME) == 0) return kFALSE;
c865cb1d 107
f34f960b 108 return kTRUE;
c865cb1d 109}
110
111#endif