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

#include <G4PixeShellDataSet.hh>

Inheritance diagram for G4PixeShellDataSet:
Collaboration diagram for G4PixeShellDataSet:

Public Member Functions

 G4PixeShellDataSet (G4int Z, G4IInterpolator *algo, const G4String &modelK="ecpssr", const G4String &modelL="ecpssr", const G4String &modelM="ecpssr", G4double eUnit=CLHEP::MeV, G4double dataUnit=CLHEP::barn)
 
virtual ~G4PixeShellDataSet ()
 
virtual G4double FindValue (G4double energy, G4int componentId=0) const
 
virtual void PrintData (void) const
 
virtual const G4IDataSetGetComponent (G4int componentId) const
 
virtual void AddComponent (G4IDataSet *dataSet)
 
virtual size_t NumberOfComponents (void) const
 
virtual const G4DataVectorGetEnergies (G4int componentId) const
 
virtual const G4DataVectorGetData (G4int componentId) const
 
virtual void SetEnergiesData (G4DataVector *energies, G4DataVector *data, G4int componentId)
 
virtual G4bool LoadData (const G4String &fileName)
 
virtual G4bool SaveData (const G4String &fileName) const
 
virtual G4double RandomSelect (G4int) const
 
- Public Member Functions inherited from G4IDataSet
 G4IDataSet ()
 
virtual ~G4IDataSet ()
 

Protected Member Functions

G4double GetUnitEnergies () const
 
G4double GetUnitData () const
 
const G4IInterpolatorGetAlgorithm () const
 
void CleanUpComponents (void)
 

Detailed Description

Definition at line 57 of file G4PixeShellDataSet.hh.

Constructor & Destructor Documentation

G4PixeShellDataSet::G4PixeShellDataSet ( G4int  Z,
G4IInterpolator algo,
const G4String modelK = "ecpssr",
const G4String modelL = "ecpssr",
const G4String modelM = "ecpssr",
G4double  eUnit = CLHEP::MeV,
G4double  dataUnit = CLHEP::barn 
)

Definition at line 48 of file G4PixeShellDataSet.cc.

54  :
55  z(zeta),
56  algorithm(algo),
57  unitEnergies(eUnit),
58  unitData(dataUnit)
59 {
60  if (algorithm == 0) G4Exception("G4PixeShellDataSet::G4PixeShellDataSet",
61  "pii00000301",
63  "interpolation == 0");
64 
65  crossModel.push_back(modelK);
66  crossModel.push_back(modelL);
67  crossModel.push_back(modelM);
68 
69  shellName.push_back("k");
70  shellName.push_back("l");
71  shellName.push_back("m");
72 
73  size_t sizeK = modelK.size();
74  size_t sizeL = modelL.size();
75  size_t sizeM = modelM.size();
76 
77  if (sizeK > 0) subShellName.push_back("k");
78 
79  if (sizeK > 0 && sizeL > 0)
80  {
81  subShellName.push_back("l1");
82  subShellName.push_back("l2");
83  subShellName.push_back("l3");
84  }
85  if (sizeK > 0 && sizeL > 0 && sizeM >0)
86  {
87  subShellName.push_back("m1");
88  subShellName.push_back("m2");
89  subShellName.push_back("m3");
90  subShellName.push_back("m4");
91  subShellName.push_back("m5");
92  }
93 }
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:

G4PixeShellDataSet::~G4PixeShellDataSet ( )
virtual

Definition at line 96 of file G4PixeShellDataSet.cc.

97 {
99  if (algorithm) delete algorithm;
100 }

Here is the call graph for this function:

Member Function Documentation

virtual void G4PixeShellDataSet::AddComponent ( G4IDataSet dataSet)
inlinevirtual

Implements G4IDataSet.

Definition at line 78 of file G4PixeShellDataSet.hh.

79  { components.push_back(dataSet); }

Here is the caller graph for this function:

void G4PixeShellDataSet::CleanUpComponents ( void  )
protected

Definition at line 192 of file G4PixeShellDataSet.cc.

193 {
194  while (!components.empty())
195  {
196  if (components.back()) delete components.back();
197  components.pop_back();
198  }
199 }

Here is the caller graph for this function:

G4double G4PixeShellDataSet::FindValue ( G4double  energy,
G4int  componentId = 0 
) const
virtual

Implements G4IDataSet.

Definition at line 103 of file G4PixeShellDataSet.cc.

104 {
105  // Returns the sum over the shells corresponding to e
106  G4double value = 0.;
107 
108  std::vector<G4IDataSet *>::const_iterator i(components.begin());
109  std::vector<G4IDataSet *>::const_iterator end(components.end());
110 
111  while (i != end)
112  {
113  value += (*i)->FindValue(energy);
114  i++;
115  }
116  return value;
117 }
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double energy(const ThreeVector &p, const G4double m)
double G4double
Definition: G4Types.hh:76
const G4IInterpolator* G4PixeShellDataSet::GetAlgorithm ( ) const
inlineprotected

Definition at line 103 of file G4PixeShellDataSet.hh.

103 { return algorithm; }
virtual const G4IDataSet* G4PixeShellDataSet::GetComponent ( G4int  componentId) const
inlinevirtual

Implements G4IDataSet.

Definition at line 75 of file G4PixeShellDataSet.hh.

76  { return components[componentId]; }

Here is the caller graph for this function:

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

Implements G4IDataSet.

Definition at line 87 of file G4PixeShellDataSet.hh.

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

Here is the call graph for this function:

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

Implements G4IDataSet.

Definition at line 84 of file G4PixeShellDataSet.hh.

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

Here is the call graph for this function:

G4double G4PixeShellDataSet::GetUnitData ( ) const
inlineprotected

Definition at line 102 of file G4PixeShellDataSet.hh.

102 { return unitData; }
G4double G4PixeShellDataSet::GetUnitEnergies ( ) const
inlineprotected

Definition at line 101 of file G4PixeShellDataSet.hh.

101 { return unitEnergies; }
G4bool G4PixeShellDataSet::LoadData ( const G4String fileName)
virtual

Implements G4IDataSet.

Definition at line 160 of file G4PixeShellDataSet.cc.

161 {
163 
164  // Load shell cross sections
165 
166  G4int nShells = subShellName.size();
167 
168  for (G4int subShellIndex=0; subShellIndex<nShells; subShellIndex++)
169  {
170  G4String subName = subShellName[subShellIndex];
171  G4String fullFileName = FullFileName(file,subName);
172 
173  // Create component DataSet with the data from the current subshell
174  G4IDataSet* dataSet = new G4DataSet(z,algorithm);
175  dataSet->LoadData(fullFileName);
176 
177  // Add component to the ShellDataSet
178  AddComponent(dataSet);
179  }
180 
181  return true;
182 }
int G4int
Definition: G4Types.hh:78
virtual G4bool LoadData(const G4String &fileName)=0
virtual void AddComponent(G4IDataSet *dataSet)

Here is the call graph for this function:

virtual size_t G4PixeShellDataSet::NumberOfComponents ( void  ) const
inlinevirtual

Implements G4IDataSet.

Definition at line 81 of file G4PixeShellDataSet.hh.

82  { return components.size(); }

Here is the caller graph for this function:

void G4PixeShellDataSet::PrintData ( void  ) const
virtual

Implements G4IDataSet.

Definition at line 120 of file G4PixeShellDataSet.cc.

121 {
122  const size_t n = NumberOfComponents();
123 
124  G4cout << "The data set has " << n << " components" << G4endl;
125  G4cout << G4endl;
126 
127  size_t i = 0;
128 
129  while (i < n)
130  {
131  G4cout << "--- Component " << i << " ---" << G4endl;
132  GetComponent(i)->PrintData();
133  i++;
134  }
135 }
G4GLOB_DLL std::ostream G4cout
virtual const G4IDataSet * GetComponent(G4int componentId) const
const G4int n
#define G4endl
Definition: G4ios.hh:61
virtual void PrintData(void) const =0
virtual size_t NumberOfComponents(void) const

Here is the call graph for this function:

virtual G4double G4PixeShellDataSet::RandomSelect ( G4int  ) const
inlinevirtual

Implements G4IDataSet.

Definition at line 97 of file G4PixeShellDataSet.hh.

97 {return -1.;};
G4bool G4PixeShellDataSet::SaveData ( const G4String fileName) const
virtual

Implements G4IDataSet.

Definition at line 185 of file G4PixeShellDataSet.cc.

186 {
187  // Dummy implementation
188  return true;
189 }
void G4PixeShellDataSet::SetEnergiesData ( G4DataVector energies,
G4DataVector data,
G4int  componentId 
)
virtual

Implements G4IDataSet.

Definition at line 138 of file G4PixeShellDataSet.cc.

141 {
142  G4IDataSet* component = components[componentId];
143 
144  if (component)
145  {
146  component->SetEnergiesData(energies, data, 0);
147  return;
148  }
149 
150  std::ostringstream message;
151  message << "G4PixeShellDataSet::SetEnergiesData - component " << componentId << " not found";
152 
153  G4Exception("G4PixeShellDataSet::SetEnergiesData",
154  "pii000000310",
156  message.str().c_str());
157 }
virtual void SetEnergiesData(G4DataVector *x, G4DataVector *data, G4int component=0)=0
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: