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