]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnCutPIDNSigma.h
Fixed all fixable coding conventions violations
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPIDNSigma.h
CommitLineData
c865cb1d 1#ifndef ALIRSNCUTPIDNSIGMA_H
2#define ALIRSNCUTPIDNSIGMA_H
3
4//
b63357a0 5// Class for generalized n-sigma PID cuts with detectors.
6// Allows to choose the detector to check and define a momentum range
7// in order to permit different cuts in different ranges.
c865cb1d 8//
9
10#include "AliPID.h"
11
12#include "AliRsnCut.h"
13
f34f960b 14class AliVTrack;
c865cb1d 15class AliPIDResponse;
16
17class AliRsnCutPIDNSigma : public AliRsnCut {
18public:
19
20 enum EDetector {
21 kITS,
22 kTPC,
23 kTOF,
24 kDetectors
25 };
26
27 AliRsnCutPIDNSigma(const char *name = "cutPIDNsigma", AliPID::EParticleType species = AliPID::kUnknown, EDetector det = kDetectors, Double_t nsigma = 3.0);
28 AliRsnCutPIDNSigma(const AliRsnCutPIDNSigma& copy);
29 AliRsnCutPIDNSigma& operator=(const AliRsnCutPIDNSigma& copy);
30 virtual ~AliRsnCutPIDNSigma() { }
31
c865cb1d 32 void SetRejectUnmatched(Bool_t yn = kTRUE) {fRejectUnmatched = yn;}
33 void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;}
34 void SetNSigmaRange(Double_t min, Double_t max) {AliRsnCut::SetRangeD(min, max);}
35 void SetSpecies(AliPID::EParticleType type) {fSpecies = type;}
36
b63357a0 37 Bool_t IsITS(const AliVTrack *vtrack) const;
38 Bool_t IsTPC(const AliVTrack *vtrack) const;
39 Bool_t IsTOF(const AliVTrack *vtrack) const;
c865cb1d 40
41 virtual Bool_t IsSelected(TObject *object);
42 virtual void Print(const Option_t *option = "") const;
43
44private:
45
46 AliPID::EParticleType fSpecies; // particle species
47 EDetector fDetector; // detector used for PID
48 Double_t fMomMin; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
49 Double_t fMomMax; // momentum range (for ITS and TOF it is vertex momentum, for TPC it is inner wall)
c865cb1d 50 Bool_t fRejectUnmatched; // tracks not matched to this detector do pass the cut?
51
52 ClassDef(AliRsnCutPIDNSigma, 1)
53};
54
b63357a0 55inline Bool_t AliRsnCutPIDNSigma::IsITS(const AliVTrack *vtrack) const
c865cb1d 56{
57//
58// Checks if the track has the status flags required for an ITS standalone track
59//
60
f34f960b 61 if ((vtrack->GetStatus() & AliESDtrack::kITSin) == 0) return kFALSE;
62 if ((vtrack->GetStatus() & AliESDtrack::kITSpid) == 0) return kFALSE;
c865cb1d 63
f34f960b 64 return kTRUE;
c865cb1d 65}
66
b63357a0 67inline Bool_t AliRsnCutPIDNSigma::IsTPC(const AliVTrack *vtrack) const
c865cb1d 68{
69//
70// Checks if the track has the status flags required for a TPC track
71//
72
f34f960b 73 if ((vtrack->GetStatus() & AliESDtrack::kTPCin) == 0) return kFALSE;
74
75 return kTRUE;
c865cb1d 76}
77
b63357a0 78inline Bool_t AliRsnCutPIDNSigma::IsTOF(const AliVTrack *vtrack) const
c865cb1d 79{
80//
81// Checks if the track has the status flags required for an ITS standalone track
82//
83
f34f960b 84 if ((vtrack->GetStatus() & AliESDtrack::kTOFout) == 0) return kFALSE;
85 if ((vtrack->GetStatus() & AliESDtrack::kTIME) == 0) return kFALSE;
c865cb1d 86
f34f960b 87 return kTRUE;
c865cb1d 88}
89
90#endif