Skip to content
Snippets Groups Projects
Commit b04321cb authored by Tadej Novak's avatar Tadej Novak
Browse files

Merge branch 'MagicNumbersUpdate_main' into 'main'

MagicNumbers.h: directly use BarcodeBased versions of helper functions

See merge request atlas/athena!71341
parents 547ad661 16e42cce
No related branches found
No related tags found
No related merge requests found
......@@ -236,12 +236,12 @@ inline int maxGeneratedParticleBarcode(const HepMC::GenEvent *genEvent) {
#ifdef HEPMC3
auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
for (const auto& bp: allbarcodes->barcode_to_particle_map()) {
if (!HepMC::is_simulation_particle(bp.first)) { maxBarcode=std::max(maxBarcode,bp.first); }
if (!HepMC::BarcodeBased::is_simulation_particle(bp.first)) { maxBarcode=std::max(maxBarcode,bp.first); }
}
#else
for (auto currentGenParticle: *genEvent) {
const int barcode=HepMC::barcode(currentGenParticle);
if(barcode > maxBarcode && !HepMC::is_simulation_particle(barcode)) { maxBarcode=barcode; }
if (barcode > maxBarcode && !HepMC::BarcodeBased::is_simulation_particle(barcode)) { maxBarcode=barcode; }
}
#endif
return maxBarcode;
......@@ -252,7 +252,7 @@ inline int maxGeneratedVertexBarcode(const HepMC::GenEvent *genEvent) {
#ifdef HEPMC3
auto allbarcodes = genEvent->attribute<HepMC::GenEventBarcodes>("barcodes");
for (const auto& bp: allbarcodes->barcode_to_vertex_map()) {
if (!HepMC::is_simulation_vertex(bp.first)) { maxBarcode=std::min(maxBarcode,bp.first); }
if (!HepMC::BarcodeBased::is_simulation_vertex(bp.first)) { maxBarcode=std::min(maxBarcode,bp.first); }
}
#else
HepMC::GenEvent::vertex_const_iterator currentGenVertexIter;
......@@ -260,7 +260,7 @@ inline int maxGeneratedVertexBarcode(const HepMC::GenEvent *genEvent) {
currentGenVertexIter!= genEvent->vertices_end();
++currentGenVertexIter) {
const int barcode((*currentGenVertexIter)->barcode());
if(barcode < maxBarcode && !HepMC::is_simulation_vertex(barcode)) { maxBarcode=barcode; }
if (barcode < maxBarcode && !HepMC::BarcodeBased::is_simulation_vertex(barcode)) { maxBarcode=barcode; }
}
#endif
return maxBarcode;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment