|
ROOT
Reference Guide |
|
Go to the documentation of this file.
109 #ifndef USEMEMPOOLFORDATASET
122 auto pool = memPool();
138 void* RooDataSet::operator
new (
size_t bytes)
143 return memPool()->allocate(bytes);
151 void RooDataSet::operator
delete (
void* ptr)
154 if (memPool()->deallocate(ptr))
157 std::cerr << __func__ <<
" " << ptr <<
" is not in any of the pools." << std::endl;
160 ::operator
delete(ptr);
217 RooAbsData(
name,title,
RooArgSet(vars,(
RooAbsArg*)
RooCmdConfig::decodeObjOnTheFly(
"RooDataSet::RooDataSet",
"IndexCat",0,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)))
221 pc.defineInt(
"ownLinked",
"OwnLinked",0) ;
222 pc.defineObject(
"impTree",
"ImportTree",0) ;
223 pc.defineObject(
"impData",
"ImportData",0) ;
224 pc.defineObject(
"indexCat",
"IndexCat",0) ;
225 pc.defineObject(
"impSliceData",
"ImportDataSlice",0,0,
kTRUE) ;
226 pc.defineString(
"impSliceState",
"ImportDataSlice",0,
"",
kTRUE) ;
227 pc.defineObject(
"lnkSliceData",
"LinkDataSlice",0,0,
kTRUE) ;
228 pc.defineString(
"lnkSliceState",
"LinkDataSlice",0,
"",
kTRUE) ;
229 pc.defineString(
"cutSpec",
"CutSpec",0,
"") ;
230 pc.defineObject(
"cutVar",
"CutVar",0) ;
231 pc.defineString(
"cutRange",
"CutRange",0,
"") ;
232 pc.defineString(
"wgtVarName",
"WeightVarName",0,
"") ;
233 pc.defineInt(
"newWeight1",
"WeightVarName",0,0) ;
234 pc.defineString(
"fname",
"ImportFromFile",0,
"") ;
235 pc.defineString(
"tname",
"ImportFromFile",1,
"") ;
236 pc.defineObject(
"wgtVar",
"WeightVar",0) ;
237 pc.defineInt(
"newWeight2",
"WeightVar",0,0) ;
238 pc.defineObject(
"dummy1",
"ImportDataSliceMany",0) ;
239 pc.defineObject(
"dummy2",
"LinkDataSliceMany",0) ;
240 pc.defineSet(
"errorSet",
"StoreError",0) ;
241 pc.defineSet(
"asymErrSet",
"StoreAsymError",0) ;
242 pc.defineMutex(
"ImportTree",
"ImportData",
"ImportDataSlice",
"LinkDataSlice",
"ImportFromFile") ;
243 pc.defineMutex(
"CutSpec",
"CutVar") ;
244 pc.defineMutex(
"WeightVarName",
"WeightVar") ;
245 pc.defineDependency(
"ImportDataSlice",
"IndexCat") ;
246 pc.defineDependency(
"LinkDataSlice",
"IndexCat") ;
247 pc.defineDependency(
"OwnLinked",
"LinkDataSlice") ;
264 TTree* impTree =
static_cast<TTree*
>(
pc.getObject(
"impTree")) ;
267 const char* cutSpec =
pc.getString(
"cutSpec",
"",
kTRUE) ;
268 const char* cutRange =
pc.getString(
"cutRange",
"",
kTRUE) ;
269 const char* wgtVarName =
pc.getString(
"wgtVarName",
"",
kTRUE) ;
271 const char* impSliceNames =
pc.getString(
"impSliceState",
"",
kTRUE) ;
273 const char* lnkSliceNames =
pc.getString(
"lnkSliceState",
"",
kTRUE) ;
277 RooArgSet* asymErrorSet =
pc.getSet(
"asymErrSet") ;
278 const char* fname =
pc.getString(
"fname") ;
279 const char* tname =
pc.getString(
"tname") ;
280 Int_t ownLinked =
pc.getInt(
"ownLinked") ;
281 Int_t newWeight =
pc.getInt(
"newWeight1") +
pc.getInt(
"newWeight2") ;
287 map<string,RooAbsData*> hmap ;
290 strlcpy(tmp, lnkSliceNames, 64000);
291 char *token = strtok(tmp,
",");
295 token = strtok(0,
",");
303 wgtVarName = wgtVar->
GetName() ;
311 map<string,RooAbsDataStore*> storeMap ;
314 throw std::string(
"RooDataSet::RooDataSet() ERROR in constructor, cannot find index category") ;
316 for (map<string,RooAbsData*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
318 if (indexCat && !indexCat->
hasLabel(hiter->first)) {
322 if (icat && !icat->
hasLabel(hiter->first)) {
325 icat->
setLabel(hiter->first.c_str()) ;
340 wgtVarName = wgtVar->
GetName() ;
344 if (!wgtVar && !wgtVarName && impData && impData->
_wgtVar) {
358 if (wgtVarName && newWeight) {
372 map<string,RooDataSet*> hmap ;
402 delete intAsymErrorSet ;
407 wgtVarName = wgtVar->
GetName() ;
414 if (wgtVarName && *wgtVarName) {
424 }
else if (indexCat) {
438 if (cutSpec && *cutSpec) {
445 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
447 if (!indexCat->
hasLabel(hiter->first)) {
451 if (!icat->
hasLabel(hiter->first)) {
454 icat->
setLabel(hiter->first.c_str()) ;
456 RooFormulaVar cutVarTmp(cutSpec,cutSpec,hiter->second->_vars) ;
460 }
else if (impData) {
465 }
else if (impTree) {
470 tstore->
loadValues(impTree,&cutVarTmp,cutRange);
473 tmpstore.
loadValues(impTree,&cutVarTmp,cutRange) ;
476 }
else if (fname && strlen(fname)) {
481 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
482 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
486 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
487 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
509 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
511 if (!indexCat->
hasLabel(hiter->first)) {
515 if (!icat->
hasLabel(hiter->first)) {
518 icat->
setLabel(hiter->first.c_str()) ;
523 }
else if (impData) {
526 }
else if (impTree) {
532 tmpstore.
loadValues(impTree,cutVar,cutRange) ;
535 }
else if (fname && strlen(fname)) {
539 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
540 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
544 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
545 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
564 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
566 if (!indexCat->
hasLabel(hiter->first)) {
570 if (!icat->
hasLabel(hiter->first)) {
573 icat->
setLabel(hiter->first.c_str()) ;
578 }
else if (impData) {
582 }
else if (impTree || (fname && strlen(fname))) {
584 std::unique_ptr<TFile>
file;
586 if (impTree ==
nullptr) {
589 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
590 throw std::invalid_argument(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
593 file->GetObject(tname, impTree);
595 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
596 throw std::invalid_argument(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
653 const RooArgSet& vars,
const char *cuts,
const char* wgtVarName) :
782 const RooArgSet& vars,
const char* cuts,
const char* wgtVarName) :
824 std::size_t nStart, std::size_t nStop,
Bool_t copyCache,
const char* wgtVarName) :
829 copyCache, wgtVarName);
832 nStop, copyCache, wgtVarName);
850 if (wgtVar) tmp.
add(*wgtVar) ;
866 delete selCacheVars ;
882 if (wgtVarName && vars && !
_wgtVar) {
915 << wgtVarName <<
" not found in set of variables, no weighting will be assigned" << endl ;
916 throw std::invalid_argument(
"RooDataSet::initialize() weight variable could not be initialised.");
919 << wgtVarName <<
" is not of type RooRealVar, no weighting will be assigned" << endl ;
920 throw std::invalid_argument(
"RooDataSet::initialize() weight variable could not be initialised.");
934 std::size_t nStart, std::size_t nStop,
Bool_t copyCache)
1025 evalData.
spans[batch.first] = std::move(batch.second);
1078 carry = (t - sumw) -
y;
1094 if (cutSpec && strlen(cutSpec) > 0) {
1108 if (select && select->
eval()==0.) continue ;
1112 carry = (t - sumw) -
y;
1116 if (select)
delete select ;
1190 }
else if ((wgt != 1. || wgtError != 0.) &&
_errorMsgCount < 5) {
1191 ccoutE(
DataHandling) <<
"An event weight/error was passed but no weight variable was defined"
1192 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1198 &&
fabs(wgt*wgt - wgtError)/wgtError > 1.E-15
1199 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreError")) {
1202 <<
"' does not store errors. Check `StoreError` in the RooDataSet constructor." << std::endl;
1240 ccoutE(
DataHandling) <<
"An event weight was given but no weight variable was defined"
1241 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1246 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreAsymError")) {
1249 <<
"' does not store errors. Check `StoreAsymError` in the RooDataSet constructor." << std::endl;
1292 ccoutE(
DataHandling) <<
"An event weight was given but no weight variable was defined"
1293 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1300 && wgtError != 0. && wgtError != wgt*wgt
1301 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreError")) {
1304 <<
"' does not store errors. Check `StoreError` in the RooDataSet constructor." << std::endl;
1325 list<RooDataSet*> dsetList ;
1326 if (data1) dsetList.push_back(data1) ;
1327 if (data2) dsetList.push_back(data2) ;
1328 if (data3) dsetList.push_back(data3) ;
1329 if (data4) dsetList.push_back(data4) ;
1330 if (data5) dsetList.push_back(data5) ;
1331 if (data6) dsetList.push_back(data6) ;
1332 return merge(dsetList) ;
1348 for (list<RooDataSet*>::iterator iter = dsetList.begin() ; iter != dsetList.end() ; ++iter) {
1356 list<RooAbsDataStore*> dstoreList ;
1357 for (list<RooDataSet*>::iterator iter = dsetList.begin() ; iter != dsetList.end() ; ++iter) {
1359 dstoreList.push_back((*iter)->store()) ;
1452 static Int_t counter(0) ;
1461 <<
" is not in dataset and is also not dependent on data set" << endl ;
1467 ownPlotVarX =
kTRUE ;
1480 <<
" is not in dataset and is also not dependent on data set" << endl ;
1486 ownPlotVarY =
kTRUE ;
1494 if(0 != cuts && strlen(cuts)) {
1496 if (!select || !select->
ok()) {
1518 for(
Int_t i=0; i < nevent; ++i)
1522 if (select && select->
eval()==0) continue ;
1526 if (ownPlotVarX)
delete plotVarX ;
1527 if (ownPlotVarY)
delete plotVarY ;
1528 if (select)
delete select ;
1576 pc.defineString(
"drawOption",
"DrawOption",0,
"P") ;
1577 pc.defineString(
"histName",
"Name",0,
"") ;
1578 pc.defineInt(
"lineColor",
"LineColor",0,-999) ;
1579 pc.defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1580 pc.defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1581 pc.defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1582 pc.defineInt(
"markerStyle",
"MarkerStyle",0,8) ;
1583 pc.defineDouble(
"markerSize",
"MarkerSize",0,-999) ;
1584 pc.defineInt(
"fillColor",
"FillColor",0,-999) ;
1585 pc.defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1586 pc.defineInt(
"histInvisible",
"Invisible",0,0) ;
1587 pc.defineDouble(
"scaleFactor",
"Rescale",0,1.) ;
1588 pc.defineObject(
"xvar",
"XVar",0,0) ;
1589 pc.defineObject(
"yvar",
"YVar",0,0) ;
1593 pc.process(argList) ;
1599 const char* drawOptions =
pc.getString(
"drawOption") ;
1600 Int_t histInvisible =
pc.getInt(
"histInvisible") ;
1601 const char* histName =
pc.getString(
"histName",0,
kTRUE) ;
1602 Double_t scaleFactor =
pc.getDouble(
"scaleFactor") ;
1611 coutE(
InputArguments) <<
"RooDataSet::plotOnXY(" <<
GetName() <<
") ERROR: no YVar() argument specified and dataset is not weighted" << endl ;
1616 if (yvar && !dataY) {
1617 coutE(
InputArguments) <<
"RooDataSet::plotOnXY(" <<
GetName() <<
") ERROR on YVar() argument, dataset does not contain a variable named " << yvar->
GetName() << endl ;
1625 graph->SetName(histName) ;
1644 graph->addBinWithXYError(
x,
y,-1*exlo,exhi,-1*eylo,eyhi,scaleFactor) ;
1648 Int_t lineColor =
pc.getInt(
"lineColor") ;
1649 Int_t lineStyle =
pc.getInt(
"lineStyle") ;
1650 Int_t lineWidth =
pc.getInt(
"lineWidth") ;
1651 Int_t markerColor =
pc.getInt(
"markerColor") ;
1652 Int_t markerStyle =
pc.getInt(
"markerStyle") ;
1653 Size_t markerSize =
pc.getDouble(
"markerSize") ;
1654 Int_t fillColor =
pc.getInt(
"fillColor") ;
1655 Int_t fillStyle =
pc.getInt(
"fillStyle") ;
1657 if (lineColor!=-999)
graph->SetLineColor(lineColor) ;
1658 if (lineStyle!=-999)
graph->SetLineStyle(lineStyle) ;
1659 if (lineWidth!=-999)
graph->SetLineWidth(lineWidth) ;
1660 if (markerColor!=-999)
graph->SetMarkerColor(markerColor) ;
1661 if (markerStyle!=-999)
graph->SetMarkerStyle(markerStyle) ;
1662 if (markerSize!=-999)
graph->SetMarkerSize(markerSize) ;
1663 if (fillColor!=-999)
graph->SetFillColor(fillColor) ;
1664 if (fillStyle!=-999)
graph->SetFillStyle(fillStyle) ;
1724 const char *verbOpt,
const char* commonPath,
1725 const char* indexCatName) {
1733 blindState =
new RooCategory(
"blindState",
"Blinding State") ;
1739 <<
"a non-RooCategory blindState member" << endl ;
1743 <<
"blindState category in variable list" << endl ;
1758 auto data = std::make_unique<RooDataSet>(
"dataset", fileList,
variables);
1759 if (ownIsBlind) {
variables.remove(*blindState) ;
delete blindState ; }
1767 blindCat = (
RooCategory*) data->_vars.find(
"blindState") ;
1774 tmp = data->_vars.find(indexCatName) ;
1777 << indexCatName <<
" in supplied variable list" << endl ;
1782 <<
" is not a RooCategory" << endl ;
1792 Int_t outOfRange(0) ;
1795 Int_t fileSeqNum(0);
1801 const char *catname = strchr(filename.c_str(),
':');
1817 char newLabel[128] ;
1818 snprintf(newLabel,128,
"file%03d",fileSeqNum) ;
1819 if (indexCat->
defineType(newLabel,fileSeqNum)) {
1820 oocoutE(data.get(),
DataHandling) <<
"RooDataSet::read: Error, cannot register automatic type name " << newLabel
1821 <<
" in index category " << indexCat->
GetName() << endl ;
1829 oocoutI(data.get(),
DataHandling) <<
"RooDataSet::read: reading file " << filename << endl ;
1832 TString fullName(commonPath) ;
1833 fullName.
Append(filename) ;
1834 ifstream
file(fullName) ;
1838 << filename <<
"'. Returning nullptr now." << endl;
1844 Bool_t haveBlindString(
false) ;
1846 while(
file.good() && !
file.eof()) {
1851 if (
file.peek() ==
'#') {
1867 blindCat->
setIndex(haveBlindString) ;
1873 while (isspace(
file.peek())) {
1875 file >> std::noskipws >> dummy >> std::skipws;
1889 for (
const auto& nameIdx : *indexCat) {
1890 origIndexCat->
defineType(nameIdx.first, nameIdx.second);
1894 <<
" events (ignored " << outOfRange <<
" out of range events)" << endl;
1896 return data.release();
1911 ofstream ofs(filename) ;
1936 coutW(
DataHandling) <<
"RooDataSet::write(" <<
GetName() <<
"): WARNING error(s) have occured in writing" << endl ;
1954 os <<
indent <<
" Dataset variable \"" <<
_wgtVar->
GetName() <<
"\" is interpreted as the event weight" << endl ;
2023 void RooDataSet::Streamer(
TBuffer &R__b)
2046 RooAbsData::Streamer(R__b);
2047 TTree* X_tree(0) ; R__b >> X_tree;
2048 RooArgSet X_truth ; X_truth.Streamer(R__b);
2049 TString X_blindString ; X_blindString.Streamer(R__b);
2060 RooDirItem::Streamer(R__b);
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
void removeFromDir(TObject *obj)
Remove object from directory it was added to.
void getBatches(RooBatchCompute::RunContext &evalData, std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const override
Write information to retrieve data columns into evalData.spans.
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const =0
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to an owning set.
const RooArgSet & cachedVars() const
virtual void setVal(Double_t value)
Set value of variable to 'value'.
virtual RooAbsData * cacheClone(const RooAbsArg *newCacheOwner, const RooArgSet *newCacheVars, const char *newName=0) override
Return a clone of this dataset containing only the cached variables.
virtual TList * GetList() const
void convertToTreeStore() override
Convert vector-based storage to tree-based storage.
virtual Bool_t isWeighted() const =0
RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add clone of specified element to an owning set.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
virtual void SetName(const char *name)
Set the name of the TNamed.
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual Double_t getMax(const char *name=0) const
Get maximum of currently defined range.
MemPoolForRooSets< RooDataSet, 5 *150 > MemPool
TString & Prepend(const char *cs)
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
2-D histogram with a float per channel (see TH1 documentation)}
const char * Data() const
void initialize(const char *wgtVarName)
Initialize the dataset.
char * Form(const char *fmt,...)
virtual const char * GetTitle() const
Returns title of object.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
RooAbsDataStore * _dstore
External variables cached with this data set.
RooArgList is a container object that can hold multiple RooAbsArg objects.
A TTree represents a columnar dataset.
RooDirItem is a utility base class for RooFit objects that are to be attached to ROOT directories.
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
virtual void printValue(std::ostream &os) const override
Print value of the dataset, i.e. the sum of weights contained in the dataset.
virtual void printArgs(std::ostream &os) const override
Print argument of dataset, i.e. the observable names.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
static StorageType defaultStorageType
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
static constexpr double pc
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual Bool_t setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
RooAbsDataStore * store()
static void indent(ostringstream &buf, int indent_level)
Bool_t merge(RooDataSet *data1, RooDataSet *data2=0, RooDataSet *data3=0, RooDataSet *data4=0, RooDataSet *data5=0, RooDataSet *data6=0)
void append(RooDataSet &data)
Add all data points of given data set to this data set.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
void SetName(const char *name) override
Change the name of this dataset into the given name.
Buffer base class used for serializing objects.
virtual void addFast(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0)
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
RooArgSet addWgtVar(const RooArgSet &origVars, const RooAbsArg *wgtVar)
Helper function for constructor that adds optional weight variable to construct total set of observab...
virtual const char * getCurrentLabel() const
Return label string of current state.
bool defineType(const std::string &label)
Define a state with given name.
Iterator abstract base class.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooCompositeDataStore combines several disjunct datasets into one.
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
float type_of_call hi(const int &, const int &)
unsigned short _errorMsgCount
virtual void add(const RooArgSet &row, Double_t weight=1.0, Double_t weightError=0) override
Add a data point, with its coordinates specified in the 'data' argset, to the data set.
virtual RooArgSet * addColumns(const RooArgList &varList)
Add a column with the values of the given list of (function) argument to this dataset.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
The RooDataHist is a container class to hold N-dimensional binned data.
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
virtual Bool_t setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
virtual Double_t sumEntries() const
Double_t getErrorHi() const
virtual const RooArgSet * get() const override
Return a RooArgSet with the coordinates of the current event.
virtual ~RooDataSet()
Destructor.
virtual Bool_t isNonPoissonWeighted() const override
Returns true if histogram contains bins with entries with a non-integer weight.
void variables(TString dataset, TString fin="TMVA.root", TString dirName="InputVariables_Id", TString title="TMVA Input Variables", Bool_t isRegression=kFALSE, Bool_t useTMVAStyle=kTRUE)
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TString & Append(const char *cs)
void setError(Double_t value)
void SetNameTitle(const char *name, const char *title) override
Change the title of this dataset into the given name.
virtual const RooArgSet * get() const
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...
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
virtual RooArgSet * addColumns(const RooArgList &varList)=0
A RooPlot is a plot frame and a container for graphics objects within that frame.
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const override
Print info about this dataset to the specified output stream.
virtual void loadValues(const RooAbsDataStore *tds, const RooFormulaVar *select=0, const char *rangeName=0, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max())=0
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
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 void Add(TObject *arg)
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)=0
bool _doWeightErrorCheck
Counter to silence error messages when filling dataset.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)=0
void appendToDir(TObject *obj, Bool_t forceMemoryResident=kFALSE)
Append object to directory.
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Double_t sumEntries() const override
Return effective number of entries in dataset, i.e., sum all weights.
RooDataSet()
Default constructor for persistence.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void writeToStream(std::ostream &os, Bool_t compact, const char *section=0) const
Write the contents of the argset in ASCII form to given stream.
RooTreeDataStore is a TTree-backed data storage.
virtual TObject * Next()=0
Int_t Fill(Double_t)
Invalid Fill method.
virtual Double_t weight() const =0
Memory pool for RooArgSet and RooDataSet.
virtual Bool_t isWeighted() const override
Return true if dataset contains weighted events.
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
std::vector< std::string > tokenise(const std::string &str, const std::string &delims, bool returnEmptyToken=true)
Tokenise the string by splitting at the characters in delims.
static RooDataSet * read(const char *filename, const RooArgList &variables, const char *opts="", const char *commonPath="", const char *indexCatName=0)
Read given list of ascii files, and construct a data set, using the given ArgList as structure defini...
virtual Double_t weightSquared() const override
Return squared event weight of current event.
virtual void checkInit() const
virtual void append(RooAbsDataStore &other)=0
virtual TObject * Remove(TObject *obj)
Remove object from the list.
RooCategory is an object to represent discrete states.
virtual RooPlot * plotOnXY(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Special plot method for 'X-Y' datasets used in fitting.
static MemPool * memPool()
RooVectorDataStore uses std::vectors to store data columns.
virtual void Add(TObject *obj)
Mother of all ROOT objects.
RooDataHist * binnedClone(const char *newName=0, const char *newTitle=0) const
Return binned clone of this dataset.
void setAttribute(const Text_t *name, Bool_t value=kTRUE)
Set (default) or clear a named boolean attribute of this object.
bool hasLabel(const std::string &label) const
Check if a state with name label exists.
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooRealVar fundamental object with our properties.
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Replace all direct servers of this object with the new servers in newServerList.
Bool_t dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=0, Bool_t valueOnly=kFALSE) const
Test whether we depend on (ie, are served by) any object in the specified collection.
virtual RooAbsData * emptyClone(const char *newName=0, const char *newTitle=0, const RooArgSet *vars=0, const char *wgtVarName=0) const override
Return an empty clone of this dataset.
RooDataSet is a container class to hold unbinned data.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
void loadValues(const TTree *t, const RooFormulaVar *select=0, const char *rangeName=0, Int_t nStart=0, Int_t nStop=2000000000)
Load values from tree 't' into this data collection, optionally selecting events using the RooFormula...
virtual Int_t getBins(const char *name=0) const
Get number of bins of currently defined range.
void setAsymError(Double_t lo, Double_t hi)
virtual const char * GetName() const
Returns name of object.
Double_t getErrorLo() const
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Internal method – Attach dataset copied with cache contents to copied instances of functions.
RooAbsData * reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=0, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max(), Bool_t copyCache=kTRUE) override
Implementation of RooAbsData virtual method that drives the RooAbsData::reduce() methods.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
void ToLower()
Change string to lower-case.
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...
void attachToStore(RooAbsDataStore &store)
Attach this argument to the data store such that it reads data from there.
RooAbsRealLValue * getPlotVar() const
std::unordered_map< const RooAbsReal *, RooSpan< const double > > spans
Once an object has computed its value(s), the span pointing to the results is registered here.
Data that has to be passed around when evaluating functions / PDFs.
TH1 * createHistogram(const char *name, const RooAbsRealLValue &xvar, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) c...
A simple container to hold a batch of data values.
virtual void weightError(Double_t &lo, Double_t &hi, ErrorType etype=SumW2) const override
Return asymmetric error on weight. (Dummy implementation returning zero)
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const override
RooArgSet is a container object that can hold multiple RooAbsArg objects.
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout.
virtual Double_t weight() const override
Return event weight of current event.
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)
Add a column with the values of the given (function) argument to this dataset.
void setAttribAll(const Text_t *name, Bool_t value=kTRUE)
Set given attribute in each element of the collection by calling each elements setAttribute() functio...
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const =0
Bool_t write(const char *filename) const
Write the contents of this dataset to an ASCII file with the specified name.