File indexing completed on 2025-09-18 09:14:09
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044 #ifndef G4BOptnForceCommonTruncatedExp_hh
0045 #define G4BOptnForceCommonTruncatedExp_hh 1
0046
0047 #include "G4VBiasingOperation.hh"
0048 #include "G4ThreeVector.hh"
0049 #include "G4ParticleChangeForNothing.hh"
0050
0051 #include <map>
0052
0053 class G4ILawCommonTruncatedExp;
0054 class G4ILawForceFreeFlight;
0055
0056 class G4BOptnForceCommonTruncatedExp : public G4VBiasingOperation
0057 {
0058 public:
0059
0060 G4BOptnForceCommonTruncatedExp(const G4String& name);
0061
0062 virtual ~G4BOptnForceCommonTruncatedExp();
0063
0064
0065
0066
0067 virtual const G4VBiasingInteractionLaw*
0068 ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*, G4ForceCondition& );
0069 virtual G4double
0070 ProposeAlongStepLimit( const G4BiasingProcessInterface* ) { return DBL_MAX; }
0071 virtual G4GPILSelection
0072 ProposeGPILSelection( const G4GPILSelection processSelection );
0073 virtual G4VParticleChange*
0074 ApplyFinalStateBiasing( const G4BiasingProcessInterface*,
0075 const G4Track*, const G4Step*, G4bool& );
0076
0077 virtual G4double
0078 DistanceToApplyOperation( const G4Track*,
0079 G4double, G4ForceCondition* ) { return DBL_MAX; }
0080 virtual G4VParticleChange*
0081 GenerateBiasingFinalState(const G4Track*, const G4Step*) { return nullptr; }
0082
0083
0084
0085
0086 G4ILawCommonTruncatedExp* GetCommonTruncatedExpLaw()
0087 {
0088 return fCommonTruncatedExpLaw;
0089 }
0090 G4ILawForceFreeFlight* GetForceFreeFlightLaw()
0091 {
0092 return fForceFreeFlightLaw;
0093 }
0094
0095 void Initialize( const G4Track* );
0096 void UpdateForStep( const G4Step* );
0097 void Sample();
0098 const G4ThreeVector& GetInitialMomentum() const { return fInitialMomentum; }
0099 G4double GetMaximumDistance() const { return fMaximumDistance; }
0100 void ChooseProcessToApply();
0101 const G4VProcess* GetProcessToApply() const { return fProcessToApply; }
0102 void AddCrossSection( const G4VProcess*, G4double );
0103 std::size_t GetNumberOfSharing() const { return fNumberOfSharing; }
0104 void SetInteractionOccured( G4bool b ) { fInteractionOccured = b; }
0105 G4bool GetInteractionOccured() const { return fInteractionOccured; }
0106
0107 private:
0108
0109 G4ILawCommonTruncatedExp* fCommonTruncatedExpLaw = nullptr;
0110 G4ILawForceFreeFlight* fForceFreeFlightLaw = nullptr;
0111 G4double fTotalCrossSection = 0.0;
0112 std::map < const G4VProcess*, G4double > fCrossSections;
0113 std::size_t fNumberOfSharing = 0;
0114 const G4VProcess* fProcessToApply = nullptr;
0115 G4bool fInteractionOccured = false;
0116 G4ThreeVector fInitialMomentum;
0117 G4double fMaximumDistance = -1.0;
0118 G4ParticleChangeForNothing fDummyParticleChange;
0119 };
0120
0121 #endif