Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EmConfigurator Class Reference

#include <G4EmConfigurator.hh>

Public Member Functions

 G4EmConfigurator (G4int verboseLevel=1)
 
 ~G4EmConfigurator ()
 
void SetExtraEmModel (const G4String &particleName, const G4String &processName, G4VEmModel *, const G4String &regionName="", G4double emin=0.0, G4double emax=DBL_MAX, G4VEmFluctuationModel *fm=nullptr)
 
void AddModels ()
 
void PrepareModels (const G4ParticleDefinition *aParticle, G4VEnergyLossProcess *p)
 
void PrepareModels (const G4ParticleDefinition *aParticle, G4VEmProcess *p)
 
void PrepareModels (const G4ParticleDefinition *aParticle, G4VMultipleScattering *p, G4TransportationWithMsc *trans=nullptr)
 
void Clear ()
 
void SetVerbose (G4int value)
 
G4EmConfiguratoroperator= (const G4EmConfigurator &right)=delete
 
 G4EmConfigurator (const G4EmConfigurator &)=delete
 

Detailed Description

Definition at line 63 of file G4EmConfigurator.hh.

Constructor & Destructor Documentation

◆ G4EmConfigurator() [1/2]

G4EmConfigurator::G4EmConfigurator ( G4int verboseLevel = 1)
explicit

Definition at line 66 of file G4EmConfigurator.cc.

66 :verbose(val)
67{
68 index = -10;
69}

◆ ~G4EmConfigurator()

G4EmConfigurator::~G4EmConfigurator ( )
default

◆ G4EmConfigurator() [2/2]

G4EmConfigurator::G4EmConfigurator ( const G4EmConfigurator & )
delete

Member Function Documentation

◆ AddModels()

void G4EmConfigurator::AddModels ( )

Definition at line 111 of file G4EmConfigurator.cc.

112{
113 size_t n = models.size();
114 if(1 < verbose) {
115 G4cout << "### G4EmConfigurator::AddModels n= " << n << G4endl;
116 }
117 if(n > 0) {
118 for(size_t i=0; i<n; ++i) {
119 if(nullptr != models[i]) {
120 const G4Region* reg = G4EmUtility::FindRegion(regions[i]);
121 if(nullptr != reg) {
122 --index;
123 SetModelForRegion(models[i],flucModels[i],reg,
124 particles[i],processes[i],
125 lowEnergy[i],highEnergy[i]);
126 }
127 }
128 }
129 }
130 Clear();
131}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static const G4Region * FindRegion(const G4String &regionName, const G4int verbose=0)

◆ Clear()

void G4EmConfigurator::Clear ( )

Definition at line 381 of file G4EmConfigurator.cc.

382{
383 particles.clear();
384 processes.clear();
385 models.clear();
386 flucModels.clear();
387 regions.clear();
388 lowEnergy.clear();
389 highEnergy.clear();
390}

Referenced by AddModels(), G4LossTableManager::BuildPhysicsTable(), G4LossTableManager::BuildPhysicsTable(), and G4LossTableManager::LocalPhysicsTables().

◆ operator=()

G4EmConfigurator & G4EmConfigurator::operator= ( const G4EmConfigurator & right)
delete

◆ PrepareModels() [1/3]

void G4EmConfigurator::PrepareModels ( const G4ParticleDefinition * aParticle,
G4VEmProcess * p )

Definition at line 298 of file G4EmConfigurator.cc.

300{
301 size_t n = particles.size();
302 if(1 < verbose) {
303 G4cout << " G4EmConfigurator::PrepareModels for EM process n= "
304 << n << G4endl;
305 }
306 if(n > 0) {
307 G4String particleName = aParticle->GetParticleName();
308 G4String processName = p->GetProcessName();
309 //G4cout << particleName << " " << particleName << G4endl;
310 for(size_t i=0; i<n; ++i) {
311 if(processName == processes[i]) {
312 if((particleName == particles[i]) ||
313 (particles[i] == "all") ||
314 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
315 const G4Region* reg = G4EmUtility::FindRegion(regions[i]);
316 //G4cout << "Region " << reg << G4endl;
317 if(nullptr != reg) {
318 --index;
319 G4VEmModel* mod = models[i];
320 if(nullptr != mod) {
321 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
322 p->AddEmModel(index,mod,reg);
323 if(1 < verbose) {
324 G4cout << "### Added em model order= " << index << " for "
325 << particleName << " and " << processName << G4endl;
326 }
327 }
328 }
329 }
330 }
331 }
332 }
333 }
334}
const G4String & GetParticleName() const
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
const G4String & GetProcessName() const

◆ PrepareModels() [2/3]

void G4EmConfigurator::PrepareModels ( const G4ParticleDefinition * aParticle,
G4VEnergyLossProcess * p )

Definition at line 252 of file G4EmConfigurator.cc.

254{
255 size_t n = particles.size();
256 if(1 < verbose) {
257 G4cout << " G4EmConfigurator::PrepareModels for EnergyLoss n= "
258 << n << G4endl;
259 }
260 if(n > 0) {
261 G4String particleName = aParticle->GetParticleName();
262 G4String processName = p->GetProcessName();
263 //G4cout << particleName << " " << processName << G4endl;
264 for(size_t i=0; i<n; ++i) {
265 //G4cout << particles[i] << " " << processes[i] << G4endl;
266 if(processName == processes[i]) {
267 if((particleName == particles[i]) ||
268 (particles[i] == "all") ||
269 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
270 const G4Region* reg = G4EmUtility::FindRegion(regions[i]);
271 //G4cout << "Region " << reg << G4endl;
272 if(nullptr != reg) {
273 --index;
274 G4VEmModel* mod = models[i];
275 G4VEmFluctuationModel* fm = flucModels[i];
276 if(nullptr != mod) {
277 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
278 p->AddEmModel(index,mod,fm,reg);
279 if(1 < verbose) {
280 G4cout << "### Added eloss model order= " << index << " for "
281 << particleName << " and " << processName
282 << " for " << reg->GetName() << G4endl;
283 }
284 }
285 } else if(nullptr != fm) {
286 p->SetFluctModel(fm);
287 }
288 }
289 }
290 }
291 }
292 }
293}
const G4String & GetName() const
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=nullptr, const G4Region *region=nullptr)
void SetFluctModel(G4VEmFluctuationModel *)

Referenced by G4LossTableManager::PreparePhysicsTable(), G4LossTableManager::PreparePhysicsTable(), G4LossTableManager::PreparePhysicsTable(), and G4TransportationWithMsc::PreparePhysicsTable().

◆ PrepareModels() [3/3]

void G4EmConfigurator::PrepareModels ( const G4ParticleDefinition * aParticle,
G4VMultipleScattering * p,
G4TransportationWithMsc * trans = nullptr )

Definition at line 339 of file G4EmConfigurator.cc.

342{
343 size_t n = particles.size();
344 if(1 < verbose) {
345 G4cout << " G4EmConfigurator::PrepareModels for MSC process n= "
346 << n << G4endl;
347 }
348
349 if(n > 0) {
350 G4String particleName = aParticle->GetParticleName();
351 G4String processName = (nullptr == p) ? G4String("msc") : p->GetProcessName();
352 for(size_t i=0; i<n; ++i) {
353 if(processName == processes[i]) {
354 if((particleName == particles[i]) ||
355 (particles[i] == "all") ||
356 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
357 const G4Region* reg = G4EmUtility::FindRegion(regions[i]);
358 if(nullptr != reg) {
359 --index;
360 auto mod = dynamic_cast<G4VMscModel*>(models[i]);
361 if(nullptr != mod) {
362 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
363 if(nullptr != p) {
364 p->AddEmModel(index,mod,reg);
365 } else {
366 trans->AddMscModel(mod,index,reg);
367 }
368 //G4cout << "### Added msc model order= " << index << " for "
369 // << particleName << " and " << processName << G4endl;
370 }
371 }
372 }
373 }
374 }
375 }
376 }
377}
void AddMscModel(G4VMscModel *mscModel, G4int order=0, const G4Region *region=nullptr)
void AddEmModel(G4int order, G4VMscModel *, const G4Region *region=nullptr)

◆ SetExtraEmModel()

void G4EmConfigurator::SetExtraEmModel ( const G4String & particleName,
const G4String & processName,
G4VEmModel * mod,
const G4String & regionName = "",
G4double emin = 0.0,
G4double emax = DBL_MAX,
G4VEmFluctuationModel * fm = nullptr )

Definition at line 77 of file G4EmConfigurator.cc.

84{
85 if(nullptr == mod) { return; }
86 if(1 < verbose) {
87 G4cout << " G4EmConfigurator::SetExtraEmModel " << mod->GetName()
88 << " for " << particleName
89 << " and " << processName
90 << " in the region <" << regionName
91 << "> Emin(MeV)= " << emin/MeV
92 << " Emax(MeV)= " << emax/MeV
93 << G4endl;
94 }
95
96 models.push_back(mod);
97 flucModels.push_back(fm);
98 G4double emin0 = std::max(emin, mod->LowEnergyLimit());
99 G4double emax0 = std::min(emax, mod->HighEnergyLimit());
101
102 particles.push_back(particleName);
103 processes.push_back(processName);
104 regions.push_back(regionName);
105 lowEnergy.push_back(emin0);
106 highEnergy.push_back(emax0);
107}
double G4double
Definition G4Types.hh:83
G4double LowEnergyLimit() const
G4double HighEnergyLimit() const
void SetActivationHighEnergyLimit(G4double)
const G4String & GetName() const

◆ SetVerbose()

void G4EmConfigurator::SetVerbose ( G4int value)
inline

Definition at line 135 of file G4EmConfigurator.hh.

136{
137 verbose = value;
138}

Referenced by G4LossTableManager::ResetParameters().


The documentation for this class was generated from the following files: