Improved functionality of AliRsnDaughterDef::MatchesDaughter()
[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"
19#include "AliESDtrackCuts.h"
659ef4f0 20#include "AliESDpid.h"
80e49c8b 21
659ef4f0 22#include "AliAODpidUtil.h"
80e49c8b 23
24#include "AliRsnDaughter.h"
659ef4f0 25#include "AliRsnCut.h"
26
2a1c7696 27class AliRsnCutPIDITS : public AliRsnCut {
28public:
29
30 AliRsnCutPIDITS(const char *name = "cutITS",
31 EPARTYPE ref = AliPID::kKaon,
32 Double_t nSigmaMin = -3.,
33 Double_t nSigmaMax = 3.,
34 Bool_t rejectOutside = kTRUE);
35
36 AliRsnCutPIDITS(const AliRsnCutPIDITS& copy);
37 AliRsnCutPIDITS& operator=(const AliRsnCutPIDITS& copy);
38 virtual ~AliRsnCutPIDITS() { }
39
40 AliESDpid* ESDpid() {return &fESDpid;}
41 AliAODpidUtil* AODpid() {return &fAODpid;}
42
43 void SetMC(Bool_t mc = kTRUE);
44 void SetRejectOutside(Bool_t yn = kTRUE) {fRejectOutside = yn;}
45 void SetMomentumRange(Double_t min, Double_t max) {fMomMin = min; fMomMax = max;}
46 void SetNSigmaRange(Double_t min, Double_t max) {fMinD = min; fMaxD = max;}
47 void SetRefType(EPARTYPE type) {fRefType = type;}
48
49 Bool_t IsTPC(AliVTrack *vtrack);
50 Bool_t IsSA(AliVTrack *vtrack);
51 virtual Bool_t IsSelected(TObject *object);
52 virtual void Print(const Option_t *option = "") const;
53
54private:
55
56 void Initialize();
57
58 Bool_t fInitialized; // a mono-usage flag which initializes the ESD pid object
59 Bool_t fRejectOutside; // choose if tracks outside momentum range are rejected or not
60 Double_t fMomMin; // min p in range where this cut is checked
61 Double_t fMomMax; // max p in range where this cut is checked
62 EPARTYPE fRefType; // particle type for which PID is checked
63 AliESDpid fESDpid; // ESD PID object
64 AliAODpidUtil fAODpid; // AOD PID object
65
66 ClassDef(AliRsnCutPIDITS, 1)
659ef4f0 67};
68
80e49c8b 69inline Bool_t AliRsnCutPIDITS::IsTPC(AliVTrack *vtrack)
659ef4f0 70{
71//
72// Checks if the track has the status flags required for a global track
73//
74
2a1c7696 75 if (!vtrack) {
76 AliWarning("NULL argument: impossible to check status");
77 return kFALSE;
78 }
79
80 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
81 Bool_t isITSrefit = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
82 Bool_t isITSpid = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
83
84 return (isTPCin && isITSrefit && isITSpid);
85
86 return kTRUE;
659ef4f0 87}
88
80e49c8b 89inline Bool_t AliRsnCutPIDITS::IsSA(AliVTrack *vtrack)
659ef4f0 90{
91//
92// Checks if the track has the status flags required for an ITS standalone track
93//
94
2a1c7696 95 if (!vtrack) {
96 AliWarning("NULL argument: impossible to check status");
97 return kFALSE;
98 }
99
100 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
101 Bool_t isITSrefit = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
102 Bool_t isITSpureSA = ((vtrack->GetStatus() & AliESDtrack::kITSpureSA) != 0);
103 Bool_t isITSpid = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
104
105 return ((!isTPCin) && isITSrefit && (!isITSpureSA) && isITSpid);
106
107 return kTRUE;
659ef4f0 108}
109
110#endif