102 MsgStream log(messageService(), name());
104 log << MSG::INFO <<
"EeToeeV initialize" << endreq;
107 static const bool CREATEIFNOTTHERE(
true);
108 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
109 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
111 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
114 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"EeToeeV");
115 std::cout<<
"==============================="<<engine<<endl;
124 }
else if(m_vect==
"phi"){
127 }
else if(m_vect==
"J/psi"){
130 }
else if(m_vect==
"psi(2S)"){
133 }
else if(m_vect==
"psi(3770)"){
136 }
else if(m_vect==
"psi(4040)"){
139 }
else if(m_vect==
"psi(4160)"){
142 }
else if(m_vect==
"psi(4415)"){
146 std::cout<<
"EeToeeV::initialize() Bad vector "<<std::endl; abort();
148 if(m_Ecms<mpar){std::cout<<
"EeToeeV:initialize: the Ecms less than the vector mass"<<std::endl;abort();}
152 std::cout<<
"m_evtMax = "<<m_evtMax<<std::endl;
156 return StatusCode::SUCCESS;
162 MsgStream log(messageService(), name());
166 int pid1,pid2,pid3,pid4,pst1,pst2;
174 }
else if(m_vect==
"phi"){
176 }
else if(m_vect==
"J/psi"){
178 }
else if(m_vect==
"psi(2S)"){
180 }
else if(m_vect==
"psi(3770)"){
182 }
else if(m_vect==
"psi(4040)"){
184 }
else if(m_vect==
"psi(4160)"){
186 }
else if(m_vect==
"psi(4415)"){
191 GenEvent* evt =
new GenEvent(1,1);
193 GenVertex* prod_vtx =
new GenVertex();
195 evt->add_vertex( prod_vtx );
198 GenParticle* p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
201 p->suggest_barcode( ++npart );
202 prod_vtx->add_particle_in(p);
206 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
210 p->suggest_barcode( ++npart );
211 prod_vtx->add_particle_in(p);
214 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
217 p->suggest_barcode( ++npart );
218 prod_vtx->add_particle_out(p);
221 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
224 p->suggest_barcode( ++npart );
225 prod_vtx->add_particle_out(p);
228 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
231 p->suggest_barcode( ++npart );
232 prod_vtx->add_particle_out(p);
236 if( log.level() < MSG::INFO )
242 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
246 MsgStream log(messageService(), name());
247 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
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" << endreq;
265 return StatusCode::FAILURE;
273 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();