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

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

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

Definition at line 80 of file G4BremsstrahlungParameters.cc.

References energy(), G4VEMDataSet::FindValue(), G4cout, G4endl, G4VEMDataSet::GetEnergies(), G4INCL::Math::max(), and G4INCL::Math::min().

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

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 }
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
int G4int
Definition: G4Types.hh:78
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
G4GLOB_DLL std::ostream G4cout
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
const XML_Char int const XML_Char * value
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double G4BremsstrahlungParameters::ParameterC ( G4int  index) const

Definition at line 249 of file G4BremsstrahlungParameters.cc.

References FatalException, G4Exception(), and n.

Referenced by G4eBremsstrahlungSpectrum::AverageEnergy().

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 }
int G4int
Definition: G4Types.hh:78
const G4int n
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void G4BremsstrahlungParameters::PrintData ( void  ) const

Definition at line 265 of file G4BremsstrahlungParameters.cc.

References G4cout, G4endl, and G4VEMDataSet::PrintData().

Referenced by G4eBremsstrahlungSpectrum::PrintData().

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 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
virtual void PrintData(void) const =0
#define G4endl
Definition: G4ios.hh:61

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