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 // $Id: G4LossTableManager.hh 99151 2016-09-07 08:03:17Z gcosmo $ >> 27 // >> 28 // 26 // ------------------------------------------- 29 // ------------------------------------------------------------------- 27 // 30 // 28 // GEANT4 Class header file 31 // GEANT4 Class header file 29 // 32 // 30 // 33 // 31 // File name: G4LossTableManager 34 // File name: G4LossTableManager 32 // 35 // 33 // Author: Vladimir Ivanchenko on base 36 // Author: Vladimir Ivanchenko on base of G4LossTables class 34 // and Maria Grazia Pia ideas 37 // and Maria Grazia Pia ideas 35 // 38 // 36 // Creation date: 03.01.2002 39 // Creation date: 03.01.2002 37 // 40 // 38 // Modifications by V.Ivanchenko << 41 // Modifications: >> 42 // >> 43 // 20-01-03 Migrade to cut per region (V.Ivanchenko) >> 44 // 17-02-03 Fix problem of store/restore tables for ions (V.Ivanchenko) >> 45 // 10-03-03 Add Ion registration (V.Ivanchenko) >> 46 // 25-03-03 Add deregistration (V.Ivanchenko) >> 47 // 26-03-03 Add GetDEDXDispersion (V.Ivanchenko) >> 48 // 02-04-03 Change messenger (V.Ivanchenko) >> 49 // 23-07-03 Add exchange with G4EnergyLossTables (V.Ivanchenko) >> 50 // 05-10-03 Add G4VEmProcesses registration (V.Ivanchenko) >> 51 // 17-10-03 Add SetParameters method (V.Ivanchenko) >> 52 // 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko) >> 53 // 14-01-04 Activate precise range calculation (V.Ivanchenko) >> 54 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko) >> 55 // 10-01-06 PreciseRange -> CSDARange (V.Ivantchenko) >> 56 // 20-01-06 Introduce GetSubDEDX method (VI) >> 57 // 26-01-06 Rename GetRange -> GetRangeFromRestricteDEDX (V.Ivanchenko) >> 58 // 10-05-06 Add methods SetMscStepLimitation, FacRange and MscFlag (VI) >> 59 // 22-05-06 Add methods Set/Get bremsTh (VI) >> 60 // 12-02-07 Add SetSkin, SetLinearLossLimit (V.Ivanchenko) >> 61 // 18-06-07 Move definition of msc parameters to G4EmProcessOptions (V.Ivanchenko) >> 62 // 12-04-10 Added PreparePhsyicsTables and BuildPhysicsTables entries (V.Ivanchenko) >> 63 // 04-06-13 Adaptation for MT mode, new method LocalPhysicsTables (V.Ivanchenko) 39 // 64 // 40 // Class Description: 65 // Class Description: 41 // 66 // 42 // A utility static class, responsable for the 67 // A utility static class, responsable for the energy loss tables 43 // for each particle 68 // for each particle 44 // 69 // 45 // Energy loss processes have to register thei 70 // Energy loss processes have to register their tables with this 46 // class. The responsibility of creating and d 71 // class. The responsibility of creating and deleting the tables 47 // remains with the energy loss classes. 72 // remains with the energy loss classes. 48 73 49 // ------------------------------------------- 74 // ------------------------------------------------------------------- 50 // 75 // 51 76 52 #ifndef G4LossTableManager_h 77 #ifndef G4LossTableManager_h 53 #define G4LossTableManager_h 1 78 #define G4LossTableManager_h 1 54 79 55 #include <map> 80 #include <map> 56 #include <vector> 81 #include <vector> 57 #include "globals.hh" 82 #include "globals.hh" 58 #include "G4ThreadLocalSingleton.hh" 83 #include "G4ThreadLocalSingleton.hh" 59 #include "G4VEnergyLossProcess.hh" 84 #include "G4VEnergyLossProcess.hh" 60 #include "G4EmParameters.hh" << 85 #include "G4EmCorrections.hh" >> 86 #include "G4LossTableBuilder.hh" >> 87 #include "G4VAtomDeexcitation.hh" >> 88 #include "G4VSubCutProducer.hh" 61 89 62 class G4PhysicsTable; 90 class G4PhysicsTable; 63 class G4MaterialCutsCouple; 91 class G4MaterialCutsCouple; 64 class G4ParticleDefinition; 92 class G4ParticleDefinition; 65 class G4Region; 93 class G4Region; 66 class G4EmSaturation; 94 class G4EmSaturation; 67 class G4EmConfigurator; 95 class G4EmConfigurator; 68 class G4ElectronIonPair; 96 class G4ElectronIonPair; 69 class G4NIELCalculator; << 70 class G4VMultipleScattering; 97 class G4VMultipleScattering; 71 class G4VEmProcess; 98 class G4VEmProcess; 72 class G4EmCorrections; << 73 class G4LossTableBuilder; << 74 class G4VAtomDeexcitation; << 75 class G4VSubCutProducer; << 76 99 77 class G4LossTableManager 100 class G4LossTableManager 78 { 101 { 79 102 80 friend class G4ThreadLocalSingleton<G4LossTabl 103 friend class G4ThreadLocalSingleton<G4LossTableManager>; 81 104 82 public: 105 public: 83 106 84 static G4LossTableManager* Instance(); 107 static G4LossTableManager* Instance(); 85 108 86 ~G4LossTableManager(); 109 ~G4LossTableManager(); 87 110 88 //------------------------------------------ 111 //------------------------------------------------- >> 112 // called from destructor >> 113 //------------------------------------------------- >> 114 >> 115 void Clear(); >> 116 >> 117 //------------------------------------------------- 89 // initialisation before a new run 118 // initialisation before a new run 90 //------------------------------------------ 119 //------------------------------------------------- 91 120 92 void PreparePhysicsTable(const G4ParticleDef 121 void PreparePhysicsTable(const G4ParticleDefinition* aParticle, 93 G4VEnergyLossProces << 122 G4VEnergyLossProcess* p, G4bool theMaster); 94 123 95 void PreparePhysicsTable(const G4ParticleDef 124 void PreparePhysicsTable(const G4ParticleDefinition* aParticle, 96 G4VEmProcess* p); << 125 G4VEmProcess* p, G4bool theMaster); 97 126 98 void PreparePhysicsTable(const G4ParticleDef 127 void PreparePhysicsTable(const G4ParticleDefinition* aParticle, 99 G4VMultipleScatteri << 128 G4VMultipleScattering* p, G4bool theMaster); 100 129 101 void BuildPhysicsTable(const G4ParticleDefin 130 void BuildPhysicsTable(const G4ParticleDefinition* aParticle); 102 131 103 void BuildPhysicsTable(const G4ParticleDefin 132 void BuildPhysicsTable(const G4ParticleDefinition* aParticle, 104 G4VEnergyLossProcess* 133 G4VEnergyLossProcess* p); 105 134 106 void LocalPhysicsTables(const G4ParticleDefi 135 void LocalPhysicsTables(const G4ParticleDefinition* aParticle, 107 G4VEnergyLossProcess 136 G4VEnergyLossProcess* p); 108 << 137 109 void DumpHtml(); << 110 << 111 //------------------------------------------ 138 //------------------------------------------------- 112 // Run time access to DEDX, range, energy fo 139 // Run time access to DEDX, range, energy for a given particle, 113 // energy, and G4MaterialCutsCouple 140 // energy, and G4MaterialCutsCouple 114 //------------------------------------------ 141 //------------------------------------------------- 115 142 116 inline G4double GetDEDX( 143 inline G4double GetDEDX( 117 const G4ParticleDefinition *aParticle, 144 const G4ParticleDefinition *aParticle, 118 G4double kineticEnergy, 145 G4double kineticEnergy, 119 const G4MaterialCutsCouple *couple); 146 const G4MaterialCutsCouple *couple); 120 147 >> 148 inline G4double GetSubDEDX( >> 149 const G4ParticleDefinition *aParticle, >> 150 G4double kineticEnergy, >> 151 const G4MaterialCutsCouple *couple); >> 152 121 inline G4double GetRange( 153 inline G4double GetRange( 122 const G4ParticleDefinition *aParticle, 154 const G4ParticleDefinition *aParticle, 123 G4double kineticEnergy, 155 G4double kineticEnergy, 124 const G4MaterialCutsCouple *couple); 156 const G4MaterialCutsCouple *couple); 125 157 126 inline G4double GetCSDARange( 158 inline G4double GetCSDARange( 127 const G4ParticleDefinition *aParticle, 159 const G4ParticleDefinition *aParticle, 128 G4double kineticEnergy, 160 G4double kineticEnergy, 129 const G4MaterialCutsCouple *couple); 161 const G4MaterialCutsCouple *couple); 130 162 131 inline G4double GetRangeFromRestricteDEDX( 163 inline G4double GetRangeFromRestricteDEDX( 132 const G4ParticleDefinition *aParticle, 164 const G4ParticleDefinition *aParticle, 133 G4double kineticEnergy, 165 G4double kineticEnergy, 134 const G4MaterialCutsCouple *couple); 166 const G4MaterialCutsCouple *couple); 135 167 136 inline G4double GetEnergy( 168 inline G4double GetEnergy( 137 const G4ParticleDefinition *aParticle, 169 const G4ParticleDefinition *aParticle, 138 G4double range, 170 G4double range, 139 const G4MaterialCutsCouple *couple); 171 const G4MaterialCutsCouple *couple); 140 172 141 inline G4double GetDEDXDispersion( 173 inline G4double GetDEDXDispersion( 142 const G4MaterialCutsCouple *couple, 174 const G4MaterialCutsCouple *couple, 143 const G4DynamicParticle* dp, 175 const G4DynamicParticle* dp, 144 G4double& length); 176 G4double& length); 145 177 146 //------------------------------------------ 178 //------------------------------------------------- 147 // Methods to be called only at initialisati 179 // Methods to be called only at initialisation 148 // and at the end of the job << 149 //------------------------------------------ 180 //------------------------------------------------- 150 181 151 void Register(G4VEnergyLossProcess* p); 182 void Register(G4VEnergyLossProcess* p); 152 183 153 void DeRegister(G4VEnergyLossProcess* p); 184 void DeRegister(G4VEnergyLossProcess* p); 154 185 155 void Register(G4VMultipleScattering* p); 186 void Register(G4VMultipleScattering* p); 156 187 157 void DeRegister(G4VMultipleScattering* p); 188 void DeRegister(G4VMultipleScattering* p); 158 189 159 void Register(G4VEmProcess* p); 190 void Register(G4VEmProcess* p); 160 191 161 void DeRegister(G4VEmProcess* p); 192 void DeRegister(G4VEmProcess* p); 162 193 163 void Register(G4VProcess* p); << 164 << 165 void DeRegister(G4VProcess* p); << 166 << 167 void Register(G4VEmModel* p); 194 void Register(G4VEmModel* p); 168 195 169 void DeRegister(G4VEmModel* p); 196 void DeRegister(G4VEmModel* p); 170 197 171 void Register(G4VEmFluctuationModel* p); 198 void Register(G4VEmFluctuationModel* p); 172 199 173 void DeRegister(G4VEmFluctuationModel* p); 200 void DeRegister(G4VEmFluctuationModel* p); 174 201 175 void RegisterExtraParticle(const G4ParticleD 202 void RegisterExtraParticle(const G4ParticleDefinition* aParticle, 176 G4VEnergyLossProc 203 G4VEnergyLossProcess* p); 177 204 178 void SetVerbose(G4int val); 205 void SetVerbose(G4int val); 179 206 180 void ResetParameters(); << 181 << 182 void SetAtomDeexcitation(G4VAtomDeexcitation 207 void SetAtomDeexcitation(G4VAtomDeexcitation*); 183 208 184 void SetSubCutProducer(G4VSubCutProducer*); 209 void SetSubCutProducer(G4VSubCutProducer*); 185 210 186 void SetNIELCalculator(G4NIELCalculator*); << 187 << 188 //------------------------------------------ 211 //------------------------------------------------- 189 // Access methods 212 // Access methods 190 //------------------------------------------ 213 //------------------------------------------------- 191 214 192 inline G4bool IsMaster() const; 215 inline G4bool IsMaster() const; 193 216 >> 217 inline 194 G4VEnergyLossProcess* GetEnergyLossProcess(c 218 G4VEnergyLossProcess* GetEnergyLossProcess(const G4ParticleDefinition*); 195 219 196 const std::vector<G4VEnergyLossProcess*>& Ge 220 const std::vector<G4VEnergyLossProcess*>& GetEnergyLossProcessVector(); 197 221 198 const std::vector<G4VEmProcess*>& GetEmProce 222 const std::vector<G4VEmProcess*>& GetEmProcessVector(); 199 223 200 const std::vector<G4VMultipleScattering*>& G 224 const std::vector<G4VMultipleScattering*>& GetMultipleScatteringVector(); 201 225 202 G4EmSaturation* EmSaturation(); 226 G4EmSaturation* EmSaturation(); 203 227 204 G4EmConfigurator* EmConfigurator(); 228 G4EmConfigurator* EmConfigurator(); 205 229 206 G4ElectronIonPair* ElectronIonPair(); 230 G4ElectronIonPair* ElectronIonPair(); 207 231 208 G4NIELCalculator* NIELCalculator(); << 209 << 210 inline G4EmCorrections* EmCorrections(); 232 inline G4EmCorrections* EmCorrections(); 211 233 212 inline G4VAtomDeexcitation* AtomDeexcitation 234 inline G4VAtomDeexcitation* AtomDeexcitation(); 213 235 214 inline G4VSubCutProducer* SubCutProducer(); 236 inline G4VSubCutProducer* SubCutProducer(); 215 237 216 inline G4LossTableBuilder* GetTableBuilder() 238 inline G4LossTableBuilder* GetTableBuilder(); 217 239 218 inline void SetGammaGeneralProcess(G4VEmProc << 219 << 220 inline G4VEmProcess* GetGammaGeneralProcess( << 221 << 222 inline void SetElectronGeneralProcess(G4VEmP << 223 << 224 inline G4VEmProcess* GetElectronGeneralProce << 225 << 226 inline void SetPositronGeneralProcess(G4VEmP << 227 << 228 inline G4VEmProcess* GetPositronGeneralProce << 229 << 230 G4LossTableManager(G4LossTableManager &) = d << 231 G4LossTableManager & operator=(const G4LossT << 232 << 233 private: 240 private: 234 241 235 //------------------------------------------ 242 //------------------------------------------------- 236 // Private methods and members 243 // Private methods and members 237 //------------------------------------------ 244 //------------------------------------------------- 238 245 239 G4LossTableManager(); 246 G4LossTableManager(); 240 247 241 void Clear(); << 248 void ResetParameters(); 242 249 243 G4VEnergyLossProcess* BuildTables(const G4Pa 250 G4VEnergyLossProcess* BuildTables(const G4ParticleDefinition* aParticle); 244 251 245 void CopyTables(const G4ParticleDefinition* 252 void CopyTables(const G4ParticleDefinition* aParticle, 246 G4VEnergyLossProcess*); 253 G4VEnergyLossProcess*); 247 254 248 void ParticleHaveNoLoss(const G4ParticleDefi 255 void ParticleHaveNoLoss(const G4ParticleDefinition* aParticle); 249 256 250 void CopyDEDXTables(); 257 void CopyDEDXTables(); 251 258 252 void PrintEWarning(G4String, G4double); 259 void PrintEWarning(G4String, G4double); 253 260 >> 261 G4LossTableManager(G4LossTableManager &) = delete; >> 262 G4LossTableManager & operator=(const G4LossTableManager &right) = delete; >> 263 254 static G4ThreadLocal G4LossTableManager* ins 264 static G4ThreadLocal G4LossTableManager* instance; 255 265 256 typedef const G4ParticleDefinition* PD; 266 typedef const G4ParticleDefinition* PD; 257 267 258 // cache << 268 std::map<PD,G4VEnergyLossProcess*,std::less<PD> > loss_map; 259 G4VEnergyLossProcess* currentLoss{nullptr}; << 260 PD currentParticle{nullptr}; << 261 PD theElectron; << 262 PD theGenericIon{nullptr}; << 263 PD firstParticle{nullptr}; << 264 << 265 G4LossTableBuilder* tableBuilder; << 266 G4EmCorrections* emCorrections; << 267 G4EmConfigurator* emConfigurator{nullptr}; << 268 G4ElectronIonPair* emElectronIonPair{nullptr << 269 G4NIELCalculator* nielCalculator{nullptr}; << 270 G4VAtomDeexcitation* atomDeexcitation{nullpt << 271 G4VSubCutProducer* subcutProducer{nullptr}; << 272 << 273 G4EmParameters* theParameters; << 274 G4VEmProcess* gGeneral{nullptr}; << 275 G4VEmProcess* eGeneral{nullptr}; << 276 G4VEmProcess* pGeneral{nullptr}; << 277 << 278 G4int verbose; << 279 G4int n_loss{0}; << 280 G4int run{-1}; << 281 << 282 G4bool all_tables_are_built{false}; << 283 G4bool startInitialisation{false}; << 284 G4bool resetParam{true}; << 285 G4bool isMaster{false}; << 286 269 287 std::vector<G4VEnergyLossProcess*> loss_vect 270 std::vector<G4VEnergyLossProcess*> loss_vector; 288 std::vector<PD> part_vector; 271 std::vector<PD> part_vector; 289 std::vector<PD> base_part_vector; 272 std::vector<PD> base_part_vector; >> 273 std::vector<G4bool> tables_are_built; >> 274 std::vector<G4bool> isActive; 290 std::vector<G4PhysicsTable*> dedx_vector; 275 std::vector<G4PhysicsTable*> dedx_vector; 291 std::vector<G4PhysicsTable*> range_vector; 276 std::vector<G4PhysicsTable*> range_vector; 292 std::vector<G4PhysicsTable*> inv_range_vecto 277 std::vector<G4PhysicsTable*> inv_range_vector; 293 std::vector<G4bool> tables_are_built; << 294 std::vector<G4bool> isActive; << 295 std::vector<G4VMultipleScattering*> msc_vect 278 std::vector<G4VMultipleScattering*> msc_vector; 296 std::vector<G4VEmProcess*> emp_vector; 279 std::vector<G4VEmProcess*> emp_vector; 297 std::vector<G4VEmModel*> mod_vector; 280 std::vector<G4VEmModel*> mod_vector; 298 std::vector<G4VEmFluctuationModel*> fmod_vec 281 std::vector<G4VEmFluctuationModel*> fmod_vector; 299 std::vector<G4VProcess*> p_vector; << 300 282 301 std::map<PD,G4VEnergyLossProcess*,std::less< << 283 // cache >> 284 G4VEnergyLossProcess* currentLoss; >> 285 PD currentParticle; >> 286 PD theElectron; >> 287 PD theGenericIon; >> 288 PD firstParticle; >> 289 >> 290 G4int n_loss; >> 291 G4int run; >> 292 >> 293 G4bool all_tables_are_built; >> 294 G4bool startInitialisation; >> 295 G4bool isMaster; >> 296 G4LossTableBuilder* tableBuilder; >> 297 G4EmCorrections* emCorrections; >> 298 G4EmConfigurator* emConfigurator; >> 299 G4ElectronIonPair* emElectronIonPair; >> 300 G4VAtomDeexcitation* atomDeexcitation; >> 301 G4VSubCutProducer* subcutProducer; >> 302 >> 303 G4EmParameters* theParameters; >> 304 >> 305 G4int verbose; >> 306 302 }; 307 }; 303 308 304 //....oooOO0OOooo........oooOO0OOooo........oo 309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 305 //....oooOO0OOooo........oooOO0OOooo........oo 310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 306 311 >> 312 inline G4VEnergyLossProcess* >> 313 G4LossTableManager::GetEnergyLossProcess(const G4ParticleDefinition *aParticle) >> 314 { >> 315 //G4cout << "G4LossTableManager::GetEnergyLossProcess: " >> 316 //<< aParticle << " " << currentParticle << " " << currentLoss << G4endl; >> 317 if(aParticle != currentParticle) { >> 318 currentParticle = aParticle; >> 319 std::map<PD,G4VEnergyLossProcess*,std::less<PD> >::const_iterator pos; >> 320 if ((pos = loss_map.find(aParticle)) != loss_map.end()) { >> 321 currentLoss = (*pos).second; >> 322 } else { >> 323 currentLoss = 0; >> 324 if ((pos = loss_map.find(theGenericIon)) != loss_map.end()) { >> 325 currentLoss = (*pos).second; >> 326 } >> 327 } >> 328 } >> 329 return currentLoss; >> 330 } >> 331 >> 332 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 333 307 inline 334 inline 308 G4double G4LossTableManager::GetDEDX(const G4P 335 G4double G4LossTableManager::GetDEDX(const G4ParticleDefinition *aParticle, 309 G4double 336 G4double kineticEnergy, 310 const G4M 337 const G4MaterialCutsCouple *couple) 311 { 338 { 312 if(aParticle != currentParticle) { GetEnergy 339 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 313 return currentLoss ? currentLoss->GetDEDX(ki << 340 G4double x = 0.0; >> 341 if(currentLoss) { x = currentLoss->GetDEDX(kineticEnergy, couple); } >> 342 return x; >> 343 } >> 344 >> 345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... >> 346 >> 347 inline >> 348 G4double G4LossTableManager::GetSubDEDX(const G4ParticleDefinition *aParticle, >> 349 G4double kineticEnergy, >> 350 const G4MaterialCutsCouple *couple) >> 351 { >> 352 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } >> 353 G4double x = 0.0; >> 354 if(currentLoss) { x = currentLoss->GetDEDXForSubsec(kineticEnergy, couple); } >> 355 return x; 314 } 356 } 315 357 316 //....oooOO0OOooo........oooOO0OOooo........oo 358 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 317 359 318 inline 360 inline 319 G4double G4LossTableManager::GetCSDARange(cons 361 G4double G4LossTableManager::GetCSDARange(const G4ParticleDefinition *aParticle, 320 G4do 362 G4double kineticEnergy, 321 cons 363 const G4MaterialCutsCouple *couple) 322 { 364 { 323 if(aParticle != currentParticle) { GetEnergy 365 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 324 return currentLoss ? currentLoss->GetCSDARan << 366 G4double x = DBL_MAX; >> 367 if(currentLoss) { x = currentLoss->GetCSDARange(kineticEnergy, couple); } >> 368 return x; 325 } 369 } 326 370 327 //....oooOO0OOooo........oooOO0OOooo........oo 371 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 328 372 329 inline 373 inline 330 G4double G4LossTableManager::GetRangeFromRestr 374 G4double G4LossTableManager::GetRangeFromRestricteDEDX( 331 const G4ParticleD 375 const G4ParticleDefinition *aParticle, 332 G4double kineticE 376 G4double kineticEnergy, 333 const G4MaterialC 377 const G4MaterialCutsCouple *couple) 334 { 378 { 335 if(aParticle != currentParticle) { GetEnergy 379 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 336 return currentLoss ? currentLoss->GetRange(k << 380 G4double x = DBL_MAX; >> 381 if(currentLoss) { x = currentLoss->GetRangeForLoss(kineticEnergy, couple); } >> 382 return x; 337 } 383 } 338 384 339 //....oooOO0OOooo........oooOO0OOooo........oo 385 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 340 386 341 inline 387 inline 342 G4double G4LossTableManager::GetRange(const G4 388 G4double G4LossTableManager::GetRange(const G4ParticleDefinition *aParticle, 343 G4double 389 G4double kineticEnergy, 344 const G4 390 const G4MaterialCutsCouple *couple) 345 { 391 { 346 if(aParticle != currentParticle) { GetEnergy 392 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 347 return currentLoss ? currentLoss->GetRange(k << 393 G4double x = DBL_MAX; >> 394 if(currentLoss) { >> 395 x = currentLoss->GetRange(kineticEnergy, couple); >> 396 } >> 397 return x; 348 } 398 } 349 399 350 //....oooOO0OOooo........oooOO0OOooo........oo 400 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 351 401 352 inline 402 inline 353 G4double G4LossTableManager::GetEnergy(const G 403 G4double G4LossTableManager::GetEnergy(const G4ParticleDefinition *aParticle, 354 G4doubl 404 G4double range, 355 const G 405 const G4MaterialCutsCouple *couple) 356 { 406 { 357 if(aParticle != currentParticle) { GetEnergy 407 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 358 return currentLoss ? currentLoss->GetKinetic << 408 G4double x = 0; >> 409 if(currentLoss) { x = currentLoss->GetKineticEnergy(range, couple); } >> 410 return x; 359 } 411 } 360 412 361 //....oooOO0OOooo........oooOO0OOooo........oo 413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 362 414 363 inline 415 inline 364 G4double G4LossTableManager::GetDEDXDispersion 416 G4double G4LossTableManager::GetDEDXDispersion( 365 const G4MaterialC 417 const G4MaterialCutsCouple *couple, 366 const G4DynamicPa 418 const G4DynamicParticle* dp, 367 G4double& length) 419 G4double& length) 368 { 420 { 369 const G4ParticleDefinition* aParticle = dp-> 421 const G4ParticleDefinition* aParticle = dp->GetParticleDefinition(); 370 if(aParticle != currentParticle) { GetEnergy 422 if(aParticle != currentParticle) { GetEnergyLossProcess(aParticle); } 371 return currentLoss ? currentLoss->GetDEDXDis << 423 G4double x = 0.0; >> 424 if(currentLoss) { currentLoss->GetDEDXDispersion(couple, dp, length); } >> 425 return x; 372 } 426 } 373 427 374 //....oooOO0OOooo........oooOO0OOooo........oo 428 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 375 429 376 inline G4bool G4LossTableManager::IsMaster() c 430 inline G4bool G4LossTableManager::IsMaster() const 377 { 431 { 378 return isMaster; 432 return isMaster; 379 } 433 } 380 434 381 //....oooOO0OOooo........oooOO0OOooo........oo 435 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 382 436 383 inline G4EmCorrections* G4LossTableManager::Em 437 inline G4EmCorrections* G4LossTableManager::EmCorrections() 384 { 438 { 385 return emCorrections; 439 return emCorrections; 386 } 440 } 387 441 388 //....oooOO0OOooo........oooOO0OOooo........oo 442 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 389 443 390 inline G4VAtomDeexcitation* G4LossTableManager 444 inline G4VAtomDeexcitation* G4LossTableManager::AtomDeexcitation() 391 { 445 { 392 return atomDeexcitation; 446 return atomDeexcitation; 393 } 447 } 394 448 395 //....oooOO0OOooo........oooOO0OOooo........oo 449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 396 450 397 inline G4VSubCutProducer* G4LossTableManager:: 451 inline G4VSubCutProducer* G4LossTableManager::SubCutProducer() 398 { 452 { 399 return subcutProducer; 453 return subcutProducer; 400 } 454 } 401 455 402 //....oooOO0OOooo........oooOO0OOooo........oo 456 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 403 457 404 inline G4LossTableBuilder* G4LossTableManager: 458 inline G4LossTableBuilder* G4LossTableManager::GetTableBuilder() 405 { 459 { 406 return tableBuilder; 460 return tableBuilder; 407 } 461 } 408 462 409 //....oooOO0OOooo........oooOO0OOooo........oo << 410 << 411 inline void G4LossTableManager::SetGammaGenera << 412 { << 413 gGeneral = ptr; << 414 } << 415 << 416 //....oooOO0OOooo........oooOO0OOooo........oo << 417 << 418 inline G4VEmProcess* G4LossTableManager::GetGa << 419 { << 420 return gGeneral; << 421 } << 422 << 423 //....oooOO0OOooo........oooOO0OOooo........oo << 424 << 425 inline void G4LossTableManager::SetElectronGen << 426 { << 427 eGeneral = ptr; << 428 } << 429 << 430 //....oooOO0OOooo........oooOO0OOooo........oo << 431 << 432 inline G4VEmProcess* G4LossTableManager::GetEl << 433 { << 434 return eGeneral; << 435 } << 436 << 437 //....oooOO0OOooo........oooOO0OOooo........oo << 438 << 439 inline void G4LossTableManager::SetPositronGen << 440 { << 441 pGeneral = ptr; << 442 } << 443 << 444 //....oooOO0OOooo........oooOO0OOooo........oo << 445 << 446 inline G4VEmProcess* G4LossTableManager::GetPo << 447 { << 448 return pGeneral; << 449 } << 450 //....oooOO0OOooo........oooOO0OOooo........oo << 451 << 452 #endif 463 #endif >> 464 453 465