11 #include "HepPDT/ParticleData.hh" 
   12 #include "HepPDT/ParticleDataTable.hh" 
   17   os << std::string(80, 
'_') << 
"\n" << std::endl;
 
   41     return StatusCode::FAILURE;
 
   47   return StatusCode::SUCCESS;
 
   72       return StatusCode::SUCCESS;
 
   77       return StatusCode::SUCCESS;
 
   93       std::cout << 
"GenEvent: #" << 
evt->event_number()
 
   95                 << 
" SignalProcessGenVertex Barcode: " 
   97       std::cout << 
" Entries this event: " << 
evt->vertices_size() << 
" vertices, " 
   98                 << 
evt->particles_size() << 
" particles.\n";
 
  100       if (
evt->heavy_ion()) {
 
  101         std::cout << 
" HeavyIon: jatt=" << 
evt->heavy_ion()->Ncoll_hard
 
  102                   << 
" np=" << 
evt->heavy_ion()->Npart_proj
 
  103                   << 
" nt=" << 
evt->heavy_ion()->Npart_targ
 
  104                   << 
" ncoll=" << 
evt->heavy_ion()->Ncoll
 
  105                   << 
" specn=" << 
evt->heavy_ion()->spectator_neutrons
 
  106                   << 
" specp=" << 
evt->heavy_ion()->spectator_protons
 
  107                   << 
" n01=" << 
evt->heavy_ion()->N_Nwounded_collisions
 
  108                   << 
" n10=" << 
evt->heavy_ion()->Nwounded_N_collisions
 
  109                   << 
" n11=" << 
evt->heavy_ion()->Nwounded_Nwounded_collisions
 
  110                   << 
" impact=" << 
evt->heavy_ion()->impact_parameter
 
  111                   << 
" evplane=" << 
evt->heavy_ion()->event_plane_angle
 
  112                   << 
" ecc=" << 
evt->heavy_ion()->eccentricity
 
  113                   << 
" sigmaNNinel=" << 
evt->heavy_ion()->sigma_inel_NN
 
  117         std::cout << 
"HeavyIon: EMPTY" 
  123       std::cout << 
" Weights(" << 
evt->weights().size() << 
")=";
 
  124       for ( 
auto wgt = 
evt->weights().begin();
 
  125             wgt != 
evt->weights().end(); wgt++ ) { std::cout << *wgt << 
" "; }
 
  127       std::cout << 
" EventScale " << (
evt->attribute<HepMC3::DoubleAttribute>(
"event_scale")? 
evt->attribute<HepMC3::DoubleAttribute>(
"event_scale")->value():0.0)
 
  128                 << 
" [energy] \t alphaQCD=" << (
evt->attribute<HepMC3::DoubleAttribute>(
"alphaQCD")? 
evt->attribute<HepMC3::DoubleAttribute>(
"alphaQCD")->value():0.0)
 
  129                 << 
"\t alphaQED=" << (
evt->attribute<HepMC3::DoubleAttribute>(
"alphaQED")? 
evt->attribute<HepMC3::DoubleAttribute>(
"alphaQED")->value():0.0) << std::endl;
 
  131       if (
evt->pdf_info()) {
 
  132         std::cout << 
"PdfInfo: id1=" << 
evt->pdf_info()->parton_id[0]
 
  133                   << 
" id2=" << 
evt->pdf_info()->parton_id[1]
 
  134                   << 
" x1=" << 
evt->pdf_info()->x[0]
 
  135                   << 
" x2=" << 
evt->pdf_info()->x[1]
 
  136                   << 
" q=" << 
evt->pdf_info()->scale
 
  137                   << 
" xpdf1=" << 
evt->pdf_info()->pdf_id[0]
 
  138                   << 
" xpdf2=" << 
evt->pdf_info()->pdf_id[1]
 
  142         std::cout << 
"PdfInfo: EMPTY" 
  146       if (
evt->heavy_ion()) {
 
  147         std::cout << 
" HeavyIon: jatt=" << 
evt->heavy_ion()->Ncoll_hard()
 
  148                   << 
" np=" << 
evt->heavy_ion()->Npart_proj()
 
  149                   << 
" nt=" << 
evt->heavy_ion()->Npart_targ()
 
  150                   << 
" ncoll=" << 
evt->heavy_ion()->Ncoll()
 
  151                   << 
" specn=" << 
evt->heavy_ion()->spectator_neutrons()
 
  152                   << 
" specp=" << 
evt->heavy_ion()->spectator_protons()
 
  153                   << 
" n01=" << 
evt->heavy_ion()->N_Nwounded_collisions()
 
  154                   << 
" n10=" << 
evt->heavy_ion()->Nwounded_N_collisions()
 
  155                   << 
" n11=" << 
evt->heavy_ion()->Nwounded_Nwounded_collisions()
 
  156                   << 
" impact=" << 
evt->heavy_ion()->impact_parameter()
 
  157                   << 
" evplane=" << 
evt->heavy_ion()->event_plane_angle()
 
  158                   << 
" ecc=" << 
evt->heavy_ion()->eccentricity()
 
  159                   << 
" sigmaNNinel=" << 
evt->heavy_ion()->sigma_inel_NN()
 
  163         std::cout << 
"HeavyIon: EMPTY" 
  169       std::cout << 
" Weights(" << 
evt->weights().size() << 
")=";
 
  170       for (
double w :  
evt->weights()) {
 
  171         std::cout << 
w << 
" ";
 
  174       std::cout << 
" EventScale " << 
evt->event_scale()
 
  175                 << 
" [energy] \t alphaQCD=" << 
evt->alphaQCD()
 
  176                 << 
"\t alphaQED=" << 
evt->alphaQED() << std::endl;
 
  178       if (
evt->pdf_info()) {
 
  179         std::cout << 
"PdfInfo: id1=" << 
evt->pdf_info()->id1()
 
  180                   << 
" id2=" << 
evt->pdf_info()->id2()
 
  181                   << 
" x1=" << 
evt->pdf_info()->x1()
 
  182                   << 
" x2=" << 
evt->pdf_info()->x2()
 
  183                   << 
" q=" << 
evt->pdf_info()->scalePDF()
 
  184                   << 
" xpdf1=" << 
evt->pdf_info()->pdf1()
 
  185                   << 
" xpdf2=" << 
evt->pdf_info()->pdf2()
 
  189         std::cout << 
"PdfInfo: EMPTY" 
  195       char particle_legend[120];
 
  196       sprintf( particle_legend,
"  %9s %8s %-15s %4s %8s %8s   (%9s,%9s,%9s,%9s,%9s)",
 
  197                "Barcode",
"PDG ID",
"Name",
"Stat",
"ProdVtx",
"DecayVtx",
"Px",
"Py",
"Pz",
"E ",
"m");
 
  198       std::cout << std::endl;
 
  199       std::cout << 
"                                    GenParticle Legend\n" << particle_legend << 
"\n";
 
  201         sprintf( particle_legend,
" %60s (%9s,%9s,%9s,%9s)",
" ",
"Vx",
"Vy",
"Vz",
"Vct ");
 
  202         std::cout << particle_legend << std::endl;
 
  209         int p_pdg_id = 
p->pdg_id();
 
  210         HepMC::FourVector 
mom=
p->momentum();
 
  211         int p_stat = 
p->status();
 
  212         int p_prodvtx = 
p->production_vertex()?
HepMC::barcode(
p->production_vertex()):0;
 
  214         HepMC::FourVector prodvtx=
p->production_vertex()?
p->production_vertex()->position():HepMC::FourVector(0.0,0.0,0.0,0.0);
 
  217         double p_mass = 
p->generated_mass();
 
  218         const HepPDT::ParticleData* 
ap = 
particleData(std::abs(p_pdg_id));
 
  220           ATH_MSG_DEBUG(
"PID " << std::abs(p_pdg_id) << 
" is not in particle data table");
 
  222           const double p_charge = 
ap->charge() * (p_pdg_id < 0 ? -1 : 1); 
 
  226             const size_t plusidx = sname.rfind(
"+");
 
  227             if (plusidx != std::string::npos) {
 
  228               sname.replace(plusidx, 1, 
"-");
 
  234         if      (p_pdg_id == 21) sname=
"g";
 
  235         else if (p_pdg_id == 1)  sname=
"d";
 
  236         else if (p_pdg_id == -1) sname=
"d~";
 
  237         else if (p_pdg_id == 2)  sname=
"u";
 
  238         else if (p_pdg_id == -2) sname=
"u~";
 
  239         else if (p_pdg_id == 3)  sname=
"s";
 
  240         else if (p_pdg_id == -3) sname=
"s~";
 
  241         else if (p_pdg_id == 4)  sname=
"c";
 
  242         else if (p_pdg_id == -4) sname=
"c~";
 
  243         else if (p_pdg_id == 5)  sname=
"b";
 
  244         else if (p_pdg_id == -5) sname=
"b~";
 
  245         else if (p_pdg_id == 6)  sname=
"t";
 
  246         else if (p_pdg_id == -6) sname=
"t~";
 
  248         else if (p_pdg_id == 91) sname=
"cluster";
 
  249         else if (p_pdg_id == 92) sname=
"string";
 
  250         else if (p_pdg_id == 9922212) sname=
"remn";
 
  251         else if (p_pdg_id == 2101) sname=
"ud";
 
  252         else if (p_pdg_id == 2203) sname=
"uu";
 
  256         if (p_mass == 0 && (p_stat == 2 || (p_stat != 1 && p_pdg_id != 22))) {
 
  260         const char* p_name = sname.c_str() ;
 
  261         char particle_entries[120];
 
  262         sprintf(particle_entries, 
"  %9i %8i %-15s %4i %8i %8i   (%+9.3g,%+9.3g,%+9.3g,%+9.3g,%9.3g)",
 
  263                 p_bcode, p_pdg_id, p_name, p_stat, p_prodvtx, p_endvtx, 
mom.px(), 
mom.py(),
mom.pz(), 
mom.e(), p_mass);
 
  264         std::cout << particle_entries << 
"\n";
 
  266           sprintf(particle_entries,
" %60s (%+9.3g,%+9.3g,%+9.3g,%+9.3g)",
" ",prodvtx.x(), prodvtx.y(),prodvtx.z(), prodvtx.t());
 
  267           std::cout << particle_entries << 
"\n";
 
  275   return StatusCode::SUCCESS;