Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RDBremsstrahlungParameters Class Reference

#include <G4RDBremsstrahlungParameters.hh>

Public Member Functions

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

Detailed Description

Definition at line 63 of file G4RDBremsstrahlungParameters.hh.

Constructor & Destructor Documentation

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

Definition at line 53 of file G4RDBremsstrahlungParameters.cc.

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

Definition at line 63 of file G4RDBremsstrahlungParameters.cc.

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

Member Function Documentation

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

Definition at line 79 of file G4RDBremsstrahlungParameters.cc.

82 {
83  G4double value = 0.;
84  G4int id = Z*length + parameterIndex;
85  std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator pos;
86 
87  pos = param.find(id);
88  if (pos!= param.end()) {
89 
90  G4RDVEMDataSet* dataSet = (*pos).second;
91  const G4DataVector ener = dataSet->GetEnergies(0);
92  G4double ee = std::max(ener.front(),std::min(ener.back(),energy));
93  value = dataSet->FindValue(ee);
94 
95  } else {
96  G4cout << "WARNING: G4RDBremsstrahlungParameters::FindValue "
97  << "did not find ID = "
98  << id << G4endl;
99  }
100 
101  return value;
102 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
Definition: expat.h:331
virtual G4double FindValue(G4double x, G4int componentId=0) const =0
virtual const G4DataVector & GetEnergies(G4int componentId) const =0
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static const G4double pos

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4RDBremsstrahlungParameters::ParameterC ( G4int  index) const

Definition at line 241 of file G4RDBremsstrahlungParameters.cc.

242 {
243  G4int n = paramC.size();
244  if (id < 0 || id >= n)
245  {
246  G4String stringConversion1("Wrong id = ");
247  G4String stringConversion2(id);
248  G4String ex = stringConversion1 + stringConversion2;
249  G4Exception("G4RDBremsstrahlungParameters::ParameterC()",
250  "InvalidSetup", FatalException, ex);
251  }
252 
253  return paramC[id];
254 }
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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4RDBremsstrahlungParameters::PrintData ( ) const

Definition at line 257 of file G4RDBremsstrahlungParameters.cc.

258 {
259 
260  G4cout << G4endl;
261  G4cout << "===== G4RDBremsstrahlungParameters =====" << G4endl;
262  G4cout << G4endl;
263  G4cout << "===== Parameters =====" << G4endl;
264  G4cout << G4endl;
265 
266  size_t nZ = activeZ.size();
267  std::map<G4int,G4RDVEMDataSet*,std::less<G4int> >::const_iterator pos;
268 
269  for (size_t j=0; j<nZ; j++) {
270  G4int Z = (G4int)activeZ[j];
271 
272  for (size_t i=0; i<length; i++) {
273 
274  pos = param.find(Z*length + i);
275  if (pos!= param.end()) {
276 
277  G4cout << "===== Z= " << Z
278  << " parameter[" << i << "] ====="
279  << G4endl;
280  G4RDVEMDataSet* dataSet = (*pos).second;
281  dataSet->PrintData();
282  }
283  }
284  }
285 
286  G4cout << "==========================================" << G4endl;
287 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
virtual void PrintData(void) const =0
#define G4endl
Definition: G4ios.hh:61
static const G4double pos

Here is the call graph for this function:

Here is the caller graph for this function:


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