From 664f95cfbd5b10b98b4c189d4ca454fd0569579e Mon Sep 17 00:00:00 2001 From: Robert Bainbridge Date: Fri, 19 Oct 2018 16:17:31 +0100 Subject: [PATCH] hack to accommodate eles from B->K,J/psi --- plugins/TrackerElectronsFeatures.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/TrackerElectronsFeatures.cc b/plugins/TrackerElectronsFeatures.cc index ba987dd611ae6..52a838d53d762 100644 --- a/plugins/TrackerElectronsFeatures.cc +++ b/plugins/TrackerElectronsFeatures.cc @@ -467,8 +467,17 @@ TrackerElectronsFeatures::analyze(const Event& iEvent, const EventSetup& iSetup) for(size_t idx=0; idx < gen_particles->size(); idx++) { reco::GenParticleRef genp(gen_particles, idx); bool is_ele = genp->isLastCopy() && std::abs(genp->pdgId()) == 11; - bool comes_from_B = genp->numberOfMothers() >= 1 && genp->mother()->pdgId() > 510 && - genp->mother()->pdgId() < 546; + bool comes_from_B = genp->numberOfMothers() >= 1 && + genp->mother()->pdgId() > 510 && + genp->mother()->pdgId() < 546; + if (!comes_from_B && // check resonant (J/psi) production? + genp->numberOfMothers() >= 1 && genp->mother() && // has mother + genp->mother()->pdgId() == 443 && // mother is J/psi + genp->mother()->numberOfMothers() >= 1 && genp->mother()->mother() && // has grandmother + genp->mother()->mother()->pdgId() > 510 && + genp->mother()->mother()->pdgId() < 546 ) { // grandmother is B + comes_from_B = true; + } if(is_ele && (comes_from_B || !check_from_B_)) { //is coming from a B electrons_from_B.insert(genp); }