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

#include <G4PhysicsLinearVector.hh>

+ Inheritance diagram for G4PhysicsLinearVector:

Public Member Functions

 G4PhysicsLinearVector ()
 
 G4PhysicsLinearVector (size_t theNbin)
 
 G4PhysicsLinearVector (G4double theEmin, G4double theEmax, size_t theNbin)
 
virtual ~G4PhysicsLinearVector ()
 
G4bool Retrieve (std::ifstream &fIn, G4bool ascii)
 
virtual void ScaleVector (G4double factorE, G4double factorV)
 
- 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 59 of file G4PhysicsLinearVector.hh.

Constructor & Destructor Documentation

◆ G4PhysicsLinearVector() [1/3]

G4PhysicsLinearVector::G4PhysicsLinearVector ( )

Definition at line 42 of file G4PhysicsLinearVector.cc.

44{
46}
@ T_G4PhysicsLinearVector
G4PhysicsVectorType type

◆ G4PhysicsLinearVector() [2/3]

G4PhysicsLinearVector::G4PhysicsLinearVector ( size_t  theNbin)
explicit

Definition at line 48 of file G4PhysicsLinearVector.cc.

50{
52
53 numberOfNodes = theNbin + 1;
55 binVector.reserve(numberOfNodes);
56
57 for (size_t i=0; i<numberOfNodes; i++)
58 {
59 binVector.push_back(0.0);
60 dataVector.push_back(0.0);
61 }
62}
G4PVDataVector binVector
G4PVDataVector dataVector

◆ G4PhysicsLinearVector() [3/3]

G4PhysicsLinearVector::G4PhysicsLinearVector ( G4double  theEmin,
G4double  theEmax,
size_t  theNbin 
)

Definition at line 64 of file G4PhysicsLinearVector.cc.

67{
69
70 dBin = (theEmax-theEmin)/theNbin;
71 baseBin = theEmin/dBin;
72
73 numberOfNodes = theNbin + 1;
75 binVector.reserve(numberOfNodes);
76
77 binVector.push_back(theEmin);
78 dataVector.push_back(0.0);
79
80 for (size_t i=1; i<numberOfNodes-1; i++)
81 {
82 binVector.push_back( theEmin + i*dBin );
83 dataVector.push_back(0.0);
84 }
85 binVector.push_back(theEmax);
86 dataVector.push_back(0.0);
87
88 edgeMin = binVector[0];
90
91}

◆ ~G4PhysicsLinearVector()

G4PhysicsLinearVector::~G4PhysicsLinearVector ( )
virtual

Definition at line 93 of file G4PhysicsLinearVector.cc.

93{}

Member Function Documentation

◆ FindBinLocation()

size_t G4PhysicsLinearVector::FindBinLocation ( G4double  theEnergy) const
protectedvirtual

Implements G4PhysicsVector.

Definition at line 116 of file G4PhysicsLinearVector.cc.

117{
118 // For G4PhysicsLinearVector, FindBinLocation is implemented using
119 // a simple arithmetic calculation.
120 //
121 // Because this is a virtual function, it is accessed through a
122 // pointer to the G4PhyiscsVector object for most usages. In this
123 // case, 'inline' will not be invoked. However, there is a possibility
124 // that the user access to the G4PhysicsLinearVector object directly and
125 // not through pointers or references. In this case, the 'inline' will
126 // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6)
127
128 return size_t( theEnergy/dBin - baseBin );
129}

◆ Retrieve()

G4bool G4PhysicsLinearVector::Retrieve ( std::ifstream &  fIn,
G4bool  ascii 
)
virtual

Reimplemented from G4PhysicsVector.

Definition at line 95 of file G4PhysicsLinearVector.cc.

96{
97 G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
98 if (success)
99 {
100 G4double theEmin = binVector[0];
101 dBin = binVector[1]-theEmin;
102 baseBin = theEmin/dBin;
103 }
104 return success;
105}
double G4double
Definition: G4Types.hh:64
bool G4bool
Definition: G4Types.hh:67
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)

◆ ScaleVector()

void G4PhysicsLinearVector::ScaleVector ( G4double  factorE,
G4double  factorV 
)
virtual

Reimplemented from G4PhysicsVector.

Definition at line 107 of file G4PhysicsLinearVector.cc.

108{
109 G4PhysicsVector::ScaleVector(factorE, factorV);
110 G4double theEmin = binVector[0];
111 dBin = binVector[1]-theEmin;
112 baseBin = theEmin/dBin;
113}
virtual void ScaleVector(G4double factorE, G4double factorV)

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