96 MsgStream log(
msgSvc(), name() );
98 log << MSG::INFO <<
"EeTo4e initialize" << endmsg;
101 static const bool CREATEIFNOTTHERE(
true );
102 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
103 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
105 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endmsg;
108 CLHEP::HepRandomEngine* engine = p_BesRndmGenSvc->GetEngine(
"EeTo4e" );
109 std::cout <<
"===============================" << engine << endl;
113 COSEE.setcos = m_cosee;
118 std::cout <<
"m_evtMax = " << m_evtMax << std::endl;
122 return StatusCode::SUCCESS;
127 MsgStream log(
msgSvc(), name() );
130 int pid1, pid2, pid3, pid4, pst1, pst2;
139 GenEvent* evt =
new GenEvent( 1, 1 );
141 GenVertex* prod_vtx =
new GenVertex();
143 evt->add_vertex( prod_vtx );
147 new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
150 p->suggest_barcode( ++npart );
151 prod_vtx->add_particle_in( p );
155 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
159 p->suggest_barcode( ++npart );
160 prod_vtx->add_particle_in( p );
163 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
166 p->suggest_barcode( ++npart );
167 prod_vtx->add_particle_out( p );
170 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
173 p->suggest_barcode( ++npart );
174 prod_vtx->add_particle_out( p );
177 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p3[1][evtgen],
MOMSET.p3[2][evtgen],
180 p->suggest_barcode( ++npart );
181 prod_vtx->add_particle_out( p );
184 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
187 p->suggest_barcode( ++npart );
188 prod_vtx->add_particle_out( p );
192 if ( log.level() < MSG::INFO ) { evt->print(); }
195 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
199 MsgStream log(
msgSvc(), name() );
200 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
202 anMcCol->push_back( mcEvent );
209 mcColl->push_back( mcEvent );
210 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
211 if ( sc != StatusCode::SUCCESS )
213 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
217 return StatusCode::FAILURE;
226 return StatusCode::SUCCESS;
241 IProperty* appPropMgr = 0;
243 serviceLocator()->getService(
"ApplicationMgr", IProperty::interfaceID(),
244 reinterpret_cast<IInterface*&
>( appPropMgr ) );
245 if ( status.isFailure() )
return status;
247 IntegerProperty evtMax(
"EvtMax", 0 );
248 status = appPropMgr->getProperty( &evtMax );
249 if ( status.isFailure() )
return status;
251 m_evtMax = evtMax.value();