67 _pdfObsList(
"pdfObs",
"List of p.d.f. observables",this),
82 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
85 for (
const auto arg : vars) {
86 if (!dvars->
find(arg->GetName())) {
88 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
119 _pdfObsList(
"pdfObs",
"List of p.d.f. observables",this),
134 <<
") ERROR histogram variable list and RooDataHist must contain the same variables." << endl ;
135 throw(
string(
"RooHistPdf::ctor() ERROR: histogram variable list and RooDataHist must contain the same variables")) ;
138 for (
const auto arg : histObs) {
139 if (!dvars->
find(arg->GetName())) {
141 <<
") ERROR variable list and RooDataHist must contain the same variables." << endl ;
142 throw(
string(
"RooHistPdf::ctor() ERROR: histogram variable list and RooDataHist must contain the same variables")) ;
144 if (!arg->isFundamental()) {
146 <<
") ERROR all elements of histogram observables set must be of type RooRealVar or RooCategory." << endl ;
147 throw(
string(
"RooHistPdf::ctor() ERROR all elements of histogram observables set must be of type RooRealVar or RooCategory.")) ;
170 _pdfObsList(
"pdfObs",this,other._pdfObsList),
171 _dataHist(other._dataHist),
172 _codeReg(other._codeReg),
173 _intOrder(other._intOrder),
174 _cdfBoundaries(other._cdfBoundaries),
175 _totVolume(other._totVolume),
176 _unitNorm(other._unitNorm)
263 if (!_x || !_y)
return false;
264 if (!range || !strlen(range) || !_x->
hasRange(range) ||
289 Int_t code = 0, frcode = 0;
294 if (allVars.
find(*pa)) {
297 if (fullRange(*pa, *ha, rangeName)) {
303 if (code == frcode) {
315 return (code >= 2) ? code : 0;
335 std::map<const RooAbsArg*, std::pair<Double_t, Double_t> > ranges;
340 if (code & (2 <<
n)) {
347 if (rangeName && rlv->
hasRange(rangeName)) {
348 ranges[ha] = std::make_pair(
350 }
else if (binning) {
352 ranges[ha] = std::make_pair(
355 ranges[ha] = std::make_pair(
365 ha->copyCache(pa,
kTRUE);
419 list<Double_t>* hint =
new list<Double_t> ;
422 xlo = xlo - 0.01*(xhi-xlo) ;
423 xhi = xhi + 0.01*(xhi-xlo) ;
430 if (boundaries[i]>=xlo && boundaries[i]<=xhi) {
431 hint->push_back(boundaries[i]-delta) ;
432 hint->push_back(boundaries[i]+delta) ;
463 list<Double_t>* hint =
new list<Double_t> ;
468 if (boundaries[i]>=xlo && boundaries[i]<=xhi) {
469 hint->push_back(boundaries[i]) ;
504 if (wgt>max) max=wgt ;
534 std::list<RooAbsData*> allData =
ws.allData() ;
535 std::list<RooAbsData*>::const_iterator iter ;
536 for (iter = allData.begin() ; iter != allData.end() ; ++iter) {
562 coutE(
ObjectHandling) <<
" RooHistPdf::importWorkspaceHook(" <<
GetName() <<
") unable to import clone of underlying RooDataHist with unique name " << uniqueName <<
", abort" << endl ;
574 coutE(
ObjectHandling) <<
" RooHistPdf::importWorkspaceHook(" <<
GetName() <<
") unable to import clone of underlying RooDataHist with unique name " << uniqueName <<
", abort" << endl ;
595void RooHistPdf::Streamer(
TBuffer &R__b)
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDirty=kTRUE)=0
virtual void syncCache(const RooArgSet *nset=0)=0
virtual Bool_t inRange(const char *) const
RooAbsBinning is the abstract base class for RooRealVar binning definitions This class defines the in...
virtual Double_t * array() const =0
virtual Bool_t isParameterized() const
virtual Double_t highBound() const =0
virtual RooAbsReal * highBoundFunc() const
virtual Int_t numBoundaries() const =0
virtual Double_t lowBound() const =0
virtual RooAbsReal * lowBoundFunc() const
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.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
RooAbsCollection * selectCommon(const RooAbsCollection &refColl) const
Create a subset of the current collection, consisting only of those elements that are contained as we...
Storage_t::size_type size() const
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.
Abstract base class for objects that are lvalues, i.e.
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 Bool_t hasRange(const char *name) const
Check if variable has a binning with given name.
virtual const RooAbsBinning * getBinningPtr(const char *rangeName) const
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
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...
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...
RooCategory represents a fundamental (non-derived) discrete value object.
The RooDataHist is a container class to hold N-dimensional binned data.
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
virtual Double_t sumEntries() const
virtual Int_t numEntries() const
Return the number of bins.
virtual const RooArgSet * get() const
RooHistPdf implements a probablity density function sampled from a multidimensional histogram.
Int_t _intOrder
Auxiliary class keeping tracking of analytical integration code.
RooHistPdf()
Default constructor coverity[UNINIT_CTOR].
virtual Int_t getMaxVal(const RooArgSet &vars) const
Only handle case of maximum in all variables.
virtual Double_t maxVal(Int_t code) const
Return maximum value for set of observables identified by code assigned in getMaxVal.
Bool_t _unitNorm
Total volume of space (product of ranges of observables)
Double_t evaluate() const
Return the current value: The value of the bin enclosing the current coordinates of the observables,...
virtual ~RooHistPdf()
Destructor.
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...
Bool_t areIdentical(const RooDataHist &dh1, const RooDataHist &dh2)
Double_t totVolume() const
Return the total volume spanned by the observables of the RooHistPdf.
Bool_t importWorkspaceHook(RooWorkspace &ws)
Check if our datahist is already in the workspace.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Determine integration scenario.
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Return integral identified by 'code'.
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...
RooRealVar represents a variable that can be changed from the outside.
void setRange(const char *name, Double_t min, Double_t max)
Set range named 'name to [min,max].
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.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual const char * GetName() const
Returns name of object.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
const char * Data() const
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
RooCmdArg Embedded(Bool_t flag=kTRUE)
RooCmdArg Rename(const char *suffix)