45 ITTL =
new std::vector<size_t>;
46 ITTU =
new std::vector<size_t>;
56 if (ITTL)
delete ITTL;
57 if (ITTU)
delete ITTU;
63 size_t points = x->size();
66 if (pac->size() != points || a->size() != points ||
67 b->size() != points || ITTL->size() != points ||
68 ITTU->size() != points)
71 ed <<
"Data vectors look to have different dimensions !" <<
G4endl;
72 G4Exception(
"G4PenelopeSamplingData::GetNumberOfStoredPoints()",
"em2040",
85 if (ITTL)
delete ITTL;
86 if (ITTU)
delete ITTU;
92 ITTL =
new std::vector<size_t>;
93 ITTU =
new std::vector<size_t>;
98 size_t ITTL0,
size_t ITTU0)
101 pac->push_back(pac0);
104 ITTL->push_back(ITTL0);
105 ITTU->push_back(ITTU0);
110 if (nOfPoints > ((
size_t)np))
112 G4cout <<
"G4PenelopeSamplingData::AddPoint() " <<
G4endl;
113 G4cout <<
"WARNING: Up to now there are " << nOfPoints <<
" points in the table" <<
G4endl;
114 G4cout <<
"while the anticipated (declared) number is " << np <<
G4endl;
123 G4cout <<
"*************************************************************************" <<
G4endl;
125 G4cout <<
"*************************************************************************" <<
G4endl;
128 G4cout << i <<
" " << (*x)[i] <<
" " << (*pac)[i] <<
" " << (*a)[i] <<
" " <<
129 (*b)[i] <<
" " << (*ITTL)[i] <<
" " << (*ITTU)[i] <<
G4endl;
131 G4cout <<
"*************************************************************************" <<
G4endl;
137 if (index < x->size())
146 if (index < pac->size())
147 return (*pac)[index];
155 if (index < a->size())
164 if (index < b->size())
177 size_t itn = (size_t) (maxRand*(points-1));
178 size_t i = (*ITTL)[itn];
179 size_t j = (*ITTU)[itn];
184 if (maxRand > (*pac)[k])
198 ((1.0+(*a)[i]+(*b)[i])*d*rr/
199 (d*d+((*a)[i]*d+(*b)[i]*rr)*rr))*((*x)[i+1]-(*x)[i]);
G4DLLIMPORT std::ostream G4cout
G4double GetA(size_t index)
G4double GetPAC(size_t index)
size_t GetNumberOfStoredPoints()
void AddPoint(G4double x0, G4double pac0, G4double a0, G4double b0, size_t ITTL0, size_t ITTU0)
G4double GetX(size_t index)
G4PenelopeSamplingData(G4int npoints=150)
~G4PenelopeSamplingData()
G4double SampleValue(G4double rndm)
G4double GetB(size_t index)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription