#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) |
Protected Member Functions | |
virtual size_t | FindBinLocation (G4double theEnergy) const |
Definition at line 59 of file G4PhysicsLogVector.hh.
G4PhysicsLogVector::G4PhysicsLogVector | ( | ) |
Definition at line 49 of file G4PhysicsLogVector.cc.
References T_G4PhysicsLogVector, and G4PhysicsVector::type.
00050 : G4PhysicsVector() 00051 { 00052 type = T_G4PhysicsLogVector; 00053 }
G4PhysicsLogVector::G4PhysicsLogVector | ( | size_t | theNbin | ) | [explicit] |
Definition at line 55 of file G4PhysicsLogVector.cc.
References G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4PhysicsVector::numberOfNodes, T_G4PhysicsLogVector, and G4PhysicsVector::type.
00056 : G4PhysicsVector() 00057 { 00058 type = T_G4PhysicsLogVector; 00059 00060 numberOfNodes = theNbin + 1; 00061 dataVector.reserve(numberOfNodes); 00062 binVector.reserve(numberOfNodes); 00063 00064 for (size_t i=0; i<numberOfNodes; i++) 00065 { 00066 binVector.push_back(0.0); 00067 dataVector.push_back(0.0); 00068 } 00069 }
Definition at line 71 of file G4PhysicsLogVector.cc.
References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dataVector, G4PhysicsVector::dBin, G4PhysicsVector::edgeMax, G4PhysicsVector::edgeMin, G4PhysicsVector::numberOfNodes, T_G4PhysicsLogVector, and G4PhysicsVector::type.
00073 : G4PhysicsVector() 00074 { 00075 type = T_G4PhysicsLogVector; 00076 00077 dBin = std::log10(theEmax/theEmin)/theNbin; 00078 baseBin = std::log10(theEmin)/dBin; 00079 00080 numberOfNodes = theNbin + 1; 00081 dataVector.reserve(numberOfNodes); 00082 binVector.reserve(numberOfNodes); 00083 static const G4double g4log10 = std::log(10.); 00084 00085 binVector.push_back(theEmin); 00086 dataVector.push_back(0.0); 00087 00088 for (size_t i=1; i<numberOfNodes-1; i++) 00089 { 00090 binVector.push_back(std::exp(g4log10*(baseBin+i)*dBin)); 00091 dataVector.push_back(0.0); 00092 } 00093 binVector.push_back(theEmax); 00094 dataVector.push_back(0.0); 00095 00096 edgeMin = binVector[0]; 00097 edgeMax = binVector[numberOfNodes-1]; 00098 }
G4PhysicsLogVector::~G4PhysicsLogVector | ( | ) | [virtual] |
size_t G4PhysicsLogVector::FindBinLocation | ( | G4double | theEnergy | ) | const [protected, virtual] |
Implements G4PhysicsVector.
Definition at line 124 of file G4PhysicsLogVector.cc.
References G4PhysicsVector::baseBin, and G4PhysicsVector::dBin.
00125 { 00126 // For G4PhysicsLogVector, FindBinLocation is implemented using 00127 // a simple arithmetic calculation. 00128 // 00129 // Because this is a virtual function, it is accessed through a 00130 // pointer to the G4PhyiscsVector object for most usages. In this 00131 // case, 'inline' will not be invoked. However, there is a possibility 00132 // that the user access to the G4PhysicsLogVector object directly and 00133 // not through pointers or references. In this case, the 'inline' will 00134 // be invoked. (See R.B.Murray, "C++ Strategies and Tactics", Chap.6.6) 00135 //G4cout << "G4PhysicsLogVector::FindBinLocation: e= " << theEnergy 00136 00137 return size_t( std::log10(theEnergy)/dBin - baseBin ); 00138 }
Reimplemented from G4PhysicsVector.
Definition at line 104 of file G4PhysicsLogVector.cc.
References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dBin, and G4PhysicsVector::Retrieve().
00105 { 00106 G4bool success = G4PhysicsVector::Retrieve(fIn, ascii); 00107 if (success) 00108 { 00109 G4double theEmin = binVector[0]; 00110 dBin = std::log10(binVector[1]/theEmin); 00111 baseBin = std::log10(theEmin)/dBin; 00112 } 00113 return success; 00114 }
Reimplemented from G4PhysicsVector.
Definition at line 116 of file G4PhysicsLogVector.cc.
References G4PhysicsVector::baseBin, G4PhysicsVector::binVector, G4PhysicsVector::dBin, and G4PhysicsVector::ScaleVector().
00117 { 00118 G4PhysicsVector::ScaleVector(factorE, factorV); 00119 G4double theEmin = binVector[0]; 00120 dBin = std::log10(binVector[1]/theEmin); 00121 baseBin = std::log10(theEmin)/dBin; 00122 }