Logo ROOT  
Reference Guide
RooHistFunc.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofit:$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/**
18\file RooHistFunc.cxx
19\class RooHistFunc
20\ingroup Roofitcore
21
22RooHistFunc implements a real-valued function sampled from a
23multidimensional histogram. The histogram can have an arbitrary number of real or
24discrete dimensions and may have negative values.
25**/
26
27#include "RooFit.h"
28#include "Riostream.h"
29#include "TBuffer.h"
30
31#include "RooHistFunc.h"
32#include "RooDataHist.h"
33#include "RooMsgService.h"
34#include "RooRealVar.h"
35#include "RooCategory.h"
36#include "RooWorkspace.h"
37
38#include "TError.h"
39
40using namespace std;
41
43;
44
45
46
47////////////////////////////////////////////////////////////////////////////////
48/// Default constructor
49
51 _dataHist(0),
52 _intOrder(0),
53 _cdfBoundaries(kFALSE),
54 _totVolume(0),
55 _unitNorm(kFALSE)
56{
58}
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Constructor from a RooDataHist. The variable listed in 'vars' control the dimensionality of the
63/// function. Any additional dimensions present in 'dhist' will be projected out. RooDataHist dimensions
64/// can be either real or discrete. See RooDataHist::RooDataHist for details on the binning.
65/// RooHistFunc neither owns or clone 'dhist' and the user must ensure the input histogram exists
66/// for the entire life span of this function.
67
68RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgSet& vars,
69 const RooDataHist& dhist, Int_t intOrder) :
70 RooAbsReal(name,title),
71 _depList("depList","List of dependents",this),
72 _dataHist((RooDataHist*)&dhist),
73 _codeReg(10),
74 _intOrder(intOrder),
75 _cdfBoundaries(kFALSE),
76 _totVolume(0),
77 _unitNorm(kFALSE)
78{
80 _depList.add(vars) ;
81
82 // Verify that vars and dhist.get() have identical contents
83 const RooArgSet* dvars = dhist.get() ;
84 if (vars.getSize()!=dvars->getSize()) {
85 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
86 << ") ERROR variable list and RooDataHist must contain the same variables." << endl ;
87 assert(0) ;
88 }
89
90 for (const auto arg : vars) {
91 if (!dvars->find(arg->GetName())) {
92 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
93 << ") ERROR variable list and RooDataHist must contain the same variables." << endl ;
94 assert(0) ;
95 }
96 }
97
99}
100
101
102
103////////////////////////////////////////////////////////////////////////////////
104/// Constructor from a RooDataHist. The variable listed in 'vars' control the dimensionality of the
105/// function. Any additional dimensions present in 'dhist' will be projected out. RooDataHist dimensions
106/// can be either real or discrete. See RooDataHist::RooDataHist for details on the binning.
107/// RooHistFunc neither owns or clone 'dhist' and the user must ensure the input histogram exists
108/// for the entire life span of this function.
109
110RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgList& funcObs, const RooArgList& histObs,
111 const RooDataHist& dhist, Int_t intOrder) :
112 RooAbsReal(name,title),
113 _depList("depList","List of dependents",this),
114 _dataHist((RooDataHist*)&dhist),
115 _codeReg(10),
116 _intOrder(intOrder),
117 _cdfBoundaries(kFALSE),
118 _totVolume(0),
119 _unitNorm(kFALSE)
120{
121 _histObsList.addClone(histObs) ;
122 _depList.add(funcObs) ;
123
124 // Verify that vars and dhist.get() have identical contents
125 const RooArgSet* dvars = dhist.get() ;
126 if (histObs.getSize()!=dvars->getSize()) {
127 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
128 << ") ERROR variable list and RooDataHist must contain the same variables." << endl ;
129 assert(0) ;
130 }
131
132 for (const auto arg : histObs) {
133 if (!dvars->find(arg->GetName())) {
134 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
135 << ") ERROR variable list and RooDataHist must contain the same variables." << endl ;
136 assert(0) ;
137 }
138 }
139
141}
142
143
144
145////////////////////////////////////////////////////////////////////////////////
146/// Copy constructor
147
148RooHistFunc::RooHistFunc(const RooHistFunc& other, const char* name) :
149 RooAbsReal(other,name),
150 _depList("depList",this,other._depList),
151 _dataHist(other._dataHist),
152 _codeReg(other._codeReg),
153 _intOrder(other._intOrder),
154 _cdfBoundaries(other._cdfBoundaries),
155 _totVolume(other._totVolume),
156 _unitNorm(other._unitNorm)
157{
159
161}
162
163
164
165////////////////////////////////////////////////////////////////////////////////
166
168{
170}
171
172
173
174
175////////////////////////////////////////////////////////////////////////////////
176/// Return the current value: The value of the bin enclosing the current coordinates
177/// of the dependents, normalized by the histograms contents. Interpolation
178/// is applied if the RooHistFunc is configured to do that
179
181{
182 // Transfer values from
183 if (_depList.getSize()>0) {
184 for (auto i = 0u; i < _histObsList.size(); ++i) {
185 const auto harg = _histObsList[i];
186 const auto parg = _depList[i];
187
188 if (harg != parg) {
189 parg->syncCache() ;
190 harg->copyCache(parg,kTRUE) ;
191 if (!harg->inRange(0)) {
192 return 0 ;
193 }
194 }
195 }
196 }
197
199 return ret ;
200}
201
202////////////////////////////////////////////////////////////////////////////////
203/// Only handle case of maximum in all variables
204
206{
207 RooAbsCollection* common = _depList.selectCommon(vars) ;
208 if (common->getSize()==_depList.getSize()) {
209 delete common ;
210 return 1;
211 }
212 delete common ;
213 return 0 ;
214}
215
216////////////////////////////////////////////////////////////////////////////////
217
219{
220 R__ASSERT(code==1) ;
221
222 Double_t max(-1) ;
223 for (Int_t i=0 ; i<_dataHist->numEntries() ; i++) {
224 _dataHist->get(i) ;
225 Double_t wgt = _dataHist->weight() ;
226 if (wgt>max) max=wgt ;
227 }
228
229 return max*1.05 ;
230}
231
232////////////////////////////////////////////////////////////////////////////////
233/// Return the total volume spanned by the observables of the RooDataHist
234
236{
237 // Return previously calculated value, if any
238 if (_totVolume>0) {
239 return _totVolume ;
240 }
241 _totVolume = 1. ;
242 for (const auto arg : _depList) {
243 RooRealVar* real = dynamic_cast<RooRealVar*>(arg) ;
244 if (real) {
245 _totVolume *= (real->getMax()-real->getMin()) ;
246 } else {
247 RooCategory* cat = dynamic_cast<RooCategory*>(arg) ;
248 if (cat) {
249 _totVolume *= cat->numTypes() ;
250 }
251 }
252 }
253
254 return _totVolume ;
255}
256
257
258
259////////////////////////////////////////////////////////////////////////////////
260/// Determine integration scenario. If no interpolation is used,
261/// RooHistFunc can perform all integrals over its dependents
262/// analytically via partial or complete summation of the input
263/// histogram. If interpolation is used, only the integral
264/// over all RooHistPdf observables is implemented.
265
266Int_t RooHistFunc::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName) const
267{
268
269 // Only analytical integrals over the full range are defined
270 if (rangeName!=0) {
271 return 0 ;
272 }
273
274 // Simplest scenario, integrate over all dependents
275 RooAbsCollection *allVarsCommon = allVars.selectCommon(_depList) ;
276 Bool_t intAllObs = (allVarsCommon->getSize()==_depList.getSize()) ;
277 delete allVarsCommon ;
278 if (intAllObs && matchArgs(allVars,analVars,_depList)) {
279 return 1000 ;
280 }
281
282 // Disable partial analytical integrals if interpolation is used
283 if (_intOrder>0) {
284 return 0 ;
285 }
286
287 // Find subset of _depList that integration is requested over
288 RooArgSet* allVarsSel = (RooArgSet*) allVars.selectCommon(_depList) ;
289 if (allVarsSel->getSize()==0) {
290 delete allVarsSel ;
291 return 0 ;
292 }
293
294 // Partial integration scenarios.
295 // Build unique code from bit mask of integrated variables in depList
296 Int_t code(0),n(0) ;
297 for (const auto arg : _depList) {
298 if (allVars.find(arg->GetName())) code |= (1<<n) ;
299 n++ ;
300 }
301
302 analVars.add(*allVarsSel) ;
303
304 return code ;
305
306}
307
308
309
310////////////////////////////////////////////////////////////////////////////////
311/// Return integral identified by 'code'. The actual integration
312/// is deferred to RooDataHist::sum() which implements partial
313/// or complete summation over the histograms contents
314
315Double_t RooHistFunc::analyticalIntegral(Int_t code, const char* /*rangeName*/) const
316{
317 // WVE needs adaptation for rangeName feature
318
319 // Simplest scenario, integration over all dependents
320 if (code==1000) {
321 return _dataHist->sum(kTRUE) ;
322 }
323
324 // Partial integration scenario, retrieve set of variables, calculate partial sum
325 RooArgSet intSet ;
326 Int_t n(0) ;
327 for (const auto arg : _depList) {
328 if (code & (1<<n)) {
329 intSet.add(*arg) ;
330 }
331 n++ ;
332 }
333
334 if (_depList.getSize()>0) {
335 for (auto i = 0u; i < _histObsList.size(); ++i) {
336 const auto harg = _histObsList[i];
337 const auto parg = _depList[i];
338
339 if (harg != parg) {
340 parg->syncCache() ;
341 harg->copyCache(parg,kTRUE) ;
342 if (!harg->inRange(0)) {
343 return 0 ;
344 }
345 }
346 }
347 }
348
349 Double_t ret = _dataHist->sum(intSet,_histObsList,kTRUE) ;
350 return ret ;
351}
352
353
354
355////////////////////////////////////////////////////////////////////////////////
356/// Return sampling hint for making curves of (projections) of this function
357/// as the recursive division strategy of RooCurve cannot deal efficiently
358/// with the vertical lines that occur in a non-interpolated histogram
359
361{
362 // No hints are required when interpolation is used
363 if (_intOrder>1) {
364 return 0 ;
365 }
366
367
368 // Find histogram observable corresponding to pdf observable
369 RooAbsArg* hobs(0) ;
370 for (auto i = 0u; i < _histObsList.size(); ++i) {
371 const auto harg = _histObsList[i];
372 const auto parg = _depList[i];
373 if (string(parg->GetName())==obs.GetName()) {
374 hobs=harg ;
375 }
376 }
377 if (!hobs) {
378 return 0 ;
379 }
380
381 // Check that observable is in dataset, if not no hint is generated
382 RooAbsLValue* lvarg = dynamic_cast<RooAbsLValue*>(_dataHist->get()->find(hobs->GetName())) ;
383 if (!lvarg) {
384 return 0 ;
385 }
386
387 // Retrieve position of all bin boundaries
388 const RooAbsBinning* binning = lvarg->getBinningPtr(0) ;
389 Double_t* boundaries = binning->array() ;
390
391 list<Double_t>* hint = new list<Double_t> ;
392
393 // Widen range slighty
394 xlo = xlo - 0.01*(xhi-xlo) ;
395 xhi = xhi + 0.01*(xhi-xlo) ;
396
397 Double_t delta = (xhi-xlo)*1e-8 ;
398
399 // Construct array with pairs of points positioned epsilon to the left and
400 // right of the bin boundaries
401 for (Int_t i=0 ; i<binning->numBoundaries() ; i++) {
402 if (boundaries[i]>=xlo && boundaries[i]<=xhi) {
403 hint->push_back(boundaries[i]-delta) ;
404 hint->push_back(boundaries[i]+delta) ;
405 }
406 }
407
408 return hint ;
409}
410
411
412////////////////////////////////////////////////////////////////////////////////
413/// Return sampling hint for making curves of (projections) of this function
414/// as the recursive division strategy of RooCurve cannot deal efficiently
415/// with the vertical lines that occur in a non-interpolated histogram
416
417std::list<Double_t>* RooHistFunc::binBoundaries(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const
418{
419 // No hints are required when interpolation is used
420 if (_intOrder>1) {
421 return 0 ;
422 }
423
424 // Find histogram observable corresponding to pdf observable
425 RooAbsArg* hobs(0) ;
426 for (auto i = 0u; i < _histObsList.size(); ++i) {
427 const auto harg = _histObsList[i];
428 const auto parg = _depList[i];
429 if (string(parg->GetName())==obs.GetName()) {
430 hobs=harg ;
431 }
432 }
433
434 // cout << "RooHistFunc::bb(" << GetName() << ") histObs = " << _histObsList << endl ;
435 // cout << "RooHistFunc::bb(" << GetName() << ") pdfObs = " << _depList << endl ;
436
437 RooAbsRealLValue* transform(0) ;
438 if (!hobs) {
439
440 // Considering alternate: input observable is histogram observable and pdf observable is transformation in terms of it
441 RooAbsArg* pobs(0) ;
442 for (auto i = 0u; i < _histObsList.size(); ++i) {
443 const auto harg = _histObsList[i];
444 const auto parg = _depList[i];
445 if (string(harg->GetName())==obs.GetName()) {
446 pobs=parg ;
447 hobs=harg ;
448 }
449 }
450
451 // Not found, or check that matching pdf observable is an l-value dependent on histogram observable fails
452 if (!hobs || !(pobs->dependsOn(obs) && dynamic_cast<RooAbsRealLValue*>(pobs))) {
453 cout << "RooHistFunc::binBoundaries(" << GetName() << ") obs = " << obs.GetName() << " hobs is not found, returning null" << endl ;
454 return 0 ;
455 }
456
457 // Now we are in business - we are in a situation where the pdf observable LV(x), mapping to a histogram observable x
458 // We can return bin boundaries by mapping the histogram boundaties through the inverse of the LV(x) transformation
459 transform = dynamic_cast<RooAbsRealLValue*>(pobs) ;
460 }
461
462
463 // cout << "hobs = " << hobs->GetName() << endl ;
464 // cout << "transform = " << (transform?transform->GetName():"<none>") << endl ;
465
466 // Check that observable is in dataset, if not no hint is generated
467 RooAbsArg* xtmp = _dataHist->get()->find(hobs->GetName()) ;
468 if (!xtmp) {
469 cout << "RooHistFunc::binBoundaries(" << GetName() << ") hobs = " << hobs->GetName() << " is not found in dataset?" << endl ;
470 _dataHist->get()->Print("v") ;
471 return 0 ;
472 }
473 RooAbsLValue* lvarg = dynamic_cast<RooAbsLValue*>(_dataHist->get()->find(hobs->GetName())) ;
474 if (!lvarg) {
475 cout << "RooHistFunc::binBoundaries(" << GetName() << ") hobs = " << hobs->GetName() << " but is not an LV, returning null" << endl ;
476 return 0 ;
477 }
478
479 // Retrieve position of all bin boundaries
480 const RooAbsBinning* binning = lvarg->getBinningPtr(0) ;
481 Double_t* boundaries = binning->array() ;
482
483 list<Double_t>* hint = new list<Double_t> ;
484
485 Double_t delta = (xhi-xlo)*1e-8 ;
486
487 // Construct array with pairs of points positioned epsilon to the left and
488 // right of the bin boundaries
489 for (Int_t i=0 ; i<binning->numBoundaries() ; i++) {
490 if (boundaries[i]>xlo-delta && boundaries[i]<xhi+delta) {
491
492 Double_t boundary = boundaries[i] ;
493 if (transform) {
494 transform->setVal(boundary) ;
495 //cout << "transform bound " << boundary << " using " << transform->GetName() << " result " << obs.getVal() << endl ;
496 hint->push_back(obs.getVal()) ;
497 } else {
498 hint->push_back(boundary) ;
499 }
500 }
501 }
502
503 return hint ;
504}
505
506
507
508////////////////////////////////////////////////////////////////////////////////
509/// Check if our datahist is already in the workspace.
510/// In case of error, return true.
512{
513 // Check if dataset with given name already exists
514 RooAbsData* wsdata = ws.embeddedData(_dataHist->GetName()) ;
515
516 if (wsdata) {
517 // If our data is exactly the same, we are done:
518 if (static_cast<RooDataHist*>(wsdata) == _dataHist)
519 return false;
520
521 // Yes it exists - now check if it is identical to our internal histogram
522 if (wsdata->InheritsFrom(RooDataHist::Class())) {
523
524 // Check if histograms are identical
525 if (areIdentical((RooDataHist&)*wsdata,*_dataHist)) {
526
527 // Exists and is of correct type, and identical -- adjust internal pointer to WS copy
528 _dataHist = (RooDataHist*) wsdata ;
529 } else {
530
531 // not identical, clone rename and import
532 TString uniqueName = Form("%s_%s",_dataHist->GetName(),GetName()) ;
533 Bool_t flag = ws.import(*_dataHist,RooFit::Rename(uniqueName.Data()),RooFit::Embedded()) ;
534 if (flag) {
535 coutE(ObjectHandling) << " RooHistPdf::importWorkspaceHook(" << GetName() << ") unable to import clone of underlying RooDataHist with unique name " << uniqueName << ", abort" << endl ;
536 return kTRUE ;
537 }
538 _dataHist = (RooDataHist*) ws.embeddedData(uniqueName.Data()) ;
539 }
540
541 } else {
542
543 // Exists and is NOT of correct type: clone rename and import
544 TString uniqueName = Form("%s_%s",_dataHist->GetName(),GetName()) ;
545 Bool_t flag = ws.import(*_dataHist,RooFit::Rename(uniqueName.Data()),RooFit::Embedded()) ;
546 if (flag) {
547 coutE(ObjectHandling) << " RooHistPdf::importWorkspaceHook(" << GetName() << ") unable to import clone of underlying RooDataHist with unique name " << uniqueName << ", abort" << endl ;
548 return kTRUE ;
549 }
550 _dataHist = (RooDataHist*) ws.embeddedData(uniqueName.Data()) ;
551
552 }
553 return kFALSE ;
554 }
555
556 // We need to import our datahist into the workspace
557 ws.import(*_dataHist,RooFit::Embedded()) ;
558
559 // Redirect our internal pointer to the copy in the workspace
560 _dataHist = (RooDataHist*) ws.embeddedData(_dataHist->GetName()) ;
561 return kFALSE ;
562}
563
564
565////////////////////////////////////////////////////////////////////////////////
566
568{
569 if (fabs(dh1.sumEntries()-dh2.sumEntries())>1e-8) return kFALSE ;
570 if (dh1.numEntries() != dh2.numEntries()) return kFALSE ;
571 for (int i=0 ; i < dh1.numEntries() ; i++) {
572 dh1.get(i) ;
573 dh2.get(i) ;
574 if (fabs(dh1.weight()-dh2.weight())>1e-8) return kFALSE ;
575 }
576 if (!(RooNameSet(*dh1.get())==RooNameSet(*dh2.get()))) return kFALSE ;
577 return kTRUE ;
578}
579
580
581
582////////////////////////////////////////////////////////////////////////////////
583/// Stream an object of class RooHistFunc.
584
585void RooHistFunc::Streamer(TBuffer &R__b)
586{
587 if (R__b.IsReading()) {
589 // WVE - interim solution - fix proxies here
590 _proxyList.Clear() ;
592 } else {
594 }
595}
596
597
598////////////////////////////////////////////////////////////////////////////////
599/// Schema evolution: if histObsList wasn't filled from persistence (v1)
600/// then fill it here. Can't be done in regular schema evolution in LinkDef
601/// as _depList content is not guaranteed to be initialized there
602
604{
605 if (_histObsList.getSize()==0) {
607 }
608}
609
void Class()
Definition: Class.C:29
#define e(i)
Definition: RSha256.hxx:103
#define coutE(a)
Definition: RooMsgService.h:33
#define TRACE_DESTROY
Definition: RooTrace.h:23
#define TRACE_CREATE
Definition: RooTrace.h:22
const Bool_t kFALSE
Definition: RtypesCore.h:90
const Bool_t kTRUE
Definition: RtypesCore.h:89
#define ClassImp(name)
Definition: Rtypes.h:361
#define R__ASSERT(e)
Definition: TError.h:96
char name[80]
Definition: TGX11.cxx:109
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:73
RooRefArray _proxyList
Definition: RooAbsArg.h:585
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
Definition: RooAbsArg.cxx:730
void registerProxy(RooArgProxy &proxy)
Register an RooArgProxy in the proxy list.
Definition: RooAbsArg.cxx:1119
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
Definition: RooAbsBinning.h:26
virtual Double_t * array() const =0
virtual Int_t numBoundaries() const =0
Int_t numTypes(const char *=0) const
Return number of types defined (in range named rangeName if rangeName!=0)
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
Int_t getSize() const
Storage_t::size_type size() const
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:44
Abstract base class for objects that are lvalues, i.e.
Definition: RooAbsLValue.h:26
virtual const RooAbsBinning * getBinningPtr(const char *rangeName) const =0
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual void setVal(Double_t value)=0
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:60
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition: RooAbsReal.h:90
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
Definition: RooArgSet.h:88
virtual void addClone(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
Definition: RooArgSet.h:96
RooCategory is an object to represent discrete states.
Definition: RooCategory.h:23
The RooDataHist is a container class to hold N-dimensional binned data.
Definition: RooDataHist.h:40
Double_t sum(Bool_t correctForBinSize, Bool_t inverseCorr=kFALSE) const
Return the sum of the weights of all hist bins.
virtual Double_t weight() const
Definition: RooDataHist.h:106
virtual Double_t sumEntries() const
virtual Int_t numEntries() const
Return the number of bins.
virtual const RooArgSet * get() const
Definition: RooDataHist.h:79
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
Definition: RooHistFunc.h:29
virtual Int_t getMaxVal(const RooArgSet &vars) const
Only handle case of maximum in all variables.
Bool_t _cdfBoundaries
Definition: RooHistFunc.h:94
RooDataHist * _dataHist
Definition: RooHistFunc.h:91
Double_t evaluate() const
Return the current value: The value of the bin enclosing the current coordinates of the dependents,...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Determine integration scenario.
Bool_t importWorkspaceHook(RooWorkspace &ws)
Check if our datahist is already in the workspace.
virtual std::list< Double_t > * binBoundaries(RooAbsRealLValue &, Double_t, Double_t) const
Return sampling hint for making curves of (projections) of this function as the recursive division st...
RooHistFunc()
Default constructor.
Definition: RooHistFunc.cxx:50
Double_t totVolume() const
Return the total volume spanned by the observables of the RooDataHist.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return integral identified by 'code'.
virtual void ioStreamerPass2()
Schema evolution: if histObsList wasn't filled from persistence (v1) then fill it here.
Bool_t areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
virtual ~RooHistFunc()
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
Int_t _intOrder
Auxiliary class keeping tracking of analytical integration code.
Definition: RooHistFunc.h:93
Double_t _totVolume
Definition: RooHistFunc.h:95
RooSetProxy _depList
Definition: RooHistFunc.h:90
RooArgSet _histObsList
Definition: RooHistFunc.h:89
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Return sampling hint for making curves of (projections) of this function as the recursive division st...
RooNameSet is a utility class that stores the names the objects in a RooArget.
Definition: RooNameSet.h:24
RooRealVar represents a variable that can be changed from the outside.
Definition: RooRealVar.h:35
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
The RooWorkspace is a persistable container for RooFit projects.
Definition: RooWorkspace.h:43
Buffer base class used for serializing objects.
Definition: TBuffer.h:42
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
Bool_t IsReading() const
Definition: TBuffer.h:85
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:47
virtual void Clear(Option_t *option="")
Remove all objects from the array.
Definition: TObjArray.cxx:321
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition: TObject.cxx:443
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
RooCmdArg Embedded(Bool_t flag=kTRUE)
RooCmdArg Rename(const char *suffix)
const Int_t n
Definition: legend1.C:16
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
@ InputArguments
Definition: RooGlobalFunc.h:68
@ ObjectHandling
Definition: RooGlobalFunc.h:68
void ws()
Definition: ws.C:66