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

#include <G4PhysicsFreeVector.hh>

+ Inheritance diagram for G4PhysicsFreeVector:

Public Member Functions

 G4PhysicsFreeVector ()
 
 G4PhysicsFreeVector (size_t theNbin)
 
 G4PhysicsFreeVector (const G4DataVector &binVector, const G4DataVector &dataVector)
 
virtual ~G4PhysicsFreeVector ()
 
void PutValue (size_t binNumber, G4double binValue, G4double dataValue)
 
- 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)
 

Protected Member Functions

virtual size_t FindBinLocation (G4double theEnergy) const
 
- Protected Member Functions inherited from G4PhysicsVector
virtual size_t FindBinLocation (G4double theEnergy) const =0
 
void DeleteData ()
 
void CopyData (const G4PhysicsVector &vec)
 

Additional Inherited Members

- 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 62 of file G4PhysicsFreeVector.hh.

Constructor & Destructor Documentation

◆ G4PhysicsFreeVector() [1/3]

G4PhysicsFreeVector::G4PhysicsFreeVector ( )

Definition at line 49 of file G4PhysicsFreeVector.cc.

51{
53}
@ T_G4PhysicsFreeVector
G4PhysicsVectorType type

◆ G4PhysicsFreeVector() [2/3]

G4PhysicsFreeVector::G4PhysicsFreeVector ( size_t  theNbin)
explicit

Definition at line 55 of file G4PhysicsFreeVector.cc.

57{
59 numberOfNodes = theNbin;
60
62 binVector.reserve(numberOfNodes);
63
64 for (size_t i=0; i<numberOfNodes; i++)
65 {
66 binVector.push_back(0.0);
67 dataVector.push_back(0.0);
68 }
69}
G4PVDataVector binVector
G4PVDataVector dataVector

◆ G4PhysicsFreeVector() [3/3]

G4PhysicsFreeVector::G4PhysicsFreeVector ( const G4DataVector binVector,
const G4DataVector dataVector 
)

Definition at line 71 of file G4PhysicsFreeVector.cc.

73{
75 numberOfNodes = theBinVector.size();
76
78 binVector.reserve(numberOfNodes);
79
80 for (size_t i=0; i<numberOfNodes; i++)
81 {
82 binVector.push_back(theBinVector[i]);
83 dataVector.push_back(theDataVector[i]);
84 }
85
86 edgeMin = binVector[0];
88}

◆ ~G4PhysicsFreeVector()

G4PhysicsFreeVector::~G4PhysicsFreeVector ( )
virtual

Definition at line 90 of file G4PhysicsFreeVector.cc.

91{
92}

Member Function Documentation

◆ FindBinLocation()

size_t G4PhysicsFreeVector::FindBinLocation ( G4double  theEnergy) const
protectedvirtual

Implements G4PhysicsVector.

Definition at line 112 of file G4PhysicsFreeVector.cc.

113{
114 // For G4PhysicsFreeVector, FindBinLocation is implemented using
115 // the binary search algorithm.
116 //
117 // Because this is a virtual function, it is accessed through a
118 // pointer to the G4PhysicsVector object for most usages. In this
119 // case, 'inline' will not be invoked. However, there is a possibility
120 // that the user access to the G4PhysicsFreeVector object directly and
121 // not through pointers or references. In this case, the 'inline' will
122 // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6)
123
124 size_t lowerBound = 0;
125 size_t upperBound = numberOfNodes-2;
126
127 while (lowerBound <= upperBound)
128 {
129 size_t midBin = (lowerBound + upperBound)/2;
130 if( theEnergy < binVector[midBin] )
131 { upperBound = midBin-1; }
132 else
133 { lowerBound = midBin+1; }
134 }
135
136 return upperBound;
137}

◆ PutValue()


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