45 current_ncase(0), current_ncase_65536(0), current_ncase_short(0) {
46 if (N <= 0)
egsFatal(
"EGS_ScoringArray::EGS_ScoringArray:\n"
47 " attempt to construct a scoring array with non-positive size\n");
59 EGS_I64 aux = ncase >> 16;
62 for (
int j=0; j<
nreg; j++) {
66 aux = ncase - (aux << 16);
67 unsigned short aux1 = (
unsigned short) aux;
73 bool relative_error,
const char *format) {
77 egsWarning(
"EGS_ScoringArray::reportResults: you must run more than 2 "
81 char c = (relative_error) ?
'%' :
' ';
82 string myformat =
" %d %g +/- %g %c\n";
83 const char *oformat = format ? format : myformat.c_str();
84 for (
int j=0; j<
nreg; j++) {
88 dr = (r > 0) ? 100*dr/r : 100;
~EGS_ScoringArray()
Destructor. Deallocates all allocated memory.
EGS_I64 current_ncase_65536
EGS_ScoringArray(int N)
Construct a scoring array with N elements.
void setHistory(EGS_I64 ncase)
Set the current statistically independent event to ncase.
EGS_ScoringSingle * result
void reportResults(double norm, const char *title, bool relative_error, const char *format=0)
unsigned short current_ncase_short
A class for scoring a single quantity of interest in a Monte Carlo simulation.
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...
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...
Global egspp functions header file.
EGS_ScoringSingle and EGS_ScoringArray class header file.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
EGS_InfoFunction EGS_EXPORT egsFatal
Always use this function for reporting fatal errors.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.