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
21#include "RooCmdArg.h"
22#include "RooDataSet.h"
23#include "RooAbsPdf.h"
24#include "RooNumIntConfig.h"
25#include <list>
26class RooAbsIntegrator ;
27
28
30public:
31
32 // Constructors, assignment etc
33 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, bool integrate=false) ;
34 RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, bool integrate=false) ;
35 /// \cond ROOFIT_INTERNAL
36 // For internal use in RooAbsReal::createChi2().
37 RooXYChi2Var(const char *name, const char *title, RooAbsReal& func, RooAbsData& data, RooRealVar *yvar, bool integrate,
39 /// \endcond ROOFIT_INTERNAL
40
41 RooXYChi2Var(const RooXYChi2Var& other, const char* name=nullptr);
42 TObject* clone(const char* newname) const override { return new RooXYChi2Var(*this,newname); }
43
44 RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
45 const RooArgSet&, RooAbsTestStatistic::Configuration const&) override {
46 // Virtual constructor
47 return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
48 }
49
50 ~RooXYChi2Var() override;
51
52 double defaultErrorLevel() const override {
53 // The default error level for MINUIT error analysis for a chi^2 is 1.0
54 return 1.0 ;
55 }
56
59
60protected:
61
62 bool allowFunctionCache() override {
63 // Disable function (component) caching if integration is requested as the function
64 // will be evaluated at coordinates other than the points in the dataset
65 return !_integrate ;
66 }
67
68 RooArgSet requiredExtraObservables() const override ;
69
70 double fy() const ;
71
72 bool _extended ; ///< Is the input function and extended p.d.f.
73 bool _integrate ; ///< Is integration over the bin volume requested
74
75 RooRealVar* _yvar ; ///< Y variable if so designated
76 RooArgSet _rrvArgs ; ///< Set of real-valued observables
77
78 void initialize() ;
79 void initIntegrator() ;
80 double xErrorContribution(double ydata) const ;
81
82 double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
83
84 RooNumIntConfig _intConfig ; ///< Numeric integrator configuration for integration of function over bin
85 std::unique_ptr<RooAbsReal> _funcInt; ///<! Function integral
86 std::list<RooAbsBinning*> _binList ; ///<! Bin ranges
87
88 ClassDefOverride(RooXYChi2Var,0) // Chi^2 function of p.d.f w.r.t a unbinned dataset with X and Y values
89};
90
91
92#endif
#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.
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
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
RooDataSet is a container class to hold unbinned data.
Definition RooDataSet.h:57
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooRealVar represents a 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