58 _histFunc(
"HistFuncForBinWidth",
"Handle to a RooHistFunc, whose bin volumes should be returned.", this, histFunc,
60 _divideByBinWidth(divideByBinWidth)
91 const double volume = idx >= 0 ? volumes[idx] : 1.;
106 for (std::size_t i=0; i < bins.size(); ++i) {
111 for (std::size_t i=0; i < bins.size(); ++i) {
112 output[i] = bins[i] >= 0 ? 1./volumes[bins[i]] : 1.;
115 for (std::size_t i=0; i < bins.size(); ++i) {
116 output[i] = bins[i] >= 0 ? volumes[bins[i]] : 1.;
123std::unique_ptr<RooAbsArg>
Common abstract base class for objects that represent a value and a "shape" in RooFit.
virtual std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const
const RefCountList_t & servers() const
List of all servers of this object.
void addServer(RooAbsArg &server, bool valueProp=true, bool shapeProp=false, std::size_t refCount=1)
Register another RooAbsArg as a server to us, ie, declare that we depend on it.
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Abstract base class for objects that represent a real value and implements functionality common to al...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
std::unique_ptr< RooAbsArg > compileForNormSet(RooArgSet const &normSet, RooFit::Detail::CompileContext &ctx) const override
const RooHistFunc & histFunc() const
RooBinWidthFunction()
Create an empty instance.
static void disableClass()
Globally disable bin-width corrections by this class.
double evaluate() const override
Compute current bin of observable, and return its volume or inverse volume, depending on configuratio...
RooTemplateProxy< const RooHistFunc > _histFunc
void computeBatch(double *output, size_t size, RooFit::Detail::DataMap const &) const override
Compute bin index for all values of the observable(s) in evalData, and return their volumes or invers...
static bool isClassEnabled()
Returns true if bin-width corrections by this class are globally enabled, false otherwise.
static void enableClass()
Globally enable bin-width corrections by this class.
The RooDataHist is a container class to hold N-dimensional binned data.
std::span< const double > binVolumes(std::size_t first, std::size_t len) const
Retrieve all bin volumes. Bins are indexed according to getIndex().
void markAsCompiled(RooAbsArg &arg) const
bool binnedLikelihoodMode() const
void setBinWidthFuncFlag(bool flag)
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
std::vector< Int_t > getBins(RooFit::Detail::DataMap const &dataMap) const
Compute bin numbers corresponding to all coordinates in evalData.
Int_t getBin() const
Compute bin number corresponding to current coordinates.
RooDataHist & dataHist()
Return RooDataHist that is represented.
RooConstVar & RooConst(double val)