14 label_(iConfig.getUntrackedParameter(
"moduleLabel",std::
string(
"generator"))), nEvents_(0), nAccepted_(0)
24 std::ostringstream str;
25 str <<
"=========================================================\n"
26 <<
"Filter MCZll being constructed with parameters: "
28 <<
"\nleptonPtMin " << leptonPtMin_
34 <<
"\n=========================================================" ;
37 produces< HepMCProduct >();
51 edm::LogVerbatim(
"MCZllInfo") <<
"================MCZll report========================================\n"
53 <<
"\n====================================================================" << std::endl;
59 std::auto_ptr<HepMCProduct> bare_product(
new HepMCProduct());
63 bool accepted =
false;
66 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evt->GetEvent()));
67 HepMC::GenEvent * zEvent =
new HepMC::GenEvent();
69 if (myGenEvent->signal_process_id() != 1)
79 for ( HepMC::GenEvent::particle_iterator
p = myGenEvent->particles_begin();
80 p != myGenEvent->particles_end(); ++
p )
82 if ( !accepted && ( (*p)->pdg_id() == 23 ) && (*p)->status() == 3 )
85 HepMC::GenVertex* zVertex =
new HepMC::GenVertex();
87 zVertex->add_particle_in(myZ);
91 std::vector<HepMC::GenParticle*> children;
92 HepMC::GenVertex* outVertex=(*p)->end_vertex();
93 for(HepMC::GenVertex::particles_out_const_iterator iter = outVertex->particles_out_const_begin();
94 iter != outVertex->particles_out_const_end(); iter++)
95 children.push_back(*iter);
96 std::vector<HepMC::GenParticle*>::const_iterator aDaughter;
97 for (aDaughter = children.begin();aDaughter != children.end();aDaughter++)
100 zVertex->add_particle_out(myDa);
101 if ((*aDaughter)->status() == 2)
117 zEvent->add_vertex( zVertex );
129 bare_product->addHepMCData(zEvent);
131 iEvent.
put(bare_product);
134 LogDebug(
"MCZll") <<
"Event " << iEvent.
id().
event() <<
" accepted" << std::endl;
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MCZll(const edm::ParameterSet &)
std::pair< double, double > zMassRange_
virtual bool filter(edm::Event &, const edm::EventSetup &)