Coverity fix
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutPIDITS.h
CommitLineData
659ef4f0 1//
2// *** Class AliRsnCutPIDITS ***
3//
4// This class implements all cuts which have to be used for the 2010 runs
5// for phi and generic resonance analysis.
6// It contains an AliESDtrackCuts object for track quality selection
7// and some criteria for particle identification with ITS, ITS and TOF.
8//
9// authors: Martin Vala (martin.vala@cern.ch)
10// Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
11//
12
13#ifndef ALIRSNCUTPIDITS_H
14#define ALIRSNCUTPIDITS_H
15
16#include "AliPID.h"
80e49c8b 17
18#include "AliESDtrack.h"
659ef4f0 19#include "AliESDpid.h"
20#include "AliAODpidUtil.h"
80e49c8b 21
659ef4f0 22#include "AliRsnCut.h"
23
b63357a0 24class AliESDtrackCuts;
25class AliAODpidUtil;
26class AliRsnDaughter;
27
2a1c7696 28class AliRsnCutPIDITS : public AliRsnCut {
29public:
30
31 AliRsnCutPIDITS(const char *name = "cutITS",
32 EPARTYPE ref = AliPID::kKaon,
33 Double_t nSigmaMin = -3.,
34 Double_t nSigmaMax = 3.,
35 Bool_t rejectOutside = kTRUE);
36
37 AliRsnCutPIDITS(const AliRsnCutPIDITS& copy);
38 AliRsnCutPIDITS& operator=(const AliRsnCutPIDITS& copy);
39 virtual ~AliRsnCutPIDITS() { }
40
c865cb1d 41 AliESDpid* ESDpid() {return fESDpid;}
42 AliAODpidUtil* AODpid() {return fAODpid;}
2a1c7696 43
c865cb1d 44 void SetMC(Bool_t mc = kTRUE) {fIsMC = mc;}
2a1c7696 45 void SetRejectOutside(Bool_t yn = kTRUE) {fRejectOutside = yn;}
46 void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;}
47 void SetNSigmaRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max;}
48 void SetRefType(EPARTYPE type) {fRefType = type;}
49
b63357a0 50 Bool_t IsTPC(const AliVTrack *vtrack);
51 Bool_t IsSA(const AliVTrack *vtrack);
2a1c7696 52 virtual Bool_t IsSelected(TObject *object);
53 virtual void Print(const Option_t *option = "") const;
54
55private:
56
c865cb1d 57 Bool_t fIsMC; // needed to initialize the pid object
58 Bool_t fRejectOutside; // choose if tracks outside momentum range are rejected or not
59 Double_t fMomMin; // min p in range where this cut is checked
60 Double_t fMomMax; // max p in range where this cut is checked
61 EPARTYPE fRefType; // particle type for which PID is checked
62 AliESDpid *fESDpid; //! ESD PID object
63 AliAODpidUtil *fAODpid; //! AOD PID object
2a1c7696 64
65 ClassDef(AliRsnCutPIDITS, 1)
659ef4f0 66};
67
b63357a0 68inline Bool_t AliRsnCutPIDITS::IsTPC(const AliVTrack *vtrack)
659ef4f0 69{
70//
71// Checks if the track has the status flags required for a global track
72//
73
2a1c7696 74 if (!vtrack) {
75 AliWarning("NULL argument: impossible to check status");
76 return kFALSE;
77 }
78
c865cb1d 79 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
2a1c7696 80
c865cb1d 81 return (isTPCin);
659ef4f0 82}
83
b63357a0 84inline Bool_t AliRsnCutPIDITS::IsSA(const AliVTrack *vtrack)
659ef4f0 85{
86//
87// Checks if the track has the status flags required for an ITS standalone track
88//
89
2a1c7696 90 if (!vtrack) {
91 AliWarning("NULL argument: impossible to check status");
92 return kFALSE;
93 }
94
95 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
96 Bool_t isITSrefit = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
97 Bool_t isITSpureSA = ((vtrack->GetStatus() & AliESDtrack::kITSpureSA) != 0);
98 Bool_t isITSpid = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
99
100 return ((!isTPCin) && isITSrefit && (!isITSpureSA) && isITSpid);
101
102 return kTRUE;
659ef4f0 103}
104
105#endif