25 produces<reco::GenParticleCollection>();
36 size_t numGenParticles = genParticles->size();
38 auto genVisTaus = std::make_unique<reco::GenParticleCollection>();
40 for (
const auto& genTauJet : *genTauJets) {
43 if (decayMode_string ==
"electron" || decayMode_string ==
"muon")
46 if (decayMode_string ==
"oneProng0Pi0")
48 else if (decayMode_string ==
"oneProng1Pi0")
50 else if (decayMode_string ==
"oneProng2Pi0")
52 else if (decayMode_string ==
"threeProng0Pi0")
54 else if (decayMode_string ==
"threeProng1Pi0")
59 int pdgId = (genTauJet.charge() > 0) ? -15 : +15;
62 reco::GenParticle genVisTau(genTauJet.charge(), genTauJet.p4(), genTauJet.vertex(), pdgId, decayMode,
true);
65 for (
size_t idxGenParticle = 0; idxGenParticle < numGenParticles; ++idxGenParticle) {
70 int abs_pdgId =
abs(daughter->pdgId());
72 if (abs_pdgId == 12 || abs_pdgId == 14 || abs_pdgId == 16)
74 daughterVisP4 += daughter->p4();
76 double dR2 =
deltaR2(daughterVisP4, genVisTau);
93 desc.
add<
edm::InputTag>(
"src")->setComment(
"collection of visible gen taus (as reco::GenJetCollection)");
94 desc.
add<
edm::InputTag>(
"srcGenParticles")->setComment(
"collections of gen particles");
95 descriptions.
add(
"genVisTaus", desc);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
std::string genTauDecayMode(const reco::CompositePtrCandidate &c)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< GenJet > GenJetCollection
collection of GenJet objects
int status() const final
status word
const daughters & daughterRefVector() const
references to daughtes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int pdgId() const final
PDG identifier.
GenVisTauProducer(const edm::ParameterSet ¶ms)
void produce(edm::StreamID id, edm::Event &evt, const edm::EventSetup &es) const override
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::GenParticleCollection > srcGenParticles_
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< reco::GenJetCollection > src_
~GenVisTauProducer() override
const GreaterByPt< reco::GenParticle > pTComparator_