AliPhysics  68dfc25 (68dfc25)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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),
65  fGenDsOption(kCountResonant),
66  fResonantDecay(0)
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),
83  fGenDsOption(kCountResonant),
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),
100  fGenDsOption(kCountResonant),
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;
377  }
378  delete decay;
379  bGenValues = kTRUE;
380  return bGenValues;
381 }
382 
383 
384 //____________________________________________
386 {
387  // Fill vector (see above) with reconstructed quantities
388  Bool_t bFillRecoValues=kFALSE;
389 
390  Int_t pdgCand = -1;
391  if(fDecay==kDplustoKpipi){
392  pdgCand=411;
393  }else if(fDecay==kDstoKKpi){
394  pdgCand=431;
395  }else if(fDecay==kLctopKpi){
396  pdgCand=4122;
397  // AliError("LambdaC not yet implemented");
398  // return bFillRecoValues;
399  }else{
400  AliError("WRONG DECAY SETTING");
401  return bFillRecoValues;
402  }
403 
405  Short_t charge=decay3->Charge();
406  Double_t rapidity=decay3->Y(pdgCand);
407  Double_t cT=decay3->Ct(pdgCand);
408  Double_t pt = decay3->Pt();
409  Double_t cosPointingAngle = decay3->CosPointingAngle();
410  Double_t phi = decay3->Phi();
411  Double_t dist12= decay3->GetDist12toPrim();
412  Double_t dist23 = decay3->GetDist23toPrim();
413  Double_t sigmVert = decay3->GetSigmaVert();
414  Double_t cosPointingAngleXY = decay3->CosPointingAngleXY();
415  Double_t normDecayLengthXY = decay3->NormalizedDecayLengthXY();
416 
417  Int_t daughtSorted[3];
418  Int_t tmpIndex=0;
419  Int_t nDauLS=0;
420  Int_t nDauOS=0;
421  for(Int_t iDau=0; iDau<3; iDau++){
422  AliAODTrack *trk = (AliAODTrack*)decay3->GetDaughter(iDau);
423  Short_t chargedau=trk->Charge();
424  if(chargedau==charge){
425  daughtSorted[tmpIndex]=iDau;
426  tmpIndex=2;
427  nDauLS++;
428  }else{
429  daughtSorted[1]=iDau;
430  nDauOS++;
431  }
432  }
433 
434  if(nDauLS!=2 || nDauOS!=1){
435  AliError("Wrong decay channel: number of OS and LS tracks not OK");
436  return bFillRecoValues;
437  }
438 
439  if(daughtSorted[0]>daughtSorted[2]){
440  Int_t tmp=daughtSorted[0];
441  daughtSorted[0]=daughtSorted[2];
442  daughtSorted[2]=tmp;
443  }
444 
445 
446  switch (fConfiguration){
448  vectorReco[0] = pt;
449  vectorReco[1] = rapidity;
450  vectorReco[2] = phi;
451  vectorReco[3] = cT*1.E4; // in micron
452  vectorReco[4] = cosPointingAngle; // in micron
453  vectorReco[5] = decay3->PtProng(daughtSorted[0]);
454  vectorReco[6] = decay3->PtProng(daughtSorted[1]);
455  vectorReco[7] = decay3->PtProng(daughtSorted[2]);
456  vectorReco[8] = fzPrimVertex; // z of reconstructed of primary vertex
457  vectorReco[9] = fCentValue; //reconstructed centrality value
458  vectorReco[10] = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2)
459  vectorReco[11] = cosPointingAngleXY;
460  vectorReco[12] = normDecayLengthXY; // in cm
461  vectorReco[13] = fMultiplicity; // reconstructed multiplicity
462 
463  if(fDecay==kLctopKpi){
464  Double_t d0prong0 = decay3->Getd0Prong(daughtSorted[0]);
465  Double_t d0prong1 = decay3->Getd0Prong(daughtSorted[1]);
466  Double_t d0prong2 = decay3->Getd0Prong(daughtSorted[2]);
467  Double_t sumd02 =(d0prong0*d0prong0 + d0prong1*d0prong1 + d0prong2*d0prong2);
468  vectorReco[11] = dist12*1.E4;
469  vectorReco[12] = dist23*1.E4;
470  vectorReco[13] = sigmVert*1.E4;
471  vectorReco[14] = sumd02*1.E8;
472  vectorReco[15] = cosPointingAngleXY;
473  vectorReco[16] = normDecayLengthXY; // in cm
474  vectorReco[17] = fMultiplicity; // reconstructed multiplicity
475  }
476  break;
478  vectorReco[0] = pt;
479  vectorReco[1] = rapidity ;
480  vectorReco[2] = cT*1.E4; // in micron
481  vectorReco[3] = phi;
482  vectorReco[4] = fzPrimVertex;
483  vectorReco[5] = fCentValue;
484  vectorReco[6] = fFake ;
485  vectorReco[7] = fMultiplicity;
486  break;
487  }
488 
489  bFillRecoValues = kTRUE;
490  return bFillRecoValues;
491 }
492 
493 
494 //_____________________________________________________________
496 {
497  // Check the pdg codes of the daughters
498  Bool_t checkCD = kFALSE;
499 
500  Int_t pdgCand = -1;
501  Int_t pdgDaughter[3]={-1,-1,-1};
502  if(fDecay==kDplustoKpipi){
503  pdgCand=411;
504  pdgDaughter[0]=321;
505  pdgDaughter[1]=211;
506  pdgDaughter[2]=211;
507  }else if(fDecay==kDstoKKpi){
508  pdgCand=431;
509  pdgDaughter[0]=321;
510  pdgDaughter[1]=321;
511  pdgDaughter[2]=211;
512  }else if(fDecay==kLctopKpi){
513  pdgCand=4122;
514  pdgDaughter[0]=2212;
515  pdgDaughter[1]=321;
516  pdgDaughter[2]=211;
517 
518  // AliError("LambdaC not yet implemented");
519  // return checkCD;
520  }else{
521  AliError("WRONG DECAY SETTING");
522  return checkCD;
523  }
524 
525 
526  Int_t daughter[3];
527  Double_t sumPxDau=0.;
528  Double_t sumPyDau=0.;
529  Double_t sumPzDau=0.;
530 
531  Int_t nDau=fmcPartCandidate->GetNDaughters();
532  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
533 
535 
536  if(nDau==3){
538  AliDebug(3,"Decay channel in direct KKpi, should be skipped");
539  return checkCD;
540  }
541  for(Int_t iDau=0; iDau<3; iDau++){
542  Int_t ind = labelFirstDau+iDau;
543  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
544  if(!part){
545  AliError("Daughter particle not found in MC array");
546  return checkCD;
547  }
548  daughter[iDau]=TMath::Abs(part->GetPdgCode());
549  sumPxDau+=part->Px();
550  sumPyDau+=part->Py();
551  sumPzDau+=part->Pz();
552  }
553  }else if(nDau==2){
554  if(fDecay==kDstoKKpi && fGenDsOption==kCountNonResonant) return checkCD;
555  Int_t nDauFound=0;
556  for(Int_t iDau=0; iDau<2; iDau++){
557  Int_t ind = labelFirstDau+iDau;
558  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
559  if(!part){
560  AliError("Daughter particle not found in MC array");
561  return checkCD;
562  }
563  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
564  if(pdgCode==211 || pdgCode==321 || pdgCode==2212){
565  if(nDauFound>=3) return checkCD;
566  daughter[nDauFound]=pdgCode;
567  sumPxDau+=part->Px();
568  sumPyDau+=part->Py();
569  sumPzDau+=part->Pz();
570  nDauFound++;
571  }else{
572  if(fDecay==kDstoKKpi && fGenDsOption!=3){
573  Int_t pdgCodeRes=TMath::Abs(part->GetPdgCode());
574  if(fGenDsOption==kCountPhipi && pdgCodeRes!=333) return checkCD;
575  else if(fGenDsOption==kCountK0stK && pdgCodeRes!=313) return checkCD;
576  }
577  Int_t nDauRes=part->GetNDaughters();
578  if(nDauRes!=2) return checkCD;
579  Int_t labelFirstDauRes = part->GetDaughter(0);
580  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
581  Int_t indDR = labelFirstDauRes+iDauRes;
582  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(fmcArray->At(indDR));
583  if(!partDR){
584  AliError("Daughter particle not found in MC array");
585  return checkCD;
586  }
587  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
588  if(nDauFound>=3) return checkCD;
589  daughter[nDauFound]=pdgCodeDR;
590  sumPxDau+=partDR->Px();
591  sumPyDau+=partDR->Py();
592  sumPzDau+=partDR->Pz();
593  nDauFound++;
594  }
595  }
596  }
597  }else{
598  return checkCD;
599  }
600  for(Int_t iDau1=0; iDau1<3; iDau1++){
601  for(Int_t iDau2=iDau1; iDau2<3; iDau2++){
602  if(daughter[iDau1]<daughter[iDau2]){
603  Int_t tmp=daughter[iDau1];
604  daughter[iDau1]=daughter[iDau2];
605  daughter[iDau2]=tmp;
606  }
607  }
608  }
609  for(Int_t iDau=0; iDau<3; iDau++){
610  if(daughter[iDau]!=pdgDaughter[iDau]){
611  AliDebug(2, "Wrong decay channel from MC, skipping!!");
612  return checkCD;
613  }
614  }
615 
616  Double_t pxMother=fmcPartCandidate->Px();
617  Double_t pyMother=fmcPartCandidate->Py();
618  Double_t pzMother=fmcPartCandidate->Pz();
619  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
620  TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
621  TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
622  AliDebug(2, "Momentum conservation violated, skipping!!");
623  return checkCD;
624  }
625 
626  checkCD = kTRUE;
627  return checkCD;
628 
629 }
630 //---------------------------------
632 {
633  Int_t numberOfLambdac=0;
634  if(TMath::Abs(fmcPartCandidate->GetPdgCode())!=4122) return kFALSE;
635  Int_t nDaugh = (Int_t)fmcPartCandidate->GetNDaughters();
636  if(nDaugh<2) return kFALSE;
637  if(nDaugh>3) return kFALSE;
638  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(0));
639  if(!pdaugh1) {return kFALSE;}
640  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
641  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(1));
642  if(!pdaugh2) {return kFALSE;}
643  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
644  if(nDaugh==3){
646  Int_t thirdDaugh=fmcPartCandidate->GetDaughter(1)-1;
647  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)fmcArray->At(thirdDaugh);
648  if(!pdaugh3) return kFALSE;
649  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
650  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++;
651  }
652  if(nDaugh==2){
654  Int_t nfiglieK=0;
655  if((number1==2212 && number2==313)){
657  nfiglieK=pdaugh2->GetNDaughters();
658  if(nfiglieK!=2) return kFALSE;
659  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
660  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
661  if(!pdaughK1) return kFALSE;
662  if(!pdaughK2) return kFALSE;
663  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
664  }
665  if((number1==313 && number2==2212)){
667  nfiglieK=pdaugh1->GetNDaughters();
668  if(nfiglieK!=2) return kFALSE;
669  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
670  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
671  if(!pdaughK1) return kFALSE;
672  if(!pdaughK2) return kFALSE;
673  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
674  }
675  Int_t nfiglieDelta=0;
676  if(number1==321 && number2==2224){
678  nfiglieDelta=pdaugh2->GetNDaughters();
679  if(nfiglieDelta!=2) return kFALSE;
680  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
681  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
682  if(!pdaughD1) return kFALSE;
683  if(!pdaughD2) return kFALSE;
684  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
685  }
686  if(number1==2224 && number2==321){
688  nfiglieDelta=pdaugh1->GetNDaughters();
689  if(nfiglieDelta!=2) return kFALSE;
690  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
691  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
692  if(!pdaughD1) return kFALSE;
693  if(!pdaughD2) return kFALSE;
694  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
695  }
696 
697  Int_t nfiglieLa=0;
698  if(number1==3124 && number2==211){
700  nfiglieLa=pdaugh1->GetNDaughters();
701  if(nfiglieLa!=2) return kFALSE;
702  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
703  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
704  if(!pdaughL1) return kFALSE;
705  if(!pdaughL2) return kFALSE;
706  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
707  }
708  if(number1==211 && number2==3124){
710  nfiglieLa=pdaugh2->GetNDaughters();
711  if(nfiglieLa!=2) return kFALSE;
712  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
713  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
714  if(!pdaughL1) return kFALSE;
715  if(!pdaughL2) return kFALSE;
716  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
717 
718  }
719  }
720  if(numberOfLambdac>0) return kTRUE;
721  return kFALSE;
722 }
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)
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
all decays (resonant + non-resonant)
unsigned int UInt_t
Definition: External.C:33
float Float_t
Definition: External.C:68
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
slow configuration, all variables
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)
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.