Ad-hoc implementation of cuts for pions/kaons/protons for 2010 analysis
[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
c865cb1d 40 AliESDpid* ESDpid() {return fESDpid;}
41 AliAODpidUtil* AODpid() {return fAODpid;}
2a1c7696 42
c865cb1d 43 void SetMC(Bool_t mc = kTRUE) {fIsMC = mc;}
2a1c7696 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
c865cb1d 56 Bool_t fIsMC; // needed to initialize the pid object
57 Bool_t fRejectOutside; // choose if tracks outside momentum range are rejected or not
58 Double_t fMomMin; // min p in range where this cut is checked
59 Double_t fMomMax; // max p in range where this cut is checked
60 EPARTYPE fRefType; // particle type for which PID is checked
61 AliESDpid *fESDpid; //! ESD PID object
62 AliAODpidUtil *fAODpid; //! AOD PID object
2a1c7696 63
64 ClassDef(AliRsnCutPIDITS, 1)
659ef4f0 65};
66
80e49c8b 67inline Bool_t AliRsnCutPIDITS::IsTPC(AliVTrack *vtrack)
659ef4f0 68{
69//
70// Checks if the track has the status flags required for a global track
71//
72
2a1c7696 73 if (!vtrack) {
74 AliWarning("NULL argument: impossible to check status");
75 return kFALSE;
76 }
77
c865cb1d 78 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
2a1c7696 79
c865cb1d 80 return (isTPCin);
659ef4f0 81}
82
80e49c8b 83inline Bool_t AliRsnCutPIDITS::IsSA(AliVTrack *vtrack)
659ef4f0 84{
85//
86// Checks if the track has the status flags required for an ITS standalone track
87//
88
2a1c7696 89 if (!vtrack) {
90 AliWarning("NULL argument: impossible to check status");
91 return kFALSE;
92 }
93
94 Bool_t isTPCin = ((vtrack->GetStatus() & AliESDtrack::kTPCin) != 0);
95 Bool_t isITSrefit = ((vtrack->GetStatus() & AliESDtrack::kITSrefit) != 0);
96 Bool_t isITSpureSA = ((vtrack->GetStatus() & AliESDtrack::kITSpureSA) != 0);
97 Bool_t isITSpid = ((vtrack->GetStatus() & AliESDtrack::kITSpid) != 0);
98
99 return ((!isTPCin) && isITSrefit && (!isITSpureSA) && isITSpid);
100
101 return kTRUE;
659ef4f0 102}
103
104#endif