]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/AliRsnCutDaughterD0.cxx
Some updates + 1 bug fix (thanks to Massimo):
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnCutDaughterD0.cxx
CommitLineData
3e6c5c16 1//
2// All cuts for single track in D0 analysis,
3// based on track quality and particle identification
4// with TPC and TOF.
5// Author: Massimo Venaruzzo
6//
7//
8
9#include <Riostream.h>
10
11#include "AliPID.h"
12#include "AliPIDResponse.h"
13#include "AliRsnCutDaughterD0.h"
14
15ClassImp(AliRsnCutDaughterD0)
16
17//__________________________________________________________________________________________________
18AliRsnCutDaughterD0::AliRsnCutDaughterD0(const char *name, AliPID::EParticleType pid) :
19AliRsnCut(name, AliRsnTarget::kDaughter),
20 fNoPID(kFALSE),
57b34356 21 //fIsCheckOnMother(kFALSE),
3e6c5c16 22 fPID(pid),
23 fCutQuality(Form("%sQuality", name)),
24 fPionTPCPIDCut(3.0),
25 fKaonTPCPIDCut(3.0),
26 fPionTOFPIDCut(3.0),
8ed7b07f 27 fKaonTOFPIDCut(3.0),
28 fPtDepPIDCut(kFALSE)
3e6c5c16 29{
30 //
31 // Constructor
57b34356 32 //
3e6c5c16 33 //
3e6c5c16 34 fCutQuality.SetPtRange(0.15, 1E+20);
35 fCutQuality.SetEtaRange(-0.8, 0.8);
57b34356 36 fCutQuality.SetDCARPtFormula("");
3e6c5c16 37 fCutQuality.SetDCARmin(0.0);
38 fCutQuality.SetDCAZmax(2.0);
57b34356 39 fCutQuality.SetSPDminNClusters(0);
3e6c5c16 40 fCutQuality.SetITSminNClusters(0);
41 fCutQuality.SetITSmaxChi2(1E+20);
57b34356 42 fCutQuality.SetTPCminNClusters(0);
43 fCutQuality.SetMinNCrossedRowsTPC(0,kTRUE);
44 fCutQuality.SetMinNCrossedRowsOverFindableClsTPC(0.00,kTRUE);
45 fCutQuality.SetTPCmaxChi2(1E20);
3e6c5c16 46 fCutQuality.SetRejectKinkDaughters();
57b34356 47 fCutQuality.SetAODTestFilterBit(-1);
3e6c5c16 48}
49
50//__________________________________________________________________________________________________
51Bool_t AliRsnCutDaughterD0::IsSelected(TObject *obj)
52{
53 //
54 // Global check
55 //
56
57 // coherence check
58 if (!TargetOK(obj)) return kFALSE;
57b34356 59
60 // if this class is used to check the mothers in the acceptance, accept (will be applied only selection on min pt and eta)
61 //if (fIsCheckOnMother) return kTRUE;
3e6c5c16 62
63 // check track
64 AliVTrack *track = dynamic_cast<AliVTrack *>(fDaughter->GetRef());
65 if (!track) return kFALSE;
66
67 AliDebugClass(2, "Checking status...");
68 // check flags
69 if ((track->GetStatus() & AliESDtrack::kTPCin ) == 0) return kFALSE;
70 if ((track->GetStatus() & AliESDtrack::kTPCrefit) == 0) return kFALSE;
71 if ((track->GetStatus() & AliESDtrack::kITSrefit) == 0) return kFALSE;
72 AliDebugClass(2, "...passed");
73
74 // quality
75 AliDebugClass(2, "Checking quality cuts...");
76 if (!fCutQuality.IsSelected(obj)) return kFALSE;
77 AliDebugClass(2, "...passed");
78
79 // if no PID is required, accept
80 if (fNoPID) return kTRUE;
81
57b34356 82
3e6c5c16 83 // check initialization of PID object
84 AliPIDResponse *pid = fEvent->GetPIDResponse();
85 if (!pid) {
86 AliFatal("NULL PID response");
87 return kFALSE;
88 }
89
57b34356 90 AliDebugClass(2, "Checking TPC and TOF Matching...");
91 // check if TPC and TOF are matched
3e6c5c16 92 // and computes all values used in the PID cut
57b34356 93 Bool_t isTPC = MatchTPC(track);
3e6c5c16 94 Bool_t isTOF = MatchTOF(track);
95 AliDebugClass(2, "...passed");
96
670857a6 97 Double_t pTPC = track->GetTPCmomentum();
98 Double_t p = track->P();
3e6c5c16 99 Double_t nsTPC = TMath::Abs(pid->NumberOfSigmasTPC(track, fPID));
100 Double_t nsTOF = isTOF ? TMath::Abs(pid->NumberOfSigmasTOF(track, fPID)) : 1E20;
101 Double_t maxTPC = 1E20;
102 Double_t maxTOF = 1E20;
103 AliDebugClass(2, "Checking PID...");
104
670857a6 105 if(!fPtDepPIDCut){
106 // applies the cut differently depending on the PID and the momentum
57b34356 107 if (isTPC && isTOF) {
670857a6 108 if (fPID == AliPID::kPion) {maxTPC = fPionTPCPIDCut; maxTOF = fPionTOFPIDCut;}
109 if (fPID == AliPID::kKaon) {maxTPC = fKaonTPCPIDCut; maxTOF = fKaonTOFPIDCut;}
110 return (nsTPC <= maxTPC && nsTOF <= maxTOF);
57b34356 111 } else if (isTPC){
670857a6 112 if (fPID == AliPID::kPion) maxTPC = fPionTPCPIDCut;
113 if (fPID == AliPID::kKaon) maxTPC = fKaonTPCPIDCut;
114 return (nsTPC <= maxTPC);
115 }
57b34356 116 else return kTRUE;
3e6c5c16 117 } else {
670857a6 118 // applies the cut differently depending on the PID and the momentum
57b34356 119 if (isTPC && isTOF) {
670857a6 120 // TPC: 5sigma cut for all
121 if (nsTPC > 5.0) return kFALSE;
122 // TOF: 3sigma below 1.5 GeV, 2sigma above
123 if (p < 1.5) maxTOF = 3.0; else maxTOF = 2.0;
124 return (nsTOF <= maxTOF);
57b34356 125 } else if(isTPC){
670857a6 126 // TPC:
127 // all below 350 MeV: 5sigma
128 // all between 350 and 500 MeV: 3sigma
129 // pions above 500 MeV: 2sigma
130 // kaons between 500 and 700 MeV: 2sigma
131 // kaons above 700 MeV: rejected
132 if (pTPC <= 0.35)
133 maxTPC = 5.0;
134 else if (pTPC > 0.35 && pTPC <= 0.5)
135 maxTPC = 3.0;
136 else {
137 if (fPID == AliPID::kPion)
138 maxTPC = 2.0;
139 else if (fPID == AliPID::kKaon) {
140 if (pTPC <= 0.7)
141 maxTPC = 2.0;
142 else
143 return kFALSE;
144 }
145 }
146 return (nsTPC <= maxTPC);
147 }
57b34356 148 else return kTRUE;
670857a6 149 }
3e6c5c16 150
151 AliDebugClass(2, "...passed");
152 // if we reach this point, all checks were successful
153 AliDebugClass(2, "Good Pion/Kaon Candidate Found!!");
154}