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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef G4IVContinuousDiscreteProcess_h
00048 #define G4IVContinuousDiscreteProcess_h 1
00049
00050 #include <CLHEP/Units/SystemOfUnits.h>
00051
00052 #include "globals.hh"
00053 #include "G4ios.hh"
00054
00055 #include "G4VProcess.hh"
00056 #include "G4Track.hh"
00057 #include "G4Step.hh"
00058 #include "G4MaterialTable.hh"
00059
00060 class G4IVContinuousDiscreteProcess : public G4VProcess
00061 {
00062
00063
00064 public:
00065
00066 G4IVContinuousDiscreteProcess(const G4String& ,
00067 G4ProcessType aType = fNotDefined );
00068 G4IVContinuousDiscreteProcess(G4IVContinuousDiscreteProcess &);
00069
00070 virtual ~G4IVContinuousDiscreteProcess();
00071
00072 public:
00073 virtual G4double PostStepGetPhysicalInteractionLength(
00074 const G4Track& track,
00075 G4double previousStepSize,
00076 G4ForceCondition* condition
00077 );
00078
00079 virtual G4VParticleChange* PostStepDoIt(
00080 const G4Track& ,
00081 const G4Step&
00082 );
00083
00084 virtual G4double AlongStepGetPhysicalInteractionLength(
00085 const G4Track&,
00086 G4double previousStepSize,
00087 G4double currentMinimumStep,
00088 G4double& currentSafety,
00089 G4GPILSelection* selection
00090 ) ;
00091
00092 virtual G4VParticleChange* AlongStepDoIt(
00093 const G4Track& ,
00094 const G4Step&
00095 );
00096
00097
00098 virtual G4double AtRestGetPhysicalInteractionLength(
00099 const G4Track& ,
00100 G4ForceCondition*
00101 ) { return -1.0; };
00102
00103
00104 virtual G4VParticleChange* AtRestDoIt(
00105 const G4Track& ,
00106 const G4Step&
00107 ) {return 0;};
00108
00109 protected:
00110 virtual G4double GetContinuousStepLimit(const G4Track& aTrack,
00111 G4double previousStepSize,
00112 G4double currentMinimumStep,
00113 G4double& currentSafety
00114 )=0;
00115 private:
00116
00117
00118 G4GPILSelection valueGPILSelection;
00119
00120 protected:
00121
00122 virtual void SubtractNumberOfInteractionLengthLeft(
00123 G4double previousStepSize) ;
00124
00125
00126 void SetGPILSelection(G4GPILSelection selection)
00127 { valueGPILSelection = selection;};
00128
00129 G4GPILSelection GetGPILSelection() const{return valueGPILSelection;};
00130
00131 private:
00132
00133 G4IVContinuousDiscreteProcess();
00134 G4IVContinuousDiscreteProcess & operator=(const G4IVContinuousDiscreteProcess &right);
00135
00136 protected:
00137 G4PhysicsTable* theNlambdaTable ;
00138 G4PhysicsTable* theInverseNlambdaTable ;
00139 const G4double BIGSTEP ;
00140 };
00141
00142
00143
00144
00145
00146 inline void G4IVContinuousDiscreteProcess::
00147 SubtractNumberOfInteractionLengthLeft(
00148 G4double
00149 )
00150 {
00151
00152 ;
00153 }
00154
00155
00156 inline G4VParticleChange* G4IVContinuousDiscreteProcess::PostStepDoIt(
00157 const G4Track& ,
00158 const G4Step&
00159 )
00160 {
00161
00162 ClearNumberOfInteractionLengthLeft();
00163 return pParticleChange;
00164 }
00165
00166 inline G4VParticleChange* G4IVContinuousDiscreteProcess::AlongStepDoIt(
00167 const G4Track& ,
00168 const G4Step&
00169 )
00170 {
00171
00172 ClearNumberOfInteractionLengthLeft();
00173 return pParticleChange;
00174 }
00175
00176 inline G4double G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength(
00177 const G4Track& track,
00178 G4double previousStepSize,
00179 G4double currentMinimumStep,
00180 G4double& currentSafety,
00181 G4GPILSelection* selection
00182 )
00183 {
00184
00185 valueGPILSelection = CandidateForSelection;
00186
00187
00188 G4double steplength = GetContinuousStepLimit(track,previousStepSize,currentMinimumStep, currentSafety);
00189
00190
00191 *selection = valueGPILSelection;
00192
00193 if (verboseLevel>1){
00194 G4cout << "G4IVContinuousDiscreteProcess::AlongStepGetPhysicalInteractionLength ";
00195 G4cout << "[ " << GetProcessName() << "]" <<G4endl;
00196 track.GetDynamicParticle()->DumpInfo();
00197 G4cout << " in Material " << track.GetMaterial()->GetName() <<G4endl;
00198 G4cout << "IntractionLength= " << steplength/CLHEP::cm <<"[cm] " <<G4endl;
00199 }
00200 return steplength ;
00201 }
00202
00203 #endif