31#include "G4BiasingProcessInterface.hh"
34#include "G4ParticleDefinition.hh"
35#include "G4ParticleTable.hh"
36#include "G4VProcess.hh"
46 fParticleToBias = G4ParticleTable::GetParticleTable()->FindParticle(particleName);
50 G4ExceptionDescription ed;
51 ed <<
"Particle `" << particleName <<
"' not found !" << G4endl;
52 G4Exception(
"GB05BOptrSplitAndKillByCrossSection(...)",
85 G4BiasingProcessInterface::GetSharedData( processManager );
90 G4bool processFound(
false);
92 j < (sharedData->GetPhysicsBiasingProcessInterfaces()).size();
96 (sharedData->GetPhysicsBiasingProcessInterfaces())[j];
98 wrapperProcess->GetWrappedProcess()->GetProcessName() )
100 fProcesses.push_back( wrapperProcess->GetWrappedProcess() );
107 G4String particleName =
"(unknown)";
112 G4ExceptionDescription ed;
114 <<
"' not found for particle `" << particleName <<
"'"
116 G4Exception(
"GB05BOptrSplitAndKillByCrossSection::StartRun(...)",
128 G4ExceptionDescription ed;
129 ed <<
"No processes to counterbalance for defined or found ! "
130 <<
"Biasing will do nothing."
132 G4Exception(
"GB05BOptrSplitAndKillByCrossSection::StartRun(...)",
160 G4double totalCrossSection(0.0);
161 for (
size_t i = 0 ; i <
fProcesses.size() ; i++ )
163 G4double interactionLength =
fProcesses[i]->GetCurrentInteractionLength();
164 if ( interactionLength < DBL_MAX/10. )
165 totalCrossSection += 1./interactionLength;
167 if ( totalCrossSection < DBL_MIN )
return 0;
169 G4double totalInteractionLength = 1./totalCrossSection;
Definition of the GB05BOptnSplitAndKillByCrossSection class.
Definition of the GB05BOptrSplitAndKillByCrossSection class.
void SetInteractionLength(G4double interactionLength)
GB05BOptnSplitAndKillByCrossSection * fSplitAndKillByCrossSection
std::vector< G4String > fProcessesToEquipoise
const G4ParticleDefinition * fParticleToBias
virtual G4VBiasingOperation * ProposeNonPhysicsBiasingOperation(const G4Track *, const G4BiasingProcessInterface *) final
std::vector< const G4VProcess * > fProcesses
virtual ~GB05BOptrSplitAndKillByCrossSection()
GB05BOptrSplitAndKillByCrossSection(G4String particleToBias, G4String name="SplitAndKillByXS")
void AddProcessToEquipoise(G4String processName)