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

#include <G4RDCompositeEMDataSet.hh>

Inheritance diagram for G4RDCompositeEMDataSet:
Collaboration diagram for G4RDCompositeEMDataSet:

Public Member Functions

 G4RDCompositeEMDataSet (G4RDVDataSetAlgorithm *argAlgorithm, G4double eUnit=CLHEP::MeV, G4double dataUnit=CLHEP::barn, G4int zMin=1, G4int zMax=99)
 
virtual ~G4RDCompositeEMDataSet ()
 
virtual G4double FindValue (G4double x, G4int componentId=0) const
 
virtual void PrintData (void) const
 
virtual const G4RDVEMDataSetGetComponent (G4int componentId) const
 
virtual void AddComponent (G4RDVEMDataSet *dataSet)
 
virtual size_t NumberOfComponents () const
 
virtual const G4DataVectorGetEnergies (G4int componentId) const
 
virtual const G4DataVectorGetData (G4int componentId) const
 
virtual void SetEnergiesData (G4DataVector *x, G4DataVector *data, G4int componentId)
 
virtual G4bool LoadData (const G4String &fileName)
 
virtual G4bool SaveData (const G4String &fileName) const
 
virtual G4double RandomSelect (G4int componentId) const
 
- Public Member Functions inherited from G4RDVEMDataSet
 G4RDVEMDataSet ()
 
virtual ~G4RDVEMDataSet ()
 

Detailed Description

Definition at line 57 of file G4RDCompositeEMDataSet.hh.

Constructor & Destructor Documentation

G4RDCompositeEMDataSet::G4RDCompositeEMDataSet ( G4RDVDataSetAlgorithm argAlgorithm,
G4double  eUnit = CLHEP::MeV,
G4double  dataUnit = CLHEP::barn,
G4int  zMin = 1,
G4int  zMax = 99 
)

Definition at line 44 of file G4RDCompositeEMDataSet.cc.

49  :
50  algorithm(argAlgorithm),
51  unitEnergies(argUnitEnergies),
52  unitData(argUnitData),
53  minZ(argMinZ),
54  maxZ(argMaxZ)
55 {
56  if (algorithm == 0)
57  G4Exception("G4RDCompositeEMDataSet::G4RDCompositeEMDataSet()",
58  "InvalidSetup", FatalException, "Interpolation == 0!");
59 }
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:

G4RDCompositeEMDataSet::~G4RDCompositeEMDataSet ( )
virtual

Definition at line 63 of file G4RDCompositeEMDataSet.cc.

64 {
65  CleanUpComponents();
66  if (algorithm) delete algorithm;
67 }

Member Function Documentation

virtual void G4RDCompositeEMDataSet::AddComponent ( G4RDVEMDataSet dataSet)
inlinevirtual

Implements G4RDVEMDataSet.

Definition at line 73 of file G4RDCompositeEMDataSet.hh.

73 { components.push_back(dataSet); }

Here is the caller graph for this function:

G4double G4RDCompositeEMDataSet::FindValue ( G4double  x,
G4int  componentId = 0 
) const
virtual

Implements G4RDVEMDataSet.

Definition at line 70 of file G4RDCompositeEMDataSet.cc.

71 {
72  const G4RDVEMDataSet* component(GetComponent(argComponentId));
73 
74  if (component) return component->FindValue(argEnergy);
75 
76  std::ostringstream message;
77  message << "Component " << argComponentId << " not found";
78 
79  G4Exception("G4RDCompositeEMDataSet::FindValue()",
80  "DataNotFound", FatalException, message.str().c_str());
81 
82  return 0.;
83 }
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
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:

virtual const G4RDVEMDataSet* G4RDCompositeEMDataSet::GetComponent ( G4int  componentId) const
inlinevirtual

Implements G4RDVEMDataSet.

Definition at line 72 of file G4RDCompositeEMDataSet.hh.

72 { return components[componentId]; }

Here is the caller graph for this function:

virtual const G4DataVector& G4RDCompositeEMDataSet::GetData ( G4int  componentId) const
inlinevirtual

Implements G4RDVEMDataSet.

Definition at line 77 of file G4RDCompositeEMDataSet.hh.

77 { return GetComponent(componentId)->GetData(0); }
virtual const G4DataVector & GetData(G4int componentId) const =0
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const

Here is the call graph for this function:

virtual const G4DataVector& G4RDCompositeEMDataSet::GetEnergies ( G4int  componentId) const
inlinevirtual

Implements G4RDVEMDataSet.

Definition at line 76 of file G4RDCompositeEMDataSet.hh.

76 { return GetComponent(componentId)->GetEnergies(0); }
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
virtual const G4DataVector & GetEnergies(G4int componentId) const =0

Here is the call graph for this function:

G4bool G4RDCompositeEMDataSet::LoadData ( const G4String fileName)
virtual

Implements G4RDVEMDataSet.

Definition at line 119 of file G4RDCompositeEMDataSet.cc.

120 {
121  CleanUpComponents();
122 
123  for (G4int z(minZ); z<maxZ; z++)
124  {
125  G4RDVEMDataSet* component = new G4RDEMDataSet(z, algorithm->Clone(), unitEnergies, unitData);
126  if (!component->LoadData(argFileName))
127  {
128  delete component;
129  return false;
130  }
131  AddComponent(component);
132  }
133  return true;
134 }
virtual G4RDVDataSetAlgorithm * Clone() const =0
int G4int
Definition: G4Types.hh:78
virtual void AddComponent(G4RDVEMDataSet *dataSet)
tuple z
Definition: test.py:28
virtual G4bool LoadData(const G4String &fileName)=0

Here is the call graph for this function:

virtual size_t G4RDCompositeEMDataSet::NumberOfComponents ( void  ) const
inlinevirtual

Implements G4RDVEMDataSet.

Definition at line 74 of file G4RDCompositeEMDataSet.hh.

74 { return components.size(); }

Here is the caller graph for this function:

void G4RDCompositeEMDataSet::PrintData ( void  ) const
virtual

Implements G4RDVEMDataSet.

Definition at line 85 of file G4RDCompositeEMDataSet.cc.

86 {
87  const size_t n(NumberOfComponents());
88 
89  G4cout << "The data set has " << n << " components" << G4endl;
90  G4cout << G4endl;
91 
92  size_t i(0);
93 
94  while (i<n)
95  {
96  G4cout << "--- Component " << i << " ---" << G4endl;
97  GetComponent(i)->PrintData();
98  i++;
99  }
100 }
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
G4GLOB_DLL std::ostream G4cout
const G4int n
virtual void PrintData(void) const =0
virtual size_t NumberOfComponents() const
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4double G4RDCompositeEMDataSet::RandomSelect ( G4int  componentId) const
virtual

Implements G4RDVEMDataSet.

Definition at line 170 of file G4RDCompositeEMDataSet.cc.

171 {
172  G4double value = 0.;
173  if (componentId >= 0 && componentId < (G4int)components.size())
174  {
175  const G4RDVEMDataSet* dataSet = GetComponent(componentId);
176  value = dataSet->RandomSelect();
177  }
178  return value;
179 }
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331
double G4double
Definition: G4Types.hh:76
virtual G4double RandomSelect(G4int componentId=0) const =0

Here is the call graph for this function:

G4bool G4RDCompositeEMDataSet::SaveData ( const G4String fileName) const
virtual

Implements G4RDVEMDataSet.

Definition at line 138 of file G4RDCompositeEMDataSet.cc.

139 {
140  for (G4int z=minZ; z<maxZ; z++)
141  {
142  const G4RDVEMDataSet* component(GetComponent(z-minZ));
143 
144  if (!component)
145  {
146  std::ostringstream message;
147  message << "Component " << (z-minZ) << " not found";
148  G4Exception("G4RDCompositeEMDataSet::SaveData()",
149  "DataNotFound", FatalException, message.str().c_str());
150  }
151 
152  if (!component->SaveData(argFileName))
153  return false;
154  }
155 
156  return true;
157 }
virtual const G4RDVEMDataSet * GetComponent(G4int componentId) const
int G4int
Definition: G4Types.hh:78
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
tuple z
Definition: test.py:28

Here is the call graph for this function:

void G4RDCompositeEMDataSet::SetEnergiesData ( G4DataVector x,
G4DataVector data,
G4int  componentId 
)
virtual

Implements G4RDVEMDataSet.

Definition at line 102 of file G4RDCompositeEMDataSet.cc.

103 {
104  G4RDVEMDataSet * component(components[argComponentId]);
105 
106  if (component)
107  {
108  component->SetEnergiesData(argEnergies, argData, 0);
109  return;
110  }
111 
112  std::ostringstream message;
113  message << "Component " << argComponentId << " not found";
114 
115  G4Exception("G4RDCompositeEMDataSet::SetEnergiesData()",
116  "DataNotFound", FatalException, message.str().c_str());
117 }
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:


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