26 std::ostringstream
str;
27 str <<
"=========================================================\n" 28 <<
"Filter MCZll being constructed with parameters: " 30 <<
"\nleptonPtMin " << leptonPtMin_
36 <<
"\n=========================================================" ;
39 produces<HepMCProduct>();
53 edm::LogVerbatim(
"MCZllInfo") <<
"================MCZll report========================================\n" 55 <<
"\n====================================================================" << std::endl;
61 std::unique_ptr<HepMCProduct> bare_product(
new HepMCProduct());
65 bool accepted =
false;
71 if (myGenEvent->signal_process_id() != 1)
81 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
82 p != myGenEvent->particles_end(); ++
p )
84 if ( !accepted && ( (*p)->pdg_id() == 23 ) && (*p)->status() == 3 )
87 HepMC::GenVertex*
zVertex =
new HepMC::GenVertex();
89 zVertex->add_particle_in(myZ);
93 std::vector<HepMC::GenParticle*>
children;
94 HepMC::GenVertex* outVertex=(*p)->end_vertex();
95 for(HepMC::GenVertex::particles_out_const_iterator iter = outVertex->particles_out_const_begin();
96 iter != outVertex->particles_out_const_end(); iter++)
97 children.push_back(*iter);
98 std::vector<HepMC::GenParticle*>::const_iterator aDaughter;
99 for (aDaughter = children.begin();aDaughter != children.end();aDaughter++)
102 zVertex->add_particle_out(myDa);
103 if ((*aDaughter)->status() == 2)
119 zEvent->add_vertex( zVertex );
131 bare_product->addHepMCData(zEvent);
136 LogDebug(
"MCZll") <<
"Event " << iEvent.
id().
event() <<
" accepted" << std::endl;
edm::EDGetTokenT< edm::HepMCProduct > token_
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
Abs< T >::type abs(const T &t)
const HepMC::GenEvent * GetEvent() const
bool filter(edm::Event &, const edm::EventSetup &) override
MCZll(const edm::ParameterSet &)
std::pair< double, double > zMassRange_