109#ifndef USEMEMPOOLFORDATASET
138void* RooDataSet::operator
new (
size_t bytes)
143 return memPool()->allocate(bytes);
151void 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) ;
233 pc.
defineInt(
"newWeight1",
"WeightVarName",0,0) ;
237 pc.
defineInt(
"newWeight2",
"WeightVar",0,0) ;
240 pc.
defineSet(
"errorSet",
"StoreError",0) ;
241 pc.
defineSet(
"asymErrSet",
"StoreAsymError",0) ;
242 pc.
defineMutex(
"ImportTree",
"ImportData",
"ImportDataSlice",
"LinkDataSlice",
"ImportFromFile") ;
271 const char* impSliceNames = pc.
getString(
"impSliceState",
"",
kTRUE) ;
273 const char* lnkSliceNames = pc.
getString(
"lnkSliceState",
"",
kTRUE) ;
278 const char* fname = pc.
getString(
"fname") ;
279 const char* tname = pc.
getString(
"tname") ;
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)) {
320 coutI(InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") defining state \"" << hiter->first <<
"\" in index category " << indexCat->
GetName() << endl ;
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)) {
449 coutI(InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") defining state \"" << hiter->first <<
"\" in index category " << indexCat->
GetName() << endl ;
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)) {
513 coutI(InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") defining state \"" << hiter->first <<
"\" in index category " << indexCat->
GetName() << endl ;
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)) {
568 coutI(InputArguments) <<
"RooDataSet::ctor(" <<
GetName() <<
") defining state \"" << hiter->first <<
"\" in index category " << indexCat->
GetName() << endl ;
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) {
914 coutE(DataHandling) <<
"RooDataSet::RooDataSet(" <<
GetName() <<
"): designated weight variable "
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.");
918 coutE(DataHandling) <<
"RooDataSet::RooDataSet(" <<
GetName() <<
"): designated weight variable "
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")) {
1200 coutE(DataHandling) <<
"An event weight error was passed to the RooDataSet '" <<
GetName()
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")) {
1247 coutE(DataHandling) <<
"An event weight error was passed to the RooDataSet '" <<
GetName()
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")) {
1302 coutE(DataHandling) <<
"An event weight error was passed to the RooDataSet '" <<
GetName()
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) {
1350 coutE(InputArguments) <<
"RooDataSet::merge(" <<
GetName() <<
") ERROR: datasets have different size" << endl ;
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()) {
1512 coutE(DataHandling) <<
fName <<
"::createHistogram: unable to create a new histogram" << endl;
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 ;
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) ;
1584 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
1585 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1586 pc.
defineInt(
"histInvisible",
"Invisible",0,0) ;
1599 const char* drawOptions = pc.
getString(
"drawOption") ;
1600 Int_t histInvisible = pc.
getInt(
"histInvisible") ;
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) ;
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) {
1731 RooAbsArg* blindState = variables.find(
"blindState") ;
1733 blindState =
new RooCategory(
"blindState",
"Blinding State") ;
1734 variables.add(*blindState) ;
1737 if (blindState->IsA()!=RooCategory::Class()) {
1738 oocoutE((
TObject*)0,DataHandling) <<
"RooDataSet::read: ERROR: variable list already contains"
1739 <<
"a non-RooCategory blindState member" << endl ;
1742 oocoutW((
TObject*)0,DataHandling) <<
"RooDataSet::read: WARNING: recycling existing "
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 ; }
1761 oocoutE((
TObject*)0,DataHandling) <<
"RooDataSet::read: unable to create a new dataset"
1767 blindCat = (
RooCategory*) data->_vars.find(
"blindState") ;
1774 tmp = data->_vars.find(indexCatName) ;
1776 oocoutE(data.get(),DataHandling) <<
"RooDataSet::read: no index category named "
1777 << indexCatName <<
" in supplied variable list" << endl ;
1780 if (tmp->IsA()!=RooCategory::Class()) {
1781 oocoutE(data.get(),DataHandling) <<
"RooDataSet::read: variable " << indexCatName
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) ;
1837 oocoutE(data.get(), DataHandling) <<
"RooDataSet::read: unable to open '"
1838 << filename <<
"'. Returning nullptr now." << endl;
1844 Bool_t haveBlindString(
false) ;
1846 while(
file.good() && !
file.eof()) {
1848 if(debug)
oocxcoutD(data.get(),DataHandling) <<
"reading line " <<
line << endl;
1851 if (
file.peek() ==
'#') {
1852 if(debug)
oocxcoutD(data.get(),DataHandling) <<
"skipping comment on line " <<
line << endl;
1856 data->_vars = variables ;
1860 oocoutE(data.get(), DataHandling) <<
"RooDataSet::read(static): read error at line " <<
line << endl ;
1867 blindCat->
setIndex(haveBlindString) ;
1873 while (isspace(
file.peek())) {
1875 file >> std::noskipws >> dummy >> std::skipws;
1887 assert(
dynamic_cast<RooCategory*
>(variables.find(indexCatName)));
1888 const auto origIndexCat =
static_cast<RooCategory*
>(variables.find(indexCatName));
1889 for (
const auto& nameIdx : *indexCat) {
1890 origIndexCat->
defineType(nameIdx.first, nameIdx.second);
1893 oocoutI(data.get(),DataHandling) <<
"RooDataSet::read: read " << data->numEntries()
1894 <<
" events (ignored " << outOfRange <<
" out of range events)" << endl;
1896 return data.release();
1911 ofstream ofs(filename) ;
1913 coutE(DataHandling) <<
"RooDataSet::write(" <<
GetName() <<
") cannot create file " << filename << endl ;
1918 coutI(DataHandling) <<
"RooDataSet::write(" <<
GetName() <<
") writing ASCII file " << filename << endl ;
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 ;
2023void 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);
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
Memory pool for RooArgSet and RooDataSet.
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
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)
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 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...
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len) const =0
const RooArgSet & cachedVars() const
virtual void append(RooAbsDataStore &other)=0
virtual Double_t sumEntries() const
virtual RooBatchCompute::RunContext getBatches(std::size_t first, std::size_t len) const =0
Retrieve batches for all observables in this data store.
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 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
Return number of entries in dataset, i.e., count unweighted entries.
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.
Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to non-owning set.
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.
RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE) override
Add clone of specified element to an owning set.
Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE) override
Add element to an owning set.
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.
TObject * getObject(const char *name, TObject *obj=0)
Return TObject property registered with name 'name'.
Bool_t defineInt(const char *name, const char *argName, Int_t intNum, Int_t defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void defineMutex(const char *argName1, const char *argName2)
Define arguments named argName1 and argName2 mutually exclusive.
Bool_t defineObject(const char *name, const char *argName, Int_t setNum, const TObject *obj=0, Bool_t isArray=kFALSE)
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_t convEmptyToNull=kFALSE)
Return string property registered with name 'name'.
Int_t getInt(const char *name, Int_t defaultValue=0)
Return integer property registered with name 'name'.
const RooLinkedList & getObjectList(const char *name)
Return list of objects registered with name 'name'.
Bool_t defineDouble(const char *name, const char *argName, Int_t doubleNum, Double_t defValue=0.)
Define Double_t property name 'name' mapped to Double_t in slot 'doubleNum' in RooCmdArg with name ar...
void defineDependency(const char *refArgName, const char *neededArgName)
Define that processing argument name refArgName requires processing of argument named neededArgName t...
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
Bool_t defineSet(const char *name, const char *argName, Int_t setNum, const RooArgSet *set=0)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
Bool_t defineString(const char *name, const char *argName, Int_t stringNum, const char *defValue="", Bool_t appendMode=kFALSE)
Define Double_t property name 'name' mapped to Double_t in slot 'stringNum' in RooCmdArg with name ar...
RooArgSet * getSet(const char *name, RooArgSet *set=0)
Return RooArgSet property registered with name 'name'.
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
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
Return effective number of entries in dataset, i.e., sum all weights.
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.
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.
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
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 uses std::vectors to store data columns.
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.
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.
This struct enables passing computation data around between elements of a computation graph.
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.