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