63 edgeMin(0.), edgeMax(0.), numberOfNodes(0),
65 dBin(0.), baseBin(0.),
92 if (&right==
this) {
return *
this; }
106 return (
this == &right);
113 return (
this != &right);
177 fOut.write((
char*)(&size),
sizeof size);
180 for(
size_t i = 0; i < size; ++i)
185 fOut.write((
char*)(value), 2*size*(
sizeof (
G4double)));
204 if (fIn.fail()) {
return false; }
208 if (fIn.fail()) {
return false; }
212 G4cerr <<
"G4PhysicsVector::Retrieve():";
222 for(
G4int i = 0; i < siz ; i++)
226 fIn >> vBin >> vData;
227 if (fIn.fail()) {
return false; }
247 fIn.read((
char*)(&size),
sizeof size);
250 fIn.read((
char*)(value), 2*size*(
sizeof(
G4double)) );
259 for(
size_t i = 0; i < size; ++i)
319 - firstPointDerivative);
339 *(endPointDerivative -
346 for(
G4int k=n-1; k>0; --k)
391 for(
G4int i=2; i<n-1; ++i)
406 - (2.0*sig - 1.0)*u[n-2]/p;
414 for(
G4int k=n-2; k>1; --k)
446 for(
size_t i=1; i<
n; ++i)
482 out << std::setprecision(12) << pv.
edgeMin <<
" "
487 for(
size_t i = 0; i < pv.
dataVector.size(); i++)
491 out << std::setprecision(6);
504 }
else if(theEnergy >=
edgeMax) {
508 lastIdx =
FindBin(theEnergy, lastIdx);
520 size_t bin = std::lower_bound(dataVector.begin(), dataVector.end(), y)
521 - dataVector.begin() - 1;
524 G4double del = dataVector[bin+1] - dataVector[bin];
526 res += (y - dataVector[bin])*(
binVector[bin+1] - res)/del;
G4PVDataVector dataVector
G4double FindLinearEnergy(G4double rand) const
G4double Interpolation(size_t idx, G4double energy) const
void CopyData(const G4PhysicsVector &vec)
G4PhysicsVector(G4bool spline=false)
void ComputeSecondDerivatives(G4double firstPointDerivative, G4double endPointDerivative)
G4double GetLowEdgeEnergy(size_t binNumber) const
void FillSecondDerivatives()
G4int operator!=(const G4PhysicsVector &right) const
std::ostream & operator<<(std::ostream &out, const G4PhysicsVector &pv)
G4int operator==(const G4PhysicsVector &right) const
G4PVDataVector secDerivative
virtual void ScaleVector(G4double factorE, G4double factorV)
size_t FindBin(G4double energy, size_t idx) const
G4double Value(G4double theEnergy, size_t &lastidx) const
virtual G4bool Store(std::ofstream &fOut, G4bool ascii=false)
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void ComputeSecDerivatives()
virtual ~G4PhysicsVector()
G4PhysicsVector & operator=(const G4PhysicsVector &)
G4GLOB_DLL std::ostream G4cerr