187 {
188 MsgStream log(
msgSvc(), name());
189 log << MSG::DEBUG << "BabayagaNLO in execute()" << endreq;
190
191
192 GenEvent* evt = new GenEvent(1,1);
193 GenVertex* prod_vtx = new GenVertex();
194 evt->add_vertex( prod_vtx );
195
196 log << MSG::DEBUG << "check point 1" << endreq;
197 bool unw = !(m_weighted);
198
199 log << MSG::DEBUG << "check point 2" << endreq;
201
202 log << MSG::DEBUG << "check point 3" << endreq;
203 int finalpidm,finalpidp;
204 if (m_ch == 0) {
205 finalpidm=11;
206 finalpidp=-11;
207 } else if (m_ch == 1) {
208 finalpidm=13;
209 finalpidp=-13;
210 } else if (m_ch == 2) {
211 finalpidm=22;
212 finalpidp=22;
213 } else {
214 finalpidm=11;
215 finalpidp=-11;
216 }
217
222
223
224
225 GenParticle *p =
new GenParticle(CLHEP::HepLorentzVector(
p1[1],
p1[2],-
p1[3],
p1[0]), 11, 1);
226 p->suggest_barcode(3);
227 prod_vtx->add_particle_in(p);
228
229
230 p =
new GenParticle(CLHEP::HepLorentzVector(
p2[1],
p2[2],-
p2[3],
p2[0]), -11, 1);
231 p->suggest_barcode(4);
232 prod_vtx->add_particle_in(p);
233
234 log << MSG::DEBUG << "check point 4" << endreq;
235
236 p =
new GenParticle(CLHEP::HepLorentzVector(
p3[1],
p3[2],-
p3[3],
p3[0]), finalpidm, 1);
237 p->suggest_barcode(3);
238 prod_vtx->add_particle_out(p);
239
240
241 p =
new GenParticle(CLHEP::HepLorentzVector(
p4[1],
p4[2],-
p4[3],
p4[0]), finalpidp, 1);
242 p->suggest_barcode(4);
243 prod_vtx->add_particle_out(p);
244
245 log << MSG::DEBUG << "check point 5" << endreq;
246
247 int id_cntr = 5;
253 p = new GenParticle(CLHEP::HepLorentzVector(px,py,pz,eph), 22, 1);
254 p->suggest_barcode(id_cntr);
255 prod_vtx->add_particle_out(p);
256 id_cntr++;
257 }
258
259 log << MSG::DEBUG << "check point 6" << endreq;
260 if (!unw){
261 p =
new GenParticle(CLHEP::HepLorentzVector(0,0,0,
weights_.sdif), 99, 1);
262 p->suggest_barcode(id_cntr);
263 prod_vtx->add_particle_out(p);
264 id_cntr++;
265 }
266
267 if( log.level() <= MSG::DEBUG ){
268 evt->print();
269 }
270
271
272 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
273 if (anMcCol!=0){
274
275 log<<MSG::WARNING<<"add event"<<endreq;
276 MsgStream log(messageService(), name());
277 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
279 anMcCol->push_back(mcEvent);
280 } else {
281
282 log<<MSG::WARNING<<"create collection"<<endreq;
285 mcColl->push_back(mcEvent);
286 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
287 if (sc != StatusCode::SUCCESS) {
288 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
289 delete mcColl;
290 delete evt;
291 delete mcEvent;
292 return StatusCode::FAILURE;
293 } else {
294 log << MSG::INFO << "McGenEventCol created!" << endreq;
295 }
296 }
297
298
299 log<<MSG::DEBUG<< "before execute() return"<<endreq;
300 return StatusCode::SUCCESS;
301
302}
struct @7 momentainitial_
void generate_event_(bool &use_unweighted)
struct @10 babayagainitint_
ObjectVector< McGenEvent > McGenEventCol
double double double * p4