87 _integrate(integrate),
88 _intConfig(*defaultIntegratorConfig())
114 _integrate(integrate),
115 _intConfig(*defaultIntegratorConfig())
144 _integrate(integrate),
145 _intConfig(*defaultIntegratorConfig())
148 throw std::runtime_error(
Form(
"RooXYChi2Var::RooXYChi2Var(%s) ERROR: Input p.d.f. must be extendible",
GetName()));
177 _integrate(integrate),
178 _intConfig(*defaultIntegratorConfig())
181 throw std::runtime_error(
Form(
"RooXYChi2Var::ctor(%s) ERROR: Input p.d.f. must be an extendible",
GetName()));
195 _extended(other._extended),
196 _integrate(other._integrate),
197 _intConfig(other._intConfig)
218 if (
auto* var =
dynamic_cast<RooRealVar*
>(arg)) {
231#ifdef R__HAS_MATHMORE
249 for(
auto *
x : static_range_cast<RooRealVar*>(
_rrvArgs)) {
250 _binList.push_back(&
x->getBinning(
"bin",
false,
true)) ;
268 for(
auto * var : static_range_cast<RooRealVar*>(
_rrvArgs)) {
270 if (var->hasAsymError()) {
273 double cxval = var->getVal() ;
274 double xerrLo = -var->getAsymErrorLo() ;
275 double xerrHi = var->getAsymErrorHi() ;
276 double xerr = (xerrLo+xerrHi)/2 ;
279 var->setVal(cxval - xerr/100) ;
280 double fxmin =
fy() ;
283 var->setVal(cxval + xerr/100) ;
284 double fxmax =
fy() ;
287 double slope = (fxmax-fxmin)/(2*xerr/100.) ;
292 if ((ydata>cxval && fxmax>fxmin) || (ydata<=cxval && fxmax<=fxmin)) {
294 ret += pow(xerrHi*slope,2) ;
297 ret += pow(xerrLo*slope,2) ;
300 }
else if (var->hasError()) {
303 double cxval = var->getVal() ;
304 double xerr = var->getError() ;
307 var->setVal(cxval - xerr/100) ;
308 double fxmin =
fy() ;
311 var->setVal(cxval + xerr/100) ;
312 double fxmax =
fy() ;
315 double slope = (fxmax-fxmin)/(2*xerr/100.) ;
323 ret += pow(xerr*slope,2) ;
354 double xmin =
x->getVal() +
x->getErrorLo() ;
355 double xmax =
x->getVal() +
x->getErrorHi() ;
362 return ret / volume ;
379 double result(0), carry(0);
386 for (
auto i=firstEvent ; i<lastEvent ; i+=stepSize) {
392 double yfunc =
fy() ;
402 ydata = xydata->
weight() ;
407 double eExt = yfunc-ydata ;
410 double eInt = (eExt>0) ? eyhi : eylo ;
419 coutE(Eval) <<
"RooXYChi2Var::RooXYChi2Var(" <<
GetName() <<
") INFINITY ERROR: data point " << i
420 <<
" has zero error, but function is not zero (f=" << yfunc <<
")" << endl ;
425 double term = eExt*eExt/(eInt*eInt+ eIntX2);
426 double y = term - carry;
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
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
const_iterator begin() const
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual void recalculateCache(const RooArgSet *, Int_t, Int_t, Int_t, bool)
virtual const RooArgSet * get() const
RooAbsDataStore * store()
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
RooAbsReal * _funcClone
Pointer to internal clone of input function.
RooArgSet * _funcObsSet
List of observables in the pdf expression.
RooAbsData * _dataClone
Pointer to internal clone if input data.
RooArgSet * _projDeps
Set of projected observable.
virtual double expectedEvents(const RooArgSet *nset) const
Return expected number of events to be used in calculation of extended likelihood.
bool canBeExtended() const
If true, PDF can provide extended likelihood term.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooFit::OwningPtr< RooAbsReal > createIntegral(const RooArgSet &iset, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Create an object that represents the integral of the function over one or more observables std::liste...
double _evalCarry
! carry of Kahan sum in evaluatePartition
GOFOpMode operMode() const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
bool setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
RooDataSet is a container class to hold unbinned data.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
void weightError(double &lo, double &hi, ErrorType etype=SumW2) const override
Return the asymmetric errors on the current weight.
double weight() const override
Return event weight of current event.
void setEpsRel(double newEpsRel)
Set relative convergence criteria (convergence if std::abs(Err)/abs(Int)<newEpsRel)
void setEpsAbs(double newEpsAbs)
Set absolute convergence criteria (convergence if std::abs(Err)<newEpsAbs)
RooRealVar represents a variable that can be changed from the outside.
double getErrorLo() const
double getErrorHi() const
RooXYChi2Var implements a simple chi^2 calculation from an unbinned dataset with values x,...
double fy() const
Return function value requested bu present configuration.
std::unique_ptr< RooAbsReal > _funcInt
! Function integral
std::list< RooAbsBinning * > _binList
! Bin ranges
bool _extended
Is the input function and extended p.d.f.
void initIntegrator()
Initialize bin content integrator.
RooRealVar * _yvar
Y variable if so designated.
RooXYChi2Var()
coverity[UNINIT_CTOR]
RooArgSet requiredExtraObservables() const override
double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override
Calculate chi^2 in partition from firstEvent to lastEvent using given stepSize.
bool _integrate
Is integration over the bin volume requested.
RooArgSet _rrvArgs
Set of real-valued observables.
double xErrorContribution(double ydata) const
Calculate contribution to internal error due to error on 'x' coordinates at point i.
void initialize()
Common constructor initialization.
RooNumIntConfig _intConfig
Numeric integrator configuration for integration of function over bin.
const char * GetName() const override
Returns name of object.