LDMX Software
FCPPhysics.cxx
2
3#include "G4Gamma.hh"
4#include "G4ProcessManager.hh"
5
6namespace simcore {
7
8const std::string FCPPhysics::NAME = "FCPPhysics";
9
10FCPPhysics::FCPPhysics(const G4String& name,
11 const framework::config::Parameters& parameters)
12 : G4VPhysicsConstructor(name) {
13 enable_ = parameters.get<bool>("enable", false);
14 fcp_mass_ = parameters.get<double>("fcp_mass", 0.) * MeV;
15 fcp_charge_ = parameters.get<double>("fcp_charge", 0.1);
16 fcp_pdg_id_ = parameters.get<int>("fcp_pdg_id", 17);
17
18 ldmx_log(info) << "FCPPhysics configuration:" << " Enabled: "
19 << (enable_ ? "YES" : "NO")
20 << ", FCP mass: " << fcp_mass_ / MeV << " MeV"
21 << ", FCP charge: " << fcp_charge_ << " e"
22 << ", FCP PDG ID: " << fcp_pdg_id_;
23}
24
25void FCPPhysics::ConstructParticle() {
26 if (!enable_) return;
27
28 ldmx_log(info) << "Initializing FCP particles with mass " << fcp_mass_ / MeV
29 << " MeV, charge " << fcp_charge_ << " e, PDG ID "
30 << fcp_pdg_id_;
31 G4FractionallyCharged::Initialize(fcp_mass_, fcp_pdg_id_, fcp_charge_);
32}
33
34void FCPPhysics::ConstructProcess() {
35 if (!enable_) return;
36
37 ldmx_log(debug) << "Setting up gamma -> fcp+ fcp- conversion process...";
38
39 G4ProcessManager* gamma_proc_man = G4Gamma::Gamma()->GetProcessManager();
40 if (gamma_proc_man == nullptr) {
41 ldmx_log(error) << "FATAL: Unable to access process manager for gamma!";
42 EXCEPTION_RAISE("FCPPhysics",
43 "Was unable to access the process manager for gamma, "
44 "something is very wrong!");
45 }
46
47 gamma_fcp_process_ = new GammaConversionToFCPs();
48 gamma_proc_man->AddDiscreteProcess(gamma_fcp_process_);
49 ldmx_log(info)
50 << "gamma -> fcp+ fcp- conversion process registered successfully!";
51}
52
53} // namespace simcore
Physics constructor for fractionally charged particle (FCP) processes.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:75
Discrete process for gamma -> fcp+ fcp- conversion in a nuclear field.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...