24 #include "AliAODMCParticle.h"
25 #include "AliAODEvent.h"
26 #include "TClonesArray.h"
28 #include "AliESDtrack.h"
29 #include "TDatabasePDG.h"
32 #include "AliCFContainer.h"
78 Bool_t bSignAssoc = kFALSE;
81 AliError(
"fRecoCandidate not found, problem in assignement\n");
86 if (recoCand->
GetPrimaryVtx()) AliDebug(3,
"Reco Cand has a pointer to PrimVtx\n");
89 Int_t pdgDgD0toKpi[2]={321,211};
92 AliDebug(3,Form(
"nentries = %d\n", nentries));
95 if (mcLabel == -1)
return bSignAssoc;
109 AliDebug(3,
"No part candidate");
123 Bool_t bGenValues = kFALSE;
125 Double_t vtx2daughter0[3] = {0,0,0};
126 Double_t vtx2daughter1[3] = {0,0,0};
131 AliAODMCParticle* mcPartDaughter0 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter0));
132 AliAODMCParticle* mcPartDaughter1 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter1));
133 if(!mcPartDaughter0 || !mcPartDaughter1)
return bGenValues;
136 mcPartDaughter0->XvYvZv(vtx2daughter0);
137 mcPartDaughter1->XvYvZv(vtx2daughter1);
138 if (TMath::Abs(vtx2daughter0[0] - vtx2daughter1[0]) > 1E-5 || TMath::Abs(vtx2daughter0[1] - vtx2daughter1[1]) > 1E-5 || TMath::Abs(vtx2daughter0[2] - vtx2daughter1[2])>1E-5) {
139 AliError(
"Daughters have different secondary vertex, skipping the track");
146 AliAODMCParticle* positiveDaugh = mcPartDaughter0;
147 AliAODMCParticle* negativeDaugh = mcPartDaughter1;
148 if (mcPartDaughter0->GetPdgCode()<0 && mcPartDaughter1->GetPdgCode()>0){
150 positiveDaugh = mcPartDaughter1;
151 negativeDaugh = mcPartDaughter0;
154 Double_t px[2] = {positiveDaugh->Px(), negativeDaugh->Px()};
155 Double_t py[2] = {positiveDaugh->Py(), negativeDaugh->Py()};
156 Double_t pz[2] = {positiveDaugh->Pz(), negativeDaugh->Pz()};
165 cosThetaStarD0 = decay->CosThetaStar(1,421,211,321);
166 cosThetaStarD0bar = decay->CosThetaStar(0,421,321,211);
168 AliDebug(3, Form(
"D0, with pdgprong0 = %d, pdgprong1 = %d",mcPartDaughter0->GetPdgCode(),mcPartDaughter1->GetPdgCode()));
169 cosThetaStar = cosThetaStarD0;
172 AliDebug(3, Form(
"D0bar, with pdgprong0 = %d, pdgprong1 = %d",mcPartDaughter0->GetPdgCode(),mcPartDaughter1->GetPdgCode()));
173 cosThetaStar = cosThetaStarD0bar;
176 AliWarning(
"There are problems!! particle was expected to be either a D0 or a D0bar, check...");
180 if (cosThetaStar < -1 || cosThetaStar > 1) {
181 AliWarning(
"Invalid value for cosine Theta star, returning");
192 if (TMath::Abs(mcPartDaughter0->GetPdgCode()) == 211) {
193 pTpi = mcPartDaughter0->Pt();
194 pTK = mcPartDaughter1->Pt();
197 pTpi = mcPartDaughter1->Pt();
198 pTK = mcPartDaughter0->Pt();
205 vectorMC[2] = cosThetaStar ;
208 vectorMC[5] = cT*1.E4 ;
210 vectorMC[7] = -80000.;
223 vectorMC[2] = cT*1.E4;
242 Bool_t bFillRecoValues=kFALSE;
246 if (d0toKpi->
GetPrimaryVtx())AliDebug(3,
"d0toKpi has primary vtx\n");
267 pTpi = d0toKpi->PtProng(0);
268 pTK = d0toKpi->PtProng(1);
269 d0pi = d0toKpi->Getd0Prong(0);
270 d0K = d0toKpi->Getd0Prong(1);
275 pTpi = d0toKpi->PtProng(1);
276 pTK = d0toKpi->PtProng(0);
277 d0pi = d0toKpi->Getd0Prong(1);
278 d0K = d0toKpi->Getd0Prong(0);
288 vectorReco[2] = cosThetaStar;
289 vectorReco[3] = pTpi;
291 vectorReco[5] = cT*1.E4;
292 vectorReco[6] = dca*1.E4;
293 vectorReco[7] = d0xd0*1.E8;
294 vectorReco[8] = cosPointingAngle;
298 vectorReco[12] =
fFake;
299 vectorReco[13] = cosPointingAngleXY;
300 vectorReco[14] = normDecayLengthXY;
306 vectorReco[2] = cT*1.E4;
310 vectorReco[6] =
fFake ;
315 bFillRecoValues = kTRUE;
317 return bFillRecoValues;
329 AliAODMCParticle* mcPartDaughter0 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter0));
330 AliAODMCParticle* mcPartDaughter1 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter1));
332 if (!mcPartDaughter0 || !mcPartDaughter1) {
333 AliDebug (2,
"Problems in the MC Daughters\n");
337 if (!(TMath::Abs(mcPartDaughter0->GetPdgCode())==321 &&
338 TMath::Abs(mcPartDaughter1->GetPdgCode())==211) &&
339 !(TMath::Abs(mcPartDaughter0->GetPdgCode())==211 &&
340 TMath::Abs(mcPartDaughter1->GetPdgCode())==321)) {
341 AliDebug(2,
"The D0 MC doesn't come from a Kpi decay, skipping!!");
345 Double_t sumPxDau=mcPartDaughter0->Px()+mcPartDaughter1->Px();
346 Double_t sumPyDau=mcPartDaughter0->Py()+mcPartDaughter1->Py();
347 Double_t sumPzDau=mcPartDaughter0->Pz()+mcPartDaughter1->Pz();
351 if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
352 TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
353 TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
354 AliDebug(2,
"Momentum conservation violated, skipping!!");
Double_t NormalizedDecayLengthXY() const
AliCFVertexingHF & operator=(const AliCFVertexingHF &c)
Bool_t GetRecoValuesFromCandidate(Double_t *) const
Double_t Ct(UInt_t pdg) const
Class for HF corrections as a function of many variables and step.
AliAODMCParticle * fmcPartCandidate
Reconstructed HF candidate.
Double_t CosPointingAngleXY() const
Double_t InvMassD0() const
Double_t Prodd0d0() const
Bool_t SetRecoCandidateParam(AliAODRecoDecayHF *recoCand)
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
Double_t CosThetaStarD0bar() const
angle of K
Bool_t GetGeneratedValuesFromMCParticle(Double_t *)
AliCFVertexingHF2Prong & operator=(const AliCFVertexingHF2Prong &other)
slow configuration, all variables
Double_t InvMassD0bar() const
AliAODRecoDecayHF * fRecoCandidate
mcArray candidate
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
Int_t fProngs
results of the MatchToMC()
AliAODVertex * GetPrimaryVtx() const
Double_t CosPointingAngle() const
void SetMCLabel(Int_t mcLabel)
Double_t CosThetaStarD0() const
Double_t fzMCVertex
Reco z primary vertex.
Bool_t CheckMCChannelDecay() const
Double_t fMultiplicity
flag to remove events not geenrated with PYTHIA
Class for HF corrections as a function of many variables and step.