Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PhysicsOrderedFreeVector Class Reference

#include <G4PhysicsOrderedFreeVector.hh>

Inheritance diagram for G4PhysicsOrderedFreeVector:
Collaboration diagram for G4PhysicsOrderedFreeVector:

Public Member Functions

 G4PhysicsOrderedFreeVector ()
 
 G4PhysicsOrderedFreeVector (G4double *Energies, G4double *Values, size_t VectorLength)
 
virtual ~G4PhysicsOrderedFreeVector ()
 
void InsertValues (G4double energy, G4double value)
 
G4double GetEnergy (G4double aValue)
 
G4double GetMaxValue ()
 
G4double GetMinValue ()
 
G4double GetMaxLowEdgeEnergy ()
 
G4double GetMinLowEdgeEnergy ()
 
- Public Member Functions inherited from G4PhysicsVector
 G4PhysicsVector (G4bool spline=false)
 
 G4PhysicsVector (const G4PhysicsVector &)
 
G4PhysicsVectoroperator= (const G4PhysicsVector &)
 
virtual ~G4PhysicsVector ()
 
G4double Value (G4double theEnergy, size_t &lastidx) const
 
G4double Value (G4double theEnergy) const
 
G4double GetValue (G4double theEnergy, G4bool &isOutRange) const
 
G4int operator== (const G4PhysicsVector &right) const
 
G4int operator!= (const G4PhysicsVector &right) const
 
G4double operator[] (const size_t index) const
 
G4double operator() (const size_t index) const
 
void PutValue (size_t index, G4double theValue)
 
virtual void ScaleVector (G4double factorE, G4double factorV)
 
G4double Energy (size_t index) const
 
G4double GetMaxEnergy () const
 
G4double GetLowEdgeEnergy (size_t binNumber) const
 
size_t GetVectorLength () const
 
size_t FindBin (G4double energy, size_t idx) const
 
void FillSecondDerivatives ()
 
void ComputeSecDerivatives ()
 
void ComputeSecondDerivatives (G4double firstPointDerivative, G4double endPointDerivative)
 
G4double FindLinearEnergy (G4double rand) const
 
G4bool IsFilledVectorExist () const
 
G4PhysicsVectorType GetType () const
 
void SetSpline (G4bool)
 
G4bool Store (std::ofstream &fOut, G4bool ascii=false) const
 
virtual G4bool Retrieve (std::ifstream &fIn, G4bool ascii=false)
 
void DumpValues (G4double unitE=1.0, G4double unitV=1.0) const
 
void SetVerboseLevel (G4int value)
 

Additional Inherited Members

- Protected Member Functions inherited from G4PhysicsVector
void DeleteData ()
 
void CopyData (const G4PhysicsVector &vec)
 
void PrintPutValueError (size_t index)
 
- Protected Attributes inherited from G4PhysicsVector
G4PhysicsVectorType type
 
G4double edgeMin
 
G4double edgeMax
 
size_t numberOfNodes
 
G4PVDataVector dataVector
 
G4PVDataVector binVector
 
G4PVDataVector secDerivative
 
G4double dBin
 
G4double baseBin
 
G4int verboseLevel
 

Detailed Description

Definition at line 67 of file G4PhysicsOrderedFreeVector.hh.

Constructor & Destructor Documentation

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( )

Definition at line 54 of file G4PhysicsOrderedFreeVector.cc.

55  : G4PhysicsVector()
56 {
58 }
G4PhysicsVector(G4bool spline=false)
G4PhysicsVectorType type
G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( G4double Energies,
G4double Values,
size_t  VectorLength 
)

Definition at line 60 of file G4PhysicsOrderedFreeVector.cc.

63  : G4PhysicsVector()
64 {
66 
67  dataVector.reserve(VectorLength);
68  binVector.reserve(VectorLength);
69 
70  for (size_t i = 0 ; i < VectorLength ; ++i)
71  {
72  InsertValues(Energies[i], Values[i]);
73  }
74 }
G4PVDataVector dataVector
G4PhysicsVector(G4bool spline=false)
void InsertValues(G4double energy, G4double value)
G4PVDataVector binVector
G4PhysicsVectorType type

Here is the call graph for this function:

G4PhysicsOrderedFreeVector::~G4PhysicsOrderedFreeVector ( )
virtual

Definition at line 76 of file G4PhysicsOrderedFreeVector.cc.

77 {}

Member Function Documentation

G4double G4PhysicsOrderedFreeVector::GetEnergy ( G4double  aValue)

Definition at line 96 of file G4PhysicsOrderedFreeVector.cc.

97 {
98  G4double e;
99  if (aValue <= GetMinValue()) {
100  e = edgeMin;
101  } else if (aValue >= GetMaxValue()) {
102  e = edgeMax;
103  } else {
104  size_t closestBin = FindValueBinLocation(aValue);
105  e = LinearInterpolationOfEnergy(aValue, closestBin);
106  }
107  return e;
108 }
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy ( )
inline

Definition at line 125 of file G4PhysicsOrderedFreeVector.hh.

126 {
127  return binVector.back();
128 }
G4PVDataVector binVector

Here is the caller graph for this function:

G4double G4PhysicsOrderedFreeVector::GetMaxValue ( )
inline

Definition at line 113 of file G4PhysicsOrderedFreeVector.hh.

114 {
115  return dataVector.back();
116 }
G4PVDataVector dataVector

Here is the caller graph for this function:

G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy ( )
inline

Definition at line 131 of file G4PhysicsOrderedFreeVector.hh.

132 {
133  return binVector.front();
134 }
G4PVDataVector binVector

Here is the caller graph for this function:

G4double G4PhysicsOrderedFreeVector::GetMinValue ( )
inline

Definition at line 119 of file G4PhysicsOrderedFreeVector.hh.

120 {
121  return dataVector.front();
122 }
G4PVDataVector dataVector

Here is the caller graph for this function:

void G4PhysicsOrderedFreeVector::InsertValues ( G4double  energy,
G4double  value 
)

Definition at line 79 of file G4PhysicsOrderedFreeVector.cc.

80 {
81  std::vector<G4double>::iterator binLoc =
82  std::lower_bound(binVector.begin(), binVector.end(), energy);
83 
84  size_t binIdx = binLoc - binVector.begin(); // Iterator difference!
85 
86  std::vector<G4double>::iterator dataLoc = dataVector.begin() + binIdx;
87 
88  binVector.insert(binLoc, energy);
89  dataVector.insert(dataLoc, value);
90 
91  ++numberOfNodes;
92  edgeMin = binVector.front();
93  edgeMax = binVector.back();
94 }
G4PVDataVector dataVector
G4PVDataVector binVector
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double energy(const ThreeVector &p, const G4double m)

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: