118 MsgStream log(
msgSvc(), name() );
120 log << MSG::INFO <<
"Eepipi initialize" << endmsg;
123 static const bool CREATEIFNOTTHERE(
true );
124 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
125 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
127 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endmsg;
130 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine(
"Eepipi" );
131 std::cout <<
"===============================" << engine << endl;
141 std::string locvp = getenv(
"EEPIPIROOT" );
142 locvp +=
"/share/fitpipi.dat";
145 system(
"cat $EEPIPIROOT/share/fitpipi.dat>fitpipi.dat" );
148 std::cout <<
"m_evtMax = " << m_evtMax << std::endl;
152 return StatusCode::SUCCESS;
157 MsgStream log(
msgSvc(), name() );
160 int pid1, pid2, pid3, pid4, pst1, pst2;
169 GenEvent* evt =
new GenEvent( 1, 1 );
171 GenVertex* prod_vtx =
new GenVertex();
173 evt->add_vertex( prod_vtx );
177 new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
180 p->suggest_barcode( ++npart );
181 prod_vtx->add_particle_in( p );
185 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
189 p->suggest_barcode( ++npart );
190 prod_vtx->add_particle_in( p );
193 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
196 p->suggest_barcode( ++npart );
197 prod_vtx->add_particle_out( p );
200 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
203 p->suggest_barcode( ++npart );
204 prod_vtx->add_particle_out( p );
207 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p3[1][evtgen],
MOMSET.p3[2][evtgen],
210 p->suggest_barcode( ++npart );
211 prod_vtx->add_particle_out( p );
214 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
217 p->suggest_barcode( ++npart );
218 prod_vtx->add_particle_out( p );
222 if ( log.level() < MSG::INFO ) { evt->print(); }
225 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
229 MsgStream log(
msgSvc(), name() );
230 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
232 anMcCol->push_back( mcEvent );
239 mcColl->push_back( mcEvent );
240 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
241 if ( sc != StatusCode::SUCCESS )
243 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
247 return StatusCode::FAILURE;
256 return StatusCode::SUCCESS;
271 IProperty* appPropMgr = 0;
273 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
274 reinterpret_cast<IInterface*&
>( appPropMgr ) );
275 if ( status.isFailure() )
return status;
277 IntegerProperty evtMax(
"EvtMax", 0 );
278 status = appPropMgr->getProperty( &evtMax );
279 if ( status.isFailure() )
return status;
281 m_evtMax = evtMax.value();