LDMX Software
Public Types | Public Member Functions | List of all members
simcore::PhotoNuclearModel Class Referenceabstract

Public Types

using Factory = ::simcore::Factory< PhotoNuclearModel, std::shared_ptr< PhotoNuclearModel >, const std::string &, const framework::config::Parameters & >
 The factory for PhotoNuclearModels.
 

Public Member Functions

 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 the process manager for the G4Gamma class.
 
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.
 

Detailed Description

Definition at line 27 of file PhotoNuclearModel.h.

Member Typedef Documentation

◆ Factory

The factory for PhotoNuclearModels.

Definition at line 52 of file PhotoNuclearModel.h.

Constructor & Destructor Documentation

◆ PhotoNuclearModel()

simcore::PhotoNuclearModel::PhotoNuclearModel ( const std::string &  name,
const framework::config::Parameters parameters 
)
inline

Base class does not take any parameters or do anything in particular, but any derived class may.

Parameters
[in]nameunique instance name for this model
[in]parameterspython configuration

Definition at line 36 of file PhotoNuclearModel.h.

37 {};

Member Function Documentation

◆ addPNCrossSectionData()

void simcore::PhotoNuclearModel::addPNCrossSectionData ( G4HadronInelasticProcess *  process) const
virtual

Default implementation for adding XS data for the process.

The default implementation is adapted from G4PhotoNuclearProcess.hh but can be overridden to add cross sections in another way (e.g. from FLUKA). If no cross-section is added to the process, the simulation process will halt when attempting to calculate the mean free path so there is no way of accidentally forgetting to enable the XS data.

Typically called during ConstructGammaProcess.

Definition at line 15 of file PhotonuclearModel.cxx.

16 {
17 auto crossSectionRegistry{G4CrossSectionDataSetRegistry::Instance()};
18 auto crossSection{
19 crossSectionRegistry->GetCrossSectionDataSet("PhotoNuclearXS")};
20 if (!crossSection) {
21 crossSection = new G4PhotoNuclearCrossSection{};
22 }
23 process->AddDataSet(crossSection);
24}

Referenced by simcore::BertiniAtLeastNProductsModel::ConstructGammaProcess(), simcore::BertiniNothingHardModel::ConstructGammaProcess(), and simcore::BertiniSingleNeutronModel::ConstructGammaProcess().

◆ ConstructGammaProcess()

virtual void simcore::PhotoNuclearModel::ConstructGammaProcess ( G4ProcessManager *  processManager)
pure virtual

The primary part of the model interface, responsible for adding the desired G4HadronicInteraction to the process manager for the G4Gamma class.

Parameters
[in]processManagerthe process manager for the G4Gamma class, passed in automatically by the GammaPhysics module.

Implemented in simcore::BertiniModel, simcore::BertiniAtLeastNProductsModel, simcore::BertiniNothingHardModel, simcore::BertiniSingleNeutronModel, and simcore::NoPhotoNuclearModel.

◆ removeExistingModel()

void simcore::PhotoNuclearModel::removeExistingModel ( G4ProcessManager *  processManager)
virtual

Removes any existing photonNuclear process from the process manager of the G4Gamma class.

Should in general not be overridden for most models other than the default Bertini model (which just retains the default interaction).

Parameters
[in]processManagerthe process manager for the G4Gamma class, passed in automatically by the GammaPhysics module.

Reimplemented in simcore::BertiniModel.

Definition at line 4 of file PhotonuclearModel.cxx.

4 {
5 const auto processes{processManager->GetProcessList()};
6 for (int i{0}; i < processes->size(); ++i) {
7 const auto process{(*processes)[i]};
8 const auto processName{process->GetProcessName()};
9 if (processName == "photonNuclear") {
10 processManager->RemoveProcess(i);
11 }
12 }
13}

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