10 #ifndef LARDATA_UTILITIES_CHISQUAREACCUMULATOR_H
11 #define LARDATA_UTILITIES_CHISQUAREACCUMULATOR_H
54 template <
typename F,
typename T =
double>
85 unsigned int N()
const {
return fN; }
130 unsigned int fN = 0U;
137 {
return (x - mu) / sigma; }
160 template <
typename F>
179 template <
typename T,
typename F>
191 #endif // LARDATA_UTILITIES_CHISQUAREACCUMULATOR_H
auto makeChiSquareAccumulator(F &&e)
Creates a ChiSquareAccumulator object with the specified function.
void add(Data_t x, Data_t y, Data_t s)
Adds a data point to the χ.
void clear()
Resets all the counts, starting from no data.
Computes a χ from expectation function and data points.
process_name opflash particleana ie x
Data_t chiSquare() const
Returns the value of χ currently accumulated.
static Data_t sqr(Data_t v)
The usual square function.
unsigned int fN
Number of data entries.
void add(Data_t x, Data_t y)
Adds a data point to the χ.
ChiSquareAccumulator(Function_t const &expected)
Constructor: uses the specified expectation function.
Function_t fExpected
Function for the expectation.
Data_t expected(Data_t x) const
Returns the expected value for the specified parameter.
process_name opflash particleana ie ie y
F Function_t
Type of function for the expectation.
Data_t fChiSq
Accumulated χ value.
static Data_t z(Data_t x, Data_t mu, Data_t sigma)
Normal variable.
T Data_t
Type of parameter and observed values.
then echo File list $list not found else cat $list while read file do echo $file sed s
unsigned int N() const
Returns the number of added points (it's not degrees of freedom yet!).
Data_t operator()() const