Skip to content
Snippets Groups Projects

Sweeping !58195 from master to 22.0. Ensure barcodes are set properly in McEventCollectionFilter in HepMC3-based builds

Merged Sweeping !58195 from master to 22.0. Ensure barcodes are set properly in McEventCollectionFilter in HepMC3-based builds
Merged Atlas Nightlybuild requested to merge cherry-pick-08d9dd5dbcf-22.0 into 22.0
2 files
+ 14
6
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -24,7 +24,6 @@
//
#include "CLHEP/Geometry/Point3D.h"
#include "GeoPrimitives/GeoPrimitives.h"
#include <climits>
McEventCollectionFilter::McEventCollectionFilter(const std::string &name, ISvcLocator *pSvcLocator)
@@ -75,8 +74,9 @@ StatusCode McEventCollectionFilter::execute(const EventContext &ctx) const
HepMC::GenParticlePtr genPart=HepMC::newGenParticlePtr();
genPart->set_pdg_id(m_pileUpParticlePDGID); //Geantino
genPart->set_status(1); //!< set decay status
HepMC::suggest_barcode(genPart, std::numeric_limits<int32_t>::max() );
#ifndef HEPMC3
HepMC::suggest_barcode(genPart, crazyParticleBarcode );
#endif
HepMC::GenVertexPtr genVertex = HepMC::newGenVertexPtr();
genVertex->add_particle_out(genPart);
@@ -138,18 +138,24 @@ StatusCode McEventCollectionFilter::execute(const EventContext &ctx) const
HepMC::GenParticlePtr newParticle = HepMC::newGenParticlePtr(particle->momentum(),
particle->pdg_id(),
particle->status());
#ifndef HEPMC3
HepMC::suggest_barcode(newParticle, barcode);
#endif
const HepMC::FourVector &position = vx->position();
HepMC::GenVertexPtr newVertex = HepMC::newGenVertexPtr(position);
newVertex->add_particle_out(newParticle);
evt->add_vertex(newVertex);
#ifdef HEPMC3
HepMC::suggest_barcode(newParticle, barcode);
#endif
}
}
//.....add new vertex with geantino
evt->add_vertex(genVertex);
#ifdef HEPMC3
HepMC::suggest_barcode(genPart, crazyParticleBarcode );
#endif
int referenceBarcode = HepMC::barcode(genPart);
ATH_MSG_DEBUG("Reference barcode: " << referenceBarcode);
Loading