45 return new RooDataSet(*
this, newname && newname[0] !=
'\0' ? newname :
GetName());
54 double sumEntries(
const char* cutSpec,
const char* cutRange=
nullptr)
const override;
57 const RooCmdArg& arg1={},
const RooCmdArg& arg2={},
58 const RooCmdArg& arg3={},
const RooCmdArg& arg4={},
59 const RooCmdArg& arg5={},
const RooCmdArg& arg6={},
60 const RooCmdArg& arg7={},
const RooCmdArg& arg8={})
const ;
65 static RooDataSet *
read(
const char *filename,
const RooArgList &variables,
66 const char *opts=
"",
const char* commonPath=
"",
67 const char *indexCatName=
nullptr) ;
68 bool write(
const char* filename)
const;
69 bool write(std::ostream & ofs)
const;
75 double weight()
const override;
85 std::span<const double>
getWeightBatch(std::size_t first, std::size_t len,
bool sumW2)
const override;
90 virtual void add(
const RooArgSet& row,
double weight,
double weightErrorLo,
double weightErrorHi);
97 bool merge(std::list<RooDataSet*> dsetList) ;
102 void printArgs(std::ostream& os)
const override;
103 void printValue(std::ostream& os)
const override;
106 void printContents(std::ostream& os = std::cout)
const override;
123 std::size_t nStart=0, std::size_t nStop = std::numeric_limits<std::size_t>::max())
const override;
131 const char *rangeName,
RooFormulaVar const *cutVar,
const char *cutSpec);
int Int_t
Signed integer 4 bytes (int).
#define ClassDefOverride(name, id)
static void indent(ostringstream &buf, int indent_level)
Common abstract base class for objects that represent a value and a "shape" in RooFit.
RooAbsData()
Default constructor.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Object to represent discrete states.
Named container for two doubles, two integers two object points and three string pointers that can be...
Container class to hold N-dimensional binned data.
Container class to hold unbinned data.
RooFit::OwningPtr< RooAbsData > emptyClone(const char *newName=nullptr, const char *newTitle=nullptr, const RooArgSet *vars=nullptr, const char *wgtVarName=nullptr) const override
Return an empty clone of this dataset.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
RooRealVar * _wgtVar
Pointer to weight variable (if set).
bool _doWeightErrorCheck
! When adding events with weights, check that weights can actually be stored.
RooArgSet _varsNoWgt
Vars without weight variable.
void loadValuesFromSlices(RooCategory &indexCat, std::map< std::string, RooAbsData * > const &slices, const char *rangeName, RooFormulaVar const *cutVar, const char *cutSpec)
RooFit::OwningPtr< RooDataHist > binnedClone(const char *newName=nullptr, const char *newTitle=nullptr) const
Return binned clone of this dataset.
void weightError(double &lo, double &hi, ErrorType etype=SumW2) const override
Return the asymmetric errors on the current weight.
const RooArgSet * get() const override
Return a RooArgSet with the coordinates of the current event.
void printContents(std::ostream &os=std::cout) const override
Print the contents of the dataset to the specified output stream.
virtual RooPlot * plotOnXY(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Special plot method for 'X-Y' datasets used in fitting.
void printArgs(std::ostream &os) const override
Print argument of dataset, i.e. the observable names.
void SetName(const char *name) override
Change the name of this dataset into the given name.
virtual void addFast(const RooArgSet &row, double weight=1.0, double weightError=0.0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
bool merge(RooDataSet *data1, RooDataSet *data2=nullptr, RooDataSet *data3=nullptr, RooDataSet *data4=nullptr, RooDataSet *data5=nullptr, RooDataSet *data6=nullptr)
virtual RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true)
Add a column with the values of the given (function) argument to this dataset.
bool write(const char *filename) const
Write the contents of this dataset to an ASCII file with the specified name.
double sumEntries() const override
Return effective number of entries in dataset, i.e., sum all weights.
std::span< const double > getWeightBatch(std::size_t first, std::size_t len, bool sumW2) const override
RooRealVar * weightVar() const
Returns a pointer to the weight variable (if set).
~RooDataSet() override
Destructor.
bool isNonPoissonWeighted() const override
Returns true if histogram contains bins with entries with a non-integer weight.
void SetNameTitle(const char *name, const char *title) override
Change the title of this dataset into the given name.
void printValue(std::ostream &os) const override
Print value of the dataset, i.e. the sum of weights contained in the dataset.
void append(RooDataSet &data)
Add all data points of given data set to this data set.
RooDataSet()
Default constructor for persistence.
friend class RooProdGenContext
std::unique_ptr< std::vector< double > > _sumW2Buffer
! Buffer for sumW2 in case a batch of values is requested.
void add(const RooArgSet &row, double weight, double weightError)
Add one ore more rows of data.
unsigned short _errorMsgCount
! Counter to silence error messages when filling dataset.
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.
void convertToTreeStore() override
Convert vector-based storage to tree-based storage.
void add(const RooArgSet &row, double weight=1.0) override
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Print info about this dataset to the specified output stream.
double weightSquared() const override
Return squared event weight of the current event.
double weight() const override
Return event weight of current event.
static RooDataSet * read(const char *filename, const RooArgList &variables, const char *opts="", const char *commonPath="", const char *indexCatName=nullptr)
Read data from a text file and create a dataset from it.
bool isWeighted() const override
Return true if dataset contains weighted events.
Plot frame and a container for graphics objects within that frame.
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...
Describe directory structure in memory.
const char * GetName() const override
Returns name of object.
TObject()
TObject constructor.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...