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

#include <G4BremsstrahlungParameters.hh>

Public Member Functions

 G4BremsstrahlungParameters (const G4String &name, size_t num, G4int minZ=1, G4int maxZ=99)
 
 ~G4BremsstrahlungParameters ()
 
G4double Parameter (G4int parameterIndex, G4int Z, G4double energy) const
 
G4double ParameterC (G4int index) const
 
void PrintData () const
 

Detailed Description

Definition at line 62 of file G4BremsstrahlungParameters.hh.

Constructor & Destructor Documentation

◆ G4BremsstrahlungParameters()

G4BremsstrahlungParameters::G4BremsstrahlungParameters ( const G4String name,
size_t  num,
G4int  minZ = 1,
G4int  maxZ = 99 
)

Definition at line 54 of file G4BremsstrahlungParameters.cc.

56 : zMin(minZ),
57 zMax(maxZ),
58 length(num)
59{
60 LoadData(name);
61}

◆ ~G4BremsstrahlungParameters()

G4BremsstrahlungParameters::~G4BremsstrahlungParameters ( )

Definition at line 64 of file G4BremsstrahlungParameters.cc.

65{
66 // Reset the map of data sets: remove the data sets from the map
67 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::iterator pos;
68
69 for (pos = param.begin(); pos != param.end(); ++pos)
70 {
71 G4VEMDataSet* dataSet = (*pos).second;
72 delete dataSet;
73 }
74
75 activeZ.clear();
76 paramC.clear();
77}

Member Function Documentation

◆ Parameter()

G4double G4BremsstrahlungParameters::Parameter ( G4int  parameterIndex,
G4int  Z,
G4double  energy 
) const

Definition at line 80 of file G4BremsstrahlungParameters.cc.

83{
84 G4double value = 0.;
85 G4int id = Z*length + parameterIndex;
86 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator pos;
87
88 pos = param.find(id);
89 if (pos!= param.end()) {
90
91 G4VEMDataSet* dataSet = (*pos).second;
92 const G4DataVector ener = dataSet->GetEnergies(0);
93 G4double ee = std::max(ener.front(),std::min(ener.back(),energy));
94 value = dataSet->FindValue(ee);
95
96 } else {
97 G4cout << "WARNING: G4BremsstrahlungParameters::FindValue "
98 << "did not find ID = "
99 << id << G4endl;
100 }
101
102 return value;
103}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
virtual G4double FindValue(G4double x, G4int componentId=0) const =0

Referenced by G4eBremsstrahlungSpectrum::AverageEnergy(), G4eBremsstrahlungSpectrum::Probability(), and G4eBremsstrahlungSpectrum::SampleEnergy().

◆ ParameterC()

G4double G4BremsstrahlungParameters::ParameterC ( G4int  index) const

Definition at line 249 of file G4BremsstrahlungParameters.cc.

250{
251 G4int n = paramC.size();
252 if (id < 0 || id >= n)
253 {
254 G4String stringConversion2(id);
255 G4String ex = "Wrong id " + stringConversion2;
256 G4Exception("G4BremsstrahlungParameters::ParameterC",
257 "em1002",FatalException,ex);
258
259 }
260
261 return paramC[id];
262}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4eBremsstrahlungSpectrum::AverageEnergy().

◆ PrintData()

void G4BremsstrahlungParameters::PrintData ( ) const

Definition at line 265 of file G4BremsstrahlungParameters.cc.

266{
267
268 G4cout << G4endl;
269 G4cout << "===== G4BremsstrahlungParameters =====" << G4endl;
270 G4cout << G4endl;
271 G4cout << "===== Parameters =====" << G4endl;
272 G4cout << G4endl;
273
274 size_t nZ = activeZ.size();
275 std::map<G4int,G4VEMDataSet*,std::less<G4int> >::const_iterator pos;
276
277 for (size_t j=0; j<nZ; j++) {
278 G4int Z = (G4int)activeZ[j];
279
280 for (size_t i=0; i<length; i++) {
281
282 pos = param.find(Z*length + i);
283 if (pos!= param.end()) {
284
285 G4cout << "===== Z= " << Z
286 << " parameter[" << i << "] ====="
287 << G4endl;
288 G4VEMDataSet* dataSet = (*pos).second;
289 dataSet->PrintData();
290 }
291 }
292 }
293
294 G4cout << "==========================================" << G4endl;
295}
virtual void PrintData(void) const =0

Referenced by G4eBremsstrahlungSpectrum::PrintData().


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