84#if (__GNUC__==3&&__GNUC_MINOR__==2&&__GNUC_PATCHLEVEL__==3)
92#ifndef USEMEMPOOLFORDATASET
121void* RooDataSet::operator
new (
size_t bytes)
126 return memPool()->allocate(bytes);
134void RooDataSet::operator
delete (
void* ptr)
137 if (memPool()->deallocate(ptr))
140 std::cerr << __func__ <<
" " << ptr <<
" is not in any of the pools." << std::endl;
143 ::operator
delete(ptr);
200 RooAbsData(
name,title,
RooArgSet(vars,(
RooAbsArg*)
RooCmdConfig::decodeObjOnTheFly(
"RooDataSet::RooDataSet",
"IndexCat",0,0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)))
204 pc.defineInt(
"ownLinked",
"OwnLinked",0) ;
205 pc.defineObject(
"impTree",
"ImportTree",0) ;
206 pc.defineObject(
"impData",
"ImportData",0) ;
207 pc.defineObject(
"indexCat",
"IndexCat",0) ;
208 pc.defineObject(
"impSliceData",
"ImportDataSlice",0,0,
kTRUE) ;
209 pc.defineString(
"impSliceState",
"ImportDataSlice",0,
"",
kTRUE) ;
210 pc.defineObject(
"lnkSliceData",
"LinkDataSlice",0,0,
kTRUE) ;
211 pc.defineString(
"lnkSliceState",
"LinkDataSlice",0,
"",
kTRUE) ;
212 pc.defineString(
"cutSpec",
"CutSpec",0,
"") ;
213 pc.defineObject(
"cutVar",
"CutVar",0) ;
214 pc.defineString(
"cutRange",
"CutRange",0,
"") ;
215 pc.defineString(
"wgtVarName",
"WeightVarName",0,
"") ;
216 pc.defineInt(
"newWeight1",
"WeightVarName",0,0) ;
217 pc.defineString(
"fname",
"ImportFromFile",0,
"") ;
218 pc.defineString(
"tname",
"ImportFromFile",1,
"") ;
219 pc.defineObject(
"wgtVar",
"WeightVar",0) ;
220 pc.defineInt(
"newWeight2",
"WeightVar",0,0) ;
221 pc.defineObject(
"dummy1",
"ImportDataSliceMany",0) ;
222 pc.defineObject(
"dummy2",
"LinkDataSliceMany",0) ;
223 pc.defineSet(
"errorSet",
"StoreError",0) ;
224 pc.defineSet(
"asymErrSet",
"StoreAsymError",0) ;
225 pc.defineMutex(
"ImportTree",
"ImportData",
"ImportDataSlice",
"LinkDataSlice",
"ImportFromFile") ;
226 pc.defineMutex(
"CutSpec",
"CutVar") ;
227 pc.defineMutex(
"WeightVarName",
"WeightVar") ;
228 pc.defineDependency(
"ImportDataSlice",
"IndexCat") ;
229 pc.defineDependency(
"LinkDataSlice",
"IndexCat") ;
230 pc.defineDependency(
"OwnLinked",
"LinkDataSlice") ;
247 TTree* impTree =
static_cast<TTree*
>(
pc.getObject(
"impTree")) ;
250 const char* cutSpec =
pc.getString(
"cutSpec",
"",
kTRUE) ;
251 const char* cutRange =
pc.getString(
"cutRange",
"",
kTRUE) ;
252 const char* wgtVarName =
pc.getString(
"wgtVarName",
"",
kTRUE) ;
254 const char* impSliceNames =
pc.getString(
"impSliceState",
"",
kTRUE) ;
256 const char* lnkSliceNames =
pc.getString(
"lnkSliceState",
"",
kTRUE) ;
260 RooArgSet* asymErrorSet =
pc.getSet(
"asymErrSet") ;
261 const char* fname =
pc.getString(
"fname") ;
262 const char* tname =
pc.getString(
"tname") ;
263 Int_t ownLinked =
pc.getInt(
"ownLinked") ;
264 Int_t newWeight =
pc.getInt(
"newWeight1") +
pc.getInt(
"newWeight2") ;
270 map<string,RooAbsData*> hmap ;
273 strlcpy(tmp, lnkSliceNames, 64000);
274 char *token = strtok(tmp,
",");
278 token = strtok(0,
",");
286 wgtVarName = wgtVar->
GetName() ;
294 map<string,RooAbsDataStore*> storeMap ;
297 throw std::string(
"RooDataSet::RooDataSet() ERROR in constructor, cannot find index category") ;
299 for (map<string,RooAbsData*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
301 if (indexCat && !indexCat->
hasLabel(hiter->first)) {
305 if (icat && !icat->
hasLabel(hiter->first)) {
308 icat->
setLabel(hiter->first.c_str()) ;
323 wgtVarName = wgtVar->
GetName() ;
327 if (!wgtVar && !wgtVarName && impData && impData->
_wgtVar) {
341 if (wgtVarName && newWeight) {
355 map<string,RooDataSet*> hmap ;
385 delete intAsymErrorSet ;
390 wgtVarName = wgtVar->
GetName() ;
397 if (wgtVarName && *wgtVarName) {
407 }
else if (indexCat) {
421 if (cutSpec && *cutSpec) {
428 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
430 if (!indexCat->
hasLabel(hiter->first)) {
434 if (!icat->
hasLabel(hiter->first)) {
437 icat->
setLabel(hiter->first.c_str()) ;
439 RooFormulaVar cutVarTmp(cutSpec,cutSpec,hiter->second->_vars) ;
443 }
else if (impData) {
448 }
else if (impTree) {
453 tstore->
loadValues(impTree,&cutVarTmp,cutRange);
456 tmpstore.
loadValues(impTree,&cutVarTmp,cutRange) ;
459 }
else if (fname && strlen(fname)) {
464 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
465 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
469 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
470 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
492 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
494 if (!indexCat->
hasLabel(hiter->first)) {
498 if (!icat->
hasLabel(hiter->first)) {
501 icat->
setLabel(hiter->first.c_str()) ;
506 }
else if (impData) {
509 }
else if (impTree) {
515 tmpstore.
loadValues(impTree,cutVar,cutRange) ;
518 }
else if (fname && strlen(fname)) {
522 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
523 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
527 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
528 throw string(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
547 for (map<string,RooDataSet*>::iterator hiter = hmap.begin() ; hiter!=hmap.end() ; ++hiter) {
549 if (!indexCat->
hasLabel(hiter->first)) {
553 if (!icat->
hasLabel(hiter->first)) {
556 icat->
setLabel(hiter->first.c_str()) ;
561 }
else if (impData) {
565 }
else if (impTree || (fname && strlen(fname))) {
567 std::unique_ptr<TFile>
file;
569 if (impTree ==
nullptr) {
572 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' cannot be opened or does not exist" << endl ;
573 throw std::invalid_argument(
Form(
"RooDataSet::ctor(%s) ERROR file %s cannot be opened or does not exist",
GetName(),fname)) ;
576 file->GetObject(tname, impTree);
578 coutE(
InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") ERROR file '" << fname <<
"' does not contain a TTree named '" << tname <<
"'" << endl ;
579 throw std::invalid_argument(
Form(
"RooDataSet::ctor(%s) ERROR file %s does not contain a TTree named %s",
GetName(),fname,tname)) ;
636 const RooArgSet& vars,
const char *cuts,
const char* wgtVarName) :
765 const RooArgSet& vars,
const char* cuts,
const char* wgtVarName) :
807 std::size_t nStart, std::size_t nStop,
Bool_t copyCache,
const char* wgtVarName) :
812 copyCache, wgtVarName);
815 nStop, copyCache, wgtVarName);
833 if (wgtVar) tmp.
add(*wgtVar) ;
849 delete selCacheVars ;
865 if (wgtVarName && vars && !
_wgtVar) {
898 << wgtVarName <<
" not found in set of variables, no weighting will be assigned" << endl ;
901 << wgtVarName <<
" is not of type RooRealVar, no weighting will be assigned" << endl ;
915 std::size_t nStart, std::size_t nStop,
Bool_t copyCache)
1044 carry = (t - sumw) -
y;
1060 if (cutSpec && strlen(cutSpec) > 0) {
1074 if (select && select->
eval()==0.) continue ;
1078 carry = (t - sumw) -
y;
1082 if (select)
delete select ;
1156 }
else if ((wgt != 1. || wgtError != 0.) &&
_errorMsgCount < 5) {
1157 ccoutE(
DataHandling) <<
"An event weight/error was passed but no weight variable was defined"
1158 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1164 &&
fabs(wgt*wgt - wgtError)/wgtError > 1.E-15
1165 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreError")) {
1168 <<
"' does not store errors. Check `StoreError` in the RooDataSet constructor." << std::endl;
1206 ccoutE(
DataHandling) <<
"An event weight was given but no weight variable was defined"
1207 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1212 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreAsymError")) {
1215 <<
"' does not store errors. Check `StoreAsymError` in the RooDataSet constructor." << std::endl;
1258 ccoutE(
DataHandling) <<
"An event weight was given but no weight variable was defined"
1259 <<
" in the dataset '" <<
GetName() <<
"'. The weight will be ignored." << std::endl;
1266 && wgtError != 0. && wgtError != wgt*wgt
1267 && _errorMsgCount < 5 && !_wgtVar->getAttribute(
"StoreError")) {
1270 <<
"' does not store errors. Check `StoreError` in the RooDataSet constructor." << std::endl;
1291 list<RooDataSet*> dsetList ;
1292 if (data1) dsetList.push_back(data1) ;
1293 if (data2) dsetList.push_back(data2) ;
1294 if (data3) dsetList.push_back(data3) ;
1295 if (data4) dsetList.push_back(data4) ;
1296 if (data5) dsetList.push_back(data5) ;
1297 if (data6) dsetList.push_back(data6) ;
1298 return merge(dsetList) ;
1314 for (list<RooDataSet*>::iterator iter = dsetList.begin() ; iter != dsetList.end() ; ++iter) {
1322 list<RooAbsDataStore*> dstoreList ;
1323 for (list<RooDataSet*>::iterator iter = dsetList.begin() ; iter != dsetList.end() ; ++iter) {
1325 dstoreList.push_back((*iter)->store()) ;
1418 static Int_t counter(0) ;
1427 <<
" is not in dataset and is also not dependent on data set" << endl ;
1433 ownPlotVarX =
kTRUE ;
1446 <<
" is not in dataset and is also not dependent on data set" << endl ;
1452 ownPlotVarY =
kTRUE ;
1460 if(0 != cuts && strlen(cuts)) {
1462 if (!select || !select->
ok()) {
1484 for(
Int_t i=0; i < nevent; ++i)
1488 if (select && select->
eval()==0) continue ;
1492 if (ownPlotVarX)
delete plotVarX ;
1493 if (ownPlotVarY)
delete plotVarY ;
1494 if (select)
delete select ;
1539 pc.defineString(
"drawOption",
"DrawOption",0,
"P") ;
1540 pc.defineString(
"histName",
"Name",0,
"") ;
1541 pc.defineInt(
"lineColor",
"LineColor",0,-999) ;
1542 pc.defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1543 pc.defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1544 pc.defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1545 pc.defineInt(
"markerStyle",
"MarkerStyle",0,8) ;
1546 pc.defineDouble(
"markerSize",
"MarkerSize",0,-999) ;
1547 pc.defineInt(
"fillColor",
"FillColor",0,-999) ;
1548 pc.defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1549 pc.defineInt(
"histInvisible",
"Invisible",0,0) ;
1550 pc.defineDouble(
"scaleFactor",
"Rescale",0,1.) ;
1551 pc.defineObject(
"xvar",
"XVar",0,0) ;
1552 pc.defineObject(
"yvar",
"YVar",0,0) ;
1556 pc.process(argList) ;
1562 const char* drawOptions =
pc.getString(
"drawOption") ;
1563 Int_t histInvisible =
pc.getInt(
"histInvisible") ;
1564 const char* histName =
pc.getString(
"histName",0,
kTRUE) ;
1565 Double_t scaleFactor =
pc.getDouble(
"scaleFactor") ;
1574 coutE(
InputArguments) <<
"RooDataSet::plotOnXY(" <<
GetName() <<
") ERROR: no YVar() argument specified and dataset is not weighted" << endl ;
1579 if (yvar && !dataY) {
1580 coutE(
InputArguments) <<
"RooDataSet::plotOnXY(" <<
GetName() <<
") ERROR on YVar() argument, dataset does not contain a variable named " << yvar->
GetName() << endl ;
1588 graph->SetName(histName) ;
1607 graph->addBinWithXYError(
x,
y,-1*exlo,exhi,-1*eylo,eyhi,scaleFactor) ;
1611 Int_t lineColor =
pc.getInt(
"lineColor") ;
1612 Int_t lineStyle =
pc.getInt(
"lineStyle") ;
1613 Int_t lineWidth =
pc.getInt(
"lineWidth") ;
1614 Int_t markerColor =
pc.getInt(
"markerColor") ;
1615 Int_t markerStyle =
pc.getInt(
"markerStyle") ;
1616 Size_t markerSize =
pc.getDouble(
"markerSize") ;
1617 Int_t fillColor =
pc.getInt(
"fillColor") ;
1618 Int_t fillStyle =
pc.getInt(
"fillStyle") ;
1620 if (lineColor!=-999)
graph->SetLineColor(lineColor) ;
1621 if (lineStyle!=-999)
graph->SetLineStyle(lineStyle) ;
1622 if (lineWidth!=-999)
graph->SetLineWidth(lineWidth) ;
1623 if (markerColor!=-999)
graph->SetMarkerColor(markerColor) ;
1624 if (markerStyle!=-999)
graph->SetMarkerStyle(markerStyle) ;
1625 if (markerSize!=-999)
graph->SetMarkerSize(markerSize) ;
1626 if (fillColor!=-999)
graph->SetFillColor(fillColor) ;
1627 if (fillStyle!=-999)
graph->SetFillStyle(fillStyle) ;
1687 const char *verbOpt,
const char* commonPath,
1688 const char* indexCatName) {
1696 blindState =
new RooCategory(
"blindState",
"Blinding State") ;
1702 <<
"a non-RooCategory blindState member" << endl ;
1706 <<
"blindState category in variable list" << endl ;
1721 auto data = std::make_unique<RooDataSet>(
"dataset", fileList,
variables);
1722 if (ownIsBlind) {
variables.remove(*blindState) ;
delete blindState ; }
1730 blindCat = (
RooCategory*) data->_vars.find(
"blindState") ;
1737 tmp = data->_vars.find(indexCatName) ;
1740 << indexCatName <<
" in supplied variable list" << endl ;
1745 <<
" is not a RooCategory" << endl ;
1755 Int_t outOfRange(0) ;
1758 Int_t fileSeqNum(0);
1764 const char *catname = strchr(filename.c_str(),
':');
1780 char newLabel[128] ;
1781 snprintf(newLabel,128,
"file%03d",fileSeqNum) ;
1782 if (indexCat->
defineType(newLabel,fileSeqNum)) {
1783 oocoutE(data.get(),
DataHandling) <<
"RooDataSet::read: Error, cannot register automatic type name " << newLabel
1784 <<
" in index category " << indexCat->
GetName() << endl ;
1792 oocoutI(data.get(),
DataHandling) <<
"RooDataSet::read: reading file " << filename << endl ;
1795 TString fullName(commonPath) ;
1796 fullName.
Append(filename) ;
1797 ifstream
file(fullName) ;
1801 << filename <<
"'. Returning nullptr now." << endl;
1807 Bool_t haveBlindString(
false) ;
1809 while(
file.good() && !
file.eof()) {
1814 if (
file.peek() ==
'#')
1829 if(
file.eof()) break ;
1839 blindCat->
setIndex(haveBlindString) ;
1854 for (
const auto& nameIdx : *indexCat) {
1855 origIndexCat->
defineType(nameIdx.first, nameIdx.second);
1859 <<
" events (ignored " << outOfRange <<
" out of range events)" << endl;
1861 return data.release();
1876 ofstream ofs(filename) ;
1901 coutW(
DataHandling) <<
"RooDataSet::write(" <<
GetName() <<
"): WARNING error(s) have occured in writing" << endl ;
1919 os <<
indent <<
" Dataset variable \"" <<
_wgtVar->
GetName() <<
"\" is interpreted as the event weight" << endl ;
1988void RooDataSet::Streamer(
TBuffer &R__b)
2011 RooAbsData::Streamer(R__b);
2012 TTree* X_tree(0) ; R__b >> X_tree;
2013 RooArgSet X_truth ; X_truth.Streamer(R__b);
2014 TString X_blindString ; X_blindString.Streamer(R__b);
2025 RooDirItem::Streamer(R__b);
static void indent(ostringstream &buf, int indent_level)
float type_of_call hi(const int &, const int &)
char * Form(const char *fmt,...)
TString operator+(const TString &s1, const TString &s2)
Use the special concatenation constructor.
Memory pool for RooArgSet and RooDataSet.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
void attachToStore(RooAbsDataStore &store)
Attach this argument to the data store such that it reads data from there.
Bool_t redirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t isRecursionStep=kFALSE)
Substitute our servers with those listed in newSet.
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 TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
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.
virtual const char * getCurrentLabel() const
Return label string of current state.
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...
void assignFast(const RooAbsCollection &other, Bool_t setValDirty=kTRUE)
Functional equivalent of operator=() but assumes this and other collection have same layout.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
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 Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
TIterator * createIterator(Bool_t dir=kIterForward) const
TIterator-style iteration over contained elements.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsDataStore is the abstract base class for data collection that use a TTree as internal storage m...
const RooArgSet & cachedVars() const
virtual void append(RooAbsDataStore &other)=0
virtual Double_t sumEntries() const
virtual void checkInit() const
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 Double_t weight() const =0
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const
Get the weights of the events in the range [first, first+size).
virtual Double_t weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const =0
virtual RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList)=0
virtual RooArgSet * addColumns(const RooArgList &varList)=0
virtual Bool_t isWeighted() const =0
virtual RooAbsArg * addColumn(RooAbsArg &var, Bool_t adjustRange=kTRUE)=0
RooAbsData is the common abstract base class for binned and unbinned datasets.
virtual const RooArgSet * get() const
RooAbsDataStore * store()
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
static StorageType defaultStorageType
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Internal method – Attach dataset copied with cache contents to copied instances of functions.
virtual Int_t numEntries() const
RooAbsDataStore * _dstore
External variables cached with this data set.
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 Int_t getBins(const char *name=0) const
Get number of bins of currently defined range.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooRealVar fundamental object with our properties.
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 addOwned(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling addOwned() for each element in the source...
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.
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 is an object to represent discrete states.
bool defineType(const std::string &label)
Define a state with given name.
virtual Bool_t setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
virtual Bool_t setIndex(Int_t index, bool printError=true) override
Set value by specifying the index code of the desired state.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Class RooCmdConfig is a configurable parser for RooCmdArg named arguments.
RooCompositeDataStore combines several disjunct datasets into one.
The RooDataHist is a container class to hold N-dimensional binned data.
RooDataSet is a container class to hold unbinned data.
virtual void weightError(Double_t &lo, Double_t &hi, ErrorType etype=SumW2) const override
Return asymmetric error on weight. (Dummy implementation returning zero)
virtual Bool_t isNonPoissonWeighted() const override
Returns true if histogram contains bins with entries with a non-integer weight.
virtual Bool_t isWeighted() const override
Return true if dataset contains weighted events.
bool _doWeightErrorCheck
Counter to silence error messages when filling dataset.
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.
virtual const RooArgSet * get() const override
Return a RooArgSet with the coordinates of the 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.
virtual Double_t sumEntries() const override
Bool_t write(const char *filename) const
Write the contents of this dataset to an ASCII file with the specified name.
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.
RooArgSet addWgtVar(const RooArgSet &origVars, const RooAbsArg *wgtVar)
Helper function for constructor that adds optional weight variable to construct total set of observab...
void initialize(const char *wgtVarName)
Initialize the dataset.
MemPoolForRooSets< RooDataSet, 5 *150 > MemPool
virtual 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 Double_t weightSquared() const override
Return squared event weight of current event.
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...
TH2F * createHistogram(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, const char *cuts="", const char *name="hist") const
Create a TH2F histogram of the distribution of the specified variable using this dataset.
virtual RooArgSet * addColumns(const RooArgList &varList)
Add a column with the values of the given list of (function) argument to this dataset.
void SetNameTitle(const char *name, const char *title) override
Change the title of this dataset into the given name.
virtual 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.
Bool_t merge(RooDataSet *data1, RooDataSet *data2=0, RooDataSet *data3=0, RooDataSet *data4=0, RooDataSet *data5=0, RooDataSet *data6=0)
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 ~RooDataSet()
Destructor.
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.
unsigned short _errorMsgCount
RooDataHist * binnedClone(const char *newName=0, const char *newTitle=0) const
Return binned clone of this dataset.
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.
static MemPool * memPool()
void convertToTreeStore() override
Convert vector-based storage to tree-based storage.
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const override
Return event weights of all events in range [first, first+len).
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 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.
virtual Double_t weight() const override
Return event weight of current event.
RooDirItem is a utility base class for RooFit objects that are to be attached to ROOT directories.
void appendToDir(TObject *obj, Bool_t forceMemoryResident=kFALSE)
Append object to directory.
void removeFromDir(TObject *obj)
Remove object from directory it was added to.
A RooHist is a graphical representation of binned data based on the TGraphAsymmErrors class.
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
TIterator * MakeIterator(Bool_t forward=kTRUE) const
Create a TIterator for this list.
virtual void Add(TObject *arg)
A RooPlot is a plot frame and a container for graphics objects within that frame.
RooAbsRealLValue * getPlotVar() const
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
RooRealVar represents a variable that can be changed from the outside.
Double_t getErrorHi() const
Double_t getErrorLo() const
void setError(Double_t value)
void setAsymError(Double_t lo, Double_t hi)
virtual void setVal(Double_t value)
Set value of variable to 'value'.
static void activate()
Install atexit handler that calls CleanupRooFitAtExit() on program termination.
A simple container to hold a batch of data values.
RooTreeDataStore is a TTree-backed data storage.
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...
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)=0
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
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
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
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.
2-D histogram with a float per channel (see TH1 documentation)}
Int_t Fill(Double_t)
Invalid Fill method.
Iterator abstract base class.
virtual TObject * Next()=0
virtual void Add(TObject *obj)
virtual TObject * Remove(TObject *obj)
Remove object from the list.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
virtual void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
Mother of all ROOT objects.
void ToLower()
Change string to lower-case.
const char * Data() const
TString & Prepend(const char *cs)
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
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 constexpr double pc
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)