AliPhysics  ef3b16e (ef3b16e)
AliCFVertexingHF3Prong.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 2007-2011, 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 to compute variables for correction framework //
21 // for 3-body decays of D mesons (D+, Ds, Lc) //
22 // in bins of cut variables //
23 // Origin: Francesco Prino (prino@to.infn.it) //
24 // Renu Bala (bala@to.infn.it) //
25 // Davide Caffarri (cafarri@pd.infn.it) //
27 
28 #include "AliAODMCParticle.h"
29 #include "AliAODEvent.h"
30 #include "TClonesArray.h"
31 #include "AliCFVertexingHF.h"
32 #include "AliESDtrack.h"
33 #include "TDatabasePDG.h"
34 
35 #include "AliCFVertexingHF3Prong.h"
36 #include "AliCFContainer.h"
37 #include "AliCFTaskVertexingHF.h"
38 
40 ClassImp(AliCFVertexingHF3Prong);
42 
43 //_________________________________________
46  fDecay(decay),
47  fGenDsOption(kCountResonant),
48  fResonantDecay(resonantDecay)
49  {
50  //
51  SetNProngs(3);
52 
55  for(Int_t iP=0; iP<fProngs; iP++){
56  fPtAccCut[iP]=0.1;
57  fEtaAccCut[iP]=0.9;
58  }
59 
60 }
61 //_________________________________________
64  fDecay(decay),
67  {
68  //
69  SetNProngs(3);
70 
73  for(Int_t iP=0; iP<fProngs; iP++){
74  fPtAccCut[iP]=0.1;
75  fEtaAccCut[iP]=0.9;
76  }
77 
78 }
79 //_________________________________________
80 AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay, UInt_t resonantDecay):
81  AliCFVertexingHF(mcArray, originDselection),
82  fDecay(decay),
84  fResonantDecay(resonantDecay)
85 {
86  //
87  SetNProngs(3);
90  for(Int_t iP=0; iP<fProngs; iP++){
91  fPtAccCut[iP]=0.1;
92  fEtaAccCut[iP]=0.9;
93  }
94 }
95 
96 //_________________________________________
97 AliCFVertexingHF3Prong::AliCFVertexingHF3Prong(TClonesArray *mcArray, UShort_t originDselection, Int_t decay):
98  AliCFVertexingHF(mcArray, originDselection),
99  fDecay(decay),
101  fResonantDecay(0)
102 {
103  //
104  SetNProngs(3);
107  for(Int_t iP=0; iP<fProngs; iP++){
108  fPtAccCut[iP]=0.1;
109  fEtaAccCut[iP]=0.9;
110  }
111 }
112 //_____________________________________
114  //
115  if (this != &c) {
116 
118 
119  }
120  return *this;
121 }
122 
123 //__________________________________________
125  // Checks if candidate is signal and D meson is present in MC array
126 
127  Bool_t bSignAssoc = kFALSE;
128  fRecoCandidate = recoCand;
129 
130  if (!fRecoCandidate) {
131  AliError("fRecoCandidate not found, problem in assignement\n");
132  return bSignAssoc;
133  }
134 
135  Int_t pdgCand = -1;
136  Int_t pdgDaughter[3]={-1,-1,-1};
137  if(fDecay==kDplustoKpipi){
138  pdgCand=411;
139  pdgDaughter[0]=321;
140  pdgDaughter[1]=211;
141  pdgDaughter[2]=211;
142  }else if(fDecay==kDstoKKpi){
143  pdgCand=431;
144  pdgDaughter[0]=321;
145  pdgDaughter[1]=321;
146  pdgDaughter[2]=211;
147  }else if(fDecay==kLctopKpi){
148  pdgCand=4122;
149  pdgDaughter[0]=2212;
150  pdgDaughter[1]=321;
151  pdgDaughter[2]=211;
152  }else{
153  AliError("WRONG DECAY SETTING");
154  return bSignAssoc;
155  }
156 
157  Int_t mcLabel = fRecoCandidate->MatchToMC(pdgCand,fmcArray,3,pdgDaughter);
158  if (mcLabel == -1) return bSignAssoc;
159 
161  fFake = 0; // fake candidate
162  if (fFakeSelection==1) return bSignAssoc;
163  }
165  fFake = 2; // non-fake candidate
166  if (fFakeSelection==2) return bSignAssoc;
167  }
168 
169  SetMCLabel(mcLabel);
170  fmcPartCandidate = dynamic_cast<AliAODMCParticle*>(fmcArray->At(fmcLabel));
171 
172  if (!fmcPartCandidate){
173  AliDebug(3,"No part candidate");
174  return bSignAssoc;
175  }
176 
178  if(!CheckMCChannelDecay()){
179  AliDebug(3,"Ds not from the selected resonant channel");
180  return bSignAssoc;
181  }
182  }
183 
185  if (!CheckLc3Prong()) return bSignAssoc;
186  }
187 
188  bSignAssoc = kTRUE;
189  return bSignAssoc;
190 }
191 
192 //______________________________________________
194  //
195  // collecting all the necessary info from MC particle and fill vectorMC: 12 variables
196  // pt_D
197  // y_D
198  // phi_D
199  // ctau
200  // cos point
201  // pt_1
202  // pt_2
203  // pt_3
204  // d0_1
205  // d0_2
206  // d0_3
207  // zPrimVert
208  // centrality
209 
210  Bool_t bGenValues = kFALSE;
211 
212  Int_t pdgCand = -1;
213  if(fDecay==kDplustoKpipi){
214  pdgCand=411;
215  }else if(fDecay==kDstoKKpi){
216  pdgCand=431;
217  }else if(fDecay==kLctopKpi){
218  pdgCand=4122;
219  }else{
220  AliError("WRONG DECAY SETTING");
221  return bGenValues;
222  }
223 
224  Double_t vertD[3] = {0,0,0}; // D origin
225  fmcPartCandidate->XvYvZv(vertD); // cm
226 
227  Int_t nprongs = 3;
228  Int_t daughter[3];
229  Short_t charge = fmcPartCandidate->Charge();
230 
231  // order the daughters as LS,OS,LS, e.g. D+ -> pi+ K- pi+
232  // the 2 LS are ordered so that in pos. 0 there is the one with lower label value
233  Int_t index=0;
234  Int_t nDauLS=0;
235  Int_t nDauOS=0;
236 
237 
238  Int_t nDau=fmcPartCandidate->GetNDaughters();
239  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
240  if(nDau==3){
241  for(Int_t iDau=0; iDau<3; iDau++){
242  Int_t ind = labelFirstDau+iDau;
243  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
244  if(!part){
245  AliError("Daughter particle not found in MC array");
246  return bGenValues;
247  }
248  Short_t signDau=part->Charge();
249  if(signDau==charge){
250  nDauLS++;
251  daughter[index] = ind;
252  index=2;
253  }else{
254  daughter[1] = ind;
255  nDauOS++;
256  }
257  }
258  }else if(nDau==2){
259  for(Int_t iDau=0; iDau<2; iDau++){
260  Int_t ind = labelFirstDau+iDau;
261  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
262  if(!part){
263  AliError("Daughter particle not found in MC array");
264  return bGenValues;
265  }
266  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
267  if(pdgCode==211 || pdgCode==321 || pdgCode==2212){
268  Short_t signDau=part->Charge();
269  if(signDau==charge){
270  nDauLS++;
271  daughter[index] = ind;
272  index=2;
273  }else{
274  daughter[1] = ind;
275  nDauOS++;
276  }
277  }else{
278  Int_t nDauRes=part->GetNDaughters();
279  if(nDauRes!=2){
280  AliError("Wrong resonant decay");
281  return bGenValues;
282  }
283  Int_t labelFirstDauRes = part->GetDaughter(0);
284  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
285  Int_t indDR = labelFirstDauRes+iDauRes;
286  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(fmcArray->At(indDR));
287  if(!partDR){
288  AliError("Daughter particle not found in MC array");
289  return bGenValues;
290  }
291  Short_t signDau=partDR->Charge();
292  if(signDau==charge){
293  nDauLS++;
294  daughter[index] = ind;
295  index=2;
296  }else{
297  daughter[1] = ind;
298  nDauOS++;
299  }
300  }
301  }
302  }
303  }else{
304  AliError(Form("Wrong number of daughters %d",nDau));
305  return bGenValues;
306  }
307 
308  if(nDauLS!=2 || nDauOS!=1){
309  AliError(Form("Wrong decay channel: LS and OS daughters not OK: %d %d",nDauLS,nDauOS));
310  return bGenValues;
311  }
312  if(daughter[0]>daughter[2]){
313  Int_t tmp=daughter[0];
314  daughter[0]=daughter[2];
315  daughter[2]=tmp;
316  }
317 
318  // getting the momentum from the daughters and decay vertex
319  Double_t px[3],py[3],pz[3],pt[3];
320  Double_t vertDec[3] = {0,0,0}; // decay vertex
321  for(Int_t iDau=0; iDau<3; iDau++){
322  AliAODMCParticle* part=dynamic_cast<AliAODMCParticle*>(fmcArray->At(daughter[iDau]));
323  if(!part){
324  AliError("Daughter particle not found in MC array");
325  return bGenValues;
326  }
327  px[iDau]=part->Px();
328  py[iDau]=part->Py();
329  pz[iDau]=part->Pz();
330  pt[iDau]=part->Pt();
331  if(iDau==0) part->XvYvZv(vertDec);
332  }
333 
334  Double_t d0[3] = {0.,0.,0.}; // dummy values!!!!
335 
336  AliAODRecoDecayHF* decay = new AliAODRecoDecayHF(vertD,vertDec,nprongs,charge,px,py,pz,d0);
337  Double_t cT = decay->Ct(pdgCand);
338 
339  Int_t localmult = -1;
341  localmult = ComputeLocalMultiplicity(decay->Eta(), decay->Phi(), 0.4);
342  }
343 
344  switch (fConfiguration){
346  vectorMC[0] = fmcPartCandidate->Pt();
347  vectorMC[1] = fmcPartCandidate->Y() ;
348  vectorMC[2] = fmcPartCandidate->Phi();
349  vectorMC[3] = cT*1.E4 ; // in micron
350  vectorMC[4] = 1.01; // cos pointing angle, dummy value, meaningless in MC
351  vectorMC[5] = pt[0];
352  vectorMC[6] = pt[1];
353  vectorMC[7] = pt[2];
354  vectorMC[8] = fzMCVertex; // z of reconstructed of primary vertex
355  vectorMC[9] = fCentValue; // reconstructed centrality value
356  vectorMC[10] = 1.; // fake: always filling with 1 at MC level
357  vectorMC[11] = 1.01; // dummy value for cosPointingXY multiplicity
358  vectorMC[12] = 0.; // dummy value for NormalizedDecayLengthXY multiplicity
359  vectorMC[13] = fMultiplicity; // reconstructed multiplicity
360 
361  if (fDecay==kLctopKpi){
362  vectorMC[11] = 0.; //dist12
363  vectorMC[12] = 0.; //dist23
364  vectorMC[13] = 0.; //sigmaVtx
365  vectorMC[14] = 0.; //sumd02
366  vectorMC[15] = 1.01; // dummy value for cosPointingXY multiplicity
367  vectorMC[16] = 0.; // dummy value for NormalizedDecayLengthXY multiplicity
368  vectorMC[17] = fMultiplicity; // reconstructed multiplicity
369  }
370  break;
371 
373  vectorMC[0] = fmcPartCandidate->Pt();
374  vectorMC[1] = fmcPartCandidate->Y() ;
375  vectorMC[2] = cT*1.E4; // in micron
376  vectorMC[3] = fmcPartCandidate->Phi();
377  vectorMC[4] = fzMCVertex;
378  vectorMC[5] = fCentValue; // dummy value for dca, meaningless in MC
379  vectorMC[6] = 1. ; // fake: always filling with 1 at MC level
380  vectorMC[7] = fMultiplicity; // dummy value for d0pi, meaningless in MC, in micron
381  break;
383  vectorMC[0] = fmcPartCandidate->Pt();
384  vectorMC[1] = fmcPartCandidate->Y() ;
385  vectorMC[2] = fCentValue; // dummy value for dca, meaningless in MC
386  vectorMC[3] = fMultiplicity; // dummy value for d0pi, meaningless in MC, in micron
387  break;
389  vectorMC[0] = fmcPartCandidate->Pt();
390  vectorMC[1] = fmcPartCandidate->Y() ;
391  vectorMC[2] = fCentValue; // centrality
392  vectorMC[3] = fMultiplicity; // multiplicity (diff estimators can be used)
393  vectorMC[4] = localmult; // local multiplicity (Ntracks in R<0.4)
394  vectorMC[5] = fq2; // magnitude of reduced flow vector (computed using TPC tracks)
395  break;
396  }
397  delete decay;
398  bGenValues = kTRUE;
399  return bGenValues;
400 }
401 
402 
403 //____________________________________________
405 {
406  // Fill vector (see above) with reconstructed quantities
407  Bool_t bFillRecoValues=kFALSE;
408 
409  Int_t pdgCand = -1;
410  if(fDecay==kDplustoKpipi){
411  pdgCand=411;
412  }else if(fDecay==kDstoKKpi){
413  pdgCand=431;
414  }else if(fDecay==kLctopKpi){
415  pdgCand=4122;
416  // AliError("LambdaC not yet implemented");
417  // return bFillRecoValues;
418  }else{
419  AliError("WRONG DECAY SETTING");
420  return bFillRecoValues;
421  }
422 
424  Short_t charge=decay3->Charge();
425  Double_t rapidity=decay3->Y(pdgCand);
426  Double_t cT=decay3->Ct(pdgCand);
427  Double_t pt = decay3->Pt();
428  Double_t cosPointingAngle = decay3->CosPointingAngle();
429  Double_t phi = decay3->Phi();
430  Double_t dist12= decay3->GetDist12toPrim();
431  Double_t dist23 = decay3->GetDist23toPrim();
432  Double_t sigmVert = decay3->GetSigmaVert();
433  Double_t cosPointingAngleXY = decay3->CosPointingAngleXY();
434  Double_t normDecayLengthXY = decay3->NormalizedDecayLengthXY();
435 
436  Int_t daughtSorted[3];
437  Int_t tmpIndex=0;
438  Int_t nDauLS=0;
439  Int_t nDauOS=0;
440  for(Int_t iDau=0; iDau<3; iDau++){
441  AliAODTrack *trk = (AliAODTrack*)decay3->GetDaughter(iDau);
442  Short_t chargedau=trk->Charge();
443  if(chargedau==charge){
444  daughtSorted[tmpIndex]=iDau;
445  tmpIndex=2;
446  nDauLS++;
447  }else{
448  daughtSorted[1]=iDau;
449  nDauOS++;
450  }
451  }
452 
453  if(nDauLS!=2 || nDauOS!=1){
454  AliError("Wrong decay channel: number of OS and LS tracks not OK");
455  return bFillRecoValues;
456  }
457 
458  if(daughtSorted[0]>daughtSorted[2]){
459  Int_t tmp=daughtSorted[0];
460  daughtSorted[0]=daughtSorted[2];
461  daughtSorted[2]=tmp;
462  }
463 
464 
465  Int_t localmult = -1;
467  localmult = ComputeLocalMultiplicity(decay3->Eta(), decay3->Phi(), 0.4);
468  }
469 
470  switch (fConfiguration){
472  vectorReco[0] = pt;
473  vectorReco[1] = rapidity;
474  vectorReco[2] = phi;
475  vectorReco[3] = cT*1.E4; // in micron
476  vectorReco[4] = cosPointingAngle; // in micron
477  vectorReco[5] = decay3->PtProng(daughtSorted[0]);
478  vectorReco[6] = decay3->PtProng(daughtSorted[1]);
479  vectorReco[7] = decay3->PtProng(daughtSorted[2]);
480  vectorReco[8] = fzPrimVertex; // z of reconstructed of primary vertex
481  vectorReco[9] = fCentValue; //reconstructed centrality value
482  vectorReco[10] = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2)
483  vectorReco[11] = cosPointingAngleXY;
484  vectorReco[12] = normDecayLengthXY; // in cm
485  vectorReco[13] = fMultiplicity; // reconstructed multiplicity
486 
487  if(fDecay==kLctopKpi){
488  Double_t d0prong0 = decay3->Getd0Prong(daughtSorted[0]);
489  Double_t d0prong1 = decay3->Getd0Prong(daughtSorted[1]);
490  Double_t d0prong2 = decay3->Getd0Prong(daughtSorted[2]);
491  Double_t sumd02 =(d0prong0*d0prong0 + d0prong1*d0prong1 + d0prong2*d0prong2);
492  vectorReco[11] = dist12*1.E4;
493  vectorReco[12] = dist23*1.E4;
494  vectorReco[13] = sigmVert*1.E4;
495  vectorReco[14] = sumd02*1.E8;
496  vectorReco[15] = cosPointingAngleXY;
497  vectorReco[16] = normDecayLengthXY; // in cm
498  vectorReco[17] = fMultiplicity; // reconstructed multiplicity
499  }
500  break;
502  vectorReco[0] = pt;
503  vectorReco[1] = rapidity ;
504  vectorReco[2] = cT*1.E4; // in micron
505  vectorReco[3] = phi;
506  vectorReco[4] = fzPrimVertex;
507  vectorReco[5] = fCentValue;
508  vectorReco[6] = fFake ;
509  vectorReco[7] = fMultiplicity;
510  break;
512  vectorReco[0] = pt;
513  vectorReco[1] = rapidity ;
514  vectorReco[2] = fCentValue;
515  vectorReco[3] = fMultiplicity;
516  break;
518  vectorReco[0] = pt;
519  vectorReco[1] = rapidity;
520  vectorReco[2] = fCentValue; // centrality
521  vectorReco[3] = fMultiplicity; // multiplicity (diff estimators can be used)
522  vectorReco[4] = localmult; // local multiplicity (Ntracks in R<0.4)
523  vectorReco[5] = fq2; // magnitude of reduced flow vector (computed using TPC tracks)
524  break;
525  }
526 
527  bFillRecoValues = kTRUE;
528  return bFillRecoValues;
529 }
530 
531 
532 //_____________________________________________________________
534 {
535  // Check the pdg codes of the daughters
536  Bool_t checkCD = kFALSE;
537 
538  Int_t pdgCand = -1;
539  Int_t pdgDaughter[3]={-1,-1,-1};
540  if(fDecay==kDplustoKpipi){
541  pdgCand=411;
542  pdgDaughter[0]=321;
543  pdgDaughter[1]=211;
544  pdgDaughter[2]=211;
545  }else if(fDecay==kDstoKKpi){
546  pdgCand=431;
547  pdgDaughter[0]=321;
548  pdgDaughter[1]=321;
549  pdgDaughter[2]=211;
550  }else if(fDecay==kLctopKpi){
551  pdgCand=4122;
552  pdgDaughter[0]=2212;
553  pdgDaughter[1]=321;
554  pdgDaughter[2]=211;
555 
556  // AliError("LambdaC not yet implemented");
557  // return checkCD;
558  }else{
559  AliError("WRONG DECAY SETTING");
560  return checkCD;
561  }
562 
563 
564  Int_t daughter[3];
565  Double_t sumPxDau=0.;
566  Double_t sumPyDau=0.;
567  Double_t sumPzDau=0.;
568 
569  Int_t nDau=fmcPartCandidate->GetNDaughters();
570  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
571 
573 
574  if(nDau==3){
576  AliDebug(3,"Decay channel in direct KKpi, should be skipped");
577  return checkCD;
578  }
579  for(Int_t iDau=0; iDau<3; iDau++){
580  Int_t ind = labelFirstDau+iDau;
581  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
582  if(!part){
583  AliError("Daughter particle not found in MC array");
584  return checkCD;
585  }
586  daughter[iDau]=TMath::Abs(part->GetPdgCode());
587  sumPxDau+=part->Px();
588  sumPyDau+=part->Py();
589  sumPzDau+=part->Pz();
590  }
591  }else if(nDau==2){
592  if(fDecay==kDstoKKpi && fGenDsOption==kCountNonResonant) return checkCD;
593  Int_t nDauFound=0;
594  for(Int_t iDau=0; iDau<2; iDau++){
595  Int_t ind = labelFirstDau+iDau;
596  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
597  if(!part){
598  AliError("Daughter particle not found in MC array");
599  return checkCD;
600  }
601  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
602  if(pdgCode==211 || pdgCode==321 || pdgCode==2212){
603  if(nDauFound>=3) return checkCD;
604  daughter[nDauFound]=pdgCode;
605  sumPxDau+=part->Px();
606  sumPyDau+=part->Py();
607  sumPzDau+=part->Pz();
608  nDauFound++;
609  }else{
610  if(fDecay==kDstoKKpi && fGenDsOption!=3){
611  Int_t pdgCodeRes=TMath::Abs(part->GetPdgCode());
612  if(fGenDsOption==kCountPhipi && pdgCodeRes!=333) return checkCD;
613  else if(fGenDsOption==kCountK0stK && pdgCodeRes!=313) return checkCD;
614  }
615  Int_t nDauRes=part->GetNDaughters();
616  if(nDauRes!=2) return checkCD;
617  Int_t labelFirstDauRes = part->GetDaughter(0);
618  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
619  Int_t indDR = labelFirstDauRes+iDauRes;
620  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(fmcArray->At(indDR));
621  if(!partDR){
622  AliError("Daughter particle not found in MC array");
623  return checkCD;
624  }
625  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
626  if(nDauFound>=3) return checkCD;
627  daughter[nDauFound]=pdgCodeDR;
628  sumPxDau+=partDR->Px();
629  sumPyDau+=partDR->Py();
630  sumPzDau+=partDR->Pz();
631  nDauFound++;
632  }
633  }
634  }
635  }else{
636  return checkCD;
637  }
638  for(Int_t iDau1=0; iDau1<3; iDau1++){
639  for(Int_t iDau2=iDau1; iDau2<3; iDau2++){
640  if(daughter[iDau1]<daughter[iDau2]){
641  Int_t tmp=daughter[iDau1];
642  daughter[iDau1]=daughter[iDau2];
643  daughter[iDau2]=tmp;
644  }
645  }
646  }
647  for(Int_t iDau=0; iDau<3; iDau++){
648  if(daughter[iDau]!=pdgDaughter[iDau]){
649  AliDebug(2, "Wrong decay channel from MC, skipping!!");
650  return checkCD;
651  }
652  }
653 
654  Double_t pxMother=fmcPartCandidate->Px();
655  Double_t pyMother=fmcPartCandidate->Py();
656  Double_t pzMother=fmcPartCandidate->Pz();
657  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
658  TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
659  TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
660  AliDebug(2, "Momentum conservation violated, skipping!!");
661  return checkCD;
662  }
663 
664  checkCD = kTRUE;
665  return checkCD;
666 
667 }
668 //---------------------------------
670 {
671  Int_t numberOfLambdac=0;
672  if(TMath::Abs(fmcPartCandidate->GetPdgCode())!=4122) return kFALSE;
673  Int_t nDaugh = (Int_t)fmcPartCandidate->GetNDaughters();
674  if(nDaugh<2) return kFALSE;
675  if(nDaugh>3) return kFALSE;
676  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(0));
677  if(!pdaugh1) {return kFALSE;}
678  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
679  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(1));
680  if(!pdaugh2) {return kFALSE;}
681  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
682  if(nDaugh==3){
684  Int_t thirdDaugh=fmcPartCandidate->GetDaughter(1)-1;
685  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)fmcArray->At(thirdDaugh);
686  if(!pdaugh3) return kFALSE;
687  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
688  if((number1==321 && number2==211 && number3==2212) || (number1==211 && number2==321 && number3==2212) || (number1==211 && number2==2212 && number3==321) || (number1==321 && number2==2212 && number3==211) || (number1==2212 && number2==321 && number3==211) || (number1==2212 && number2==211 && number3==321)) numberOfLambdac++;
689  }
690  if(nDaugh==2){
692  Int_t nfiglieK=0;
693  if((number1==2212 && number2==313)){
695  nfiglieK=pdaugh2->GetNDaughters();
696  if(nfiglieK!=2) return kFALSE;
697  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
698  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
699  if(!pdaughK1) return kFALSE;
700  if(!pdaughK2) return kFALSE;
701  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
702  }
703  if((number1==313 && number2==2212)){
705  nfiglieK=pdaugh1->GetNDaughters();
706  if(nfiglieK!=2) return kFALSE;
707  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
708  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
709  if(!pdaughK1) return kFALSE;
710  if(!pdaughK2) return kFALSE;
711  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
712  }
713  Int_t nfiglieDelta=0;
714  if(number1==321 && number2==2224){
716  nfiglieDelta=pdaugh2->GetNDaughters();
717  if(nfiglieDelta!=2) return kFALSE;
718  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
719  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
720  if(!pdaughD1) return kFALSE;
721  if(!pdaughD2) return kFALSE;
722  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
723  }
724  if(number1==2224 && number2==321){
726  nfiglieDelta=pdaugh1->GetNDaughters();
727  if(nfiglieDelta!=2) return kFALSE;
728  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
729  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
730  if(!pdaughD1) return kFALSE;
731  if(!pdaughD2) return kFALSE;
732  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
733  }
734 
735  Int_t nfiglieLa=0;
736  if(number1==3124 && number2==211){
738  nfiglieLa=pdaugh1->GetNDaughters();
739  if(nfiglieLa!=2) return kFALSE;
740  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
741  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
742  if(!pdaughL1) return kFALSE;
743  if(!pdaughL2) return kFALSE;
744  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
745  }
746  if(number1==211 && number2==3124){
748  nfiglieLa=pdaugh2->GetNDaughters();
749  if(nfiglieLa!=2) return kFALSE;
750  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
751  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
752  if(!pdaughL1) return kFALSE;
753  if(!pdaughL2) return kFALSE;
754  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
755 
756  }
757  }
758  if(numberOfLambdac>0) return kTRUE;
759  return kFALSE;
760 }
Int_t charge
Double_t NormalizedDecayLengthXY() const
AliCFVertexingHF & operator=(const AliCFVertexingHF &c)
double Double_t
Definition: External.C:58
TClonesArray * fmcArray
Int_t fGenDsOption
decay mode id
Double_t Ct(UInt_t pdg) const
Int_t ComputeLocalMultiplicity(Double_t etaD, Double_t phiD, Double_t R) const
AliAODMCParticle * fmcPartCandidate
Reconstructed HF candidate.
TCanvas * c
Definition: TestFitELoss.C:172
super fast configuration, only (pt,y,centrality)
Double_t CosPointingAngleXY() const
AliCFVertexingHF3Prong(Int_t decay, UInt_t resonantDecay)
all decays (resonant + non-resonant)
void SetNProngs(Int_t nProngs)
Float_t * fPtAccCut
centrality value
Float_t fFake
fakes selection: 0 –> all, 1 –> non-fake, 2 –> fake
Int_t fConfiguration
array of tracks
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
rapidity
Definition: HFPtSpectrum.C:47
UInt_t fResonantDecay
option for selection Ds (see enum)
short Short_t
Definition: External.C:23
Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *recoCand)
AliAODRecoDecayHF * fRecoCandidate
mcArray candidate
decay
Definition: HFPtSpectrum.C:41
Int_t fmcLabel
flag to keep only the charm particles that comes from beauty decays
Double_t fzPrimVertex
get Number of variables for the container from the channel decay
Int_t NumberOfFakeDaughters() const
Bool_t GetGeneratedValuesFromMCParticle(Double_t *)
Int_t fProngs
results of the MatchToMC()
unsigned short UShort_t
Definition: External.C:28
AliCFVertexingHF3Prong & operator=(const AliCFVertexingHF3Prong &other)
Double_t fq2
multiplicity of the event
bool Bool_t
Definition: External.C:53
Double_t CosPointingAngle() const
void SetMCLabel(Int_t mcLabel)
slow configuration, all variables
Double_t fzMCVertex
Reco z primary vertex.
Class to compute variables for correction framework // for 3-body decays of D mesons (D+...
Double_t fMultiplicity
flag to remove events not geenrated with PYTHIA
Bool_t GetRecoValuesFromCandidate(Double_t *) const
Class for HF corrections as a function of many variables and step.
fast configuration, only a subset of variables