Skip to content

Commit 99abf6a

Browse files
committed
fixing the MC
1 parent 2167064 commit 99abf6a

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

PWGHF/TableProducer/HFCandidateCreatorChicPCM.cxx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,24 @@ struct HFCandidateCreatorChicPCMMC {
273273
}
274274
}
275275
}
276-
// indexMother =RecoDecay::getMother(particlesMC, particlesMC.iteratorAt(indexRec), pdg::Code::kChic2);
277-
// indexMotherGamma = RecoDecay::getMother(particlesMC, particlesMC.iteratorAt(candidate.index1().mcparticle().globalIndex()), pdg::Code::kChic2) ;
276+
indexMother =RecoDecay::getMother(particlesMC, particlesMC.iteratorAt(indexRec), pdg::Code::kChic2);
277+
indexMotherGamma = RecoDecay::getMother(particlesMC, particlesMC.iteratorAt(candidate.index1().mcparticle().globalIndex()), pdg::Code::kChic2) ;
278+
if (indexMother > -1 && indexMotherGamma == indexMother && candidate.index1().mcparticle().pdgCode() == kGamma) {
279+
auto particleMother = particlesMC.iteratorAt(indexMother);
280+
// hEphotonMatched->Fill(candidate.index1().p());
281+
hMassEMatched->Fill(sqrt(candidate.index1().px() * candidate.index1().px() + candidate.index1().py() * candidate.index1().py() + candidate.index1().pz() * candidate.index1().pz()));
282+
int indexDaughterFirst = particleMother.daughter0Id(); // index of the first direct daughter
283+
int indexDaughterLast = particleMother.daughter1Id(); // index of the last direct daughter
284+
if ((indexDaughterFirst > -1 && indexDaughterLast > -1)) {
285+
std::vector<int> arrAllDaughtersIndex;
286+
RecoDecay::getDaughters(particlesMC, particleMother, &arrAllDaughtersIndex, array{(int)(kGamma), (int)(pdg::Code::kJpsi)}, 1);
287+
if (arrAllDaughtersIndex.size() == 2) {
288+
flag = 1 << hf_cand_chicPCM::DecayType::ChicToJpsiToMuMuGamma;
289+
hMassChicToJpsiToMuMuGammaMatched->Fill(InvMassChicToJpsiGamma(candidate));
290+
hMassChicToJpsiToMuMuGammaVSPtMatched->Fill(InvMassChicToJpsiGamma(candidate),RecoDecay::Pt(candidate.px(), candidate.py()));
291+
}
292+
}
293+
}
278294
}
279295
if (flag != 0) {
280296
auto particle = particlesMC.iteratorAt(indexRec);

0 commit comments

Comments
 (0)