Added AliRsnCutEventUtils class: interface to /Users/bellini/alisoft/aliroot/last_tru...
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutKaonForPhi2010PP.cxx
CommitLineData
110620ce 1//
4e4fb2f6 2// This cut implements all the checks done to accept a track as a Kaon
61f275d1 3// for the pp analysis using 2010 runs.
4e4fb2f6 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//__________________________________________________________________________________________________
61f275d1 67AliRsnCutKaonForPhi2010PP &AliRsnCutKaonForPhi2010PP::operator=(const AliRsnCutKaonForPhi2010PP &copy)
de767d44 68{
69//
70// Assignment operator
71//
72
73 AliRsnCut::operator=(copy);
e6f3a909 74 if (this == &copy)
61f275d1 75 return *this;
de767d44 76 fNSigmaTPCLow = copy.fNSigmaTPCLow;
77 fNSigmaTPCHigh = copy.fNSigmaTPCHigh;
78 fLimitTPC = copy.fLimitTPC;
79 fNSigmaTOF = copy.fNSigmaTOF;
80 fMyPID = copy.fMyPID;
81 fCutQuality = copy.fCutQuality;
61f275d1 82
de767d44 83 return *this;
84}
85
86//__________________________________________________________________________________________________
87void AliRsnCutKaonForPhi2010PP::InitMyPID(Bool_t isMC, Bool_t isESD)
88{
89//
90// Initialize manual PID object
91//
92
61f275d1 93 if (isESD)
de767d44 94 fMyPID = new AliESDpid(isMC);
95 else
96 fMyPID = new AliAODpidUtil(isMC);
97}
98
99//__________________________________________________________________________________________________
110620ce 100Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
101{
102//
103// Global check
104//
105
106 // coherence check
107 if (!TargetOK(obj)) return kFALSE;
61f275d1 108
110620ce 109 // check track
61f275d1 110 AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef());
a2455d2a 111 if (!track) return kFALSE;
61f275d1 112
110620ce 113 // check flags
114 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
115 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
116 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
61f275d1 117
110620ce 118 // quality
119 if (!fCutQuality.IsSelected(obj)) return kFALSE;
61f275d1 120
110620ce 121 // check initialization of PID object
122 AliPIDResponse *pid = fEvent->GetPIDResponse();
123 if (!pid) {
124 AliFatal("NULL PID response");
125 return kFALSE;
126 }
61f275d1 127
110620ce 128 // PID TPC :
129 // depends on momentum
de767d44 130 // and if local PID object is initialized, it is used instead of that got from manager
c31027eb 131 Double_t mom = track->GetTPCmomentum();
132 mom = TMath::Abs(mom);
61f275d1 133 if (mom < fLimitTPC)
110620ce 134 SetRangeD(0.0, fNSigmaTPCLow);
135 else
136 SetRangeD(0.0, fNSigmaTPCHigh);
61f275d1 137 if (fMyPID)
de767d44 138 fCutValueD = TMath::Abs(fMyPID->NumberOfSigmasTPC(track, AliPID::kKaon));
139 else
140 fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
110620ce 141 if (!OkRangeD()) return kFALSE;
61f275d1 142
110620ce 143 // if TOF is not matched, end here
144 // otherwise check TOF
61f275d1 145 if (!MatchTOF(track))
110620ce 146 return kTRUE;
147 else {
148 SetRangeD(0.0, fNSigmaTOF);
149 fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
150 return OkRangeD();
151 }
152}