7#ifndef SIMCORE_GENIEELECTRONUCLEARPROCESS_H
8#define SIMCORE_GENIEELECTRONUCLEARPROCESS_H
16#include "Framework/Configure/Parameters.h"
17#include "Framework/Logger.h"
18#include "G4VDiscreteProcess.hh"
19#include "GENIE/Framework/EventGen/GEVGDriver.h"
20#include "GENIE/Framework/EventGen/HepMC3Converter.h"
61 G4bool
IsApplicable(
const G4ParticleDefinition& p)
override;
71 const G4Step& step)
override;
84 G4ForceCondition* condition)
override;
175 enableLogging(
"GenieElectroNuclearProcess")
Class encapsulating parameters for configuring a processor.
Geant4 discrete process that fires GENIE electronuclear interactions.
void initializeGENIE()
Initialize the GENIE framework (tune, message thresholds, splines)
G4bool IsApplicable(const G4ParticleDefinition &p) override
bool only_one_per_event_
Only allow one EN interaction per event (then deactivate)
bool genie_initialized_
Flag to lazily sync GENIE random seed on first event.
static const std::string PROCESS_NAME
Process name — matches the built-in so the bias operator works unchanged.
void setupDrivers()
Set up GEVGDrivers for each target isotope (manual mode)
std::vector< int > targets_
GENIE target codes (10LZZZAAAI format)
std::set< int > discovered_z_
Z values already checked for isotope discovery.
std::vector< std::unique_ptr< genie::GEVGDriver > > evg_drivers_
One GENIE event generator driver per target isotope.
void loadAvailableTargets()
Parse the spline file for the set of target nuclei that have cross-section splines available.
std::string tune_
GENIE tune name.
G4double GetMeanFreePath(const G4Track &track, G4double prevStepSize, G4ForceCondition *condition) override
Calculate the mean free path for the electronuclear process.
std::vector< double > abundances_
Relative abundances for each target.
std::string discover_volume_
Name of the volume to auto-discover targets from (e.g.
void setOnlyOnePerEvent(bool val)
Set whether to allow only one interaction per event.
void discoverFromVolume()
One-shot auto-discovery of target isotopes from the configured volume.
bool splineAvailable(int target_code) const
std::vector< double > partial_sum_sigma_
Partial cross-section sums per element, used to select the target isotope in PostStepDoIt via weighte...
~GenieElectroNuclearProcess() override
Destructor.
bool auto_discover_
Whether targets are auto-discovered from the Geant4 geometry.
GenieElectroNuclearProcess(const framework::config::Parameters ¶ms)
Constructor.
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step) override
Called by Geant4 when this process fires.
std::map< int, std::vector< std::pair< int, double > > > z_to_targets_
Lookup map: element Z -> list of (driver_index, abundance).
std::set< int > available_targets_
Target nuclei (10LZZZAAAI codes) that have splines in the spline file.
genie::HepMC3Converter hep_mc3_converter_
Converter from GENIE EventRecord to HepMC3.
std::string message_threshold_file_
Path to GENIE message threshold configuration.
std::string spline_file_
Path to GENIE cross-section spline file.
void discoverIsotopesForElement(const G4Element *element)
Discover isotopes from a G4Element and set up GENIE drivers (auto mode)
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...