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