318 {
319 MsgStream log(messageService(), name());
320 log << MSG::INFO << "Mcgpj executing" << endreq;
321 log<<MSG::WARNING<<"execute start"<<endreq;
322
323
324 GenEvent* evt = new GenEvent(1,1);
325
326 GenVertex* prod_vtx = new GenVertex();
327
328 evt->add_vertex( prod_vtx );
329
330
331 GenParticle* p =
332 new GenParticle(HepLorentzVector(0,0,0.5*cmE*1e-3,0.5*cmE*1e-3),-11, 3);
333 p->suggest_barcode(1);
334 prod_vtx->add_particle_in(p);
335
336
337 p =
338 new GenParticle(HepLorentzVector(0,0,0.5*cmE*1e-3, 0.5*cmE*1e-3), 11, 3);
339 p->suggest_barcode(2);
340 prod_vtx->add_particle_in(p);
341
342 int npart = 2;
343 if(proc<100){
344 double mom[4*6];
345 int np;
347
348
349 for(int i=0; i<np;i++){
350 double ptot = mom[i*4+3];
351 double px = ptot*mom[i*4+0];
352 double py = ptot*mom[i*4+1];
353 double pz = ptot*mom[i*4+2];
355 int pid = 22;
356 if(i<2){
357 pid = fpid[i];
359 }
361 p =
new GenParticle( HepLorentzVector(px,py,pz,
etot), pid, 1);
362 p->suggest_barcode(i+3);
363 prod_vtx->add_particle_out(p);
364 npart++;
365 }
366 } else {
369 for(size_t i=0;i<nmax;i++){
372 p =
373 new GenParticle( HepLorentzVector(
q.X()*1e-3,
q.Y()*1e-3,
q.Z()*1e-3,
q.T()*1e-3), pid, 1);
374 p->suggest_barcode(i+3);
375 prod_vtx->add_particle_out(p);
376 npart++;
377 }
378 }
379
380 if( log.level() < MSG::INFO ){
381 evt->print();
382 }
383
384
385 SmartDataPtr<McGenEventCol> anMcCol(eventSvc(), "/Event/Gen");
386 if (anMcCol!=0){
387
388 log<<MSG::WARNING<<"add event"<<endreq;
389 MsgStream log(messageService(), name());
390 log << MSG::INFO << "Add McGenEvent to existing collection" << endreq;
392 anMcCol->push_back(mcEvent);
393 } else {
394
395 log<<MSG::WARNING<<"create collection"<<endreq;
398 mcColl->push_back(mcEvent);
399 StatusCode sc = eventSvc()->registerObject("/Event/Gen",mcColl);
400 if (sc != StatusCode::SUCCESS) {
401 log << MSG::ERROR << "Could not register McGenEvent" << endreq;
402 delete mcColl;
403 delete evt;
404 delete mcEvent;
405 return StatusCode::FAILURE;
406 } else {
407 log << MSG::INFO << "McGenEventCol created and " << npart
408 <<" particles stored in McGenEvent" << endreq;
409 }
410 }
411
412 log<<MSG::WARNING<<"execute end"<<endreq;
413 return StatusCode::SUCCESS;
414}
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()