Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4PhysicsOrderedFreeVector Class Reference

#include <G4PhysicsOrderedFreeVector.hh>

+ Inheritance diagram for G4PhysicsOrderedFreeVector:

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from G4PhysicsVector
virtual size_t FindBinLocation (G4double theEnergy) const =0
 
void DeleteData ()
 
void CopyData (const G4PhysicsVector &vec)
 
- Protected Attributes inherited from G4PhysicsVector
G4PhysicsVectorType type
 
G4double edgeMin
 
G4double edgeMax
 
size_t numberOfNodes
 
G4PhysicsVectorCachecache
 
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() [1/2]

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( )

Definition at line 74 of file G4PhysicsOrderedFreeVector.cc.

◆ G4PhysicsOrderedFreeVector() [2/2]

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( G4double Energies,
G4double Values,
size_t  VectorLength 
)

Definition at line 61 of file G4PhysicsOrderedFreeVector.cc.

65{
67
68 for (size_t i = 0 ; i < VectorLength ; i++)
69 {
70 InsertValues(Energies[i], Values[i]);
71 }
72}
void InsertValues(G4double energy, G4double value)

◆ ~G4PhysicsOrderedFreeVector()

G4PhysicsOrderedFreeVector::~G4PhysicsOrderedFreeVector ( )
virtual

Definition at line 84 of file G4PhysicsOrderedFreeVector.cc.

84{}

Member Function Documentation

◆ DumpValues()

◆ GetEnergy()

G4double G4PhysicsOrderedFreeVector::GetEnergy ( G4double  aValue)

Definition at line 112 of file G4PhysicsOrderedFreeVector.cc.

113{
114
115 if (aValue <= GetMinValue()) {
116 return GetMinLowEdgeEnergy();
117 } else if (aValue >= GetMaxValue()) {
118 return GetMaxLowEdgeEnergy();
119 } else {
120 size_t closestBin = FindValueBinLocation(aValue);
121 G4double theEnergy = LinearInterpolationOfEnergy(aValue, closestBin);
122
123 return theEnergy;
124 }
125}
double G4double
Definition: G4Types.hh:64

Referenced by G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), G4SPSRandomGenerator::GenRandZ(), G4Scintillation::PostStepDoIt(), and G4OpWLS::PostStepDoIt().

◆ GetLowEdgeEnergy()

◆ GetMaxLowEdgeEnergy()

G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy ( )

◆ GetMaxValue()

◆ GetMinLowEdgeEnergy()

G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy ( )

◆ GetMinValue()

G4double G4PhysicsOrderedFreeVector::GetMinValue ( )

Referenced by GetEnergy().

◆ InsertValues()

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

Definition at line 90 of file G4PhysicsOrderedFreeVector.cc.

91{
92 std::vector<G4double>::iterator binLoc =
93 std::lower_bound(binVector.begin(), binVector.end(), energy);
94
95 size_t binIdx = binLoc - binVector.begin(); // Iterator difference!
96
97 std::vector<G4double>::iterator dataLoc = dataVector.begin() + binIdx;
98
99 binVector.insert(binLoc, energy);
100 dataVector.insert(dataLoc, value);
101
103 edgeMin = binVector.front();
104 edgeMax = binVector.back();
105}
G4PVDataVector dataVector

Referenced by G4SPSEneDistribution::ArbEnergyHisto(), G4SPSEneDistribution::ArbEnergyHistoFile(), G4SPSEneDistribution::EpnEnergyHisto(), G4PhysicsOrderedFreeVector(), G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), G4SPSRandomGenerator::GenRandZ(), G4GDMLReadMaterials::PropertyRead(), G4SPSRandomGenerator::SetEnergyBias(), G4SPSRandomGenerator::SetPhiBias(), G4SPSRandomGenerator::SetPosPhiBias(), G4SPSRandomGenerator::SetPosThetaBias(), G4SPSRandomGenerator::SetThetaBias(), G4SPSRandomGenerator::SetXBias(), G4SPSRandomGenerator::SetYBias(), G4SPSRandomGenerator::SetZBias(), G4SPSAngDistribution::UserDefAngPhi(), G4SPSAngDistribution::UserDefAngTheta(), and G4SPSEneDistribution::UserEnergyHisto().


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