27 produces<reco::GenParticleCollection>();
39 size_t numGenParticles = genParticles->size();
41 auto genVisTaus = std::make_unique<reco::GenParticleCollection>();
43 for (
const auto & genTauJet : *genTauJets) {
46 if ( decayMode_string ==
"electron" || decayMode_string ==
"muon" )
continue;
55 int pdgId = ( genTauJet.charge() > 0 ) ? -15 : +15;
61 for (
size_t idxGenParticle = 0; idxGenParticle < numGenParticles; ++idxGenParticle ) {
66 int abs_pdgId =
abs(daughter->pdgId());
68 if ( abs_pdgId == 12 || abs_pdgId == 14 || abs_pdgId == 16 )
continue;
69 daughterVisP4 += daughter->p4();
71 double dR2 =
deltaR2(daughterVisP4, genVisTau);
88 desc.
add<
edm::InputTag>(
"src")->setComment(
"collection of visible gen taus (as reco::GenJetCollection)");
89 desc.
add<
edm::InputTag>(
"srcGenParticles")->setComment(
"collections of gen particles");
90 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_
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)
int status() const final
status word
const edm::EDGetTokenT< reco::GenJetCollection > src_
~GenVisTauProducer() override
const GreaterByPt< reco::GenParticle > pTComparator_