10#include "G4ProcessManager.hh"
11#include "G4VProcess.hh"
12#include "SimCore/PhotoNuclearModels/PhotoNuclearModel.h"
18 : G4VPhysicsConstructor(name),
20 parameters.get<
framework::config::Parameters>(
"photonuclear_model")} {
26 G4ProcessManager* process_manager = G4Gamma::Gamma()->GetProcessManager();
27 if (process_manager ==
nullptr) {
28 EXCEPTION_RAISE(
"GammaPhysics",
29 "Was unable to access the process manager for photons, "
30 "something is very wrong!");
33 auto pn = PhotoNuclearModel::Factory::get().make(
37 EXCEPTION_RAISE(
"UnableToCreate",
38 "Unable to create a PhotoNuclearModel of type " +
41 pn.value()->removeExistingModel(process_manager);
42 pn.value()->constructGammaProcess(process_manager);
61 const auto processes{process_manager->GetProcessList()};
62 for (
int i{0}; i < processes->size(); i++) {
63 const auto process{(*processes)[i]};
64 if (process->GetProcessName() ==
"photonNuclear") {
65 process_manager->SetProcessOrderingToFirst(
66 process, G4ProcessVectorDoItIndex::idxAll);
Class used to enhanced the gamma physics list.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
GammaPhysics(const G4String &name, const framework::config::Parameters ¶meters)
Class constructor.
G4GammaConversionToMuons gamma_conv_process_
The gamma to muons process.
void ConstructProcess() final
We do two things for this call back during initialization.
void ConstructParticle() final
Construct particles.
framework::config::Parameters model_parameters_
Parameters from the configuration to pass along to the photonuclear model.
All classes in the ldmx-sw project use this namespace.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...