AliPhysics  1c9c77b (1c9c77b)
 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 
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  Int_t label = TMath::Abs(trk->GetLabel());
424  Short_t chargedau=trk->Charge();
425  if(chargedau==charge){
426  daughtSorted[tmpIndex]=label;
427  tmpIndex=2;
428  nDauLS++;
429  }else{
430  daughtSorted[1]=label;
431  nDauOS++;
432  }
433  }
434 
435  if(nDauLS!=2 || nDauOS!=1){
436  AliError("Wrong decay channel: number of OS and LS tracks not OK");
437  return bFillRecoValues;
438  }
439 
440  if(daughtSorted[0]>daughtSorted[2]){
441  Int_t tmp=daughtSorted[0];
442  daughtSorted[0]=daughtSorted[2];
443  daughtSorted[2]=tmp;
444  }
445 
446  Double_t d0prong0 = decay3->Getd0Prong(daughtSorted[0]);
447  Double_t d0prong1 = decay3->Getd0Prong(daughtSorted[1]);
448  Double_t d0prong2 = decay3->Getd0Prong(daughtSorted[2]);
449 
450  switch (fConfiguration){
452  vectorReco[0] = pt;
453  vectorReco[1] = rapidity;
454  vectorReco[2] = phi;
455  vectorReco[3] = cT*1.E4; // in micron
456  vectorReco[4] = cosPointingAngle; // in micron
457  vectorReco[5] = decay3->PtProng(daughtSorted[0]);
458  vectorReco[6] = decay3->PtProng(daughtSorted[1]);
459  vectorReco[7] = decay3->PtProng(daughtSorted[2]);
460  vectorReco[8] = fzPrimVertex; // z of reconstructed of primary vertex
461  vectorReco[9] = fCentValue; //reconstructed centrality value
462  vectorReco[10] = fFake; // whether the reconstructed candidate was a fake (fFake = 0) or not (fFake = 2)
463  vectorReco[11] = cosPointingAngleXY;
464  vectorReco[12] = normDecayLengthXY; // in cm
465  vectorReco[13] = fMultiplicity; // reconstructed multiplicity
466 
467  if(fDecay==kLctopKpi){
468  Double_t sumd02 =(d0prong0*d0prong0 + d0prong1*d0prong1 + d0prong2*d0prong2);
469  vectorReco[11] = dist12*1.E4;
470  vectorReco[12] = dist23*1.E4;
471  vectorReco[13] = sigmVert*1.E4;
472  vectorReco[14] = sumd02*1.E8;
473  vectorReco[15] = cosPointingAngleXY;
474  vectorReco[16] = normDecayLengthXY; // in cm
475  vectorReco[17] = fMultiplicity; // reconstructed multiplicity
476  }
477  break;
479  vectorReco[0] = pt;
480  vectorReco[1] = rapidity ;
481  vectorReco[2] = cT*1.E4; // in micron
482  vectorReco[3] = phi;
483  vectorReco[4] = fzPrimVertex;
484  vectorReco[5] = fCentValue;
485  vectorReco[6] = fFake ;
486  vectorReco[7] = fMultiplicity;
487  break;
488  }
489 
490  bFillRecoValues = kTRUE;
491  return bFillRecoValues;
492 }
493 
494 
495 //_____________________________________________________________
497 {
498  // Check the pdg codes of the daughters
499  Bool_t checkCD = kFALSE;
500 
501  Int_t pdgCand = -1;
502  Int_t pdgDaughter[3]={-1,-1,-1};
503  if(fDecay==kDplustoKpipi){
504  pdgCand=411;
505  pdgDaughter[0]=321;
506  pdgDaughter[1]=211;
507  pdgDaughter[2]=211;
508  }else if(fDecay==kDstoKKpi){
509  pdgCand=431;
510  pdgDaughter[0]=321;
511  pdgDaughter[1]=321;
512  pdgDaughter[2]=211;
513  }else if(fDecay==kLctopKpi){
514  pdgCand=4122;
515  pdgDaughter[0]=2212;
516  pdgDaughter[1]=321;
517  pdgDaughter[2]=211;
518 
519  // AliError("LambdaC not yet implemented");
520  // return checkCD;
521  }else{
522  AliError("WRONG DECAY SETTING");
523  return checkCD;
524  }
525 
526 
527  Int_t daughter[3];
528  Double_t sumPxDau=0.;
529  Double_t sumPyDau=0.;
530  Double_t sumPzDau=0.;
531 
532  Int_t nDau=fmcPartCandidate->GetNDaughters();
533  Int_t labelFirstDau = fmcPartCandidate->GetDaughter(0);
534 
536 
537  if(nDau==3){
539  AliDebug(3,"Decay channel in direct KKpi, should be skipped");
540  return checkCD;
541  }
542  for(Int_t iDau=0; iDau<3; iDau++){
543  Int_t ind = labelFirstDau+iDau;
544  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
545  if(!part){
546  AliError("Daughter particle not found in MC array");
547  return checkCD;
548  }
549  daughter[iDau]=TMath::Abs(part->GetPdgCode());
550  sumPxDau+=part->Px();
551  sumPyDau+=part->Py();
552  sumPzDau+=part->Pz();
553  }
554  }else if(nDau==2){
555  if(fDecay==kDstoKKpi && fGenDsOption==kCountNonResonant) return checkCD;
556  Int_t nDauFound=0;
557  for(Int_t iDau=0; iDau<2; iDau++){
558  Int_t ind = labelFirstDau+iDau;
559  AliAODMCParticle* part = dynamic_cast<AliAODMCParticle*>(fmcArray->At(ind));
560  if(!part){
561  AliError("Daughter particle not found in MC array");
562  return checkCD;
563  }
564  Int_t pdgCode=TMath::Abs(part->GetPdgCode());
565  if(pdgCode==211 || pdgCode==321 || pdgCode==2212){
566  if(nDauFound>=3) return checkCD;
567  daughter[nDauFound]=pdgCode;
568  sumPxDau+=part->Px();
569  sumPyDau+=part->Py();
570  sumPzDau+=part->Pz();
571  nDauFound++;
572  }else{
573  if(fDecay==kDstoKKpi && fGenDsOption!=3){
574  Int_t pdgCodeRes=TMath::Abs(part->GetPdgCode());
575  if(fGenDsOption==kCountPhipi && pdgCodeRes!=333) return checkCD;
576  else if(fGenDsOption==kCountK0stK && pdgCodeRes!=313) return checkCD;
577  }
578  Int_t nDauRes=part->GetNDaughters();
579  if(nDauRes!=2) return checkCD;
580  Int_t labelFirstDauRes = part->GetDaughter(0);
581  for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
582  Int_t indDR = labelFirstDauRes+iDauRes;
583  AliAODMCParticle* partDR = dynamic_cast<AliAODMCParticle*>(fmcArray->At(indDR));
584  if(!partDR){
585  AliError("Daughter particle not found in MC array");
586  return checkCD;
587  }
588  Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
589  if(nDauFound>=3) return checkCD;
590  daughter[nDauFound]=pdgCodeDR;
591  sumPxDau+=partDR->Px();
592  sumPyDau+=partDR->Py();
593  sumPzDau+=partDR->Pz();
594  nDauFound++;
595  }
596  }
597  }
598  }else{
599  return checkCD;
600  }
601  for(Int_t iDau1=0; iDau1<3; iDau1++){
602  for(Int_t iDau2=iDau1; iDau2<3; iDau2++){
603  if(daughter[iDau1]<daughter[iDau2]){
604  Int_t tmp=daughter[iDau1];
605  daughter[iDau1]=daughter[iDau2];
606  daughter[iDau2]=tmp;
607  }
608  }
609  }
610  for(Int_t iDau=0; iDau<3; iDau++){
611  if(daughter[iDau]!=pdgDaughter[iDau]){
612  AliDebug(2, "Wrong decay channel from MC, skipping!!");
613  return checkCD;
614  }
615  }
616 
617  Double_t pxMother=fmcPartCandidate->Px();
618  Double_t pyMother=fmcPartCandidate->Py();
619  Double_t pzMother=fmcPartCandidate->Pz();
620  if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
621  TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
622  TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
623  AliDebug(2, "Momentum conservation violated, skipping!!");
624  return checkCD;
625  }
626 
627  checkCD = kTRUE;
628  return checkCD;
629 
630 }
631 //---------------------------------
633 {
634  Int_t numberOfLambdac=0;
635  if(TMath::Abs(fmcPartCandidate->GetPdgCode())!=4122) return kFALSE;
636  Int_t nDaugh = (Int_t)fmcPartCandidate->GetNDaughters();
637  if(nDaugh<2) return kFALSE;
638  if(nDaugh>3) return kFALSE;
639  AliAODMCParticle* pdaugh1 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(0));
640  if(!pdaugh1) {return kFALSE;}
641  Int_t number1 = TMath::Abs(pdaugh1->GetPdgCode());
642  AliAODMCParticle* pdaugh2 = (AliAODMCParticle*)fmcArray->At(fmcPartCandidate->GetDaughter(1));
643  if(!pdaugh2) {return kFALSE;}
644  Int_t number2 = TMath::Abs(pdaugh2->GetPdgCode());
645  if(nDaugh==3){
647  Int_t thirdDaugh=fmcPartCandidate->GetDaughter(1)-1;
648  AliAODMCParticle* pdaugh3 = (AliAODMCParticle*)fmcArray->At(thirdDaugh);
649  if(!pdaugh3) return kFALSE;
650  Int_t number3 = TMath::Abs(pdaugh3->GetPdgCode());
651  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++;
652  }
653  if(nDaugh==2){
655  Int_t nfiglieK=0;
656  if((number1==2212 && number2==313)){
658  nfiglieK=pdaugh2->GetNDaughters();
659  if(nfiglieK!=2) return kFALSE;
660  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
661  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
662  if(!pdaughK1) return kFALSE;
663  if(!pdaughK2) return kFALSE;
664  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
665  }
666  if((number1==313 && number2==2212)){
668  nfiglieK=pdaugh1->GetNDaughters();
669  if(nfiglieK!=2) return kFALSE;
670  AliAODMCParticle* pdaughK1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
671  AliAODMCParticle* pdaughK2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
672  if(!pdaughK1) return kFALSE;
673  if(!pdaughK2) return kFALSE;
674  if((TMath::Abs(pdaughK1->GetPdgCode())==211 && TMath::Abs(pdaughK2->GetPdgCode())==321) || (TMath::Abs(pdaughK1->GetPdgCode())==321 && TMath::Abs(pdaughK2->GetPdgCode())==211)) numberOfLambdac++;
675  }
676  Int_t nfiglieDelta=0;
677  if(number1==321 && number2==2224){
679  nfiglieDelta=pdaugh2->GetNDaughters();
680  if(nfiglieDelta!=2) return kFALSE;
681  AliAODMCParticle *pdaughD1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
682  AliAODMCParticle *pdaughD2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
683  if(!pdaughD1) return kFALSE;
684  if(!pdaughD2) return kFALSE;
685  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
686  }
687  if(number1==2224 && number2==321){
689  nfiglieDelta=pdaugh1->GetNDaughters();
690  if(nfiglieDelta!=2) return kFALSE;
691  AliAODMCParticle* pdaughD1 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
692  AliAODMCParticle* pdaughD2 = (AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
693  if(!pdaughD1) return kFALSE;
694  if(!pdaughD2) return kFALSE;
695  if((TMath::Abs(pdaughD1->GetPdgCode())==211 && TMath::Abs(pdaughD2->GetPdgCode())==2212) || (TMath::Abs(pdaughD1->GetPdgCode())==2212 && TMath::Abs(pdaughD2->GetPdgCode())==211)) numberOfLambdac++;
696  }
697 
698  Int_t nfiglieLa=0;
699  if(number1==3124 && number2==211){
701  nfiglieLa=pdaugh1->GetNDaughters();
702  if(nfiglieLa!=2) return kFALSE;
703  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(0));
704  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh1->GetDaughter(1));
705  if(!pdaughL1) return kFALSE;
706  if(!pdaughL2) return kFALSE;
707  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
708  }
709  if(number1==211 && number2==3124){
711  nfiglieLa=pdaugh2->GetNDaughters();
712  if(nfiglieLa!=2) return kFALSE;
713  AliAODMCParticle *pdaughL1=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(0));
714  AliAODMCParticle *pdaughL2=(AliAODMCParticle*)fmcArray->At(pdaugh2->GetDaughter(1));
715  if(!pdaughL1) return kFALSE;
716  if(!pdaughL2) return kFALSE;
717  if((TMath::Abs(pdaughL1->GetPdgCode())==321 && TMath::Abs(pdaughL2->GetPdgCode())==2212) || (TMath::Abs(pdaughL1->GetPdgCode())==2212 && TMath::Abs(pdaughL2->GetPdgCode())==321)) numberOfLambdac++;
718 
719  }
720  }
721  if(numberOfLambdac>0) return kTRUE;
722  return kFALSE;
723 }
Int_t charge
Double_t NormalizedDecayLengthXY() const
AliCFVertexingHF & operator=(const AliCFVertexingHF &c)
double Double_t
Definition: External.C:58
all decays (resonant + non-resonant)
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
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:46
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
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
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.