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