Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id$ 27 // 28 // >> 29 // $Id: 28 // ------------------------------------------- 30 // ------------------------------------------------------------ 29 // GEANT 4 class header file 31 // GEANT 4 class header file 30 // 32 // 31 // History: first implementation, based o 33 // History: first implementation, based on object model of 32 // 2nd December 1995, G.Cosmo 34 // 2nd December 1995, G.Cosmo 33 // ---------- G4hEnergyLoss physics proce 35 // ---------- G4hEnergyLoss physics process ----------- 34 // by Laszlo Urban, 30 May 1997 36 // by Laszlo Urban, 30 May 1997 35 // 37 // 36 // ******************************************* 38 // ************************************************************ 37 // It is the first implementation of the NEW U 39 // It is the first implementation of the NEW UNIFIED ENERGY LOSS PROCESS. 38 // It calculates the continuous energy loss fo 40 // It calculates the continuous energy loss for charged hadrons. 39 // Processes giving contribution to the contin 41 // Processes giving contribution to the continuous loss : 40 // ionisation (= cont.ion.loss + delta ray p 42 // ionisation (= cont.ion.loss + delta ray production) 41 // can be added more easily .......... 43 // can be added more easily .......... 42 // This class creates static proton/antiproton 44 // This class creates static proton/antiproton dE/dx and range tables , 43 // which tables can be used by other processes 45 // which tables can be used by other processes. 44 // The energy loss for other charged hadrons i 46 // The energy loss for other charged hadrons is calculated from the p/pbar 45 // tables with scaled kinetic energy. 47 // tables with scaled kinetic energy. 46 // 48 // 47 // 7/10/98 L.Urban some bugs fixed + some cle 49 // 7/10/98 L.Urban some bugs fixed + some cleanup 48 // 22/10/98 L.Urban cleanup 50 // 22/10/98 L.Urban cleanup 49 // 02/02/99 L.Urban several bugs fixed 51 // 02/02/99 L.Urban several bugs fixed 50 // 31/03/00 V.Ivanchenko rename to lowenergy a 52 // 31/03/00 V.Ivanchenko rename to lowenergy as G4hLowEnergyLoss.hh 51 // 09/08/00 V.Ivanchenko remove GetContinuousS 53 // 09/08/00 V.Ivanchenko remove GetContinuousStepLimit and IsApplicable 52 // 23/11/01 V.Ivanchenko Move static member-fu 54 // 23/11/01 V.Ivanchenko Move static member-functions from header to source 53 // 22/01/03 V.Ivanchenko Cuts per region 55 // 22/01/03 V.Ivanchenko Cuts per region 54 // 18/04/03 V.Ivanchenko Make dRoverRange prot 56 // 18/04/03 V.Ivanchenko Make dRoverRange protected 55 // 57 // 56 // 31 Jul 2008 MGP Short term supply of en 58 // 31 Jul 2008 MGP Short term supply of energy loss of hadrons through clone of 57 // former G4hLowEnergyLoss 59 // former G4hLowEnergyLoss (with some initial cleaning) 58 // To be replaced by rewor 60 // To be replaced by reworked class to deal with condensed/discrete 59 // issues properly 61 // issues properly 60 // 62 // 61 // ------------------------------------------- 63 // -------------------------------------------------------------- 62 64 63 // Class description: 65 // Class description: 64 // Short term supply of energy loss of hadrons 66 // Short term supply of energy loss of hadrons through clone of former G4hLowEnergyLoss 65 // (with some initial cleaning) 67 // (with some initial cleaning) 66 // To be replaced by reworked class to deal wi 68 // To be replaced by reworked class to deal with condensed/discrete issues properly 67 69 68 // ------------------------------------------- 70 // -------------------------------------------------------------- 69 71 70 72 71 #ifndef G4HRDENERGYLOSS_HH 73 #ifndef G4HRDENERGYLOSS_HH 72 #define G4HRDENERGYLOSS_HH 1 74 #define G4HRDENERGYLOSS_HH 1 73 75 74 #include "G4ios.hh" 76 #include "G4ios.hh" 75 #include "globals.hh" 77 #include "globals.hh" 76 #include "Randomize.hh" 78 #include "Randomize.hh" 77 #include "G4VContinuousDiscreteProcess.hh" 79 #include "G4VContinuousDiscreteProcess.hh" 78 #include "G4Material.hh" 80 #include "G4Material.hh" 79 #include "G4Element.hh" 81 #include "G4Element.hh" 80 #include "G4Proton.hh" 82 #include "G4Proton.hh" 81 #include "G4AntiProton.hh" 83 #include "G4AntiProton.hh" 82 #include "G4Electron.hh" 84 #include "G4Electron.hh" 83 #include "G4VParticleChange.hh" 85 #include "G4VParticleChange.hh" 84 #include "G4Track.hh" 86 #include "G4Track.hh" 85 #include "G4Step.hh" 87 #include "G4Step.hh" 86 #include "G4PhysicsLogVector.hh" 88 #include "G4PhysicsLogVector.hh" 87 #include "G4PhysicsLinearVector.hh" 89 #include "G4PhysicsLinearVector.hh" 88 90 89 class G4EnergyLossMessenger; 91 class G4EnergyLossMessenger; 90 92 91 class G4hRDEnergyLoss : public G4VContinuousDi 93 class G4hRDEnergyLoss : public G4VContinuousDiscreteProcess 92 94 93 { 95 { 94 public: 96 public: 95 97 96 G4hRDEnergyLoss(const G4String& ); 98 G4hRDEnergyLoss(const G4String& ); 97 99 98 ~G4hRDEnergyLoss(); 100 ~G4hRDEnergyLoss(); 99 101 100 virtual G4double GetMeanFreePath( 102 virtual G4double GetMeanFreePath( 101 const G4Track& track, 103 const G4Track& track, 102 G4double previousStepSize, 104 G4double previousStepSize, 103 enum G4ForceCondition* condition 105 enum G4ForceCondition* condition 104 ) = 0 ; 106 ) = 0 ; 105 107 106 virtual G4VParticleChange* PostStepDoIt(cons 108 virtual G4VParticleChange* PostStepDoIt(const G4Track& track, 107 const G4Step& Step) = 0 ; 109 const G4Step& Step) = 0 ; 108 110 109 // ---- MGP ---- All this static stuff is ex 111 // ---- MGP ---- All this static stuff is expected to disappear in a future 110 // development cycle 112 // development cycle 111 113 112 // get the number of processes contributing 114 // get the number of processes contributing to the cont.energy loss 113 static G4int GetNumberOfProcesses(); 115 static G4int GetNumberOfProcesses(); 114 116 115 // set the number of processes contributing 117 // set the number of processes contributing to the cont.energy loss 116 static void SetNumberOfProcesses(G4int numbe 118 static void SetNumberOfProcesses(G4int number); 117 119 118 // Increment the number of processes contri 120 // Increment the number of processes contributing to the cont.energy loss 119 static void PlusNumberOfProcesses(); 121 static void PlusNumberOfProcesses(); 120 122 121 // decrement the number of processes contri 123 // decrement the number of processes contributing to the cont.energy loss 122 static void MinusNumberOfProcesses(); 124 static void MinusNumberOfProcesses(); 123 125 124 static void SetdRoverRange(G4double value); 126 static void SetdRoverRange(G4double value); 125 static void SetRndmStep (G4bool value) 127 static void SetRndmStep (G4bool value); 126 static void SetEnlossFluc (G4bool value) 128 static void SetEnlossFluc (G4bool value); 127 static void SetStepFunction (G4double c1, G4 129 static void SetStepFunction (G4double c1, G4double c2); 128 130 129 protected: 131 protected: 130 132 131 G4bool CutsWhereModified(); 133 G4bool CutsWhereModified(); 132 134 133 // G4Material *lastMaterial ; 135 // G4Material *lastMaterial ; 134 const G4double MaxExcitationNumber ; 136 const G4double MaxExcitationNumber ; 135 const G4double probLimFluct ; 137 const G4double probLimFluct ; 136 const long nmaxDirectFluct,nmaxCont1,nmaxCon 138 const long nmaxDirectFluct,nmaxCont1,nmaxCont2 ; 137 139 138 static void BuildDEDXTable(const G4ParticleD 140 static void BuildDEDXTable(const G4ParticleDefinition& aParticleType); 139 141 140 protected: 142 protected: 141 143 142 static G4ThreadLocal G4PhysicsTable* theDEDX << 144 static G4PhysicsTable* theDEDXpTable ; 143 static G4ThreadLocal G4PhysicsTable* theDEDX << 145 static G4PhysicsTable* theDEDXpbarTable ; 144 static G4ThreadLocal G4PhysicsTable* theRang << 146 static G4PhysicsTable* theRangepTable ; 145 static G4ThreadLocal G4PhysicsTable* theRang << 147 static G4PhysicsTable* theRangepbarTable ; 146 148 147 //inverse of the range tables 149 //inverse of the range tables 148 static G4ThreadLocal G4PhysicsTable* theInve << 150 static G4PhysicsTable* theInverseRangepTable ; 149 static G4ThreadLocal G4PhysicsTable* theInve << 151 static G4PhysicsTable* theInverseRangepbarTable ; 150 152 151 //lab and proper time tables 153 //lab and proper time tables 152 static G4ThreadLocal G4PhysicsTable* theLabT << 154 static G4PhysicsTable* theLabTimepTable ; 153 static G4ThreadLocal G4PhysicsTable* theLabT << 155 static G4PhysicsTable* theLabTimepbarTable ; 154 156 155 static G4ThreadLocal G4PhysicsTable* theProp << 157 static G4PhysicsTable* theProperTimepTable ; 156 static G4ThreadLocal G4PhysicsTable* theProp << 158 static G4PhysicsTable* theProperTimepbarTable ; 157 159 158 // processes inherited from G4hRDEnergyLoss 160 // processes inherited from G4hRDEnergyLoss 159 // register themselves in the static arra 161 // register themselves in the static array Recorder 160 static G4ThreadLocal G4PhysicsTable** Record << 162 static G4PhysicsTable** RecorderOfpProcess; 161 static G4ThreadLocal G4PhysicsTable** Record << 163 static G4PhysicsTable** RecorderOfpbarProcess; 162 static G4ThreadLocal G4int CounterOfpProcess << 164 static G4int CounterOfpProcess ; 163 static G4ThreadLocal G4int CounterOfpbarProc << 165 static G4int CounterOfpbarProcess ; 164 166 165 // particle mass 167 // particle mass 166 static G4ThreadLocal G4double ParticleMass ; << 168 static G4double ParticleMass ; 167 169 168 // cut in range 170 // cut in range 169 static G4ThreadLocal G4double ptableElectron << 171 static G4double ptableElectronCutInRange; 170 static G4ThreadLocal G4double pbartableElect << 172 static G4double pbartableElectronCutInRange; 171 173 172 static G4ThreadLocal G4double Charge ; << 174 static G4double Charge ; 173 175 174 static G4ThreadLocal G4double LowestKineticE << 176 static G4double LowestKineticEnergy; 175 static G4ThreadLocal G4double HighestKinetic << 177 static G4double HighestKineticEnergy; 176 static G4ThreadLocal G4int TotBin; // number << 178 static G4int TotBin; // number of bins in table, 177 // calculated in BuildPhysicsTable 179 // calculated in BuildPhysicsTable 178 180 179 static G4ThreadLocal G4double RTable,LOGRTab << 181 static G4double RTable,LOGRTable; // LOGRTable=std::log(HighestKineticEnergy 180 // /LowestKineticEnergy)/TotBin 182 // /LowestKineticEnergy)/TotBin 181 // RTable = std::exp(LOGRTable) 183 // RTable = std::exp(LOGRTable) 182 184 183 G4PhysicsTable* theLossTable ; 185 G4PhysicsTable* theLossTable ; 184 186 185 G4double linLossLimit ; 187 G4double linLossLimit ; 186 188 187 G4double MinKineticEnergy ; 189 G4double MinKineticEnergy ; 188 190 189 static G4ThreadLocal G4double dRoverRange ; << 191 static G4double dRoverRange ; // maximum allowed deltarange/range 190 // in one step 192 // in one step 191 static G4ThreadLocal G4double finalRange ; << 193 static G4double finalRange ; // last step before stop 192 static G4ThreadLocal G4double c1lim,c2lim,c3 << 194 static G4double c1lim,c2lim,c3lim ; // coeffs for computing steplimit 193 195 194 static G4ThreadLocal G4bool rndmStepFlag ; << 196 static G4bool rndmStepFlag ; 195 static G4ThreadLocal G4bool EnlossFlucFlag ; << 197 static G4bool EnlossFlucFlag ; 196 198 197 199 198 private: 200 private: 199 201 200 // hide assignment operator 202 // hide assignment operator 201 203 202 G4hRDEnergyLoss(G4hRDEnergyLoss &); 204 G4hRDEnergyLoss(G4hRDEnergyLoss &); 203 G4hRDEnergyLoss & operator=(const G4hRDEnerg 205 G4hRDEnergyLoss & operator=(const G4hRDEnergyLoss &right); 204 206 205 // variables for the integration routines 207 // variables for the integration routines 206 static G4ThreadLocal G4double Mass,taulow,ta << 208 static G4double Mass,taulow,tauhigh,ltaulow,ltauhigh; 207 209 208 // ========================================= 210 // ==================================================================== 209 // static part of the class 211 // static part of the class 210 212 211 static void BuildRangeTable(const G4Particle 213 static void BuildRangeTable(const G4ParticleDefinition& aParticleType); 212 214 213 static void BuildInverseRangeTable(const G4P 215 static void BuildInverseRangeTable(const G4ParticleDefinition& aParticleType); 214 216 215 static void BuildTimeTables(const G4Particle 217 static void BuildTimeTables(const G4ParticleDefinition& aParticleType); 216 218 217 static void BuildLabTimeVector(G4int materia 219 static void BuildLabTimeVector(G4int materialIndex, 218 G4PhysicsLogVector* rangeVector); 220 G4PhysicsLogVector* rangeVector); 219 221 220 static void BuildProperTimeVector(G4int mate 222 static void BuildProperTimeVector(G4int materialIndex, 221 G4PhysicsLogVector* rangeVector); 223 G4PhysicsLogVector* rangeVector); 222 224 223 static void InvertRangeVector(G4int material 225 static void InvertRangeVector(G4int materialIndex, 224 G4PhysicsLogVector* rangeVector); 226 G4PhysicsLogVector* rangeVector); 225 227 226 static void BuildRangeVector(G4int materialI 228 static void BuildRangeVector(G4int materialIndex, 227 G4PhysicsLogVector* rangeVector); 229 G4PhysicsLogVector* rangeVector); 228 230 229 static G4double LabTimeIntLog(G4PhysicsVecto 231 static G4double LabTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin); 230 232 231 static G4double ProperTimeIntLog(G4PhysicsVe 233 static G4double ProperTimeIntLog(G4PhysicsVector* physicsVector, G4int nbin); 232 234 233 static G4double RangeIntLin(G4PhysicsVector* 235 static G4double RangeIntLin(G4PhysicsVector* physicsVector, G4int nbin); 234 236 235 static G4double RangeIntLog(G4PhysicsVector* 237 static G4double RangeIntLog(G4PhysicsVector* physicsVector, G4int nbin); 236 238 237 static void BuildRangeCoeffATable( const G4P 239 static void BuildRangeCoeffATable( const G4ParticleDefinition& aParticleType); 238 static void BuildRangeCoeffBTable( const G4P 240 static void BuildRangeCoeffBTable( const G4ParticleDefinition& aParticleType); 239 static void BuildRangeCoeffCTable(const G4Pa 241 static void BuildRangeCoeffCTable(const G4ParticleDefinition& aParticleType); 240 242 241 // ========================================= 243 // ==================================================================== 242 244 243 static G4ThreadLocal G4PhysicsTable* theDEDX << 245 static G4PhysicsTable* theDEDXTable; 244 246 245 static G4ThreadLocal G4PhysicsTable* theRang << 247 static G4PhysicsTable* theRangeTable; 246 static G4ThreadLocal G4PhysicsTable* theInve << 248 static G4PhysicsTable* theInverseRangeTable; 247 249 248 static G4ThreadLocal G4PhysicsTable* theLabT << 250 static G4PhysicsTable* theLabTimeTable; 249 static G4ThreadLocal G4PhysicsTable* theProp << 251 static G4PhysicsTable* theProperTimeTable; 250 252 251 static G4ThreadLocal G4PhysicsTable** Record << 253 static G4PhysicsTable** RecorderOfProcess; 252 static G4ThreadLocal G4int CounterOfProcess; << 254 static G4int CounterOfProcess; 253 << 255 254 static G4ThreadLocal G4PhysicsTable* thepRan << 256 static G4PhysicsTable* thepRangeCoeffATable; 255 static G4ThreadLocal G4PhysicsTable* thepRan << 257 static G4PhysicsTable* thepRangeCoeffBTable; 256 static G4ThreadLocal G4PhysicsTable* thepRan << 258 static G4PhysicsTable* thepRangeCoeffCTable; 257 static G4ThreadLocal G4PhysicsTable* thepbar << 259 static G4PhysicsTable* thepbarRangeCoeffATable; 258 static G4ThreadLocal G4PhysicsTable* thepbar << 260 static G4PhysicsTable* thepbarRangeCoeffBTable; 259 static G4ThreadLocal G4PhysicsTable* thepbar << 261 static G4PhysicsTable* thepbarRangeCoeffCTable; 260 << 262 261 static G4ThreadLocal G4PhysicsTable* theRang << 263 static G4PhysicsTable* theRangeCoeffATable; 262 static G4ThreadLocal G4PhysicsTable* theRang << 264 static G4PhysicsTable* theRangeCoeffBTable; 263 static G4ThreadLocal G4PhysicsTable* theRang << 265 static G4PhysicsTable* theRangeCoeffCTable; 264 static G4ThreadLocal G4int NumberOfProcesses << 266 static G4int NumberOfProcesses ; 265 267 266 }; 268 }; 267 269 268 #endif 270 #endif >> 271 >> 272 >> 273 269 274