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