Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooXYChi2Var.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17#ifndef ROO_XY_CHI2_VAR
18#define ROO_XY_CHI2_VAR
19
20// We can't print deprecation warnings when including headers in cling, because
21// this will be done automatically anyway.
22#ifdef __CLING__
23#ifndef ROOFIT_BUILDS_ITSELF
24// These warnings should only be suppressed when building ROOT itself!
25#warning "Including RooXYChi2Var.h is deprecated, and this header will be removed in ROOT v6.34: please use RooAbsReal::createChi2(RooAbsData &, ...) to create chi-square test statistics objects on X-Y data"
26#else
27// If we are builting RooFit itself, this will serve as a reminder to actually
28// remove this deprecate public header. Here is now this needs to be done:
29// 1. Move this header file from inc/ to src/
30// 2. Remove the LinkDef entry, ClassDefOverride, and ClassImpl macros for
31// this class
32// 3. If there are are tests using this class in the test/ directory, change
33// the include to use a relative path the moved header file in the src/
34// directory, e.g. #include <RemovedInterface.h> becomes #include
35// "../src/RemovedInterface.h"
36// 4. Remove this ifndef-else-endif block from the header
37// 5. Remove the deprecation warning at the end of the class declaration
38#include <RVersion.h>
39#if ROOT_VERSION_CODE >= ROOT_VERSION(6, 34, 00)
40#error "Please remove this deprecated public interface."
41#endif
42#endif
43#endif
44
46#include "RooDataSet.h"
47#include "RooAbsPdf.h"
49#include <list>
51
54public:
56 // Constructors, assignment etc
57 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, bool integrate=false) ;
58 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, bool integrate=false) ;
59 /// \cond ROOFIT_INTERNAL
60 // For internal use in RooAbsReal::createChi2().
61 RooXYChi2Var(const char *name, const char *title, RooAbsReal& func, RooAbsData& data, RooRealVar *yvar, bool integrate,
63 /// \endcond ROOFIT_INTERNAL
64
65 RooXYChi2Var(const RooXYChi2Var& other, const char* name=nullptr);
66 TObject* clone(const char* newname) const override { return new RooXYChi2Var(*this,newname); }
67
68 RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
69 const RooArgSet&, RooAbsTestStatistic::Configuration const&) override {
70 // Virtual constructor
71 return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
72 }
73
74 ~RooXYChi2Var() override;
75
76 double defaultErrorLevel() const override {
77 // The default error level for MINUIT error analysis for a chi^2 is 1.0
78 return 1.0 ;
79 }
80
83
84protected:
85
86 bool allowFunctionCache() override {
87 // Disable function (component) caching if integration is requested as the function
88 // will be evaluated at coordinates other than the points in the dataset
89 return !_integrate ;
90 }
91
92 RooArgSet requiredExtraObservables() const override ;
93
94 double fy() const ;
95
96 bool _extended ; ///< Is the input function and extended p.d.f.
97 bool _integrate ; ///< Is integration over the bin volume requested
98
99 RooRealVar* _yvar ; ///< Y variable if so designated
100 RooArgSet _rrvArgs ; ///< Set of real-valued observables
101
102 void initialize() ;
103 void initIntegrator() ;
104 double xErrorContribution(double ydata) const ;
105
106 double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
107
108 RooNumIntConfig _intConfig ; ///< Numeric integrator configuration for integration of function over bin
109 std::unique_ptr<RooAbsReal> _funcInt; ///<! Function integral
110 std::list<RooAbsBinning*> _binList ; ///<! Bin ranges
111
112 ClassDefOverride(RooXYChi2Var,0) // Chi^2 function of p.d.f w.r.t a unbinned dataset with X and Y values
113
114#ifndef ROOFIT_BUILDS_ITSELF
115} R__DEPRECATED(6,34, "Please use RooAbsReal::createChi2(RooAbsData &, ...) to create chi-square test statistics objects on X-Y data");
116#else
117};
118#endif
119
120
121#endif
#define R__DEPRECATED(MAJOR, MINOR, REASON)
Definition RConfig.hxx:504
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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:55
Container class to hold unbinned data.
Definition RooDataSet.h:57
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