159 MsgStream log(
msgSvc(), name() );
160 log << MSG::WARNING <<
"BesTwogam initialize" << endmsg;
162 if ( m_fcard.size() > 254 )
164 log << MSG::ERROR <<
"Too big name of BesTwogam card file" << endmsg;
165 return StatusCode::FAILURE;
168 strcpy(
FNAMES.cardName, m_fcard.c_str() );
169 FNAMES.i_cardName = m_fcard.size();
173 EXCUTS.EBEAME = 0.5 * m_cmEnergy;
185 for (
int i = 0; i < m_pypars.size(); i++ )
186 {
pygive_( m_pypars[i].c_str(), strlen( m_pypars[i].c_str() ) ); }
187 return StatusCode::SUCCESS;
191 MsgStream log(
msgSvc(), name() );
192 log << MSG::INFO <<
"BesTwogam executing" << endmsg;
193 HepMC::HEPEVT_Wrapper::set_max_number_entries( 2000 );
194 HepMC::HEPEVT_Wrapper::set_sizeof_real( 8 );
195 HepMC::IO_HEPEVT HepEvtIO;
201 log << MSG::ERROR <<
" BesTwogam: fail to generate good event" << endl;
202 return StatusCode::FAILURE;
205 if ( log.level() < MSG::INFO )
LULIST( 1 );
208 HepMC::GenEvent* evt = HepEvtIO.read_next_event();
209 evt->set_event_number( m_numberEvent );
210 evt->set_signal_process_id( 1 );
212 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
216 MsgStream log(
msgSvc(), name() );
217 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
219 anMcCol->push_back( mcEvent );
226 mcColl->push_back( mcEvent );
227 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
228 if ( sc != StatusCode::SUCCESS )
230 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
234 return StatusCode::FAILURE;
237 return StatusCode::SUCCESS;