Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions include/DDML/FastMLShower.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand All @@ -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);
}
Expand All @@ -129,11 +119,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<double> prepareInputTime;
Expand Down Expand Up @@ -228,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);
Expand Down