From 714536a2190bdee7c62d90c13c4ee3ad4beacafb Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 18 Dec 2025 12:23:52 +0100 Subject: [PATCH 1/2] Use member function of parent model to kill track --- include/DDML/FastMLShower.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/DDML/FastMLShower.h b/include/DDML/FastMLShower.h index 8741c15..09c0dee 100644 --- a/include/DDML/FastMLShower.h +++ b/include/DDML/FastMLShower.h @@ -129,11 +129,9 @@ class FastMLShower : public dd4hep::sim::Geant4FastSimShowerModel { /// User callback to model the particle/energy shower - details defined in /// ML_MODEL virtual void modelShower(const G4FastTrack& track, G4FastStep& step) override { - // remove particle from further processing by G4 - step.KillPrimaryTrack(); - step.ProposePrimaryTrackPathLength(0.0); G4double energy = track.GetPrimaryTrack()->GetKineticEnergy(); - step.ProposeTotalEnergyDeposited(energy); + // remove particle from further processing by G4 + killParticle(step, energy); #if DDML_INSTRUMENT_MODEL_SHOWER podio::UserDataCollection prepareInputTime; From 03ad3eb43239600a91ce4dd525514d8826723b50 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Thu, 18 Dec 2025 12:25:32 +0100 Subject: [PATCH 2/2] Remove unused const boolean members --- include/DDML/FastMLShower.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/include/DDML/FastMLShower.h b/include/DDML/FastMLShower.h index 09c0dee..6164176 100644 --- a/include/DDML/FastMLShower.h +++ b/include/DDML/FastMLShower.h @@ -81,24 +81,18 @@ class FastMLShower : public dd4hep::sim::Geant4FastSimShowerModel { /// Geometry construction callback. Called at "Construct()" virtual void constructGeo(dd4hep::sim::Geant4DetectorConstructionContext* ctxt) override { - // if( fastsimML.has_constructGeo ) fastsimML.constructGeo( ctxt ) ; - // else this->Geant4FastSimShowerModel::constructGeo(ctxt); } /// Electromagnetic field construction callback. Called at /// "ConstructSDandField()" virtual void constructField(dd4hep::sim::Geant4DetectorConstructionContext* ctxt) override { - // if( fastsimML.has_constructField ) fastsimML.constructField( ctxt ) - // ; else this->Geant4FastSimShowerModel::constructField(ctxt); } /// Sensitive detector construction callback. Called at /// "ConstructSDandField()" virtual void constructSensitives(dd4hep::sim::Geant4DetectorConstructionContext* ctxt) override { - // if( fastsimML.has_constructSensitives ) fastsimML.constructSensitives( - // ctxt ) ; else this->Geant4FastSimShowerModel::constructSensitives(ctxt); } @@ -108,8 +102,6 @@ class FastMLShower : public dd4hep::sim::Geant4FastSimShowerModel { * 'ApplicableParticles' */ virtual bool check_applicability(const G4ParticleDefinition& particle) override { - // if( fastsimML.has_check_applicability ) return - // fastsimML.check_applicability(particle) ; else return this->Geant4FastSimShowerModel::check_applicability(particle); } @@ -118,8 +110,6 @@ class FastMLShower : public dd4hep::sim::Geant4FastSimShowerModel { * 'Etrigger' the kinetic energy is bigger than the value. */ virtual bool check_trigger(const G4FastTrack& track) override { - // if( fastsimML.has_check_trigger ) return fastsimML.check_trigger(track ) - // ; else if (this->Geant4FastSimShowerModel::check_trigger(track)) { return m_fastsimML.trigger.check_trigger(track); } @@ -226,12 +216,6 @@ struct FastMLModel { FastMLModel() : hitMaker(new HitMaker) {} - const bool has_constructGeo = false; - const bool has_constructField = false; - const bool has_constructSensitives = false; - const bool has_check_applicability = false; - const bool has_check_trigger = false; - void declareProperties(dd4hep::sim::Geant4Action* plugin) { model.declareProperties(plugin); inference.declareProperties(plugin);