LDMX Software
PhotoNuclearModel.h
1#ifndef SIMCORE_PHOTONUCLEAR_MODEL_H
2#define SIMCORE_PHOTONUCLEAR_MODEL_H
3#include <G4CrossSectionDataSetRegistry.hh>
4#include <G4HadronInelasticProcess.hh>
5#include <G4HadronicInteraction.hh>
6#include <G4PhotoNuclearCrossSection.hh>
7#include <G4ProcessManager.hh>
8#include <string>
9#include <utility>
10
11#include "Framework/Configure/Parameters.h"
12#include "SimCore/Factory.h"
13/*
14** Dynamically loadable photonuclear models either from SimCore or external
15** libraries implementing this interface. For example implementations, see the
16** BertiniNothingHard model in SimCore.
17**
18** Allows for replacing the default Bertini model from Geant4 with any other
19** G4HadronicInteraction process. The library is used from within the
20** GammaPhysics module in SimCore which ensures that the removeExistingModel and
21** ConstructModel functions are called in the right order and that the
22** photonNuclear process is located in the right part of the G4Gamma process
23** list.
24*/
25namespace simcore {
26
28 public:
36 PhotoNuclearModel(const std::string& name,
37 const framework::config::Parameters& parameters){};
38 virtual ~PhotoNuclearModel() = default;
39
47 virtual void ConstructGammaProcess(G4ProcessManager* processManager) = 0;
48
52 using Factory =
54 const std::string&,
56
66 virtual void removeExistingModel(G4ProcessManager* processManager);
67
80 virtual void addPNCrossSectionData(G4HadronInelasticProcess* process) const;
81};
82} // namespace simcore
83
94#define DECLARE_PHOTONUCLEAR_MODEL(CLASS) \
95 namespace { \
96 auto v = ::simcore::PhotoNuclearModel::Factory::get().declare<CLASS>(); \
97 }
98#endif /* SIMCORE_PHOTONUCLEAR_MODEL_H */
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Factory to dynamically create objects derived from a specific prototype class.
Definition Factory.h:197
virtual void removeExistingModel(G4ProcessManager *processManager)
Removes any existing photonNuclear process from the process manager of the G4Gamma class.
virtual void addPNCrossSectionData(G4HadronInelasticProcess *process) const
Default implementation for adding XS data for the process.
PhotoNuclearModel(const std::string &name, const framework::config::Parameters &parameters)
Base class does not take any parameters or do anything in particular, but any derived class may.
virtual void ConstructGammaProcess(G4ProcessManager *processManager)=0
The primary part of the model interface, responsible for adding the desired G4HadronicInteraction to ...