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

#include <G4PhysicsLogVector.hh>

+ Inheritance diagram for G4PhysicsLogVector:

Public Member Functions

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

Constructor & Destructor Documentation

◆ G4PhysicsLogVector() [1/3]

G4PhysicsLogVector::G4PhysicsLogVector ( )

Definition at line 49 of file G4PhysicsLogVector.cc.

51{
53}
@ T_G4PhysicsLogVector
G4PhysicsVectorType type

◆ G4PhysicsLogVector() [2/3]

G4PhysicsLogVector::G4PhysicsLogVector ( size_t  theNbin)
explicit

Definition at line 55 of file G4PhysicsLogVector.cc.

57{
59
60 numberOfNodes = theNbin + 1;
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

◆ G4PhysicsLogVector() [3/3]

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

Definition at line 71 of file G4PhysicsLogVector.cc.

74{
76
77 dBin = std::log10(theEmax/theEmin)/theNbin;
78 baseBin = std::log10(theEmin)/dBin;
79
80 numberOfNodes = theNbin + 1;
82 binVector.reserve(numberOfNodes);
83 static const G4double g4log10 = std::log(10.);
84
85 binVector.push_back(theEmin);
86 dataVector.push_back(0.0);
87
88 for (size_t i=1; i<numberOfNodes-1; i++)
89 {
90 binVector.push_back(std::exp(g4log10*(baseBin+i)*dBin));
91 dataVector.push_back(0.0);
92 }
93 binVector.push_back(theEmax);
94 dataVector.push_back(0.0);
95
96 edgeMin = binVector[0];
98}
double G4double
Definition: G4Types.hh:64

◆ ~G4PhysicsLogVector()

G4PhysicsLogVector::~G4PhysicsLogVector ( )
virtual

Definition at line 100 of file G4PhysicsLogVector.cc.

101{
102}

Member Function Documentation

◆ FindBinLocation()

size_t G4PhysicsLogVector::FindBinLocation ( G4double  theEnergy) const
protectedvirtual

Implements G4PhysicsVector.

Definition at line 124 of file G4PhysicsLogVector.cc.

125{
126 // For G4PhysicsLogVector, FindBinLocation is implemented using
127 // a simple arithmetic calculation.
128 //
129 // Because this is a virtual function, it is accessed through a
130 // pointer to the G4PhyiscsVector object for most usages. In this
131 // case, 'inline' will not be invoked. However, there is a possibility
132 // that the user access to the G4PhysicsLogVector object directly and
133 // not through pointers or references. In this case, the 'inline' will
134 // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6)
135 //G4cout << "G4PhysicsLogVector::FindBinLocation: e= " << theEnergy
136
137 return size_t( std::log10(theEnergy)/dBin - baseBin );
138}

◆ Retrieve()

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

Reimplemented from G4PhysicsVector.

Definition at line 104 of file G4PhysicsLogVector.cc.

105{
106 G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
107 if (success)
108 {
109 G4double theEmin = binVector[0];
110 dBin = std::log10(binVector[1]/theEmin);
111 baseBin = std::log10(theEmin)/dBin;
112 }
113 return success;
114}
bool G4bool
Definition: G4Types.hh:67
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)

◆ ScaleVector()

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

Reimplemented from G4PhysicsVector.

Definition at line 116 of file G4PhysicsLogVector.cc.

117{
118 G4PhysicsVector::ScaleVector(factorE, factorV);
119 G4double theEmin = binVector[0];
120 dBin = std::log10(binVector[1]/theEmin);
121 baseBin = std::log10(theEmin)/dBin;
122}
virtual void ScaleVector(G4double factorE, G4double factorV)

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