127static std::map<RooAbsData*,int>
_dcc ;
136 cout <<
"Composite storage is not a valid *default* storage type." << endl;
167 return (
_dcc[data]==0) ;
188 _vars(
"Dataset Variables"),
189 _cachedVars(
"Cached Variables"),
204 for (
const auto var : vars) {
205 if (!var->isFundamental()) {
206 coutE(InputArguments) <<
"RooAbsDataStore::initialize(" <<
GetName()
207 <<
"): Data set cannot contain non-fundamental types, ignoring " << var->GetName()
209 throw std::invalid_argument(std::string(
"Only fundamental variables can be placed into datasets. This is violated for ") + var->GetName());
216 for (
auto var :
_vars) {
229 TNamed(newname ? newname : other.GetName(),other.GetTitle()),
231 _cachedVars(
"Cached Variables"),
232 _namePtr(newname ?
RooNameReg::instance().constPtr(newname) : other._namePtr)
239 for (
auto var :
_vars) {
248 map<string,RooAbsDataStore*> smap ;
252 smap[itero.first] = dclone->
store();
273 RooPrintable::operator=(other);
281 for (
const auto var :
_vars) {
282 var->attachDataSet(*
this) ;
290 map<string,RooAbsDataStore*> smap ;
294 smap[itero.first] = dclone->
store();
341 delete iter->second ;
466 pc.
defineInt(
"evtStart",
"EventRange",0,0) ;
467 pc.
defineInt(
"evtStop",
"EventRange",1,std::numeric_limits<int>::max()) ;
472 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
482 Int_t nStop = pc.
getInt(
"evtStop",std::numeric_limits<int>::max()) ;
490 varSubset.
add(*varSet) ;
491 for (
const auto arg : varSubset) {
493 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
494 << arg->GetName() <<
" not in dataset, ignored" << endl ;
518 if (!ret)
return nullptr;
565 for (
const auto arg : varSubset) {
567 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
568 << arg->GetName() <<
" not in dataset, ignored" << endl ;
574 if (cut && strlen(cut)>0) {
576 ret =
reduceEng(varSubset2,&cutVar,0,0,std::numeric_limits<std::size_t>::max(),
false);
578 ret =
reduceEng(varSubset2,0,0,0,std::numeric_limits<std::size_t>::max(),
false);
597 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
598 << arg->GetName() <<
" not in dataset, ignored" << endl ;
632 const auto varNames =
ROOT::Split(varNameList,
",:");
634 RooRealVar* vars[3] = {
nullptr,
nullptr,
nullptr};
636 for (
unsigned int i = 0; i < varNames.size(); ++i) {
638 coutW(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
"): Can only create 3-dimensional histograms. Variable "
639 << i <<
" " << varNames[i] <<
" unused." << std::endl;
645 coutE(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
") ERROR: dataset does not contain an observable named " << varNames[i] << std::endl;
651 coutE(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
"): No variable to be histogrammed in list '" << varNameList <<
"'" << std::endl;
655 if (xbins<=0 || !vars[0]->hasMax() || !vars[0]->hasMin() ) {
662 if (ybins<=0 || !vars[1]->hasMax() || !vars[1]->
hasMin() ) {
669 if (zbins<=0 || !vars[2]->hasMax() || !vars[2]->
hasMin() ) {
767 ownedCmds.
Add(bincmd) ;
768 argList.
Replace(autoRD,bincmd) ;
779 ((
RooCmdArg*)argList.
find(
"YVar"))->subArgs().Replace(autoRDY,bincmd) ;
792 ((
RooCmdArg*)argList.
find(
"ZVar"))->subArgs().Replace(autoRDZ,bincmd) ;
814 string prodName(
"(") ;
820 if (varsArg != 0) catSet2.
add(*varsArg) ;
821 else catSet2.
add(*arg) ;
822 if (prodName.length()>1) {
827 coutW(InputArguments) <<
"RooAbsData::table(" <<
GetName() <<
") non-RooAbsCategory input argument " << arg->
GetName() <<
" ignored" << endl ;
834 return table(tmp,cuts,opts) ;
858 os << IsA()->GetName() ;
888 if (order==1)
return 0 ;
889 if (order==2)
return 1 ;
907 return moment(var,order,offset,cutSpec,cutRange) ;
922 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") ERROR: unknown variable: " << var.
GetName() << endl ;
926 auto varPtr =
dynamic_cast<const RooRealVar*
>(arg);
929 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") ERROR: variable " << var.
GetName() <<
" is not of type RooRealVar" << endl ;
935 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") WARNING: empty dataset" << endl ;
940 std::unique_ptr<RooFormula> select;
950 if (select && select->eval()==0) continue ;
951 if (cutRange && vars->
allInRange(cutRange)) continue ;
967 coutE(InputArguments) <<
"RooDataSet::" << methodname <<
"(" <<
GetName() <<
") ERROR: variable : " << extVar.
GetName() <<
" is not in data" << endl ;
972 coutE(InputArguments) <<
"RooDataSet::" << methodname <<
"(" <<
GetName() <<
") ERROR: variable : " << extVar.
GetName() <<
" is not of type RooRealVar in data" << endl ;
986 if (!xdata||!ydata)
return 0 ;
990 coutW(InputArguments) <<
"RooDataSet::" << (corr?
"correlation":
"covariance") <<
"(" <<
GetName() <<
") WARNING: empty dataset, returning zero" << endl ;
998 Double_t xysum(0),xsum(0),ysum(0),x2sum(0),y2sum(0);
1002 if (select && select->
eval()==0) continue ;
1003 if (cutRange && vars->
allInRange(cutRange)) continue ;
1007 ysum +=
weight()*ydata->getVal() ;
1010 y2sum +=
weight()*ydata->getVal()*ydata->getVal() ;
1024 if (select)
delete select ;
1028 return (xysum-xsum*ysum)/(sqrt(x2sum-(xsum*xsum))*sqrt(y2sum-(ysum*ysum))) ;
1030 return (xysum-xsum*ysum);
1048 varList.
add(*datavar) ;
1055 coutW(InputArguments) <<
"RooDataSet::covariance(" <<
GetName() <<
") WARNING: empty dataset, returning zero" << endl ;
1066 vector<double> xsum(varList.
getSize()) ;
1067 vector<double> x2sum(varList.
getSize()) ;
1072 if (select && select->
eval()==0) continue ;
1073 if (cutRange && dvars->
allInRange(cutRange)) continue ;
1084 *iter2=*iter ; iy=ix ;
1088 xysum(iy,ix) = xysum(ix,iy) ;
1104 xysum(ix,iy) /=
sumEntries(cutSpec, cutRange) ;
1112 (*C)(ix,iy) = xysum(ix,iy)-xsum[ix]*xsum[iy] ;
1114 (*C)(ix,iy) /= sqrt((x2sum[ix]-(xsum[ix]*xsum[ix]))*(x2sum[iy]-(xsum[iy]*xsum[iy]))) ;
1119 if (select)
delete select ;
1140 name.Append(
"Mean");
1246 pc.
defineInt(
"dummy",
"FormatArgs",0,0) ;
1257 const char* label = pc.
getString(
"label") ;
1261 const char* formatStr = pc.
getString(
"formatStr") ;
1270 return statOn(frame,
what,label,0,0,
xmin,
xmax,
ymax,cutSpec,cutRange,formatCmd) ;
1281 const char* cutSpec,
const char* cutRange,
const RooCmdArg* formatCmd)
1283 Bool_t showLabel= (label != 0 && strlen(label) > 0);
1297 if(showLabel)
ymin-= dy;
1303 box->SetFillColor(0);
1304 box->SetBorderSize(1);
1305 box->SetTextAlign(12);
1306 box->SetTextSize(0.04F);
1307 box->SetFillStyle(1001);
1311 N.setPlotLabel(
"Entries") ;
1316 TString *rmsText, *meanText, *NText ;
1318 rmsText= rms->
format(sigDigits,options);
1319 meanText= meanv->
format(sigDigits,options);
1320 NText=
N.format(sigDigits,options);
1322 rmsText= rms->
format(*formatCmd);
1323 meanText= meanv->
format(*formatCmd);
1324 NText=
N.format(*formatCmd);
1326 if (showR)
box->AddText(rmsText->
Data());
1327 if (showM)
box->AddText(meanText->
Data());
1328 if (showN)
box->AddText(NText->
Data());
1338 if(showLabel)
box->AddText(label);
1354 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: no valid histogram to fill" << endl;
1360 if(hdim != plotVars.
getSize()) {
1361 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: plotVars has the wrong dimension" << endl;
1369 for(
Int_t index= 0; index < plotVars.
getSize(); index++) {
1374 <<
"\" of type " << var->
ClassName() << endl;
1383 <<
":fillHistogram: Data does not contain the variable '" << realVar->
GetName() <<
"'." << endl;
1389 localVars.
add(*clone);
1392 localVars.
add(*found);
1397 std::unique_ptr<RooFormula> select;
1398 if (cuts !=
nullptr && strlen(cuts) > 0) {
1400 if (!select || !select->ok()) {
1401 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: invalid cuts \"" << cuts <<
"\"" << endl;
1424 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: cannot fill histogram with "
1425 << hdim <<
" dimensions" << endl;
1430 const auto cutVec =
ROOT::Split(cutRange ? cutRange :
"",
",");
1437 for(
Int_t i=0; i < nevent; ++i) {
1444 if (select && select->eval()==0) {
1452 for (
const auto arg :
_vars) {
1454 for (
auto const& cut : cutVec) {
1455 if (!cut.empty() && arg->inRange(cut.c_str())) {
1456 selectThisArg =
kTRUE ;
1460 if (!selectThisArg) {
1467 if (!selectByRange) {
1494 if (we==0) we =
weight() ;
1528 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") ERROR category " << splitCat.
GetName()
1529 <<
" doesn't depend on any variable in this dataset" << endl ;
1539 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") Couldn't deep-clone splitting category, abort." << endl ;
1547 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") ERROR category " << splitCat.
GetName()
1548 <<
" is fundamental and does not appear in this dataset" << endl ;
1570 RooRealVar newweight(
"weight",
"weight",-1e9,1e9) ;
1572 subsetVars.
add(newweight) ;
1577 if (createEmptyDataSets) {
1578 for (
const auto& nameIdx : *cloneCat) {
1579 RooAbsData* subset =
emptyClone(nameIdx.first.c_str(), nameIdx.first.c_str(), &subsetVars,(addWV?
"weight":0)) ;
1594 if (!propWeightSquared) {
1619 if (!splitCat.dependsOn(*
get())) {
1620 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") ERROR category " << splitCat.
GetName()
1621 <<
" doesn't depend on any variable in this dataset" << endl ;
1627 std::unique_ptr<RooArgSet> cloneSet;
1628 if (splitCat.isDerived()) {
1631 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") Couldn't deep-clone splitting category, abort." << endl ;
1634 cloneCat = (
RooAbsCategory*) cloneSet->find(splitCat.GetName()) ;
1639 coutE(InputArguments) <<
"RooTreeData::split(" <<
GetName() <<
") ERROR category " << splitCat.
GetName()
1640 <<
" is fundamental and does not appear in this dataset" << endl ;
1651 if (splitCat.isDerived()) {
1652 std::unique_ptr<RooArgSet> vars{splitCat.getVariables()};
1661 RooRealVar newweight(
"weight",
"weight",-1e9,1e9) ;
1663 subsetVars.
add(newweight) ;
1669 auto getPdfObservables = [
this, &simpdf](
const char * label) {
1672 catPdf->getObservables(this->
get(), obsSet);
1679 for(
const auto& catPair : splitCat) {
1680 allObservables.
add(getPdfObservables(catPair.first.c_str()));
1686 if (createEmptyDataSets) {
1687 for (
const auto& nameIdx : *cloneCat) {
1690 subsetVarsCat.
add(getPdfObservables(nameIdx.first.c_str()));
1691 RooAbsData* subset =
emptyClone(nameIdx.first.c_str(), nameIdx.first.c_str(), &subsetVarsCat,(addWV?
"weight":0)) ;
1692 dsetList->
Add(subset) ;
1707 dsetList->
Add(subset);
1709 if (!propWeightSquared) {
1822 pc.
defineInt(
"nbins",
"BinningSpec",0,100) ;
1827 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
1828 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1829 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1830 pc.
defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1831 pc.
defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
1833 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
1834 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1836 pc.
defineInt(
"histInvisible",
"Invisible",0,0) ;
1837 pc.
defineInt(
"refreshFrameNorm",
"RefreshNorm",0,1) ;
1843 pc.
defineMutex(
"DataError",
"Asymmetry",
"Efficiency") ;
1844 pc.
defineMutex(
"Binning",
"BinningName",
"BinningSpec") ;
1884 coutI(InputArguments) <<
"RooAbsData::plotOn(" <<
GetName()
1885 <<
") INFO: dataset has non-integer weights, auto-selecting SumW2 errors instead of Poisson errors" << endl ;
1891 <<
" to add to in RooPlot" << endl ;
1896 if (!asymCat && !effCat) {
1898 }
else if (asymCat) {
1949 <<
":plotOn: frame does not specify a plot variable" << endl;
1955 histName.
Append(
"_plot");
1956 std::unique_ptr<TH1> hist;
1972 <<
":plotOn: fillHistogram() failed" << endl;
1989 <<
":plotOn: unable to create a RooHist object" << endl;
2005 coutI(Plotting) <<
"RooTreeData::plotOn: plotting " << hist->GetSumOfWeights() <<
" events out of " << nEnt <<
" total events" << endl ;
2006 graph->setRawEntries(nEnt) ;
2013 if (!
graph->hasIdenticalBinning(*otherGraph)) {
2014 coutE(Plotting) <<
"RooTreeData::plotOn: ERROR Histogram to be added to, '" << o.
addToHistName <<
"',has different binning" << endl ;
2071 <<
":plotAsymOn: frame does not specify a plot variable" << endl;
2077 hist1Name.Append(
"_plot1");
2078 std::unique_ptr<TH1> hist1, hist2;
2079 hist2Name.
Append(
"_plot2");
2093 assert(hist1 && hist2);
2107 <<
":plotAsymOn: createHistogram() failed" << endl;
2161 <<
":plotEffOn: frame does not specify a plot variable" << endl;
2167 hist1Name.Append(
"_plot1");
2168 std::unique_ptr<TH1> hist1, hist2;
2169 hist2Name.
Append(
"_plot2");
2183 assert(hist1 && hist2);
2197 <<
":plotEffOn: createHistogram() failed" << endl;
2246 <<
" is not in dataset and is also not dependent on data set" << endl ;
2253 coutE(Plotting) <<
"RooTreeData::table(" <<
GetName() <<
") Couldn't deep-clone table category, abort." << endl ;
2257 ownPlotVar =
kTRUE ;
2264 if (cuts && strlen(cuts)) {
2273 if (cuts && strlen(cuts)) {
2279 for(
Int_t i=0; i < nevent; ++i) {
2282 if (cutVar && cutVar->
getVal()==0) continue ;
2287 if (ownPlotVar)
delete tableSet ;
2288 if (cutVar)
delete cutVar ;
2303 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") ERROR: unknown variable: " << var.
GetName() << endl ;
2307 auto varPtr =
dynamic_cast<const RooRealVar*
>(arg);
2310 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") ERROR: variable " << var.
GetName() <<
" is not of type RooRealVar" << endl ;
2316 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") WARNING: empty dataset" << endl ;
2325 if (varPtr->getVal()<lowest) {
2326 lowest = varPtr->getVal() ;
2328 if (varPtr->getVal()>highest) {
2329 highest = varPtr->getVal() ;
2336 Double_t margin = marginFrac*(highest-lowest) ;
2345 Double_t delta = ((highest-mom1)>(mom1-lowest)?(highest-mom1):(mom1-lowest))*(1+marginFrac) ;
2346 lowest = mom1-delta ;
2347 highest = mom1+delta ;
2377 pruneSet.
add(*var) ;
2388 for(
auto const* rrv : dynamic_range_cast<RooRealVar*>(*usedObs)) {
2389 if (rrv && !rrv->getBinning().isShareable()) {
2391 RooAbsReal* loFunc = rrv->getBinning().lowBoundFunc() ;
2392 RooAbsReal* hiFunc = rrv->getBinning().highBoundFunc() ;
2413 cxcoutI(Optimization) <<
"RooTreeData::optimizeReadingForTestStatistic(" <<
GetName() <<
"): Observables " << pruneSet
2414 <<
" in dataset are either not used at all, orserving exclusively p.d.f nodes that are now cached, disabling reading of these observables for TTree" << endl ;
2432 if (!cacheList.
find(client->GetName())) {
2438 return anyClient?ret:
kFALSE ;
2484void RooAbsData::Streamer(
TBuffer &R__b)
2532 coutW(InputArguments) <<
"RooAbsData::tree(" <<
GetName() <<
") WARNING: is not of StorageType::Tree. "
2533 <<
"Use GetClonedTree() instead or convert to tree storage." << endl;
2534 return (
TTree *)
nullptr;
2573 if (iter.second == obj) {
2574 iter.second =
nullptr;
2590 arg->setAttribute(
"global",
true);
2592 if(
auto lval =
dynamic_cast<RooAbsRealLValue*
>(arg)) lval->setConstant(
true);
2630 if (eventWeights.
empty()) {
2635 for (std::size_t i = 0; i < eventWeights.
size(); ++i) {
2638 return kahanWeight.
Sum();
static std::map< RooAbsData *, int > _dcc
TMatrixTSym< Double_t > TMatrixDSym
static void indent(ostringstream &buf, int indent_level)
char * Form(const char *fmt,...)
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
void AddIndexed(T input, std::size_t index)
Add input to the sum.
Roo1DTable implements a one-dimensional table.
virtual void fill(RooAbsCategory &cat, Double_t weight=1.0)
Increment the counter of the table slot with the name corresponding to that of the current category s...
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
RooArgSet * getObservables(const RooArgSet &set, Bool_t valueOnly=kTRUE) const
Given a set of possible observables, return the observables that this PDF depends on.
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.
void attachArgs(const RooAbsCollection &set)
Bind this node to objects in set.
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=0, Bool_t recurseNonDerived=kFALSE) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
const RefCountList_t & valueClients() const
List of all value clients of this object. Value clients receive value updates.
RooArgSet * getVariables(Bool_t stripDisconnected=kTRUE) const
Return RooArgSet with all variables (tree leaf nodes of expresssion tree)
virtual Bool_t isDerived() const
Does value or shape of this arg depend on any other arg?
Bool_t recursiveRedirectServers(const RooAbsCollection &newServerList, Bool_t mustReplaceAll=kFALSE, Bool_t nameChange=kFALSE, Bool_t recurseInNewSet=kTRUE)
Recursively replace all servers with the new servers in newSet.
void attachDataSet(const RooAbsData &set)
Replace server nodes with names matching the dataset variable names with those data set variables,...
void SetName(const char *name)
Set the name of the TNamed.
RooAbsBinning is the abstract base class for RooRealVar binning definitions.
virtual Bool_t isUniform() const
virtual Double_t averageBinWidth() const =0
RooAbsCategoryLValue is the common abstract base class for objects that represent a discrete value th...
RooAbsCategory is the base class for objects that represent a discrete value with a finite number of ...
virtual const char * getCurrentLabel() const
Return label string of current state.
const std::string & lookupName(value_type index) const
Get the name corresponding to the given index.
Roo1DTable * createTable(const char *label) const
Create a table matching the shape of this category.
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
virtual RooAbsArg * addClone(const RooAbsArg &var, Bool_t silent=kFALSE)
Add a clone of the specified argument to list.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Add the specified argument to list.
Bool_t allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
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 void attachBuffers(const RooArgSet &extObs)=0
virtual Bool_t hasFilledCache() const
virtual RooAbsData::CategorySpans getCategoryBatches(std::size_t, std::size_t) const
virtual Bool_t changeObservableName(const char *from, const char *to)=0
virtual const RooArgSet * get(Int_t index) const =0
virtual void resetBuffers()=0
virtual const TTree * tree() const
virtual void cacheArgs(const RooAbsArg *cacheOwner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kFALSE)=0
virtual void checkInit() const
virtual RooAbsData::RealSpans getBatches(std::size_t first, std::size_t len) const =0
Retrieve batches for all observables in this data store.
virtual RooAbsDataStore * clone(const char *newname=0) const =0
virtual void setDirtyProp(Bool_t flag)
virtual void resetCache()=0
void printMultiline(std::ostream &os, Int_t content, Bool_t verbose, TString indent) const override
Detailed printing interface.
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)=0
virtual void setArgStatus(const RooArgSet &set, Bool_t active)=0
virtual Int_t numEntries() const =0
RooAbsData is the common abstract base class for binned and unbinned datasets.
RooRealVar * meanVar(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Create a RooRealVar containing the mean of observable 'var' in this dataset.
virtual const RooArgSet * get() const
void SetNameTitle(const char *name, const char *title)
Set all the TNamed parameters (name and title).
void SetName(const char *name)
Set the name of the TNamed.
virtual void RecursiveRemove(TObject *obj)
If one of the TObject we have a referenced to is deleted, remove the reference.
RooAbsData()
Default constructor.
static void setDefaultStorageType(StorageType s)
virtual Bool_t changeObservableName(const char *from, const char *to)
CategorySpans getCategoryBatches(std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
RooRealVar * dataRealVar(const char *methodname, const RooRealVar &extVar) const
Internal method to check if given RooRealVar maps to a RooRealVar in this dataset.
virtual Roo1DTable * table(const RooArgSet &catSet, const char *cuts="", const char *opts="") const
Construct table for product of categories in catSet.
void setGlobalObservables(RooArgSet const &globalObservables)
Sets the global observables stored in this data.
RooAbsDataStore * store()
std::map< RooFit::Detail::DataKey, RooSpan< const double > > RealSpans
static Bool_t releaseVars(RooAbsData *)
If return value is true variables can be deleted.
TMatrixDSym * corrcovMatrix(const RooArgList &vars, const char *cutSpec, const char *cutRange, Bool_t corr) const
Return covariance matrix from data for given list of observables.
virtual Bool_t isNonPoissonWeighted() const
virtual TList * split(const RooAbsCategory &splitCat, Bool_t createEmptyDataSets=kFALSE) const
Split dataset into subsets based on states of given splitCat in this dataset.
virtual Double_t sumEntries() const =0
Return effective number of entries in dataset, i.e., sum all weights.
virtual double weightError(ErrorType=Poisson) const
Return the symmetric error on the current weight.
void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
virtual TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts="", const char *cutRange=0) const
Loop over columns of our tree data and fill the input histogram.
virtual RooPlot * statOn(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())
Add a box with statistics information to the specified frame.
virtual RooPlot * plotEffOn(RooPlot *frame, const RooAbsCategoryLValue &effCat, PlotOpt o) const
Create and fill a histogram with the efficiency N[1] / ( N[1] + N[0] ), where N(1/0) is the number of...
RealSpans getBatches(std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
Write information to retrieve data columns into evalData.spans.
virtual void optimizeReadingWithCaching(RooAbsArg &arg, const RooArgSet &cacheList, const RooArgSet &keepObsList)
Prepare dataset for use with cached constant terms listed in 'cacheList' of expression 'arg'.
static void claimVars(RooAbsData *)
virtual Double_t weight() const =0
static StorageType defaultStorageType
virtual Double_t weightSquared() const =0
Double_t standMoment(const RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate standardized moment.
virtual Bool_t isWeighted() const
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
virtual void printName(std::ostream &os) const
Print name of dataset.
virtual RooPlot * plotAsymOn(RooPlot *frame, const RooAbsCategoryLValue &asymCat, PlotOpt o) const
Create and fill a histogram with the asymmetry N[+] - N[-] / ( N[+] + N[-] ), where N(+/-) is the num...
RooAbsData * getSimData(const char *idxstate)
virtual void Draw(Option_t *option="")
Forward draw command to data store.
virtual RooAbsData * reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=0, std::size_t nStart=0, std::size_t=std::numeric_limits< std::size_t >::max(), Bool_t copyCache=kTRUE)=0
void copyGlobalObservables(const RooAbsData &other)
De-duplicated name pointer. This will be equal for all objects with the same name.
RooRealVar * rmsVar(const RooRealVar &var, const char *cutSpec=0, const char *cutRange=0) const
Create a RooRealVar containing the RMS of observable 'var' in this dataset.
double sumEntriesW2() const
Return sum of squared weights of this data.
virtual void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars)
Internal method – Attach dataset copied with cache contents to copied instances of functions.
std::map< RooFit::Detail::DataKey, RooSpan< const RooAbsCategory::value_type > > CategorySpans
Double_t corrcov(const RooRealVar &x, const RooRealVar &y, const char *cutSpec, const char *cutRange, Bool_t corr) const
Internal method to calculate single correlation and covariance elements.
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
virtual RooSpan< const double > getWeightBatch(std::size_t first, std::size_t len, bool sumW2=false) const =0
Return event weights of all events in range [first, first+len).
virtual void add(const RooArgSet &row, Double_t weight=1, Double_t weightError=0)=0
Bool_t getRange(const RooAbsRealLValue &var, Double_t &lowest, Double_t &highest, Double_t marginFrac=0, Bool_t symMode=kFALSE) const
Fill Doubles 'lowest' and 'highest' with the lowest and highest value of observable 'var' in this dat...
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
virtual void convertToTreeStore()
Convert vector-based storage to tree-based storage.
virtual RooPlot * plotOn(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
virtual Int_t defaultPrintContents(Option_t *opt) const
Define default print options, for a given print style.
RooAbsData & operator=(const RooAbsData &other)
Double_t moment(const RooRealVar &var, Double_t order, const char *cutSpec=0, const char *cutRange=0) const
Calculate moment of requested order.
virtual void resetCache()
Internal method – Remove cached function values.
std::unique_ptr< RooArgSet > _globalObservables
Bool_t hasFilledCache() const
TTree * GetClonedTree() const
Return a clone of the TTree which stores the data or create such a tree if vector storage is used.
RooAbsData * reduce(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg())
Create a reduced copy of this dataset.
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=0, Bool_t skipZeroWeights=kFALSE)
Internal method – Cache given set of functions with data.
void attachBuffers(const RooArgSet &extObs)
virtual RooAbsData * emptyClone(const char *newName=0, const char *newTitle=0, const RooArgSet *vars=0, const char *wgtVarName=0) const =0
virtual void setArgStatus(const RooArgSet &set, Bool_t active)
virtual void printClassName(std::ostream &os) const
Print class name of dataset.
std::map< std::string, RooAbsData * > _ownedComponents
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...
static StorageType getDefaultStorageType()
Bool_t canSplitFast() const
virtual void printTitle(std::ostream &os) const
Print title of dataset.
RooAbsDataStore * _dstore
External variables cached with this data set.
const TTree * tree() const
Return a pointer to the TTree which stores the data.
Bool_t allClientsCached(RooAbsArg *, const RooArgSet &)
Utility function that determines if all clients of object 'var' appear in given list of cached nodes.
void setDirtyProp(Bool_t flag)
Control propagation of dirty flags from observables in dataset.
virtual ~RooAbsData()
Destructor.
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 const RooAbsBinning & getBinning(const char *name=0, Bool_t verbose=kTRUE, Bool_t createOnTheFly=kFALSE) const =0
Retrive binning configuration with given name or default binning.
void setConstant(Bool_t value=kTRUE)
Bool_t hasMin(const char *name=0) const
Check if variable has a lower bound.
virtual Double_t getMin(const char *name=0) const
Get miniminum of currently defined range.
TH1 * createHistogram(const char *name, 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
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.
const char * getPlotLabel() const
Get the label associated with the variable.
void setPlotLabel(const char *label)
Set the label associated with this variable.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooAbsArg * at(Int_t idx) const
Return object at given index, or nullptr if index is out of range.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
RooCategory is an object to represent discrete states.
RooCmdArg is a named container for two doubles, two integers two object points and three string point...
Double_t getDouble(Int_t idx) const
Int_t getInt(Int_t idx) const
virtual TObject * Clone(const char *newName=0) const
Make a clone of an object using the Streamer facility.
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'.
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...
Double_t getDouble(const char *name, Double_t defaultValue=0)
Return Double_t property registered with name 'name'.
void allowUndefined(Bool_t flag=kTRUE)
void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge)
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList.
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...
Bool_t ok(Bool_t verbose) const
Return true of parsing was successful.
Bool_t process(const RooCmdArg &arg)
Process given RooCmdArg.
Bool_t hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
RooCompositeDataStore combines several disjunct datasets into one.
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 ...
TObject * FindObject(const char *name) const
Return pointer to obejct with given name.
void Delete(Option_t *o=0)
Remove all elements in collection and delete all elements NB: Collection does not own elements,...
TObject * find(const char *name) const
Return pointer to object with given name in collection.
virtual void Add(TObject *arg)
Bool_t Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
RooMultiCategory connects several RooAbsCategory objects into a single category.
RooNameReg is a registry for const char* names.
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
static RooNameReg & instance()
Return reference to singleton instance.
static void incrementRenameCounter()
The renaming counter has to be incremented every time a RooAbsArg is renamed.
static Double_t infinity()
Return internal infinity representation.
A RooPlot is a plot frame and a container for graphics objects within that frame.
TAttMarker * getAttMarker(const char *name=0) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
void addObject(TObject *obj, Option_t *drawOptions="", Bool_t invisible=kFALSE)
Add a generic object to this plot.
Double_t getFitRangeNEvt() const
Return the number of events in the fit range.
Double_t getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
TAttFill * getAttFill(const char *name=0) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
RooAbsRealLValue * getPlotVar() const
TAttLine * getAttLine(const char *name=0) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
void updateNormVars(const RooArgSet &vars)
Install the given set of observables are reference normalization variables for this frame.
void addPlotable(RooPlotable *plotable, Option_t *drawOptions="", Bool_t invisible=kFALSE, Bool_t refreshNorm=kFALSE)
Add the specified plotable object to our plot.
TObject * findObject(const char *name, const TClass *clas=0) const
Find the named object in our list of items and return a pointer to it.
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
RooRealVar represents a variable that can be changed from the outside.
void setError(Double_t value)
TString * format(const RooCmdArg &formatArg) const
Format contents of RooRealVar for pretty printing on RooPlot parameter boxes.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
RooSimultaneous facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
const RooAbsCategoryLValue & indexCat() const
RooAbsPdf * getPdf(const char *catName) const
Return the p.d.f associated with the given index category name.
A simple container to hold a batch of data values.
constexpr std::span< T >::index_type size() const noexcept
constexpr bool empty() const noexcept
static void destroy(const TObject *obj)
Register deletion of object 'obj'.
static void create(const TObject *obj)
Register creation of object 'obj'.
RooTreeDataStore is a TTree-backed data storage.
RooVectorDataStore uses std::vectors to store data columns.
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineStyle(Style_t lstyle)
Set the line style.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetBinError(Int_t bin) const
Return value of error associated to bin number bin.
virtual Int_t GetDimension() const
virtual void SetBinError(Int_t bin, Double_t error)
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empt...
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual TArrayD * GetSumw2()
virtual Int_t FindBin(Double_t x, Double_t y=0, Double_t z=0)
Return Global bin number corresponding to x,y,z.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
Service class for 2-D histogram classes.
The 3-D histogram classes derived from the 1-D histogram classes.
Iterator abstract base class.
virtual TObject * Next()=0
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
The TNamed class is the base class for all named ROOT classes.
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 TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
virtual void Clear(Option_t *="")
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
A Pave (see TPave) with text, lines or/and boxes inside.
const char * Data() const
void ToUpper()
Change string to upper case.
TString & Append(const char *cs)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
virtual TTree * CloneTree(Long64_t nentries=-1, Option_t *option="")
Create a clone of this tree and copy nentries.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
RooCmdArg ZVar(const RooAbsRealLValue &var, const RooCmdArg &arg=RooCmdArg::none())
RooCmdArg AxisLabel(const char *name)
RooCmdArg AutoBinning(Int_t nbins=100, Double_t marginFactor=0.1)
RooCmdArg Binning(const RooAbsBinning &binning)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
const char * addToHistName
RooAbsData::ErrorType etype
Bool_t correctForBinWidth
static uint64_t sum(uint64_t i)