38 _funcMode{dynamic_cast<
RooAbsPdf *>(&func) ? (extended ? ExtendedPdf : Pdf) : Function}
46RooChi2Var::RooChi2Var(
const RooChi2Var& other,
const char*
name) :
47 RooAbsOptTestStatistic(other,
name),
49 _funcMode(other._funcMode)
61double RooChi2Var::evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize)
const
67 std::vector<std::string> rangeTokens;
68 if (!_rangeName.empty()) {
73 double normFactor(1) ;
75 case Function: normFactor=1 ; break ;
76 case Pdf: normFactor = _dataClone->sumEntries() ; break ;
77 case ExtendedPdf: normFactor = (
static_cast<RooAbsPdf*
>(_funcClone))->expectedEvents(_dataClone->get()) ; break ;
82 for (
auto i=firstEvent ; i<lastEvent ; i+=stepSize) {
89 if (!_rangeName.empty()) {
92 for (
const auto &rangeName : rangeTokens) {
93 bool inThisRange =
true;
94 for (
const auto arg : *row) {
95 if (!arg->inRange(rangeName.c_str())) {
106 if (!doSelect) continue ;
108 const double nData = hdata->
weight(i) ;
110 const double nPdf = _funcClone->getVal(_normSet) * normFactor * hdata->
binVolume(i) ;
112 const double eExt = nPdf-nData ;
120 eInt = (eExt > 0) ? eIntHi : eIntLo;
126 if (0. == eInt * eInt && 0. == nData * nData && 0. == nPdf * nPdf) continue ;
129 if (0. == eInt * eInt) {
130 coutE(Eval) <<
"RooChi2Var::RooChi2Var(" <<
GetName() <<
") INFINITY ERROR: bin " << i
131 <<
" has zero error" << std::endl;
137 double term = eExt*eExt/(
eInt*
eInt) ;
138 double y = term - carry;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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.
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
std::string GetName(TCppScope_t)