185{
186 MsgStream log(messageService(), name());
187 log << MSG::INFO << "BesTwogam executing" << endreq;
188 HepMC::HEPEVT_Wrapper::set_max_number_entries(2000);
189 HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
190 HepMC::IO_HEPEVT HepEvtIO;
193
195 log << MSG::ERROR<<" BesTwogam: fail to generate good event"<<endl;
196 return StatusCode::FAILURE;
197 }
198 m_numberEvent++;
199 if( log.level() < MSG::INFO )
LULIST(1);
201
202 HepMC::GenEvent* evt = HepEvtIO.read_next_event();
203 evt->set_event_number(m_numberEvent);
204 evt->set_signal_process_id(1);
205
206 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
207 if (anMcCol!=0) {
208
209 MsgStream log(messageService(), name());
210 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
212 anMcCol->push_back(mcEvent);
213 } else {
214
217 mcColl->push_back(mcEvent);
218 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
219 if (sc != StatusCode::SUCCESS) {
220 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
221 delete mcColl;
222 delete evt;
223 delete mcEvent;
224 return StatusCode::FAILURE;
225 }
226 }
227 return StatusCode::SUCCESS;
228}
ObjectVector< McGenEvent > McGenEventCol