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();
210 vectorMC[2] = cosThetaStar ;
213 vectorMC[5] = cT*1.E4 ;
215 vectorMC[7] = -80000.;
228 vectorMC[2] = cT*1.E4;
246 vectorMC[4] = localmult;
261 Bool_t bFillRecoValues=kFALSE;
265 if (d0toKpi->
GetPrimaryVtx())AliDebug(3,
"d0toKpi has primary vtx\n");
286 pTpi = d0toKpi->PtProng(0);
287 pTK = d0toKpi->PtProng(1);
288 d0pi = d0toKpi->Getd0Prong(0);
289 d0K = d0toKpi->Getd0Prong(1);
294 pTpi = d0toKpi->PtProng(1);
295 pTK = d0toKpi->PtProng(0);
296 d0pi = d0toKpi->Getd0Prong(1);
297 d0K = d0toKpi->Getd0Prong(0);
312 vectorReco[2] = cosThetaStar;
313 vectorReco[3] = pTpi;
315 vectorReco[5] = cT*1.E4;
316 vectorReco[6] = dca*1.E4;
317 vectorReco[7] = d0xd0*1.E8;
318 vectorReco[8] = cosPointingAngle;
322 vectorReco[12] =
fFake;
323 vectorReco[13] = cosPointingAngleXY;
324 vectorReco[14] = normDecayLengthXY;
330 vectorReco[2] = cT*1.E4;
334 vectorReco[6] =
fFake ;
348 vectorReco[4] = localmult;
353 bFillRecoValues = kTRUE;
355 return bFillRecoValues;
367 AliAODMCParticle* mcPartDaughter0 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter0));
368 AliAODMCParticle* mcPartDaughter1 =
dynamic_cast<AliAODMCParticle*
>(
fmcArray->At(daughter1));
370 if (!mcPartDaughter0 || !mcPartDaughter1) {
371 AliDebug (2,
"Problems in the MC Daughters\n");
375 if (!(TMath::Abs(mcPartDaughter0->GetPdgCode())==321 &&
376 TMath::Abs(mcPartDaughter1->GetPdgCode())==211) &&
377 !(TMath::Abs(mcPartDaughter0->GetPdgCode())==211 &&
378 TMath::Abs(mcPartDaughter1->GetPdgCode())==321)) {
379 AliDebug(2,
"The D0 MC doesn't come from a Kpi decay, skipping!!");
383 Double_t sumPxDau=mcPartDaughter0->Px()+mcPartDaughter1->Px();
384 Double_t sumPyDau=mcPartDaughter0->Py()+mcPartDaughter1->Py();
385 Double_t sumPzDau=mcPartDaughter0->Pz()+mcPartDaughter1->Pz();
389 if(TMath::Abs(pxMother-sumPxDau)/(TMath::Abs(pxMother)+1.e-13)>0.00001 ||
390 TMath::Abs(pyMother-sumPyDau)/(TMath::Abs(pyMother)+1.e-13)>0.00001 ||
391 TMath::Abs(pzMother-sumPzDau)/(TMath::Abs(pzMother)+1.e-13)>0.00001){
392 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
Int_t ComputeLocalMultiplicity(Double_t etaD, Double_t phiD, Double_t R) const
Class for HF corrections as a function of many variables and step.
AliAODMCParticle * fmcPartCandidate
Reconstructed HF candidate.
super fast configuration, only (pt,y,centrality)
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
array of tracks
Double_t CosThetaStarD0bar() const
angle of K
Bool_t GetGeneratedValuesFromMCParticle(Double_t *)
AliCFVertexingHF2Prong & operator=(const AliCFVertexingHF2Prong &other)
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 fq2
multiplicity of the event
Double_t CosPointingAngle() const
void SetMCLabel(Int_t mcLabel)
Double_t CosThetaStarD0() const
slow configuration, all variables
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.
fast configuration, only a subset of variables