Fix for PAR library
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutKaonForPhi2010PP.cxx
CommitLineData
110620ce 1//
4e4fb2f6 2// This cut implements all the checks done to accept a track as a Kaon
3// for the pp analysis using 2010 runs.
4// It is based on standard cuts on track quality and nsigma cuts
5// with respect to the TPC and TOF signals for the PID.
110620ce 6//
7
8#include <Riostream.h>
9
10#include "AliPID.h"
11#include "AliPIDResponse.h"
de767d44 12#include "AliESDpid.h"
13#include "AliAODpidUtil.h"
14
110620ce 15#include "AliRsnCutKaonForPhi2010PP.h"
16
17ClassImp(AliRsnCutKaonForPhi2010PP)
18
19//__________________________________________________________________________________________________
20AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const char *name) :
21 AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0),
22 fNSigmaTPCLow(5.0),
23 fNSigmaTPCHigh(3.0),
24 fLimitTPC(0.350),
25 fNSigmaTOF(3.0),
de767d44 26 fMyPID(0x0),
110620ce 27 fCutQuality(Form("%sQuality", name))
28{
29//
30// Constructor
31// Initialize the contained cuts and sets defaults
32//
33
34 // track quality
35 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE);
36 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
37 //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
38 fCutQuality.SetPtRange(0.15, 1E+20);
39 fCutQuality.SetEtaRange(-0.8, 0.8);
40 fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
41 fCutQuality.SetDCAZmax(2.0);
42 fCutQuality.SetSPDminNClusters(1);
43 fCutQuality.SetITSminNClusters(0);
44 fCutQuality.SetITSmaxChi2(1E+20);
45 fCutQuality.SetTPCminNClusters(70);
46 fCutQuality.SetTPCmaxChi2(4.0);
47 fCutQuality.SetRejectKinkDaughters();
48 fCutQuality.SetAODTestFilterBit(5);
49}
50
51//__________________________________________________________________________________________________
de767d44 52AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const AliRsnCutKaonForPhi2010PP &copy) :
53 AliRsnCut(copy),
54 fNSigmaTPCLow(copy.fNSigmaTPCLow),
55 fNSigmaTPCHigh(copy.fNSigmaTPCHigh),
56 fLimitTPC(copy.fLimitTPC),
57 fNSigmaTOF(copy.fNSigmaTOF),
58 fMyPID(copy.fMyPID),
59 fCutQuality(copy.fCutQuality)
60{
61//
62// Copy constructor
63//
64}
65
66//__________________________________________________________________________________________________
67AliRsnCutKaonForPhi2010PP& AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutKaonForPhi2010PP &copy)
68{
69//
70// Assignment operator
71//
72
73 AliRsnCut::operator=(copy);
74
75 fNSigmaTPCLow = copy.fNSigmaTPCLow;
76 fNSigmaTPCHigh = copy.fNSigmaTPCHigh;
77 fLimitTPC = copy.fLimitTPC;
78 fNSigmaTOF = copy.fNSigmaTOF;
79 fMyPID = copy.fMyPID;
80 fCutQuality = copy.fCutQuality;
81
82 return *this;
83}
84
85//__________________________________________________________________________________________________
86void AliRsnCutKaonForPhi2010PP::InitMyPID(Bool_t isMC, Bool_t isESD)
87{
88//
89// Initialize manual PID object
90//
91
92 if (isESD)
93 fMyPID = new AliESDpid(isMC);
94 else
95 fMyPID = new AliAODpidUtil(isMC);
96}
97
98//__________________________________________________________________________________________________
110620ce 99Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
100{
101//
102// Global check
103//
104
105 // coherence check
106 if (!TargetOK(obj)) return kFALSE;
107
108 // check track
a2455d2a 109 AliVTrack *track = dynamic_cast<AliVTrack*>(fDaughter->GetRef());
110 if (!track) return kFALSE;
110620ce 111
112 // check flags
113 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
114 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
115 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
116
117 // quality
118 if (!fCutQuality.IsSelected(obj)) return kFALSE;
119
120 // check initialization of PID object
121 AliPIDResponse *pid = fEvent->GetPIDResponse();
122 if (!pid) {
123 AliFatal("NULL PID response");
124 return kFALSE;
125 }
126
127 // PID TPC :
128 // depends on momentum
de767d44 129 // and if local PID object is initialized, it is used instead of that got from manager
c31027eb 130 Double_t mom = track->GetTPCmomentum();
131 mom = TMath::Abs(mom);
a2455d2a 132 if (mom < fLimitTPC)
110620ce 133 SetRangeD(0.0, fNSigmaTPCLow);
134 else
135 SetRangeD(0.0, fNSigmaTPCHigh);
de767d44 136 if (fMyPID)
137 fCutValueD = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon));
138 else
139 fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
110620ce 140 if (!OkRangeD()) return kFALSE;
141
142 // if TOF is not matched, end here
143 // otherwise check TOF
144 if (!MatchTOF(track))
145 return kTRUE;
146 else {
147 SetRangeD(0.0, fNSigmaTOF);
148 fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
149 return OkRangeD();
150 }
151}