197{
198 MsgStream log(messageService(), name());
199 log << MSG::INFO << "BesTwogam executing" << endreq;
200 HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
201 HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
202 HepMC::IO_HEPEVT HepEvtIO;
205
207 log << MSG::ERROR<<" BesTwogam: fail to generate good event"<<endl;
208 return StatusCode::FAILURE;
209 }
210 m_numberEvent++;
211 if( log.level() < MSG::INFO )
LULIST(1);
213
214 HepMC::GenEvent* evt = HepEvtIO.read_next_event();
215 evt->set_event_number(m_numberEvent);
216 evt->set_signal_process_id(1);
217
218 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
219 if (anMcCol!=0) {
220
221 MsgStream log(messageService(), name());
222 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
224 anMcCol->push_back(mcEvent);
225 } else {
226
229 mcColl->push_back(mcEvent);
230 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
231 if (sc != StatusCode::SUCCESS) {
232 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
233 delete mcColl;
234 delete evt;
235 delete mcEvent;
236 return StatusCode::FAILURE;
237 }
238 }
239 return StatusCode::SUCCESS;
240}
ObjectVector< McGenEvent > McGenEventCol