LDMX Software
ElectroNuclear.cxx
1
2#include "SimCore/BiasOperators/ElectroNuclear.h"
3
4namespace simcore {
5namespace biasoperators {
6
9 : XsecBiasingOperator(name, p) {
10 volume_ = p.getParameter<std::string>("volume");
11 factor_ = p.getParameter<double>("factor");
12 threshold_ = p.getParameter<double>("threshold");
13}
14
16 const G4Track* track, const G4BiasingProcessInterface* callingProcess) {
17 if (track->GetKineticEnergy() < threshold_) {
18 return nullptr;
19 }
20
21 std::string currentProcess =
22 callingProcess->GetWrappedProcess()->GetProcessName();
23 if (currentProcess.compare(this->getProcessToBias()) == 0) {
24 G4double interactionLength =
25 callingProcess->GetWrappedProcess()->GetCurrentInteractionLength();
26 double enXsecUnbiased = 1. / interactionLength;
27
28 double enXsecBiased = enXsecUnbiased * factor_;
29
30 return BiasedXsec(enXsecBiased);
31 }
32 return nullptr;
33}
34} // namespace biasoperators
35} // namespace simcore
36
37DECLARE_XSECBIASINGOPERATOR(simcore::biasoperators::ElectroNuclear)
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
Our specialization of the biasing operator used with Geant4.
G4VBiasingOperation * BiasedXsec(double biased_xsec)
Helper method for passing a biased interaction length to the Geant4 biasing framework.
Bias the Electron-Nuclear process.
std::string volume_
The volume to bias in.
double threshold_
Minimum kinetic energy [MeV] to allow a track to be biased.
G4VBiasingOperation * ProposeOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess) override
double factor_
The biasing factor.
ElectroNuclear(std::string name, const framework::config::Parameters &p)
Constructor.