25 produces<reco::GenParticleCollection>();
37 size_t numGenParticles = genParticles->size();
39 auto genVisTaus = std::make_unique<reco::GenParticleCollection>();
41 for (
const auto & genTauJet : *genTauJets) {
44 if ( decayMode_string ==
"electron" || decayMode_string ==
"muon" )
continue;
53 int pdgId = ( genTauJet.charge() > 0 ) ? -15 : +15;
59 for (
size_t idxGenParticle = 0; idxGenParticle < numGenParticles; ++idxGenParticle ) {
64 int abs_pdgId =
abs(daughter->pdgId());
66 if ( abs_pdgId == 12 || abs_pdgId == 14 || abs_pdgId == 16 )
continue;
67 daughterVisP4 += daughter->p4();
69 double dR2 =
deltaR2(daughterVisP4, genVisTau);
85 desc.
add<
edm::InputTag>(
"src")->setComment(
"collection of visible gen taus (as reco::GenJetCollection)");
86 desc.
add<
edm::InputTag>(
"srcGenParticles")->setComment(
"collections of gen particles");
87 descriptions.
add(
"genVisTaus", desc);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
int pdgId() const final
PDG identifier.
std::string genTauDecayMode(const reco::CompositePtrCandidate &c)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::StreamID id, edm::Event &evt, const edm::EventSetup &es) const override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::vector< GenJet > GenJetCollection
collection of GenJet objects
const daughters & daughterRefVector() const
references to daughtes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
GenVisTauProducer(const edm::ParameterSet ¶ms)
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< reco::GenParticleCollection > srcGenParticles_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
int status() const final
status word
const edm::EDGetTokenT< reco::GenJetCollection > src_
~GenVisTauProducer() override