100 MsgStream log(messageService(), name());
102 log << MSG::INFO <<
"EeTo4e initialize" << endreq;
105 static const bool CREATEIFNOTTHERE(
true);
106 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
107 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
109 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
112 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"EeTo4e");
113 std::cout<<
"==============================="<<engine<<endl;
117 COSEE.setcos=m_cosee;
122 std::cout<<
"m_evtMax = "<<m_evtMax<<std::endl;
126 return StatusCode::SUCCESS;
132 MsgStream log(messageService(), name());
136 int pid1,pid2,pid3,pid4,pst1,pst2;
147 GenEvent* evt =
new GenEvent(1,1);
149 GenVertex* prod_vtx =
new GenVertex();
151 evt->add_vertex( prod_vtx );
154 GenParticle* p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
157 p->suggest_barcode( ++npart );
158 prod_vtx->add_particle_in(p);
162 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
166 p->suggest_barcode( ++npart );
167 prod_vtx->add_particle_in(p);
170 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
173 p->suggest_barcode( ++npart );
174 prod_vtx->add_particle_out(p);
177 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
180 p->suggest_barcode( ++npart );
181 prod_vtx->add_particle_out(p);
184 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p3[1][evtgen],
MOMSET.p3[2][evtgen],
187 p->suggest_barcode( ++npart );
188 prod_vtx->add_particle_out(p);
191 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
194 p->suggest_barcode( ++npart );
195 prod_vtx->add_particle_out(p);
201 if( log.level() < MSG::INFO )
207 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
211 MsgStream log(messageService(), name());
212 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
214 anMcCol->push_back(mcEvent);
221 mcColl->push_back(mcEvent);
222 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
223 if (sc != StatusCode::SUCCESS)
225 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
229 return StatusCode::FAILURE;
237 return StatusCode::SUCCESS;
253 IProperty* appPropMgr=0;
255 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
256 reinterpret_cast<IInterface*&
>( appPropMgr ));
257 if( status.isFailure() )
return status;
259 IntegerProperty evtMax(
"EvtMax",0);
260 status = appPropMgr->getProperty( &evtMax );
261 if (status.isFailure())
return status;
263 m_evtMax = evtMax.value();