157 MsgStream log(messageService(), name());
159 log << MSG::INFO <<
"Babayaga initialize" << endreq;
162 static const bool CREATEIFNOTTHERE(
true);
163 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE);
164 if (!RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc)
166 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endreq;
169 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"Babayaga");
170 std::cout<<
"==============================="<<engine<<endl;
193 std::cout<<
"m_evtMax = "<<m_evtMax<<std::endl;
197 return StatusCode::SUCCESS;
203 MsgStream log(messageService(), name());
208 int pid1,pid2,pst1,pst2;
209 if(m_Ich==1) {pid1=11; pid2=-11; pst1=1;pst2=1;}
210 if(m_Ich==2) {pid1=13; pid2=-13; pst1=1;pst2=1;}
211 if(m_Ich==3) {pid1=22; pid2= 22; pst1=1;pst2=1;}
212 if(m_Ich==4) {pid1=-211; pid2= 211; pst1=1;pst2=1;}
215 GenEvent* evt =
new GenEvent(1,1);
217 GenVertex* prod_vtx =
new GenVertex();
219 evt->add_vertex( prod_vtx );
222 GenParticle* p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
225 p->suggest_barcode( ++npart );
226 prod_vtx->add_particle_in(p);
230 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
234 p->suggest_barcode( ++npart );
235 prod_vtx->add_particle_in(p);
238 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
241 p->suggest_barcode( ++npart );
242 prod_vtx->add_particle_out(p);
252 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
255 p->suggest_barcode( ++npart );
256 prod_vtx->add_particle_out(p);
261 for (iphot=0; iphot<
ISRPHOTONS.ncqph[evtgen-1]; iphot++)
267 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.phot[1][iphot][evtgen],
MOMSET.phot[2][iphot][evtgen],
268 MOMSET.phot[3][iphot][evtgen],
MOMSET.phot[0][iphot][evtgen]),
270 p->suggest_barcode( ++npart );
271 prod_vtx->add_particle_out(p);
278 if( log.level() < MSG::INFO )
284 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(),
"/Event/Gen");
288 MsgStream log(messageService(), name());
289 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endreq;
291 anMcCol->push_back(mcEvent);
298 mcColl->push_back(mcEvent);
299 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen",mcColl);
300 if (sc != StatusCode::SUCCESS)
302 log << MSG::ERROR <<
"Could not register McGenEvent" << endreq;
306 return StatusCode::FAILURE;
314 return StatusCode::SUCCESS;
330 IProperty* appPropMgr=0;
332 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
333 reinterpret_cast<IInterface*&
>( appPropMgr ));
334 if( status.isFailure() )
return status;
336 IntegerProperty evtMax(
"EvtMax",0);
337 status = appPropMgr->getProperty( &evtMax );
338 if (status.isFailure())
return status;
340 m_evtMax = evtMax.value();