58 edm::
InputTag(iConfig.getUntrackedParameter(
"moduleLabel", std::
string(
"generator")),
"unsmeared"))) {
67 std::ostringstream
str;
68 str <<
"=========================================================\n"
69 <<
"Filter MCZll being constructed with parameters: "
72 <<
"\nzMassMax " <<
zMassRange_.second <<
"\n=========================================================";
75 produces<HepMCProduct>();
79 std::unique_ptr<HepMCProduct> bare_product(
new HepMCProduct());
81 bool accepted =
false;
87 if (myGenEvent->signal_process_id() != 1) {
95 for (HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end(); ++
p) {
96 if (!accepted && ((*p)->pdg_id() == 23) && (*p)->status() == 3) {
98 HepMC::GenVertex* zVertex =
new HepMC::GenVertex();
100 zVertex->add_particle_in(myZ);
104 std::vector<HepMC::GenParticle*> children;
105 HepMC::GenVertex* outVertex = (*p)->end_vertex();
106 for (HepMC::GenVertex::particles_out_const_iterator iter = outVertex->particles_out_const_begin();
107 iter != outVertex->particles_out_const_end();
109 children.push_back(*iter);
110 std::vector<HepMC::GenParticle*>::const_iterator aDaughter;
111 for (aDaughter = children.begin(); aDaughter != children.end(); aDaughter++) {
113 zVertex->add_particle_out(myDa);
114 if ((*aDaughter)->status() == 2)
130 zEvent->add_vertex(zVertex);
138 bare_product->addHepMCData(zEvent);
141 LogDebug(
"MCZll") <<
"Event " << iEvent.
id().
event() <<
" accepted" << std::endl;
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
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)
const edm::EDGetTokenT< edm::HepMCProduct > token_
bool filter(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Abs< T >::type abs(const T &t)
std::pair< double, double > zMassRange_
MCZll(const edm::ParameterSet &)