88 MsgStream log(
msgSvc(), name() );
90 log << MSG::INFO <<
"Phokhara initialize" << endmsg;
95 if ( m_initSeed == 0 )
99 static const bool CREATEIFNOTTHERE(
true );
100 StatusCode RndmStatus = service(
"BesRndmGenSvc", p_BesRndmGenSvc, CREATEIFNOTTHERE );
101 if ( !RndmStatus.isSuccess() || 0 == p_BesRndmGenSvc )
103 log << MSG::ERROR <<
" Could not initialize Random Number Service" << endmsg;
108 HepRandomEngine* engine = p_BesRndmGenSvc->
GetEngine(
"PHOKHARA" );
109 const long*
s = engine->getSeeds();
113 log << MSG::INFO <<
"Set initial seed " << m_initSeed << endmsg;
138 FLAGS.fsrnlo = m_fsrnlo;
141 FLAGS.FF_pion = m_FF_Pion;
142 FLAGS.f0_model = m_f0_model;
143 FLAGS.FF_kaon = m_FF_Kaon;
144 FLAGS.narr_res = m_NarrowRes;
150 CUTS.q2min = m_q2min;
151 CUTS.q2_min_c = m_q2_min_c;
152 CUTS.q2_max_c = m_q2_max_c;
154 CUTS.phot1cut = m_phot1cut;
155 CUTS.phot2cut = m_phot2cut;
156 CUTS.pi1cut = m_pi1cut;
157 CUTS.pi2cut = m_pi2cut;
161 cout <<
"-------------------------------------------------------------" << endl;
162 if (
FLAGS.pion == 0 ) cout <<
" PHOKHARA 7.0 : e^+ e^- -> mu^+ mu^- gamma" << endl;
163 else if (
FLAGS.pion == 1 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- gamma" << endl;
164 else if (
FLAGS.pion == 2 )
165 cout <<
" PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- 2pi^0 gamma" << endl;
166 else if (
FLAGS.pion == 3 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> 2pi^+ 2pi^- gamma" << endl;
167 else if (
FLAGS.pion == 4 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> p pbar gamma" << endl;
168 else if (
FLAGS.pion == 5 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> n nbar gamma" << endl;
169 else if (
FLAGS.pion == 6 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> K^+ K^- gamma" << endl;
170 else if (
FLAGS.pion == 7 ) cout <<
" PHOKHARA 7.0: e^+ e^- -> K_0 K_0bar gamma" << endl;
171 else if (
FLAGS.pion == 8 )
172 cout <<
" PHOKHARA 7.0: e^+ e^- -> pi^+ pi^- pi^0 gamma" << endl;
173 else if (
FLAGS.pion == 9 )
175 cout <<
"PHOKHARA 7.0 : e^+ e^- ->" << endl;
176 cout <<
" Lambda (-> pi^- p) Lambda bar (-> pi^+ pbar) gamma" << endl;
178 else cout <<
" PHOKHARA 7.0: not yet implemented" << endl;
181 cout <<
"--------------------------------------------------------------" << endl;
182 printf(
" %s %f %s\n",
"cms total energy = ", sqrt(
CTES.Sp ),
185 if ( (
CUTS.gmin / 2.0 /
CTES.ebeam ) < 0.0098 )
187 cerr <<
" minimal missing energy set to small" << endl;
188 return StatusCode::FAILURE;
190 printf(
" %s %f %s\n",
"minimal tagged photon energy = ",
CUTS.gmin,
" GeV " );
191 printf(
" %s %f,%f\n",
"angular cuts on tagged photon = ",
CUTS.phot1cut,
206 if (
FLAGS.pion == 0 )
207 printf(
" %s %f,%f\n",
"angular cuts on muons = ",
CUTS.pi1cut,
209 else if (
FLAGS.pion == 4 )
210 printf(
" %s %f,%f\n",
"angular cuts on protons = ",
CUTS.pi1cut,
212 else if (
FLAGS.pion == 5 )
213 printf(
" %s %f,%f\n",
"angular cuts on neutrons = ",
CUTS.pi1cut,
215 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
216 printf(
" %s %f,%f\n",
"angular cuts on kaons = ",
CUTS.pi1cut,
218 else if (
FLAGS.pion == 9 )
219 printf(
" %s %f,%f\n",
"angular cuts on pions and protons = ",
CUTS.pi1cut,
222 printf(
" %s %f,%f\n",
"angular cuts on pions = ",
CUTS.pi1cut,
226 if (
FLAGS.pion == 0 )
227 printf(
" %s %f %s\n",
"min. muons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
228 else if (
FLAGS.pion == 4 )
229 printf(
" %s %f %s\n",
"min. protons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
230 else if (
FLAGS.pion == 5 )
231 printf(
" %s %f %s\n",
"min. neutrons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
232 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
233 printf(
" %s %f %s\n",
"min. kaons-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
234 else if (
FLAGS.pion == 9 )
235 printf(
" %s %f %s\n",
" min. lambdas-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
237 printf(
" %s %f %s\n",
"min. pions-tagged photon inv.mass^2 = ",
CUTS.q2min,
" GeV^2" );
252 if (
FLAGS.pion == 0 )
254 else if (
FLAGS.pion == 1 ) qqmin = 4.0 *
CTES.mpi *
CTES.mpi;
255 else if (
FLAGS.pion == 2 )
257 else if (
FLAGS.pion == 3 ) qqmin = 16.0 *
CTES.mpi *
CTES.mpi;
259 else if (
FLAGS.pion == 5 ) qqmin = 4.0 *
CTES.mnt *
CTES.mnt;
260 else if (
FLAGS.pion == 6 ) qqmin = 4.0 *
CTES.mKp *
CTES.mKp;
261 else if (
FLAGS.pion == 7 ) qqmin = 4.0 *
CTES.mKn *
CTES.mKn;
262 else if (
FLAGS.pion == 8 )
264 else if (
FLAGS.pion == 9 ) qqmin = 4.0 *
CTES.mlamb *
CTES.mlamb;
269 if (
CUTS.q2_max_c < qqmax ) qqmax =
CUTS.q2_max_c;
272 if ( (
CUTS.q2_min_c > qqmin ) &&
275 qqmin =
CUTS.q2_min_c;
278 cerr <<
"------------------------------" << endl;
279 cerr <<
" Q^2_min TOO SMALL" << endl;
280 cerr <<
" Q^2_min CHANGED BY PHOKHARA = " << qqmin <<
" GeV^2" << endl;
281 cerr <<
"------------------------------" << endl;
284 if ( qqmax <= qqmin )
286 cerr <<
" Q^2_max to small " << endl;
287 cerr <<
" Q^2_max = " << qqmax << endl;
288 cerr <<
" Q^2_min = " << qqmin << endl;
289 return StatusCode::FAILURE;
293 if (
FLAGS.pion == 0 )
295 printf(
" %s %f %s\n",
"minimal muon-pair invariant mass^2 = ", qqmin,
" GeV^2" );
296 printf(
" %s %f %s\n",
"maximal muon-pair invariant mass^2 = ", qqmax,
" GeV^2" );
298 else if (
FLAGS.pion == 1 )
300 printf(
" %s %f %s\n",
"minimal pion-pair invariant mass^2 = ", qqmin,
" GeV^2" );
301 printf(
" %s %f %s\n",
"maximal pion-pair invariant mass^2 = ", qqmax,
" GeV^2" );
303 else if (
FLAGS.pion == 4 )
305 printf(
" %s %f %s\n",
"minimal proton-pair invariant mass^2 = ", qqmin,
" GeV^2" );
306 printf(
" %s %f %s\n",
"maximal proton-pair invariant mass^2 = ", qqmax,
" GeV^2" );
308 else if (
FLAGS.pion == 5 )
310 printf(
" %s %f %s\n",
"minimal neutron-pair invariant mass^2 = ", qqmin,
" GeV^2" );
311 printf(
" %s %f %s\n",
"maximal neutron-pair invariant mass^2 = ", qqmax,
" GeV^2" );
313 else if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
315 printf(
" %s %f %s\n",
"minimal kaon-pair invariant mass^2 = ", qqmin,
" GeV^2" );
316 printf(
" %s %f %s\n",
"maximal kaon-pair invariant mass^2 = ", qqmax,
" GeV^2" );
318 else if (
FLAGS.pion == 8 )
320 printf(
" %s %f %s\n",
"minimal three-pion invariant mass^2 = ", qqmin,
" GeV^2" );
321 printf(
" %s %f %s\n",
"maximal three-pion invariant mass^2 = ", qqmax,
" GeV^2" );
323 else if (
FLAGS.pion == 9 )
325 printf(
" %s %f %s\n",
"minimal lambda-pair invariant mass^2 = ", qqmin,
" GeV^2" );
326 printf(
" %s %f %s\n",
"maximal lambda-pair invariant mass^2 = ", qqmax,
" GeV^2" );
330 printf(
" %s %f %s\n",
"minimal four-pion invariant mass^2 = ", qqmin,
" GeV^2" );
331 printf(
" %s %f %s\n",
"maximal four-pion invariant mass^2 = ", qqmax,
" GeV^2" );
334 if (
FLAGS.nlo == 0 )
336 cout <<
"Born" << endl;
337 if (
FLAGS.fsrnlo != 0 )
339 cerr <<
"WRONG FSRNLO flag - only fsrnlo=0 allowed for Born" << endl;
340 return StatusCode::FAILURE;
344 if ( (
FLAGS.pion == 9 ) && (
FLAGS.nlo != 0 ) )
346 cerr <<
"WRONG NLO flag - only Born allowed for Lambdas" << endl;
347 cerr <<
"If you feel that you need NLO" << endl;
348 cerr <<
"please contact the authors" << endl;
349 return StatusCode::FAILURE;
352 if (
FLAGS.nlo == 1 )
353 printf(
" %s %f\n",
"NLO: soft photon cutoff w = ",
CUTS.w );
354 if ( (
FLAGS.pion <= 1 ) || (
FLAGS.pion == 6 ) )
357 if ( !( (
FLAGS.fsr == 1 ) || (
FLAGS.fsr == 2 ) || (
FLAGS.fsrnlo == 0 ) ||
359 (
FLAGS.fsrnlo == 0 ) ) )
361 cerr <<
"WRONG combination of FSR, FSRNLO flags" << endl;
362 return StatusCode::FAILURE;
366 if (
FLAGS.fsr == 0 ) cout <<
"ISR only" << endl;
367 else if (
FLAGS.fsr == 1 ) cout <<
"ISR+FSR" << endl;
368 else if (
FLAGS.fsr == 2 )
370 if (
FLAGS.nlo == 0 ) cout <<
"ISR+INT+FSR" << endl;
373 cerr <<
"WRONG FSR flag: interference is included only for nlo=0" << endl;
374 return StatusCode::FAILURE;
379 cerr <<
"WRONG FSR flag" <<
FLAGS.fsr << endl;
380 return StatusCode::FAILURE;
383 if (
FLAGS.fsrnlo == 1 ) cout <<
"IFSNLO included" << endl;
387 if ( (
FLAGS.fsr == 0 ) && (
FLAGS.fsrnlo == 0 ) ) cout <<
"ISR only" << endl;
390 cerr <<
"FSR is implemented only for pi+pi-, mu+mu- and K+K- modes" << endl;
391 return StatusCode::FAILURE;
396 if (
FLAGS.ivac == 0 ) { cout <<
"Vacuum polarization is NOT included" << endl; }
397 else if (
FLAGS.ivac == 1 )
399 cout <<
"Vacuum polarization by Fred Jegerlehner "
400 "(http://www-com.physik.hu-berlin.de/fjeger/alphaQEDn.uu)"
403 else if (
FLAGS.ivac == 2 )
405 cout <<
"Vacuum polarization (VP_HLMNT_v1_3nonr) by Daisuke Nomura and Thomas Teubner"
410 cout <<
"WRONG vacuum polarization switch" << endl;
411 return StatusCode::FAILURE;
415 if (
FLAGS.pion == 1 )
417 if (
FLAGS.FF_pion == 0 ) cout <<
"Kuhn-Santamaria PionFormFactor" << endl;
418 else if (
FLAGS.FF_pion == 1 ) cout <<
"Gounaris-Sakurai PionFormFactor old" << endl;
419 else if (
FLAGS.FF_pion == 2 ) cout <<
"Gounaris-Sakurai PionFormFactor new" << endl;
422 cout <<
"WRONG PionFormFactor switch" << endl;
423 return StatusCode::FAILURE;
426 if (
FLAGS.fsr != 0 )
428 if (
FLAGS.f0_model == 0 ) cout <<
"f0+f0(600): K+K- model" << endl;
429 else if (
FLAGS.f0_model == 1 ) cout <<
"f0+f0(600): \"no structure\" model" << endl;
430 else if (
FLAGS.f0_model == 2 ) cout <<
"NO f0+f0(600)" << endl;
431 else if (
FLAGS.f0_model == 3 )
432 cout <<
"only f0, KLOE: Cesare Bini-private communication" << endl;
435 cout <<
"WRONG f0+f0(600) switch" << endl;
436 return StatusCode::FAILURE;
442 if ( (
FLAGS.pion == 6 ) || (
FLAGS.pion == 7 ) )
444 if (
FLAGS.FF_kaon == 0 ) cout <<
"constrained KaonFormFactor" << endl;
445 else if (
FLAGS.FF_kaon == 1 ) { cout <<
"unconstrained KaonFormFactor" << endl; }
446 else if (
FLAGS.FF_kaon == 2 )
447 { cout <<
"Kuhn-Khodjamirian-Bruch KaonFormFactor" << endl; }
450 cout <<
"WRONG KaonFormFactor switch" << endl;
451 return StatusCode::FAILURE;
455 if ( (
FLAGS.pion == 0 ) || (
FLAGS.pion == 1 ) || (
FLAGS.pion == 6 ) ||
456 (
FLAGS.pion == 7 ) )
458 if (
FLAGS.narr_res == 1 ) { cout <<
"THE NARROW RESONANCE J/PSI INCLUDED" << endl; }
459 else if (
FLAGS.narr_res == 2 )
460 { cout <<
"THE NARROW RESONANCE PSI(2S) INCLUDED" << endl; }
461 else if (
FLAGS.narr_res != 0 )
463 cout <<
"wrong flag narr_res: only 0, 1 or 2 allowed" << endl;
464 return StatusCode::FAILURE;
469 cout <<
"--------------------------------------------------------------" << endl;
473 for ( i = 0; i < 2; i++ )
489 for ( j = 1; j <= m_nm; j++ )
496 GEN_1PH( 1, qqmin, qqmax, cos1min, cos1max, cos3min, cos3max );
501 GEN_2PH( 1, qqmin, cos1min, cos1max, cos2min, cos2max, cos3min, cos3max );
513 if ( (
FLAGS.pion == 0 ) && (
FLAGS.fsr == 1 ) && (
FLAGS.fsrnlo == 0 ) )
516 if ( (
FLAGS.pion == 2 ) || (
FLAGS.pion == 3 ) )
522 if (
FLAGS.pion == 8 )
534 return StatusCode::SUCCESS;
578 MsgStream log(
msgSvc(), name() );
582 GenEvent* evt =
new GenEvent( 1, 1 );
584 GenVertex* prod_vtx =
new GenVertex();
586 evt->add_vertex( prod_vtx );
590 new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][0],
CTES.momenta[2][0],
591 CTES.momenta[3][0],
CTES.momenta[0][0] ),
593 p->suggest_barcode( ++npart );
594 prod_vtx->add_particle_in( p );
597 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][1],
CTES.momenta[2][1],
598 CTES.momenta[3][1],
CTES.momenta[0][1] ),
600 p->suggest_barcode( ++npart );
601 prod_vtx->add_particle_in( p );
604 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][2],
CTES.momenta[2][2],
605 CTES.momenta[3][2],
CTES.momenta[0][2] ),
607 p->suggest_barcode( ++npart );
608 prod_vtx->add_particle_out( p );
610 if (
CTES.momenta[0][3] != 0 )
612 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][3],
CTES.momenta[2][3],
613 CTES.momenta[3][3],
CTES.momenta[0][3] ),
615 p->suggest_barcode( ++npart );
616 prod_vtx->add_particle_out( p );
620 if (
FLAGS.pion == 0 )
623 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
624 CTES.momenta[3][5],
CTES.momenta[0][5] ),
626 p->suggest_barcode( ++npart );
627 prod_vtx->add_particle_out( p );
629 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
630 CTES.momenta[3][6],
CTES.momenta[0][6] ),
632 p->suggest_barcode( ++npart );
633 prod_vtx->add_particle_out( p );
636 if (
FLAGS.pion == 1 )
639 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
640 CTES.momenta[3][5],
CTES.momenta[0][5] ),
642 p->suggest_barcode( ++npart );
643 prod_vtx->add_particle_out( p );
645 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
646 CTES.momenta[3][6],
CTES.momenta[0][6] ),
648 p->suggest_barcode( ++npart );
649 prod_vtx->add_particle_out( p );
652 if (
FLAGS.pion == 2 )
655 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
656 CTES.momenta[3][5],
CTES.momenta[0][5] ),
658 p->suggest_barcode( ++npart );
659 prod_vtx->add_particle_out( p );
661 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
662 CTES.momenta[3][6],
CTES.momenta[0][6] ),
664 p->suggest_barcode( ++npart );
665 prod_vtx->add_particle_out( p );
667 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][7],
CTES.momenta[2][7],
668 CTES.momenta[3][7],
CTES.momenta[0][7] ),
670 p->suggest_barcode( ++npart );
671 prod_vtx->add_particle_out( p );
673 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][8],
CTES.momenta[2][8],
674 CTES.momenta[3][8],
CTES.momenta[0][8] ),
676 p->suggest_barcode( ++npart );
677 prod_vtx->add_particle_out( p );
680 if (
FLAGS.pion == 3 )
683 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
684 CTES.momenta[3][5],
CTES.momenta[0][5] ),
686 p->suggest_barcode( ++npart );
687 prod_vtx->add_particle_out( p );
689 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
690 CTES.momenta[3][6],
CTES.momenta[0][6] ),
692 p->suggest_barcode( ++npart );
693 prod_vtx->add_particle_out( p );
695 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][7],
CTES.momenta[2][7],
696 CTES.momenta[3][7],
CTES.momenta[0][7] ),
698 p->suggest_barcode( ++npart );
699 prod_vtx->add_particle_out( p );
701 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][8],
CTES.momenta[2][8],
702 CTES.momenta[3][8],
CTES.momenta[0][8] ),
704 p->suggest_barcode( ++npart );
705 prod_vtx->add_particle_out( p );
708 if (
FLAGS.pion == 4 )
711 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
712 CTES.momenta[3][5],
CTES.momenta[0][5] ),
714 p->suggest_barcode( ++npart );
715 prod_vtx->add_particle_out( p );
717 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
718 CTES.momenta[3][6],
CTES.momenta[0][6] ),
720 p->suggest_barcode( ++npart );
721 prod_vtx->add_particle_out( p );
724 if (
FLAGS.pion == 5 )
727 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
728 CTES.momenta[3][5],
CTES.momenta[0][5] ),
730 p->suggest_barcode( ++npart );
731 prod_vtx->add_particle_out( p );
733 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
734 CTES.momenta[3][6],
CTES.momenta[0][6] ),
736 p->suggest_barcode( ++npart );
737 prod_vtx->add_particle_out( p );
740 if (
FLAGS.pion == 6 )
743 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
744 CTES.momenta[3][5],
CTES.momenta[0][5] ),
746 p->suggest_barcode( ++npart );
747 prod_vtx->add_particle_out( p );
749 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
750 CTES.momenta[3][6],
CTES.momenta[0][6] ),
752 p->suggest_barcode( ++npart );
753 prod_vtx->add_particle_out( p );
756 if (
FLAGS.pion == 7 )
759 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
760 CTES.momenta[3][5],
CTES.momenta[0][5] ),
762 p->suggest_barcode( ++npart );
763 prod_vtx->add_particle_out( p );
765 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
766 CTES.momenta[3][6],
CTES.momenta[0][6] ),
768 p->suggest_barcode( ++npart );
769 prod_vtx->add_particle_out( p );
772 if (
FLAGS.pion == 8 )
775 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
776 CTES.momenta[3][5],
CTES.momenta[0][5] ),
778 p->suggest_barcode( ++npart );
779 prod_vtx->add_particle_out( p );
781 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
782 CTES.momenta[3][6],
CTES.momenta[0][6] ),
784 p->suggest_barcode( ++npart );
785 prod_vtx->add_particle_out( p );
787 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][7],
CTES.momenta[2][7],
788 CTES.momenta[3][7],
CTES.momenta[0][7] ),
790 p->suggest_barcode( ++npart );
791 prod_vtx->add_particle_out( p );
794 if (
FLAGS.pion == 9 )
797 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][5],
CTES.momenta[2][5],
798 CTES.momenta[3][5],
CTES.momenta[0][5] ),
800 p->suggest_barcode( ++npart );
801 prod_vtx->add_particle_out( p );
803 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][6],
CTES.momenta[2][6],
804 CTES.momenta[3][6],
CTES.momenta[0][6] ),
806 p->suggest_barcode( ++npart );
807 prod_vtx->add_particle_out( p );
809 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][7],
CTES.momenta[2][7],
810 CTES.momenta[3][7],
CTES.momenta[0][7] ),
812 p->suggest_barcode( ++npart );
813 prod_vtx->add_particle_out( p );
815 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][8],
CTES.momenta[2][8],
816 CTES.momenta[3][8],
CTES.momenta[0][8] ),
818 p->suggest_barcode( ++npart );
819 prod_vtx->add_particle_out( p );
821 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][9],
CTES.momenta[2][9],
822 CTES.momenta[3][9],
CTES.momenta[0][9] ),
824 p->suggest_barcode( ++npart );
825 prod_vtx->add_particle_out( p );
827 p =
new GenParticle( CLHEP::HepLorentzVector(
CTES.momenta[1][10],
CTES.momenta[2][10],
828 CTES.momenta[3][10],
CTES.momenta[0][10] ),
830 p->suggest_barcode( ++npart );
831 prod_vtx->add_particle_out( p );
834 if ( log.level() < MSG::INFO ) { evt->print(); }
837 SmartDataPtr<McGenEventCol> anMcCol( eventSvc(),
"/Event/Gen" );
841 MsgStream log(
msgSvc(), name() );
842 log << MSG::INFO <<
"Add McGenEvent to existing collection" << endmsg;
844 anMcCol->push_back( mcEvent );
851 mcColl->push_back( mcEvent );
852 StatusCode sc = eventSvc()->registerObject(
"/Event/Gen", mcColl );
853 if ( sc != StatusCode::SUCCESS )
855 log << MSG::ERROR <<
"Could not register McGenEvent" << endmsg;
859 return StatusCode::FAILURE;
863 log << MSG::INFO <<
"McGenEventCol created and " << npart
864 <<
" particles stored in McGenEvent" << endmsg;
868 return StatusCode::SUCCESS;