Logo ROOT  
Reference Guide
RooChi2Var.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooChi2Var.h,v 1.12 2007/05/11 09:11:30 verkerke Exp $
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_CHI2_VAR
18#define ROO_CHI2_VAR
19
21#include "RooCmdArg.h"
22#include "RooDataHist.h"
23#include "RooAbsPdf.h"
24
26public:
27
28 // Constructors, assignment etc
29 RooChi2Var(const char *name, const char* title, RooAbsReal& func, RooDataHist& data,
30 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(),
31 const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(),
32 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ;
33
34 RooChi2Var(const char *name, const char* title, RooAbsPdf& pdf, RooDataHist& data,
35 const RooCmdArg& arg1=RooCmdArg::none(), const RooCmdArg& arg2=RooCmdArg::none(),const RooCmdArg& arg3=RooCmdArg::none(),
36 const RooCmdArg& arg4=RooCmdArg::none(), const RooCmdArg& arg5=RooCmdArg::none(),const RooCmdArg& arg6=RooCmdArg::none(),
37 const RooCmdArg& arg7=RooCmdArg::none(), const RooCmdArg& arg8=RooCmdArg::none(),const RooCmdArg& arg9=RooCmdArg::none()) ;
38
40
41 RooChi2Var(const RooChi2Var& other, const char* name=nullptr);
42 TObject* clone(const char* newname) const override { return new RooChi2Var(*this,newname); }
43
44 RooAbsTestStatistic* create(const char *name, const char *title, RooAbsReal& pdf, RooAbsData& dhist,
45 const RooArgSet& projDeps, RooAbsTestStatistic::Configuration const& cfg) override {
46 // Virtual constructor
47 return new RooChi2Var(name,title,(RooAbsPdf&)pdf,(RooDataHist&)dhist,projDeps,_funcMode,cfg,_etype) ;
48 }
49
50 double defaultErrorLevel() const override {
51 // The default error level for MINUIT error analysis for a chi^2 is 1.0
52 return 1.0 ;
53 }
54
55private:
56
57 RooChi2Var(const char *name, const char *title, RooAbsReal& func, RooDataHist& data,
58 const RooArgSet& projDeps, FuncMode funcMode,
61 : RooAbsOptTestStatistic(name,title,func,data,projDeps,cfg), _etype(etype), _funcMode(funcMode) {}
62
63protected:
64
65 double evaluatePartition(std::size_t firstEvent, std::size_t lastEvent, std::size_t stepSize) const override ;
66
67 static RooArgSet _emptySet ; ///< Supports named argument constructor
68
69 RooDataHist::ErrorType _etype ; ///< Error type store in associated RooDataHist
70 FuncMode _funcMode ; ///< Function, P.d.f. or extended p.d.f?
71
72 ClassDefOverride(RooChi2Var,1) // Chi^2 function of p.d.f w.r.t a binned dataset
73};
74
75
76#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:62
RooAbsOptTestStatistic is the abstract base class for test statistics objects that evaluate a functio...
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:62
RooAbsTestStatistic is the abstract base class for all test statistics.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:56
RooChi2Var implements a simple calculation from a binned dataset and a PDF.
Definition: RooChi2Var.h:25
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 Throughout the calcula...
Definition: RooChi2Var.cxx:241
RooAbsTestStatistic * create(const char *name, const char *title, RooAbsReal &pdf, RooAbsData &dhist, const RooArgSet &projDeps, RooAbsTestStatistic::Configuration const &cfg) override
Definition: RooChi2Var.h:44
RooChi2Var(const char *name, const char *title, RooAbsReal &func, RooDataHist &data, const RooArgSet &projDeps, FuncMode funcMode, RooAbsTestStatistic::Configuration const &cfg, RooDataHist::ErrorType etype)
Definition: RooChi2Var.h:57
RooDataHist::ErrorType _etype
Error type store in associated RooDataHist.
Definition: RooChi2Var.h:69
RooChi2Var(const char *name, const char *title, RooAbsReal &func, RooDataHist &data, const RooCmdArg &arg1=RooCmdArg::none(), 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 RooCmdArg &arg9=RooCmdArg::none())
RooChi2Var constructor.
Definition: RooChi2Var.cxx:138
FuncMode _funcMode
Function, P.d.f. or extended p.d.f?
Definition: RooChi2Var.h:70
TObject * clone(const char *newname) const override
Definition: RooChi2Var.h:42
double defaultErrorLevel() const override
Definition: RooChi2Var.h:50
static RooArgSet _emptySet
Supports named argument constructor.
Definition: RooChi2Var.h:67
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Definition: RooCmdArg.h:26
static const RooCmdArg & none()
Return reference to null argument.
Definition: RooCmdArg.cxx:51
The RooDataHist is a container class to hold N-dimensional binned data.
Definition: RooDataHist.h:45
Mother of all ROOT objects.
Definition: TObject.h:41