Classes for 'mini' subpackage for RSN analysis framework
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnCutKaonForPhi2010.cxx
CommitLineData
2895972e 1//
2// All cuts for single kaons in phi analysis 2010
3//
4
5#include <Riostream.h>
6
7#include "AliPID.h"
8#include "AliPIDResponse.h"
9#include "AliRsnCutKaonForPhi2010.h"
10
11ClassImp(AliRsnCutKaonForPhi2010)
12
13//__________________________________________________________________________________________________
14AliRsnCutKaonForPhi2010::AliRsnCutKaonForPhi2010(const char *name) :
110620ce 15 AliRsnCut(name, AliRsnTarget::kDaughter, 0.0, 3.0),
2895972e 16 fCutQuality(Form("%sQuality", name))
17{
18//
19// Constructor
20// Initialize the contained cuts and sets defaults
21//
22
23 // track quality
24 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE);
25 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
26 //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
27 fCutQuality.SetPtRange(0.15, 1E+20);
28 fCutQuality.SetEtaRange(-0.8, 0.8);
29 fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
30 fCutQuality.SetDCAZmax(2.0);
31 fCutQuality.SetSPDminNClusters(1);
32 fCutQuality.SetITSminNClusters(0);
33 fCutQuality.SetITSmaxChi2(1E+20);
34 fCutQuality.SetTPCminNClusters(70);
35 fCutQuality.SetTPCmaxChi2(4.0);
36 fCutQuality.SetRejectKinkDaughters();
37 fCutQuality.SetAODTestFilterBit(5);
38}
39
40//__________________________________________________________________________________________________
41Bool_t AliRsnCutKaonForPhi2010::IsSelected(TObject *obj)
42{
43//
44// Global check
45//
46
47 // coherence check
48 if (!TargetOK(obj)) return kFALSE;
49
50 // check track
51 AliVTrack *track = fDaughter->Ref2Vtrack();
52 if (!track) {
53 if (!fDaughter->GetRef()) AliWarning("NULL ref");
54 return kFALSE;
55 }
56
57 // check flags
58 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
59 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
60 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
61
62 // quality
63 if (!fCutQuality.IsSelected(obj)) return kFALSE;
64
65 // check initialization of PID object
66 AliPIDResponse *pid = fEvent->GetPIDResponse();
67 if (!pid) {
68 AliFatal("NULL PID response");
69 return kFALSE;
70 }
71
72 // PID ITS :
73 // depends on momentum
74 //SetRangeD(0.0, 4.0);
75 //fCutValueD = TMath::Abs(pid->NumberOfSigmasITS(track, AliPID::kKaon));
76 //if (!OkRangeD()) return kFALSE;
77
78 // PID TPC :
79 // depends on momentum
80 //SetRangeD(0.0, 3.0);
81 //if (track->GetTPCmomentum() < 0.350) SetRangeD(0.0, 5.0);
82 fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
83 if (!OkRangeD()) return kFALSE;
84
85 // if TOF is not matched, end here
86 // otherwise check TOF
87 if (!MatchTOF(track))
88 return kTRUE;
89 else {
90 //SetRangeD(0.0, 3.0);
91 fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
92 return OkRangeD();
93 }
94}