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