AliPhysics  d0c3a41 (d0c3a41)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliRDHFCutsDstoK0sK.cxx
Go to the documentation of this file.
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 
16 /* $Id$ */
17 
19 //
20 // Class for cuts on AOD reconstructed Ds->K0S+K
21 //
22 // Author: J.Hamon, julien.hamon@cern.ch (IPHC)
23 //
25 
26 #include <Riostream.h>
27 #include <TDatabasePDG.h>
28 #include <TMath.h>
29 
30 #include "AliAnalysisManager.h"
31 #include "AliInputEventHandler.h"
32 #include "AliAODPidHF.h"
33 #include "AliRDHFCutsDstoK0sK.h"
34 #include "AliAODRecoCascadeHF.h"
35 #include "AliAODTrack.h"
36 #include "AliAODv0.h"
37 #include "AliAODVertex.h"
38 #include "AliESDtrack.h"
39 #include "AliESDv0.h"
40 #include "AliESDVertex.h"
41 
42 
44 ClassImp(AliRDHFCutsDstoK0sK);
46 
47 
48 
49 
50 //--------------------------------------------------------------------------
52 AliRDHFCuts(name)
53  , fExcludedCut(-1)
54  , fV0Type(0)
55  , fV0daughtersCuts(0)
56 {
57  //
59  //
60 
61  const Int_t nvars = 16;
62  SetNVars(nvars);
63  TString varNames[nvars] = { "Inv. Mass Ds -> K0s+K [GeV/c2]", // 0
64  "Inv. Mass K0s [GeV/c2]", // 1 -------- K0S reconstruction --------
65  "K0s reco: min pT V0-daughters [GeV/c]", // 2
66  "K0s reco: max DCA V0 (prong-to-prong) [sigma]", // 3
67  "K0s reco: min d0(xy) V0-daughters [cm]", // 4
68  "K0s reco: min cosPointing (3D) V0", // 5
69  "K0s reco: min fiducial radius (xy) [cm]", // 6
70  "min pT bachelor track [GeV/c]", // 7 ------ Cascade reconstruction ------
71  "min pT V0 track [GeV/c]", // 8
72  "max d0(xy) bachelor wrt PV [cm]", // 9
73  "max d0(xy) V0 wrt PV [cm]", // 10
74  "max cosThetaStar Ds daughters", // 11
75  "min cosPointing (3D) cascade daughters", // 12
76  "min |cosPointing| (xy) cascade daughters", // 13
77  "min decay length (xy) cascade [cm]", // 14
78  "V0 type" // 15
79  };
80 
81 
82  Bool_t isUpperCut[nvars] = { kTRUE, // 0
83  kTRUE, // 1 -------- K0S reconstruction --------
84  kFALSE, // 2
85  kTRUE, // 3
86  kFALSE, // 4
87  kFALSE, // 5
88  kFALSE, // 6
89  kFALSE, // 7 ------ Cascade reconstruction ------
90  kFALSE, // 8
91  kTRUE, // 9
92  kTRUE, // 10
93  kTRUE, // 11
94  kFALSE, // 12
95  kFALSE, // 13
96  kFALSE, // 14
97  kFALSE // 15
98  };
99  SetVarNames(nvars, varNames, isUpperCut);
100 
101 
102  Float_t limits[2] = {0, 999999999.};
103  SetPtBins(2, limits);
104 
105 
106  // PID settings
107  Double_t nsigma[5] = {3., 3., 3., 3., 0.}; // 0-2 for TPC, 3 for TOF, 4 for ITS
108 
109  if (fPidHF) delete fPidHF;
110  fPidHF = new AliAODPidHF();
111 
112  fPidHF -> SetMatch(1); // switch to combine the info from more detectors: 1 = || , 2 = &, 3 = p region
113  fPidHF -> SetAsym(kFALSE); // asimmetric PID required (different sigmas for different p bins)
114  fPidHF -> SetSigma(nsigma); // sigma for the raw signal PID: 0-2 for TPC, 3 for TOF, 4 for ITS
115  fPidHF -> SetCompat(kTRUE); // compatibility region : useful only if fMatch=1
116  fPidHF -> SetTPC(1);
117  fPidHF -> SetTOF(1);
118  fPidHF -> SetITS(0);
119  fPidHF -> SetTRD(0);
120 }
121 
122 
123 
124 
125 //--------------------------------------------------------------------------
127 AliRDHFCuts(source)
128  , fExcludedCut(source.fExcludedCut)
129  , fV0Type(source.fV0Type)
130  , fV0daughtersCuts(0)
131 {
132  //
134  //
135 
137  else fV0daughtersCuts = new AliESDtrackCuts();
138 }
139 
140 
141 
142 
143 //--------------------------------------------------------------------------
145 {
146  //
148  //
149 
150  if (this != &source) {
151 
152  AliRDHFCuts::operator = (source);
153  fV0Type = source.fV0Type;
154  fExcludedCut = source.fExcludedCut;
155 
156  delete fV0daughtersCuts;
157  fV0daughtersCuts = new AliESDtrackCuts(*(source.fV0daughtersCuts));
158 
159  }
160 
161  return *this;
162 }
163 
164 
165 
166 
167 //--------------------------------------------------------------------------
169 {
170  //
172  //
173 
175 }
176 
177 
178 
179 
180 //---------------------------------------------------------------------------
182 {
183  //
185  //
186 
187  if(nvars!=fnVarsForOpt) {
188  AliDebug(2, "wrong number of variables");
189  return;
190  }
191 
192 
193  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
194  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
195 
196 
198  if (!d) {
199  AliDebug(2, "AliAODRecoCascadeHF null");
200  return;
201  }
202 
203  // Get the v0 and all daughter tracks
204  AliAODTrack *bachelorTrack = (AliAODTrack*) d->GetBachelor();
205  AliAODv0 *v0 = (AliAODv0*) d->Getv0();
206  if (!v0 || !bachelorTrack) {
207  AliDebug(2, "Missing V0 or missing bachelor for the current cascade");
208  return;
209  }
210 
211  AliAODTrack *v0positiveTrack = (AliAODTrack*) d->Getv0PositiveTrack();
212  AliAODTrack *v0negativeTrack = (AliAODTrack*) d->Getv0NegativeTrack();
213  if (!v0positiveTrack || !v0negativeTrack) {
214  AliDebug(2, "No V0 daughters' objects");
215  return;
216  }
217 
218 
219  //recalculate vertex w/o daughters
220  Bool_t cleanvtx = kFALSE;
221  AliAODVertex *origownvtx = 0x0;
223  if (d->GetOwnPrimaryVtx()) origownvtx = new AliAODVertex(*d->GetOwnPrimaryVtx());
224  cleanvtx = kTRUE;
225  if (!RecalcOwnPrimaryVtx(d, aod)) {
226  CleanOwnPrimaryVtx(d, aod, origownvtx);
227  cleanvtx = kFALSE;
228  }
229  }
230 
231 
232  Int_t iter=-1;
233 
234  if (fVarsForOpt[0]) {
235  iter++;
236  if (TMath::Abs(pdgdaughters[0]==431)) vars[iter] = TMath::Abs(d->InvMassDstoK0sK()-mDsPDG);
237  }
238 
239 
240  //___ K0s reconstruction _________________________
241  //_________________________________________________
242 
243  // - Cut on the K0s invariant mass
244  if (fVarsForOpt[1]) {
245  iter++;
246  vars[iter] = TMath::Abs(v0->MassK0Short()-mk0sPDG);
247  }
248 
249  // - Cut on V0-daughters pT
250  if (fVarsForOpt[2]) {
251  iter++;
252  vars[iter] = v0positiveTrack->Pt();
253  }
254 
255  // - Cut on V0-daughters DCA (prong-to-prong)
256  if (fVarsForOpt[3]) {
257  iter++;
258  vars[iter] = TMath::Abs(v0->GetDCA());
259  }
260 
261  // - Cut on V0-daughters transverse impact parameter d0(xy)
262  if (fVarsForOpt[4]) {
263  iter++;
264  vars[iter] = TMath::Abs(v0->DcaPosToPrimVertex());
265  }
266 
267  // - Cut on V0 cosine of pointing angle (3D) wrt PV
268  if (fVarsForOpt[5]) {
269  iter++;
270  vars[iter] = d->CosV0PointingAngle();
271  }
272 
273  // - Cut on V0 fiducial transverse radius
274  if (fVarsForOpt[6]) {
275  iter++;
276  vars[iter] = TMath::Abs(d->DecayLengthXYV0());
277  }
278 
279 
280  //___ Cascade reconstruction _____________________
281  //_________________________________________________
282 
283  // - Cut on bachelor pT
284  if (fVarsForOpt[7]) {
285  iter++;
286  vars[iter] = bachelorTrack->Pt();
287  }
288 
289  // - Cut on V0 pT
290  if (fVarsForOpt[8]) {
291  iter++;
292  vars[iter] = v0->Pt();
293  }
294 
295  // - Cut on bachelor transverse impact parameter d0(xy)
296  if (fVarsForOpt[9]) {
297  iter++;
298  vars[iter] = TMath::Abs(d->Getd0Prong(0));
299  }
300 
301  // - Cut on V0 transverse impact parameter d0(xy)
302  if (fVarsForOpt[10]) {
303  iter++;
304  vars[iter] = TMath::Abs(d->Getd0Prong(1));
305  }
306 
307  // - Cut on cascade-daughters cosThetaStar
308  if (fVarsForOpt[11]) {
309  iter++;
310  vars[iter] = TMath::Abs(d->CosThetaStar(0, 431, 321, 310));
311  }
312 
313  // - Cut on cascade cosPointingAngle (3D) wrt PV
314  if (fVarsForOpt[12]) {
315  iter++;
316  vars[iter] = d->CosPointingAngle();
317  }
318 
319  // - Cut on cascade cosPointingAngle (xy) wrt PV
320  if (fVarsForOpt[13]) {
321  iter++;
322  vars[iter] = TMath::Abs(d->CosPointingAngleXY());
323  }
324 
325  // - Cut on cascade decay length (xy)
326  if (fVarsForOpt[14]) {
327  iter++;
328  vars[iter] = TMath::Abs(d->DecayLengthXY());
329  }
330 
331 
332  if (cleanvtx) CleanOwnPrimaryVtx(d, aod, origownvtx);
333 
334  return;
335 }
336 
337 
338 
339 
340 //--------------------------------------------------------------------------
342 {
343  //
347  //
348 
349  if (!fCutsRD) {
350  AliFatal("Cut matrice not inizialized. Exit...");
351  return 0;
352  }
353 
354 
356  if (!d) {
357  AliDebug(2, "AliAODRecoCascadeHF null");
358  return 0;
359  }
360 
361  if (!d->GetSecondaryVtx()) {
362  AliDebug(2, "No secondary vertex for cascade");
363  return 0;
364  }
365 
366  if (d->GetNDaughters() != 2) {
367  AliDebug(2, Form("No 2 daughters for current cascade (nDaughters=%d)", d->GetNDaughters()));
368  return 0;
369  }
370 
371 
372 
373  //___ 1./ Check daughter tracks __________________
374  //_________________________________________________
375  AliAODv0 *v0 = (AliAODv0*) d->Getv0();
376  AliAODTrack *bachelorTrack = (AliAODTrack*) d->GetBachelor();
377 
378 
379  if (!v0 || !bachelorTrack) {
380  AliDebug(2, "Missing V0 or missing bachelor for the current cascade");
381  return 0;
382  }
383 
384  if ((v0->GetOnFlyStatus()==kTRUE && GetV0Type()==AliRDHFCuts::kOnlyOfflineV0s) ||
385  (v0->GetOnFlyStatus()==kFALSE && GetV0Type()==AliRDHFCuts::kOnlyOnTheFlyV0s)) {
386  AliDebug(2, "Wrong V0 status (offline or on-the-fly)");
387  return 0;
388  }
389 
390  if (bachelorTrack->GetID()<0) {
391  AliDebug(2, Form("Bachelor has negative ID %d", bachelorTrack->GetID()));
392  return 0;
393  }
394 
395  if (!v0->GetSecondaryVtx()) {
396  AliDebug(2, "No secondary vertex for V0 by cascade");
397  return 0;
398  }
399 
400  if (v0->GetNDaughters()!=2) {
401  AliDebug(2, Form("More than 2 daughters for V0 of current cascade (onTheFly=%d, nDaughters=%d)", v0->GetOnFlyStatus(), v0->GetNDaughters()));
402  return 0;
403  }
404 
405 
406  // - Get the V0 daughter tracks
407  AliAODTrack *v0positiveTrack = (AliAODTrack*) d->Getv0PositiveTrack();
408  AliAODTrack *v0negativeTrack = (AliAODTrack*) d->Getv0NegativeTrack();
409 
410  if (!v0positiveTrack || !v0negativeTrack) {
411  AliDebug(2, "No V0 daughters' objects");
412  return 0;
413  }
414 
415  if (v0positiveTrack->GetID()<0 || v0negativeTrack->GetID()<0) {
416  AliDebug(2, Form("At least one of V0 daughters has negative ID %d %d", v0positiveTrack->GetID(), v0negativeTrack->GetID()));
417  return 0;
418  }
419 
421  AliDebug(2, "Check on the bachelor FilterBit: no BIT(4). Candidate rejected.");
422  return 0;
423  }
424 
425 
426  // - Selection on daughter tracks
427  if ( selectionLevel == AliRDHFCuts::kAll ||
428  selectionLevel == AliRDHFCuts::kTracks )
429  { if (!AreDtoK0sDaughtersSelected(d)) return 0; }
430 
431 
432 
433 
434  //___ 2./ Check for cascade Ds ___________________
435  //_________________________________________________
436 
437  // - Selection on candidate
438  if (selectionLevel == AliRDHFCuts::kAll ||
439  selectionLevel == AliRDHFCuts::kCandidate) {
440 
441 
442  Double_t mDsPDG = TDatabasePDG::Instance()->GetParticle(431)->Mass();
443  Double_t mk0sPDG = TDatabasePDG::Instance()->GetParticle(310)->Mass();
444 
445  Double_t mDs = d->InvMassDstoK0sK();
446  Double_t mk0s = v0->MassK0Short();
447 
448 
449  Double_t pt = d->Pt();
450  Int_t ptbin = PtBin(pt);
451  if (ptbin==-1) {
452  return 0;
453  }
454 
455 
456  // Recalculate vertex w/o daughters
457  AliAODVertex *origownvtx = 0x0;
459  if (d->GetOwnPrimaryVtx()) origownvtx = new AliAODVertex(*d->GetOwnPrimaryVtx());
460  if (!RecalcOwnPrimaryVtx(d, aod)) {
461  CleanOwnPrimaryVtx(d, aod, origownvtx);
462  return 0;
463  }
464  }
465 
466 
467  if (fUseMCVertex) {
468  if (d->GetOwnPrimaryVtx()) origownvtx = new AliAODVertex(*d->GetOwnPrimaryVtx());
469  if (!SetMCPrimaryVtx(d, aod)) {
470  CleanOwnPrimaryVtx(d, aod, origownvtx);
471  return 0;
472  }
473  }
474 
475 
476 
477  //___ Invariant mass compatibility _______________
478  //_________________________________________________
479 
480  // - Check invariant mass of cascade Ds
481  if (TMath::Abs(mDs - mDsPDG) > fCutsRD[GetGlobalIndex(0,ptbin)] && fExcludedCut!=0) {
482  AliDebug(4, "cascade not compatible with Ds invariant mass");
483  return 0;
484  }
485 
486 
487 
488  //___ K0s reconstruction _________________________
489  //_________________________________________________
490 
491  // - Cut on the K0s invariant mass
492  if (TMath::Abs(mk0s-mk0sPDG) > fCutsRD[GetGlobalIndex(1,ptbin)] && fExcludedCut!=1) {
493  AliDebug(4, Form(" V0 mass is %2.2e and does not correspond to K0S cut", mk0s));
494  CleanOwnPrimaryVtx(d, aod, origownvtx);
495  return 0;
496  }
497 
498 
499  // - Cut on V0-daughters pT
500  if (v0positiveTrack->Pt() < fCutsRD[GetGlobalIndex(2,ptbin)] && fExcludedCut!=2) {
501  AliDebug(4, Form(" v0 positive track Pt=%2.2e < %2.2e", v0positiveTrack->Pt(), fCutsRD[GetGlobalIndex(2,ptbin)]));
502  CleanOwnPrimaryVtx(d, aod, origownvtx);
503  return 0;
504  }
505  if (v0negativeTrack->Pt() < fCutsRD[GetGlobalIndex(2,ptbin)] && fExcludedCut!=2) {
506  AliDebug(4, Form(" v0 positive track Pt=%2.2e < %2.2e", v0negativeTrack->Pt(), fCutsRD[GetGlobalIndex(2,ptbin)]));
507  CleanOwnPrimaryVtx(d, aod, origownvtx);
508  return 0;
509  }
510 
511 
512  // - Cut on V0-daughters DCA (prong-to-prong)
513  if (TMath::Abs(v0->GetDCA()) > fCutsRD[GetGlobalIndex(3,ptbin)] && fExcludedCut!=3) {
514  AliDebug(4, " V0-daugters DCA doesn't pass the cut");
515  CleanOwnPrimaryVtx(d, aod, origownvtx);
516  return 0;
517  }
518 
519 
520  // - Cut on V0-daughters transverse impact parameter d0(xy)
521  if (TMath::Abs(v0->DcaPosToPrimVertex()) < fCutsRD[GetGlobalIndex(4,ptbin)] && fExcludedCut!=4) {
522  AliDebug(4, " V0-daugters impact parameter (xy) don't pass the cut");
523  CleanOwnPrimaryVtx(d, aod, origownvtx);
524  return 0;
525  }
526  if (TMath::Abs(v0->DcaNegToPrimVertex()) < fCutsRD[GetGlobalIndex(4,ptbin)] && fExcludedCut!=4) {
527  AliDebug(4, " V0-daugters impact parameter (xy) don't pass the cut");
528  CleanOwnPrimaryVtx(d, aod, origownvtx);
529  return 0;
530  }
531 
532 
533  // - Cut on V0 cosine of pointing angle (3D) wrt PV
534  if (d->CosV0PointingAngle() < fCutsRD[GetGlobalIndex(5,ptbin)] && fExcludedCut!=5) {
535  AliDebug(4, " V0 cosine of pointing angle (3D) doesn't pass the cut");
536  CleanOwnPrimaryVtx(d, aod, origownvtx);
537  return 0;
538  }
539 
540 
541  // - Cut on V0 fiducial transverse radius
542  if (TMath::Abs(d->DecayLengthXYV0()) < fCutsRD[GetGlobalIndex(6,ptbin)] && fExcludedCut!=6) {
543  AliDebug(4, " V0 fiducial transverse radius min doesn't pass the cut");
544  CleanOwnPrimaryVtx(d, aod, origownvtx);
545  return 0;
546  }
547 
548 
549 
550  //___ Cascade reconstruction _____________________
551  //_________________________________________________
552 
553  // - Cut on bachelor pT
554  if (TMath::Abs(bachelorTrack->Pt()) < fCutsRD[GetGlobalIndex(7,ptbin)] && fExcludedCut!=7) {
555  AliDebug(4, Form(" bachelor track Pt=%2.2e < %2.2e", bachelorTrack->Pt(), fCutsRD[GetGlobalIndex(7,ptbin)]));
556  CleanOwnPrimaryVtx(d, aod, origownvtx);
557  return 0;
558  }
559 
560 
561  // - Cut on V0 pT
562  if (TMath::Abs(v0->Pt()) < fCutsRD[GetGlobalIndex(8,ptbin)] && fExcludedCut!=8) {
563  AliDebug(4, Form(" V0 track Pt=%2.2e < %2.2e", v0->Pt(), fCutsRD[GetGlobalIndex(8,ptbin)]));
564  CleanOwnPrimaryVtx(d, aod, origownvtx);
565  return 0;
566  }
567 
568 
569  // - Cut on bachelor transverse impact parameter d0(xy)
570  if (TMath::Abs(d->Getd0Prong(0)) > fCutsRD[GetGlobalIndex(9,ptbin)] && fExcludedCut!=9) {
571  AliDebug(4, " bachelor transverse impact parameter doesn't pass the cut");
572  CleanOwnPrimaryVtx(d, aod, origownvtx);
573  return 0;
574  }
575 
576 
577  // - Cut on V0 transverse impact parameter d0(xy)
578  if (TMath::Abs(d->Getd0Prong(1)) > fCutsRD[GetGlobalIndex(10,ptbin)] && fExcludedCut!=10) {
579  AliDebug(4, " V0 transverse impact parameter doesn't pass the cut");
580  CleanOwnPrimaryVtx(d, aod, origownvtx);
581  return 0;
582  }
583 
584 
585  // - Cut on Ds-daughters cosThetaStar
586  if (TMath::Abs(d->CosThetaStar(0, 431, 321, 310)) > fCutsRD[GetGlobalIndex(11,ptbin)] && fExcludedCut!=11) {
587  AliDebug(4, " Ds daughter cosThetaStar doesn't pass the cut");
588  CleanOwnPrimaryVtx(d, aod, origownvtx);
589  return 0;
590  }
591 
592 
593  // - Cut on cascade cosPointingAngle (3D) wrt PV
594  if (d->CosPointingAngle() < fCutsRD[GetGlobalIndex(12,ptbin)] && fExcludedCut!=12) {
595  AliDebug(4, " Cascade cosPointingAngle (3D) doesn't pass the cut");
596  CleanOwnPrimaryVtx(d, aod, origownvtx);
597  return 0;
598  }
599 
600  // - Cut on cascade cosPointingAngle (xy) wrt PV
601  if (TMath::Abs(d->CosPointingAngleXY()) < fCutsRD[GetGlobalIndex(13,ptbin)] && fExcludedCut!=13) {
602  AliDebug(4, " Cascade cosPointingAngle (xy) doesn't pass the cut");
603  CleanOwnPrimaryVtx(d, aod, origownvtx);
604  return 0;
605  }
606 
607 
608  // - Cut on cascade decay length (xy)
609  if (TMath::Abs(d->DecayLengthXY()) < fCutsRD[GetGlobalIndex(14,ptbin)] && fExcludedCut!=14) {
610  AliDebug(4, " Ds normalised decay length (XY) doesn't pass the cut");
611  CleanOwnPrimaryVtx(d, aod, origownvtx);
612  return 0;
613  }
614 
615 
616  // Unset recalculated primary vertex when not needed any more
617  CleanOwnPrimaryVtx(d, aod, origownvtx);
618 
619  } // end if (kAll || kCandidate)
620 
621 
622 
623 
624  //___ 3./ PID selection __________________________
625  //_________________________________________________
626  Int_t returnvalueTopo = 1;
627  Int_t returnvaluePID = 1;
628 
629  if (selectionLevel == AliRDHFCuts::kAll ||
630  selectionLevel == AliRDHFCuts::kCandidate ||
631  selectionLevel == AliRDHFCuts::kPID)
632  { returnvaluePID = IsSelectedPID(d); }
633 
634 
635  Int_t returnvalueTot = returnvalueTopo & returnvaluePID;
636 
637  return returnvalueTot;
638 }
639 
640 
641 
642 
643 //---------------------------------------------------------------------------
645 {
646  //
650  //
651 
652  if (!fUsePID) {
653  AliDebug(2, "PID selection inactive. Candidate accepted.");
654  return 1;
655  }
656 
658  if (!d) {
659  AliDebug(2, "AliAODRecoCascadeHF null");
660  return 0;
661  }
662 
663  AliAODTrack *bachelorTrack = (AliAODTrack*) d->GetBachelor();
664  if (!bachelorTrack) {
665  AliDebug(2, "Missing bachelor for the current cascade");
666  return 0;
667  }
668 
669 
670  // - Combined TPC/TOF PID
671  Int_t isKaon = fPidHF -> MakeRawPid(bachelorTrack, AliPID::kKaon);
672 
673  if (isKaon>=0) return 1;
674  else return 0;
675 }
676 
677 
678 
679 
680 //---------------------------------------------------------------------------
682 {
683  //
685  //
686 
687  if (fMaxRapidityCand > -998.) {
688  if (TMath::Abs(y) > fMaxRapidityCand) return kFALSE;
689  else return kTRUE;
690  }
691 
692  if (pt > 5.) {
693  // applying cut for pt > 5 GeV
694  AliDebug(2,Form("pt of cascade = %f (> 5), cutting at |y| < 0.8", pt));
695  if (TMath::Abs(y) > 0.8) return kFALSE;
696  } else {
697  // appliying smooth cut for pt < 5 GeV
698  Double_t maxFiducialY = -0.2/15*pt*pt + 1.9/15*pt + 0.5;
699  Double_t minFiducialY = 0.2/15*pt*pt - 1.9/15*pt - 0.5;
700  AliDebug(2,Form("pt of cascade = %f (< 5), cutting according to the fiducial zone [%f, %f]\n", pt, minFiducialY, maxFiducialY));
701  if (y < minFiducialY || y > maxFiducialY) return kFALSE;
702  }
703 
704  return kTRUE;
705 }
706 
707 
708 
709 
710 //---------------------------------------------------------------------------
712 {
713  //
715  //
716 
718  if (!d) {
719  AliDebug(2, "AliAODRecoCascadeHF null");
720  return kFALSE;
721  }
722 
723  if (!fTrackCuts) {
724  AliFatal("Cut object is not defined for bachelor. Candidate accepted.");
725  return kTRUE;
726  }
727 
728 
729  //___ 1./ Check bachelor tracks __________________
730  //_________________________________________________
731  AliAODTrack *bachelorTrack = (AliAODTrack*) d->GetBachelor();
732  if (!bachelorTrack) return kFALSE;
733 
734 
736  if(!bachelorTrack->HasPointOnITSLayer(0)) return kFALSE;
737  }
738 
739 
740  if (fKinkReject != (!(fTrackCuts->GetAcceptKinkDaughters())) ) {
741  AliError(Form("Not compatible setting: fKinkReject=%1d - fTrackCuts->GetAcceptKinkDaughters()=%1d",fKinkReject, fTrackCuts->GetAcceptKinkDaughters()));
742  return kFALSE;
743  }
744 
745 
746  AliAODVertex *vAOD = (AliAODVertex*) d->GetPrimaryVtx();
747  Double_t pos[3]; vAOD->GetXYZ(pos);
748  Double_t cov[6]; vAOD->GetCovarianceMatrix(cov);
749  const AliESDVertex vESD(pos,cov,100.,100);
750 
751  if (!IsDaughterSelected(bachelorTrack, &vESD, fTrackCuts)) return kFALSE;
752 
753  if (!fV0daughtersCuts) {
754  AliFatal("Cut object is not defined for V0daughters. Candidate accepted.");
755  return kTRUE;
756  }
757 
758 
759 
760  //___ 2./ Check V0 _______________________________
761  //_________________________________________________
762  AliAODv0 *v0 = (AliAODv0*) d->Getv0();
763  if (!v0) return kFALSE;
764 
765  AliAODTrack *v0positiveTrack = (AliAODTrack*) d->Getv0PositiveTrack();
766  AliAODTrack *v0negativeTrack = (AliAODTrack*) d->Getv0NegativeTrack();
767  if (!v0positiveTrack || !v0negativeTrack) return kFALSE;
768 
769 
770  Float_t etaMin=0, etaMax=0; fV0daughtersCuts->GetEtaRange(etaMin,etaMax);
771  if ( (v0positiveTrack->Eta()<=etaMin || v0positiveTrack->Eta()>=etaMax) ||
772  (v0negativeTrack->Eta()<=etaMin || v0negativeTrack->Eta()>=etaMax) ) return kFALSE;
773  Float_t ptMin=0, ptMax=0; fV0daughtersCuts->GetPtRange(ptMin,ptMax);
774  if ( (v0positiveTrack->Pt()<=ptMin || v0positiveTrack->Pt()>=ptMax) ||
775  (v0negativeTrack->Pt()<=ptMin || v0negativeTrack->Pt()>=ptMax) ) return kFALSE;
776 
777 
778  // Condition on nTPCclusters
779  if (fV0daughtersCuts->GetMinNClusterTPC()>0) {
780  if ( ((v0positiveTrack->GetTPCClusterInfo(2,1)) < fV0daughtersCuts->GetMinNClusterTPC()) ||
781  ((v0negativeTrack->GetTPCClusterInfo(2,1)) < fV0daughtersCuts->GetMinNClusterTPC()) ) return kFALSE;
782  }
783 
784 
785  // kTPCrefit status
786  if (v0->GetOnFlyStatus()==kFALSE) { // only for offline V0s
787  if (fV0daughtersCuts->GetRequireTPCRefit()) {
788  if( !(v0positiveTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
789  if( !(v0negativeTrack->GetStatus() & AliESDtrack::kTPCrefit)) return kFALSE;
790  }
791  }
792 
793 
794  // kink condition
795  if (!fV0daughtersCuts->GetAcceptKinkDaughters()) {
796  AliAODVertex *maybeKinkPos = (AliAODVertex*)v0positiveTrack->GetProdVertex();
797  AliAODVertex *maybeKinkNeg = (AliAODVertex*)v0negativeTrack->GetProdVertex();
798  if (maybeKinkPos->GetType()==AliAODVertex::kKink ||
799  maybeKinkNeg->GetType()==AliAODVertex::kKink) return kFALSE;
800  }
801 
802 
803  // Findable clusters > 0 condition - from V0 analysis
804  // if( v0positiveTrack->GetTPCNclsF()<=0 || v0negativeTrack->GetTPCNclsF()<=0 ) return kFALSE;
805  /*
806  Float_t lPosTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
807  Float_t lNegTrackCrossedRows = v0positiveTrack->GetTPCClusterInfo(2,1);
808  fTreeVariableLeastNbrCrossedRows = (Int_t) lPosTrackCrossedRows;
809  if( lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows )
810  fTreeVariableLeastNbrCrossedRows = (Int_t) lNegTrackCrossedRows;
811  //Compute ratio Crossed Rows / Findable clusters
812  //Note: above test avoids division by zero!
813  Float_t lPosTrackCrossedRowsOverFindable = lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF()));
814  Float_t lNegTrackCrossedRowsOverFindable = lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF()));
815  fTreeVariableLeastRatioCrossedRowsOverFindable = lPosTrackCrossedRowsOverFindable;
816  if( lNegTrackCrossedRowsOverFindable < fTreeVariableLeastRatioCrossedRowsOverFindable )
817  fTreeVariableLeastRatioCrossedRowsOverFindable = lNegTrackCrossedRowsOverFindable;
818  //Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here
819  if ( fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8 ) return kFALSE;
820  */
821 
822  return kTRUE;
823 }
824 
825 
826 
827 
828 //---------------------------------------------------------------------------
830 {
831  //
833  //
834 
835  const Int_t nvars = this->GetNVars() ;
836  fV0Type = (this->GetCuts())[nvars-1];
837  TString *sVarNames = GetVarNames();
838 
839  if (sVarNames[nvars-1].Contains("V0 type")) {
840  return (Int_t)fV0Type;
841  } else {
842  AliInfo("AliRDHFCutsDstoK0sK Last variable is not the V0 type!!!");
843  return -999;
844  }
845 }
Double_t fMaxPtCandTrackSPDFirst
flag to select the track kFirst criteria for pt < ptlimit
Definition: AliRDHFCuts.h:438
Int_t GetNVars() const
Definition: AliRDHFCuts.h:240
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
double Double_t
Definition: External.C:58
Double_t InvMassDstoK0sK() const
Bool_t fUseMCVertex
flag to switch on the removal of duaghters from the primary vertex computation
Definition: AliRDHFCuts.h:416
Bool_t SetMCPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Bool_t fRemoveDaughtersFromPrimary
Definition: AliRDHFCuts.h:415
void AddTrackCutsV0daughters(AliESDtrackCuts *v0daug)
AliAODTrack * Getv0NegativeTrack() const
AliAODv0 * Getv0() const
Bool_t AreDtoK0sDaughtersSelected(AliAODRecoDecayHF *rd) const
const Float_t * GetCuts() const
Definition: AliRDHFCuts.h:244
void SetNVars(Int_t nVars)
Definition: AliRDHFCuts.h:383
Double_t CosPointingAngleXY() const
virtual Int_t IsSelectedPID(AliAODRecoDecayHF *obj)
Double_t fMaxRapidityCand
minimum pt of the candidate
Definition: AliRDHFCuts.h:435
TString * GetVarNames() const
Definition: AliRDHFCuts.h:241
Double_t ptMin
AliRDHFCuts & operator=(const AliRDHFCuts &source)
Double_t DecayLengthXYV0() const
Bool_t fUsePID
Definition: AliRDHFCuts.h:410
Bool_t HasBadDaughters() const
AliAODTrack * Getv0PositiveTrack() const
AliRDHFCutsDstoK0sK(const char *name="CutsDstoK0sK")
int Int_t
Definition: External.C:63
Bool_t fUseTrackSelectionWithFilterBits
flag to reject kink daughters
Definition: AliRDHFCuts.h:445
Int_t fnVarsForOpt
Definition: AliRDHFCuts.h:405
float Float_t
Definition: External.C:68
Class for cuts on AOD reconstructed Ds->K0S+K.
AliESDtrackCuts * fTrackCuts
quality cuts on the daughter tracks
Definition: AliRDHFCuts.h:398
AliAODTrack * GetBachelor() const
AliAODVertex * GetOwnPrimaryVtx() const
Double_t nsigma
Float_t * fCutsRD
fnVars*fnPtBins
Definition: AliRDHFCuts.h:408
Double_t CosV0PointingAngle() const
Double_t DecayLengthXY() const
void SetVarNames(Int_t nVars, TString *varNames, Bool_t *isUpperCut)
Bool_t * fVarsForOpt
number of cut vars to be optimized for candidates
Definition: AliRDHFCuts.h:406
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
AliRDHFCutsDstoK0sK & operator=(const AliRDHFCutsDstoK0sK &source)
AliESDtrackCuts * fV0daughtersCuts
V0 type – should be defined as in AliRDHFCuts.h.
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Bool_t fIsCandTrackSPDFirst
IsSelected returns always kTRUE for MC signal.
Definition: AliRDHFCuts.h:437
void SetPtBins(Int_t nPtBinLimits, Float_t *ptBinLimits)
Bool_t fKinkReject
cut on zSPD vertex to remove outliers in centrality vs. tracklets (0=no cut, 1= cut at 12 cm...
Definition: AliRDHFCuts.h:444
AliAODVertex * GetPrimaryVtx() const
bool Bool_t
Definition: External.C:53
Float_t fV0Type
cut to be excluded (-1=none)
Double_t CosPointingAngle() const
Double_t ptMax
AliAODPidHF * fPidHF
enable AOD049 centrality cleanup
Definition: AliRDHFCuts.h:412
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
virtual void GetCutVarsForOpt(AliAODRecoDecayHF *obj, Float_t *vars, Int_t nvars, Int_t *pdgdaughters)
Int_t GetGlobalIndex(Int_t iVar, Int_t iPtBin) const
Bool_t IsDaughterSelected(AliAODTrack *track, const AliESDVertex *primary, AliESDtrackCuts *cuts, const AliAODEvent *aod=0x0) const