46 fWrappedProcess ( 0 ),
47 fIsPhysicsBasedBiasing ( false ),
48 fWrappedProcessIsAtRest ( false ),
49 fWrappedProcessIsAlong ( false ),
50 fWrappedProcessIsPost ( false ),
51 fWrappedProcessInteractionLength( -1.0 ),
52 fBiasingInteractionLaw ( 0 ),
53 fPhysicalInteractionLaw ( 0 ),
54 fOccurenceBiasingParticleChange ( 0 ),
55 fIamFirstGPIL ( false ),
70 :
G4VProcess( useThisName !=
"" ? useThisName :
"biasWrapper("+wrappedProcess->GetProcessName()+
")",
71 wrappedProcess->GetProcessType()),
72 fWrappedProcess ( wrappedProcess ),
73 fIsPhysicsBasedBiasing ( true ),
74 fWrappedProcessIsAtRest ( wrappedIsAtRest ),
75 fWrappedProcessIsAlong ( wrappedIsAlongStep ),
76 fWrappedProcessIsPost ( wrappedIsPostStep ),
77 fWrappedProcessInteractionLength( -1.0 ),
78 fBiasingInteractionLaw ( 0 ),
79 fPhysicalInteractionLaw ( 0 ),
80 fOccurenceBiasingParticleChange ( 0 ),
81 fIamFirstGPIL ( false ),
118 return (*itr).second;
199 if ( firstStepInVolume )
258 G4double usedPreviousStepSize = previousStepSize;
278 usedPreviousStepSize = 0.0;
371 return particleChange;
394 G4bool forceBiasedFinalState =
false;
410 return finalStateParticleChange;
414 if ( forceBiasedFinalState )
417 return finalStateParticleChange;
422 G4double weightForInteraction = 1.0;
432 ed <<
"Internal inconsistency in cross-section handling. Please report !" <<
G4endl;
433 G4Exception(
" G4BiasingProcessInterface::PostStepDoIt(...)",
443 if ( weightForInteraction <= 0. )
446 ed <<
" Negative interaction weight : w_I = "
447 << weightForInteraction <<
453 G4Exception(
" G4BiasingProcessInterface::PostStepDoIt(...)",
581 G4double weightForNonInteraction (1.0);
584 weightForNonInteraction =
590 if ( weightForNonInteraction <= 0. )
593 ed <<
" Negative non interaction weight : w_NI = " << weightForNonInteraction <<
598 G4Exception(
" G4BiasingProcessInterface::AlongStepDoIt(...)",
721 fSharedData-> fBiasingProcessInterfaces.push_back(
this );
722 fSharedData-> fPublicBiasingProcessInterfaces.push_back(
this );
725 fSharedData-> fPhysicsBiasingProcessInterfaces.push_back(
this );
726 fSharedData-> fPublicPhysicsBiasingProcessInterfaces.push_back(
this );
730 fSharedData-> fNonPhysicsBiasingProcessInterfaces.push_back(
this );
731 fSharedData-> fPublicNonPhysicsBiasingProcessInterfaces.push_back(
this );
797 G4int iPhys = ( physOnly ) ? 1 : 0;
804 G4int iPhys = ( physOnly ) ? 1 : 0;
811 G4int iPhys = ( physOnly ) ? 1 : 0;
818 G4int iPhys = ( physOnly ) ? 1 : 0;
828 for (
G4int i = 0; i < pv->
size(); i++ )
if ( (*pv)(i) ==
this ) { thisIdx = i;
break; }
835 if ( thisIdx > thatIdx )
851 for (
G4int i = 0; i < pv->
size(); i++ )
if ( (*pv)(i) ==
this ) { thisIdx = i;
break; }
858 if ( thisIdx < thatIdx )
874 for (
G4int i = 0; i < pv->
size(); i++ )
if ( (*pv)(i) ==
this ) { thisIdx = i;
break; }
881 if ( thisIdx > thatIdx )
897 for (
G4int i = 0; i < pv->
size(); i++ )
if ( (*pv)(i) ==
this ) { thisIdx = i;
break; }
904 if ( thisIdx < thatIdx )
917 for (
G4int iPhys = 0; iPhys < 2; iPhys++ )
919 G4bool physOnly = ( iPhys == 1 );
944 G4double usedPreviousStepSize = previousStepSize;
956 usedPreviousStepSize = 0.0;
970 (
fSharedData -> fBiasingProcessInterfaces ) . clear();
971 (
fSharedData -> fPhysicsBiasingProcessInterfaces ) . clear();
972 (
fSharedData -> fNonPhysicsBiasingProcessInterfaces ) . clear();
973 (
fSharedData -> fPublicBiasingProcessInterfaces ) . clear();
974 (
fSharedData -> fPublicPhysicsBiasingProcessInterfaces ) . clear();
975 (
fSharedData -> fPublicNonPhysicsBiasingProcessInterfaces ) . clear();
980 for (
size_t j = 0; j < tmpProcess.size(); j++ )
982 if ( (*pv)(i) == tmpProcess[j] )
984 (
fSharedData -> fBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
985 (
fSharedData -> fPublicBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
988 (
fSharedData -> fPhysicsBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
989 (
fSharedData -> fPublicPhysicsBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
993 (
fSharedData -> fNonPhysicsBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
994 (
fSharedData -> fPublicNonPhysicsBiasingProcessInterfaces ) . push_back( tmpProcess[j] );
virtual void SetMasterProcess(G4VProcess *masterP)
virtual void Initialize(const G4Track &track)
G4double condition(const G4ErrorSymMatrix &m)
static G4MapCache< const G4ProcessManager *, G4BiasingProcessSharedData * > fSharedDataMap
const G4VProcess * GetMasterProcess() const
virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition &pd)
G4VBiasingOperation * fPreviousFinalStateBiasingOperation
G4bool IsLastPostStepGPILInterface(G4bool physOnly=true) const
G4bool fResetWrappedProcessInteractionLength
virtual void PreparePhysicsTable(const G4ParticleDefinition &pd)
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
virtual G4double ComputeNonInteractionProbabilityAt(G4double length) const
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &track, G4ForceCondition *condition)=0
virtual void SetProcessManager(const G4ProcessManager *)
G4VBiasingOperation * fFinalStateBiasingOperation
void SetWrappedParticleChange(G4VParticleChange *wpc)
static G4Cache< G4bool > fCommonEnd
G4VBiasingOperation * fNonPhysicsBiasingOperation
G4double fBiasingAlongStepGPIL
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)=0
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *pd, const G4String &s, G4bool f)
G4GPILSelection fWrappedProcessGPILSelection
std::ostringstream G4ExceptionDescription
static G4Cache< G4bool > fResetInteractionLaws
G4ParticleChange * fParticleChange
G4double GetStepLength() const
virtual void BuildPhysicsTable(const G4ParticleDefinition &pd)
virtual G4VParticleChange * ApplyFinalStateBiasing(const G4BiasingProcessInterface *, const G4Track *, const G4Step *, G4bool &)=0
G4double fBiasingPostStepGPIL
virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition &pd)
static G4Cache< G4bool > fDoCommonConfigure
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &step)
G4StepStatus GetStepStatus() const
G4ParticleChangeForNothing * fDummyParticleChange
void InvokeWrappedProcessPostStepGPIL(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
G4TrackStatus GetTrackStatus() const
void ResetForUnbiasedTracking()
std::vector< G4BiasingProcessInterface * > fBiasingProcessInterfaces
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &step)
G4double fWrappedProcessPostStepGPIL
const G4bool fIsPhysicsBasedBiasing
G4double fPreviousStepSize
virtual void SetProcessManager(const G4ProcessManager *)
virtual G4double ComputeEffectiveCrossSectionAt(G4double length) const =0
virtual void ResetNumberOfInteractionLengthLeft()
G4ForceCondition fBiasingForceCondition
G4VBiasingOperation * fPreviousOccurenceBiasingOperation
const G4ProcessManager * fProcessManager
void SetOccurenceWeightForNonInteraction(G4double w)
const G4Step * GetStep() const
const G4VBiasingInteractionLaw * fPreviousBiasingInteractionLaw
virtual G4double ProposeAlongStepLimit(const G4BiasingProcessInterface *)
G4VProcess * GetWrappedProcess() const
void SetUpFirstLastFlags()
virtual void BuildWorkerPhysicsTable(const G4ParticleDefinition &part)
G4bool GetIsFirstPostStepGPILInterface(G4bool physOnly=true) const
G4StepPoint * GetPreStepPoint() const
virtual void StartTracking(G4Track *)
void SetSecondaryWeightByProcess(G4bool)
static G4Cache< G4bool > fCommonStart
std::vector< G4BiasingProcessInterface * > fPhysicsBiasingProcessInterfaces
G4int GetCurrentStepNumber() const
G4bool GetIsLastPostStepDoItInterface(G4bool physOnly=true) const
const G4VBiasingInteractionLaw * fBiasingInteractionLaw
G4bool GetIsLastPostStepGPILInterface(G4bool physOnly=true) const
virtual void PreparePhysicsTable(const G4ParticleDefinition &)
virtual G4double ComputeEffectiveCrossSectionAt(G4double length) const
G4bool GetIsFirstPostStepDoItInterface(G4bool physOnly=true) const
G4VBiasingOperation * fPreviousNonPhysicsBiasingOperation
G4double GetCurrentInteractionLength() const
void SetProcessSubType(G4int)
void SetPhysicalCrossSection(G4double crossSection)
void SetOccurenceWeightForInteraction(G4double w)
G4VProcess * fWrappedProcess
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4ForceCondition *condition)
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *, const G4String &, G4bool)
const G4String & GetProcessName() const
G4ForceCondition fWrappedProcessForceCondition
const G4bool fWrappedProcessIsAlong
virtual G4VParticleChange * GenerateBiasingFinalState(const G4Track *, const G4Step *)=0
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual G4bool IsApplicable(const G4ParticleDefinition &pd)
virtual const G4ProcessManager * GetProcessManager()
G4bool fLeavingPreviousOperator
static G4VBiasingOperator * GetBiasingOperator(const G4LogicalVolume *)
virtual G4bool IsSingular() const
virtual const G4ProcessManager * GetProcessManager()
iterator Find(const key_type &k)
G4LogicalVolume * GetLogicalVolume() const
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
G4VBiasingOperation * fOccurenceBiasingOperation
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)=0
G4ParticleChangeForOccurenceBiasing * fOccurenceBiasingParticleChange
G4bool IsFirstPostStepGPILInterface(G4bool physOnly=true) const
G4bool fFirstLastFlags[8]
virtual void SetMasterProcess(G4VProcess *masterP)
G4BiasingProcessInterface(G4String name="biasWrapper(0)")
virtual G4bool RetrievePhysicsTable(const G4ParticleDefinition *pd, const G4String &s, G4bool f)
virtual G4GPILSelection ProposeGPILSelection(const G4GPILSelection wrappedProcessSelection)
G4VPhysicalVolume * GetVolume() const
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)=0
G4double GetSampledInteractionLength() const
static const std::vector< G4VBiasingOperator * > & GetBiasingOperators()
G4double fWrappedProcessInteractionLength
const G4String & GetName() const
virtual G4bool StorePhysicsTable(const G4ParticleDefinition *, const G4String &, G4bool)
virtual G4bool IsEffectiveCrossSectionInfinite() const
G4TrackStatus GetTrackStatus() const
G4bool IsFirstPostStepDoItInterface(G4bool physOnly=true) const
virtual const G4VBiasingInteractionLaw * ProvideOccurenceBiasingInteractionLaw(const G4BiasingProcessInterface *, G4ForceCondition &)=0
virtual void AlongMoveBy(const G4BiasingProcessInterface *, const G4Step *, G4double)
G4InteractionLawPhysical * fPhysicalInteractionLaw
virtual void ResetNumberOfInteractionLengthLeft()
G4BiasingProcessSharedData * fSharedData
virtual void PrepareWorkerPhysicsTable(const G4ParticleDefinition &)
void ProposeTrackStatus(G4TrackStatus status)
virtual void EndTracking()
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)=0
G4double fWrappedProcessAlongStepGPIL
G4double fCurrentMinimumStep
G4bool IsLastPostStepDoItInterface(G4bool physOnly=true) const
G4int IdxFirstLast(G4int firstLast, G4int GPILDoIt, G4int physAll) const
void ReorderBiasingVectorAsGPIL()
G4VBiasingOperator * fPreviousBiasingOperator
void Put(const value_type &val) const
G4int GetProcessSubType() const
G4GPILSelection fBiasingGPILSelection
void StartTracking(G4Track *track)
virtual G4double DistanceToApplyOperation(const G4Track *, G4double, G4ForceCondition *)=0
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4VBiasingOperator * fCurrentBiasingOperator
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &proposedSafety, G4GPILSelection *selection)
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
~G4BiasingProcessInterface()
virtual G4VParticleChange * AtRestDoIt(const G4Track &track, const G4Step &stepData)=0
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4BiasingProcessSharedData * GetSharedData() const