AliPhysics  5eaf189 (5eaf189)
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  switch (fConfiguration){
341  vectorMC[0] = fmcPartCandidate->Pt();
342  vectorMC[1] = fmcPartCandidate->Y() ;
343  vectorMC[2] = fmcPartCandidate->Phi();
344  vectorMC[3] = cT*1.E4 ; // in micron
345  vectorMC[4] = 1.01; // cos pointing angle, dummy value, meaningless in MC
346  vectorMC[5] = pt[0];
347  vectorMC[6] = pt[1];
348  vectorMC[7] = pt[2];
349  vectorMC[8] = fzMCVertex; // z of reconstructed of primary vertex
350  vectorMC[9] = fCentValue; // reconstructed centrality value
351  vectorMC[10] = 1.; // fake: always filling with 1 at MC level
352  vectorMC[11] = 1.01; // dummy value for cosPointingXY multiplicity
353  vectorMC[12] = 0.; // dummy value for NormalizedDecayLengthXY multiplicity
354  vectorMC[13] = fMultiplicity; // reconstructed multiplicity
355 
356  if (fDecay==kLctopKpi){
357  vectorMC[11] = 0.; //dist12
358  vectorMC[12] = 0.; //dist23
359  vectorMC[13] = 0.; //sigmaVtx
360  vectorMC[14] = 0.; //sumd02
361  vectorMC[15] = 1.01; // dummy value for cosPointingXY multiplicity
362  vectorMC[16] = 0.; // dummy value for NormalizedDecayLengthXY multiplicity
363  vectorMC[17] = fMultiplicity; // reconstructed multiplicity
364  }
365  break;
366 
368  vectorMC[0] = fmcPartCandidate->Pt();
369  vectorMC[1] = fmcPartCandidate->Y() ;
370  vectorMC[2] = cT*1.E4; // in micron
371  vectorMC[3] = fmcPartCandidate->Phi();
372  vectorMC[4] = fzMCVertex;
373  vectorMC[5] = fCentValue; // dummy value for dca, meaningless in MC
374  vectorMC[6] = 1. ; // fake: always filling with 1 at MC level
375  vectorMC[7] = fMultiplicity; // dummy value for d0pi, meaningless in MC, in micron
376  break;
378  vectorMC[0] = fmcPartCandidate->Pt();
379  vectorMC[1] = fmcPartCandidate->Y() ;
380  vectorMC[2] = fCentValue; // dummy value for dca, meaningless in MC
381  vectorMC[3] = fMultiplicity; // dummy value for d0pi, meaningless in MC, in micron
382  break;
383  }
384  delete decay;
385  bGenValues = kTRUE;
386  return bGenValues;
387 }
388 
389 
390 //____________________________________________
392 {
393  // Fill vector (see above) with reconstructed quantities
394  Bool_t bFillRecoValues=kFALSE;
395 
396  Int_t pdgCand = -1;
397  if(fDecay==kDplustoKpipi){
398  pdgCand=411;
399  }else if(fDecay==kDstoKKpi){
400  pdgCand=431;
401  }else if(fDecay==kLctopKpi){
402  pdgCand=4122;
403  // AliError("LambdaC not yet implemented");
404  // return bFillRecoValues;
405  }else{
406  AliError("WRONG DECAY SETTING");
407  return bFillRecoValues;
408  }
409 
411  Short_t charge=decay3->Charge();
412  Double_t rapidity=decay3->Y(pdgCand);
413  Double_t cT=decay3->Ct(pdgCand);
414  Double_t pt = decay3->Pt();
415  Double_t cosPointingAngle = decay3->CosPointingAngle();
416  Double_t phi = decay3->Phi();
417  Double_t dist12= decay3->GetDist12toPrim();
418  Double_t dist23 = decay3->GetDist23toPrim();
419  Double_t sigmVert = decay3->GetSigmaVert();
420  Double_t cosPointingAngleXY = decay3->CosPointingAngleXY();
421  Double_t normDecayLengthXY = decay3->NormalizedDecayLengthXY();
422 
423  Int_t daughtSorted[3];
424  Int_t tmpIndex=0;
425  Int_t nDauLS=0;
426  Int_t nDauOS=0;
427  for(Int_t iDau=0; iDau<3; iDau++){
428  AliAODTrack *trk = (AliAODTrack*)decay3->GetDaughter(iDau);
429  Short_t chargedau=trk->Charge();
430  if(chargedau==charge){
431  daughtSorted[tmpIndex]=iDau;
432  tmpIndex=2;
433  nDauLS++;
434  }else{
435  daughtSorted[1]=iDau;
436  nDauOS++;
437  }
438  }
439 
440  if(nDauLS!=2 || nDauOS!=1){
441  AliError("Wrong decay channel: number of OS and LS tracks not OK");
442  return bFillRecoValues;
443  }
444 
445  if(daughtSorted[0]>daughtSorted[2]){
446  Int_t tmp=daughtSorted[0];
447  daughtSorted[0]=daughtSorted[2];
448  daughtSorted[2]=tmp;
449  }
450 
451 
452  switch (fConfiguration){
454  vectorReco[0] = pt;
455  vectorReco[1] = rapidity;
456  vectorReco[2] = phi;
457  vectorReco[3] = cT*1.E4; // in micron
458  vectorReco[4] = cosPointingAngle; // in micron
459  vectorReco[5] = decay3->PtProng(daughtSorted[0]);
460  vectorReco[6] = decay3->PtProng(daughtSorted[1]);
461  vectorReco[7] = decay3->PtProng(daughtSorted[2]);
462  vectorReco[8] = fzPrimVertex; // z of reconstructed of primary vertex
463  vectorReco[9] = fCentValue; //reconstructed centrality value
464  vectorReco[10] = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2)
465  vectorReco[11] = cosPointingAngleXY;
466  vectorReco[12] = normDecayLengthXY; // in cm
467  vectorReco[13] = fMultiplicity; // reconstructed multiplicity
468 
469  if(fDecay==kLctopKpi){
470  Double_t d0prong0 = decay3->Getd0Prong(daughtSorted[0]);
471  Double_t d0prong1 = decay3->Getd0Prong(daughtSorted[1]);
472  Double_t d0prong2 = decay3->Getd0Prong(daughtSorted[2]);
473  Double_t sumd02 =(d0prong0*d0prong0 + d0prong1*d0prong1 + d0prong2*d0prong2);
474  vectorReco[11] = dist12*1.E4;
475  vectorReco[12] = dist23*1.E4;
476  vectorReco[13] = sigmVert*1.E4;
477  vectorReco[14] = sumd02*1.E8;
478  vectorReco[15] = cosPointingAngleXY;
479  vectorReco[16] = normDecayLengthXY; // in cm
480  vectorReco[17] = fMultiplicity; // reconstructed multiplicity
481  }
482  break;
484  vectorReco[0] = pt;
485  vectorReco[1] = rapidity ;
486  vectorReco[2] = cT*1.E4; // in micron
487  vectorReco[3] = phi;
488  vectorReco[4] = fzPrimVertex;
489  vectorReco[5] = fCentValue;
490  vectorReco[6] = fFake ;
491  vectorReco[7] = fMultiplicity;
492  break;
494  vectorReco[0] = pt;
495  vectorReco[1] = rapidity ;
496  vectorReco[2] = fCentValue;
497  vectorReco[3] = fMultiplicity;
498  break;
499  }
500 
501  bFillRecoValues = kTRUE;
502  return bFillRecoValues;
503 }
504 
505 
506 //_____________________________________________________________
508 {
509  // Check the pdg codes of the daughters
510  Bool_t checkCD = kFALSE;
511 
512  Int_t pdgCand = -1;
513  Int_t pdgDaughter[3]={-1,-1,-1};
514  if(fDecay==kDplustoKpipi){
515  pdgCand=411;
516  pdgDaughter[0]=321;
517  pdgDaughter[1]=211;
518  pdgDaughter[2]=211;
519  }else if(fDecay==kDstoKKpi){
520  pdgCand=431;
521  pdgDaughter[0]=321;
522  pdgDaughter[1]=321;
523  pdgDaughter[2]=211;
524  }else if(fDecay==kLctopKpi){
525  pdgCand=4122;
526  pdgDaughter[0]=2212;
527  pdgDaughter[1]=321;
528  pdgDaughter[2]=211;
529 
530  // AliError("LambdaC not yet implemented");
531  // return checkCD;
532  }else{
533  AliError("WRONG DECAY SETTING");
534  return checkCD;
535  }
536 
537 
538  Int_t daughter[3];
539  Double_t sumPxDau=0.;
540  Double_t sumPyDau=0.;
541  Double_t sumPzDau=0.;
542 
543  Int_t nDau=fmcPartCandidate->GetNDaughters();
544  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
545 
547 
548  if(nDau==3){
550  AliDebug(3,"Decay channel in direct KKpi, should be skipped");
551  return checkCD;
552  }
553  for(Int_t iDau=0; iDau<3; iDau++){
554  Int_t ind = labelFirstDau+iDau;
555  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
556  if(!part){
557  AliError("Daughter particle not found in MC array");
558  return checkCD;
559  }
560  daughter[iDau]=TMath::Abs(part->GetPdgCode());
561  sumPxDau+=part->Px();
562  sumPyDau+=part->Py();
563  sumPzDau+=part->Pz();
564  }
565  }else if(nDau==2){
566  if(fDecay==kDstoKKpi && fGenDsOption==kCountNonResonant) return checkCD;
567  Int_t nDauFound=0;
568  for(Int_t iDau=0; iDau<2; iDau++){
569  Int_t ind = labelFirstDau+iDau;
570  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
571  if(!part){
572  AliError("Daughter particle not found in MC array");
573  return checkCD;
574  }
575  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
576  if(pdgCode==211 || pdgCode==321 || pdgCode==2212){
577  if(nDauFound>=3) return checkCD;
578  daughter[nDauFound]=pdgCode;
579  sumPxDau+=part->Px();
580  sumPyDau+=part->Py();
581  sumPzDau+=part->Pz();
582  nDauFound++;
583  }else{
584  if(fDecay==kDstoKKpi && fGenDsOption!=3){
585  Int_t pdgCodeRes=TMath::Abs(part->GetPdgCode());
586  if(fGenDsOption==kCountPhipi && pdgCodeRes!=333) return checkCD;
587  else if(fGenDsOption==kCountK0stK && pdgCodeRes!=313) return checkCD;
588  }
589  Int_t nDauRes=part->GetNDaughters();
590  if(nDauRes!=2) return checkCD;
591  Int_t labelFirstDauRes = part->GetDaughter(0);
592  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
593  Int_t indDR = labelFirstDauRes+iDauRes;
594  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(fmcArray->At(indDR));
595  if(!partDR){
596  AliError("Daughter particle not found in MC array");
597  return checkCD;
598  }
599  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
600  if(nDauFound>=3) return checkCD;
601  daughter[nDauFound]=pdgCodeDR;
602  sumPxDau+=partDR->Px();
603  sumPyDau+=partDR->Py();
604  sumPzDau+=partDR->Pz();
605  nDauFound++;
606  }
607  }
608  }
609  }else{
610  return checkCD;
611  }
612  for(Int_t iDau1=0; iDau1<3; iDau1++){
613  for(Int_t iDau2=iDau1; iDau2<3; iDau2++){
614  if(daughter[iDau1]<daughter[iDau2]){
615  Int_t tmp=daughter[iDau1];
616  daughter[iDau1]=daughter[iDau2];
617  daughter[iDau2]=tmp;
618  }
619  }
620  }
621  for(Int_t iDau=0; iDau<3; iDau++){
622  if(daughter[iDau]!=pdgDaughter[iDau]){
623  AliDebug(2, "Wrong decay channel from MC, skipping!!");
624  return checkCD;
625  }
626  }
627 
628  Double_t pxMother=fmcPartCandidate->Px();
629  Double_t pyMother=fmcPartCandidate->Py();
630  Double_t pzMother=fmcPartCandidate->Pz();
631  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
632  TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
633  TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
634  AliDebug(2, "Momentum conservation violated, skipping!!");
635  return checkCD;
636  }
637 
638  checkCD = kTRUE;
639  return checkCD;
640 
641 }
642 //---------------------------------
644 {
645  Int_t numberOfLambdac=0;
646  if(TMath::Abs(fmcPartCandidate->GetPdgCode())!=4122) return kFALSE;
647  Int_t nDaugh = (Int_t)fmcPartCandidate->GetNDaughters();
648  if(nDaugh<2) return kFALSE;
649  if(nDaugh>3) return kFALSE;
650  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(0));
651  if(!pdaugh1) {return kFALSE;}
652  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
653  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(1));
654  if(!pdaugh2) {return kFALSE;}
655  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
656  if(nDaugh==3){
658  Int_t thirdDaugh=fmcPartCandidate->GetDaughter(1)-1;
659  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)fmcArray->At(thirdDaugh);
660  if(!pdaugh3) return kFALSE;
661  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
662  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++;
663  }
664  if(nDaugh==2){
666  Int_t nfiglieK=0;
667  if((number1==2212 && number2==313)){
669  nfiglieK=pdaugh2->GetNDaughters();
670  if(nfiglieK!=2) return kFALSE;
671  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
672  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
673  if(!pdaughK1) return kFALSE;
674  if(!pdaughK2) return kFALSE;
675  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
676  }
677  if((number1==313 && number2==2212)){
679  nfiglieK=pdaugh1->GetNDaughters();
680  if(nfiglieK!=2) return kFALSE;
681  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
682  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
683  if(!pdaughK1) return kFALSE;
684  if(!pdaughK2) return kFALSE;
685  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
686  }
687  Int_t nfiglieDelta=0;
688  if(number1==321 && number2==2224){
690  nfiglieDelta=pdaugh2->GetNDaughters();
691  if(nfiglieDelta!=2) return kFALSE;
692  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
693  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
694  if(!pdaughD1) return kFALSE;
695  if(!pdaughD2) return kFALSE;
696  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
697  }
698  if(number1==2224 && number2==321){
700  nfiglieDelta=pdaugh1->GetNDaughters();
701  if(nfiglieDelta!=2) return kFALSE;
702  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
703  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
704  if(!pdaughD1) return kFALSE;
705  if(!pdaughD2) return kFALSE;
706  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
707  }
708 
709  Int_t nfiglieLa=0;
710  if(number1==3124 && number2==211){
712  nfiglieLa=pdaugh1->GetNDaughters();
713  if(nfiglieLa!=2) return kFALSE;
714  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
715  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
716  if(!pdaughL1) return kFALSE;
717  if(!pdaughL2) return kFALSE;
718  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
719  }
720  if(number1==211 && number2==3124){
722  nfiglieLa=pdaugh2->GetNDaughters();
723  if(nfiglieLa!=2) return kFALSE;
724  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
725  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
726  if(!pdaughL1) return kFALSE;
727  if(!pdaughL2) return kFALSE;
728  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
729 
730  }
731  }
732  if(numberOfLambdac>0) return kTRUE;
733  return kFALSE;
734 }
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
AliAODMCParticle * fmcPartCandidate
Reconstructed HF candidate.
TCanvas * c
Definition: TestFitELoss.C:172
Double_t CosPointingAngleXY() const
AliCFVertexingHF3Prong(Int_t decay, UInt_t resonantDecay)
all decays (resonant + non-resonant)
TString part
use mixed event to constrain combinatorial background
Definition: InvMassFit.C:52
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
multiplicity of the event
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)
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