Import Geant4 10.6.0 source tree
This commit is contained in:
@@ -51,8 +51,8 @@ G4PhysicsLinearVector::G4PhysicsLinearVector(G4double theEmin,
|
||||
{
|
||||
type = T_G4PhysicsLinearVector;
|
||||
|
||||
dBin = (theEmax-theEmin)/(G4double)theNbin;
|
||||
baseBin = theEmin/dBin;
|
||||
invdBin = 1./((theEmax-theEmin)/(G4double)theNbin);
|
||||
baseBin = theEmin*invdBin;
|
||||
|
||||
numberOfNodes = theNbin + 1;
|
||||
dataVector.reserve(numberOfNodes);
|
||||
@@ -63,7 +63,7 @@ G4PhysicsLinearVector::G4PhysicsLinearVector(G4double theEmin,
|
||||
|
||||
for (size_t i=1; i<numberOfNodes-1; ++i)
|
||||
{
|
||||
binVector.push_back( theEmin + i*dBin );
|
||||
binVector.push_back( theEmin + i/invdBin );
|
||||
dataVector.push_back(0.0);
|
||||
}
|
||||
binVector.push_back(theEmax);
|
||||
@@ -82,8 +82,8 @@ G4bool G4PhysicsLinearVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
|
||||
if (success)
|
||||
{
|
||||
dBin = binVector[1]-edgeMin;
|
||||
baseBin = edgeMin/dBin;
|
||||
invdBin = 1./(binVector[1]-edgeMin);
|
||||
baseBin = edgeMin*invdBin;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ G4bool G4PhysicsLinearVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
void G4PhysicsLinearVector::ScaleVector(G4double factorE, G4double factorV)
|
||||
{
|
||||
G4PhysicsVector::ScaleVector(factorE, factorV);
|
||||
dBin = binVector[1]-edgeMin;
|
||||
baseBin = edgeMin/dBin;
|
||||
invdBin = 1./(binVector[1]-edgeMin);
|
||||
baseBin = edgeMin*invdBin;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ G4PhysicsLogVector::G4PhysicsLogVector(G4double theEmin,
|
||||
{
|
||||
type = T_G4PhysicsLogVector;
|
||||
|
||||
dBin = G4Log(theEmax/theEmin)/(G4double)theNbin;
|
||||
baseBin = G4Log(theEmin)/dBin;
|
||||
invdBin = 1./(G4Log(theEmax/theEmin)/(G4double)theNbin);
|
||||
baseBin = G4Log(theEmin)*invdBin;
|
||||
|
||||
numberOfNodes = theNbin + 1;
|
||||
dataVector.reserve(numberOfNodes);
|
||||
@@ -71,7 +71,7 @@ G4PhysicsLogVector::G4PhysicsLogVector(G4double theEmin,
|
||||
|
||||
for (size_t i=1; i<numberOfNodes-1; ++i)
|
||||
{
|
||||
binVector.push_back(G4Exp((baseBin+i)*dBin));
|
||||
binVector.push_back(G4Exp((baseBin+i)/invdBin));
|
||||
dataVector.push_back(0.0);
|
||||
}
|
||||
binVector.push_back(theEmax);
|
||||
@@ -89,8 +89,8 @@ G4bool G4PhysicsLogVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
G4bool success = G4PhysicsVector::Retrieve(fIn, ascii);
|
||||
if (success)
|
||||
{
|
||||
dBin = G4Log(binVector[1]/edgeMin);
|
||||
baseBin = G4Log(edgeMin)/dBin;
|
||||
invdBin = 1./G4Log(binVector[1]/edgeMin);
|
||||
baseBin = G4Log(edgeMin)*invdBin;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -98,6 +98,6 @@ G4bool G4PhysicsLogVector::Retrieve(std::ifstream& fIn, G4bool ascii)
|
||||
void G4PhysicsLogVector::ScaleVector(G4double factorE, G4double factorV)
|
||||
{
|
||||
G4PhysicsVector::ScaleVector(factorE, factorV);
|
||||
dBin = G4Log(binVector[1]/edgeMin);
|
||||
baseBin = G4Log(edgeMin)/dBin;
|
||||
invdBin = 1./G4Log(binVector[1]/edgeMin);
|
||||
baseBin = G4Log(edgeMin)*invdBin;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ G4PhysicsVector::G4PhysicsVector(G4bool val)
|
||||
: type(T_G4PhysicsVector),
|
||||
edgeMin(0.), edgeMax(0.), numberOfNodes(0),
|
||||
useSpline(val),
|
||||
dBin(0.), baseBin(0.),
|
||||
invdBin(0.), baseBin(0.),
|
||||
verboseLevel(0)
|
||||
{}
|
||||
|
||||
@@ -74,7 +74,7 @@ G4PhysicsVector::~G4PhysicsVector()
|
||||
|
||||
G4PhysicsVector::G4PhysicsVector(const G4PhysicsVector& right)
|
||||
{
|
||||
dBin = right.dBin;
|
||||
invdBin = right.invdBin;
|
||||
baseBin = right.baseBin;
|
||||
verboseLevel = right.verboseLevel;
|
||||
|
||||
@@ -87,7 +87,7 @@ G4PhysicsVector::G4PhysicsVector(const G4PhysicsVector& right)
|
||||
G4PhysicsVector& G4PhysicsVector::operator=(const G4PhysicsVector& right)
|
||||
{
|
||||
if (&right==this) { return *this; }
|
||||
dBin = right.dBin;
|
||||
invdBin = right.invdBin;
|
||||
baseBin = right.baseBin;
|
||||
verboseLevel = right.verboseLevel;
|
||||
|
||||
@@ -512,25 +512,6 @@ G4double G4PhysicsVector::Value(G4double theEnergy, size_t& lastIdx) const
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
G4double G4PhysicsVector::Value(G4double theEnergy, G4double theLogEnergy,
|
||||
size_t& lastIdx) const
|
||||
{
|
||||
G4double y;
|
||||
if(theEnergy <= edgeMin) {
|
||||
lastIdx = 0;
|
||||
y = dataVector[0];
|
||||
} else if(theEnergy >= edgeMax) {
|
||||
lastIdx = numberOfNodes-1;
|
||||
y = dataVector[lastIdx];
|
||||
} else {
|
||||
lastIdx = FindBin(theEnergy, theLogEnergy, lastIdx);
|
||||
y = Interpolation(lastIdx, theEnergy);
|
||||
}
|
||||
return y;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
G4double G4PhysicsVector::FindLinearEnergy(G4double rand) const
|
||||
{
|
||||
if(1 >= numberOfNodes) { return 0.0; }
|
||||
|
||||
Reference in New Issue
Block a user