Logo ROOT  
Reference Guide
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 #include "RooAbsOptTestStatistic.h"
21 #include "RooCmdArg.h"
22 #include "RooDataSet.h"
23 #include "RooAbsPdf.h"
24 #include "RooNumIntConfig.h"
25 #include <list>
26 class RooAbsIntegrator ;
27 
28 
30 public:
31 
32  // Constructors, assignment etc
33  RooXYChi2Var() ;
34  RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, Bool_t integrate=kFALSE) ;
35  RooXYChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
36  RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, Bool_t integrate=kFALSE) ;
37  RooXYChi2Var(const char *name, const char* title, RooAbsPdf& extPdf, RooDataSet& data, RooRealVar& yvar, Bool_t integrate=kFALSE) ;
38 
39  RooXYChi2Var(const RooXYChi2Var& other, const char* name=0);
40  virtual TObject* clone(const char* newname) const { return new RooXYChi2Var(*this,newname); }
41 
42  virtual RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& adata,
43  const RooArgSet&, const char*, const char*,Int_t, RooFit::MPSplit,Bool_t, Bool_t, Bool_t) {
44  // Virtual constructor
45  return new RooXYChi2Var(name,title,pdf,(RooDataSet&)adata) ;
46  }
47 
48  virtual ~RooXYChi2Var();
49 
50  virtual Double_t defaultErrorLevel() const {
51  // The default error level for MINUIT error analysis for a chi^2 is 1.0
52  return 1.0 ;
53  }
54 
56  const RooNumIntConfig& binIntegratorConfig() const { return _intConfig ; }
57 
58 protected:
59 
61  // Disable function (component) caching if integration is requested as the function
62  // will be evaluated at coordinates other than the points in the dataset
63  return !_integrate ;
64  }
65 
67 
68  Double_t fy() const ;
69 
70  Bool_t _extended ; // Is the input function and extended p.d.f.
71  Bool_t _integrate ; // Is integration over the bin volume requested
72 
73  RooRealVar* _yvar ; // Y variable if so designated
74  RooArgSet _rrvArgs ; // Set of real-valued observables
75  TIterator* _rrvIter ; //! Iterator over set of real-valued observables
76 
77  void initialize() ;
78  void initIntegrator() ;
79  Double_t xErrorContribution(Double_t ydata) const ;
80 
81  virtual Double_t evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const ;
82 
83  RooNumIntConfig _intConfig ; // Numeric integrator configuration for integration of function over bin
84  RooAbsReal* _funcInt ; //! Function integral
85  std::list<RooAbsBinning*> _binList ; //! Bin ranges
86 
87  ClassDef(RooXYChi2Var,1) // Chi^2 function of p.d.f w.r.t a unbinned dataset with X and Y values
88 };
89 
90 
91 #endif
RooXYChi2Var::_extended
Bool_t _extended
Definition: RooXYChi2Var.h:70
RooXYChi2Var::defaultErrorLevel
virtual Double_t defaultErrorLevel() const
Definition: RooXYChi2Var.h:50
RooXYChi2Var::requiredExtraObservables
RooArgSet requiredExtraObservables() const
Definition: RooXYChi2Var.cxx:458
RooAbsData
Definition: RooAbsData.h:46
RooNumIntConfig.h
RooAbsOptTestStatistic::data
RooAbsData & data()
Definition: RooAbsOptTestStatistic.cxx:792
RooXYChi2Var::~RooXYChi2Var
virtual ~RooXYChi2Var()
Destructor.
Definition: RooXYChi2Var.cxx:262
RooAbsOptTestStatistic.h
RooXYChi2Var::RooXYChi2Var
RooXYChi2Var()
coverity[UNINIT_CTOR]
Definition: RooXYChi2Var.cxx:56
RooFit::MPSplit
MPSplit
Definition: RooGlobalFunc.h:70
RooXYChi2Var::xErrorContribution
Double_t xErrorContribution(Double_t ydata) const
Calculate contribution to internal error due to error on 'x' coordinates at point i.
Definition: RooXYChi2Var.cxx:275
RooAbsReal
Definition: RooAbsReal.h:61
RooDataSet.h
bool
TIterator
Definition: TIterator.h:30
RooXYChi2Var::initialize
void initialize()
Iterator over set of real-valued observables.
Definition: RooXYChi2Var.cxx:209
RooXYChi2Var::_rrvArgs
RooArgSet _rrvArgs
Definition: RooXYChi2Var.h:74
RooAbsTestStatistic
Definition: RooAbsTestStatistic.h:37
RooXYChi2Var::_integrate
Bool_t _integrate
Definition: RooXYChi2Var.h:71
RooXYChi2Var::_yvar
RooRealVar * _yvar
Definition: RooXYChi2Var.h:73
RooXYChi2Var::_funcInt
RooAbsReal * _funcInt
Definition: RooXYChi2Var.h:84
RooAbsPdf.h
RooXYChi2Var::allowFunctionCache
Bool_t allowFunctionCache()
Definition: RooXYChi2Var.h:60
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooXYChi2Var::binIntegratorConfig
const RooNumIntConfig & binIntegratorConfig() const
Definition: RooXYChi2Var.h:56
RooXYChi2Var::_rrvIter
TIterator * _rrvIter
Definition: RooXYChi2Var.h:75
RooXYChi2Var::_intConfig
RooNumIntConfig _intConfig
Definition: RooXYChi2Var.h:83
RooXYChi2Var::evaluatePartition
virtual Double_t evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const
Calculate chi^2 in partition from firstEvent to lastEvent using given stepSize.
Definition: RooXYChi2Var.cxx:389
RooCmdArg.h
RooXYChi2Var::initIntegrator
void initIntegrator()
Initialize bin content integrator.
Definition: RooXYChi2Var.cxx:244
Double_t
double Double_t
Definition: RtypesCore.h:59
RooXYChi2Var::fy
Double_t fy() const
Return function value requested bu present configuration.
Definition: RooXYChi2Var.cxx:356
RooAbsOptTestStatistic
Definition: RooAbsOptTestStatistic.h:28
TObject
Definition: TObject.h:37
RooXYChi2Var::create
virtual RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &pdf, RooAbsData &adata, const RooArgSet &, const char *, const char *, Int_t, RooFit::MPSplit, Bool_t, Bool_t, Bool_t)
Definition: RooXYChi2Var.h:42
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooXYChi2Var::binIntegratorConfig
RooNumIntConfig & binIntegratorConfig()
Definition: RooXYChi2Var.h:55
name
char name[80]
Definition: TGX11.cxx:110
RooXYChi2Var
Definition: RooXYChi2Var.h:29
RooXYChi2Var::_binList
std::list< RooAbsBinning * > _binList
Function integral.
Definition: RooXYChi2Var.h:85
RooDataSet
Definition: RooDataSet.h:33
RooNumIntConfig
Definition: RooNumIntConfig.h:25
RooAbsPdf
Definition: RooAbsPdf.h:40
RooAbsIntegrator
Definition: RooAbsIntegrator.h:22
RooRealVar
Definition: RooRealVar.h:36
RooXYChi2Var::clone
virtual TObject * clone(const char *newname) const
Definition: RooXYChi2Var.h:40
RooArgSet
Definition: RooArgSet.h:28
int