Added LHC10h run list for flow analysis (Giacomo)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCutsLctoV0.cxx
CommitLineData
a07ad8e0 1/**************************************************************************
2 * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
27de2dfb 16/* $Id$ */
17
a07ad8e0 18/////////////////////////////////////////////////////////////
19//
20// Class for cuts on AOD reconstructed Lc->pKpi
21//
22/////////////////////////////////////////////////////////////
23
24#include <TDatabasePDG.h>
25#include <Riostream.h>
26
27#include "AliRDHFCutsLctoV0.h"
28#include "AliAODRecoCascadeHF.h"
29#include "AliAODTrack.h"
30#include "AliESDtrack.h"
31#include "AliAODv0.h"
32#include "AliESDv0.h"
33
34ClassImp(AliRDHFCutsLctoV0)
35
36//--------------------------------------------------------------------------
37AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const char* name) :
38AliRDHFCuts(name)
39{
40 //
41 // Default Constructor
42 //
43 Int_t nvars=9;
44 SetNVars(nvars);
45 TString varNames[9]={"inv. mass if K0s [GeV]",
46 "inv. mass if Lambda [GeV]",
47 "inv. mass V0 if K0s [GeV]",
48 "inv. mass V0 if Lambda [GeV]",
49 "pT min bachelor track [GeV/c]",
50 "pT min V0-positive track [GeV/c]",
51 "pT min V0-negative track [GeV/c]",
52 "dca cascade cut (cm)",
53 "dca V0 cut (cm)"};
54
55 Bool_t isUpperCut[9]={kTRUE,
56 kTRUE,
57 kTRUE,
58 kTRUE,
59 kFALSE,
60 kFALSE,
61 kFALSE,
62 kTRUE,
63 kTRUE};
64 SetVarNames(nvars,varNames,isUpperCut);
65 Bool_t forOpt[9]={kFALSE,
66 kFALSE,
67 kFALSE,
68 kFALSE,
69 kFALSE,
70 kFALSE,
71 kFALSE,
72 kFALSE,
73 kFALSE};
74 SetVarsForOpt(5,forOpt);
75 Float_t limits[2]={0,999999999.};
76 SetPtBins(2,limits);
77}
78//--------------------------------------------------------------------------
79AliRDHFCutsLctoV0::AliRDHFCutsLctoV0(const AliRDHFCutsLctoV0 &source) :
80 AliRDHFCuts(source)
81{
82 //
83 // Copy constructor
84 //
85
86}
87//--------------------------------------------------------------------------
88AliRDHFCutsLctoV0 &AliRDHFCutsLctoV0::operator=(const AliRDHFCutsLctoV0 &source)
89{
90 //
91 // assignment operator
92 //
93 if(&source == this) return *this;
94
95 AliRDHFCuts::operator=(source);
96
97 return *this;
98}
99
100
101//---------------------------------------------------------------------------
102void AliRDHFCutsLctoV0::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
103 //
104 // Fills in vars the values of the variables
105 //
e654189e 106 if(pdgdaughters[0]==-9999) return; // dummy
107
a07ad8e0 108
109 if(nvars!=fnVarsForOpt) {
110 printf("AliRDHFCutsLctoV0::GetCutsVarsForOpt: wrong number of variables\n");
111 return;
112 }
113
114 AliAODRecoCascadeHF *dd = (AliAODRecoCascadeHF*)d;
115
116 // Get the v0 and all daughter tracks
117 AliAODTrack *bachelor_track = dd->GetBachelor();
118 AliAODv0 *v0 = dd->Getv0();
119 AliAODTrack *v0positive_track = dd->Getv0PositiveTrack();
120 AliAODTrack *v0negative_track = dd->Getv0NegativeTrack();
121
122 Int_t iter=-1;
123 // cut on cascade mass, if k0s + p
124 if(fVarsForOpt[0]){
125 iter++;
126 vars[iter]=dd->InvMassLctoK0sP();
127 }
128 // cut on cascade mass, if lambda + pi
129 if(fVarsForOpt[1]){
130 iter++;
131 vars[iter]=dd->InvMassLctoLambdaPi();
132 }
133
134 // cut on v0 mass if k0s
135 if(fVarsForOpt[2]){
136 iter++;
137 vars[iter]=v0->MassK0Short();
138 }
139
140 // cut on v0 mass if lambda
141 // ----------------------------- pb with anti-lambda?? --------->>>>>>>>
142 if(fVarsForOpt[3]){
143 iter++;
144 vars[iter]=v0->MassLambda();
145 }
146
147 // cut on v0-positive min pt
148 if(fVarsForOpt[4]){
149 iter++;
150 vars[iter]=v0positive_track->Pt();
151 }
152
153 // cut on v0-negative min pt
154 if(fVarsForOpt[5]){
155 iter++;
156 vars[iter]=v0negative_track->Pt();
157 }
158
159 // cut bachelor min pt
160 if(fVarsForOpt[6]){
161 iter++;
162 vars[iter]=bachelor_track->Pt();
163 }
164
165 // cut on v0 dca
166 if(fVarsForOpt[7]){
167 iter++;
168 vars[iter]=v0->GetDCA();
169 }
170
171 // cut on cascade dca
172 if(fVarsForOpt[8]){
173 iter++;
174 vars[iter]=dd->GetDCA();
175 }
176
177 return;
178}
179//---------------------------------------------------------------------------
180Int_t AliRDHFCutsLctoV0::IsSelected(TObject* obj,Int_t selectionLevel) {
181 //
182 // Apply selection
183 //
184
185 if(!fCutsRD){
186 cout<<"Cut matrice not inizialized. Exit..."<<endl;
187 return 0;
188 }
189 //PrintAll();
190 AliAODRecoCascadeHF* d=(AliAODRecoCascadeHF*)obj;
191
192 if(!d){
193 cout<<"AliAODRecoCascadeHF null"<<endl;
194 return 0;
195 }
196
197
198 // selection on daughter tracks
199 if(selectionLevel==AliRDHFCuts::kAll ||
200 selectionLevel==AliRDHFCuts::kTracks) {
201 if(!AreDaughtersSelected(d)) return 0;
202 }
203
204
205 // Get the v0 and all daughter tracks
206 AliAODTrack *bachelor_track = d->GetBachelor();
207 AliAODv0 *v0 = d->Getv0();
208 AliAODTrack *v0positive_track = d->Getv0PositiveTrack();
209 AliAODTrack *v0negative_track = d->Getv0NegativeTrack();
210
211// // If reading ESDv0, return false
212// if ( !d->Getv0() || !d->Getv0PositiveTrack() || !d->Getv0NegativeTrack() )
213// { AliInfo(Form("Not adapted for ESDv0s, return false...")); return false; }
214
215 Int_t returnvalue=1;
216
217 // selection on candidate
218 if(selectionLevel==AliRDHFCuts::kAll ||
219 selectionLevel==AliRDHFCuts::kCandidate) {
220
221 Double_t pt=d->Pt();
222
223 Int_t ptbin=PtBin(pt);
224
225 Double_t mLck0sp,mLcLpi;
226 Int_t okLck0sp=1,okLcLpi=1;
227
228 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
229 Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
230 Double_t mLPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
231
232 // k0s + p
233 double mk0s = v0->MassK0Short();
234 mLck0sp = d->InvMassLctoK0sP();
235
236 // lambda + pi
237 double mlambda = v0->MassLambda();
238 double malambda = v0->MassAntiLambda();
239 mLcLpi = d->InvMassLctoLambdaPi();
240
241 // cut on Lc mass
242 // with k0s p hypothesis
243 if(TMath::Abs(mLck0sp-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) {
244 okLck0sp = 0;
245 AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to lambda_c into k0s+p cut",mLck0sp));
246 }
247 // with Lambda pi hypothesis
248 if(TMath::Abs(mLcLpi-mLcPDG)>fCutsRD[GetGlobalIndex(1,ptbin)]) {
249 okLcLpi = 0;
250 AliDebug(4,Form(" cascade mass is %2.2e and does not correspond to lambda_c into lambda+pi cut",mLcLpi));
251 }
252
253 // cuts on the v0 mass
254 if(TMath::Abs(mk0s-mk0sPDG)>fCutsRD[GetGlobalIndex(2,ptbin)]) {
255 okLck0sp = 0;
256 AliDebug(4,Form(" v0 mass is %2.2e and does not correspond to k0s cut",mk0s));
257 }
258 if( TMath::Abs(mlambda-mLPDG)>fCutsRD[GetGlobalIndex(3,ptbin)] &&
259 TMath::Abs(malambda-mLPDG)>fCutsRD[GetGlobalIndex(3,ptbin)] ) {
260 okLcLpi = 0;
261 AliDebug(4,Form(" v0 mass is %2.2e and does not correspond to lambda cut",mlambda));
262 }
263
264 if(!okLck0sp && !okLcLpi) return 0;
265
266 // cuts on the minimum pt of the tracks
267 if(TMath::Abs(bachelor_track->Pt()) < fCutsRD[GetGlobalIndex(4,ptbin)]) {
268 AliDebug(4,Form(" bachelor track Pt=%2.2e > %2.2e",bachelor_track->Pt(),fCutsRD[GetGlobalIndex(4,ptbin)]));
269 return 0;
270 }
271 if(TMath::Abs(v0positive_track->Pt()) < fCutsRD[GetGlobalIndex(5,ptbin)]) {
272 AliDebug(4,Form(" v0 positive track Pt=%2.2e > %2.2e",v0positive_track->Pt(),fCutsRD[GetGlobalIndex(5,ptbin)]));
273 return 0;
274 }
275 if(TMath::Abs(v0negative_track->Pt()) < fCutsRD[GetGlobalIndex(6,ptbin)]) {
276 AliDebug(4,Form(" v0 negative track Pt=%2.2e > %2.2e",v0negative_track->Pt(),fCutsRD[GetGlobalIndex(6,ptbin)]));
277 return 0;
278 }
279
280 // cut on the v0 dca
281 if(TMath::Abs(v0->DcaV0Daughters()) > fCutsRD[GetGlobalIndex(7,ptbin)]) {
282 AliDebug(4,Form(" v0 daughters DCA = %2.2e > %2.2e",v0->DcaV0Daughters(),fCutsRD[GetGlobalIndex(7,ptbin)]));
283 return 0;
284 }
285
286 // cut on the cascade dca
287 if( TMath::Abs(d->GetDCA(0))>fCutsRD[GetGlobalIndex(8,ptbin)] ||
288 TMath::Abs(v0->DcaPosToPrimVertex())>fCutsRD[GetGlobalIndex(8,ptbin)] ||
289 TMath::Abs(v0->DcaNegToPrimVertex())>fCutsRD[GetGlobalIndex(8,ptbin)] ) {
290 AliDebug(4,Form(" cascade tracks DCA at primary vertex don't pass the cut"));
291 return 0;
292 }
293
294 if(okLck0sp) returnvalue=1; //cuts passed as Lc -> k0s + p
295 if(okLcLpi) returnvalue=2; //cuts passed as Lc-> lambda + pi
296 if(okLck0sp && okLcLpi) returnvalue=3; //cuts passed as both Lc -> k0s + p; Lc-> lambda + pi
297
298 }
299
300 return returnvalue;
301}
302//---------------------------------------------------------------------------