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: G4EmParameters.cc 69320 2013-04-30 15:59:36Z vnivanch $ >> 27 // 26 // ------------------------------------------- 28 // ------------------------------------------------------------------- 27 // 29 // 28 // GEANT4 Class file 30 // GEANT4 Class file 29 // 31 // >> 32 // 30 // File name: G4EmParameters 33 // File name: G4EmParameters 31 // 34 // 32 // Author: Vladimir Ivanchenko 35 // Author: Vladimir Ivanchenko 33 // 36 // 34 // Creation date: 18.05.2013 37 // Creation date: 18.05.2013 35 // 38 // 36 // Modifications: 39 // Modifications: 37 // 40 // >> 41 // >> 42 // 38 // ------------------------------------------- 43 // ------------------------------------------------------------------- 39 // 44 // 40 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 41 //....oooOO0OOooo........oooOO0OOooo........oo 46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 42 47 43 #include "G4EmParameters.hh" 48 #include "G4EmParameters.hh" 44 #include "G4PhysicalConstants.hh" 49 #include "G4PhysicalConstants.hh" 45 #include "G4UnitsTable.hh" 50 #include "G4UnitsTable.hh" 46 #include "G4SystemOfUnits.hh" 51 #include "G4SystemOfUnits.hh" 47 #include "G4VEmProcess.hh" 52 #include "G4VEmProcess.hh" 48 #include "G4VEnergyLossProcess.hh" 53 #include "G4VEnergyLossProcess.hh" 49 #include "G4VAtomDeexcitation.hh" 54 #include "G4VAtomDeexcitation.hh" 50 #include "G4EmExtraParameters.hh" << 51 #include "G4EmLowEParameters.hh" << 52 #include "G4EmParametersMessenger.hh" 55 #include "G4EmParametersMessenger.hh" 53 #include "G4NistManager.hh" 56 #include "G4NistManager.hh" 54 #include "G4RegionStore.hh" 57 #include "G4RegionStore.hh" 55 #include "G4Region.hh" 58 #include "G4Region.hh" 56 #include "G4ApplicationState.hh" 59 #include "G4ApplicationState.hh" 57 #include "G4StateManager.hh" 60 #include "G4StateManager.hh" 58 #include "G4Threading.hh" << 59 #include "G4AutoLock.hh" << 60 61 61 G4EmParameters* G4EmParameters::theInstance = 62 G4EmParameters* G4EmParameters::theInstance = nullptr; 62 63 63 namespace << 64 #ifdef G4MULTITHREADED 64 { << 65 G4Mutex G4EmParameters::emParametersMutex = G4MUTEX_INITIALIZER; 65 G4Mutex emParametersMutex = G4MUTEX_INITIALI << 66 #endif 66 } << 67 67 68 //....oooOO0OOooo........oooOO0OOooo........oo 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 69 69 70 G4EmParameters* G4EmParameters::Instance() 70 G4EmParameters* G4EmParameters::Instance() 71 { 71 { 72 if(nullptr == theInstance) { 72 if(nullptr == theInstance) { 73 G4AutoLock l(&emParametersMutex); << 73 #ifdef G4MULTITHREADED >> 74 G4MUTEXLOCK(&emParametersMutex); 74 if(nullptr == theInstance) { 75 if(nullptr == theInstance) { >> 76 #endif 75 static G4EmParameters manager; 77 static G4EmParameters manager; 76 theInstance = &manager; 78 theInstance = &manager; >> 79 #ifdef G4MULTITHREADED 77 } 80 } 78 l.unlock(); << 81 G4MUTEXUNLOCK(&G4EmParameters::emParametersMutex); >> 82 #endif 79 } 83 } 80 return theInstance; 84 return theInstance; 81 } 85 } 82 86 83 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 84 88 85 G4EmParameters::~G4EmParameters() 89 G4EmParameters::~G4EmParameters() 86 { 90 { 87 delete theMessenger; 91 delete theMessenger; 88 delete fBParameters; << 89 delete fCParameters; << 90 delete emSaturation; 92 delete emSaturation; 91 } 93 } 92 94 93 //....oooOO0OOooo........oooOO0OOooo........oo 95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 94 96 95 G4EmParameters::G4EmParameters() 97 G4EmParameters::G4EmParameters() 96 { 98 { 97 G4NistManager::Instance(); 99 G4NistManager::Instance(); 98 theMessenger = new G4EmParametersMessenger(t 100 theMessenger = new G4EmParametersMessenger(this); 99 Initialise(); << 100 << 101 fBParameters = new G4EmExtraParameters(); << 102 fCParameters = new G4EmLowEParameters(); << 103 101 104 fStateManager = G4StateManager::GetStateMana 102 fStateManager = G4StateManager::GetStateManager(); >> 103 Initialise(); 105 emSaturation = nullptr; 104 emSaturation = nullptr; 106 } 105 } 107 106 108 void G4EmParameters::SetDefaults() 107 void G4EmParameters::SetDefaults() 109 { 108 { 110 if(!IsLocked()) { << 109 if(!IsLocked()) { Initialise(); } 111 Initialise(); << 112 fBParameters->Initialise(); << 113 fCParameters->Initialise(); << 114 } << 115 } 110 } 116 111 117 void G4EmParameters::Initialise() 112 void G4EmParameters::Initialise() 118 { 113 { 119 lossFluctuation = true; 114 lossFluctuation = true; 120 buildCSDARange = false; 115 buildCSDARange = false; 121 flagLPM = true; 116 flagLPM = true; >> 117 spline = true; 122 cutAsFinalRange = false; 118 cutAsFinalRange = false; 123 applyCuts = false; 119 applyCuts = false; >> 120 fluo = false; >> 121 beardenFluoDir = false; >> 122 auger = false; >> 123 augerCascade = false; >> 124 pixe = false; >> 125 deexIgnoreCut = false; 124 lateralDisplacement = true; 126 lateralDisplacement = true; 125 lateralDisplacementAlg96 = true; 127 lateralDisplacementAlg96 = true; 126 muhadLateralDisplacement = false; 128 muhadLateralDisplacement = false; >> 129 latDisplacementBeyondSafety = false; 127 useAngGeneratorForIonisation = false; 130 useAngGeneratorForIonisation = false; 128 useMottCorrection = false; 131 useMottCorrection = false; 129 integral = true; 132 integral = true; 130 birks = false; 133 birks = false; 131 fICRU90 = false; << 134 dnaFast = false; 132 gener = false; << 135 dnaStationary = false; 133 onIsolated = false; << 136 dnaMsc = false; 134 fSamplingTable = false; << 137 gammaShark = false; 135 fPolarisation = false; << 136 fMuDataFromFile = false; << 137 fPEKShell = true; << 138 fMscPosiCorr = true; << 139 fUseEPICS2017XS = false; << 140 f3GammaAnnihilationOnFly = false; << 141 fUseRiGePairProductionModel = false; << 142 fDNA = false; << 143 fIsPrinted = false; << 144 138 >> 139 minSubRange = 1.0; 145 minKinEnergy = 0.1*CLHEP::keV; 140 minKinEnergy = 0.1*CLHEP::keV; 146 maxKinEnergy = 100.0*CLHEP::TeV; 141 maxKinEnergy = 100.0*CLHEP::TeV; 147 maxKinEnergyCSDA = 1.0*CLHEP::GeV; 142 maxKinEnergyCSDA = 1.0*CLHEP::GeV; 148 max5DEnergyForMuPair = 0.0; << 149 lowestElectronEnergy = 1.0*CLHEP::keV; 143 lowestElectronEnergy = 1.0*CLHEP::keV; 150 lowestMuHadEnergy = 1.0*CLHEP::keV; 144 lowestMuHadEnergy = 1.0*CLHEP::keV; 151 lowestTripletEnergy = 1.0*CLHEP::MeV; 145 lowestTripletEnergy = 1.0*CLHEP::MeV; 152 maxNIELEnergy = 0.0; << 153 linLossLimit = 0.01; 146 linLossLimit = 0.01; 154 bremsTh = bremsMuHadTh = maxKinEnergy; << 147 bremsTh = maxKinEnergy; 155 lambdaFactor = 0.8; 148 lambdaFactor = 0.8; 156 factorForAngleLimit = 1.0; 149 factorForAngleLimit = 1.0; 157 thetaLimit = CLHEP::pi; 150 thetaLimit = CLHEP::pi; 158 energyLimit = 100.0*CLHEP::MeV; << 159 rangeFactor = 0.04; 151 rangeFactor = 0.04; 160 rangeFactorMuHad = 0.2; 152 rangeFactorMuHad = 0.2; 161 geomFactor = 2.5; 153 geomFactor = 2.5; 162 skin = 1.0; 154 skin = 1.0; 163 safetyFactor = 0.6; << 155 dRoverRange = 0.2; 164 lambdaLimit = 1.0*CLHEP::mm; << 156 finalRange = CLHEP::mm; >> 157 dRoverRangeMuHad = 0.2; >> 158 finalRangeMuHad = 0.1*CLHEP::mm; 165 factorScreen = 1.0; 159 factorScreen = 1.0; 166 160 >> 161 nbins = 84; 167 nbinsPerDecade = 7; 162 nbinsPerDecade = 7; 168 verbose = 1; 163 verbose = 1; 169 workerVerbose = 0; 164 workerVerbose = 0; 170 nForFreeVector = 2; << 171 tripletConv = 0; << 172 165 173 fTransportationWithMsc = G4TransportationWit << 174 mscStepLimit = fUseSafety; 166 mscStepLimit = fUseSafety; 175 mscStepLimitMuHad = fMinimal; 167 mscStepLimitMuHad = fMinimal; 176 nucFormfactor = fExponentialNF; 168 nucFormfactor = fExponentialNF; 177 fSStype = fWVI; << 169 178 fFluct = fUniversalFluctuation; << 170 namePIXE = "Empirical"; 179 fPositronium = fSimplePositronium; << 171 nameElectronPIXE = "Livermore"; 180 << 181 const char* data_dir = G4FindDataDir("G4LEDA << 182 if (nullptr != data_dir) { << 183 fDirLEDATA = G4String(data_dir); << 184 } << 185 else { << 186 G4Exception("G4EmParameters::Initialise()" << 187 "G4LEDATA data directory was n << 188 } << 189 } 172 } 190 173 191 void G4EmParameters::SetLossFluctuations(G4boo 174 void G4EmParameters::SetLossFluctuations(G4bool val) 192 { 175 { 193 if(IsLocked()) { return; } 176 if(IsLocked()) { return; } 194 lossFluctuation = val; 177 lossFluctuation = val; 195 } 178 } 196 179 197 G4bool G4EmParameters::LossFluctuation() const 180 G4bool G4EmParameters::LossFluctuation() const 198 { 181 { 199 return lossFluctuation; 182 return lossFluctuation; 200 } 183 } 201 184 202 void G4EmParameters::SetBuildCSDARange(G4bool 185 void G4EmParameters::SetBuildCSDARange(G4bool val) 203 { 186 { 204 if(IsLocked()) { return; } 187 if(IsLocked()) { return; } 205 buildCSDARange = val; 188 buildCSDARange = val; 206 } 189 } 207 190 208 G4bool G4EmParameters::BuildCSDARange() const 191 G4bool G4EmParameters::BuildCSDARange() const 209 { 192 { 210 return buildCSDARange; 193 return buildCSDARange; 211 } 194 } 212 195 213 void G4EmParameters::SetLPM(G4bool val) 196 void G4EmParameters::SetLPM(G4bool val) 214 { 197 { 215 if(IsLocked()) { return; } 198 if(IsLocked()) { return; } 216 flagLPM = val; 199 flagLPM = val; 217 } 200 } 218 201 219 G4bool G4EmParameters::LPM() const 202 G4bool G4EmParameters::LPM() const 220 { 203 { 221 return flagLPM; 204 return flagLPM; 222 } 205 } 223 206 >> 207 void G4EmParameters::SetSpline(G4bool val) >> 208 { >> 209 if(IsLocked()) { return; } >> 210 spline = val; >> 211 } >> 212 >> 213 G4bool G4EmParameters::Spline() const >> 214 { >> 215 return spline; >> 216 } >> 217 224 void G4EmParameters::SetUseCutAsFinalRange(G4b 218 void G4EmParameters::SetUseCutAsFinalRange(G4bool val) 225 { 219 { 226 if(IsLocked()) { return; } 220 if(IsLocked()) { return; } 227 cutAsFinalRange = val; 221 cutAsFinalRange = val; 228 } 222 } 229 223 230 G4bool G4EmParameters::UseCutAsFinalRange() co 224 G4bool G4EmParameters::UseCutAsFinalRange() const 231 { 225 { 232 return cutAsFinalRange; 226 return cutAsFinalRange; 233 } 227 } 234 228 235 void G4EmParameters::SetApplyCuts(G4bool val) 229 void G4EmParameters::SetApplyCuts(G4bool val) 236 { 230 { 237 if(IsLocked()) { return; } 231 if(IsLocked()) { return; } 238 applyCuts = val; 232 applyCuts = val; 239 } 233 } 240 234 241 G4bool G4EmParameters::ApplyCuts() const 235 G4bool G4EmParameters::ApplyCuts() const 242 { 236 { 243 return applyCuts; 237 return applyCuts; 244 } 238 } 245 239 246 void G4EmParameters::SetFluo(G4bool val) 240 void G4EmParameters::SetFluo(G4bool val) 247 { 241 { 248 if(IsLocked()) { return; } 242 if(IsLocked()) { return; } 249 fCParameters->SetFluo(val); << 243 fluo = val; 250 } 244 } 251 245 252 G4bool G4EmParameters::Fluo() const 246 G4bool G4EmParameters::Fluo() const 253 { 247 { 254 return fCParameters->Fluo(); << 248 return fluo; 255 } << 256 << 257 G4EmFluoDirectory G4EmParameters::FluoDirector << 258 { << 259 return fCParameters->FluoDirectory(); << 260 } << 261 << 262 void G4EmParameters::SetFluoDirectory(G4EmFluo << 263 { << 264 if(IsLocked()) { return; } << 265 fCParameters->SetFluoDirectory(val); << 266 } 249 } 267 250 268 void G4EmParameters::SetBeardenFluoDir(G4bool 251 void G4EmParameters::SetBeardenFluoDir(G4bool val) 269 { 252 { 270 if(IsLocked()) { return; } 253 if(IsLocked()) { return; } 271 fCParameters->SetBeardenFluoDir(val); << 254 beardenFluoDir = val; 272 } 255 } 273 256 274 void G4EmParameters::SetANSTOFluoDir(G4bool va << 257 G4bool G4EmParameters::BeardenFluoDir() const 275 { 258 { 276 if(IsLocked()) { return; } << 259 return beardenFluoDir; 277 fCParameters->SetANSTOFluoDir(val); << 278 } << 279 << 280 void G4EmParameters::SetXDB_EADLFluoDir(G4bool << 281 { << 282 if(IsLocked()) { return; } << 283 fCParameters->SetXDB_EADLFluoDir(val); << 284 } 260 } 285 261 286 void G4EmParameters::SetAuger(G4bool val) 262 void G4EmParameters::SetAuger(G4bool val) 287 { 263 { 288 if(IsLocked()) { return; } 264 if(IsLocked()) { return; } 289 fCParameters->SetAuger(val); << 265 auger = val; >> 266 if(val) { fluo = true; } 290 } 267 } 291 268 292 G4bool G4EmParameters::BeardenFluoDir() << 269 G4bool G4EmParameters::Auger() const 293 { 270 { 294 auto dir = fCParameters->FluoDirectory(); << 271 return auger; 295 return (dir == fluoBearden); << 296 } 272 } 297 273 298 G4bool G4EmParameters::ANSTOFluoDir() << 274 void G4EmParameters::SetAugerCascade(G4bool val) 299 { 275 { 300 auto dir = fCParameters->FluoDirectory(); << 276 if(IsLocked()) { return; } 301 return (dir == fluoANSTO); << 277 augerCascade = val; >> 278 if(val) { fluo = true; auger = true; } 302 } 279 } 303 280 304 G4bool G4EmParameters::Auger() const << 281 G4bool G4EmParameters::AugerCascade() const 305 { 282 { 306 return fCParameters->Auger(); << 283 return augerCascade; 307 } 284 } 308 285 309 void G4EmParameters::SetPixe(G4bool val) 286 void G4EmParameters::SetPixe(G4bool val) 310 { 287 { 311 if(IsLocked()) { return; } 288 if(IsLocked()) { return; } 312 fCParameters->SetPixe(val); << 289 pixe = val; >> 290 if(val) { fluo = true; } 313 } 291 } 314 292 315 G4bool G4EmParameters::Pixe() const 293 G4bool G4EmParameters::Pixe() const 316 { 294 { 317 return fCParameters->Pixe(); << 295 return pixe; 318 } 296 } 319 297 320 void G4EmParameters::SetDeexcitationIgnoreCut( 298 void G4EmParameters::SetDeexcitationIgnoreCut(G4bool val) 321 { 299 { 322 if(IsLocked()) { return; } 300 if(IsLocked()) { return; } 323 fCParameters->SetDeexcitationIgnoreCut(val); << 301 deexIgnoreCut = val; 324 } 302 } 325 303 326 G4bool G4EmParameters::DeexcitationIgnoreCut() 304 G4bool G4EmParameters::DeexcitationIgnoreCut() const 327 { 305 { 328 return fCParameters->DeexcitationIgnoreCut() << 306 return deexIgnoreCut; 329 } 307 } 330 308 331 void G4EmParameters::SetLateralDisplacement(G4 309 void G4EmParameters::SetLateralDisplacement(G4bool val) 332 { 310 { 333 if(IsLocked()) { return; } 311 if(IsLocked()) { return; } 334 lateralDisplacement = val; 312 lateralDisplacement = val; 335 } 313 } 336 314 337 G4bool G4EmParameters::LateralDisplacement() c 315 G4bool G4EmParameters::LateralDisplacement() const 338 { 316 { 339 return lateralDisplacement; 317 return lateralDisplacement; 340 } 318 } 341 319 342 void G4EmParameters::SetLateralDisplacementAlg 320 void G4EmParameters::SetLateralDisplacementAlg96(G4bool val) 343 { 321 { 344 if(IsLocked()) { return; } 322 if(IsLocked()) { return; } 345 lateralDisplacementAlg96 = val; 323 lateralDisplacementAlg96 = val; 346 } 324 } 347 325 348 G4bool G4EmParameters::LateralDisplacementAlg9 326 G4bool G4EmParameters::LateralDisplacementAlg96() const 349 { 327 { 350 return lateralDisplacementAlg96; 328 return lateralDisplacementAlg96; 351 } 329 } 352 330 353 void G4EmParameters::SetMuHadLateralDisplaceme 331 void G4EmParameters::SetMuHadLateralDisplacement(G4bool val) 354 { 332 { 355 if(IsLocked()) { return; } 333 if(IsLocked()) { return; } 356 muhadLateralDisplacement = val; 334 muhadLateralDisplacement = val; 357 } 335 } 358 336 359 G4bool G4EmParameters::MuHadLateralDisplacemen 337 G4bool G4EmParameters::MuHadLateralDisplacement() const 360 { 338 { 361 return muhadLateralDisplacement; 339 return muhadLateralDisplacement; 362 } 340 } 363 341 >> 342 void G4EmParameters::SetLatDisplacementBeyondSafety(G4bool val) >> 343 { >> 344 if(IsLocked()) { return; } >> 345 latDisplacementBeyondSafety = val; >> 346 } >> 347 >> 348 G4bool G4EmParameters::LatDisplacementBeyondSafety() const >> 349 { >> 350 return latDisplacementBeyondSafety; >> 351 } >> 352 364 void G4EmParameters::ActivateAngularGeneratorF 353 void G4EmParameters::ActivateAngularGeneratorForIonisation(G4bool val) 365 { 354 { 366 if(IsLocked()) { return; } 355 if(IsLocked()) { return; } 367 useAngGeneratorForIonisation = val; 356 useAngGeneratorForIonisation = val; 368 } 357 } 369 358 370 G4bool G4EmParameters::UseAngularGeneratorForI 359 G4bool G4EmParameters::UseAngularGeneratorForIonisation() const 371 { 360 { 372 return useAngGeneratorForIonisation; 361 return useAngGeneratorForIonisation; 373 } 362 } 374 363 375 void G4EmParameters::SetUseMottCorrection(G4bo 364 void G4EmParameters::SetUseMottCorrection(G4bool val) 376 { 365 { 377 if(IsLocked()) { return; } 366 if(IsLocked()) { return; } 378 useMottCorrection = val; 367 useMottCorrection = val; 379 } 368 } 380 369 381 G4bool G4EmParameters::UseMottCorrection() con 370 G4bool G4EmParameters::UseMottCorrection() const 382 { 371 { 383 return useMottCorrection; 372 return useMottCorrection; 384 } 373 } 385 374 386 void G4EmParameters::SetIntegral(G4bool val) 375 void G4EmParameters::SetIntegral(G4bool val) 387 { 376 { 388 if(IsLocked()) { return; } 377 if(IsLocked()) { return; } 389 integral = val; 378 integral = val; 390 } 379 } 391 380 392 G4bool G4EmParameters::Integral() const 381 G4bool G4EmParameters::Integral() const 393 { 382 { 394 return integral; 383 return integral; 395 } 384 } 396 385 397 void G4EmParameters::SetEnablePolarisation(G4b << 398 { << 399 if(IsLocked()) { return; } << 400 fPolarisation = val; << 401 } << 402 << 403 G4bool G4EmParameters::EnablePolarisation() co << 404 { << 405 return fPolarisation; << 406 } << 407 << 408 void G4EmParameters::SetBirksActive(G4bool val 386 void G4EmParameters::SetBirksActive(G4bool val) 409 { 387 { 410 if(IsLocked()) { return; } << 411 birks = val; 388 birks = val; 412 if(birks && nullptr == emSaturation) { emSat << 389 #ifdef G4MULTITHREADED >> 390 G4MUTEXLOCK(&G4EmParameters::emParametersMutex); >> 391 #endif >> 392 if(birks) { >> 393 if(!emSaturation) { emSaturation = new G4EmSaturation(1); } >> 394 emSaturation->InitialiseG4Saturation(); >> 395 } >> 396 #ifdef G4MULTITHREADED >> 397 G4MUTEXUNLOCK(&G4EmParameters::emParametersMutex); >> 398 #endif 413 } 399 } 414 400 415 G4bool G4EmParameters::BirksActive() const 401 G4bool G4EmParameters::BirksActive() const 416 { 402 { 417 return birks; 403 return birks; 418 } 404 } 419 405 420 void G4EmParameters::SetUseICRU90Data(G4bool v << 421 { << 422 if(IsLocked()) { return; } << 423 fICRU90 = val; << 424 } << 425 << 426 G4bool G4EmParameters::UseICRU90Data() const << 427 { << 428 return fICRU90; << 429 } << 430 << 431 void G4EmParameters::SetDNAFast(G4bool val) 406 void G4EmParameters::SetDNAFast(G4bool val) 432 { 407 { 433 if(IsLocked()) { return; } 408 if(IsLocked()) { return; } 434 fCParameters->SetDNAFast(val); << 409 dnaFast = val; 435 if(val) { ActivateDNA(); } << 436 } 410 } 437 411 438 G4bool G4EmParameters::DNAFast() const 412 G4bool G4EmParameters::DNAFast() const 439 { 413 { 440 return fCParameters->DNAFast(); << 414 return dnaFast; 441 } 415 } 442 416 443 void G4EmParameters::SetDNAStationary(G4bool v 417 void G4EmParameters::SetDNAStationary(G4bool val) 444 { 418 { 445 if(IsLocked()) { return; } 419 if(IsLocked()) { return; } 446 fCParameters->SetDNAStationary(val); << 420 dnaStationary = val; 447 if(val) { ActivateDNA(); } << 448 } 421 } 449 422 450 G4bool G4EmParameters::DNAStationary() const 423 G4bool G4EmParameters::DNAStationary() const 451 { 424 { 452 return fCParameters->DNAStationary(); << 425 return dnaStationary; 453 } 426 } 454 427 455 void G4EmParameters::SetDNAElectronMsc(G4bool 428 void G4EmParameters::SetDNAElectronMsc(G4bool val) 456 { 429 { 457 if(IsLocked()) { return; } 430 if(IsLocked()) { return; } 458 fCParameters->SetDNAElectronMsc(val); << 431 dnaMsc = val; 459 if(val) { ActivateDNA(); } << 460 } 432 } 461 433 462 G4bool G4EmParameters::DNAElectronMsc() const 434 G4bool G4EmParameters::DNAElectronMsc() const 463 { 435 { 464 return fCParameters->DNAElectronMsc(); << 436 return dnaMsc; 465 } 437 } 466 438 467 void G4EmParameters::SetGeneralProcessActive(G << 439 void G4EmParameters::SetGammaSharkActive(G4bool val) 468 { 440 { 469 if(IsLocked()) { return; } 441 if(IsLocked()) { return; } 470 gener = val; << 442 gammaShark = val; 471 } 443 } 472 444 473 G4bool G4EmParameters::GeneralProcessActive() << 445 G4bool G4EmParameters::GammaSharkActive() const 474 { 446 { 475 return gener; << 447 return gammaShark; 476 } 448 } 477 449 478 void G4EmParameters::SetEmSaturation(G4EmSatur 450 void G4EmParameters::SetEmSaturation(G4EmSaturation* ptr) 479 { 451 { 480 if(IsLocked()) { return; } << 481 birks = (nullptr != ptr); << 482 if(emSaturation != ptr) { 452 if(emSaturation != ptr) { 483 delete emSaturation; 453 delete emSaturation; 484 emSaturation = ptr; 454 emSaturation = ptr; >> 455 SetBirksActive(true); 485 } 456 } 486 } 457 } 487 458 488 G4bool G4EmParameters::RetrieveMuDataFromFile( << 459 G4EmSaturation* G4EmParameters::GetEmSaturation() 489 { << 490 return fMuDataFromFile; << 491 } << 492 << 493 void G4EmParameters::SetRetrieveMuDataFromFile << 494 { << 495 fMuDataFromFile = v; << 496 } << 497 << 498 void G4EmParameters::SetOnIsolated(G4bool val) << 499 { << 500 if(IsLocked()) { return; } << 501 onIsolated = val; << 502 } << 503 << 504 G4bool G4EmParameters::OnIsolated() const << 505 { << 506 return onIsolated; << 507 } << 508 << 509 void G4EmParameters::SetEnableSamplingTable(G4 << 510 { << 511 if(IsLocked()) { return; } << 512 fSamplingTable = val; << 513 } << 514 << 515 G4bool G4EmParameters::EnableSamplingTable() c << 516 { << 517 return fSamplingTable; << 518 } << 519 << 520 G4bool G4EmParameters::PhotoeffectBelowKShell( << 521 { << 522 return fPEKShell; << 523 } << 524 << 525 void G4EmParameters::SetPhotoeffectBelowKShell << 526 { << 527 if(IsLocked()) { return; } << 528 fPEKShell = v; << 529 } << 530 << 531 G4bool G4EmParameters::MscPositronCorrection() << 532 { << 533 return fMscPosiCorr; << 534 } << 535 << 536 void G4EmParameters::SetMscPositronCorrection( << 537 { << 538 if(IsLocked()) { return; } << 539 fMscPosiCorr = v; << 540 } << 541 << 542 G4bool G4EmParameters::UseEPICS2017XS() const << 543 { << 544 return fUseEPICS2017XS; << 545 } << 546 << 547 void G4EmParameters::SetUseEPICS2017XS(G4bool << 548 { << 549 if(IsLocked()) { return; } << 550 fUseEPICS2017XS = v; << 551 } << 552 << 553 G4bool G4EmParameters::Use3GammaAnnihilationOn << 554 { << 555 return f3GammaAnnihilationOnFly; << 556 } << 557 << 558 void G4EmParameters::Set3GammaAnnihilationOnFl << 559 { << 560 if(IsLocked()) { return; } << 561 f3GammaAnnihilationOnFly = v; << 562 } << 563 << 564 G4bool G4EmParameters::UseRiGePairProductionMo << 565 { << 566 return fUseRiGePairProductionModel; << 567 } << 568 << 569 void G4EmParameters::SetUseRiGePairProductionM << 570 { 460 { 571 if (IsLocked()) { return; } << 461 if(!emSaturation) { SetBirksActive(true); } 572 fUseRiGePairProductionModel = v; << 462 return emSaturation; 573 } 463 } 574 464 575 void G4EmParameters::ActivateDNA() << 465 void G4EmParameters::SetMinSubRange(G4double val) 576 { 466 { 577 if(IsLocked()) { return; } 467 if(IsLocked()) { return; } 578 fDNA = true; << 468 if(val > 0.0 && val < 1.0) { 579 } << 469 minSubRange = val; 580 << 470 } else { 581 void G4EmParameters::SetIsPrintedFlag(G4bool v << 471 G4ExceptionDescription ed; 582 { << 472 ed << "Value of MinSubRange is out of range (0 - 1): " << val 583 fIsPrinted = val; << 473 << " is ignored"; 584 } << 474 PrintWarning(ed); 585 << 475 } 586 G4bool G4EmParameters::IsPrintLocked() const << 587 { << 588 return fIsPrinted; << 589 } 476 } 590 477 591 G4EmSaturation* G4EmParameters::GetEmSaturatio << 478 G4double G4EmParameters::MinSubRange() const 592 { 479 { 593 if(nullptr == emSaturation) { << 480 return minSubRange; 594 #ifdef G4MULTITHREADED << 595 G4MUTEXLOCK(&emParametersMutex); << 596 if(nullptr == emSaturation) { << 597 #endif << 598 emSaturation = new G4EmSaturation(1); << 599 #ifdef G4MULTITHREADED << 600 } << 601 G4MUTEXUNLOCK(&emParametersMutex); << 602 #endif << 603 } << 604 birks = true; << 605 return emSaturation; << 606 } 481 } 607 482 608 void G4EmParameters::SetMinEnergy(G4double val 483 void G4EmParameters::SetMinEnergy(G4double val) 609 { 484 { 610 if(IsLocked()) { return; } 485 if(IsLocked()) { return; } 611 if(val > 1.e-3*CLHEP::eV && val < maxKinEner << 486 if(val > 1.e-3*eV && val < maxKinEnergy) { 612 minKinEnergy = val; 487 minKinEnergy = val; >> 488 nbins = nbinsPerDecade*G4lrint(std::log10(maxKinEnergy/minKinEnergy)); 613 } else { 489 } else { 614 G4ExceptionDescription ed; 490 G4ExceptionDescription ed; 615 ed << "Value of MinKinEnergy - is out of r << 491 ed << "Value of MinKinEnergy is out of range: " << val/MeV 616 << " MeV is ignored"; 492 << " MeV is ignored"; 617 PrintWarning(ed); 493 PrintWarning(ed); 618 } 494 } 619 } 495 } 620 496 621 G4double G4EmParameters::MinKinEnergy() const 497 G4double G4EmParameters::MinKinEnergy() const 622 { 498 { 623 return minKinEnergy; 499 return minKinEnergy; 624 } 500 } 625 501 626 void G4EmParameters::SetMaxEnergy(G4double val 502 void G4EmParameters::SetMaxEnergy(G4double val) 627 { 503 { 628 if(IsLocked()) { return; } 504 if(IsLocked()) { return; } 629 if(val > std::max(minKinEnergy,599.9*CLHEP:: << 505 if(val > minKinEnergy && val < 1.e+7*TeV) { 630 maxKinEnergy = val; 506 maxKinEnergy = val; >> 507 nbins = nbinsPerDecade*G4lrint(std::log10(maxKinEnergy/minKinEnergy)); 631 } else { 508 } else { 632 G4ExceptionDescription ed; 509 G4ExceptionDescription ed; 633 ed << "Value of MaxKinEnergy is out of ran 510 ed << "Value of MaxKinEnergy is out of range: " 634 << val/CLHEP::GeV << 511 << val/GeV << " GeV is ignored"; 635 << " GeV is ignored; allowed range 600 << 636 PrintWarning(ed); 512 PrintWarning(ed); 637 } 513 } 638 } 514 } 639 515 640 G4double G4EmParameters::MaxKinEnergy() const 516 G4double G4EmParameters::MaxKinEnergy() const 641 { 517 { 642 return maxKinEnergy; 518 return maxKinEnergy; 643 } 519 } 644 520 645 void G4EmParameters::SetMaxEnergyForCSDARange( 521 void G4EmParameters::SetMaxEnergyForCSDARange(G4double val) 646 { 522 { 647 if(IsLocked()) { return; } 523 if(IsLocked()) { return; } 648 if(val > minKinEnergy && val <= 100*CLHEP::T << 524 if(val > minKinEnergy && val <= 100*TeV) { 649 maxKinEnergyCSDA = val; 525 maxKinEnergyCSDA = val; 650 } else { 526 } else { 651 G4ExceptionDescription ed; 527 G4ExceptionDescription ed; 652 ed << "Value of MaxKinEnergyCSDA is out of 528 ed << "Value of MaxKinEnergyCSDA is out of range: " 653 << val/CLHEP::GeV << " GeV is ignored; << 529 << val/GeV << " GeV is ignored"; 654 << minKinEnergy << " MeV - 100 TeV"; << 655 PrintWarning(ed); 530 PrintWarning(ed); 656 } 531 } 657 } 532 } 658 533 659 G4double G4EmParameters::MaxEnergyForCSDARange 534 G4double G4EmParameters::MaxEnergyForCSDARange() const 660 { 535 { 661 return maxKinEnergyCSDA; 536 return maxKinEnergyCSDA; 662 } 537 } 663 538 664 void G4EmParameters::SetLowestElectronEnergy(G 539 void G4EmParameters::SetLowestElectronEnergy(G4double val) 665 { 540 { 666 if(IsLocked()) { return; } 541 if(IsLocked()) { return; } 667 if(val >= 0.0) { lowestElectronEnergy = val; << 542 if(val >= 0.0) { >> 543 lowestElectronEnergy = val; >> 544 } else { >> 545 G4ExceptionDescription ed; >> 546 ed << "Value of lowestElectronEnergy is out of range: " >> 547 << val/MeV << " MeV is ignored"; >> 548 PrintWarning(ed); >> 549 } 668 } 550 } 669 551 670 G4double G4EmParameters::LowestElectronEnergy( 552 G4double G4EmParameters::LowestElectronEnergy() const 671 { 553 { 672 return lowestElectronEnergy; 554 return lowestElectronEnergy; 673 } 555 } 674 556 675 void G4EmParameters::SetLowestMuHadEnergy(G4do 557 void G4EmParameters::SetLowestMuHadEnergy(G4double val) 676 { 558 { 677 if(IsLocked()) { return; } 559 if(IsLocked()) { return; } 678 if(val >= 0.0) { lowestMuHadEnergy = val; } << 560 if(val >= 0.0) { >> 561 lowestMuHadEnergy = val; >> 562 } else { >> 563 G4ExceptionDescription ed; >> 564 ed << "Value of lowestMuHadEnergy is out of range: " >> 565 << val/MeV << " MeV is ignored"; >> 566 PrintWarning(ed); >> 567 } 679 } 568 } 680 569 681 G4double G4EmParameters::LowestMuHadEnergy() c 570 G4double G4EmParameters::LowestMuHadEnergy() const 682 { 571 { 683 return lowestMuHadEnergy; 572 return lowestMuHadEnergy; 684 } 573 } 685 574 686 void G4EmParameters::SetLowestTripletEnergy(G4 575 void G4EmParameters::SetLowestTripletEnergy(G4double val) 687 { 576 { 688 if(IsLocked()) { return; } 577 if(IsLocked()) { return; } 689 if(val > 0.0) { lowestTripletEnergy = val; } 578 if(val > 0.0) { lowestTripletEnergy = val; } 690 } 579 } 691 580 692 G4double G4EmParameters::LowestTripletEnergy() 581 G4double G4EmParameters::LowestTripletEnergy() const 693 { 582 { 694 return lowestTripletEnergy; 583 return lowestTripletEnergy; 695 } 584 } 696 585 697 void G4EmParameters::SetMaxNIELEnergy(G4double << 698 { << 699 if(IsLocked()) { return; } << 700 if(val >= 0.0) { maxNIELEnergy = val; } << 701 } << 702 << 703 G4double G4EmParameters::MaxNIELEnergy() const << 704 { << 705 return maxNIELEnergy; << 706 } << 707 << 708 void G4EmParameters::SetMaxEnergyFor5DMuPair(G << 709 { << 710 if(IsLocked()) { return; } << 711 if(val > 0.0) { max5DEnergyForMuPair = val; << 712 } << 713 << 714 G4double G4EmParameters::MaxEnergyFor5DMuPair( << 715 { << 716 return max5DEnergyForMuPair; << 717 } << 718 << 719 void G4EmParameters::SetLinearLossLimit(G4doub 586 void G4EmParameters::SetLinearLossLimit(G4double val) 720 { 587 { 721 if(IsLocked()) { return; } 588 if(IsLocked()) { return; } 722 if(val > 0.0 && val < 0.5) { 589 if(val > 0.0 && val < 0.5) { 723 linLossLimit = val; 590 linLossLimit = val; 724 } else { 591 } else { 725 G4ExceptionDescription ed; 592 G4ExceptionDescription ed; 726 ed << "Value of linLossLimit is out of ran 593 ed << "Value of linLossLimit is out of range: " << val 727 << " is ignored"; 594 << " is ignored"; 728 PrintWarning(ed); 595 PrintWarning(ed); 729 } 596 } 730 } 597 } 731 598 732 G4double G4EmParameters::LinearLossLimit() con 599 G4double G4EmParameters::LinearLossLimit() const 733 { 600 { 734 return linLossLimit; 601 return linLossLimit; 735 } 602 } 736 603 737 void G4EmParameters::SetBremsstrahlungTh(G4dou 604 void G4EmParameters::SetBremsstrahlungTh(G4double val) 738 { 605 { 739 if(IsLocked()) { return; } 606 if(IsLocked()) { return; } 740 if(val > 0.0) { 607 if(val > 0.0) { 741 bremsTh = val; 608 bremsTh = val; 742 } else { 609 } else { 743 G4ExceptionDescription ed; 610 G4ExceptionDescription ed; 744 ed << "Value of bremsstrahlung threshold i 611 ed << "Value of bremsstrahlung threshold is out of range: " 745 << val/GeV << " GeV is ignored"; 612 << val/GeV << " GeV is ignored"; 746 PrintWarning(ed); 613 PrintWarning(ed); 747 } 614 } 748 } 615 } 749 616 750 G4double G4EmParameters::BremsstrahlungTh() co 617 G4double G4EmParameters::BremsstrahlungTh() const 751 { 618 { 752 return bremsTh; 619 return bremsTh; 753 } 620 } 754 621 755 void G4EmParameters::SetMuHadBremsstrahlungTh( << 756 { << 757 if(IsLocked()) { return; } << 758 if(val > 0.0) { << 759 bremsMuHadTh = val; << 760 } else { << 761 G4ExceptionDescription ed; << 762 ed << "Value of bremsstrahlung threshold i << 763 << val/GeV << " GeV is ignored"; << 764 PrintWarning(ed); << 765 } << 766 } << 767 << 768 G4double G4EmParameters::MuHadBremsstrahlungTh << 769 { << 770 return bremsMuHadTh; << 771 } << 772 << 773 void G4EmParameters::SetLambdaFactor(G4double 622 void G4EmParameters::SetLambdaFactor(G4double val) 774 { 623 { 775 if(IsLocked()) { return; } 624 if(IsLocked()) { return; } 776 if(val > 0.0 && val < 1.0) { 625 if(val > 0.0 && val < 1.0) { 777 lambdaFactor = val; 626 lambdaFactor = val; 778 } else { 627 } else { 779 G4ExceptionDescription ed; 628 G4ExceptionDescription ed; 780 ed << "Value of lambda factor is out of ra 629 ed << "Value of lambda factor is out of range: " << val 781 << " is ignored"; 630 << " is ignored"; 782 PrintWarning(ed); 631 PrintWarning(ed); 783 } 632 } 784 } 633 } 785 634 786 G4double G4EmParameters::LambdaFactor() const 635 G4double G4EmParameters::LambdaFactor() const 787 { 636 { 788 return lambdaFactor; 637 return lambdaFactor; 789 } 638 } 790 639 791 void G4EmParameters::SetFactorForAngleLimit(G4 640 void G4EmParameters::SetFactorForAngleLimit(G4double val) 792 { 641 { 793 if(IsLocked()) { return; } 642 if(IsLocked()) { return; } 794 if(val > 0.0) { 643 if(val > 0.0) { 795 factorForAngleLimit = val; 644 factorForAngleLimit = val; 796 } else { 645 } else { 797 G4ExceptionDescription ed; 646 G4ExceptionDescription ed; 798 ed << "Value of factor for enegry limit is 647 ed << "Value of factor for enegry limit is out of range: " 799 << val << " is ignored"; 648 << val << " is ignored"; 800 PrintWarning(ed); 649 PrintWarning(ed); 801 } 650 } 802 } 651 } 803 652 804 G4double G4EmParameters::FactorForAngleLimit() 653 G4double G4EmParameters::FactorForAngleLimit() const 805 { 654 { 806 return factorForAngleLimit; 655 return factorForAngleLimit; 807 } 656 } 808 657 809 void G4EmParameters::SetMscThetaLimit(G4double 658 void G4EmParameters::SetMscThetaLimit(G4double val) 810 { 659 { 811 if(IsLocked()) { return; } 660 if(IsLocked()) { return; } 812 if(val >= 0.0 && val <= pi) { 661 if(val >= 0.0 && val <= pi) { 813 thetaLimit = val; 662 thetaLimit = val; 814 } else { 663 } else { 815 G4ExceptionDescription ed; 664 G4ExceptionDescription ed; 816 ed << "Value of polar angle limit is out o 665 ed << "Value of polar angle limit is out of range: " 817 << val << " is ignored"; 666 << val << " is ignored"; 818 PrintWarning(ed); 667 PrintWarning(ed); 819 } 668 } 820 } 669 } 821 670 822 G4double G4EmParameters::MscThetaLimit() const 671 G4double G4EmParameters::MscThetaLimit() const 823 { 672 { 824 return thetaLimit; 673 return thetaLimit; 825 } 674 } 826 675 827 void G4EmParameters::SetMscEnergyLimit(G4doubl << 828 { << 829 if(IsLocked()) { return; } << 830 if(val >= 0.0) { << 831 energyLimit = val; << 832 } else { << 833 G4ExceptionDescription ed; << 834 ed << "Value of msc energy limit is out of << 835 << val << " is ignored"; << 836 PrintWarning(ed); << 837 } << 838 } << 839 << 840 G4double G4EmParameters::MscEnergyLimit() cons << 841 { << 842 return energyLimit; << 843 } << 844 << 845 void G4EmParameters::SetMscRangeFactor(G4doubl 676 void G4EmParameters::SetMscRangeFactor(G4double val) 846 { 677 { 847 if(IsLocked()) { return; } 678 if(IsLocked()) { return; } 848 if(val > 0.0 && val < 1.0) { 679 if(val > 0.0 && val < 1.0) { 849 rangeFactor = val; 680 rangeFactor = val; 850 } else { 681 } else { 851 G4ExceptionDescription ed; 682 G4ExceptionDescription ed; 852 ed << "Value of rangeFactor is out of rang 683 ed << "Value of rangeFactor is out of range: " 853 << val << " is ignored"; 684 << val << " is ignored"; 854 PrintWarning(ed); 685 PrintWarning(ed); 855 } 686 } 856 } 687 } 857 688 858 G4double G4EmParameters::MscRangeFactor() cons 689 G4double G4EmParameters::MscRangeFactor() const 859 { 690 { 860 return rangeFactor; 691 return rangeFactor; 861 } 692 } 862 693 863 void G4EmParameters::SetMscMuHadRangeFactor(G4 694 void G4EmParameters::SetMscMuHadRangeFactor(G4double val) 864 { 695 { 865 if(IsLocked()) { return; } 696 if(IsLocked()) { return; } 866 if(val > 0.0 && val < 1.0) { 697 if(val > 0.0 && val < 1.0) { 867 rangeFactorMuHad = val; 698 rangeFactorMuHad = val; 868 } else { 699 } else { 869 G4ExceptionDescription ed; 700 G4ExceptionDescription ed; 870 ed << "Value of rangeFactorMuHad is out of 701 ed << "Value of rangeFactorMuHad is out of range: " 871 << val << " is ignored"; 702 << val << " is ignored"; 872 PrintWarning(ed); 703 PrintWarning(ed); 873 } 704 } 874 } 705 } 875 706 876 G4double G4EmParameters::MscMuHadRangeFactor() 707 G4double G4EmParameters::MscMuHadRangeFactor() const 877 { 708 { 878 return rangeFactorMuHad; 709 return rangeFactorMuHad; 879 } 710 } 880 711 881 void G4EmParameters::SetMscGeomFactor(G4double 712 void G4EmParameters::SetMscGeomFactor(G4double val) 882 { 713 { 883 if(IsLocked()) { return; } 714 if(IsLocked()) { return; } 884 if(val >= 1.0) { 715 if(val >= 1.0) { 885 geomFactor = val; 716 geomFactor = val; 886 } else { 717 } else { 887 G4ExceptionDescription ed; 718 G4ExceptionDescription ed; 888 ed << "Value of geomFactor is out of range 719 ed << "Value of geomFactor is out of range: " 889 << val << " is ignored"; 720 << val << " is ignored"; 890 PrintWarning(ed); 721 PrintWarning(ed); 891 } 722 } 892 } 723 } 893 724 894 G4double G4EmParameters::MscGeomFactor() const 725 G4double G4EmParameters::MscGeomFactor() const 895 { 726 { 896 return geomFactor; 727 return geomFactor; 897 } 728 } 898 729 899 void G4EmParameters::SetMscSafetyFactor(G4doub << 900 { << 901 if(IsLocked()) { return; } << 902 if(val >= 0.1) { << 903 safetyFactor = val; << 904 } else { << 905 G4ExceptionDescription ed; << 906 ed << "Value of safetyFactor is out of ran << 907 << val << " is ignored"; << 908 PrintWarning(ed); << 909 } << 910 } << 911 << 912 G4double G4EmParameters::MscSafetyFactor() con << 913 { << 914 return safetyFactor; << 915 } << 916 << 917 void G4EmParameters::SetMscLambdaLimit(G4doubl << 918 { << 919 if(IsLocked()) { return; } << 920 if(val >= 0.0) { << 921 lambdaLimit = val; << 922 } else { << 923 G4ExceptionDescription ed; << 924 ed << "Value of lambdaLimit is out of rang << 925 << val << " is ignored"; << 926 PrintWarning(ed); << 927 } << 928 } << 929 << 930 G4double G4EmParameters::MscLambdaLimit() cons << 931 { << 932 return lambdaLimit; << 933 } << 934 << 935 void G4EmParameters::SetMscSkin(G4double val) 730 void G4EmParameters::SetMscSkin(G4double val) 936 { 731 { 937 if(IsLocked()) { return; } 732 if(IsLocked()) { return; } 938 if(val >= 1.0) { 733 if(val >= 1.0) { 939 skin = val; 734 skin = val; 940 } else { 735 } else { 941 G4ExceptionDescription ed; 736 G4ExceptionDescription ed; 942 ed << "Value of skin is out of range: " 737 ed << "Value of skin is out of range: " 943 << val << " is ignored"; 738 << val << " is ignored"; 944 PrintWarning(ed); 739 PrintWarning(ed); 945 } 740 } 946 } 741 } 947 742 948 G4double G4EmParameters::MscSkin() const 743 G4double G4EmParameters::MscSkin() const 949 { 744 { 950 return skin; 745 return skin; 951 } 746 } 952 747 953 void G4EmParameters::SetScreeningFactor(G4doub 748 void G4EmParameters::SetScreeningFactor(G4double val) 954 { 749 { 955 if(IsLocked()) { return; } 750 if(IsLocked()) { return; } 956 if(val > 0.0) { 751 if(val > 0.0) { 957 factorScreen = val; 752 factorScreen = val; 958 } else { 753 } else { 959 G4ExceptionDescription ed; 754 G4ExceptionDescription ed; 960 ed << "Value of factorScreen is out of ran 755 ed << "Value of factorScreen is out of range: " 961 << val << " is ignored"; 756 << val << " is ignored"; 962 PrintWarning(ed); 757 PrintWarning(ed); 963 } 758 } 964 } 759 } 965 760 966 G4double G4EmParameters::ScreeningFactor() con 761 G4double G4EmParameters::ScreeningFactor() const 967 { 762 { 968 return factorScreen; 763 return factorScreen; 969 } 764 } 970 765 971 void G4EmParameters::SetStepFunction(G4double 766 void G4EmParameters::SetStepFunction(G4double v1, G4double v2) 972 { 767 { 973 if(IsLocked()) { return; } 768 if(IsLocked()) { return; } 974 fBParameters->SetStepFunction(v1, v2); << 769 if(v1 > 0.0 && v1 <= 1.0 && v2 > 0.0) { >> 770 dRoverRange = v1; >> 771 finalRange = v2; >> 772 } else { >> 773 G4ExceptionDescription ed; >> 774 ed << "Values of step function are out of range: " >> 775 << v1 << ", " << v2/CLHEP::mm << " mm - are ignored"; >> 776 PrintWarning(ed); >> 777 } 975 } 778 } 976 779 977 void G4EmParameters::SetStepFunctionMuHad(G4do 780 void G4EmParameters::SetStepFunctionMuHad(G4double v1, G4double v2) 978 { 781 { 979 if(IsLocked()) { return; } 782 if(IsLocked()) { return; } 980 fBParameters->SetStepFunctionMuHad(v1, v2); << 783 if(v1 > 0.0 && v1 <= 1.0 && v2 > 0.0) { 981 } << 784 dRoverRangeMuHad = v1; 982 << 785 finalRangeMuHad = v2; 983 void G4EmParameters::SetStepFunctionLightIons( << 786 } else { 984 { << 787 G4ExceptionDescription ed; 985 if(IsLocked()) { return; } << 788 ed << "Values of step function are out of range: " 986 fBParameters->SetStepFunctionLightIons(v1, v << 789 << v1 << ", " << v2/CLHEP::mm << " mm - are ignored"; >> 790 PrintWarning(ed); >> 791 } 987 } 792 } 988 793 989 void G4EmParameters::SetStepFunctionIons(G4dou << 794 void G4EmParameters::SetNumberOfBins(G4int val) 990 { 795 { 991 if(IsLocked()) { return; } 796 if(IsLocked()) { return; } 992 fBParameters->SetStepFunctionIons(v1, v2); << 797 if(val >= 5 && val < 10000000) { 993 } << 798 nbins = val; 994 << 799 nbinsPerDecade = G4lrint(nbins/std::log10(maxKinEnergy/minKinEnergy)); 995 void G4EmParameters::FillStepFunction(const G4 << 800 } else { 996 { << 801 G4ExceptionDescription ed; 997 fBParameters->FillStepFunction(part, proc); << 802 ed << "Value of number of bins is out of range: " >> 803 << val << " is ignored"; >> 804 PrintWarning(ed); >> 805 } 998 } 806 } 999 807 1000 G4int G4EmParameters::NumberOfBins() const 808 G4int G4EmParameters::NumberOfBins() const 1001 { 809 { 1002 return nbinsPerDecade*G4lrint(std::log10(ma << 810 return nbins; 1003 } 811 } 1004 812 1005 void G4EmParameters::SetNumberOfBinsPerDecade 813 void G4EmParameters::SetNumberOfBinsPerDecade(G4int val) 1006 { 814 { 1007 if(IsLocked()) { return; } 815 if(IsLocked()) { return; } 1008 if(val >= 5 && val < 1000000) { 816 if(val >= 5 && val < 1000000) { 1009 nbinsPerDecade = val; 817 nbinsPerDecade = val; >> 818 nbins = nbinsPerDecade*G4lrint(std::log10(maxKinEnergy/minKinEnergy)); 1010 } else { 819 } else { 1011 G4ExceptionDescription ed; 820 G4ExceptionDescription ed; 1012 ed << "Value of number of bins per decade 821 ed << "Value of number of bins per decade is out of range: " 1013 << val << " is ignored"; 822 << val << " is ignored"; 1014 PrintWarning(ed); 823 PrintWarning(ed); 1015 } 824 } 1016 } 825 } 1017 826 1018 G4int G4EmParameters::NumberOfBinsPerDecade() 827 G4int G4EmParameters::NumberOfBinsPerDecade() const 1019 { 828 { 1020 return nbinsPerDecade; 829 return nbinsPerDecade; 1021 } 830 } 1022 831 1023 void G4EmParameters::SetVerbose(G4int val) 832 void G4EmParameters::SetVerbose(G4int val) 1024 { 833 { 1025 if(IsLocked()) { return; } 834 if(IsLocked()) { return; } 1026 verbose = val; 835 verbose = val; 1027 workerVerbose = std::min(workerVerbose, ver 836 workerVerbose = std::min(workerVerbose, verbose); 1028 } 837 } 1029 838 1030 G4int G4EmParameters::Verbose() const 839 G4int G4EmParameters::Verbose() const 1031 { 840 { 1032 return verbose; 841 return verbose; 1033 } 842 } 1034 843 1035 void G4EmParameters::SetWorkerVerbose(G4int v 844 void G4EmParameters::SetWorkerVerbose(G4int val) 1036 { 845 { 1037 if(IsLocked()) { return; } 846 if(IsLocked()) { return; } 1038 workerVerbose = val; 847 workerVerbose = val; 1039 } 848 } 1040 849 1041 G4int G4EmParameters::WorkerVerbose() const 850 G4int G4EmParameters::WorkerVerbose() const 1042 { 851 { 1043 return workerVerbose; 852 return workerVerbose; 1044 } 853 } 1045 854 1046 void G4EmParameters::SetNumberForFreeVector(G << 1047 { << 1048 if(IsLocked()) { return; } << 1049 nForFreeVector = val; << 1050 } << 1051 << 1052 G4int G4EmParameters::NumberForFreeVector() c << 1053 { << 1054 return nForFreeVector; << 1055 } << 1056 << 1057 void G4EmParameters::SetTransportationWithMsc << 1058 { << 1059 if(IsLocked()) { return; } << 1060 fTransportationWithMsc = val; << 1061 } << 1062 << 1063 G4TransportationWithMscType G4EmParameters::T << 1064 { << 1065 return fTransportationWithMsc; << 1066 } << 1067 << 1068 void G4EmParameters::SetFluctuationType(G4EmF << 1069 { << 1070 if(IsLocked()) { return; } << 1071 fFluct = val; << 1072 } << 1073 << 1074 G4EmFluctuationType G4EmParameters::Fluctuati << 1075 { << 1076 return fFluct; << 1077 } << 1078 << 1079 void G4EmParameters::SetPositronAtRestModelTy << 1080 { << 1081 if(IsLocked()) { return; } << 1082 fPositronium = val; << 1083 } << 1084 << 1085 G4PositronAtRestModelType G4EmParameters::Pos << 1086 { << 1087 return fPositronium; << 1088 } << 1089 << 1090 void G4EmParameters::SetMscStepLimitType(G4Ms 855 void G4EmParameters::SetMscStepLimitType(G4MscStepLimitType val) 1091 { 856 { 1092 if(IsLocked()) { return; } 857 if(IsLocked()) { return; } 1093 mscStepLimit = val; 858 mscStepLimit = val; 1094 } 859 } 1095 860 1096 G4MscStepLimitType G4EmParameters::MscStepLim 861 G4MscStepLimitType G4EmParameters::MscStepLimitType() const 1097 { 862 { 1098 return mscStepLimit; 863 return mscStepLimit; 1099 } 864 } 1100 865 1101 void G4EmParameters::SetMscMuHadStepLimitType 866 void G4EmParameters::SetMscMuHadStepLimitType(G4MscStepLimitType val) 1102 { 867 { 1103 if(IsLocked()) { return; } 868 if(IsLocked()) { return; } 1104 mscStepLimitMuHad = val; 869 mscStepLimitMuHad = val; 1105 } 870 } 1106 871 1107 G4MscStepLimitType G4EmParameters::MscMuHadSt 872 G4MscStepLimitType G4EmParameters::MscMuHadStepLimitType() const 1108 { 873 { 1109 return mscStepLimitMuHad; 874 return mscStepLimitMuHad; 1110 } 875 } 1111 876 1112 void G4EmParameters::SetSingleScatteringType( << 1113 { << 1114 if(IsLocked()) { return; } << 1115 fSStype = val; << 1116 } << 1117 << 1118 G4eSingleScatteringType G4EmParameters::Singl << 1119 { << 1120 return fSStype; << 1121 } << 1122 << 1123 void 877 void 1124 G4EmParameters::SetNuclearFormfactorType(G4Nu 878 G4EmParameters::SetNuclearFormfactorType(G4NuclearFormfactorType val) 1125 { 879 { 1126 if(IsLocked()) { return; } 880 if(IsLocked()) { return; } 1127 nucFormfactor = val; 881 nucFormfactor = val; 1128 } 882 } 1129 883 1130 G4NuclearFormfactorType G4EmParameters::Nucle 884 G4NuclearFormfactorType G4EmParameters::NuclearFormfactorType() const 1131 { 885 { 1132 return nucFormfactor; 886 return nucFormfactor; 1133 } 887 } 1134 888 1135 void G4EmParameters::SetDNAeSolvationSubType( << 1136 { << 1137 if(IsLocked()) { return; } << 1138 fCParameters->SetDNAeSolvationSubType(val); << 1139 ActivateDNA(); << 1140 } << 1141 << 1142 G4DNAModelSubType G4EmParameters::DNAeSolvati << 1143 { << 1144 return fCParameters->DNAeSolvationSubType() << 1145 } << 1146 << 1147 void G4EmParameters::SetConversionType(G4int << 1148 { << 1149 if(IsLocked()) { return; } << 1150 tripletConv = val; << 1151 } << 1152 << 1153 G4int G4EmParameters::GetConversionType() con << 1154 { << 1155 return tripletConv; << 1156 } << 1157 << 1158 void G4EmParameters::SetPIXECrossSectionModel 889 void G4EmParameters::SetPIXECrossSectionModel(const G4String& sss) 1159 { 890 { >> 891 G4cout << "G4EmParameters::SetPIXECrossSectionModel " << sss << G4endl; 1160 if(IsLocked()) { return; } 892 if(IsLocked()) { return; } 1161 fCParameters->SetPIXECrossSectionModel(sss) << 893 namePIXE = sss; 1162 } 894 } 1163 895 1164 const G4String& G4EmParameters::PIXECrossSect 896 const G4String& G4EmParameters::PIXECrossSectionModel() 1165 { 897 { 1166 return fCParameters->PIXECrossSectionModel( << 898 return namePIXE; 1167 } 899 } 1168 900 1169 void G4EmParameters::SetPIXEElectronCrossSect 901 void G4EmParameters::SetPIXEElectronCrossSectionModel(const G4String& sss) 1170 { 902 { 1171 if(IsLocked()) { return; } 903 if(IsLocked()) { return; } 1172 fCParameters->SetPIXEElectronCrossSectionMo << 904 nameElectronPIXE = sss; 1173 } 905 } 1174 906 1175 const G4String& G4EmParameters::PIXEElectronC 907 const G4String& G4EmParameters::PIXEElectronCrossSectionModel() 1176 { 908 { 1177 return fCParameters->PIXEElectronCrossSecti << 909 return nameElectronPIXE; 1178 } << 1179 << 1180 void G4EmParameters::SetLivermoreDataDir(cons << 1181 { << 1182 if(IsLocked()) { return; } << 1183 fCParameters->SetLivermoreDataDir(sss); << 1184 } 910 } 1185 911 1186 const G4String& G4EmParameters::LivermoreData << 912 void G4EmParameters::PrintWarning(G4ExceptionDescription& ed) const 1187 { 913 { 1188 return fCParameters->LivermoreDataDir(); << 914 G4Exception("G4EmParameters", "em0044", JustWarning, ed); 1189 } 915 } 1190 916 1191 void G4EmParameters::PrintWarning(G4Exception << 917 G4String G4EmParameters::CheckRegion(const G4String& reg) const 1192 { 918 { 1193 G4Exception("G4EmParameters", "em0044", Jus << 919 G4String r = reg; >> 920 if(r == "" || r == "world" || r == "World") { >> 921 r = "DefaultRegionForTheWorld"; >> 922 } >> 923 return r; 1194 } 924 } 1195 925 1196 void G4EmParameters::AddPAIModel(const G4Stri 926 void G4EmParameters::AddPAIModel(const G4String& particle, 1197 const G4Stri 927 const G4String& region, 1198 const G4Stri 928 const G4String& type) 1199 { 929 { 1200 if(IsLocked()) { return; } 930 if(IsLocked()) { return; } 1201 fBParameters->AddPAIModel(particle, region, << 931 G4String r = CheckRegion(region); >> 932 G4int nreg = m_regnamesPAI.size(); >> 933 for(G4int i=0; i<nreg; ++i) { >> 934 if((m_particlesPAI[i] == particle || >> 935 m_particlesPAI[i] == "all" || >> 936 particle == "all") && >> 937 (m_regnamesPAI[i] == r || >> 938 m_regnamesPAI[i] == "DefaultRegionForTheWorld" || >> 939 r == "DefaultRegionForTheWorld") ) { >> 940 >> 941 m_typesPAI[i] = type; >> 942 if(particle == "all") { m_particlesPAI[i] = particle; } >> 943 if(r == "DefaultRegionForTheWorld") { m_regnamesPAI[i] = r; } >> 944 return; >> 945 } >> 946 } >> 947 m_particlesPAI.push_back(particle); >> 948 m_regnamesPAI.push_back(r); >> 949 m_typesPAI.push_back(type); 1202 } 950 } 1203 951 1204 const std::vector<G4String>& G4EmParameters:: 952 const std::vector<G4String>& G4EmParameters::ParticlesPAI() const 1205 { 953 { 1206 return fBParameters->ParticlesPAI(); << 954 return m_particlesPAI; 1207 } 955 } 1208 956 1209 const std::vector<G4String>& G4EmParameters:: 957 const std::vector<G4String>& G4EmParameters::RegionsPAI() const 1210 { 958 { 1211 return fBParameters->RegionsPAI(); << 959 return m_regnamesPAI; 1212 } 960 } 1213 961 1214 const std::vector<G4String>& G4EmParameters:: 962 const std::vector<G4String>& G4EmParameters::TypesPAI() const 1215 { 963 { 1216 return fBParameters->TypesPAI(); << 964 return m_typesPAI; 1217 } 965 } 1218 966 1219 void G4EmParameters::AddMicroElec(const G4Str 967 void G4EmParameters::AddMicroElec(const G4String& region) 1220 { 968 { 1221 if(IsLocked()) { return; } 969 if(IsLocked()) { return; } 1222 fCParameters->AddMicroElec(region); << 970 G4String r = CheckRegion(region); >> 971 G4int nreg = m_regnamesME.size(); >> 972 for(G4int i=0; i<nreg; ++i) { >> 973 if(r == m_regnamesME[i]) { return; } >> 974 } >> 975 m_regnamesME.push_back(r); 1223 } 976 } 1224 977 1225 const std::vector<G4String>& G4EmParameters:: 978 const std::vector<G4String>& G4EmParameters::RegionsMicroElec() const 1226 { 979 { 1227 return fCParameters->RegionsMicroElec(); << 980 return m_regnamesME; 1228 } 981 } 1229 982 1230 void G4EmParameters::AddDNA(const G4String& r 983 void G4EmParameters::AddDNA(const G4String& region, const G4String& type) 1231 { 984 { 1232 if(IsLocked()) { return; } 985 if(IsLocked()) { return; } 1233 fCParameters->AddDNA(region, type); << 986 G4String r = CheckRegion(region); 1234 ActivateDNA(); << 987 G4int nreg = m_regnamesDNA.size(); >> 988 for(G4int i=0; i<nreg; ++i) { >> 989 if(r == m_regnamesDNA[i]) { return; } >> 990 } >> 991 m_regnamesDNA.push_back(r); >> 992 m_typesDNA.push_back(type); 1235 } 993 } 1236 994 1237 const std::vector<G4String>& G4EmParameters:: 995 const std::vector<G4String>& G4EmParameters::RegionsDNA() const 1238 { 996 { 1239 return fCParameters->RegionsDNA(); << 997 return m_regnamesDNA; 1240 } 998 } 1241 999 1242 const std::vector<G4String>& G4EmParameters:: 1000 const std::vector<G4String>& G4EmParameters::TypesDNA() const 1243 { 1001 { 1244 return fCParameters->TypesDNA(); << 1002 return m_typesDNA; >> 1003 } >> 1004 >> 1005 void G4EmParameters::AddMsc(const G4String& region, const G4String& type) >> 1006 { >> 1007 AddPhysics(region, type); >> 1008 } >> 1009 >> 1010 const std::vector<G4String>& G4EmParameters::RegionsMsc() const >> 1011 { >> 1012 return m_regnamesMsc; >> 1013 } >> 1014 >> 1015 const std::vector<G4String>& G4EmParameters::TypesMsc() const >> 1016 { >> 1017 return m_typesMsc; 1245 } 1018 } 1246 1019 1247 void G4EmParameters::AddPhysics(const G4Strin 1020 void G4EmParameters::AddPhysics(const G4String& region, const G4String& type) 1248 { 1021 { 1249 if(IsLocked()) { return; } 1022 if(IsLocked()) { return; } 1250 fBParameters->AddPhysics(region, type); << 1023 G4String r = CheckRegion(region); >> 1024 G4int nreg = m_regnamesMsc.size(); >> 1025 for(G4int i=0; i<nreg; ++i) { >> 1026 if(r == m_regnamesMsc[i]) { return; } >> 1027 } >> 1028 m_regnamesMsc.push_back(r); >> 1029 m_typesMsc.push_back(type); 1251 } 1030 } 1252 1031 1253 const std::vector<G4String>& G4EmParameters:: 1032 const std::vector<G4String>& G4EmParameters::RegionsPhysics() const 1254 { 1033 { 1255 return fBParameters->RegionsPhysics(); << 1034 return m_regnamesMsc; 1256 } 1035 } 1257 1036 1258 const std::vector<G4String>& G4EmParameters:: 1037 const std::vector<G4String>& G4EmParameters::TypesPhysics() const 1259 { 1038 { 1260 return fBParameters->TypesPhysics(); << 1039 return m_typesMsc; 1261 } 1040 } 1262 1041 1263 void G4EmParameters::SetSubCutRegion(const G4 << 1042 void G4EmParameters::SetSubCutoff(G4bool val, const G4String& region) 1264 { 1043 { 1265 if(IsLocked()) { return; } 1044 if(IsLocked()) { return; } 1266 fBParameters->SetSubCutRegion(region); << 1045 G4String r = CheckRegion(region); >> 1046 G4int nreg = m_regnamesSubCut.size(); >> 1047 for(G4int i=0; i<nreg; ++i) { >> 1048 if(r == m_regnamesSubCut[i]) { >> 1049 m_subCuts[i] = val; >> 1050 return; >> 1051 } >> 1052 } >> 1053 m_regnamesSubCut.push_back(r); >> 1054 m_subCuts.push_back(val); 1267 } 1055 } 1268 1056 1269 void 1057 void 1270 G4EmParameters::SetDeexActiveRegion(const G4S << 1058 G4EmParameters::SetDeexActiveRegion(const G4String& region, G4bool fdeex, 1271 G4bool aa << 1059 G4bool fauger, G4bool fpixe) 1272 { 1060 { 1273 if(IsLocked()) { return; } 1061 if(IsLocked()) { return; } 1274 fCParameters->SetDeexActiveRegion(region, a << 1062 if(fdeex) { fluo = true; } >> 1063 G4String r = CheckRegion(region); >> 1064 G4int nreg = m_regnamesDeex.size(); >> 1065 if(0 == nreg && r != "DefaultRegionForTheWorld") { >> 1066 m_regnamesDeex.push_back("DefaultRegionForTheWorld"); >> 1067 m_fluo.push_back(false); >> 1068 m_auger.push_back(false); >> 1069 m_pixe.push_back(false); >> 1070 nreg = 1; >> 1071 } >> 1072 for(G4int i=0; i<nreg; ++i) { >> 1073 if(r == m_regnamesDeex[i]) { >> 1074 m_fluo[i] = fdeex; >> 1075 m_auger[i]= fauger; >> 1076 m_pixe[i] = fpixe; >> 1077 return; >> 1078 } >> 1079 } >> 1080 m_regnamesDeex.push_back(r); >> 1081 m_fluo.push_back(fdeex); >> 1082 m_auger.push_back(fauger); >> 1083 m_pixe.push_back(fpixe); 1275 } 1084 } 1276 1085 1277 void 1086 void 1278 G4EmParameters::SetProcessBiasingFactor(const 1087 G4EmParameters::SetProcessBiasingFactor(const G4String& procname, 1279 G4dou 1088 G4double val, G4bool wflag) 1280 { 1089 { 1281 if(IsLocked()) { return; } 1090 if(IsLocked()) { return; } 1282 fBParameters->SetProcessBiasingFactor(procn << 1091 if(val > 0.0) { >> 1092 G4int n = m_procBiasedXS.size(); >> 1093 for(G4int i=0; i<n; ++i) { >> 1094 if(procname == m_procBiasedXS[i]) { >> 1095 m_factBiasedXS[i] = val; >> 1096 m_weightBiasedXS[i]= wflag; >> 1097 return; >> 1098 } >> 1099 } >> 1100 m_procBiasedXS.push_back(procname); >> 1101 m_factBiasedXS.push_back(val); >> 1102 m_weightBiasedXS.push_back(wflag); >> 1103 } else { >> 1104 G4ExceptionDescription ed; >> 1105 ed << "Process: " << procname << " XS biasing factor " >> 1106 << val << " is negative - ignored"; >> 1107 PrintWarning(ed); >> 1108 } 1283 } 1109 } 1284 1110 1285 void 1111 void 1286 G4EmParameters::ActivateForcedInteraction(con 1112 G4EmParameters::ActivateForcedInteraction(const G4String& procname, 1287 con 1113 const G4String& region, 1288 G4d 1114 G4double length, 1289 G4b 1115 G4bool wflag) 1290 { 1116 { 1291 if(IsLocked() && !gener) { return; } << 1117 if(IsLocked()) { return; } 1292 fBParameters->ActivateForcedInteraction(pro << 1118 G4String r = CheckRegion(region); >> 1119 if(length >= 0.0) { >> 1120 G4int n = m_procForced.size(); >> 1121 for(G4int i=0; i<n; ++i) { >> 1122 if(procname == m_procForced[i] && r == m_regnamesForced[i] ) { >> 1123 m_lengthForced[i] = length; >> 1124 m_weightForced[i]= wflag; >> 1125 return; >> 1126 } >> 1127 } >> 1128 m_regnamesForced.push_back(r); >> 1129 m_procForced.push_back(procname); >> 1130 m_lengthForced.push_back(length); >> 1131 m_weightForced.push_back(wflag); >> 1132 } else { >> 1133 G4ExceptionDescription ed; >> 1134 ed << "Process: " << procname << " in region " << r >> 1135 << " : forced interacttion length= " >> 1136 << length << " is negative - ignored"; >> 1137 PrintWarning(ed); >> 1138 } 1293 } 1139 } 1294 1140 1295 void 1141 void 1296 G4EmParameters::ActivateSecondaryBiasing(cons 1142 G4EmParameters::ActivateSecondaryBiasing(const G4String& procname, 1297 cons 1143 const G4String& region, 1298 G4do 1144 G4double factor, 1299 G4do << 1145 G4double energyLimit) 1300 { 1146 { 1301 if(IsLocked()) { return; } 1147 if(IsLocked()) { return; } 1302 fBParameters->ActivateSecondaryBiasing(proc << 1148 G4String r = CheckRegion(region); 1303 } << 1149 if(factor >= 0.0 && energyLimit >= 0.0) { 1304 << 1150 G4int n = m_procBiasedSec.size(); 1305 void G4EmParameters::DefineRegParamForLoss(G4 << 1151 for(G4int i=0; i<n; ++i) { 1306 { << 1152 if(procname == m_procBiasedSec[i] && r == m_regnamesBiasedSec[i] ) { 1307 fBParameters->DefineRegParamForLoss(ptr); << 1153 m_factBiasedSec[i] = factor; >> 1154 m_elimBiasedSec[i] = energyLimit; >> 1155 return; >> 1156 } >> 1157 } >> 1158 m_regnamesBiasedSec.push_back(r); >> 1159 m_procBiasedSec.push_back(procname); >> 1160 m_factBiasedSec.push_back(factor); >> 1161 m_elimBiasedSec.push_back(energyLimit); >> 1162 } else { >> 1163 G4ExceptionDescription ed; >> 1164 ed << "Process: " << procname << " in region " << r >> 1165 << " : secondary bised factor= " >> 1166 << factor << ", Elim= " << energyLimit << " - ignored"; >> 1167 PrintWarning(ed); >> 1168 } 1308 } 1169 } 1309 1170 1310 void G4EmParameters::DefineRegParamForEM(G4VE << 1171 void G4EmParameters::DefineRegParamForLoss(G4VEnergyLossProcess* ptr, >> 1172 G4bool isElectron) const 1311 { 1173 { 1312 fBParameters->DefineRegParamForEM(ptr); << 1174 if(isElectron) { ptr->SetStepFunction(dRoverRange, finalRange, false); } 1313 } << 1175 else { ptr->SetStepFunction(dRoverRangeMuHad, finalRangeMuHad, false); } 1314 1176 1315 G4bool G4EmParameters::QuantumEntanglement() << 1177 G4RegionStore* regionStore = G4RegionStore::GetInstance(); 1316 { << 1178 G4int n = m_regnamesSubCut.size(); 1317 return fBParameters->QuantumEntanglement(); << 1179 for(G4int i=0; i<n; ++i) { >> 1180 const G4Region* reg = regionStore->GetRegion(m_regnamesSubCut[i], false); >> 1181 if(reg) { ptr->ActivateSubCutoff(m_subCuts[i], reg); } >> 1182 } >> 1183 n = m_procBiasedXS.size(); >> 1184 for(G4int i=0; i<n; ++i) { >> 1185 if(ptr->GetProcessName() == m_procBiasedXS[i]) { >> 1186 ptr->SetCrossSectionBiasingFactor(m_factBiasedXS[i], >> 1187 m_weightBiasedXS[i]); >> 1188 break; >> 1189 } >> 1190 } >> 1191 n = m_procForced.size(); >> 1192 for(G4int i=0; i<n; ++i) { >> 1193 if(ptr->GetProcessName() == m_procForced[i]) { >> 1194 ptr->ActivateForcedInteraction(m_lengthForced[i], >> 1195 m_regnamesForced[i], >> 1196 m_weightForced[i]); >> 1197 break; >> 1198 } >> 1199 } >> 1200 n = m_procBiasedSec.size(); >> 1201 for(G4int i=0; i<n; ++i) { >> 1202 if(ptr->GetProcessName() == m_procBiasedSec[i]) { >> 1203 ptr->ActivateSecondaryBiasing(m_regnamesBiasedSec[i], >> 1204 m_factBiasedSec[i], >> 1205 m_elimBiasedSec[i]); >> 1206 break; >> 1207 } >> 1208 } 1318 } 1209 } 1319 1210 1320 void G4EmParameters::SetQuantumEntanglement(G << 1211 void G4EmParameters::DefineRegParamForEM(G4VEmProcess* ptr) const 1321 { 1212 { 1322 if(IsLocked()) { return; } << 1213 G4int n = m_procBiasedXS.size(); 1323 fBParameters->SetQuantumEntanglement(v); << 1214 for(G4int i=0; i<n; ++i) { 1324 } << 1215 if(ptr->GetProcessName() == m_procBiasedXS[i]) { 1325 << 1216 ptr->SetCrossSectionBiasingFactor(m_factBiasedXS[i], 1326 G4bool G4EmParameters::GetDirectionalSplittin << 1217 m_weightBiasedXS[i]); 1327 return fBParameters->GetDirectionalSplittin << 1218 break; 1328 } << 1219 } 1329 << 1220 } 1330 void G4EmParameters::SetDirectionalSplitting( << 1221 n = m_procForced.size(); 1331 { << 1222 for(G4int i=0; i<n; ++i) { 1332 if(IsLocked()) { return; } << 1223 if(ptr->GetProcessName() == m_procForced[i]) { 1333 fBParameters->SetDirectionalSplitting(v); << 1224 ptr->ActivateForcedInteraction(m_lengthForced[i], 1334 } << 1225 m_regnamesForced[i], 1335 << 1226 m_weightForced[i]); 1336 void G4EmParameters::SetDirectionalSplittingT << 1227 break; 1337 { << 1228 } 1338 if(IsLocked()) { return; } << 1229 } 1339 fBParameters->SetDirectionalSplittingTarget << 1230 n = m_procBiasedSec.size(); 1340 } << 1231 for(G4int i=0; i<n; ++i) { 1341 << 1232 if(ptr->GetProcessName() == m_procBiasedSec[i]) { 1342 G4ThreeVector G4EmParameters::GetDirectionalS << 1233 ptr->ActivateSecondaryBiasing(m_regnamesBiasedSec[i], 1343 { << 1234 m_factBiasedSec[i], 1344 return fBParameters->GetDirectionalSplittin << 1235 m_elimBiasedSec[i]); 1345 } << 1236 break; 1346 << 1237 } 1347 void G4EmParameters::SetDirectionalSplittingR << 1238 } 1348 { << 1349 if(IsLocked()) { return; } << 1350 fBParameters->SetDirectionalSplittingRadius << 1351 } << 1352 << 1353 G4double G4EmParameters::GetDirectionalSplitt << 1354 { << 1355 return fBParameters->GetDirectionalSplittin << 1356 } 1239 } 1357 1240 1358 void G4EmParameters::DefineRegParamForDeex(G4 1241 void G4EmParameters::DefineRegParamForDeex(G4VAtomDeexcitation* ptr) const 1359 { 1242 { 1360 fCParameters->DefineRegParamForDeex(ptr); << 1243 G4int n = m_regnamesDeex.size(); 1361 } << 1244 for(G4int i=0; i<n; ++i) { 1362 << 1245 ptr->SetDeexcitationActiveRegion(m_regnamesDeex[i], 1363 const G4String& G4EmParameters::GetDirLEDATA( << 1246 m_fluo[i], m_auger[i], m_pixe[i]); 1364 { << 1247 } 1365 return fDirLEDATA; << 1366 } 1248 } 1367 1249 1368 void G4EmParameters::StreamInfo(std::ostream& << 1250 std::ostream& G4EmParameters::StreamInfo(std::ostream& os) const 1369 { 1251 { 1370 G4long prec = os.precision(5); << 1252 G4int prec = os.precision(5); 1371 os << "==================================== 1253 os << "=======================================================================" << "\n"; 1372 os << "====== Electromagnet 1254 os << "====== Electromagnetic Physics Parameters ========" << "\n"; 1373 os << "==================================== 1255 os << "=======================================================================" << "\n"; 1374 os << "LPM effect enabled 1256 os << "LPM effect enabled " <<flagLPM << "\n"; 1375 os << "Enable creation and use of sampling << 1257 os << "Spline of EM tables enabled " <<spline << "\n"; 1376 os << "Apply cuts on all EM processes 1258 os << "Apply cuts on all EM processes " <<applyCuts << "\n"; 1377 const char* transportationWithMsc = "Disabl << 1259 os << "Use integral approach for tracking " << integral << "\n"; 1378 if(fTransportationWithMsc == G4Transportati << 1379 transportationWithMsc = "Enabled"; << 1380 } else if (fTransportationWithMsc == G4Tran << 1381 transportationWithMsc = "MultipleSteps"; << 1382 } << 1383 os << "Use combined TransportationWithMsc << 1384 os << "Use general process << 1385 os << "Enable linear polarisation for gamma << 1386 os << "Enable photoeffect sampling below K- << 1387 os << "Enable sampling of quantum entanglem << 1388 <<fBParameters->QuantumEntanglement() < << 1389 os << "X-section factor for integral approa 1260 os << "X-section factor for integral approach " <<lambdaFactor << "\n"; >> 1261 os << "Use built-in Birks satuaration " << birks << "\n"; 1390 os << "Min kinetic energy for tables 1262 os << "Min kinetic energy for tables " 1391 <<G4BestUnit(minKinEnergy,"Energy") << " 1263 <<G4BestUnit(minKinEnergy,"Energy") << "\n"; 1392 os << "Max kinetic energy for tables 1264 os << "Max kinetic energy for tables " 1393 <<G4BestUnit(maxKinEnergy,"Energy") << " 1265 <<G4BestUnit(maxKinEnergy,"Energy") << "\n"; >> 1266 os << "Number of bins in tables " <<nbins << "\n"; 1394 os << "Number of bins per decade of a table 1267 os << "Number of bins per decade of a table " <<nbinsPerDecade << "\n"; 1395 os << "Verbose level 1268 os << "Verbose level " <<verbose << "\n"; 1396 os << "Verbose level for worker thread 1269 os << "Verbose level for worker thread " <<workerVerbose << "\n"; 1397 os << "Bremsstrahlung energy threshold abov 1270 os << "Bremsstrahlung energy threshold above which \n" 1398 << " primary e+- is added to the list o << 1271 << " primary is added to the list of secondary " 1399 <<G4BestUnit(bremsTh,"Energy") << "\n"; 1272 <<G4BestUnit(bremsTh,"Energy") << "\n"; 1400 os << "Bremsstrahlung energy threshold abov << 1401 << " muon/hadron is added to the list o << 1402 <<G4BestUnit(bremsMuHadTh,"Energy") << " << 1403 G4String name3g = "SimplePositronium"; << 1404 if (fPositronium == fAllisonPositronium) { << 1405 else if (fPositronium == fOrePowell) { name << 1406 else if (fPositronium == fOrePowellPolar) { << 1407 os << "Positron annihilation at rest model << 1408 << 1409 os << "Enable 3 gamma annihilation on fly << 1410 << f3GammaAnnihilationOnFly << "\n"; << 1411 os << "Lowest triplet kinetic energy << 1412 <<G4BestUnit(lowestTripletEnergy,"Energy << 1413 os << "Enable sampling of gamma linear pola << 1414 os << "5D gamma conversion model type << 1415 os << "5D gamma conversion model on isolate << 1416 if(max5DEnergyForMuPair>0.0) { << 1417 os << "5D gamma conversion limit for muon p << 1418 << max5DEnergyForMuPair/CLHEP::GeV << " << 1419 } << 1420 os << "Use Ricardo-Gerardo pair production << 1421 << fUseRiGePairProductionModel << "\n"; << 1422 os << "Livermore data directory << 1423 << fCParameters->LivermoreDataDir() << " << 1424 1273 1425 os << "==================================== 1274 os << "=======================================================================" << "\n"; 1426 os << "====== Ionisation Pa 1275 os << "====== Ionisation Parameters ========" << "\n"; 1427 os << "==================================== 1276 os << "=======================================================================" << "\n"; 1428 os << "Step function for e+- << 1277 os << "Step function for e+- " <<"("<< dRoverRange 1429 <<"("<<fBParameters->GetStepFunctionP1() << 1278 << ", " << finalRange << " mm)\n"; 1430 << fBParameters->GetStepFunctionP2()/CLH << 1279 os << "Step function for muons/hadrons " <<"("<< dRoverRangeMuHad 1431 os << "Step function for muons/hadrons << 1280 << ", " << finalRangeMuHad << " mm)\n"; 1432 <<"("<<fBParameters->GetStepFunctionMuHa << 1433 << fBParameters->GetStepFunctionMuHadP2( << 1434 os << "Step function for light ions << 1435 <<"("<<fBParameters->GetStepFunctionLigh << 1436 << fBParameters->GetStepFunctionLightIon << 1437 os << "Step function for general ions << 1438 <<"("<<fBParameters->GetStepFunctionIons << 1439 << fBParameters->GetStepFunctionIonsP2() << 1440 os << "Lowest e+e- kinetic energy << 1441 <<G4BestUnit(lowestElectronEnergy,"Energ << 1442 os << "Lowest muon/hadron kinetic energy << 1443 <<G4BestUnit(lowestMuHadEnergy,"Energy") << 1444 os << "Use ICRU90 data << 1445 os << "Fluctuations of dE/dx are enabled 1281 os << "Fluctuations of dE/dx are enabled " <<lossFluctuation << "\n"; 1446 G4String namef = "Universal"; << 1447 if(fFluct == fUrbanFluctuation) { namef = " << 1448 else if(fFluct == fDummyFluctuation) { name << 1449 os << "Type of fluctuation model for lepton << 1450 os << "Use built-in Birks satuaration << 1451 os << "Build CSDA range enabled 1282 os << "Build CSDA range enabled " <<buildCSDARange << "\n"; 1452 os << "Use cut as a final range enabled << 1283 os << "Use cut as a final range enabled " <<finalRange << "\n"; 1453 os << "Enable angular generator interface 1284 os << "Enable angular generator interface " 1454 <<useAngGeneratorForIonisation << "\n"; 1285 <<useAngGeneratorForIonisation << "\n"; >> 1286 os << "Factor of cut reduction for sub-cutoff method " << minSubRange << "\n"; 1455 os << "Max kinetic energy for CSDA tables 1287 os << "Max kinetic energy for CSDA tables " 1456 <<G4BestUnit(maxKinEnergyCSDA,"Energy") 1288 <<G4BestUnit(maxKinEnergyCSDA,"Energy") << "\n"; 1457 os << "Max kinetic energy for NIEL computat << 1289 os << "Lowest e+e- kinetic energy " 1458 <<G4BestUnit(maxNIELEnergy,"Energy") << << 1290 <<G4BestUnit(lowestElectronEnergy,"Energy") << "\n"; 1459 os << "Linear loss limit << 1291 os << "Lowest muon/hadron kinetic energy " 1460 os << "Read data from file for e+e- pair pr << 1292 <<G4BestUnit(lowestMuHadEnergy,"Energy") << "\n"; >> 1293 os << "Lowest triplet kinetic energy " >> 1294 <<G4BestUnit(lowestTripletEnergy,"Energy") << "\n"; >> 1295 os << "Linear loss limit " <<linLossLimit << "\n"; 1461 1296 1462 os << "==================================== 1297 os << "=======================================================================" << "\n"; 1463 os << "====== Multiple Scat 1298 os << "====== Multiple Scattering Parameters ========" << "\n"; 1464 os << "==================================== 1299 os << "=======================================================================" << "\n"; 1465 os << "Type of msc step limit algorithm for 1300 os << "Type of msc step limit algorithm for e+- " <<mscStepLimit << "\n"; 1466 os << "Type of msc step limit algorithm for 1301 os << "Type of msc step limit algorithm for muons/hadrons " <<mscStepLimitMuHad << "\n"; 1467 os << "Msc lateral displacement for e+- ena 1302 os << "Msc lateral displacement for e+- enabled " <<lateralDisplacement << "\n"; 1468 os << "Msc lateral displacement for muons a 1303 os << "Msc lateral displacement for muons and hadrons " <<muhadLateralDisplacement << "\n"; 1469 os << "Urban msc model lateral displacement << 1304 os << "Msc lateral displacement alg96 for e+- " <<lateralDisplacementAlg96 << "\n"; >> 1305 os << "Msc lateral displacement beyond geometry safety " <<latDisplacementBeyondSafety << "\n"; 1470 os << "Range factor for msc step limit for 1306 os << "Range factor for msc step limit for e+- " <<rangeFactor << "\n"; 1471 os << "Range factor for msc step limit for 1307 os << "Range factor for msc step limit for muons/hadrons " <<rangeFactorMuHad << "\n"; 1472 os << "Geometry factor for msc step limitat 1308 os << "Geometry factor for msc step limitation of e+- " <<geomFactor << "\n"; 1473 os << "Safety factor for msc step limit for << 1474 os << "Skin parameter for msc step limitati 1309 os << "Skin parameter for msc step limitation of e+- " <<skin << "\n"; 1475 os << "Lambda limit for msc step limit for << 1476 os << "Use Mott correction for e- scatterin 1310 os << "Use Mott correction for e- scattering " << useMottCorrection << "\n"; 1477 os << "Factor used for dynamic computation 1311 os << "Factor used for dynamic computation of angular \n" 1478 << " limit between single and multiple 1312 << " limit between single and multiple scattering " << factorForAngleLimit << "\n"; 1479 os << "Fixed angular limit between single \ 1313 os << "Fixed angular limit between single \n" 1480 << " and multiple scattering 1314 << " and multiple scattering " 1481 << thetaLimit/CLHEP::rad << " rad\n"; << 1315 <<thetaLimit/rad << " rad" << "\n"; 1482 os << "Upper energy limit for e+- multiple << 1483 << energyLimit/CLHEP::MeV << " MeV\n"; << 1484 os << "Type of electron single scattering m << 1485 os << "Type of nuclear form-factor 1316 os << "Type of nuclear form-factor " <<nucFormfactor << "\n"; 1486 os << "Screening factor 1317 os << "Screening factor " <<factorScreen << "\n"; 1487 os << "==================================== << 1488 1318 1489 if(fCParameters->Fluo()) { << 1319 os << "=======================================================================" << "\n"; 1490 os << "====== Atomic Deexci 1320 os << "====== Atomic Deexcitation Parameters ========" << "\n"; 1491 os << "==================================== 1321 os << "=======================================================================" << "\n"; 1492 os << "Fluorescence enabled << 1322 os << "Fluorescence enabled " <<fluo << "\n"; 1493 G4String named = "fluor"; << 1323 os << "Fluorescence Bearden data files enabled " <<beardenFluoDir << "\n"; 1494 G4EmFluoDirectory fdir = FluoDirectory(); << 1324 os << "Auger electron production enabled " <<auger << "\n"; 1495 if(fdir == fluoBearden) { named = "fluor_Be << 1325 os << "Auger cascade enabled " <<augerCascade << "\n"; 1496 else if(fdir == fluoANSTO) { named = "fluor << 1326 os << "PIXE atomic de-excitation enabled " <<pixe << "\n"; 1497 else if(fdir == fluoXDB_EADL) { named = "fl << 1327 os << "De-excitation module ignores cuts " <<deexIgnoreCut << "\n"; 1498 os << "Directory in G4LEDATA for fluorescen << 1328 os << "Type of PIXE cross section for hadrons " <<namePIXE << "\n"; 1499 os << "Auger electron cascade enabled << 1329 os << "Type of PIXE cross section for e+- " <<nameElectronPIXE << "\n"; 1500 <<fCParameters->Auger() << "\n"; << 1330 1501 os << "PIXE atomic de-excitation enabled << 1502 os << "De-excitation module ignores cuts << 1503 <<fCParameters->DeexcitationIgnoreCut() << 1504 os << "Type of PIXE cross section for hadro << 1505 <<fCParameters->PIXECrossSectionModel() << 1506 os << "Type of PIXE cross section for e+- << 1507 <<fCParameters->PIXEElectronCrossSection << 1508 os << "==================================== 1331 os << "=======================================================================" << "\n"; 1509 } << 1510 if(fDNA) { << 1511 os << "====== DNA Physics P 1332 os << "====== DNA Physics Parameters ========" << "\n"; 1512 os << "==================================== 1333 os << "=======================================================================" << "\n"; 1513 os << "Use fast sampling in DNA models << 1334 os << "Use fast sampling in DNA models " << dnaFast << "\n"; 1514 << fCParameters->DNAFast() << "\n"; << 1335 os << "Use Stationary option in DNA models " << dnaStationary << "\n"; 1515 os << "Use Stationary option in DNA models << 1336 os << "Use DNA with multiple scattering of e- " << dnaMsc << "\n"; 1516 << fCParameters->DNAStationary() << "\n" << 1337 os << "=======================================================================" << "\n"; 1517 os << "Use DNA with multiple scattering of << 1518 << fCParameters->DNAElectronMsc() << "\n << 1519 os << "Use DNA e- solvation model type << 1520 << fCParameters->DNAeSolvationSubType() << 1521 auto chemModel = fCParameters->GetChemTimeS << 1522 if(fCParameters->GetChemTimeStepModel() != << 1523 { << 1524 std::vector<G4String> ChemModel{"Unknown" << 1525 os << "Use DNA Chemistry model << 1526 << ChemModel.at((std::size_t)chemModel << 1527 } << 1528 os << "==================================== << 1529 } << 1530 os.precision(prec); 1338 os.precision(prec); >> 1339 return os; 1531 } 1340 } 1532 1341 1533 void G4EmParameters::Dump() << 1342 void G4EmParameters::Dump() const 1534 { 1343 { 1535 if(fIsPrinted) return; << 1536 << 1537 #ifdef G4MULTITHREADED << 1538 G4MUTEXLOCK(&emParametersMutex); << 1539 #endif << 1540 StreamInfo(G4cout); 1344 StreamInfo(G4cout); 1541 #ifdef G4MULTITHREADED << 1542 G4MUTEXUNLOCK(&emParametersMutex); << 1543 #endif << 1544 } 1345 } 1545 1346 1546 std::ostream& operator<< (std::ostream& os, c 1347 std::ostream& operator<< (std::ostream& os, const G4EmParameters& par) 1547 { 1348 { 1548 par.StreamInfo(os); << 1349 return par.StreamInfo(os); 1549 return os; << 1550 } 1350 } 1551 1351 1552 G4bool G4EmParameters::IsLocked() const 1352 G4bool G4EmParameters::IsLocked() const 1553 { 1353 { 1554 return (!G4Threading::IsMasterThread() || 1354 return (!G4Threading::IsMasterThread() || 1555 (fStateManager->GetCurrentState() != G4St 1355 (fStateManager->GetCurrentState() != G4State_PreInit && 1556 fStateManager->GetCurrentState() ! 1356 fStateManager->GetCurrentState() != G4State_Init && 1557 fStateManager->GetCurrentState() != G4St 1357 fStateManager->GetCurrentState() != G4State_Idle)); 1558 } 1358 } 1559 1359 1560 << 1561 void G4EmParameters::SetTimeStepModel(const G << 1562 { << 1563 fCParameters-> SetChemTimeStepModel(model); << 1564 } << 1565 << 1566 G4ChemTimeStepModel G4EmParameters::GetTimeSt << 1567 { << 1568 return fCParameters->GetChemTimeStepModel() << 1569 } << 1570 //....oooOO0OOooo........oooOO0OOooo........o 1360 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 1571 1361