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

#include <G4PhysicsLnVector.hh>

+ Inheritance diagram for G4PhysicsLnVector:

Public Member Functions

 G4PhysicsLnVector ()
 
 G4PhysicsLnVector (size_t theNbin)
 
 G4PhysicsLnVector (G4double theEmin, G4double theEmax, size_t theNbin)
 
 ~G4PhysicsLnVector ()
 
virtual 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 55 of file G4PhysicsLnVector.hh.

Constructor & Destructor Documentation

◆ G4PhysicsLnVector() [1/3]

G4PhysicsLnVector::G4PhysicsLnVector ( )

Definition at line 42 of file G4PhysicsLnVector.cc.

44{
46}
@ T_G4PhysicsLnVector
G4PhysicsVectorType type

◆ G4PhysicsLnVector() [2/3]

G4PhysicsLnVector::G4PhysicsLnVector ( size_t  theNbin)
explicit

Definition at line 48 of file G4PhysicsLnVector.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

◆ G4PhysicsLnVector() [3/3]

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

Definition at line 64 of file G4PhysicsLnVector.cc.

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

◆ ~G4PhysicsLnVector()

G4PhysicsLnVector::~G4PhysicsLnVector ( )

Definition at line 91 of file G4PhysicsLnVector.cc.

91{}

Member Function Documentation

◆ FindBinLocation()

size_t G4PhysicsLnVector::FindBinLocation ( G4double  theEnergy) const
protectedvirtual

Implements G4PhysicsVector.

Definition at line 113 of file G4PhysicsLnVector.cc.

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

◆ Retrieve()

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

Reimplemented from G4PhysicsVector.

Definition at line 93 of file G4PhysicsLnVector.cc.

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

◆ ScaleVector()

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

Reimplemented from G4PhysicsVector.

Definition at line 105 of file G4PhysicsLnVector.cc.

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

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