LDMX Software
GammaPhysics.cxx
Go to the documentation of this file.
1
9
10namespace simcore {
11
12GammaPhysics::GammaPhysics(const G4String& name,
13 const framework::config::Parameters& parameters)
14 : G4VPhysicsConstructor(name),
15 modelParameters{parameters.getParameter<framework::config::Parameters>(
16 "photonuclear_model")} {}
17
19
21 G4ProcessManager* processManager = G4Gamma::Gamma()->GetProcessManager();
22 if (processManager == nullptr) {
23 EXCEPTION_RAISE("GammaPhysics",
24 "Was unable to access the process manager for photons, "
25 "something is very wrong!");
26 }
27 // configure our PN model based on runtime parameters
29 modelParameters.getParameter<std::string>("class_name"),
30 modelParameters.getParameter<std::string>("instance_name"),
32 pn->removeExistingModel(processManager);
33 pn->ConstructGammaProcess(processManager);
52 const auto processes{processManager->GetProcessList()};
53 for (int i{0}; i < processes->size(); i++) {
54 const auto process{(*processes)[i]};
55 if (process->GetProcessName() == "photonNuclear") {
56 processManager->SetProcessOrderingToFirst(
57 process, G4ProcessVectorDoItIndex::idxAll);
58 }
59 }
60 // Add the gamma -> mumu to the physics list.
61 processManager->AddDiscreteProcess(&gammaConvProcess);
62}
63} // namespace simcore
Class used to enhanced the gamma physics list.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
static Factory & get()
get the factory instance
Definition Factory.h:217
PrototypePtr make(const std::string &full_name, PrototypeConstructorArgs... maker_args)
make a new object by name
Definition Factory.h:265
GammaPhysics(const G4String &name, const framework::config::Parameters &parameters)
Class constructor.
void ConstructProcess() final
We do two things for this call back during initialization.
G4GammaConversionToMuons gammaConvProcess
The gamma to muons process.
void ConstructParticle() final
Construct particles.
framework::config::Parameters modelParameters
Parameters from the configuration to pass along to the photonuclear model.
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45