161{
162 MsgStream log(messageService(), name());
163
164
165 int npart = 0;
166 int pid1,pid2,pid3,pid4,pst1,pst2;
167 pid1 = 11;
168 pid2 =-11;
169 pst1 = 1;
170 pst2 = 1;
171
172 if(m_vect=="omega"){
173 pid3=223;
174 }else if(m_vect=="phi"){
175 pid3=333;
176 }else if(m_vect=="J/psi"){
177 pid3=443;
178 }else if(m_vect=="psi(2S)"){
179 pid3=100443;
180 }else if(m_vect=="psi(3770)"){
181 pid3=30443;
182 }else if(m_vect=="psi(4040)"){
183 pid3=9000443;
184 }else if(m_vect=="psi(4160)"){
185 pid3=9010443;
186 }else if(m_vect=="psi(4415)"){
187 pid3=9020443;
188 }
189
190
191 GenEvent* evt = new GenEvent(1,1);
192
193 GenVertex* prod_vtx = new GenVertex();
194
195 evt->add_vertex( prod_vtx );
196
197
198 GenParticle* p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p1[1][evtgen],
MOMSET.p1[2][evtgen],
200 11, 3);
201 p->suggest_barcode( ++npart );
202 prod_vtx->add_particle_in(p);
203
204
205
206 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q1[1][evtgen],
MOMSET.q1[2][evtgen],
208 -11, 3);
209
210 p->suggest_barcode( ++npart );
211 prod_vtx->add_particle_in(p);
212
213
214 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.p2[1][evtgen],
MOMSET.p2[2][evtgen],
216 pid1,pst1);
217 p->suggest_barcode( ++npart );
218 prod_vtx->add_particle_out(p);
219
220
221 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q2[1][evtgen],
MOMSET.q2[2][evtgen],
223 pid2, pst1);
224 p->suggest_barcode( ++npart );
225 prod_vtx->add_particle_out(p);
226
227
228 p =
new GenParticle( CLHEP::HepLorentzVector(
MOMSET.q3[1][evtgen],
MOMSET.q3[2][evtgen],
230 pid3,pst2);
231 p->suggest_barcode( ++npart );
232 prod_vtx->add_particle_out(p);
233
234 evtgen++;
235
236 if( log.level() < MSG::INFO )
237 {
238 evt->print();
239 }
240
241
242 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
243 if (anMcCol!=0)
244 {
245
246 MsgStream log(messageService(), name());
247 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
249 anMcCol->push_back(mcEvent);
250 }
251 else
252 {
253
254
257 mcColl->push_back(mcEvent);
258 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
259 if (sc != StatusCode::SUCCESS)
260 {
261 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
262 delete mcColl;
263 delete evt;
264 delete mcEvent;
265 return StatusCode::FAILURE;
266 }
267 else
268 {
269
270 }
271 }
272
273 return StatusCode::SUCCESS;
274}
ObjectVector< McGenEvent > McGenEventCol