Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
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=0)
 
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)

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.

References Clear(), G4cout, G4endl, and n.

Referenced by HadrontherapyPhysicsList::ConstructProcess(), IORTPhysicsList::ConstructProcess(), and ML2PhysicsList::ConstructProcess().

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 }
G4GLOB_DLL std::ostream G4cout
const G4int n
#define G4endl
Definition: G4ios.hh:61
void G4EmConfigurator::Clear ( )

Definition at line 352 of file G4EmConfigurator.cc.

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

353 {
354  particles.clear();
355  processes.clear();
356  models.clear();
357  flucModels.clear();
358  regions.clear();
359  lowEnergy.clear();
360  highEnergy.clear();
361 }
void G4EmConfigurator::PrepareModels ( const G4ParticleDefinition aParticle,
G4VEnergyLossProcess p 
)

Definition at line 229 of file G4EmConfigurator.cc.

References G4VEnergyLossProcess::AddEmModel(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4VProcess::GetProcessName(), n, and G4VEnergyLossProcess::SetFluctModel().

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

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

Definition at line 274 of file G4EmConfigurator.cc.

References G4VEmProcess::AddEmModel(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4VProcess::GetProcessName(), and n.

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

Definition at line 315 of file G4EmConfigurator.cc.

References G4VMultipleScattering::AddEmModel(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4VProcess::GetProcessName(), and n.

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

Definition at line 77 of file G4EmConfigurator.cc.

References G4cout, G4endl, G4VEmModel::GetName(), and python.hepunit::MeV.

84 {
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  if(mod || fm) {
95  models.push_back(mod);
96  flucModels.push_back(fm);
97  } else {
98  models.push_back(new G4DummyModel());
99  flucModels.push_back(0);
100  }
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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4String & GetName() const
Definition: G4VEmModel.hh:753
void G4EmConfigurator::SetVerbose ( G4int  value)
inline

Definition at line 136 of file G4EmConfigurator.hh.

Referenced by G4EmManager::SetVerbose(), and G4LossTableManager::SetVerbose().

137 {
138  verbose = value;
139 }
const XML_Char int const XML_Char * value

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