25 #include <TDatabasePDG.h> 29 #include "AliAODMCParticle.h" 78 if(&source ==
this)
return *
this;
106 Double_t mD0PDG = TDatabasePDG::Instance()->GetParticle(421)->Mass();
108 if(PtProng(1) < cuts[3] || PtProng(0) < cuts[4]) okD0 = 0;
109 if(PtProng(0) < cuts[3] || PtProng(1) < cuts[4]) okD0bar = 0;
110 if(!okD0 && !okD0bar)
return kFALSE;
112 if(TMath::Abs(Getd0Prong(1)) > cuts[5] ||
113 TMath::Abs(Getd0Prong(0)) > cuts[6]) okD0 = 0;
114 if(TMath::Abs(Getd0Prong(0)) > cuts[6] ||
115 TMath::Abs(Getd0Prong(1)) > cuts[5]) okD0bar = 0;
116 if(!okD0 && !okD0bar)
return kFALSE;
118 if(GetDCA() > cuts[1]) { okD0 = okD0bar = 0;
return kFALSE; }
121 if(TMath::Abs(mD0-mD0PDG) > cuts[0]) okD0 = 0;
122 if(TMath::Abs(mD0bar-mD0PDG) > cuts[0]) okD0bar = 0;
123 if(!okD0 && !okD0bar)
return kFALSE;
126 if(TMath::Abs(ctsD0) > cuts[2]) okD0 = 0;
127 if(TMath::Abs(ctsD0bar) > cuts[2]) okD0bar = 0;
128 if(!okD0 && !okD0bar)
return kFALSE;
130 if(
Prodd0d0() > cuts[7]) { okD0 = okD0bar = 0;
return kFALSE; }
158 Double_t mJPSIPDG = TDatabasePDG::Instance()->GetParticle(443)->Mass();
160 if(PtProng(1) < cuts[3] || PtProng(0) < cuts[4]) okB = 0;
161 if(!okB)
return kFALSE;
163 if(TMath::Abs(Getd0Prong(1)) > cuts[5] ||
164 TMath::Abs(Getd0Prong(0)) > cuts[6]) okB = 0;
165 if(!okB)
return kFALSE;
167 if(GetDCA() > cuts[1]) { okB = 0;
return kFALSE; }
170 if(TMath::Abs(mJPsi-mJPSIPDG) > cuts[0]) okB = 0;
171 if(!okB)
return kFALSE;
174 if(TMath::Abs(ctsJPsi) > cuts[2]) okB = 0;
175 if(!okB)
return kFALSE;
177 if(
Prodd0d0() > cuts[7]) { okB = 0;
return kFALSE; }
195 Int_t ndg = GetNDaughters();
196 if (!ndg) { AliError(
"HF2Prong: No daughters available");
return -1;}
197 if (ndg != 2) { AliError(Form(
"HF2Prong: %d daughters instead of 2",ndg));
return -1;}
200 Int_t dgLabels[2] = {-1};
201 if(pdgabs2prong == 0){
202 for(
Int_t i=0; i<ndg; i++) {
203 AliAODTrack *trk = (AliAODTrack*)GetDaughter(i);
204 dgLabels[i] = trk->GetLabel();
207 AliAODTrack *trk = (AliAODTrack*)GetDaughter(0);
208 dgLabels[0] = trk->GetLabel();
211 Int_t pdgempty[2]={0,0};
212 dgLabels[1] = daug2prong->
MatchToMCB2Prong(pdgabs2prong, 0, pdgDg2prong, pdgempty, mcArray);
214 if (dgLabels[0] == -1)
return -1;
215 if (dgLabels[1] == -1)
return -1;
217 Int_t labMom[2] = {0, 0};
218 Int_t i, j, lab, labMother, pdgMother, pdgPart;
219 AliAODMCParticle *part = 0;
220 AliAODMCParticle *mother = 0;
221 Double_t pxSumDgs = 0., pySumDgs = 0., pzSumDgs = 0.;
222 Bool_t pdgUsed[2] = {kFALSE, kFALSE};
225 for (i = 0; i < ndg; i++){
227 lab = TMath::Abs(dgLabels[i]);
229 printf(
"daughter with negative label %d\n", lab);
232 part = (AliAODMCParticle*)mcArray->At(lab);
234 printf(
"no MC particle\n");
239 pdgPart = TMath::Abs(part->GetPdgCode());
240 for (j = 0; j < ndg; j++){
241 if (!pdgUsed[j] && pdgPart == pdgDg[j]){
248 while (mother->GetMother() >= 0){
249 labMother = mother->GetMother();
250 mother = (AliAODMCParticle*)mcArray->At(labMother);
252 printf(
"no MC mother particle\n");
255 pdgMother = TMath::Abs(mother->GetPdgCode());
256 if (pdgMother == pdgabs){
257 labMom[i] = labMother;
259 pxSumDgs += part->Px();
260 pySumDgs += part->Py();
261 pzSumDgs += part->Pz();
265 if (labMom[i] == -1)
return -1;
269 labMother = labMom[0];
271 for (i = 0; i < ndg; i++){
272 if (labMom[i] == -1)
return -1;
273 if (labMom[i] != labMother)
return -1;
277 for (i = 0; i < ndg; i++){
278 if (pdgUsed[i] == kFALSE)
return -1;
282 if(mother->GetNDaughters() != 2)
return -1;
285 mother = (AliAODMCParticle*)mcArray->At(labMother);
289 if ((TMath::Abs(pxMother - pxSumDgs) / (TMath::Abs(pxMother) + 1.e-13)) > 0.005 ||
290 (TMath::Abs(pyMother - pySumDgs) / (TMath::Abs(pyMother) + 1.e-13)) > 0.005 ||
291 (TMath::Abs(pzMother - pzSumDgs) / (TMath::Abs(pzMother) + 1.e-13)) > 0.005)
295 AliWarning(Form(
"Mom. cons. not within 0.5%% perc for decay pdgabs = %d daughters = %d",pdgabs,(
Int_t)mother->GetNDaughters()));
308 Int_t ndg=GetNDaughters();
310 AliError(
"No daughters available");
314 AliError(
"Only decays with <10 daughters supported");
322 if(!DDaughter)
return -1;
323 Int_t DLabel = DDaughter->MatchToMC(pdgabs3prong,mcArray,3,pdgDg3prong);
324 if(DLabel<0)
return -1;
326 Int_t dgLabels[10]={0};
330 for(
Int_t i=0; i<ndg; i++) {
331 AliVTrack *trk = (AliVTrack*)GetDaughter(i);
332 Int_t lab = trk->GetLabel();
336 printf(
"daughter with negative label\n");
344 Int_t label = MatchToMC(pdgabs,mcArray,dgLabels,ndg,2,pdgBDg);
AliAODRecoDecayHF2Prong()
AliAODRecoDecayHF & operator=(const AliAODRecoDecayHF &source)
Int_t MatchToMCB2Prong(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray) const
Double_t InvMassD0() const
Double_t Prodd0d0() const
Double_t CosThetaStarJPSI() const
Bool_t SelectD0(const Double_t *cuts, Int_t &okD0, Int_t &okD0bar) const
AliAODRecoDecayHF2Prong & operator=(const AliAODRecoDecayHF2Prong &source)
Double_t InvMassJPSIee() const
angle of e-
Double_t CosPointingAngle() const
Double_t CosThetaStarD0() const
Bool_t SelectBtoJPSI(const Double_t *cuts, Int_t &okB) const
Int_t MatchToMCB3Prong(Int_t pdgabs, Int_t pdgabs3prong, Int_t *pdgBDg, Int_t *pdgDg3prong, TClonesArray *mcArray) const