Geant4 10.7.0
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)
 
void Clear ()
 
void SetVerbose (G4int value)
 

Detailed Description

Definition at line 62 of file G4EmConfigurator.hh.

Constructor & Destructor Documentation

◆ G4EmConfigurator()

G4EmConfigurator::G4EmConfigurator ( G4int  verboseLevel = 1)
explicit

Definition at line 64 of file G4EmConfigurator.cc.

64 :verbose(val)
65{
66 index = -10;
67}

◆ ~G4EmConfigurator()

G4EmConfigurator::~G4EmConfigurator ( )

Definition at line 71 of file G4EmConfigurator.cc.

72{}

Member Function Documentation

◆ AddModels()

void G4EmConfigurator::AddModels ( )

Definition at line 110 of file G4EmConfigurator.cc.

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

◆ Clear()

void G4EmConfigurator::Clear ( )

Definition at line 343 of file G4EmConfigurator.cc.

344{
345 particles.clear();
346 processes.clear();
347 models.clear();
348 flucModels.clear();
349 regions.clear();
350 lowEnergy.clear();
351 highEnergy.clear();
352}

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

◆ PrepareModels() [1/3]

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

Definition at line 265 of file G4EmConfigurator.cc.

267{
268 size_t n = particles.size();
269 if(1 < verbose) {
270 G4cout << " G4EmConfigurator::PrepareModels for EM process n= "
271 << n << G4endl;
272 }
273 if(n > 0) {
274 G4String particleName = aParticle->GetParticleName();
275 G4String processName = p->GetProcessName();
276 //G4cout << particleName << " " << particleName << G4endl;
277 for(size_t i=0; i<n; ++i) {
278 if(processName == processes[i]) {
279 if((particleName == particles[i]) ||
280 (particles[i] == "all") ||
281 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
282 G4Region* reg = FindRegion(regions[i]);
283 //G4cout << "Region " << reg << G4endl;
284 if(reg) {
285 --index;
286 G4VEmModel* mod = models[i];
287 if(mod) {
288 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
289 p->AddEmModel(index,mod,reg);
290 if(1 < verbose) {
291 G4cout << "### Added em model order= " << index << " for "
292 << particleName << " and " << processName << G4endl;
293 }
294 }
295 }
296 }
297 }
298 }
299 }
300 }
301}
G4double GetPDGCharge() const
const G4String & GetParticleName() const
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=nullptr)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382

◆ PrepareModels() [2/3]

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

Definition at line 220 of file G4EmConfigurator.cc.

222{
223 size_t n = particles.size();
224 if(1 < verbose) {
225 G4cout << " G4EmConfigurator::PrepareModels for EnergyLoss n= "
226 << n << G4endl;
227 }
228 if(n > 0) {
229 G4String particleName = aParticle->GetParticleName();
230 G4String processName = p->GetProcessName();
231 //G4cout << particleName << " " << processName << G4endl;
232 for(size_t i=0; i<n; ++i) {
233 //G4cout << particles[i] << " " << processes[i] << G4endl;
234 if(processName == processes[i]) {
235 if((particleName == particles[i]) ||
236 (particles[i] == "all") ||
237 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
238 G4Region* reg = FindRegion(regions[i]);
239 //G4cout << "Region " << reg << G4endl;
240 if(reg) {
241 --index;
242 G4VEmModel* mod = models[i];
243 G4VEmFluctuationModel* fm = flucModels[i];
244 if(mod) {
245 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
246 p->AddEmModel(index,mod,fm,reg);
247 if(1 < verbose) {
248 G4cout << "### Added eloss model order= " << index << " for "
249 << particleName << " and " << processName << G4endl;
250 }
251 }
252 } else if(fm) {
253 p->SetFluctModel(fm);
254 }
255 }
256 }
257 }
258 }
259 }
260}
void SetFluctModel(G4VEmFluctuationModel *)
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=nullptr)

Referenced by G4LossTableManager::PreparePhysicsTable().

◆ PrepareModels() [3/3]

void G4EmConfigurator::PrepareModels ( const G4ParticleDefinition aParticle,
G4VMultipleScattering p 
)

Definition at line 306 of file G4EmConfigurator.cc.

308{
309 size_t n = particles.size();
310 if(1 < verbose) {
311 G4cout << " G4EmConfigurator::PrepareModels for MSC process n= "
312 << n << G4endl;
313 }
314
315 if(n > 0) {
316 G4String particleName = aParticle->GetParticleName();
317 G4String processName = p->GetProcessName();
318 for(size_t i=0; i<n; ++i) {
319 if(processName == processes[i]) {
320 if((particleName == particles[i]) ||
321 (particles[i] == "all") ||
322 (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
323 G4Region* reg = FindRegion(regions[i]);
324 if(reg) {
325 --index;
326 G4VEmModel* mod = models[i];
327 if(mod) {
328 if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
329 p->AddEmModel(index,mod,reg);
330 //G4cout << "### Added msc model order= " << index << " for "
331 // << particleName << " and " << processName << G4endl;
332 }
333 }
334 }
335 }
336 }
337 }
338 }
339}
void AddEmModel(G4int order, G4VEmModel *, 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 76 of file G4EmConfigurator.cc.

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

Referenced by G4EmLivermorePolarizedPhysics::ConstructProcess().

◆ 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: