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