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