LDMX Software
PhotoNuclearModel.cxx
1#include "SimCore/PhotoNuclearModels/PhotoNuclearModel.h"
2
3namespace simcore {
4void PhotoNuclearModel::removeExistingModel(G4ProcessManager* processManager) {
5 const auto processes{processManager->GetProcessList()};
6 for (int i{0}; i < processes->size(); ++i) {
7 const auto process{(*processes)[i]};
8 const auto process_name{process->GetProcessName()};
9 if (process_name == "photonNuclear") {
10 processManager->RemoveProcess(i);
11 }
12 }
13}
14
16 G4HadronInelasticProcess* process) const {
17 auto cross_section_registry{G4CrossSectionDataSetRegistry::Instance()};
18 auto cross_section{
19 cross_section_registry->GetCrossSectionDataSet("PhotoNuclearXS")};
20 if (!cross_section) {
21 cross_section = new G4PhotoNuclearCrossSection{};
22 }
23 process->AddDataSet(cross_section);
24}
25
27
28} // namespace simcore
#define DEFINE_FACTORY(classtype)
This should go into an implementation file for your prototype class.
Definition Factory.h:411
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.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...