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