Skip to content

Commit

Permalink
Merge pull request #32312 from intrepid42/PLP_leptags_106
Browse files Browse the repository at this point in the history
ParticleLevelProducer: check for leptonic decays of tag particles (106X)
  • Loading branch information
cmsbuild committed Nov 30, 2020
2 parents e5efce6 + db1a3fe commit eadf88e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
16 changes: 16 additions & 0 deletions GeneratorInterface/RivetInterface/interface/RivetAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,22 @@ namespace Rivet {
_fatjets = applyProjection<FastJets>(event, "FatJets").jetsByPt(fatjet_cut);
_neutrinos = applyProjection<FinalState>(event, "Neutrinos").particlesByPt();
_met = applyProjection<MissingMomentum>(event, "MET").missingMomentum().p3();

// check for leptonic decays of tag particles
for (auto& jet : _jets) {
for (auto& pt : jet.tags()) {
for (auto& p : pt.children(isLepton)) {
pt.addConstituent(p, false);
}
}
}
for (auto& jet : _fatjets) {
for (auto& pt : jet.tags()) {
for (auto& p : pt.children(isLepton)) {
pt.addConstituent(p, false);
}
}
}
};

// Do nothing here
Expand Down
10 changes: 10 additions & 0 deletions GeneratorInterface/RivetInterface/plugins/ParticleLevelProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ void ParticleLevelProducer::addGenJet(Rivet::Jet jet,
} else {
tags->push_back(reco::GenParticle(p.charge(), p4(p) * 1e-20, genVertex_, p.pdgId(), 2, true));
genJet.addDaughter(edm::refToPtr(reco::GenParticleRef(tagsRefHandle, ++iTag)));
// Also save lepton+neutrino daughters of tag particles
int iTagMother = iTag;
for (auto const& d : p.constituents()) {
++iTag;
int d_status = (d.isStable()) ? 1 : 2;
tags->push_back(reco::GenParticle(d.charge(), p4(d) * 1e-20, genVertex_, d.pid(), d_status, true));
tags->at(iTag).addMother(reco::GenParticleRef(tagsRefHandle, iTagMother));
tags->at(iTagMother).addDaughter(reco::GenParticleRef(tagsRefHandle, iTag));
genJet.addDaughter(edm::refToPtr(reco::GenParticleRef(tagsRefHandle, iTag)));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from TopQuarkAnalysis.TopEventProducers.tqafInputFiles_cff import relValTTbar
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(relValTTbar)
fileNames = cms.untracked.vstring('/store/relval/CMSSW_10_2_0/RelValTTbar_14TeV/GEN-SIM/102X_upgrade2023_realistic_v7_2023D29noPU-v1/10000/3C679F61-298E-E811-AF92-0025905B85A2.root')
)

## define maximal number of events to loop over
Expand Down

0 comments on commit eadf88e

Please sign in to comment.