Geant4 10.7.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 (const std::vector< G4double > &Energies, const std::vector< G4double > &Values)
 
 G4PhysicsOrderedFreeVector (G4double *Energies, G4double *Values, std::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 &)
 
G4bool operator== (const G4PhysicsVector &right) const
 
G4bool operator!= (const G4PhysicsVector &right) const
 
virtual ~G4PhysicsVector ()
 
G4double Value (G4double theEnergy, std::size_t &lastidx) const
 
G4double LogVectorValue (const G4double theEnergy, const G4double theLogEnergy) const
 
G4double Value (G4double theEnergy) const
 
G4double GetValue (G4double theEnergy, G4bool &isOutRange) const
 
G4double operator[] (const std::size_t index) const
 
G4double operator() (const std::size_t index) const
 
void PutValue (std::size_t index, G4double theValue)
 
virtual void ScaleVector (G4double factorE, G4double factorV)
 
G4double Energy (std::size_t index) const
 
G4double GetMaxEnergy () const
 
G4double GetLowEdgeEnergy (std::size_t binNumber) const
 
std::size_t GetVectorLength () const
 
std::size_t FindBin (const G4double energy, const std::size_t idx) const
 
std::size_t ComputeLogVectorBin (const G4double logenergy) 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 (std::size_t index)
 
- Protected Attributes inherited from G4PhysicsVector
G4PhysicsVectorType type = T_G4PhysicsVector
 
G4double edgeMin = 0.0
 
G4double edgeMax = 0.0
 
G4double invdBin = 0.0
 
G4double baseBin = 0.0
 
G4int verboseLevel = 0
 
std::size_t numberOfNodes = 0
 
G4PVDataVector dataVector
 
G4PVDataVector binVector
 
G4PVDataVector secDerivative
 

Detailed Description

Definition at line 47 of file G4PhysicsOrderedFreeVector.hh.

Constructor & Destructor Documentation

◆ G4PhysicsOrderedFreeVector() [1/3]

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( )

Definition at line 37 of file G4PhysicsOrderedFreeVector.cc.

◆ G4PhysicsOrderedFreeVector() [2/3]

G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector ( const std::vector< G4double > &  Energies,
const std::vector< G4double > &  Values 
)

Definition at line 61 of file G4PhysicsOrderedFreeVector.cc.

64{
65 if(Energies.size() != Values.size())
66 {
68 ed << "The sizes of the two std::vector arguments must be the same";
69 G4Exception("G4PhysicsOrderedFreeVector::G4PhysicsOrderedFreeVector()",
70 "glob04", FatalException, ed);
71 }
72
74
75 dataVector.reserve(Energies.size());
76 binVector.reserve(Energies.size());
77
78 for(std::size_t i = 0; i < Energies.size(); ++i)
79 {
80 InsertValues(Energies[i], Values[i]);
81 }
82}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
void InsertValues(G4double energy, G4double value)
G4PVDataVector binVector
G4PVDataVector dataVector

◆ G4PhysicsOrderedFreeVector() [3/3]

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

Definition at line 44 of file G4PhysicsOrderedFreeVector.cc.

48{
50
51 dataVector.reserve(VectorLength);
52 binVector.reserve(VectorLength);
53
54 for(std::size_t i = 0; i < VectorLength; ++i)
55 {
56 InsertValues(Energies[i], Values[i]);
57 }
58}

◆ ~G4PhysicsOrderedFreeVector()

G4PhysicsOrderedFreeVector::~G4PhysicsOrderedFreeVector ( )
virtual

Definition at line 85 of file G4PhysicsOrderedFreeVector.cc.

85{}

Member Function Documentation

◆ GetEnergy()

G4double G4PhysicsOrderedFreeVector::GetEnergy ( G4double  aValue)

Definition at line 105 of file G4PhysicsOrderedFreeVector.cc.

106{
107 G4double e;
108 if(aValue <= GetMinValue())
109 {
110 e = edgeMin;
111 }
112 else if(aValue >= GetMaxValue())
113 {
114 e = edgeMax;
115 }
116 else
117 {
118 std::size_t closestBin = FindValueBinLocation(aValue);
119 e = LinearInterpolationOfEnergy(aValue, closestBin);
120 }
121 return e;
122}
double G4double
Definition: G4Types.hh:83

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

◆ GetMaxLowEdgeEnergy()

G4double G4PhysicsOrderedFreeVector::GetMaxLowEdgeEnergy ( )
inline

Definition at line 96 of file G4PhysicsOrderedFreeVector.hh.

97{
98 return binVector.back();
99}

Referenced by G4SPSEneDistribution::ArbInterpolate(), and G4Cerenkov::PostStepDoIt().

◆ GetMaxValue()

◆ GetMinLowEdgeEnergy()

G4double G4PhysicsOrderedFreeVector::GetMinLowEdgeEnergy ( )
inline

◆ GetMinValue()

G4double G4PhysicsOrderedFreeVector::GetMinValue ( )
inline

Definition at line 91 of file G4PhysicsOrderedFreeVector.hh.

92{
93 return dataVector.front();
94}

Referenced by GetEnergy().

◆ InsertValues()

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

Definition at line 88 of file G4PhysicsOrderedFreeVector.cc.

89{
90 auto binLoc = std::lower_bound(binVector.cbegin(), binVector.cend(), energy);
91
92 std::size_t binIdx = binLoc - binVector.cbegin(); // Iterator difference!
93
94 auto dataLoc = dataVector.cbegin() + binIdx;
95
96 binVector.insert(binLoc, energy);
97 dataVector.insert(dataLoc, value);
98
100 edgeMin = binVector.front();
101 edgeMax = binVector.back();
102}
std::size_t numberOfNodes

Referenced by G4MaterialPropertiesTable::AddEntry(), G4SPSEneDistribution::ArbEnergyHisto(), G4SPSEneDistribution::ArbEnergyHistoFile(), G4Cerenkov::BuildPhysicsTable(), G4Scintillation::BuildPhysicsTable(), G4OpWLS::BuildPhysicsTable(), G4OpWLS2::BuildPhysicsTable(), G4AdjointPrimaryGenerator::ComputeAccumulatedDepthVectorAlongBackRay(), G4SPSEneDistribution::EpnEnergyHisto(), G4PhysicsOrderedFreeVector(), G4SPSRandomGenerator::GenRandEnergy(), G4SPSRandomGenerator::GenRandPhi(), G4SPSRandomGenerator::GenRandPosPhi(), G4SPSRandomGenerator::GenRandPosTheta(), G4SPSRandomGenerator::GenRandTheta(), G4SPSRandomGenerator::GenRandX(), G4SPSRandomGenerator::GenRandY(), G4SPSRandomGenerator::GenRandZ(), G4GDMLReadMaterials::PropertyRead(), G4GDMLReadSolids::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: