]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/vertexingHF/AliRDHFCutsLctopKpi.cxx
Update (Chiara Z)
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliRDHFCutsLctopKpi.cxx
CommitLineData
e3d40058 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
e3d40058 18/////////////////////////////////////////////////////////////
19//
20// Class for cuts on AOD reconstructed Lc->pKpi
21//
22// Author: A.Dainese, andrea.dainese@pd.infn.it
23/////////////////////////////////////////////////////////////
24
25#include <TDatabasePDG.h>
26#include <Riostream.h>
27
28#include "AliRDHFCutsLctopKpi.h"
29#include "AliAODRecoDecayHF3Prong.h"
7ad4b782 30#include "AliRDHFCuts.h"
e3d40058 31#include "AliAODTrack.h"
32#include "AliESDtrack.h"
7ad4b782 33#include "AliKFParticle.h"
34#include "AliESDVertex.h"
e3d40058 35
36ClassImp(AliRDHFCutsLctopKpi)
37
38//--------------------------------------------------------------------------
a9b75906 39AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const char* name) :
7ad4b782 40AliRDHFCuts(name),
41fPidObjprot(0),
42fPidObjpion(0),
43fRecoKF(kFALSE)
e3d40058 44{
45 //
46 // Default Constructor
47 //
a7b533b7 48 Int_t nvars=13;
e3d40058 49 SetNVars(nvars);
a7b533b7 50 TString varNames[13]={"inv. mass [GeV]",
a8b8e864 51 "pTK [GeV/c]",
a7b533b7 52 "pTP [GeV/c]",
a8b8e864 53 "d0K [cm] lower limit!",
e3d40058 54 "d0Pi [cm] lower limit!",
55 "dist12 (cm)",
56 "sigmavert (cm)",
57 "dist prim-sec (cm)",
58 "pM=Max{pT1,pT2,pT3} (GeV/c)",
59 "cosThetaPoint",
60 "Sum d0^2 (cm^2)",
a7b533b7 61 "dca cut (cm)",
62 "cut on pTpion [GeV/c]"};
63 Bool_t isUpperCut[13]={kTRUE,
e3d40058 64 kFALSE,
65 kFALSE,
66 kFALSE,
67 kFALSE,
68 kFALSE,
69 kTRUE,
70 kFALSE,
71 kFALSE,
72 kFALSE,
73 kFALSE,
a7b533b7 74 kTRUE,
75 kFALSE
76 };
e3d40058 77 SetVarNames(nvars,varNames,isUpperCut);
a7b533b7 78 Bool_t forOpt[13]={kFALSE,
79 kTRUE,
80 kTRUE,
e3d40058 81 kFALSE,
82 kFALSE,
83 kFALSE,
84 kFALSE,
85 kTRUE,
a7b533b7 86 kFALSE,
87 kFALSE,
88 kFALSE,
89 kFALSE,
90 kTRUE};
91 SetVarsForOpt(4,forOpt);
e3d40058 92 Float_t limits[2]={0,999999999.};
93 SetPtBins(2,limits);
94}
95//--------------------------------------------------------------------------
96AliRDHFCutsLctopKpi::AliRDHFCutsLctopKpi(const AliRDHFCutsLctopKpi &source) :
7ad4b782 97 AliRDHFCuts(source),
98 fPidObjprot(0),
99 fPidObjpion(0),
100 fRecoKF(kFALSE)
e3d40058 101{
102 //
103 // Copy constructor
104 //
7ad4b782 105 if(source.fPidObjprot) SetPidprot(source.fPidObjprot);
106 if(source.fPidObjpion) SetPidpion(source.fPidObjpion);
e3d40058 107}
108//--------------------------------------------------------------------------
109AliRDHFCutsLctopKpi &AliRDHFCutsLctopKpi::operator=(const AliRDHFCutsLctopKpi &source)
110{
111 //
112 // assignment operator
113 //
114 if(&source == this) return *this;
115
116 AliRDHFCuts::operator=(source);
7ad4b782 117 SetPidprot(source.GetPidprot());
118 SetPidpion(source.GetPidpion());
e3d40058 119
120 return *this;
121}
7ad4b782 122//---------------------------------------------------------------------------
123AliRDHFCutsLctopKpi::~AliRDHFCutsLctopKpi() {
124 //
125 // // Default Destructor
126 //
127 if(fPidObjpion){
128 delete fPidObjpion;
129 fPidObjpion=0;
130 }
131 if(fPidObjprot){
132 delete fPidObjprot;
133 fPidObjprot=0;
134 }
e3d40058 135
7ad4b782 136}
e3d40058 137
138//---------------------------------------------------------------------------
139void AliRDHFCutsLctopKpi::GetCutVarsForOpt(AliAODRecoDecayHF *d,Float_t *vars,Int_t nvars,Int_t *pdgdaughters) {
140 //
141 // Fills in vars the values of the variables
142 //
143
144 if(nvars!=fnVarsForOpt) {
145 printf("AliRDHFCutsLctopKpi::GetCutsVarsForOpt: wrong number of variables\n");
146 return;
147 }
148
149 AliAODRecoDecayHF3Prong *dd = (AliAODRecoDecayHF3Prong*)d;
150
151 Int_t iter=-1;
152 if(fVarsForOpt[0]){
153 iter++;
154 vars[iter]=dd->InvMassLcpKpi();
155 }
156 if(fVarsForOpt[1]){
157 iter++;
158 for(Int_t iprong=0;iprong<3;iprong++){
a7b533b7 159 if(TMath::Abs(pdgdaughters[iprong])==321) {
e3d40058 160 vars[iter]=dd->PtProng(iprong);
161 }
162 }
163 }
164 if(fVarsForOpt[2]){
165 iter++;
166 for(Int_t iprong=0;iprong<3;iprong++){
a7b533b7 167 if(TMath::Abs(pdgdaughters[iprong])==2212) {
e3d40058 168 vars[iter]=dd->PtProng(iprong);
169 }
170 }
171 }
172 if(fVarsForOpt[3]){
173 iter++;
174 for(Int_t iprong=0;iprong<3;iprong++){
175 if(TMath::Abs(pdgdaughters[iprong])==2212) {
176 vars[iter]=dd->Getd0Prong(iprong);
177 }
178 }
179 }
180 if(fVarsForOpt[4]){
181 iter++;
182 for(Int_t iprong=0;iprong<3;iprong++){
183 if(TMath::Abs(pdgdaughters[iprong])==211) {
184 vars[iter]=dd->Getd0Prong(iprong);
185 }
186 }
187 }
188 if(fVarsForOpt[5]){
189 iter++;
190 vars[iter]=dd->GetDist12toPrim();
191 }
192 if(fVarsForOpt[6]){
193 iter++;
194 vars[iter]=dd->GetSigmaVert();
195 }
196 if(fVarsForOpt[7]){
197 iter++;
198 vars[iter] = dd->DecayLength();
199 }
200 if(fVarsForOpt[8]){
201 iter++;
202 Float_t ptmax=0;
203 for(Int_t i=0;i<3;i++){
204 if(dd->PtProng(i)>ptmax)ptmax=dd->PtProng(i);
205 }
206 vars[iter]=ptmax;
207 }
208 if(fVarsForOpt[9]){
209 iter++;
210 vars[iter]=dd->CosPointingAngle();
211 }
212 if(fVarsForOpt[10]){
213 iter++;
214 vars[iter]=dd->Getd0Prong(0)*dd->Getd0Prong(0)+dd->Getd0Prong(1)*dd->Getd0Prong(1)+dd->Getd0Prong(2)*dd->Getd0Prong(2);
215 }
216 if(fVarsForOpt[11]){
217 iter++;
218 vars[iter]=dd->GetDCA();
219 }
a7b533b7 220 if(fVarsForOpt[12]){
221 iter++;
222 for(Int_t iprong=0;iprong<3;iprong++){
223 if(TMath::Abs(pdgdaughters[iprong])==211) {
224 vars[iter]=dd->PtProng(iprong);
225 }
226 }
227 }
e3d40058 228
229 return;
230}
231//---------------------------------------------------------------------------
7ad4b782 232Int_t AliRDHFCutsLctopKpi::IsSelected(TObject* obj,Int_t selectionLevel,AliAODEvent *aod) {
e3d40058 233 //
234 // Apply selection
235 //
236
237 if(!fCutsRD){
238 cout<<"Cut matrice not inizialized. Exit..."<<endl;
239 return 0;
240 }
241 //PrintAll();
242 AliAODRecoDecayHF3Prong* d=(AliAODRecoDecayHF3Prong*)obj;
243
244 if(!d){
245 cout<<"AliAODRecoDecayHF3Prong null"<<endl;
246 return 0;
247 }
248
249
e3d40058 250
228974b3 251 Int_t returnvalue=3;
7ad4b782 252 Int_t returnvaluePID=3;
253
47aa3d55 254 if(d->Pt()<fMinPtCand) return 0;
255 if(d->Pt()>fMaxPtCand) return 0;
e3d40058 256
257 // selection on candidate
258 if(selectionLevel==AliRDHFCuts::kAll ||
259 selectionLevel==AliRDHFCuts::kCandidate) {
260
261 Double_t pt=d->Pt();
262
263 Int_t ptbin=PtBin(pt);
264
265 Double_t mLcpKpi,mLcpiKp;
266 Int_t okLcpKpi=1,okLcpiKp=1;
267
268 Double_t mLcPDG = TDatabasePDG::Instance()->GetParticle(4122)->Mass();
269
270 mLcpKpi=d->InvMassLcpKpi();
271 mLcpiKp=d->InvMassLcpiKp();
272
273 if(TMath::Abs(mLcpKpi-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpKpi = 0;
274 if(TMath::Abs(mLcpiKp-mLcPDG)>fCutsRD[GetGlobalIndex(0,ptbin)]) okLcpiKp = 0;
275 if(!okLcpKpi && !okLcpiKp) return 0;
276
277 if(TMath::Abs(d->PtProng(1)) < fCutsRD[GetGlobalIndex(1,ptbin)] || TMath::Abs(d->Getd0Prong(1))<fCutsRD[GetGlobalIndex(3,ptbin)]) return 0;//Kaon
a7b533b7 278 if((TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(12,ptbin)])) okLcpKpi=0;
279 if((TMath::Abs(d->PtProng(2)) < fCutsRD[GetGlobalIndex(2,ptbin)]) || (TMath::Abs(d->PtProng(0)) < fCutsRD[GetGlobalIndex(12,ptbin)]))okLcpiKp=0;
7ad4b782 280 if(!okLcpKpi && !okLcpiKp) return 0;
e3d40058 281
282
7ad4b782 283 if(fRecoKF){
284 Int_t valueTmp=3;
285 if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi
286 if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp
287 if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
288
289 Int_t valueTotTmp=CombinePIDCuts(valueTmp,returnvaluePID);
290 Int_t pdgs[3]={2212,321,211};
291 if(valueTotTmp>=2) {
292 pdgs[0]=211;
293 pdgs[2]=2212;
294 }
295 if(!d->GetOwnPrimaryVtx()){
296 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
297 d->SetOwnPrimaryVtx(vtx1);
298 }
299 Double_t field=aod->GetMagneticField();
300 ReconstructKF(d,pdgs,field);
301 }
e3d40058 302 //2track cuts
303 if(d->GetDist12toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]|| d->GetDist23toPrim()<fCutsRD[GetGlobalIndex(5,ptbin)]) return 0;
228974b3 304 if(d->GetDist12toPrim()>1.) return 0;
305 if(d->GetDist23toPrim()>1.) return 0;
e3d40058 306 if(d->Getd0Prong(0)*d->Getd0Prong(1)<0. && d->Getd0Prong(2)*d->Getd0Prong(1)<0.) return 0;
307
308 //sec vert
309 if(d->GetSigmaVert()>fCutsRD[GetGlobalIndex(6,ptbin)]) return 0;
310
311 if(d->DecayLength()<fCutsRD[GetGlobalIndex(7,ptbin)]) return 0;
228974b3 312 if(d->DecayLength()>0.5) return 0;
e3d40058 313
314 if(TMath::Abs(d->PtProng(0))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(1))<fCutsRD[GetGlobalIndex(8,ptbin)] && TMath::Abs(d->PtProng(2))<fCutsRD[GetGlobalIndex(8,ptbin)]) return 0;
315 if(d->CosPointingAngle()< fCutsRD[GetGlobalIndex(9,ptbin)]) return 0;
316 Double_t sum2=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
317 if(sum2<fCutsRD[GetGlobalIndex(10,ptbin)]) return 0;
318
319 //DCA
320 for(Int_t i=0;i<3;i++) if(d->GetDCA(i)>fCutsRD[GetGlobalIndex(11,ptbin)]) return 0;
321
322
323 if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi
324 if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp
325 if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
dcc2ade0 326
dcc2ade0 327 }
328
329 if(fUsePID || selectionLevel==AliRDHFCuts::kPID) returnvaluePID = IsSelectedPID(d);
330 if(returnvaluePID==0) return 0;
331
332 // selection on daughter tracks
333 if(selectionLevel==AliRDHFCuts::kAll ||
334 selectionLevel==AliRDHFCuts::kTracks) {
335 if(!AreDaughtersSelected(d)) return 0;
e3d40058 336 }
dcc2ade0 337
338
7ad4b782 339 Int_t returnvalueTot=CombinePIDCuts(returnvalue,returnvaluePID);
340 return returnvalueTot;
e3d40058 341}
342//---------------------------------------------------------------------------
7ad4b782 343Int_t AliRDHFCutsLctopKpi::IsSelectedPID(AliAODRecoDecayHF* obj) {
344
345
346 if(!obj) {return 3;}
347 Int_t okLcpKpi=0,okLcpiKp=0;
348 Int_t returnvalue=0;
349 Bool_t isPeriodd=fPidHF->GetOnePad();
a7b533b7 350 Bool_t isMC=fPidHF->GetMC();
7ad4b782 351 Bool_t ispion0=kTRUE,ispion2=kTRUE;
352 Bool_t isproton0=kFALSE,isproton2=kFALSE;
353 Bool_t iskaon1=kFALSE;
a7b533b7 354 if(isPeriodd) {
355 fPidObjprot->SetOnePad(kTRUE);
356 fPidObjpion->SetOnePad(kTRUE);
357 }
358 if(isMC) {
359 fPidObjprot->SetMC(kTRUE);
360 fPidObjpion->SetMC(kTRUE);
361 }
7ad4b782 362
363 for(Int_t i=0;i<3;i++){
364 AliAODTrack *track=(AliAODTrack*)obj->GetDaughter(i);
365 if(!track) return 0;
366 // identify kaon
367 if(i==1) {
368 Int_t isKaon=fPidHF->MakeRawPid(track,3);
369 if(isKaon>=1) {
370 iskaon1=kTRUE;
371 if(fPidHF->MakeRawPid(track,2)>=1) iskaon1=kFALSE;
372 }
47aa3d55 373 if(!iskaon1) return 0;
7ad4b782 374
375 }else{
376 //pion or proton
377
378 Int_t isProton=fPidObjprot->MakeRawPid(track,4);
379 if(isProton>=1){
380 if(fPidHF->MakeRawPid(track,2)>=1) isProton=-1;
381 if(fPidHF->MakeRawPid(track,3)>=1) isProton=-1;
382 }
383
384 Int_t isPion=fPidObjpion->MakeRawPid(track,2);
385 if(fPidHF->MakeRawPid(track,3)>=1) isPion=-1;
386 if(fPidObjprot->MakeRawPid(track,4)>=1) isPion=-1;
387
388
389 if(i==0) {
390 if(isPion<0) ispion0=kFALSE;
391 if(isProton>=1) isproton0=kTRUE;
392
393 }
47aa3d55 394 if(!ispion0 && !isproton0) return 0;
7ad4b782 395 if(i==2) {
396 if(isPion<0) ispion2=kFALSE;
397 if(isProton>=1) isproton2=kTRUE;
398 }
399
400 }
401 }
402
403 if(ispion2 && isproton0 && iskaon1) okLcpKpi=1;
404 if(ispion0 && isproton2 && iskaon1) okLcpiKp=1;
405 if(okLcpKpi) returnvalue=1; //cuts passed as Lc->pKpi
406 if(okLcpiKp) returnvalue=2; //cuts passed as Lc->piKp
407 if(okLcpKpi && okLcpiKp) returnvalue=3; //cuts passed as both pKpi and piKp
408
409 return returnvalue;
410}
411//-----------------------
412Int_t AliRDHFCutsLctopKpi::CombinePIDCuts(Int_t returnvalue, Int_t returnvaluePID) const {
413
414 Int_t returnvalueTot=0;
415 Int_t okLcpKpi=0,okLcpiKp=0;
416 if(returnvaluePID==1){
417 if(returnvalue==1 || returnvalue==3) okLcpKpi=1;
418 }
419 if(returnvaluePID==2){
420 if(returnvalue>=2) okLcpiKp=1;
421 }
422 if(returnvaluePID==3 && returnvalue>0){
423 if(returnvalue==1 || returnvalue==3) okLcpKpi=1;
424 if(returnvalue>=2) okLcpiKp=1;
425 }
426
427 if(okLcpKpi) returnvalueTot=1; //cuts passed as Lc->pKpi
428 if(okLcpiKp) returnvalueTot=2; //cuts passed as Lc->piKp
429 if(okLcpKpi && okLcpiKp) returnvalueTot=3; //cuts passed as both pKpi and piKp
430 return returnvalueTot;
431}
432//----------------------------------
433void AliRDHFCutsLctopKpi::SetStandardCutsPP2010() {
434
435 SetName("LctopKpiProdCuts");
436 SetTitle("Production cuts for Lc analysis");
437
438 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
439 esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
440 esdTrackCuts->SetRequireTPCRefit(kTRUE);
441 esdTrackCuts->SetMinNClustersTPC(70);
442 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
443 AliESDtrackCuts::kAny);
444 esdTrackCuts->SetRequireITSRefit(kTRUE);
445 esdTrackCuts->SetMinNClustersITS(4);
446 esdTrackCuts->SetMinDCAToVertexXY(0.);
447 esdTrackCuts->SetEtaRange(-0.8,0.8);
448 esdTrackCuts->SetPtRange(0.3,1.e10);
449 AddTrackCuts(esdTrackCuts);
450
451 const Int_t nptbins=4;
a7b533b7 452 const Int_t nvars=13;
7ad4b782 453 Float_t* ptbins;
454 ptbins=new Float_t[nptbins+1];
455
456 ptbins[0]=0.;
457 ptbins[1]=2.;
458 ptbins[2]=3.;
459 ptbins[3]=4.;
460 ptbins[4]=9999.;
461
462 SetGlobalIndex(nvars,nptbins);
463 SetPtBins(nptbins+1,ptbins);
464
465 Float_t** prodcutsval;
466 prodcutsval=new Float_t*[nvars];
467 for(Int_t iv=0;iv<nvars;iv++){
468 prodcutsval[iv]=new Float_t[nptbins];
469 }
e11ae259 470
7ad4b782 471 for(Int_t ipt=0;ipt<nptbins;ipt++){
472 prodcutsval[0][ipt]=0.18;
473 prodcutsval[1][ipt]=0.4;
474 prodcutsval[2][ipt]=0.5;
475 prodcutsval[3][ipt]=0.;
476 prodcutsval[4][ipt]=0.;
477 prodcutsval[5][ipt]=0.01;
478 prodcutsval[6][ipt]=0.06;
479 prodcutsval[7][ipt]=0.005;
480 prodcutsval[8][ipt]=0.;
481 prodcutsval[9][ipt]=0.;
482 prodcutsval[10][ipt]=0.;
483 prodcutsval[11][ipt]=0.05;
a7b533b7 484 prodcutsval[12][ipt]=0.4;
7ad4b782 485 }
486 SetCuts(nvars,nptbins,prodcutsval);
487
488 AliAODPidHF* pidObjK=new AliAODPidHF();
489 Double_t sigmasK[5]={3.,1.,1.,3.,2.};
490 pidObjK->SetSigma(sigmasK);
491 pidObjK->SetAsym(kTRUE);
492 pidObjK->SetMatch(1);
493 pidObjK->SetTPC(kTRUE);
494 pidObjK->SetTOF(kTRUE);
495 pidObjK->SetITS(kTRUE);
496 Double_t plimK[2]={0.5,0.8};
497 pidObjK->SetPLimit(plimK,2);
a7b533b7 498 pidObjK->SetTOFdecide(kTRUE);
7ad4b782 499
500 SetPidHF(pidObjK);
501
502 AliAODPidHF* pidObjpi=new AliAODPidHF();
503 pidObjpi->SetTPC(kTRUE);
504 Double_t sigmaspi[5]={3.,0.,0.,0.,0.};
505 pidObjpi->SetSigma(sigmaspi);
a7b533b7 506 pidObjpi->SetTOFdecide(kTRUE);
7ad4b782 507 SetPidpion(pidObjpi);
508
509 AliAODPidHF* pidObjp=new AliAODPidHF();
510 Double_t sigmasp[5]={3.,1.,1.,3.,2.};
511 pidObjp->SetSigma(sigmasp);
512 pidObjp->SetAsym(kTRUE);
513 pidObjp->SetMatch(1);
514 pidObjp->SetTPC(kTRUE);
515 pidObjp->SetTOF(kTRUE);
516 pidObjp->SetITS(kTRUE);
517 Double_t plimp[2]={1.,2.};
518 pidObjp->SetPLimit(plimp,2);
a7b533b7 519 pidObjp->SetTOFdecide(kTRUE);
7ad4b782 520
521 SetPidprot(pidObjp);
522
523 SetUsePID(kTRUE);
524
525 PrintAll();
526
e11ae259 527 for(Int_t iiv=0;iiv<nvars;iiv++){
528 delete [] prodcutsval[iiv];
529 }
530 delete [] prodcutsval;
531 prodcutsval=NULL;
532 delete [] ptbins;
533 ptbins=NULL;
534
535 delete pidObjp;
536 pidObjp=NULL;
537
7ad4b782 538 return;
539}
a8b8e864 540//------------------
541void AliRDHFCutsLctopKpi::SetStandardCutsPbPb2010() {
542
543 SetName("LctopKpiProdCuts");
544 SetTitle("Production cuts for Lc analysis");
545
546 AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts","default");
547
548 esdTrackCuts->SetRequireTPCRefit(kTRUE);
549 esdTrackCuts->SetMinNClustersTPC(70);
550 esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
551 AliESDtrackCuts::kAny);
552 esdTrackCuts->SetRequireITSRefit(kTRUE);
553 esdTrackCuts->SetMinNClustersITS(4);
554 esdTrackCuts->SetMinDCAToVertexXYPtDep("0.0100*TMath::Max(0.,(1-TMath::Floor(TMath::Abs(pt)/2.)))");
555 esdTrackCuts->SetEtaRange(-0.8,0.8);
556 esdTrackCuts->SetMaxDCAToVertexXY(1.);
557 esdTrackCuts->SetMaxDCAToVertexZ(1.);
558 esdTrackCuts->SetPtRange(0.8,1.e10);
559 AddTrackCuts(esdTrackCuts);
560
561 const Int_t nptbins=4;
a7b533b7 562 const Int_t nvars=13;
a8b8e864 563 Float_t* ptbins;
564 ptbins=new Float_t[nptbins+1];
565
566 ptbins[0]=0.;
567 ptbins[1]=2.;
568 ptbins[2]=3.;
569 ptbins[3]=4.;
570 ptbins[4]=9999.;
571
572 SetGlobalIndex(nvars,nptbins);
573 SetPtBins(nptbins+1,ptbins);
574
575 Float_t** prodcutsval;
576 prodcutsval=new Float_t*[nvars];
577 for(Int_t iv=0;iv<nvars;iv++){
578 prodcutsval[iv]=new Float_t[nptbins];
579 }
580
581 for(Int_t ipt=0;ipt<nptbins;ipt++){
582 prodcutsval[0][ipt]=0.13;
583 prodcutsval[1][ipt]=0.5;
584 prodcutsval[2][ipt]=0.6;
585 prodcutsval[3][ipt]=0.;
586 prodcutsval[4][ipt]=0.;
587 prodcutsval[5][ipt]=0.01;
588 prodcutsval[6][ipt]=0.04;
589 prodcutsval[7][ipt]=0.006;
590 prodcutsval[8][ipt]=0.8;
591 prodcutsval[9][ipt]=0.3;
592 prodcutsval[10][ipt]=0.;
593 prodcutsval[11][ipt]=0.05;
a7b533b7 594 prodcutsval[12][ipt]=0.4;
a8b8e864 595 }
596 SetCuts(nvars,nptbins,prodcutsval);
597
598 AliAODPidHF* pidObjK=new AliAODPidHF();
599 Double_t sigmasK[5]={3.,1.,1.,3.,2.};
600 pidObjK->SetSigma(sigmasK);
601 pidObjK->SetAsym(kTRUE);
602 pidObjK->SetMatch(1);
603 pidObjK->SetTPC(kTRUE);
604 pidObjK->SetTOF(kTRUE);
605 pidObjK->SetITS(kTRUE);
606 Double_t plimK[2]={0.5,0.8};
607 pidObjK->SetPLimit(plimK,2);
608
609 SetPidHF(pidObjK);
610
611 AliAODPidHF* pidObjpi=new AliAODPidHF();
612 pidObjpi->SetTPC(kTRUE);
613 Double_t sigmaspi[5]={3.,0.,0.,0.,0.};
614 pidObjpi->SetSigma(sigmaspi);
615 SetPidpion(pidObjpi);
7ad4b782 616
a8b8e864 617 AliAODPidHF* pidObjp=new AliAODPidHF();
618 Double_t sigmasp[5]={3.,1.,1.,3.,2.};
619 pidObjp->SetSigma(sigmasp);
620 pidObjp->SetAsym(kTRUE);
621 pidObjp->SetMatch(1);
622 pidObjp->SetTPC(kTRUE);
623 pidObjp->SetTOF(kTRUE);
624 pidObjp->SetITS(kTRUE);
625 Double_t plimp[2]={1.,2.};
626 pidObjp->SetPLimit(plimp,2);
627
628 SetPidprot(pidObjp);
629
630 SetUsePID(kTRUE);
631
632 PrintAll();
633
634 for(Int_t iiv=0;iiv<nvars;iiv++){
635 delete [] prodcutsval[iiv];
636 }
637 delete [] prodcutsval;
638 prodcutsval=NULL;
639 delete [] ptbins;
640 ptbins=NULL;
641
642 delete pidObjp;
643 pidObjp=NULL;
644
645 return;
646}
7ad4b782 647//------------------
648Bool_t AliRDHFCutsLctopKpi::ReconstructKF(AliAODRecoDecayHF3Prong *d,Int_t *pdgs,Double_t field) const{
649
650 Int_t nprongs=d->GetNProngs();
651 Int_t iprongs[nprongs];
652 for(Int_t i=0;i<nprongs;i++) iprongs[i]=i;
653
654 Double_t mass[2]={0.,0.};
655
656 AliKFParticle *decay=d->ApplyVertexingKF(iprongs,nprongs,pdgs,kTRUE,field,mass);
657 if(!decay) return kTRUE;
658 AliESDVertex *vertexESD = new AliESDVertex(decay->Parameters(),
659 decay->CovarianceMatrix(),
660 decay->GetChi2(),
661 nprongs);
662 Double_t pos[3],cov[6],chi2perNDF;
663 vertexESD->GetXYZ(pos);
664 vertexESD->GetCovMatrix(cov);
665 chi2perNDF = vertexESD->GetChi2toNDF();
666 delete vertexESD; vertexESD=NULL;
667 AliAODVertex *vertexAOD = new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
668 d->SetSecondaryVtx(vertexAOD);
669 return kTRUE;
670}
a8b8e864 671