Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 63 of file G4EmConfigurator.hh.

Constructor & Destructor Documentation

G4EmConfigurator::G4EmConfigurator ( G4int  verboseLevel = 1)
explicit

Definition at line 65 of file G4EmConfigurator.cc.

65  :verbose(val)
66 {
67  index = -10;
68 }
G4EmConfigurator::~G4EmConfigurator ( )

Definition at line 72 of file G4EmConfigurator.cc.

73 {}

Member Function Documentation

void G4EmConfigurator::AddModels ( )

Definition at line 111 of file G4EmConfigurator.cc.

112 {
113  size_t n = models.size();
114  if(0 < verbose) {
115  G4cout << "### G4EmConfigurator::AddModels n= " << n << G4endl;
116  }
117  if(n > 0) {
118  for(size_t i=0; i<n; ++i) {
119  if(models[i]) {
120  G4Region* reg = FindRegion(regions[i]);
121  if(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 }
static const G4double reg
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4EmConfigurator::Clear ( )

Definition at line 349 of file G4EmConfigurator.cc.

350 {
351  particles.clear();
352  processes.clear();
353  models.clear();
354  flucModels.clear();
355  regions.clear();
356  lowEnergy.clear();
357  highEnergy.clear();
358 }

Here is the caller graph for this function:

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

Definition at line 226 of file G4EmConfigurator.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 271 of file G4EmConfigurator.cc.

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

Here is the call graph for this function:

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

Definition at line 312 of file G4EmConfigurator.cc.

314 {
315  size_t n = particles.size();
316  if(1 < verbose) {
317  G4cout << " G4EmConfigurator::PrepareModels for MSC process n= "
318  << n << G4endl;
319  }
320 
321  if(n > 0) {
322  G4String particleName = aParticle->GetParticleName();
323  G4String processName = p->GetProcessName();
324  for(size_t i=0; i<n; ++i) {
325  if(processName == processes[i]) {
326  if((particleName == particles[i]) ||
327  (particles[i] == "all") ||
328  (particles[i] == "charged" && aParticle->GetPDGCharge() != 0.0)) {
329  G4Region* reg = FindRegion(regions[i]);
330  if(reg) {
331  --index;
332  G4VEmModel* mod = models[i];
333  if(mod) {
334  if(UpdateModelEnergyRange(mod, lowEnergy[i], highEnergy[i])) {
335  p->AddEmModel(index,mod,reg);
336  //G4cout << "### Added msc model order= " << index << " for "
337  // << particleName << " and " << processName << G4endl;
338  }
339  }
340  }
341  }
342  }
343  }
344  }
345 }
const G4String & GetParticleName() const
static const G4double reg
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
void AddEmModel(G4int order, G4VEmModel *, const G4Region *region=nullptr)
#define G4endl
Definition: G4ios.hh:61
G4double GetPDGCharge() const

Here is the call graph for this function:

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(!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  emin = std::max(emin, mod->LowEnergyLimit());
99  emax = std::min(emax, mod->HighEnergyLimit());
100  mod->SetActivationHighEnergyLimit(emax);
101 
102  particles.push_back(particleName);
103  processes.push_back(processName);
104  regions.push_back(regionName);
105  lowEnergy.push_back(emin);
106  highEnergy.push_back(emax);
107 }
void SetActivationHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:738
G4double LowEnergyLimit() const
Definition: G4VEmModel.hh:640
G4double HighEnergyLimit() const
Definition: G4VEmModel.hh:633
G4GLOB_DLL std::ostream G4cout
static const G4double emax
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
const G4String & GetName() const
Definition: G4VEmModel.hh:794

Here is the call graph for this function:

void G4EmConfigurator::SetVerbose ( G4int  value)
inline

Definition at line 136 of file G4EmConfigurator.hh.

137 {
138  verbose = value;
139 }
const XML_Char int const XML_Char * value
Definition: expat.h:331

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