Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooXYChi2Var.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 *
4 * Copyright (c) 2024, CERN
5 *
6 * Redistribution and use in source and binary forms,
7 * with or without modification, are permitted according to the terms
8 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
9 */
10
11#ifndef ROO_XY_CHI2_VAR
12#define ROO_XY_CHI2_VAR
13
15#include "RooDataSet.h"
16#include "RooAbsPdf.h"
17#include "RooNumIntConfig.h"
18#include <list>
19class RooAbsIntegrator ;
20
21
23public:
24
25 // Constructors, assignment etc
26 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, bool integrate=false) ;
27 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, bool integrate=false) ;
28 /// \cond ROOFIT_INTERNAL
29 // For internal use in RooAbsReal::createChi2().
30 RooXYChi2Var(const char *name, const char *title, RooAbsReal& func, RooAbsData& data, RooRealVar *yvar, bool integrate,
32 /// \endcond ROOFIT_INTERNAL
33
34 RooXYChi2Var(const RooXYChi2Var& other, const char* name=nullptr);
35 TObject* clone(const char* newname) const override { return new RooXYChi2Var(*this,newname); }
36
37 RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
38 const RooArgSet&, RooAbsTestStatistic::Configuration const&) override {
39 // Virtual constructor
40 return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
41 }
42
43 ~RooXYChi2Var() override;
44
45 double defaultErrorLevel() const override {
46 // The default error level for MINUIT error analysis for a chi^2 is 1.0
47 return 1.0 ;
48 }
49
52
53protected:
54
55 bool allowFunctionCache() override {
56 // Disable function (component) caching if integration is requested as the function
57 // will be evaluated at coordinates other than the points in the dataset
58 return !_integrate ;
59 }
60
61 RooArgSet requiredExtraObservables() const override ;
62
63 double fy() const ;
64
65 bool _extended ; ///< Is the input function and extended p.d.f.
66 bool _integrate ; ///< Is integration over the bin volume requested
67
68 RooRealVar* _yvar ; ///< Y variable if so designated
69 RooArgSet _rrvArgs ; ///< Set of real-valued observables
70
71 void initialize() ;
72 void initIntegrator() ;
73 double xErrorContribution(double ydata) const ;
74
75 double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
76
77 RooNumIntConfig _intConfig ; ///< Numeric integrator configuration for integration of function over bin
78 std::unique_ptr<RooAbsReal> _funcInt; ///<! Function integral
79 std::list<RooAbsBinning*> _binList ; ///<! Bin ranges
80};
81
82
83#endif
char name[80]
Definition TGX11.cxx:110
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:57
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
Abstract base class for test statistics objects that evaluate a function or PDF at each point of a gi...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
Abstract base class for all test statistics.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Container class to hold unbinned data.
Definition RooDataSet.h:33
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
RooXYChi2Var implements a simple chi^2 calculation from an unbinned dataset with values x,...
RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &pdf, RooAbsData &adata, const RooArgSet &, RooAbsTestStatistic::Configuration const &) override
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.
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.
double defaultErrorLevel() const override
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.
const RooNumIntConfig & binIntegratorConfig() const
void initialize()
Common constructor initialization.
RooNumIntConfig _intConfig
Numeric integrator configuration for integration of function over bin.
~RooXYChi2Var() override
bool allowFunctionCache() override
TObject * clone(const char *newname) const override
RooNumIntConfig & binIntegratorConfig()
Mother of all ROOT objects.
Definition TObject.h:41