165 MsgStream log(messageService(), name());
167 log << MSG::INFO <<
"Babayaga initialize" << endreq;
170 static const bool CREATEIFNOTTHERE(
true);
171 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
172 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
174 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
177 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"Babayaga");
178 std::cout<<
"==============================="<<engine<<endl;
201 std::cout<<
"m_evtMax = "<<m_evtMax<<std::endl;
205 return StatusCode::SUCCESS;
211 MsgStream log(messageService(), name());
216 int pid1,pid2,pst1,pst2;
217 if(m_Ich==1) {pid1=11; pid2=-11; pst1=1;pst2=1;}
218 if(m_Ich==2) {pid1=13; pid2=-13; pst1=1;pst2=1;}
219 if(m_Ich==3) {pid1=22; pid2= 22; pst1=1;pst2=1;}
220 if(m_Ich==4) {pid1=-211; pid2= 211; pst1=1;pst2=1;}
223 GenEvent* evt =
new GenEvent(1,1);
225 GenVertex* prod_vtx =
new GenVertex();
227 evt->add_vertex( prod_vtx );
230 GenParticle* p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
233 p->suggest_barcode( ++npart );
234 prod_vtx->add_particle_in(p);
238 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
242 p->suggest_barcode( ++npart );
243 prod_vtx->add_particle_in(p);
246 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
249 p->suggest_barcode( ++npart );
250 prod_vtx->add_particle_out(p);
260 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
263 p->suggest_barcode( ++npart );
264 prod_vtx->add_particle_out(p);
269 for (iphot=0; iphot<
ISRPHOTONS.ncqph[evtgen-1]; iphot++)
275 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.phot[1][iphot][evtgen],
MOMSET.phot[2][iphot][evtgen],
276 MOMSET.phot[3][iphot][evtgen],
MOMSET.phot[0][iphot][evtgen]),
278 p->suggest_barcode( ++npart );
279 prod_vtx->add_particle_out(p);
286 if( log.level() < MSG::INFO )
292 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
296 MsgStream log(messageService(), name());
297 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
299 anMcCol->push_back(mcEvent);
306 mcColl->push_back(mcEvent);
307 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
308 if (sc != StatusCode::SUCCESS)
310 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
314 return StatusCode::FAILURE;
322 return StatusCode::SUCCESS;
338 IProperty* appPropMgr=0;
340 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
341 reinterpret_cast<IInterface*&
>( appPropMgr ));
342 if( status.isFailure() )
return status;
344 IntegerProperty evtMax(
"EvtMax",0);
345 status = appPropMgr->getProperty( &evtMax );
346 if (status.isFailure())
return status;
348 m_evtMax = evtMax.value();