00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef G4ITTransportation_H
00042 #define G4ITTransportation_H
00043
00044 #include <CLHEP/Units/SystemOfUnits.h>
00045
00046 #include "G4IT.hh"
00047 #include "G4VITProcess.hh"
00048 #include "G4Track.hh"
00049 #include "G4Step.hh"
00050 #include "G4ParticleChangeForTransport.hh"
00051
00052 class G4ITNavigator;
00053
00054 class G4SafetyHelper;
00055 class G4PropagatorInField;
00056
00057 class G4ITTransportation : public G4VITProcess
00058 {
00059
00060 public:
00061
00062 G4ITTransportation(const G4String& aName = "ITTransportation",G4int verbosityLevel= 1);
00063 virtual ~G4ITTransportation();
00064
00065 G4ITTransportation(const G4ITTransportation&);
00066
00067 G4IT_ADD_CLONE(G4VITProcess, G4ITTransportation)
00068
00069 virtual void BuildPhysicsTable(const G4ParticleDefinition&){;}
00070
00071 virtual void ComputeStep(const G4Track&,
00072 const G4Step&,
00073 const double timeStep,
00074 double& spaceStep) ;
00075
00076 virtual void StartTracking(G4Track* aTrack);
00077
00078
00079
00080 public:
00081
00082 virtual G4double AtRestGetPhysicalInteractionLength(
00083 const G4Track& ,
00084 G4ForceCondition*
00085 )
00086 {
00087 return -1.0;
00088 }
00089
00090
00091 virtual G4VParticleChange* AtRestDoIt(
00092 const G4Track& ,
00093 const G4Step&
00094 )
00095 {
00096 return 0;
00097 }
00098
00099
00100 virtual G4double AlongStepGetPhysicalInteractionLength(
00101 const G4Track& track,
00102 G4double ,
00103 G4double currentMinimumStep,
00104 G4double& currentSafety,
00105 G4GPILSelection* selection);
00106
00107 virtual G4double PostStepGetPhysicalInteractionLength(
00108 const G4Track& ,
00109 G4double ,
00110 G4ForceCondition* pForceCond);
00111
00112 virtual G4VParticleChange* AlongStepDoIt( const G4Track& track,
00113 const G4Step& stepData );
00114
00115 virtual G4VParticleChange* PostStepDoIt( const G4Track& track,
00116 const G4Step& ) ;
00117
00118
00119
00120
00121 G4PropagatorInField* GetPropagatorInField();
00122 void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
00123
00124
00125 inline void SetVerboseLevel( G4int verboseLevel );
00126 inline G4int GetVerboseLevel() const;
00127
00128
00129
00130 inline G4double GetThresholdWarningEnergy() const;
00131 inline G4double GetThresholdImportantEnergy() const;
00132 inline G4int GetThresholdTrials() const;
00133
00134 inline void SetThresholdWarningEnergy( G4double newEnWarn );
00135 inline void SetThresholdImportantEnergy( G4double newEnImp );
00136 inline void SetThresholdTrials(G4int newMaxTrials );
00137
00138
00139
00140
00141
00142
00143 inline G4double GetMaxEnergyKilled() const;
00144 inline G4double GetSumEnergyKilled() const;
00145 inline void ResetKilledStatistics( G4int report = 1);
00146
00147
00148 inline void EnableShortStepOptimisation(G4bool optimise=true);
00149
00150
00151 protected :
00152
00153
00154 G4bool DoesGlobalFieldExist();
00155
00156
00157
00158
00159 struct G4ITTransportationState : public G4ProcessState
00160 {
00161 public :
00162 G4ITTransportationState();
00163 virtual ~G4ITTransportationState();
00164
00165 G4ThreeVector fTransportEndPosition;
00166 G4ThreeVector fTransportEndMomentumDir;
00167 G4double fTransportEndKineticEnergy;
00168 G4ThreeVector fTransportEndSpin;
00169 G4bool fMomentumChanged;
00170 G4bool fEnergyChanged;
00171 G4bool fEndGlobalTimeComputed;
00172 G4double fCandidateEndGlobalTime;
00173 G4bool fParticleIsLooping;
00174
00175
00176 G4TouchableHandle fCurrentTouchableHandle;
00177 G4bool fGeometryLimitedStep;
00178
00179
00180 G4ThreeVector fPreviousSftOrigin;
00181 G4double fPreviousSafety;
00182
00183
00184
00185
00186 G4int fNoLooperTrials;
00187
00188
00189
00190
00191
00192
00193 G4double endpointDistance;
00194 };
00195
00196 G4ITTransportationState* const & fTransportationState;
00197
00198
00199
00200
00201 G4ITNavigator* fLinearNavigator;
00202 G4PropagatorInField* fFieldPropagator;
00203
00204
00205
00206
00207 G4ParticleChangeForTransport fParticleChange;
00208
00209
00210
00211
00212 G4double fThreshold_Warning_Energy;
00213 G4double fThreshold_Important_Energy;
00214 G4int fThresholdTrials;
00215
00216
00217 G4double fUnimportant_Energy;
00218
00219
00220
00221
00222 G4double fSumEnergyKilled;
00223 G4double fMaxEnergyKilled;
00224
00225
00226
00227 G4bool fShortStepOptimisation;
00228
00229 G4SafetyHelper* fpSafetyHelper;
00230
00231
00232 G4int fVerboseLevel;
00233
00234
00235
00236 void SetInstantiateProcessState(G4bool flag)
00237 { fInstantiateProcessState = flag; }
00238
00239 G4bool InstantiateProcessState() { return fInstantiateProcessState; }
00240
00241 private :
00242 G4bool fInstantiateProcessState;
00243 G4ITTransportation& operator=(const G4ITTransportation&);
00244 };
00245
00246 #include "G4ITTransportation.icc"
00247 #endif // G4ITTransportation_H