44 ITTL =
new std::vector<size_t>;
45 ITTU =
new std::vector<size_t>;
55 if (ITTL)
delete ITTL;
56 if (ITTU)
delete ITTU;
62 size_t points = x->size();
65 if (pac->size() != points || a->size() != points ||
66 b->size() != points || ITTL->size() != points ||
67 ITTU->size() != points)
70 ed <<
"Data vectors look to have different dimensions !" <<
G4endl;
71 G4Exception(
"G4PenelopeSamplingData::GetNumberOfStoredPoints()",
"em2040",
84 if (ITTL)
delete ITTL;
85 if (ITTU)
delete ITTU;
91 ITTL =
new std::vector<size_t>;
92 ITTU =
new std::vector<size_t>;
97 size_t ITTL0,
size_t ITTU0)
100 pac->push_back(pac0);
103 ITTL->push_back(ITTL0);
104 ITTU->push_back(ITTU0);
109 if (nOfPoints > ((
size_t)np))
111 G4cout <<
"G4PenelopeSamplingData::AddPoint() " <<
G4endl;
112 G4cout <<
"WARNING: Up to now there are " << nOfPoints <<
" points in the table" <<
G4endl;
113 G4cout <<
"while the anticipated (declared) number is " << np <<
G4endl;
122 G4cout <<
"*************************************************************************" <<
G4endl;
124 G4cout <<
"*************************************************************************" <<
G4endl;
127 G4cout << i <<
" " << (*x)[i] <<
" " << (*pac)[i] <<
" " << (*a)[i] <<
" " <<
128 (*b)[i] <<
" " << (*ITTL)[i] <<
" " << (*ITTU)[i] <<
G4endl;
130 G4cout <<
"*************************************************************************" <<
G4endl;
136 if (index < x->size())
145 if (index < pac->size())
146 return (*pac)[index];
154 if (index < a->size())
163 if (index < b->size())
176 size_t itn = (size_t) (maxRand*(points-1));
177 size_t i = (*ITTL)[itn];
178 size_t j = (*ITTU)[itn];
183 if (maxRand > (*pac)[k])
197 ((1.0+(*a)[i]+(*b)[i])*d*rr/
198 (d*d+((*a)[i]*d+(*b)[i]*rr)*rr))*((*x)[i+1]-(*x)[i]);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL 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)