LDMX Software
simcore::GenieNuclearPhysics Class Reference

Physics constructor that replaces the built-in Geant4 electronNuclear process with the GENIE-based GenieElectroNuclearProcess. More...

#include <GenieNuclearPhysics.h>

Public Member Functions

 GenieNuclearPhysics (const framework::config::Parameters &params)
 Constructor.
 
void ConstructParticle () override
 No new particles to construct.
 
void ConstructProcess () override
 Remove the built-in electronNuclear process and register the GENIE-based replacement.
 

Static Public Attributes

static const std::string NAME = "GenieNuclear"
 Name of this physics constructor.
 

Private Attributes

framework::config::Parameters params_
 Stored configuration to forward to the process.
 
bool enable_
 Is the GENIE process enabled?
 

Detailed Description

Physics constructor that replaces the built-in Geant4 electronNuclear process with the GENIE-based GenieElectroNuclearProcess.

Follows the same pattern as APrimePhysics. Registered with the physics list in RunManager::setupPhysics().

Definition at line 24 of file GenieNuclearPhysics.h.

Constructor & Destructor Documentation

◆ GenieNuclearPhysics()

simcore::GenieNuclearPhysics::GenieNuclearPhysics ( const framework::config::Parameters & params)

Constructor.

Parameters
paramsConfiguration parameters forwarded to the process

Definition at line 17 of file GenieNuclearPhysics.cxx.

19 : G4VPhysicsConstructor(NAME), params_{params} {
20 enable_ = params_.get<bool>("enable", false);
21}
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78
framework::config::Parameters params_
Stored configuration to forward to the process.
static const std::string NAME
Name of this physics constructor.
bool enable_
Is the GENIE process enabled?

References enable_, framework::config::Parameters::get(), and params_.

Member Function Documentation

◆ ConstructParticle()

void simcore::GenieNuclearPhysics::ConstructParticle ( )
override

No new particles to construct.

Definition at line 23 of file GenieNuclearPhysics.cxx.

23 {
24 // No new particles — we only replace an existing process
25}

◆ ConstructProcess()

void simcore::GenieNuclearPhysics::ConstructProcess ( )
override

Remove the built-in electronNuclear process and register the GENIE-based replacement.

Definition at line 27 of file GenieNuclearPhysics.cxx.

27 {
28 if (!enable_) {
29 ldmx_log(info) << "GENIE electronuclear process is not enabled";
30 return;
31 }
32
33 ldmx_log(info) << "Setting up GENIE electronuclear process...";
34
35 G4ProcessManager* process_manager =
36 G4Electron::Definition()->GetProcessManager();
37 if (!process_manager) {
38 EXCEPTION_RAISE("GenieNuclearPhysics",
39 "Unable to access the electron process manager!");
40 }
41
42 // Find and remove the built-in electronNuclear process
43 G4VProcess* existing =
44 G4ProcessTable::GetProcessTable()->FindProcess("electronNuclear", "e-");
45 if (existing) {
46 ldmx_log(info) << "Removing built-in electronNuclear process";
47 process_manager->RemoveProcess(existing);
48 } else {
49 ldmx_log(info)
50 << "No built-in electronNuclear process found — adding GENIE process";
51 }
52
53 // Create and register the GENIE-based process
54 auto* genie_process = new GenieElectroNuclearProcess(params_);
55 process_manager->AddDiscreteProcess(genie_process);
56
57 // Set ordering to first so biasing framework always sees it
58 process_manager->SetProcessOrderingToFirst(genie_process,
59 G4ProcessVectorDoItIndex::idxAll);
60
61 ldmx_log(info) << "GENIE electronuclear process registered successfully";
62}

References enable_, and params_.

Member Data Documentation

◆ enable_

bool simcore::GenieNuclearPhysics::enable_
private

Is the GENIE process enabled?

Definition at line 51 of file GenieNuclearPhysics.h.

Referenced by ConstructProcess(), and GenieNuclearPhysics().

◆ NAME

const std::string simcore::GenieNuclearPhysics::NAME = "GenieNuclear"
static

Name of this physics constructor.

Definition at line 27 of file GenieNuclearPhysics.h.

◆ params_

framework::config::Parameters simcore::GenieNuclearPhysics::params_
private

Stored configuration to forward to the process.

Definition at line 48 of file GenieNuclearPhysics.h.

Referenced by ConstructProcess(), and GenieNuclearPhysics().


The documentation for this class was generated from the following files: