164 MsgStream log(
msgSvc(), name() );
166 log << MSG::INFO <<
"Babayaga initialize" << endmsg;
169 static const bool CREATEIFNOTTHERE(
true );
170 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
171 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
173 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endmsg;
176 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine(
"Babayaga" );
177 std::cout <<
"===============================" << engine << endl;
183 if ( m_PHCUT == 1 ) {
DECLARESTR.phcut =
'Y'; }
203 std::cout <<
"m_evtMax = " << m_evtMax << std::endl;
207 return StatusCode::SUCCESS;
212 MsgStream log(
msgSvc(), name() );
217 int pid1, pid2, pst1, pst2;
248 GenEvent* evt =
new GenEvent( 1, 1 );
250 GenVertex* prod_vtx =
new GenVertex();
252 evt->add_vertex( prod_vtx );
256 new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
259 p->suggest_barcode( ++npart );
260 prod_vtx->add_particle_in( p );
264 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
268 p->suggest_barcode( ++npart );
269 prod_vtx->add_particle_in( p );
272 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
275 p->suggest_barcode( ++npart );
276 prod_vtx->add_particle_out( p );
289 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
292 p->suggest_barcode( ++npart );
293 prod_vtx->add_particle_out( p );
297 for ( iphot = 0; iphot <
ISRPHOTONS.ncqph[evtgen - 1]; iphot++ )
304 p =
new GenParticle( CLHEP::HepLorentzVector(
305 MOMSET.phot[1][iphot][evtgen],
MOMSET.phot[2][iphot][evtgen],
306 MOMSET.phot[3][iphot][evtgen],
MOMSET.phot[0][iphot][evtgen] ),
308 p->suggest_barcode( ++npart );
309 prod_vtx->add_particle_out( p );
314 if ( log.level() < MSG::INFO ) { evt->print(); }
317 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
321 MsgStream log(
msgSvc(), name() );
322 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
324 anMcCol->push_back( mcEvent );
331 mcColl->push_back( mcEvent );
332 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
333 if ( sc != StatusCode::SUCCESS )
335 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
339 return StatusCode::FAILURE;
348 return StatusCode::SUCCESS;
363 IProperty* appPropMgr = 0;
365 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
366 reinterpret_cast<IInterface*&
>( appPropMgr ) );
367 if ( status.isFailure() )
return status;
369 IntegerProperty evtMax(
"EvtMax", 0 );
370 status = appPropMgr->getProperty( &evtMax );
371 if ( status.isFailure() )
return status;
373 m_evtMax = evtMax.value();