49 fCurrentTrack(nullptr),
50 fCurrentTrackData(nullptr),
51 fInitialTrackWeight(-1.0),
58 if ( fParticleToBias == 0 )
61 ed <<
" Particle `" << particleName <<
"' not found !" <<
G4endl;
62 G4Exception(
" G4BOptrForceCollision::G4BOptrForceCollision(...)",
73 fCurrentTrack(nullptr),
74 fCurrentTrackData(nullptr),
75 fInitialTrackWeight(-1.0),
80 fParticleToBias = particle;
86 for ( std::map< const G4BiasingProcessInterface*, G4BOptnForceFreeFlight* >::iterator it = fFreeFlightOperations.begin() ;
87 it != fFreeFlightOperations.end() ;
88 it++ )
delete (*it).second;
89 delete fSharedForceInteractionOperation;
90 delete fCloningOperation;
108 if ( interfaceProcessSharedData )
135 if ( fCurrentTrackData ==
nullptr )
139 if ( fCurrentTrackData ==
nullptr )
return nullptr;
153 if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeFreeFlight )
174 if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeForced )
178 G4bool isFirstPhysGPIL = callingProcess-> GetIsFirstPostStepGPILInterface();
181 if ( isFirstPhysGPIL )
192 fSharedForceInteractionOperation->
Initialize( track );
210 fCurrentTrackData->Reset();
216 if ( isFirstPhysGPIL )
228 if ( interactionLength <
DBL_MAX/10. )
238 return operationToReturn;
254 if ( track->
GetDefinition() != fParticleToBias )
return nullptr;
266 if ( fCurrentTrackData !=
nullptr )
271 fCurrentTrackData->fForceCollisionOperator = this ;
283 fCurrentTrackData->fForceCollisionState = ForceCollisionState::toBeCloned;
284 fInitialTrackWeight = track->
GetWeight();
286 return fCloningOperation;
305 fCurrentTrack = track;
306 fCurrentTrackData =
nullptr;
313 if ( fCurrentTrackData !=
nullptr )
320 ed <<
"Current track deleted while under biasing by " <<
GetName() <<
". Will result in inconsistencies.";
321 G4Exception(
" G4BOptrForceCollision::EndTracking()",
337 if ( fCurrentTrackData ==
nullptr )
342 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
343 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
351 if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeCloned )
353 fCurrentTrackData->fForceCollisionState = ForceCollisionState::toBeFreeFlight;
355 cloneData->fForceCollisionState = ForceCollisionState::toBeForced;
358 else if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeFreeFlight )
360 if ( fFreeFlightOperations[callingProcess]->OperationComplete() ) fCurrentTrackData->Reset();
362 else if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeForced )
364 if ( operationApplied != fSharedForceInteractionOperation )
367 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
368 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
375 if ( operationApplied != fSharedForceInteractionOperation )
378 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
379 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
388 if ( fCurrentTrackData->fForceCollisionState != ForceCollisionState::free )
391 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
392 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
406 if ( fCurrentTrackData->fForceCollisionState == ForceCollisionState::toBeForced )
408 if ( finalStateOperationApplied != fSharedForceInteractionOperation )
411 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
412 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
422 ed <<
" Internal inconsistency : please submit bug report. " <<
G4endl;
423 G4Exception(
" G4BOptrForceCollision::OperationApplied(...)",
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
@ fKillTrackAndSecondaries
void SetCloneWeights(G4double clone1Weight, G4double clone2Weight)
G4Track * GetCloneTrack() const
void UpdateForStep(const G4Step *)
G4double GetMaximumDistance() const
void AddCrossSection(const G4VProcess *, G4double)
const G4ThreeVector & GetInitialMomentum() const
G4bool GetInteractionOccured() const
void Initialize(const G4Track *)
size_t GetNumberOfSharing() const
void ResetInitialTrackWeight(G4double w)
G4bool IsFreeFromBiasing() const
virtual void StartTracking(const G4Track *track) final
virtual void EndTracking() final
G4BOptrForceCollision(G4String particleToForce, G4String name="ForceCollision")
virtual void ConfigureForWorker() final
void OperationApplied(const G4BiasingProcessInterface *callingProcess, G4BiasingAppliedCase biasingCase, G4VBiasingOperation *operationApplied, const G4VParticleChange *particleChangeProduced) final
virtual void StartRun() final
virtual void Configure() final
const G4BiasingProcessSharedData * GetSharedData() const
G4VBiasingOperation * GetCurrentOccurenceBiasingOperation() const
G4VProcess * GetWrappedProcess() const
const std::vector< const G4BiasingProcessInterface * > & GetPhysicsBiasingProcessInterfaces() const
G4ProcessManager * GetProcessManager() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4StepStatus GetStepStatus() const
G4StepPoint * GetPreStepPoint() const
G4TrackStatus GetTrackStatus() const
void SetAuxiliaryTrackInformation(G4int id, G4VAuxiliaryTrackInformation *info) const
G4double GetWeight() const
G4int GetCurrentStepNumber() const
G4ThreeVector GetMomentum() const
G4VAuxiliaryTrackInformation * GetAuxiliaryTrackInformation(G4int id) const
G4ParticleDefinition * GetDefinition() const
const G4Step * GetStep() const
const G4String GetName() const
G4double GetCurrentInteractionLength() const
const G4String & GetProcessName() const