Skip to content
Snippets Groups Projects

Update HepMcParticleLink to handle creation with GenParticle::id() as well as barcodes

Merged John Derek Chapman requested to merge jchapman/athena:HMPL_Barcode2_main into main
1 file
+ 7
7
Compare changes
  • Side-by-side
  • Inline
@@ -315,7 +315,7 @@ FPGATrackSimSGToRawHitsTool::readPixelSimulation(HitIndexMap& hitIndexMap, unsig
tmpSGhit.setEventIndex(index);
else
tmpSGhit.setEventIndex(std::numeric_limits<long>::max());
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max()));
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
tmpSGhit.setParentageMask(parentMask.to_ulong());
@@ -389,7 +389,7 @@ FPGATrackSimSGToRawHitsTool::readStripSimulation(HitIndexMap& hitIndexMap, unsig
else
tmpSGhit.setEventIndex(std::numeric_limits<long>::max());
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max()));
tmpSGhit.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
tmpSGhit.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
tmpSGhit.setParentageMask(parentMask.to_ulong());
tmpSGhit.setX(0.5 * (endsOfStrip.first.x() + endsOfStrip.second.x()));
@@ -537,7 +537,7 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste
clusterEquiv.setEventIndex(index);
else
clusterEquiv.setEventIndex(std::numeric_limits<long>::max());
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max()));
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
clusterEquiv.setParentageMask(parentMask.to_ulong());
clusterOut.setClusterEquiv(clusterEquiv);
@@ -607,7 +607,7 @@ FPGATrackSimSGToRawHitsTool::readOfflineClusters(std::vector <FPGATrackSimCluste
clusterEquiv.setEventIndex(std::numeric_limits<long>::max());
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.barcode() : std::numeric_limits<long>::max()));
clusterEquiv.setBarcode((long)(bestParent ? bestExtcode.uid() : std::numeric_limits<long>::max())); // FIXME
clusterEquiv.setBarcodePt(static_cast<unsigned long>(std::ceil(bestParent ? bestParent->momentum().perp() : 0.)));
clusterEquiv.setParentageMask(parentMask.to_ulong());
clusterOut.setClusterEquiv(clusterEquiv);
@@ -730,7 +730,7 @@ FPGATrackSimSGToRawHitsTool::readTruthTracks(std::vector <FPGATrackSimTruthTrack
tmpSGTrack.setPZ(track_truth_p * track_truth_costheta);
tmpSGTrack.setPDGCode(pdgcode);
tmpSGTrack.setStatus(particle->status());
tmpSGTrack.setBarcode(extBarcode2.barcode());
tmpSGTrack.setBarcode(extBarcode2.uid()); // FIXME
index_type index2, position2;
extBarcode2.eventIndex(index2, position2);
tmpSGTrack.setEventIndex(index2);
@@ -760,13 +760,13 @@ void FPGATrackSimSGToRawHitsTool::getTruthInformation(InDetSimDataCollection::co
// reject unstable particles
if (!MC::isStable(particleLink)) { continue; }
// reject secondaries and low pT (<400 MeV) pileup
if (HepMC::is_simulation_particle(particleLink.cptr()) ||particleLink.barcode() == 0) { continue; }
if (HepMC::is_simulation_particle(particleLink.cptr()) ||particleLink.barcode() == 0) { continue; } // FIXME
// reject far forward particles
if (std::fabs(genEta) > m_maxEta) { continue; }
// "bestParent" is the highest pt particle
if (bestParent == nullptr || bestParent->momentum().perp() < genPt) {
bestParent = particleLink.cptr();
bestExtcode = HepMcParticleLink::ExtendedBarCode(particleLink.barcode(), particleLink.eventIndex());
bestExtcode = HepMcParticleLink::ExtendedBarCode(particleLink.barcode(), particleLink.eventIndex(), EBC_MAINEVCOLL, HepMcParticleLink::IS_EVENTNUM, HepMcParticleLink::IS_BARCODE); // FIXME barcode-based-syntax
}
#ifdef HEPMC3
parentMask |= FPGATrackSimInputUtils::construct_truth_bitmap(std::shared_ptr<const HepMC3::GenParticle>(particleLink.cptr()));
Loading