153 LOG(
debug) <<
"--- Process cross-section information";
156 mCrossSec = std::make_shared<HepMC3::GenCrossSection>();
160 mCrossSec->set_cross_section(0.f, 0.f, 0, 0);
162 if (xsections.size() <= 0) {
164 LOG(warning) <<
"??? No input cross-section";
168 XSection xsection = xsections.iteratorAt(0);
169 mCrossSec->set_cross_section(xsection.xsectGen(),
172 xsection.attempted());
177 LOG(
debug) <<
"--- Process PDF information";
180 mPdf = std::make_shared<HepMC3::GenPdfInfo>();
184 mPdf->set(0, 0, 0.f, 0.f, 0.f, 0.f, 0.f, 0, 0);
186 if (pdfs.size() <= 0) {
188 LOG(warning) <<
"??? No input pdf-info, skipping";
192 PdfInfo pdf = pdfs.iteratorAt(0);
207 LOG(
debug) <<
"--- Process input heavy-ion header";
210 mIon = std::make_shared<HepMC3::GenHeavyIon>();
214 mIon->impact_parameter = header.impactParameter();
215 mIon->event_plane_angle = 0.f;
216 mIon->Ncoll_hard = 0;
217 mIon->Npart_proj = 0;
218 mIon->Npart_targ = 0;
219 mIon->Nspec_proj_n = 0;
220 mIon->Nspec_proj_p = 0;
221 mIon->Nspec_targ_n = 0;
222 mIon->Nspec_targ_p = 0;
224 mIon->N_Nwounded_collisions = 0;
225 mIon->Nwounded_N_collisions = 0;
226 mIon->Nwounded_Nwounded_collisions = 0;
227 mIon->sigma_inel_NN = 0.f;
228 mIon->centrality = 0.f;
229#ifndef HEPMC3_NO_DEPRECATED
231 mIon->eccentricity = 0.f;
234 mIon->eccentricities[1] = 0.f;
237 if (heavyions.size() <= 0) {
239 LOG(warning) <<
"??? No input heavy-ion header, skipping";
243 HeavyIon heavyion = heavyions.iteratorAt(0);
249 if (heavyion.npartProj() < heavyion.npartTarg() and
250 heavyion.npartTarg() > 0) {
251 r = heavyion.npartProj() / heavyion.npartTarg();
252 }
else if (heavyion.npartTarg() < heavyion.npartProj() and
253 heavyion.npartProj() > 0) {
254 r = heavyion.npartTarg() / heavyion.npartProj();
260 mIon->impact_parameter = heavyion.impactParameter();
261 mIon->event_plane_angle = heavyion.eventPlaneAngle();
262 mIon->Ncoll_hard = heavyion.ncollHard();
263 mIon->Npart_proj = heavyion.npartProj();
264 mIon->Npart_targ = heavyion.npartTarg();
265 mIon->Nspec_proj_n = heavyion.spectatorNeutrons() * (1 -
r);
266 mIon->Nspec_proj_p = heavyion.spectatorProtons() * (1 -
r);
267 mIon->Nspec_targ_n = heavyion.spectatorNeutrons() *
r;
268 mIon->Nspec_targ_p = heavyion.spectatorProtons() *
r;
269 mIon->Ncoll = heavyion.ncoll();
270 mIon->N_Nwounded_collisions = heavyion.nNwoundedCollisions();
271 mIon->Nwounded_N_collisions = heavyion.nwoundedNCollisions();
272 mIon->Nwounded_Nwounded_collisions = heavyion.nwoundedNwoundedCollisions();
273 mIon->sigma_inel_NN = heavyion.sigmaInelNN();
274 mIon->centrality = heavyion.centrality();
275#ifndef HEPMC3_NO_DEPRECATED
276 mIon->eccentricity = heavyion.eccentricity();
278 mIon->eccentricities[1] = heavyion.eccentricity();
325 int motherStatus = 0;
339 if (track.has_mothers()) {
340 for (
auto mtrack : track.mothers_as<
Tracks>()) {
348 if (motherStatus != 0) {
349 mother->set_status(motherStatus);
352 mothers.push_back(mother);
355 vout = mother->end_vertex();
364 particle->status() != 4 and
365 mothers.size() > 0) {
373 for (
auto mother : mothers) {
374 if (not mother->end_vertex()) {
375 vout->add_particle_in(mother);
382 vout->add_particle_out(particle);
386 if (particle->status() == 4) {
387 mBeams.push_back(particle);
391 else if (mothers.size() <= 0) {
402 Int_t pdg = track.pdgCode();
403 int hepMCstatus = track.getHepMCStatusCode();
404 int egStatus = track.getGenStatusCode();
405 int transport = track.getProcess();
406 bool fromEG = track.producedByGenerator();
411 if (not force and
mOnlyGen and !fromEG) {
428 int state = hepMCstatus < 0 ? 200 + transport : hepMCstatus;
454 LOG(warning) <<
"No particle at " << track.globalIndex() <<
" in map";
458 auto endVtx = particle->end_vertex();
469 int svId = particle->id();
475 if (track.has_daughters()) {
476 for (
auto dtrack : track.daughters_as<
Tracks>()) {
486 LOG(warning) <<
"Daughter " << dtrack.globalIndex()
487 <<
" of " << track.globalIndex()
488 <<
" not found in map!";
496 auto prodVtx = daughter->production_vertex();
498 headLess.push_back(daughter);
512 if (endVtx and endVtx->id() != prodVtx->id()) {
520 if (candidate and prodVtx->id() != candidate->id()) {
521 LOG(warning) <<
"Production vertex of daughter " << daughter->id()
522 <<
" of " << particle->id()
523 <<
" is not the same as previously found from "
528 svId = daughter->id();
535 if (not candidate and
536 (particle->status() == 4 or
537 particle->status() == 2)) {
539 LOG(warning) <<
"Particle " << track.globalIndex()
540 <<
" (" << particle->id() <<
")"
541 <<
" w/status " << particle->status()
542 <<
" does not have an end-vertex, "
543 <<
"nor was any found from its daughters";
549 endVtx->add_particle_in(particle);
554 if (endVtx and headLess.size() > 0) {
555 for (
auto daughter : headLess) {
556 endVtx->add_particle_out(daughter);