2#include "SimCore/BiasOperators/DarkBrem.h"
7#include "G4RunManager.hh"
10namespace biasoperators {
20 const G4Track* track,
const G4BiasingProcessInterface* callingProcess) {
21 std::string currentProcess =
22 callingProcess->GetWrappedProcess()->GetProcessName();
23 if (currentProcess.compare(this->getProcessToBias()) == 0) {
25 if (not
bias_all_ and track->GetParentID() != 0)
return nullptr;
27 G4double interactionLength =
28 callingProcess->GetWrappedProcess()->GetCurrentInteractionLength();
30 double dbXsecUnbiased = 1. / interactionLength;
31 double dbXsecBiased = dbXsecUnbiased *
factor_;
33 if (G4RunManager::GetRunManager()->GetVerboseLevel() > 1) {
34 std::cout <<
"[ DarkBremXsecBiasingOperator ]: "
35 <<
" Unbiased DBrem xsec: " << dbXsecUnbiased
36 <<
" -> Biased xsec: " << dbXsecBiased << std::endl;
Class encapsulating parameters for configuring a processor.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
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 operator for the dark brem process.
void RecordConfig(ldmx::RunHeader &header) const override
Record the configuration of this biasing operator into the run header.
double factor_
factor we want to bias by
bool bias_all_
should we bias all electrons? (or only the primary)
DarkBrem(std::string name, const framework::config::Parameters &p)
Constructor.
std::string volume_
DEBUG FUNCTION This function is called by the biasing interface class during PostStepDoIt.
G4VBiasingOperation * ProposeOccurenceBiasingOperation(const G4Track *track, const G4BiasingProcessInterface *callingProcess) override
Calculate the biased cross section given the input process and track.