44 current_ncase(0), current_ncase_65536(0), current_ncase_short(0) {
45 if (N <= 0)
egsFatal(
"EGS_ScoringArray::EGS_ScoringArray:\n"
46 " attempt to construct a scoring array with non-positive size\n");
58 EGS_I64 aux = ncase >> 16;
61 for (
int j=0; j<
nreg; j++) {
65 aux = ncase - (aux << 16);
66 unsigned short aux1 = (
unsigned short) aux;
72 bool relative_error,
const char *format) {
76 egsWarning(
"EGS_ScoringArray::reportResults: you must run more than 2 "
80 char c = (relative_error) ?
'%' :
' ';
81 string myformat =
" %d %g +/- %g %c\n";
82 const char *oformat = format ? format : myformat.c_str();
83 for (
int j=0; j<
nreg; j++) {
87 dr = (r > 0) ? 100*dr/r : 100;
EGS_ScoringArray(int N)
Construct a scoring array with N elements.
unsigned short current_ncase_short
void setHistory(EGS_I64 ncase)
Set the current statistically independent event to ncase.
Global egspp functions header file.
EGS_ScoringSingle * result
void finishCase(unsigned short new_case, EGS_Float new_result)
Finish the current 'case' (event) and start a new event with index new_case and a score of new_result...
EGS_I64 current_ncase_65536
A class for scoring a single quantity of interest in a Monte Carlo simulation.
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
void reportResults(double norm, const char *title, bool relative_error, const char *format=0)
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_ScoringSingle and EGS_ScoringArray class header file.
void currentResult(EGS_I64 ncase, double &r, double &dr)
Sets r to the current result and dr to its statistical uncertainty assuming ncase statistically indep...
~EGS_ScoringArray()
Destructor. Deallocates all allocated memory.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.