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