40 _funcMode{dynamic_cast<
RooAbsPdf *>(&func) ? (extended ? ExtendedPdf : Pdf) :
Function}
48RooChi2Var::RooChi2Var(
const RooChi2Var& other,
const char*
name) :
49 RooAbsOptTestStatistic(other,
name),
51 _funcMode(other._funcMode)
63double RooChi2Var::evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize)
const
69 std::vector<std::string> rangeTokens;
70 if (!_rangeName.empty()) {
75 double normFactor(1) ;
78 case Pdf: normFactor = _dataClone->sumEntries() ;
break ;
79 case ExtendedPdf: normFactor = (
static_cast<RooAbsPdf*
>(_funcClone))->expectedEvents(_dataClone->get()) ;
break ;
84 for (
auto i=firstEvent ; i<lastEvent ; i+=stepSize) {
91 if (!_rangeName.empty()) {
94 for (
const auto &rangeName : rangeTokens) {
95 bool inThisRange =
true;
96 for (
const auto arg : *row) {
97 if (!arg->inRange(rangeName.c_str())) {
108 if (!doSelect) continue ;
110 const double nData = hdata->
weight(i) ;
112 const double nPdf = _funcClone->getVal(_normSet) * normFactor * hdata->
binVolume(i) ;
114 const double eExt = nPdf-nData ;
122 eInt = (eExt > 0) ? eIntHi : eIntLo;
128 if (0. == eInt * eInt && 0. == nData * nData && 0. == nPdf * nPdf) continue ;
131 if (0. == eInt * eInt) {
132 coutE(Eval) <<
"RooChi2Var::RooChi2Var(" << GetName() <<
") INFINITY ERROR: bin " << i
133 <<
" has zero error" << std::endl;
139 double term = eExt*eExt/(
eInt*
eInt) ;
140 double y = term - carry;
141 double t = result +
y;
142 carry = (t - result) -
y;
Double_t(* Function)(Double_t)
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold N-dimensional binned data.
double weight(std::size_t i) const
Return weight of i-th bin.
void weightError(double &lo, double &hi, ErrorType etype=Poisson) const override
Return the asymmetric errors on the current weight.
double binVolume(std::size_t i) const
Return bin volume of i-th bin.
const RooArgSet * get() const override
Get bin centre of current bin.
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.