LDMX Software
BertiniWithHistoryModel.cxx
Go to the documentation of this file.
1
6
7#include <G4Gamma.hh>
8#include <G4HadronInelasticProcess.hh>
9#include <G4ProcessManager.hh>
10
12
13namespace simcore {
14namespace bertini {
15
16BertiniWithHistoryModel::BertiniWithHistoryModel(
17 const std::string& name, const framework::config::Parameters& parameters)
18 : PhotoNuclearModel{name, parameters} {
19 max_energy_ = parameters.getParameter<double>("max_energy", 15000.0);
20 energy_threshold_ =
21 parameters.getParameter<double>("energy_threshold", 5000.0);
22}
23
24void BertiniWithHistoryModel::constructGammaProcess(
25 G4ProcessManager* processManager) {
26 ldmx_log(info) << "BertiniWithHistoryModel::constructGammaProcess";
27 ldmx_log(info) << " Max energy: " << max_energy_ << " MeV";
28 ldmx_log(info) << " Energy threshold: " << energy_threshold_ << " MeV";
29
30 auto photo_nuclear_process =
31 new G4HadronInelasticProcess("photonNuclear", G4Gamma::Definition());
32
33 auto model = new LDMXCascadeInterface("LDMXBertiniWithHistory");
34 model->setEnergyThreshold(energy_threshold_);
35 model->SetMaxEnergy(max_energy_ * CLHEP::MeV);
36
37 ldmx_log(info) << " Created LDMXCascadeInterface model";
38
39 addPNCrossSectionData(photo_nuclear_process);
40 photo_nuclear_process->RegisterMe(model);
41 processManager->AddDiscreteProcess(photo_nuclear_process);
42
43 ldmx_log(info) << " Photonuclear process added to gamma";
44}
45
46} // namespace bertini
47} // namespace simcore
48
49// Register the model with the factory
50DECLARE_PHOTONUCLEAR_MODEL(simcore::bertini::BertiniWithHistoryModel);
Photonuclear model with cascade history capture.
Bertini cascade interface with history capture.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
PhotoNuclear model that records Bertini cascade history.
G4CascadeInterface that captures cascade history via preprocessor hack.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...