93 MsgStream log(
msgSvc(), name() );
95 log << MSG::INFO <<
"EeToeeV initialize" << endmsg;
98 static const bool CREATEIFNOTTHERE(
true );
99 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
100 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
102 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endmsg;
105 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine(
"EeToeeV" );
106 std::cout <<
"===============================" << engine << endl;
112 if ( m_vect ==
"omega" )
117 else if ( m_vect ==
"phi" )
122 else if ( m_vect ==
"J/psi" )
127 else if ( m_vect ==
"psi(2S)" )
132 else if ( m_vect ==
"psi(3770)" )
137 else if ( m_vect ==
"psi(4040)" )
142 else if ( m_vect ==
"psi(4160)" )
147 else if ( m_vect ==
"psi(4415)" )
154 std::cout <<
"EeToeeV::initialize() Bad vector " << std::endl;
159 std::cout <<
"EeToeeV:initialize: the Ecms less than the vector mass" << std::endl;
165 std::cout <<
"m_evtMax = " << m_evtMax << std::endl;
169 return StatusCode::SUCCESS;
174 MsgStream log(
msgSvc(), name() );
177 int pid1, pid2, pid3, pid4, pst1, pst2;
183 if ( m_vect ==
"omega" ) { pid3 = 223; }
184 else if ( m_vect ==
"phi" ) { pid3 = 333; }
185 else if ( m_vect ==
"J/psi" ) { pid3 = 443; }
186 else if ( m_vect ==
"psi(2S)" ) { pid3 = 100443; }
187 else if ( m_vect ==
"psi(3770)" ) { pid3 = 30443; }
188 else if ( m_vect ==
"psi(4040)" ) { pid3 = 9000443; }
189 else if ( m_vect ==
"psi(4160)" ) { pid3 = 9010443; }
190 else if ( m_vect ==
"psi(4415)" ) { pid3 = 9020443; }
193 GenEvent* evt =
new GenEvent( 1, 1 );
195 GenVertex* prod_vtx =
new GenVertex();
197 evt->add_vertex( prod_vtx );
201 new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
204 p->suggest_barcode( ++npart );
205 prod_vtx->add_particle_in( p );
209 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
213 p->suggest_barcode( ++npart );
214 prod_vtx->add_particle_in( p );
217 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
220 p->suggest_barcode( ++npart );
221 prod_vtx->add_particle_out( p );
224 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
227 p->suggest_barcode( ++npart );
228 prod_vtx->add_particle_out( p );
231 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
234 p->suggest_barcode( ++npart );
235 prod_vtx->add_particle_out( p );
239 if ( log.level() < MSG::INFO ) { evt->print(); }
242 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
246 MsgStream log(
msgSvc(), name() );
247 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
249 anMcCol->push_back( mcEvent );
257 mcColl->push_back( mcEvent );
258 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
259 if ( sc != StatusCode::SUCCESS )
261 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
265 return StatusCode::FAILURE;
274 return StatusCode::SUCCESS;
289 IProperty* appPropMgr = 0;
291 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
292 reinterpret_cast<IInterface*&
>( appPropMgr ) );
293 if ( status.isFailure() )
return status;
295 IntegerProperty evtMax(
"EvtMax", 0 );
296 status = appPropMgr->getProperty( &evtMax );
297 if ( status.isFailure() )
return status;
299 m_evtMax = evtMax.value();