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 // 28 // 29 // GEANT4 Class 29 // GEANT4 Class 30 // 30 // 31 // File name: G4EmConfigurator 31 // File name: G4EmConfigurator 32 // 32 // 33 // Author: Vladimir Ivanchenko 33 // Author: Vladimir Ivanchenko 34 // 34 // 35 // Creation date: 14.07.2008 35 // Creation date: 14.07.2008 36 // 36 // 37 // Modifications: 37 // Modifications: 38 // 38 // 39 // Class Description: 39 // Class Description: 40 // 40 // 41 // This class provides configuration EM models 41 // This class provides configuration EM models for 42 // particles/processes/regions 42 // particles/processes/regions 43 // 43 // 44 44 45 // ------------------------------------------- 45 // ------------------------------------------------------------------- 46 // 46 // 47 47 48 #include "G4EmConfigurator.hh" 48 #include "G4EmConfigurator.hh" 49 #include "G4EmUtility.hh" << 50 #include "G4SystemOfUnits.hh" 49 #include "G4SystemOfUnits.hh" 51 #include "G4ParticleTable.hh" 50 #include "G4ParticleTable.hh" 52 #include "G4ParticleDefinition.hh" 51 #include "G4ParticleDefinition.hh" 53 #include "G4ProcessManager.hh" 52 #include "G4ProcessManager.hh" 54 #include "G4VProcess.hh" 53 #include "G4VProcess.hh" 55 #include "G4ProcessVector.hh" 54 #include "G4ProcessVector.hh" 56 #include "G4RegionStore.hh" 55 #include "G4RegionStore.hh" 57 #include "G4Region.hh" 56 #include "G4Region.hh" 58 #include "G4DummyModel.hh" 57 #include "G4DummyModel.hh" 59 #include "G4VEnergyLossProcess.hh" 58 #include "G4VEnergyLossProcess.hh" 60 #include "G4VEmProcess.hh" 59 #include "G4VEmProcess.hh" 61 #include "G4VMultipleScattering.hh" 60 #include "G4VMultipleScattering.hh" 62 #include "G4TransportationWithMsc.hh" << 63 61 64 //....oooOO0OOooo........oooOO0OOooo........oo 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 65 63 66 G4EmConfigurator::G4EmConfigurator(G4int val): 64 G4EmConfigurator::G4EmConfigurator(G4int val):verbose(val) 67 { 65 { 68 index = -10; 66 index = -10; 69 } 67 } 70 68 71 //....oooOO0OOooo........oooOO0OOooo........oo 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 70 73 G4EmConfigurator::~G4EmConfigurator() = defaul << 71 G4EmConfigurator::~G4EmConfigurator() >> 72 {} 74 73 75 //....oooOO0OOooo........oooOO0OOooo........oo 74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 76 75 77 void G4EmConfigurator::SetExtraEmModel(const G 76 void G4EmConfigurator::SetExtraEmModel(const G4String& particleName, 78 const G 77 const G4String& processName, 79 G4VEmMo 78 G4VEmModel* mod, 80 const G 79 const G4String& regionName, 81 G4doubl 80 G4double emin, 82 G4doubl 81 G4double emax, 83 G4VEmFl 82 G4VEmFluctuationModel* fm) 84 { 83 { 85 if(nullptr == mod) { return; } 84 if(nullptr == mod) { return; } 86 if(1 < verbose) { 85 if(1 < verbose) { 87 G4cout << " G4EmConfigurator::SetExtraEmMo 86 G4cout << " G4EmConfigurator::SetExtraEmModel " << mod->GetName() 88 << " for " << particleName 87 << " for " << particleName 89 << " and " << processName 88 << " and " << processName 90 << " in the region <" << regionName 89 << " in the region <" << regionName 91 << "> Emin(MeV)= " << emin/MeV 90 << "> Emin(MeV)= " << emin/MeV 92 << " Emax(MeV)= " << emax/MeV 91 << " Emax(MeV)= " << emax/MeV 93 << G4endl; 92 << G4endl; 94 } 93 } 95 94 96 models.push_back(mod); 95 models.push_back(mod); 97 flucModels.push_back(fm); 96 flucModels.push_back(fm); 98 G4double emin0 = std::max(emin, mod->LowEner 97 G4double emin0 = std::max(emin, mod->LowEnergyLimit()); 99 G4double emax0 = std::min(emax, mod->HighEne 98 G4double emax0 = std::min(emax, mod->HighEnergyLimit()); 100 mod->SetActivationHighEnergyLimit(emax0); 99 mod->SetActivationHighEnergyLimit(emax0); 101 100 102 particles.push_back(particleName); 101 particles.push_back(particleName); 103 processes.push_back(processName); 102 processes.push_back(processName); 104 regions.push_back(regionName); 103 regions.push_back(regionName); 105 lowEnergy.push_back(emin0); 104 lowEnergy.push_back(emin0); 106 highEnergy.push_back(emax0); 105 highEnergy.push_back(emax0); 107 } 106 } 108 107 109 //....oooOO0OOooo........oooOO0OOooo........oo 108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 110 109 111 void G4EmConfigurator::AddModels() 110 void G4EmConfigurator::AddModels() 112 { 111 { 113 size_t n = models.size(); 112 size_t n = models.size(); 114 if(1 < verbose) { << 113 if(0 < verbose) { 115 G4cout << "### G4EmConfigurator::AddModels 114 G4cout << "### G4EmConfigurator::AddModels n= " << n << G4endl; 116 } 115 } 117 if(n > 0) { 116 if(n > 0) { 118 for(size_t i=0; i<n; ++i) { 117 for(size_t i=0; i<n; ++i) { 119 if(nullptr != models[i]) { 118 if(nullptr != models[i]) { 120 const G4Region* reg = G4EmUtility::Fin << 119 const G4Region* reg = FindRegion(regions[i]); 121 if(nullptr != reg) { 120 if(nullptr != reg) { 122 --index; 121 --index; 123 SetModelForRegion(models[i],flucMode 122 SetModelForRegion(models[i],flucModels[i],reg, 124 particles[i],proce 123 particles[i],processes[i], 125 lowEnergy[i],highE 124 lowEnergy[i],highEnergy[i]); 126 } 125 } 127 } 126 } 128 } 127 } 129 } 128 } 130 Clear(); 129 Clear(); 131 } 130 } 132 131 133 //....oooOO0OOooo........oooOO0OOooo........oo 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 134 133 135 void G4EmConfigurator::SetModelForRegion(G4VEm 134 void G4EmConfigurator::SetModelForRegion(G4VEmModel* mod, 136 G4VEm 135 G4VEmFluctuationModel* fm, 137 const 136 const G4Region* reg, 138 const 137 const G4String& particleName, 139 const 138 const G4String& processName, 140 G4dou 139 G4double emin, G4double emax) 141 { 140 { 142 if(nullptr == mod) { return; } 141 if(nullptr == mod) { return; } 143 if(1 < verbose) { 142 if(1 < verbose) { 144 G4cout << " G4EmConfigurator::SetModelForR 143 G4cout << " G4EmConfigurator::SetModelForRegion: " << mod->GetName() 145 << G4endl; 144 << G4endl; 146 G4cout << " For " << particleName 145 G4cout << " For " << particleName 147 << " and " << processName 146 << " and " << processName 148 << " in the region <" << reg->GetNa 147 << " in the region <" << reg->GetName() 149 << " Emin(MeV)= " << emin/MeV 148 << " Emin(MeV)= " << emin/MeV 150 << " Emax(MeV)= " << emax/MeV; 149 << " Emax(MeV)= " << emax/MeV; 151 if(nullptr != fm) { G4cout << " FLmodel " 150 if(nullptr != fm) { G4cout << " FLmodel " << fm->GetName(); } 152 G4cout << G4endl; 151 G4cout << G4endl; 153 } 152 } 154 153 155 // Loop checking, 03-Aug-2015, Vladimir Ivan 154 // Loop checking, 03-Aug-2015, Vladimir Ivanchenko 156 auto myParticleIterator = G4ParticleTable::G 155 auto myParticleIterator = G4ParticleTable::GetParticleTable()->GetIterator(); 157 myParticleIterator->reset(); 156 myParticleIterator->reset(); 158 while( (*myParticleIterator)() ) { 157 while( (*myParticleIterator)() ) { 159 const G4ParticleDefinition* part = myParti 158 const G4ParticleDefinition* part = myParticleIterator->value(); 160 159 161 if((part->GetParticleName() == particleNam 160 if((part->GetParticleName() == particleName) || 162 (particleName == "all") || 161 (particleName == "all") || 163 (particleName == "charged" && part->Get 162 (particleName == "charged" && part->GetPDGCharge() != 0.0)) { 164 163 165 // search for process 164 // search for process 166 G4ProcessManager* pmanager = part->GetPr 165 G4ProcessManager* pmanager = part->GetProcessManager(); 167 G4ProcessVector* plist = pmanager->GetPr 166 G4ProcessVector* plist = pmanager->GetProcessList(); 168 G4int np = pmanager->GetProcessListLengt 167 G4int np = pmanager->GetProcessListLength(); 169 168 170 if(1 < verbose) { 169 if(1 < verbose) { 171 G4cout << "Check process <" << process << 170 G4cout << "Check process <" << processName << "> for " 172 << np << " processes" << G4endl << 171 << particleName << " in list of " << np << " processes" >> 172 << G4endl; 173 } 173 } 174 G4VProcess* proc = nullptr; 174 G4VProcess* proc = nullptr; 175 for(G4int i=0; i<np; ++i) { 175 for(G4int i=0; i<np; ++i) { 176 if(processName == (*plist)[i]->GetProc 176 if(processName == (*plist)[i]->GetProcessName()) { 177 proc = (*plist)[i]; 177 proc = (*plist)[i]; 178 break; 178 break; 179 } 179 } 180 } 180 } 181 if(nullptr == proc) { 181 if(nullptr == proc) { 182 if(processName == "msc") { << 182 G4cout << "### G4EmConfigurator WARNING: fails to find a process <" 183 for (G4int i = 0; i < np; ++i) { << 183 << processName << "> for " << particleName << G4endl; 184 auto* trans = dynamic_cast<G4Trans << 184 return; 185 if (nullptr != trans) { << 185 } 186 G4cout << "G4TransportationWithM << 187 proc = trans; << 188 break; << 189 } << 190 } << 191 } << 192 if (nullptr == proc) { << 193 if (0 < verbose) { << 194 G4cout << "### G4EmConfigurator WA << 195 << "> for " << particleName << 196 } << 197 return; << 198 } << 199 } << 200 186 201 if(!UpdateModelEnergyRange(mod, emin, em 187 if(!UpdateModelEnergyRange(mod, emin, emax)) { return; } 202 // classify process 188 // classify process 203 G4int ii = proc->GetProcessSubType(); 189 G4int ii = proc->GetProcessSubType(); 204 auto msc = dynamic_cast<G4VMscModel*>(mo << 190 if(10 == ii) { 205 if (nullptr != msc) { << 191 G4VMultipleScattering* p = static_cast<G4VMultipleScattering*>(proc); 206 if (auto* trans = dynamic_cast<G4Trans << 192 p->AddEmModel(index,mod,reg); 207 trans->AddMscModel(msc, index, reg); << 193 if(1 < verbose) { 208 if (1 < verbose) { << 194 G4cout << "### Added msc model order= " << index << " for " 209 G4cout << "### Added msc model ord << 195 << particleName << " and " << processName << G4endl; 210 << proc->GetProcessName() < << 196 } 211 } << 197 } else if(2 <= ii && 4 >= ii) { 212 } << 198 G4VEnergyLossProcess* p = static_cast<G4VEnergyLossProcess*>(proc); 213 else if (10 == ii) { << 199 p->AddEmModel(index,mod,fm,reg); 214 auto p = dynamic_cast<G4VMultipleSca << 200 if(1 < verbose) { 215 if (nullptr != p) { << 201 G4cout << "### Added eloss model order= " << index << " for " 216 p->AddEmModel(index, msc, reg); << 202 << particleName << " and " << processName << G4endl; 217 if (1 < verbose) { << 203 } 218 G4cout << "### Added msc model o << 204 } else { 219 << processName << G4endl; << 205 G4VEmProcess* p = static_cast<G4VEmProcess*>(proc); 220 } << 206 p->AddEmModel(index,mod,reg); 221 } << 207 if(1 < verbose) { 222 } << 208 G4cout << "### Added em model order= " << index << " for " 223 else { << 209 << particleName << " and " << processName << G4endl; 224 G4cout << "### Unable to add msc mod << 225 << G4endl; << 226 } << 227 } << 228 else if (2 <= ii && 4 >= ii) { << 229 auto p = dynamic_cast<G4VEnergyLossPro << 230 if (nullptr != p) { << 231 p->AddEmModel(index, mod, fm, reg); << 232 if (1 < verbose) { << 233 G4cout << "### Added eloss model o << 234 << processName << G4endl; << 235 } << 236 } << 237 } << 238 else { << 239 auto p = dynamic_cast<G4VEmProcess*>(p << 240 if (nullptr != p) { << 241 p->AddEmModel(index, mod, reg); << 242 if (1 < verbose) { << 243 G4cout << "### Added em model orde << 244 << processName << G4endl; << 245 } << 246 } << 247 else { << 248 G4cout << "### Unable to add em mode << 249 << G4endl; << 250 } 210 } 251 } << 211 } 252 return; 212 return; 253 } 213 } 254 } 214 } 255 } 215 } 256 216 257 //....oooOO0OOooo........oooOO0OOooo........oo 217 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 258 218 259 void 219 void 260 G4EmConfigurator::PrepareModels(const G4Partic 220 G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle, 261 G4VEnergyLossP 221 G4VEnergyLossProcess* p) 262 { 222 { 263 size_t n = particles.size(); 223 size_t n = particles.size(); 264 if(1 < verbose) { 224 if(1 < verbose) { 265 G4cout << " G4EmConfigurator::PrepareModel 225 G4cout << " G4EmConfigurator::PrepareModels for EnergyLoss n= " 266 << n << G4endl; 226 << n << G4endl; 267 } 227 } 268 if(n > 0) { 228 if(n > 0) { 269 G4String particleName = aParticle->GetPart 229 G4String particleName = aParticle->GetParticleName(); 270 G4String processName = p->GetProcessName( 230 G4String processName = p->GetProcessName(); 271 //G4cout << particleName << " " << proc 231 //G4cout << particleName << " " << processName << G4endl; 272 for(size_t i=0; i<n; ++i) { 232 for(size_t i=0; i<n; ++i) { 273 //G4cout << particles[i] << " " << pr 233 //G4cout << particles[i] << " " << processes[i] << G4endl; 274 if(processName == processes[i]) { 234 if(processName == processes[i]) { 275 if((particleName == particles[i]) || 235 if((particleName == particles[i]) || 276 (particles[i] == "all") || 236 (particles[i] == "all") || 277 (particles[i] == "charged" && aPart 237 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) { 278 const G4Region* reg = G4EmUtility::F << 238 const G4Region* reg = FindRegion(regions[i]); 279 //G4cout << "Region " << reg << G4en 239 //G4cout << "Region " << reg << G4endl; 280 if(nullptr != reg) { 240 if(nullptr != reg) { 281 --index; 241 --index; 282 G4VEmModel* mod = models[i]; 242 G4VEmModel* mod = models[i]; 283 G4VEmFluctuationModel* fm = flucMo 243 G4VEmFluctuationModel* fm = flucModels[i]; 284 if(nullptr != mod) { 244 if(nullptr != mod) { 285 if(UpdateModelEnergyRange(mod, l 245 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) { 286 p->AddEmModel(index,mod,fm,reg 246 p->AddEmModel(index,mod,fm,reg); 287 if(1 < verbose) { 247 if(1 < verbose) { 288 G4cout << "### Added eloss m << 248 G4cout << "### Added eloss model order= " << index << " for " 289 << " and " << process << 249 << particleName << " and " << processName >> 250 << " for " << reg->GetName() << G4endl; 290 } 251 } 291 } 252 } 292 } else if(nullptr != fm) { 253 } else if(nullptr != fm) { 293 p->SetFluctModel(fm); 254 p->SetFluctModel(fm); 294 } 255 } 295 } 256 } 296 } 257 } 297 } 258 } 298 } 259 } 299 } 260 } 300 } 261 } 301 262 302 //....oooOO0OOooo........oooOO0OOooo........oo 263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 303 264 304 void 265 void 305 G4EmConfigurator::PrepareModels(const G4Partic 266 G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle, 306 G4VEmProcess* 267 G4VEmProcess* p) 307 { 268 { 308 size_t n = particles.size(); 269 size_t n = particles.size(); 309 if(1 < verbose) { 270 if(1 < verbose) { 310 G4cout << " G4EmConfigurator::PrepareModel 271 G4cout << " G4EmConfigurator::PrepareModels for EM process n= " 311 << n << G4endl; 272 << n << G4endl; 312 } 273 } 313 if(n > 0) { 274 if(n > 0) { 314 G4String particleName = aParticle->GetPart 275 G4String particleName = aParticle->GetParticleName(); 315 G4String processName = p->GetProcessName( 276 G4String processName = p->GetProcessName(); 316 //G4cout << particleName << " " << part 277 //G4cout << particleName << " " << particleName << G4endl; 317 for(size_t i=0; i<n; ++i) { 278 for(size_t i=0; i<n; ++i) { 318 if(processName == processes[i]) { 279 if(processName == processes[i]) { 319 if((particleName == particles[i]) || 280 if((particleName == particles[i]) || 320 (particles[i] == "all") || 281 (particles[i] == "all") || 321 (particles[i] == "charged" && aPart 282 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) { 322 const G4Region* reg = G4EmUtility::F << 283 const G4Region* reg = FindRegion(regions[i]); 323 //G4cout << "Region " << reg << G4en 284 //G4cout << "Region " << reg << G4endl; 324 if(nullptr != reg) { 285 if(nullptr != reg) { 325 --index; 286 --index; 326 G4VEmModel* mod = models[i]; 287 G4VEmModel* mod = models[i]; 327 if(nullptr != mod) { 288 if(nullptr != mod) { 328 if(UpdateModelEnergyRange(mod, l 289 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) { 329 p->AddEmModel(index,mod,reg); 290 p->AddEmModel(index,mod,reg); 330 if(1 < verbose) { 291 if(1 < verbose) { 331 G4cout << "### Added em mode 292 G4cout << "### Added em model order= " << index << " for " 332 << particleName << " 293 << particleName << " and " << processName << G4endl; 333 } 294 } 334 } 295 } 335 } 296 } 336 } 297 } 337 } 298 } 338 } 299 } 339 } 300 } 340 } 301 } 341 } 302 } 342 303 343 //....oooOO0OOooo........oooOO0OOooo........oo 304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 344 305 345 void 306 void 346 G4EmConfigurator::PrepareModels(const G4Partic 307 G4EmConfigurator::PrepareModels(const G4ParticleDefinition* aParticle, 347 G4VMultipleSca << 308 G4VMultipleScattering* p) 348 G4Transportati << 349 { 309 { 350 size_t n = particles.size(); 310 size_t n = particles.size(); 351 if(1 < verbose) { 311 if(1 < verbose) { 352 G4cout << " G4EmConfigurator::PrepareModel 312 G4cout << " G4EmConfigurator::PrepareModels for MSC process n= " 353 << n << G4endl; 313 << n << G4endl; 354 } 314 } 355 315 356 if(n > 0) { 316 if(n > 0) { 357 G4String particleName = aParticle->GetPart << 317 G4String particleName = aParticle->GetParticleName(); 358 G4String processName = (nullptr == p) ? G4 << 318 G4String processName = p->GetProcessName(); 359 for(size_t i=0; i<n; ++i) { 319 for(size_t i=0; i<n; ++i) { 360 if(processName == processes[i]) { 320 if(processName == processes[i]) { 361 if ((particleName == particles[i]) || << 321 if((particleName == particles[i]) || 362 || (particles[i] == "charged" && a << 322 (particles[i] == "all") || 363 { << 323 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) { 364 const G4Region* reg = G4EmUtility::F << 324 const G4Region* reg = FindRegion(regions[i]); 365 if (nullptr != reg) { << 325 if(nullptr != reg) { 366 --index; 326 --index; 367 auto mod = dynamic_cast<G4VMscMode << 327 G4VEmModel* mod = models[i]; 368 if(nullptr != mod) { 328 if(nullptr != mod) { 369 if(UpdateModelEnergyRange(mod, l << 329 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) { 370 if(nullptr != p) { << 330 p->AddEmModel(index,mod,reg); 371 p->AddEmModel(index, mod, re << 372 } << 373 else { << 374 trans->AddMscModel(mod, inde << 375 } << 376 //G4cout << "### Added msc mod 331 //G4cout << "### Added msc model order= " << index << " for " 377 // << particleName << " and << 332 // << particleName << " and " << processName << G4endl; 378 } 333 } 379 } 334 } 380 } 335 } 381 } 336 } 382 } 337 } 383 } 338 } 384 } 339 } 385 } 340 } 386 341 387 //....oooOO0OOooo........oooOO0OOooo........oo 342 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 388 343 389 void G4EmConfigurator::Clear() 344 void G4EmConfigurator::Clear() 390 { 345 { 391 particles.clear(); 346 particles.clear(); 392 processes.clear(); 347 processes.clear(); 393 models.clear(); 348 models.clear(); 394 flucModels.clear(); 349 flucModels.clear(); 395 regions.clear(); 350 regions.clear(); 396 lowEnergy.clear(); 351 lowEnergy.clear(); 397 highEnergy.clear(); 352 highEnergy.clear(); >> 353 } >> 354 >> 355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 356 >> 357 const G4Region* G4EmConfigurator::FindRegion(const G4String& regionName) >> 358 { >> 359 // search for region >> 360 const G4Region* reg = nullptr; >> 361 G4RegionStore* regStore = G4RegionStore::GetInstance(); >> 362 G4String r = regionName; >> 363 if(r == "" || r == "world" || r == "World") { >> 364 r = "DefaultRegionForTheWorld"; >> 365 } >> 366 reg = regStore->GetRegion(r, true); >> 367 if(nullptr == reg) { >> 368 G4cout << "### G4EmConfigurator WARNING: fails to find a region <" >> 369 << r << G4endl; >> 370 } else if(verbose > 1) { >> 371 G4cout << "### G4EmConfigurator finds out G4Region <" << r << ">" >> 372 << G4endl; >> 373 } >> 374 return reg; 398 } 375 } 399 376 400 //....oooOO0OOooo........oooOO0OOooo........oo 377 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 401 378 402 G4bool G4EmConfigurator::UpdateModelEnergyRang 379 G4bool G4EmConfigurator::UpdateModelEnergyRange(G4VEmModel* mod, 403 380 G4double emin, G4double emax) 404 { 381 { 405 // energy limits 382 // energy limits 406 G4double e1 = std::max(emin,mod->LowEnergyLi 383 G4double e1 = std::max(emin,mod->LowEnergyLimit()); 407 G4double e2 = std::min(emax,mod->HighEnergyL 384 G4double e2 = std::min(emax,mod->HighEnergyLimit()); 408 if(e2 <= e1) { 385 if(e2 <= e1) { 409 G4cout << "### G4EmConfigurator WARNING: e 386 G4cout << "### G4EmConfigurator WARNING: empty energy interval" 410 << " for <" << mod->GetName() 387 << " for <" << mod->GetName() 411 << "> Emin(MeV)= " << e1/CLHEP::Me 388 << "> Emin(MeV)= " << e1/CLHEP::MeV 412 << "> Emax(MeV)= " << e2/CLHEP::Me 389 << "> Emax(MeV)= " << e2/CLHEP::MeV 413 << G4endl; 390 << G4endl; 414 return false; 391 return false; 415 } 392 } 416 mod->SetLowEnergyLimit(e1); 393 mod->SetLowEnergyLimit(e1); 417 mod->SetHighEnergyLimit(e2); 394 mod->SetHighEnergyLimit(e2); 418 if(verbose > 1) { 395 if(verbose > 1) { 419 G4cout << "### G4EmConfigurator for " << m 396 G4cout << "### G4EmConfigurator for " << mod->GetName() 420 << " Emin(MeV)= " << e1/MeV << " Em 397 << " Emin(MeV)= " << e1/MeV << " Emax(MeV)= " << e2/MeV 421 << G4endl; 398 << G4endl; 422 } 399 } 423 return true; 400 return true; 424 } 401 } 425 402 426 //....oooOO0OOooo........oooOO0OOooo........oo 403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 427 404