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