example macros to run on proof
[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"
12#include "AliRsnCutKaonForPhi2010PP.h"
13
14ClassImp(AliRsnCutKaonForPhi2010PP)
15
16//__________________________________________________________________________________________________
17AliRsnCutKaonForPhi2010PP::AliRsnCutKaonForPhi2010PP(const char *name) :
18 AliRsnCut(name, AliRsnTarget::kDaughter, -3.0, 3.0),
19 fNSigmaTPCLow(5.0),
20 fNSigmaTPCHigh(3.0),
21 fLimitTPC(0.350),
22 fNSigmaTOF(3.0),
23 fCutQuality(Form("%sQuality", name))
24{
25//
26// Constructor
27// Initialize the contained cuts and sets defaults
28//
29
30 // track quality
31 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCin , kTRUE);
32 //fCutQuality.AddStatusFlag(AliESDtrack::kTPCrefit, kTRUE);
33 //fCutQuality.AddStatusFlag(AliESDtrack::kITSrefit, kTRUE);
34 fCutQuality.SetPtRange(0.15, 1E+20);
35 fCutQuality.SetEtaRange(-0.8, 0.8);
36 fCutQuality.SetDCARPtFormula("0.0182+0.0350/pt^1.01");
37 fCutQuality.SetDCAZmax(2.0);
38 fCutQuality.SetSPDminNClusters(1);
39 fCutQuality.SetITSminNClusters(0);
40 fCutQuality.SetITSmaxChi2(1E+20);
41 fCutQuality.SetTPCminNClusters(70);
42 fCutQuality.SetTPCmaxChi2(4.0);
43 fCutQuality.SetRejectKinkDaughters();
44 fCutQuality.SetAODTestFilterBit(5);
45}
46
47//__________________________________________________________________________________________________
48Bool_t AliRsnCutKaonForPhi2010PP::IsSelected(TObject *obj)
49{
50//
51// Global check
52//
53
54 // coherence check
55 if (!TargetOK(obj)) return kFALSE;
56
57 // check track
58 AliVTrack *track = fDaughter->Ref2Vtrack();
59 if (!track) {
60 if (!fDaughter->GetRef()) AliWarning("NULL ref");
61 return kFALSE;
62 }
63
64 // check flags
65 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
66 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
67 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
68
69 // quality
70 if (!fCutQuality.IsSelected(obj)) return kFALSE;
71
72 // check initialization of PID object
73 AliPIDResponse *pid = fEvent->GetPIDResponse();
74 if (!pid) {
75 AliFatal("NULL PID response");
76 return kFALSE;
77 }
78
79 // PID TPC :
80 // depends on momentum
81 if (track->GetTPCmomentum() < fLimitTPC)
82 SetRangeD(0.0, fNSigmaTPCLow);
83 else
84 SetRangeD(0.0, fNSigmaTPCHigh);
85 fCutValueD = TMath::Abs(pid->NumberOfSigmasTPC(track, AliPID::kKaon));
86 if (!OkRangeD()) return kFALSE;
87
88 // if TOF is not matched, end here
89 // otherwise check TOF
90 if (!MatchTOF(track))
91 return kTRUE;
92 else {
93 SetRangeD(0.0, fNSigmaTOF);
94 fCutValueD = TMath::Abs(pid->NumberOfSigmasTOF(track, AliPID::kKaon));
95 return OkRangeD();
96 }
97}