LDMX Software
K0LongInelastic.cxx
1
2#include "SimCore/BiasOperators/K0LongInelastic.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
27 double k0LongInXsecUnbiased = 1. / interactionLength;
28
29 double k0LongInXsecBiased = k0LongInXsecUnbiased * factor_;
30
31 return BiasedXsec(k0LongInXsecBiased);
32 }
33 return nullptr;
34}
35
36} // namespace biasoperators
37} // namespace simcore
38
39DECLARE_XSECBIASINGOPERATOR(simcore::biasoperators::K0LongInelastic)
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 k0 long inelastic collisions.
K0LongInelastic(std::string name, const framework::config::Parameters &p)
Constructor.
std::string volume_
The volume to bias in.
G4VBiasingOperation * ProposeOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess) override
double threshold_
Minimum kinetic energy [MeV] to allow a track to be biased.