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
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Abs< T >::type abs(const T &t)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::pair< double, double > zMassRange_