33 constexpr G4int nmax = 40;
41 const G4int nxsections,
46 std::ostringstream ss;
47 ss << dirpath <<
"/" << filename;
48 std::ifstream infile(ss.str(), std::ios::in);
50 if (nxsections < 1 || length <= 0 || nxsections > nmax) {
52 ed <<
" Wrong data size: nsections=" << nxsections <<
" length="
53 << length <<
" nmax=" << nmax;
54 G4Exception(
"G4MatUtils::BuildExtendedVector(..)",
"mat004",
60 if (!infile.is_open()) {
62 ed <<
" Fail to open file: <" << ss.str() <<
">";
63 G4Exception(
"G4MatUtils::BuildExtendedVector(..)",
"mat004",
74 auto nn = (std::size_t)length;
76 for (std::size_t i=0; i<nn; ++i) {
80 for (
G4int j=0; j<nxsections; ++j) {
86 vtot->PutValues(i, e, sum);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
void SetDataLength(G4int dlength)
void PutPartialXSData(const std::size_t idx, const G4double *y)
static G4ExtendedPhysicsVector * BuildExtendedVector(const G4String &dirpath, const G4String &filename, const G4int N, const G4int length, const G4double unitE=1.0, const G4double unitS=1.0)