Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22A 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 "RooHistFunc.h"
28#include "RooDataHist.h"
29#include "RooMsgService.h"
30#include "RooRealVar.h"
31#include "RooCategory.h"
32#include "RooWorkspace.h"
33#include "RooHistPdf.h"
34#include "RooFitImplHelpers.h"
35
36#include "TError.h"
37#include "TBuffer.h"
38
39#include <stdexcept>
40
41
42
43
44////////////////////////////////////////////////////////////////////////////////
45/// Constructor from a RooDataHist. The variable listed in 'vars' control the dimensionality of the
46/// function. Any additional dimensions present in 'dhist' will be projected out. RooDataHist dimensions
47/// can be either real or discrete. See RooDataHist::RooDataHist for details on the binning.
48/// RooHistFunc neither owns or clone 'dhist' and the user must ensure the input histogram exists
49/// for the entire life span of this function.
50
51RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgSet& vars,
53 RooAbsReal(name,title),
54 _depList("depList","List of dependents",this),
55 _dataHist(const_cast<RooDataHist*>(&dhist)),
56 _codeReg(10),
57 _intOrder(intOrder)
58{
60 _depList.add(vars) ;
61
62 // Verify that vars and dhist.get() have identical contents
63 const RooArgSet* dvars = dhist.get() ;
64 if (vars.size()!=dvars->size()) {
65 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
66 << ") ERROR variable list and RooDataHist must contain the same variables." << std::endl ;
67 throw std::invalid_argument("RooHistFunc: ERROR variable list and RooDataHist must contain the same variables.");
68 }
69
70 for (const auto arg : vars) {
71 if (!dvars->find(arg->GetName())) {
72 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
73 << ") ERROR variable list and RooDataHist must contain the same variables." << std::endl ;
74 throw std::invalid_argument("RooHistFunc: ERROR variable list and RooDataHist must contain the same variables.");
75 }
76 }
77
78}
79
80
81
82////////////////////////////////////////////////////////////////////////////////
83/// Constructor from a RooDataHist. The variable listed in 'vars' control the dimensionality of the
84/// function. Any additional dimensions present in 'dhist' will be projected out. RooDataHist dimensions
85/// can be either real or discrete. See RooDataHist::RooDataHist for details on the binning.
86/// RooHistFunc neither owns or clone 'dhist' and the user must ensure the input histogram exists
87/// for the entire life span of this function.
88
89RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgList& funcObs, const RooArgList& histObs,
91 RooAbsReal(name,title),
92 _depList("depList","List of dependents",this),
93 _dataHist(const_cast<RooDataHist*>(&dhist)),
94 _codeReg(10),
95 _intOrder(intOrder)
96{
99
100 // Verify that vars and dhist.get() have identical contents
101 const RooArgSet* dvars = dhist.get() ;
102 if (histObs.size()!=dvars->size()) {
103 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
104 << ") ERROR variable list and RooDataHist must contain the same variables." << std::endl ;
105 throw std::invalid_argument("RooHistFunc: ERROR variable list and RooDataHist must contain the same variables.");
106 }
107
108 for (const auto arg : histObs) {
109 if (!dvars->find(arg->GetName())) {
110 coutE(InputArguments) << "RooHistFunc::ctor(" << GetName()
111 << ") ERROR variable list and RooDataHist must contain the same variables." << std::endl ;
112 throw std::invalid_argument("RooHistFunc: ERROR variable list and RooDataHist must contain the same variables.");
113 }
114 }
115
116}
117
118RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgSet &vars, std::unique_ptr<RooDataHist> dhist,
119 int intOrder)
120 : RooHistFunc{name, title, vars, *dhist, intOrder}
121{
122 initializeOwnedDataHist(std::move(dhist));
123}
124
125RooHistFunc::RooHistFunc(const char *name, const char *title, const RooArgList &pdfObs, const RooArgList &histObs,
126 std::unique_ptr<RooDataHist> dhist, int intOrder)
128{
129 initializeOwnedDataHist(std::move(dhist));
130}
131
132
133////////////////////////////////////////////////////////////////////////////////
134/// Copy constructor
135
138 _depList("depList",this,other._depList),
139 _dataHist(other._dataHist),
140 _codeReg(other._codeReg),
141 _intOrder(other._intOrder),
142 _cdfBoundaries(other._cdfBoundaries),
143 _totVolume(other._totVolume),
144 _unitNorm(other._unitNorm)
145{
146
147 _histObsList.addClone(other._histObsList) ;
148}
149
150
151
152////////////////////////////////////////////////////////////////////////////////
153
157
158
159
160
161////////////////////////////////////////////////////////////////////////////////
162/// Return the current value: The value of the bin enclosing the current coordinates
163/// of the dependents, normalized by the histograms contents. Interpolation
164/// is applied if the RooHistFunc is configured to do that
165
167{
168 // Transfer values from
169 if (!_depList.empty()) {
170 for (auto i = 0u; i < _histObsList.size(); ++i) {
171 const auto harg = _histObsList[i];
172 const auto parg = _depList[i];
173
174 if (harg != parg) {
175 parg->syncCache() ;
176 harg->copyCache(parg,true) ;
177 if (!harg->inRange(nullptr)) {
178 return 0 ;
179 }
180 }
181 }
182 }
183
185 return ret ;
186}
187
189{
190 std::span<double> output = ctx.output();
191 std::size_t nEvents = output.size();
192
193 if (_depList.size() == 1) {
194 auto xVals = ctx.at(_depList[0]);
195 _dataHist->weights(output.data(), xVals, _intOrder, false, _cdfBoundaries);
196 return;
197 }
198
199 std::vector<std::span<const double>> inputValues;
200 for (const auto& obs : _depList) {
201 auto realObs = dynamic_cast<const RooAbsReal*>(obs);
202 if (realObs) {
203 inputValues.push_back(ctx.at(realObs));
204 } else {
205 inputValues.emplace_back();
206 }
207 }
208
209 for (std::size_t i = 0; i < nEvents; ++i) {
210 bool skip = false;
211
212 for (auto j = 0u; j < _histObsList.size(); ++j) {
213 const auto histObs = _histObsList[j];
214
215 if (i < inputValues[j].size()) {
216 histObs->setCachedValue(inputValues[j][i], false);
217 if (!histObs->inRange(nullptr)) {
218 skip = true;
219 break;
220 }
221 }
222 }
223
224 output[i] = skip ? 0. : _dataHist->weightFast(_histObsList, _intOrder, false, _cdfBoundaries);
225 }
226}
227
228
229////////////////////////////////////////////////////////////////////////////////
230/// Only handle case of maximum in all variables
231
233{
234 std::unique_ptr<RooAbsCollection> common{_depList.selectCommon(vars)};
235 return common->size() == _depList.size() ? 1 : 0;
236}
237
238////////////////////////////////////////////////////////////////////////////////
239
240double RooHistFunc::maxVal(Int_t code) const
241{
242 R__ASSERT(code==1) ;
243
244 double max(-1) ;
245 for (Int_t i=0 ; i<_dataHist->numEntries() ; i++) {
246 double wgt = _dataHist->weight(i) ;
247 if (wgt>max) max=wgt ;
248 }
249
250 return max*1.05 ;
251}
252
254 if (_ownedDataHist) return _ownedDataHist.get();
255 _ownedDataHist.reset(static_cast<RooDataHist*>(_dataHist->Clone(newname)));
257 return _dataHist;
258}
259
260////////////////////////////////////////////////////////////////////////////////
261/// Return the total volume spanned by the observables of the RooDataHist
262
264{
265 // Return previously calculated value, if any
266 if (_totVolume>0) {
267 return _totVolume ;
268 }
269 _totVolume = 1. ;
270 for (const auto arg : _depList) {
271 RooRealVar* real = dynamic_cast<RooRealVar*>(arg) ;
272 if (real) {
273 _totVolume *= (real->getMax()-real->getMin()) ;
274 } else {
275 RooCategory* cat = dynamic_cast<RooCategory*>(arg) ;
276 if (cat) {
277 _totVolume *= cat->numTypes() ;
278 }
279 }
280 }
281
282 return _totVolume ;
283}
284
285
286////////////////////////////////////////////////////////////////////////////////
287/// Determine integration scenario. If no interpolation is used,
288/// RooHistFunc can perform all integrals over its dependents
289/// analytically via partial or complete summation of the input
290/// histogram. If interpolation is used, only the integral
291/// over all RooHistPdf observables is implemented.
292
297
298
299////////////////////////////////////////////////////////////////////////////////
300/// Return integral identified by 'code'. The actual integration
301/// is deferred to RooDataHist::sum() which implements partial
302/// or complete summation over the histograms contents
303
304double RooHistFunc::analyticalIntegral(Int_t code, const char* rangeName) const
305{
307}
308
313
314////////////////////////////////////////////////////////////////////////////////
315/// Return sampling hint for making curves of (projections) of this function
316/// as the recursive division strategy of RooCurve cannot deal efficiently
317/// with the vertical lines that occur in a non-interpolated histogram
318
319std::list<double>* RooHistFunc::plotSamplingHint(RooAbsRealLValue& obs, double xlo, double xhi) const
320{
322}
323
324
325////////////////////////////////////////////////////////////////////////////////
326/// Return sampling hint for making curves of (projections) of this function
327/// as the recursive division strategy of RooCurve cannot deal efficiently
328/// with the vertical lines that occur in a non-interpolated histogram
329
330std::list<double>* RooHistFunc::binBoundaries(RooAbsRealLValue& obs, double xlo, double xhi) const
331{
332 // No hints are required when interpolation is used
333 if (_intOrder>1) {
334 return nullptr ;
335 }
336
337 // Find histogram observable corresponding to pdf observable
338 RooAbsArg* hobs(nullptr) ;
339 for (auto i = 0u; i < _histObsList.size(); ++i) {
340 const auto harg = _histObsList[i];
341 const auto parg = _depList[i];
342 if (std::string(parg->GetName())==obs.GetName()) {
343 hobs=harg ;
344 }
345 }
346
347 RooAbsRealLValue* transform = nullptr;
348 if (!hobs) {
349
350 // Considering alternate: input observable is histogram observable and pdf observable is transformation in terms of it
351 RooAbsArg* pobs = nullptr;
352 for (auto i = 0u; i < _histObsList.size(); ++i) {
353 const auto harg = _histObsList[i];
354 const auto parg = _depList[i];
355 if (std::string(harg->GetName())==obs.GetName()) {
356 pobs=parg ;
357 hobs=harg ;
358 }
359 }
360
361 // Not found, or check that matching pdf observable is an l-value dependent on histogram observable fails
362 if (!hobs || !(pobs->dependsOn(obs) && dynamic_cast<RooAbsRealLValue*>(pobs))) {
363 std::cout << "RooHistFunc::binBoundaries(" << GetName() << ") obs = " << obs.GetName() << " hobs is not found, returning null" << std::endl ;
364 return nullptr ;
365 }
366
367 // Now we are in business - we are in a situation where the pdf observable LV(x), mapping to a histogram observable x
368 // We can return bin boundaries by mapping the histogram boundaties through the inverse of the LV(x) transformation
369 transform = dynamic_cast<RooAbsRealLValue*>(pobs) ;
370 }
371
372
373 // Check that observable is in dataset, if not no hint is generated
374 RooAbsArg* xtmp = _dataHist->get()->find(hobs->GetName()) ;
375 if (!xtmp) {
376 std::cout << "RooHistFunc::binBoundaries(" << GetName() << ") hobs = " << hobs->GetName() << " is not found in dataset?" << std::endl ;
377 _dataHist->get()->Print("v") ;
378 return nullptr ;
379 }
380 RooAbsLValue* lvarg = dynamic_cast<RooAbsLValue*>(_dataHist->get()->find(hobs->GetName())) ;
381 if (!lvarg) {
382 std::cout << "RooHistFunc::binBoundaries(" << GetName() << ") hobs = " << hobs->GetName() << " but is not an LV, returning null" << std::endl ;
383 return nullptr ;
384 }
385
386 // Retrieve position of all bin boundaries
387 const RooAbsBinning* binning = lvarg->getBinningPtr(nullptr);
388 double* boundaries = binning->array() ;
389
390 auto hint = new std::list<double> ;
391
392 double delta = (xhi-xlo)*1e-8 ;
393
394 // Construct array with pairs of points positioned epsilon to the left and
395 // right of the bin boundaries
396 for (Int_t i=0 ; i<binning->numBoundaries() ; i++) {
397 if (boundaries[i]>xlo-delta && boundaries[i]<xhi+delta) {
398
399 double boundary = boundaries[i] ;
400 if (transform) {
401 transform->setVal(boundary) ;
402 hint->push_back(obs.getVal()) ;
403 } else {
404 hint->push_back(boundary) ;
405 }
406 }
407 }
408
409 return hint ;
410}
411
412
413
414////////////////////////////////////////////////////////////////////////////////
415/// Check if our datahist is already in the workspace.
416/// In case of error, return true.
418{
419 // Check if dataset with given name already exists
421
422 if (wsdata) {
423 // If our data is exactly the same, we are done:
424 if (static_cast<RooDataHist*>(wsdata) == _dataHist)
425 return false;
426
427 // Yes it exists - now check if it is identical to our internal histogram
428 if (wsdata->InheritsFrom(RooDataHist::Class())) {
429
430 // Check if histograms are identical
431 if (areIdentical(static_cast<RooDataHist&>(*wsdata),*_dataHist)) {
432
433 // Exists and is of correct type, and identical -- adjust internal pointer to WS copy
434 _dataHist = static_cast<RooDataHist*>(wsdata) ;
435 } else {
436
437 // not identical, clone rename and import
438 auto uniqueName = std::string(_dataHist->GetName()) + "_" + GetName();
440 if (flag) {
441 coutE(ObjectHandling) << " RooHistPdf::importWorkspaceHook(" << GetName() << ") unable to import clone of underlying RooDataHist with unique name " << uniqueName << ", abort" << std::endl ;
442 return true ;
443 }
444 _dataHist = static_cast<RooDataHist*>(ws.embeddedData(uniqueName)) ;
445 }
446
447 } else {
448
449 // Exists and is NOT of correct type: clone rename and import
450 auto uniqueName = std::string(_dataHist->GetName()) + "_" + GetName();
452 if (flag) {
453 coutE(ObjectHandling) << " RooHistPdf::importWorkspaceHook(" << GetName() << ") unable to import clone of underlying RooDataHist with unique name " << uniqueName << ", abort" << std::endl ;
454 return true ;
455 }
456 _dataHist = static_cast<RooDataHist*>(ws.embeddedData(uniqueName));
457
458 }
459 return false ;
460 }
461
462 // We need to import our datahist into the workspace
464
465 // Redirect our internal pointer to the copy in the workspace
466 _dataHist = static_cast<RooDataHist*>(ws.embeddedData(_dataHist->GetName())) ;
467 return false ;
468}
469
470
471////////////////////////////////////////////////////////////////////////////////
472
474{
475 if (std::abs(dh1.sumEntries()-dh2.sumEntries())>1e-8) return false ;
476 if (dh1.numEntries() != dh2.numEntries()) return false ;
477 for (int i=0 ; i < dh1.numEntries() ; i++) {
478 if (std::abs(dh1.weight(i)-dh2.weight(i))>1e-8) return false ;
479 }
481 if (getColonSeparatedNameString(*dh1.get()) != getColonSeparatedNameString(*dh2.get())) return false ;
482 return true ;
483}
484
485
486
487////////////////////////////////////////////////////////////////////////////////
488/// Stream an object of class RooHistFunc.
489
491{
492 if (R__b.IsReading()) {
493 R__b.ReadClassBuffer(RooHistFunc::Class(),this);
494 // WVE - interim solution - fix proxies here
495 _proxyList.Clear() ;
497 } else {
498 R__b.WriteClassBuffer(RooHistFunc::Class(),this);
499 }
500}
501
502
503////////////////////////////////////////////////////////////////////////////////
504/// Schema evolution: if histObsList wasn't filled from persistence (v1)
505/// then fill it here. Can't be done in regular schema evolution in LinkDef
506/// as _depList content is not guaranteed to be initialized there
507
509{
510 RooAbsReal::ioStreamerPass2(); // call the baseclass method
511
512 if (_histObsList.empty()) {
514 }
515}
516
517
518////////////////////////////////////////////////////////////////////////////////
519/// Compute bin number corresponding to current coordinates.
520/// \return If a bin is not in the current range of the observables, return -1.
522 if (!_depList.empty()) {
523 for (auto i = 0u; i < _histObsList.size(); ++i) {
524 const auto harg = _histObsList[i];
525 const auto parg = _depList[i];
526
527 if (harg != parg) {
528 parg->syncCache() ;
529 harg->copyCache(parg,true) ;
530 if (!harg->inRange(nullptr)) {
531 return -1;
532 }
533 }
534 }
535 }
536
537 return _dataHist->getIndex(_histObsList, true);
538}
539
540
541////////////////////////////////////////////////////////////////////////////////
542/// Compute bin numbers corresponding to all coordinates in `evalData`.
543/// \return Vector of bin numbers. If a bin is not in the current range of the observables, return -1.
544std::vector<Int_t> RooHistFunc::getBins(RooFit::EvalContext & ctx) const {
545 std::vector<std::span<const double>> depData;
546 for (const auto dep : _depList) {
547 auto real = dynamic_cast<const RooAbsReal*>(dep);
548 if (real) {
549 depData.push_back(ctx.at(real));
550 } else {
551 depData.emplace_back();
552 }
553 }
554
555 const auto batchSize = std::max_element(depData.begin(), depData.end(),
556 [](const std::span<const double>& a, const std::span<const double>& b){ return a.size() < b.size(); })->size();
557 std::vector<Int_t> results;
558
559 for (std::size_t evt = 0; evt < batchSize; ++evt) {
560 if (!_depList.empty()) {
561 for (auto i = 0u; i < _histObsList.size(); ++i) {
562 const auto harg = _histObsList[i];
563
564 if (evt < depData[i].size())
565 harg->setCachedValue(depData[i][evt], false);
566
567 if (!harg->inRange(nullptr)) {
568 results.push_back(-1);
569 continue;
570 }
571 }
572 }
573
574 results.push_back(_dataHist->getIndex(_histObsList, true));
575 }
576
577 return results;
578}
#define b(i)
Definition RSha256.hxx:100
#define a(i)
Definition RSha256.hxx:99
#define e(i)
Definition RSha256.hxx:103
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
#define coutE(a)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
char name[80]
Definition TGX11.cxx:148
const_iterator begin() const
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:76
RooRefArray _proxyList
Definition RooAbsArg.h:570
void registerProxy(RooArgProxy &proxy)
Register an RooArgProxy in the proxy list.
friend void RooRefArray::Streamer(TBuffer &)
virtual void ioStreamerPass2()
Method called by workspace container to finalize schema evolution issues that cannot be handled in a ...
Abstract base class for RooRealVar binning definitions.
virtual Int_t numBoundaries() const =0
virtual double * array() const =0
Int_t numTypes(const char *=nullptr) const
Return number of types defined (in range named rangeName if rangeName!=nullptr)
Storage_t::size_type size() const
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:56
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract base class for objects that are lvalues, i.e.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:63
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Definition RooAbsReal.h:107
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Definition RooArgSet.h:154
Object to represent discrete states.
Definition RooCategory.h:28
bool add(const RooAbsArg &var, bool valueServer, bool shapeServer, bool silent)
Overloaded RooCollection_t::add() method insert object into set and registers object as server to own...
Container class to hold N-dimensional binned data.
Definition RooDataHist.h:40
void weights(double *output, std::span< double const > xVals, int intOrder, bool correctForBinSize, bool cdfBoundaries)
A vectorized version of RooDataHist::weight() for one dimensional histograms with up to one dimension...
static TClass * Class()
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
Definition RooDataHist.h:61
Int_t getIndex(const RooAbsCollection &coord, bool fast=false) const
Calculate bin number of the given coordinates.
double weight(std::size_t i) const
Return weight of i-th bin.
double weightFast(const RooArgSet &bin, int intOrder, bool correctForBinSize, bool cdfBoundaries)
A faster version of RooDataHist::weight that assumes the passed arguments are aligned with the histog...
const RooArgSet * get() const override
Get bin centre of current bin.
Definition RooDataHist.h:82
std::span< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
std::span< double > output()
A real-valued function sampled from a multidimensional histogram.
Definition RooHistFunc.h:30
bool _cdfBoundaries
Use boundary conditions for CDFs.
RooDataHist * _dataHist
Unowned pointer to underlying histogram.
double _totVolume
! Total volume of space (product of ranges of observables)
void doEval(RooFit::EvalContext &) const override
Base function for computing multiple values of a RooAbsReal.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Return integral identified by 'code'.
~RooHistFunc() override
std::list< double > * binBoundaries(RooAbsRealLValue &, double, double) const override
Return sampling hint for making curves of (projections) of this function as the recursive division st...
std::unique_ptr< RooDataHist > _ownedDataHist
! Owned pointer to underlying histogram
void ioStreamerPass2() override
Schema evolution: if histObsList wasn't filled from persistence (v1) then fill it here.
void initializeOwnedDataHist(std::unique_ptr< RooDataHist > &&dataHist)
double evaluate() const override
Return the current value: The value of the bin enclosing the current coordinates of the dependents,...
std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const override
Return sampling hint for making curves of (projections) of this function as the recursive division st...
Int_t getMaxVal(const RooArgSet &vars) const override
Only handle case of maximum in all variables.
double totVolume() const
Get total bin volume spanned by this hist function.
Int_t getBin() const
Compute bin number corresponding to current coordinates.
bool areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
double maxVal(Int_t code) const override
Return maximum value for set of observables identified by code assigned in getMaxVal.
std::vector< Int_t > getBins(RooFit::EvalContext &ctx) const
Compute bin numbers corresponding to all coordinates in evalData.
bool importWorkspaceHook(RooWorkspace &ws) override
Check if our datahist is already in the workspace.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Determine integration scenario.
RooDataHist * cloneAndOwnDataHist(const char *newname="")
Replaces underlying RooDataHist with a clone, which is now owned, and returns the clone.
Int_t _intOrder
Interpolation order.
static TClass * Class()
RooSetProxy _depList
List of observables mapped onto histogram observables.
RooArgSet _histObsList
List of observables defining dimensions of histogram.
bool forceAnalyticalInt(const RooAbsArg &dep) const override
double analyticalIntegral(Int_t code, const char *rangeName=nullptr) const override
Return integral identified by 'code'.
std::list< double > * plotSamplingHint(RooAbsRealLValue &obs, double xlo, double xhi) const override
Return sampling hint for making curves of (projections) of this function as the recursive division st...
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=nullptr) const override
Determine integration scenario.
Variable that can be changed from the outside.
Definition RooRealVar.h:37
Persistable container for RooFit projects.
RooAbsData * embeddedData(RooStringView name) const
Retrieve dataset (binned or unbinned) with given name. A null pointer is returned if not found.
bool import(const RooAbsArg &arg, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}, const RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
Buffer base class used for serializing objects.
Definition TBuffer.h:43
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
void Clear(Option_t *option="") override
Remove all objects from the array.
RooCmdArg Rename(const char *suffix)
RooCmdArg Embedded(bool flag=true)
std::string getColonSeparatedNameString(RooArgSet const &argSet, char delim=':')