File indexing completed on 2025-01-18 09:59:13
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 #ifndef G4Transportation_hh
0044 #define G4Transportation_hh 1
0045
0046 #include "G4VProcess.hh"
0047
0048 #include "G4Track.hh"
0049 #include "G4Step.hh"
0050 #include "G4ParticleChangeForTransport.hh"
0051
0052 class G4Navigator;
0053 class G4PropagatorInField;
0054 class G4SafetyHelper;
0055 class G4TransportationLogger;
0056
0057 class G4Transportation : public G4VProcess
0058 {
0059
0060
0061 public:
0062
0063 G4Transportation( G4int verbosityLevel= 1, const G4String& aName = "Transportation");
0064 ~G4Transportation();
0065
0066 G4double AlongStepGetPhysicalInteractionLength(
0067 const G4Track& track,
0068 G4double previousStepSize,
0069 G4double currentMinimumStep,
0070 G4double& currentSafety,
0071 G4GPILSelection* selection
0072 );
0073
0074 G4VParticleChange* AlongStepDoIt(
0075 const G4Track& track,
0076 const G4Step& stepData
0077 );
0078
0079 G4VParticleChange* PostStepDoIt(
0080 const G4Track& track,
0081 const G4Step& stepData
0082 );
0083
0084
0085 G4double PostStepGetPhysicalInteractionLength(
0086 const G4Track& ,
0087 G4double previousStepSize,
0088 G4ForceCondition* pForceCond
0089 );
0090
0091
0092
0093 inline G4bool FieldExertedForce() { return fFieldExertedForce; }
0094
0095 G4PropagatorInField* GetPropagatorInField();
0096 void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
0097
0098
0099 inline G4double GetThresholdWarningEnergy() const;
0100 inline G4double GetThresholdImportantEnergy() const;
0101 inline G4int GetThresholdTrials() const;
0102
0103 inline void SetThresholdWarningEnergy( G4double newEnWarn );
0104 inline void SetThresholdImportantEnergy( G4double newEnImp );
0105 inline void SetThresholdTrials(G4int newMaxTrials );
0106
0107
0108
0109
0110
0111 void SetHighLooperThresholds();
0112 void SetLowLooperThresholds();
0113 void PushThresholdsToLogger();
0114 void ReportLooperThresholds();
0115
0116 inline G4double GetMaxEnergyKilled() const;
0117 inline G4double GetSumEnergyKilled() const;
0118 inline void ResetKilledStatistics( G4int report = 1);
0119
0120
0121 inline void EnableShortStepOptimisation(G4bool optimise=true);
0122
0123
0124 static G4bool EnableMagneticMoment(G4bool useMoment=true);
0125
0126
0127 static G4bool EnableGravity(G4bool useGravity=true);
0128
0129
0130 static void SetSilenceLooperWarnings( G4bool val);
0131
0132 static G4bool GetSilenceLooperWarnings();
0133
0134 public:
0135 static G4bool EnableUseMagneticMoment(G4bool useMoment=true)
0136 { return EnableMagneticMoment(useMoment); }
0137
0138 public:
0139
0140 G4double AtRestGetPhysicalInteractionLength( const G4Track&,
0141 G4ForceCondition*)
0142 { return -1.0; }
0143
0144 G4VParticleChange* AtRestDoIt( const G4Track&, const G4Step& )
0145 { return 0; }
0146
0147 void StartTracking(G4Track* aTrack);
0148
0149
0150 virtual void ProcessDescription(std::ostream& outFile) const;
0151 void PrintStatistics( std::ostream& outStr) const;
0152
0153 protected:
0154
0155 void SetTouchableInformation(const G4TouchableHandle& touchable);
0156
0157 void ReportMissingLogger(const char * methodName);
0158
0159 protected:
0160
0161 G4Navigator* fLinearNavigator;
0162
0163
0164 G4PropagatorInField* fFieldPropagator;
0165
0166
0167 G4ThreeVector fTransportEndPosition= G4ThreeVector( 0.0, 0.0, 0.0 );
0168 G4ThreeVector fTransportEndMomentumDir= G4ThreeVector( 0.0, 0.0, 0.0 );
0169 G4double fTransportEndKineticEnergy= 0.0;
0170 G4ThreeVector fTransportEndSpin= G4ThreeVector( 0.0, 0.0, 0.0 );
0171 G4bool fMomentumChanged= true;
0172 G4bool fEndGlobalTimeComputed= false;
0173 G4double fCandidateEndGlobalTime= 0.0;
0174
0175
0176 G4bool fAnyFieldExists= false;
0177
0178 G4bool fParticleIsLooping = false;
0179 G4bool fNewTrack= true;
0180 G4bool fFirstStepInVolume= true;
0181 G4bool fLastStepInVolume= false;
0182
0183 G4bool fGeometryLimitedStep= true;
0184
0185
0186 G4bool fFieldExertedForce= false;
0187
0188 G4TouchableHandle fCurrentTouchableHandle;
0189
0190 G4ThreeVector fPreviousSftOrigin;
0191 G4double fPreviousSafety;
0192
0193
0194 G4ParticleChangeForTransport fParticleChange;
0195
0196
0197 G4double fEndPointDistance;
0198
0199
0200
0201 G4double fThreshold_Warning_Energy = 1.0 * CLHEP::keV;
0202 G4double fThreshold_Important_Energy = 1.0 * CLHEP::MeV;
0203 G4int fThresholdTrials = 10;
0204
0205
0206 G4int fAbandonUnstableTrials = 0;
0207
0208
0209
0210 G4int fNoLooperTrials= 0;
0211
0212
0213
0214 G4double fSumEnergyKilled= 0.0;
0215 G4double fSumEnerSqKilled= 0.0;
0216 G4double fMaxEnergyKilled= -1.0;
0217 G4int fMaxEnergyKilledPDG= 0;
0218 unsigned long fNumLoopersKilled= 0;
0219 G4double fSumEnergyKilled_NonElectron= 0.0;
0220 G4double fSumEnerSqKilled_NonElectron= 0.0;
0221 G4double fMaxEnergyKilled_NonElectron= -1.0;
0222 G4int fMaxEnergyKilled_NonElecPDG= 0;
0223 unsigned long fNumLoopersKilled_NonElectron= 0;
0224 G4double fSumEnergySaved= 0.0;
0225 G4double fMaxEnergySaved= -1.0;
0226 G4double fSumEnergyUnstableSaved = 0.0;
0227
0228
0229
0230 G4bool fShortStepOptimisation;
0231
0232 G4SafetyHelper* fpSafetyHelper;
0233 G4TransportationLogger* fpLogger;
0234
0235 protected:
0236
0237 static G4bool fUseMagneticMoment;
0238 static G4bool fUseGravity;
0239 static G4bool fSilenceLooperWarnings;
0240
0241 };
0242
0243 #include "G4Transportation.icc"
0244
0245 #endif