Geant4 10.7.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 (G4double Emin, G4double Emax, std::size_t Nbin)
 
virtual ~G4PhysicsLinearVector ()
 
virtual G4bool Retrieve (std::ifstream &fIn, G4bool ascii) final
 
virtual void ScaleVector (G4double factorE, G4double factorV) final
 
- 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 G4PhysicsLinearVector.hh.

Constructor & Destructor Documentation

◆ G4PhysicsLinearVector() [1/2]

G4PhysicsLinearVector::G4PhysicsLinearVector ( )

Definition at line 38 of file G4PhysicsLinearVector.cc.

40{
42}
@ T_G4PhysicsLinearVector
G4PhysicsVectorType type

◆ G4PhysicsLinearVector() [2/2]

G4PhysicsLinearVector::G4PhysicsLinearVector ( G4double  Emin,
G4double  Emax,
std::size_t  Nbin 
)

Definition at line 45 of file G4PhysicsLinearVector.cc.

48{
49 numberOfNodes = theNbin + 1;
50 if(theNbin < 1 || theEmin == theEmax)
51 {
53 ed << "G4PhysicsLinearVector with wrong parameters: theNbin= " << theNbin
54 << " theEmin= " << theEmin << " theEmax= " << theEmax;
55 G4Exception("G4PhysicsLinearVector::G4PhysicsLinearVector()", "glob03",
56 FatalException, ed, "theNbins should be > 1");
57 }
58 if(numberOfNodes < 2)
59 {
60 numberOfNodes = 2;
61 }
63
64 invdBin = 1. / ((theEmax - theEmin) / (G4double) (numberOfNodes - 1));
65 baseBin = theEmin * invdBin;
66
68 binVector.reserve(numberOfNodes);
69
70 binVector.push_back(theEmin);
71 dataVector.push_back(0.0);
72
73 for(std::size_t i = 1; i < numberOfNodes - 1; ++i)
74 {
75 binVector.push_back(theEmin + i / invdBin);
76 dataVector.push_back(0.0);
77 }
78 binVector.push_back(theEmax);
79 dataVector.push_back(0.0);
80
81 edgeMin = binVector[0];
83}
@ 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
double G4double
Definition: G4Types.hh:83
G4PVDataVector binVector
std::size_t numberOfNodes
G4PVDataVector dataVector

◆ ~G4PhysicsLinearVector()

G4PhysicsLinearVector::~G4PhysicsLinearVector ( )
virtual

Definition at line 86 of file G4PhysicsLinearVector.cc.

86{}

Member Function Documentation

◆ Retrieve()

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

Reimplemented from G4PhysicsVector.

Definition at line 89 of file G4PhysicsLinearVector.cc.

90{
91 G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
92 if(success)
93 {
94 invdBin = 1. / (binVector[1] - edgeMin);
96 }
97 return success;
98}
bool G4bool
Definition: G4Types.hh:86
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)

◆ ScaleVector()

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

Reimplemented from G4PhysicsVector.

Definition at line 101 of file G4PhysicsLinearVector.cc.

102{
103 G4PhysicsVector::ScaleVector(factorE, factorV);
104 invdBin = 1. / (binVector[1] - edgeMin);
106}
virtual void ScaleVector(G4double factorE, G4double factorV)

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