53 {
54
57
58
59
61
62
64
66 SG::ReadHandle<xAOD::EventInfo> evtInfo(
m_evtInfoKey, ctx);
67 evtnum = evtInfo->eventNumber();
68 }
69
70
72 return StatusCode::SUCCESS;
73 }
77 return StatusCode::SUCCESS;
78 }
79
80
82
83
86 HepMC::Print::line(std::cout, *evt);
87 }
88
92
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";
99 if (
evt->heavy_ion()) {
100 std::cout << " HeavyIon: jatt=" << evt->heavy_ion()->Ncoll_hard
101 << " np=" << evt->heavy_ion()->Npart_proj
102 << " nt=" << evt->heavy_ion()->Npart_targ
103 << " ncoll=" << evt->heavy_ion()->Ncoll
104 << " specn=" << evt->heavy_ion()->spectator_neutrons
105 << " specp=" << evt->heavy_ion()->spectator_protons
106 << " n01=" << evt->heavy_ion()->N_Nwounded_collisions
107 << " n10=" << evt->heavy_ion()->Nwounded_N_collisions
108 << " n11=" << evt->heavy_ion()->Nwounded_Nwounded_collisions
109 << " impact=" << evt->heavy_ion()->impact_parameter
110 << " evplane=" << evt->heavy_ion()->event_plane_angle
111 << " ecc=" << evt->heavy_ion()->eccentricity
112 << " sigmaNNinel=" << evt->heavy_ion()->sigma_inel_NN
113 << std::endl;
114 }
115 else {
116 std::cout << "HeavyIon: EMPTY"
117 << std::endl;
118 }
119
120
121
122 std::cout <<
" Weights(" <<
evt->weights().size() <<
")=";
123 for (
auto wgt =
evt->weights().begin();
124 wgt !=
evt->weights().end(); wgt++ ) { std::cout << *wgt <<
" "; }
125 std::cout << "\n";
129
130 if (
evt->pdf_info()) {
131 std::cout << "PdfInfo: id1=" << evt->pdf_info()->parton_id[0]
132 << " id2=" << evt->pdf_info()->parton_id[1]
133 << " x1=" << evt->pdf_info()->x[0]
134 << " x2=" << evt->pdf_info()->x[1]
135 << " q=" << evt->pdf_info()->scale
136 << " xpdf1=" << evt->pdf_info()->pdf_id[0]
137 << " xpdf2=" << evt->pdf_info()->pdf_id[1]
138 << std::endl;
139 }
140 else {
141 std::cout << "PdfInfo: EMPTY"
142 << std::endl;
143 }
144
145
146 char particle_legend[120];
147 sprintf( particle_legend," %9s %8s %-15s %4s %8s %8s (%9s,%9s,%9s,%9s,%9s)",
148 "Barcode","PDG ID","Name","Stat","ProdVtx","DecayVtx","Px","Py","Pz","E ","m");
149 std::cout << std::endl;
150 std::cout << " GenParticle Legend\n" << particle_legend << "\n";
152 sprintf( particle_legend," %60s (%9s,%9s,%9s,%9s)"," ","Vx","Vy","Vz","Vct ");
153 std::cout << particle_legend << std::endl;
154 }
156
157
158 for (auto p: *evt) {
160 int p_pdg_id =
p->pdg_id();
162 int p_stat =
p->status();
163 int p_prodvtx =
p->production_vertex()?
HepMC::barcode(
p->production_vertex()):0;
166
167 std::string sname;
168 double p_mass =
p->generated_mass();
169 const HepPDT::ParticleData*
ap =
particleData(std::abs(p_pdg_id));
170 if (!ap) {
171 ATH_MSG_DEBUG(
"PID " << std::abs(p_pdg_id) <<
" is not in particle data table");
172 } else {
173 const double p_charge =
ap->charge() * (p_pdg_id < 0 ? -1 : 1);
174
176 if (p_charge < 0) {
177 const size_t plusidx = sname.rfind("+");
178 if (plusidx != std::string::npos) {
179 sname.replace(plusidx, 1, "-");
180 }
181 }
182 }
183
184
185 if (p_pdg_id == 21) sname="g";
186 else if (p_pdg_id == 1) sname="d";
187 else if (p_pdg_id == -1) sname="d~";
188 else if (p_pdg_id == 2) sname="u";
189 else if (p_pdg_id == -2) sname="u~";
190 else if (p_pdg_id == 3) sname="s";
191 else if (p_pdg_id == -3) sname="s~";
192 else if (p_pdg_id == 4) sname="c";
193 else if (p_pdg_id == -4) sname="c~";
194 else if (p_pdg_id == 5) sname="b";
195 else if (p_pdg_id == -5) sname="b~";
196 else if (p_pdg_id == 6) sname="t";
197 else if (p_pdg_id == -6) sname="t~";
198
199 else if (p_pdg_id == 91) sname="cluster";
200 else if (p_pdg_id == 92) sname="string";
201 else if (p_pdg_id == 9922212) sname="remn";
202 else if (p_pdg_id == 2101) sname="ud";
203 else if (p_pdg_id == 2203) sname="uu";
204
205
207 if (p_mass == 0 && (p_stat == 2 || (p_stat != 1 && p_pdg_id != 22))) {
209 }
210
211 const char* p_name = sname.c_str() ;
212 char particle_entries[120];
213 sprintf(particle_entries, " %9i %8i %-15s %4i %8i %8i (%+9.3g,%+9.3g,%+9.3g,%+9.3g,%9.3g)",
214 p_bcode, p_pdg_id, p_name, p_stat, p_prodvtx, p_endvtx,
mom.px(),
mom.py(),
mom.pz(),
mom.e(), p_mass);
215 std::cout << particle_entries << "\n";
217 sprintf(particle_entries," %60s (%+9.3g,%+9.3g,%+9.3g,%+9.3g)"," ",prodvtx.x(), prodvtx.y(),prodvtx.z(), prodvtx.t());
218 std::cout << particle_entries << "\n";
219 }
220 }
221
222 }
223
224 }
225
226 return StatusCode::SUCCESS;
227}
void drawLine(std::ostream &os)
const HepPDT::ParticleData * particleData(int pid) const
Access an element in the particle data table.
SG::ReadHandleKey< xAOD::EventInfo > m_evtInfoKey
for(size_t i=0;i< m_blockFillers.size();i++)
Fill one block.
const std::string event_scale
const std::string alphaQED
const std::string alphaQCD
int signal_process_id(const GenEvent &evt)
HepMC3::FourVector FourVector
ConstGenVertexPtr signal_process_vertex(const GenEvent *e)
HepMC3::GenEvent GenEvent