78using std::string, std::ostream;
90std::unique_ptr<RooAbsDataStore>
94 ?
static_cast<std::unique_ptr<RooAbsDataStore>
>(std::make_unique<RooTreeDataStore>(
name, title, vars))
95 :
static_cast<std::unique_ptr<RooAbsDataStore>
>(std::make_unique<RooVectorDataStore>(
name, title, vars));
190 std::map<string,RooDataHist*>
dhistMap,
double wgt) :
218 errorMsgStream <<
"RooDataHist::ctor(" <<
GetName() <<
") ERROR: dimension of input histogram must match "
219 <<
"number of dimension variables";
222 throw std::invalid_argument(
errorMsg);
271 RooAbsData(
name,title,
RooArgSet(vars,
static_cast<
RooAbsArg*>(
RooCmdConfig::decodeObjOnTheFly(
"RooDataHist::RooDataHist",
"IndexCat",0,nullptr,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7,
arg8))))
279 pc.
defineInt(
"impDens",
"ImportHisto",0) ;
281 pc.
defineObject(
"impSliceData",
"ImportDataSlice",0,
nullptr,
true) ;
282 pc.
defineString(
"impSliceState",
"ImportDataSlice",0,
"",
true) ;
285 pc.
defineSet(
"glObs",
"GlobalObservables",0,
nullptr) ;
298 throw std::invalid_argument(
"Invalid command arguments passed to RooDataHist constructor!");
316 }
else if (indexCat) {
320 std::map<std::string,RooDataHist*>
dmap ;
321 std::map<std::string,TH1*>
hmap ;
328 <<
"you are providing import data for the category state \"" << token
329 <<
"\", but the index category \"" << indexCat->
GetName() <<
"\" has no such state!";
332 throw std::invalid_argument(
errorMsg);
343 if(!
dmap.empty() && !
hmap.empty()) {
345 errorMsgStream <<
"RooDataHist::ctor(" <<
GetName() <<
") ERROR: you can't import mix of TH1 and RooDataHist";
348 throw std::invalid_argument(
errorMsg);
412 for (iz=0 ; iz <
zvar->getBins() ; iz++) {
468 auto const&
bng1 =
var1->getBinning();
469 auto const&
bng2 =
var2->getBinning();
472 if(
bng1.numBins() !=
bng2.numBins())
return false;
474 std::size_t nBins =
bng1.numBins();
482 double v1 =
bng1.binHigh(nBins - 1);
483 double v2 =
bng2.binHigh(nBins - 1);
500 TH1* histo(
nullptr) ;
505 histo =
hiter.second;
508 coutE(InputArguments) <<
"Axes of histogram " <<
hiter.second->GetName() <<
" are not consistent with first processed "
509 <<
"histogram " << histo->
GetName() << std::endl;
510 throw std::invalid_argument(
"Axes of inputs for RooDataHist are inconsistent");
516 coutI(InputArguments) <<
"RooDataHist::importTH1Set(" <<
GetName() <<
") defining state \"" <<
hiter.first <<
"\" in index category " << indexCat.
GetName() << std::endl ;
525 coutE(InputArguments) <<
"RooDataHist::importTH1Set(" <<
GetName() <<
"): dimension of input histogram must match "
526 <<
"number of continuous variables" << std::endl ;
527 throw std::invalid_argument(
"Inputs histograms for RooDataHist are not compatible with dimensions of variables.");
550 double volume =
xvar->getMax()-
xvar->getMin() ;
555 volume *= (
yvar->getMax()-
yvar->getMin()) ;
560 volume *= (
zvar->getMax()-
zvar->getMin()) ;
568 for (
ic=0 ;
ic <
icat->numBins(
nullptr) ;
ic++) {
570 histo =
hmap[
icat->getCurrentLabel()] ;
577 for (iz=0 ; iz <
zvar->getBins() ; iz++) {
604 std::map<std::string, RooDataHist *>
dmap,
double initWgt)
612 std::string
const &label =
diter.first;
619 coutE(InputArguments) <<
"Layout or binning of histogram " <<
dhist->GetName()
620 <<
" is not consistent with first processed "
622 throw std::invalid_argument(
"Layout or binning of inputs for RooDataHist is inconsistent");
629 coutI(InputArguments) <<
"RooDataHist::importDHistSet(" <<
GetName() <<
") defining state \"" << label
630 <<
"\" in index category " << indexCat.
GetName() << std::endl;
632 if (!
icat->hasLabel(label)) {
633 icat->defineType(label);
648 std::string
const &label =
diter.first;
651 icat->setLabel(label.c_str());
654 for (
Int_t i = 0; i <
dhist->numEntries(); i++) {
675 <<
" must be real\n";
676 throw std::logic_error(
"Incorrect type object (" +
ourVarName +
677 ") passed as argument to RooDataHist::_adjustBinning. Please report this issue.");
680 const double xlo =
theirVar.getMin();
681 const double xhi =
theirVar.getMax();
683 const bool isUniform = !axis.
GetXbins()->GetArray();
684 std::unique_ptr<RooAbsBinning> xbins;
687 xbins = std::make_unique<RooBinning>(axis.
GetNbins(), axis.
GetXbins()->GetArray());
692 const double tolerance = 1
e-6 * xbins->averageBinWidth();
710 coutI(DataHandling) <<
"RooDataHist::adjustBinning(" <<
ownName <<
"): fit range of variable " <<
ourVarName
711 <<
" expanded to nearest bin boundaries: [" << xlo <<
"," << xhi <<
"] --> [" <<
xloAdj <<
","
716 ourVar->setBinning(*xbins);
760 ours =
new double[
n];
786 for (
unsigned int i = 0; i <
_vars.
size(); ++i) {
790 rrv->setBinning(
rrv->getBinning(binningName));
800 if (
rrv->getBins() == 0) {
810 _lvbins.emplace_back(binning ? binning->
clone() :
nullptr);
819 for (
const auto var :
_vars) {
824 for (
unsigned int i = 0
u; i<
n; i++) {
881 std::vector<double>& bounds =
_binbounds.back();
882 bounds.reserve(2 * it->numBins());
883 for (
Int_t i = 0; i < it->numBins(); ++i) {
884 bounds.push_back(it->binLow(i));
885 bounds.push_back(it->binHigh(i));
912 _lvbins.emplace_back(binning ? binning->
clone() :
nullptr) ;
931 std::unique_ptr<RooArgSet>
tmp;
933 tmp = std::make_unique<RooArgSet>();
936 coutE(DataHandling) <<
"RooDataHist::reduceEng(" <<
GetName() <<
") Couldn't deep-clone cut variable, abort," << std::endl ;
946 for (
auto i=
nStart; i<nevt ; i++) {
951 for (
const auto arg : *row) {
952 if (!arg->inRange(cutRange)) {
960 if (!cloneVar || cloneVar->
getVal()) {
1003 std::vector<double> vals(
_arrSize);
1004 for (std::size_t i = 0; i < vals.size(); ++i) {
1018 for (std::size_t i = 0; i <
_vars.
size(); ++i) {
1026 coutE(InputArguments) <<
"RooHistPdf::weight(" <<
GetName()
1027 <<
") ERROR: Code Squashing currently does not support category values." << std::endl;
1040 return _vars.
size() == 1 ? code :
"(" + code +
")";
1061 if (&
_vars == &coords)
1066 for (
unsigned int i=0; i <
_vars.
size(); ++i) {
1119 <<
":plotOn: frame does not specify a plot variable" << std::endl;
1126 <<
":plotOn: dataset doesn't contain plot frame variable" << std::endl;
1154 const std::size_t nEvents =
xVals.size();
1158 auto binIndices =
reinterpret_cast<int*
>(output + nEvents) - nEvents;
1170 double binWidth =
_binv[0];
1209 for (std::size_t i = 0; i < nEvents ; ++i) {
1261 const std::size_t nEvents =
xVals.size();
1265 auto binIndices =
reinterpret_cast<int*
>(output + nEvents) - nEvents;
1277 double binWidth =
_binv[0];
1309 for (std::size_t i = 0; i < nEvents ; ++i) {
1347 auto const nEvents =
xVals.size();
1353 auto binIndices =
reinterpret_cast<int*
>(output + nEvents) - nEvents;
1357 for (std::size_t i=0; i < nEvents; ++i) {
1370 coutE(InputArguments) <<
"RooDataHist::weights(" <<
GetName() <<
") interpolation in "
1371 <<
intOrder <<
" dimensions not yet implemented" << std::endl ;
1399 coutE(InputArguments) <<
"RooDataHist::weight(" <<
GetName() <<
") ERROR: interpolation order must be positive" << std::endl ;
1434 coutE(InputArguments) <<
"RooDataHist::weight(" <<
GetName() <<
") ERROR: interpolation order must be positive" << std::endl ;
1479 }
else if (
varInfo.nRealVars == 2) {
1512 if (i>=0 && i<
ybinM) {
1516 }
else if (i>=
ybinM) {
1530 std::cout <<
"RooDataHist interpolating data is" << std::endl ;
1531 std::cout <<
"xarr = " ;
1533 std::cout <<
" yarr = " ;
1535 std::cout << std::endl ;
1542 coutE(InputArguments) <<
"RooDataHist::weight(" <<
GetName() <<
") interpolation in "
1543 <<
varInfo.nRealVars <<
" dimensions not yet implemented" << std::endl ;
1578 throw std::invalid_argument(
"RooDataHist::weightError(" + std::string(
GetName()) +
") error type Auto not allowed here");
1582 throw std::invalid_argument(
"RooDataHist::weightError(" + std::string(
GetName()) +
") error type Expected not allowed here");
1648 int fbinM = binning.numBins() ;
1659 if (i>=0 && i<
fbinM) {
1666 }
else if (i>=
fbinM) {
1781 if (
_curIndex == std::numeric_limits<std::size_t>::max()) {
1822 std::unique_ptr<RooArgSet>
tmp;
1825 tmp = std::make_unique<RooArgSet>();
1827 coutE(DataHandling) <<
"RooDataHist::add(" <<
GetName() <<
") Couldn't deep-clone cut variable, abort," << std::endl ;
1837 for (i=0 ; i<
dset.numEntries() ; i++) {
1839 if (!cloneVar || cloneVar->
getVal()) {
1876 return kahanSum.Sum();
1903 std::vector<double>
const *
pbinv =
nullptr;
1915 for (
unsigned int i = 0; i <
_vars.
size(); ++i) {
1971 const std::map<
const RooAbsArg*, std::pair<double, double> >& ranges,
1988 std::vector<double> rangeLo(
_vars.
size(), -std::numeric_limits<double>::infinity());
1989 std::vector<double> rangeHi(
_vars.
size(), +std::numeric_limits<double>::infinity());
1991 for (std::size_t i = 0; i <
_vars.
size(); ++i) {
2004 if (ranges.end() != it) {
2005 rangeLo[i] = it->second.first;
2006 rangeHi[i] = it->second.second;
2035 if (!
sumSet.find(*arg)) {
2075 for (
auto const&
v :
_vars) {
2076 code += ((
dimSet.find(*
v) ? 1 : 0) << i) ;
2082 if(!
pbinv.empty()) {
2089 for (std::size_t i = 0; i <
selDim.size(); ++i) {
2090 selDim[i] = (code >> i) & 1 ;
2098 for (
unsigned int j=0;
j <
_lvvars.size(); ++
j) {
2132 if (
cutSpec==
nullptr && cutRange==
nullptr) {
2137 std::unique_ptr<RooFormula> select;
2139 select = std::make_unique<RooFormula>(
"select",
cutSpec,*
get());
2146 if ((select && select->eval() == 0.) || (cutRange && !
_vars.
allInRange(cutRange)))
2152 return kahanSum.Sum();
2223 coutE(InputArguments) <<
"RooDataHist::sliceIterator() variable " <<
sliceArg.GetName() <<
" is not part of this RooDataHist" << std::endl ;
2270 for (
const auto arg :
_vars) {
2276 os << arg->GetName() ;
2291 if (std::abs(std::modf(
wgt, &
intpart)) > 1.E-10)
2310 os <<
indent <<
" Observables " <<
_vars << std::endl ;
2312 os <<
indent <<
" Observables: " ;
2335 os <<
"Contents of RooDataHist \"" <<
GetName() <<
"\"" << std::endl;
2338 os <<
"(dataset is empty)" << std::endl;
2344 os <<
" Bin " << i <<
": ";
2347 for (
const auto* var : *obs) {
2348 if (!first) os <<
", ";
2351 os << var->GetName() <<
"=";
2355 os <<
catVar->getCurrentLabel();
2357 os <<
"(unsupported type)";
2363 os <<
", weight=" <<
weight(i) <<
" +/- [" << lo <<
"," <<
hi <<
"]"
2372 if (
R__b.IsReading()) {
2485 for (
unsigned int i=0; i <
_vars.
size(); ++i) {
2494 info.initialized =
true;
int Int_t
Signed integer 4 bytes (int)
short Version_t
Class version identifier (short)
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
static unsigned int total
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char y1
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
static KahanSum< T, N > Accumulate(Iterator begin, Iterator end, T initialValue=T{})
Iterate over a range and return an instance of a KahanSum.
const_iterator begin() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
Abstract base class for RooRealVar binning definitions.
int binNumber(double x) const
Returns the bin number corresponding to the value x.
virtual void binNumbers(double const *x, int *bins, std::size_t n, int coef=1) const =0
Compute the bin indices for multiple values of x.
virtual bool isUniform() const
virtual double highBound() const =0
virtual double lowBound() const =0
virtual std::string translateBinNumber(RooFit::Experimental::CodegenContext &ctx, RooAbsArg const &var, int coef) const
virtual RooAbsBinning * clone(const char *name=nullptr) const =0
Abstract base class for objects that represent a discrete value that can be set from the outside,...
bool hasLabel(const std::string &label) const
Check if a state with name label exists.
Abstract container object that can hold multiple RooAbsArg objects.
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, bool forceIfSizeOne=false)
Sets the value of any argument in our set that also appears in the other set.
bool allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
Storage_t::size_type size() const
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for detailed printing of object.
void SetName(const char *name) override
Set the name of the TNamed.
void setGlobalObservables(RooArgSet const &globalObservables)
Sets the global observables stored in this data.
static StorageType defaultStorageType
std::unique_ptr< RooAbsDataStore > _dstore
Data storage implementation.
RooArgSet _vars
Dimensions of this data set.
RooArgSet _cachedVars
! External variables cached with this data set
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
void Streamer(TBuffer &) override
Stream an object of class RooAbsData.
virtual RooPlot * plotOnImpl(RooPlot *frame, PlotOpt o) const
Create and fill a histogram of the frame's variable and append it to the frame.
Abstract base class for objects that are lvalues, i.e.
virtual double getBinWidth(Int_t i, const char *rangeName=nullptr) const =0
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
static constexpr int DefaultNBins
Historical default number of bins, injected by routines that need a concrete bin count when a variabl...
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Object to represent discrete states.
bool defineType(const std::string &label)
Define a state with given name.
Named container for two doubles, two integers two object points and three string pointers that can be...
Configurable parser for RooCmdArg named arguments.
void defineMutex(const char *head, Args_t &&... tail)
Define arguments where any pair is mutually exclusive.
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
double getDouble(const char *name, double defaultValue=0.0) const
Return double property registered with name 'name'.
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
bool defineDouble(const char *name, const char *argName, int doubleNum, double defValue=0.0)
Define double property name 'name' mapped to double in slot 'doubleNum' in RooCmdArg with name argNam...
RooArgSet * getSet(const char *name, RooArgSet *set=nullptr) const
Return RooArgSet property registered with name 'name'.
bool defineSet(const char *name, const char *argName, int setNum, const RooArgSet *set=nullptr)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
bool ok(bool verbose) const
Return true of parsing was successful.
bool defineObject(const char *name, const char *argName, int setNum, const TObject *obj=nullptr, bool isArray=false)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
const char * getString(const char *name, const char *defaultValue="", bool convEmptyToNull=false) const
Return string property registered with name 'name'.
bool defineString(const char *name, const char *argName, int stringNum, const char *defValue="", bool appendMode=false)
Define double property name 'name' mapped to double in slot 'stringNum' in RooCmdArg with name argNam...
const RooLinkedList & getObjectList(const char *name) const
Return list of objects registered with name 'name'.
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
TObject * getObject(const char *name, TObject *obj=nullptr) const
Return TObject property registered with name 'name'.
Container class to hold N-dimensional binned data.
std::span< const double > getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const override
Return event weights of all events in range [first, first+len).
void interpolateQuadratic(double *output, std::span< const double > xVals, bool correctForBinSize, bool cdfBoundaries)
A vectorized version of interpolateDim for boundary safe quadratic interpolation of one dimensional h...
double sum(bool correctForBinSize, bool inverseCorr=false) const
Return the sum of the weights of all bins in the histogram.
void weights(double *output, std::span< double const > xVals, int intOrder, bool correctForBinSize, bool cdfBoundaries)
A vectorized version of RooDataHist::weight() for one dimensional histograms with up to one dimension...
Int_t _cache_sum_valid
! Is cache sum valid? Needs to be Int_t instead of CacheSumState_t for subclasses.
void printContents(std::ostream &os=std::cout) const override
Print the contents of the dataset to the specified output stream.
double interpolateDim(int iDim, double xval, size_t centralIdx, int intOrder, bool correctForBinSize, bool cdfBoundaries)
Perform boundary safe 'intOrder'-th interpolation of weights in dimension 'dim' at current value 'xva...
double weightSquared() const override
Return squared weight of last bin that was requested with get().
friend class RooDataHistSliceIter
void importTH1(const RooArgList &vars, const TH1 &histo, double initWgt, bool doDensityCorrection)
Import data from given TH1/2/3 into this RooDataHist.
TClass * IsA() const override
void SetNameTitle(const char *name, const char *title) override
Change the title of this RooDataHist.
double _cache_sum
! Cache for sum of entries ;
void initialize(const char *binningName=nullptr, bool fillTree=true)
Initialization procedure: allocate weights array, calculate multipliers needed for N-space to 1-dim a...
std::string declWeightArrayForCodeSquash(RooFit::Experimental::CodegenContext &ctx, bool correctForBinSize) const
Int_t getIndex(const RooAbsCollection &coord, bool fast=false) const
Calculate bin number of the given coordinates.
void add(const RooArgSet &row, double wgt=1.0) override
Add wgt to the bin content enclosed by the coordinates passed in row.
const std::vector< double > & calculatePartialBinVolume(const RooArgSet &dimSet) const
Fill the transient cache with partial bin volumes with up-to-date values for the partial volume speci...
static std::unique_ptr< RooAbsDataStore > makeDefaultDataStore(RooStringView name, RooStringView title, RooArgSet const &vars)
double weightInterpolated(const RooArgSet &bin, int intOrder, bool correctForBinSize, bool cdfBoundaries)
Return the weight at given coordinates with interpolation.
std::unordered_map< int, std::vector< double > > _pbinvCache
! Cache for arrays of partial bin volumes
void checkBinBounds() const
void initializeAsymErrArrays() const
void set(std::size_t binNumber, double weight, double wgtErr)
Set bin content of bin that was last loaded with get(std::size_t).
void weightError(double &lo, double &hi, ErrorType etype=Poisson) const override
Return the asymmetric errors on the current weight.
double * _errHi
[_arrSize] High-side error on weight array
void importTH1Set(const RooArgList &vars, RooCategory &indexCat, std::map< std::string, TH1 * > hmap, double initWgt, bool doDensityCorrection)
Import data from given set of TH1/2/3 into this RooDataHist.
void adjustBinning(const RooArgList &vars, const TH1 &href, Int_t *offset=nullptr)
Adjust binning specification on first and optionally second and third observable to binning in given ...
double * _binv
[_arrSize] Bin volume array
RooDataHist()
Default constructor.
ULong64_t _curIndex
Current index.
std::string calculateTreeIndexForCodeSquash(RooFit::Experimental::CodegenContext &ctx, const RooAbsCollection &coords, bool reverse=false) const
double weightFast(const RooArgSet &bin, int intOrder, bool correctForBinSize, bool cdfBoundaries)
A faster version of RooDataHist::weight that assumes the passed arguments are aligned with the histog...
double weight() const override
Return weight of last bin that was requested with get().
std::vector< std::vector< double > > _binbounds
! list of bin bounds per dimension
void printArgs(std::ostream &os) const override
Print argument of dataset, i.e. the observable names.
void importDHistSet(const RooArgList &vars, RooCategory &indexCat, std::map< std::string, RooDataHist * > dmap, double initWgt)
Import data from given set of TH1/2/3 into this RooDataHist.
void _adjustBinning(RooRealVar &theirVar, const TAxis &axis, RooRealVar *ourVar, Int_t *offset)
Helper doing the actual work of adjustBinning().
void printMultiline(std::ostream &os, Int_t content, bool verbose=false, TString indent="") const override
Print the details on the dataset contents.
double * _sumw2
[_arrSize] Sum of weights^2
TIterator * sliceIterator(RooAbsArg &sliceArg, const RooArgSet &otherArgs)
Create an iterator over all bins in a slice defined by the subset of observables listed in sliceArg.
Int_t calcTreeIndex() const
Legacy overload to calculate the tree index from the current value of _vars.
~RooDataHist() override
Destructor.
bool isNonPoissonWeighted() const override
Returns true if dataset contains entries with a non-integer weight.
std::vector< RooAbsLValue * > _lvvars
! List of observables casted as RooAbsLValue
void SetName(const char *name) override
Change the name of the RooDataHist.
std::vector< std::unique_ptr< const RooAbsBinning > > _lvbins
! List of used binnings associated with lvalues
void Streamer(TBuffer &) override
Stream an object of class RooDataHist.
std::vector< double > _interpolationBuffer
! Buffer to contain values used for weight interpolation
std::vector< Int_t > _idxMult
void registerWeightArraysToDataStore() const
Hand over pointers to our weight arrays to the data store implementation.
void reset() override
Reset all bin weights to zero.
double * _errLo
[_arrSize] Low-side error on weight array
double * _wgt
[_arrSize] Weight array
RooPlot * plotOnImpl(RooPlot *frame, PlotOpt o) const override
Back end function to plotting functionality.
void printValue(std::ostream &os) const override
Print value of the dataset, i.e. the sum of weights contained in the dataset.
VarInfo const & getVarInfo()
Return reference to VarInfo struct with cached histogram variable information that is frequently used...
std::unique_ptr< RooAbsData > reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=nullptr, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max()) const override
Implementation of RooAbsData virtual method that drives the RooAbsData::reduce() methods.
const RooArgSet * get() const override
Get bin centre of current bin.
void interpolateLinear(double *output, std::span< const double > xVals, bool correctForBinSize, bool cdfBoundaries)
A vectorized version of interpolateDim for boundary safe linear interpolation of one dimensional hist...
double binVolume() const
Return volume of current bin.
double sumEntries() const override
Sum the weights of all bins.
Utility base class for RooFit objects that are to be attached to ROOT directories.
virtual void Streamer(TBuffer &)
void removeFromDir(TObject *obj)
Remove object from directory it was added to.
TDirectory * _dir
! Associated directory
A class to maintain the context for squashing of RooFit models into code.
std::string buildArg(RooAbsCollection const &x, std::string const &arrayType="double")
Function to save a RooListProxy as an array in the squashed code.
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
static double interpolate(double yArr[], Int_t nOrder, double x)
Plot frame and a container for graphics objects within that frame.
RooAbsRealLValue * getPlotVar() const
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
Variable that can be changed from the outside.
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
Class to manage histogram axis.
const TArrayD * GetXbins() const
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x
Buffer base class used for serializing objects.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual TList * GetList() const
TH1 is the base class of all histogram classes in ROOT.
virtual Int_t GetNbinsY() const
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetNbinsZ() const
virtual Int_t GetDimension() const
virtual Int_t GetNbinsX() const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Iterator abstract base class.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Mother of all ROOT objects.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
A TTree represents a columnar dataset.
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
Structure to cache information on the histogram variable that is frequently used for histogram weight...