1#include "SimCore/BiasOperators/PhotoNuclear.h"
4namespace biasoperators {
25 "PhotoNuclearBiasing",
31 const G4Track* track,
const G4BiasingProcessInterface* callingProcess) {
43 std::string current_process =
44 callingProcess->GetWrappedProcess()->GetProcessName();
47 if (current_process.compare(this->getProcessToBias()) == 0) {
48 G4double interaction_length =
49 callingProcess->GetWrappedProcess()->GetCurrentInteractionLength();
64 G4double interaction_length =
65 callingProcess->GetWrappedProcess()->GetCurrentInteractionLength();
67 double em_xsec_unbiased = 1. / interaction_length;
69 double em_xsec_biased =
72 static auto material_tungsten =
73 simcore::g4user::ptrretrieval::getMaterial(
"G4_W");
74 auto interaction_material = track->GetMaterial();
76 (interaction_material == material_tungsten)) {
77 ldmx_log(warn) <<
"EM XS = PN unbiased XS! The biasing factor ("
78 <<
factor_ <<
") is too large for particle with energy "
79 << track->GetKineticEnergy()
80 <<
" and material = " << interaction_material->GetName();
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Our specialization of the biasing operator used with Geant4.
void StartRun()
Method called at the beginning of a run.
bool processIsBiased(std::string process)
Check if the given processed is being biased.
G4VBiasingOperation * BiasedXsec(double biased_xsec)
Helper method for passing a biased interaction length to the Geant4 biasing framework.
Bias the Photon-Nuclear process.
double factor_
factor to bias PN by
bool only_children_of_primary_
Should we restrict biasing to only children of primary?
bool down_bias_conv_
Should we down-bias the gamma conversion process?
G4BOptnChangeCrossSection * em_xsec_operation_
Cross-section biasing operation for conversion process.
G4VBiasingOperation * ProposeOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess) override
void StartRun() override
Method called at the beginning of a run.
double pn_xsec_unbiased_
Unbiased photonuclear xsec.
double threshold_
minimum kinetic energy [MeV] for a track to be biased
static const std::string CONVERSION_PROCESS
Geant4 gamma conversion process name.
PhotoNuclear(std::string name, const framework::config::Parameters &p)
Constructor.
double pn_xsec_biased_
Biased photonuclear xsec.
std::string volume_
Volume we are going to bias within.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...