333 {
334 MsgStream log(
msgSvc(), name() );
335 log << MSG::INFO << "Mcgpj executing" << endmsg;
336 log << MSG::WARNING << "execute start" << endmsg;
337
338
339 GenEvent* evt = new GenEvent( 1, 1 );
340
341 GenVertex* prod_vtx = new GenVertex();
342
343 evt->add_vertex( prod_vtx );
344
345
346 GenParticle* p =
347 new GenParticle( HepLorentzVector( 0, 0, 0.5 * cmE * 1e-3, 0.5 * cmE * 1e-3 ), -11, 3 );
348 p->suggest_barcode( 1 );
349 prod_vtx->add_particle_in( p );
350
351
352 p = new GenParticle( HepLorentzVector( 0, 0, 0.5 * cmE * 1e-3, 0.5 * cmE * 1e-3 ), 11, 3 );
353 p->suggest_barcode( 2 );
354 prod_vtx->add_particle_in( p );
355
356 int npart = 2;
357 if ( proc < 100 )
358 {
359 double mom[4 * 6];
360 int np;
362
363
364 for ( int i = 0; i < np; i++ )
365 {
366 double ptot = mom[i * 4 + 3];
367 double px = ptot * mom[i * 4 + 0];
368 double py = ptot * mom[i * 4 + 1];
369 double pz = ptot * mom[i * 4 + 2];
371 int pid = 22;
372 if ( i < 2 )
373 {
374 pid = fpid[i];
376 }
378 p =
new GenParticle( HepLorentzVector( px, py, pz,
etot ), pid, 1 );
379 p->suggest_barcode( i + 3 );
380 prod_vtx->add_particle_out( p );
381 npart++;
382 }
383 }
384 else
385 {
387 size_t nmax =
CS->
GetNfinal() + ( ( ipart == 0 ) ? 1 : 2 );
388 for ( size_t i = 0; i < nmax; i++ )
389 {
392 p = new GenParticle(
393 HepLorentzVector(
q.X() * 1e-3,
q.Y() * 1e-3,
q.Z() * 1e-3,
q.T() * 1e-3 ), pid, 1 );
394 p->suggest_barcode( i + 3 );
395 prod_vtx->add_particle_out( p );
396 npart++;
397 }
398 }
399
400 if ( log.level() < MSG::INFO ) { evt->print(); }
401
402
403 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(), "/Event/Gen" );
404 if ( anMcCol != 0 )
405 {
406
407 log << MSG::WARNING << "add event" << endmsg;
408 MsgStream log(
msgSvc(), name() );
409 log << MSG::INFO << "Add McGenEvent to existing collection" << endmsg;
410 McGenEvent* mcEvent = new McGenEvent( evt );
411 anMcCol->push_back( mcEvent );
412 }
413 else
414 {
415
416 log << MSG::WARNING << "create collection" << endmsg;
418 McGenEvent* mcEvent = new McGenEvent( evt );
419 mcColl->push_back( mcEvent );
420 StatusCode sc = eventSvc()->registerObject( "/Event/Gen", mcColl );
421 if ( sc != StatusCode::SUCCESS )
422 {
423 log << MSG::ERROR << "Could not register McGenEvent" << endmsg;
424 delete mcColl;
425 delete evt;
426 delete mcEvent;
427 return StatusCode::FAILURE;
428 }
429 else
430 {
431 log << MSG::INFO << "McGenEventCol created and " << npart
432 << " particles stored in McGenEvent" << endmsg;
433 }
434 }
435
436 log << MSG::WARNING << "execute end" << endmsg;
437 return StatusCode::SUCCESS;
438}
ObjectVector< McGenEvent > McGenEventCol
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
size_t GenUnWeightedEvent()
TLorentzVector ** GetParticles()