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