|
ROOT
Reference Guide |
|
Go to the documentation of this file.
68 _pdfObsList(
"pdfObs",
"List of p.d.f. observables",this),
83 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
86 for (
const auto arg : vars) {
87 if (!dvars->
find(arg->GetName())) {
89 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
120 _pdfObsList(
"pdfObs",
"List of p.d.f. observables",this),
135 <<
") ERROR histogram variable list and RooDataHist must contain the same variables." << endl ;
136 throw(
string(
"RooHistPdf::ctor() ERROR: histogram variable list and RooDataHist must contain the same variables")) ;
139 for (
const auto arg : histObs) {
140 if (!dvars->
find(arg->GetName())) {
142 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
143 throw(
string(
"RooHistPdf::ctor() ERROR: histogram variable list and RooDataHist must contain the same variables")) ;
145 if (!arg->isFundamental()) {
147 <<
") ERROR all elements of histogram observables set must be of type RooRealVar or RooCategory." << endl ;
148 throw(
string(
"RooHistPdf::ctor() ERROR all elements of histogram observables set must be of type RooRealVar or RooCategory.")) ;
171 _pdfObsList(
"pdfObs",this,other._pdfObsList),
172 _dataHist(other._dataHist),
173 _codeReg(other._codeReg),
174 _intOrder(other._intOrder),
175 _cdfBoundaries(other._cdfBoundaries),
176 _totVolume(other._totVolume),
177 _unitNorm(other._unitNorm)
264 if (!_x || !_y)
return false;
265 if (!range || !strlen(range) || !_x->
hasRange(range) ||
290 Int_t code = 0, frcode = 0;
295 if (allVars.
find(*pa)) {
298 if (fullRange(*pa, *ha, rangeName)) {
304 if (code == frcode) {
316 return (code >= 2) ? code : 0;
336 std::map<const RooAbsArg*, std::pair<Double_t, Double_t> > ranges;
341 if (code & (2 <<
n)) {
348 if (rangeName && rlv->
hasRange(rangeName)) {
349 ranges[ha] = std::make_pair(
351 }
else if (binning) {
353 ranges[ha] = std::make_pair(
356 ranges[ha] = std::make_pair(
366 ha->copyCache(pa,
kTRUE);
420 list<Double_t>* hint =
new list<Double_t> ;
423 xlo = xlo - 0.01*(xhi-xlo) ;
424 xhi = xhi + 0.01*(xhi-xlo) ;
431 if (boundaries[i]>=xlo && boundaries[i]<=xhi) {
432 hint->push_back(boundaries[i]-delta) ;
433 hint->push_back(boundaries[i]+delta) ;
464 list<Double_t>* hint =
new list<Double_t> ;
469 if (boundaries[i]>=xlo && boundaries[i]<=xhi) {
470 hint->push_back(boundaries[i]) ;
505 if (wgt>max) max=wgt ;
535 std::list<RooAbsData*> allData =
ws.allData() ;
536 std::list<RooAbsData*>::const_iterator iter ;
537 for (iter = allData.begin() ; iter != allData.end() ; ++iter) {
563 coutE(
ObjectHandling) <<
" RooHistPdf::importWorkspaceHook(" <<
GetName() <<
") unable to import clone of underlying RooDataHist with unique name " << uniqueName <<
", abort" << endl ;
575 coutE(
ObjectHandling) <<
" RooHistPdf::importWorkspaceHook(" <<
GetName() <<
") unable to import clone of underlying RooDataHist with unique name " << uniqueName <<
", abort" << endl ;
596 void RooHistPdf::Streamer(
TBuffer &R__b)
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add clone of specified element to an owning set.
Double_t totVolume() const
Return the total volume spanned by the observables of the RooHistPdf.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual RooAbsReal * highBoundFunc() const
Return pointer to RooAbsReal parameterized upper bound, if any.
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
virtual RooAbsReal * lowBoundFunc() const
Return pointer to RooAbsReal parameterized lower bound, if any.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Determine integration scenario.
virtual Double_t highBound() const =0
RooHistPdf()
Default constructor coverity[UNINIT_CTOR].
const char * Data() const
char * Form(const char *fmt,...)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooArgList is a container object that can hold multiple RooAbsArg objects.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return integral identified by 'code'.
virtual const RooArgSet * get() const
virtual const RooAbsBinning * getBinningPtr(const char *rangeName) const =0
RooAbsArg * find(const char *name) const
Find object with given name in list.
virtual Double_t weight() const
Buffer base class used for serializing objects.
Bool_t _unitNorm
Total volume of space (product of ranges of observables)
void setRange(const char *name, Double_t min, Double_t max)
Set a fit or plotting range.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Int_t numTypes(const char *=0) const
Return number of types defined (in range named rangeName if rangeName!=0)
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
virtual Double_t * array() const =0
virtual const RooAbsBinning * getBinningPtr(const char *rangeName) const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
RooCmdArg Rename(const char *suffix)
The RooDataHist is a container class to hold N-dimensional binned data.
Int_t _intOrder
Auxiliary class keeping tracking of analytical integration code.
virtual void syncCache(const RooArgSet *nset=0)=0
virtual Double_t sumEntries() const
Return effective number of entries in dataset, i.e., sum all weights.
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
RooAbsCollection is an abstract container object that can hold multiple RooAbsArg objects.
RooCmdArg Embedded(Bool_t flag=kTRUE)
Storage_t::size_type size() const
Bool_t importWorkspaceHook(RooWorkspace &ws)
Check if our datahist is already in the workspace.
RooHistPdf implements a probablity density function sampled from a multidimensional histogram.
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
The RooWorkspace is a persistable container for RooFit projects.
Double_t sum(Bool_t correctForBinSize, Bool_t inverseCorr=kFALSE) const
Return the sum of the weights of all hist bins.
Double_t evaluate() const
Return the current value: The value of the bin enclosing the current coordinates of the observables,...
virtual Bool_t hasRange(const char *name) const
Check if variable has a binning with given name.
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...
RooCategory is an object to represent discrete states.
virtual Int_t numEntries() const
Return the number of bins.
Bool_t areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
virtual Int_t numBoundaries() const =0
virtual Bool_t isParameterized() const
Interface function.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
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...
Abstract base class for objects that are lvalues, i.e.
virtual const char * GetName() const
Returns name of object.
virtual Int_t getMaxVal(const RooArgSet &vars) const
Only handle case of maximum in all variables.
RooRealVar represents a variable that can be changed from the outside.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
virtual Double_t lowBound() const =0
virtual Bool_t inRange(const char *) const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Overloaded RooArgSet::add() method inserts 'var' into set and registers 'var' as server to owner with...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual ~RooHistPdf()
Destructor.