124#include <unordered_map>
136 std::cout <<
"Composite storage is not a valid *default* storage type." << std::endl;
161 throw std::runtime_error(
"RooAbsData::initializeVars(): the variables are already initialized!");
165 for (
const auto var : vars) {
166 if (!var->isFundamental()) {
167 coutE(InputArguments) <<
"RooAbsDataStore::initialize(" <<
GetName()
168 <<
"): Data set cannot contain non-fundamental types, ignoring " << var->GetName()
170 throw std::invalid_argument(std::string(
"Only fundamental variables can be placed into datasets. This is violated for ") + var->GetName());
188 _vars(
"Dataset Variables"),
189 _cachedVars(
"Cached Variables"),
214 for (
auto var :
_vars) {
222 std::map<std::string, RooAbsDataStore *> smap;
226 smap[itero.first] = dclone->
store();
249 :
TNamed{newName ? newName : other.GetName(), other.GetTitle()},
251 _cachedVars{
"Cached Variables"}
261 RooPrintable::operator=(other);
308 bool ret =
_dstore->changeObservableName(from,to) ;
351 _dstore->cacheArgs(cacheOwner,varSet,nset,skipZeroWeights) ;
368 _dstore->attachCache(newOwner, cachedVars) ;
375 _dstore->setArgStatus(set,active) ;
412 pc.
defineInt(
"evtStart",
"EventRange",0,0) ;
413 pc.
defineInt(
"evtStop",
"EventRange",1,std::numeric_limits<int>::max()) ;
414 pc.
defineSet(
"varSel",
"SelectVars",0,
nullptr) ;
418 pc.
process(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
424 const char* cutRange = pc.
getString(
"cutRange",
nullptr,
true) ;
425 const char* cutSpec = pc.
getString(
"cutSpec",
nullptr,
true) ;
427 int nStart = pc.
getInt(
"evtStart",0) ;
428 int nStop = pc.
getInt(
"evtStop",std::numeric_limits<int>::max()) ;
431 const char* title = pc.
getString(
"title",
nullptr,
true) ;
436 varSubset.
add(*varSet) ;
437 for (
const auto arg : varSubset) {
439 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
440 << arg->GetName() <<
" not in dataset, ignored" << std::endl ;
448 std::unique_ptr<RooAbsData> ret;
452 ret =
reduceEng(varSubset,&cutVarTmp,cutRange,nStart,nStop) ;
456 ret =
reduceEng(varSubset,cutVar,cutRange,nStart,nStop) ;
460 if (!ret)
return nullptr;
463 if (title) ret->SetTitle(title) ;
465 ret->copyGlobalObservables(*
this);
478 auto ret =
reduceEng(*
get(),&cutVar,
nullptr,0,std::numeric_limits<std::size_t>::max()) ;
479 ret->copyGlobalObservables(*
this);
490 auto ret =
reduceEng(*
get(),&cutVar,
nullptr,0,std::numeric_limits<std::size_t>::max()) ;
491 ret->copyGlobalObservables(*
this);
507 for (
const auto arg : varSubset) {
509 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
510 << arg->GetName() <<
" not in dataset, ignored" << std::endl ;
515 std::unique_ptr<RooAbsData> ret;
516 if (cut && strlen(cut)>0) {
518 ret =
reduceEng(varSubset2,&cutVar,
nullptr,0,std::numeric_limits<std::size_t>::max());
520 ret =
reduceEng(varSubset2,
nullptr,
nullptr,0,std::numeric_limits<std::size_t>::max());
522 ret->copyGlobalObservables(*
this);
539 coutW(InputArguments) <<
"RooAbsData::reduce(" <<
GetName() <<
") WARNING: variable "
540 << arg->GetName() <<
" not in dataset, ignored" << std::endl ;
545 auto ret =
reduceEng(varSubset2,&cutVar,
nullptr,0,std::numeric_limits<std::size_t>::max()) ;
546 ret->copyGlobalObservables(*
this);
607 const auto varNames =
ROOT::Split(varNameList,
",:");
608 RooRealVar* vars[3] = {
nullptr,
nullptr,
nullptr};
610 for (
unsigned int i = 0; i < varNames.size(); ++i) {
612 coutW(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
"): Can only create 3-dimensional histograms. Variable "
613 << i <<
" " << varNames[i] <<
" unused." << std::endl;
619 coutE(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
") ERROR: dataset does not contain an observable named " << varNames[i] << std::endl;
625 coutE(InputArguments) <<
"RooAbsData::createHistogram(" <<
GetName() <<
"): No variable to be histogrammed in list '" << varNameList <<
"'" << std::endl;
694 const char* cutSpec = pc.
getString(
"cutString",
nullptr,
true) ;
695 const char* cutRange = pc.
getString(
"cutRange",
nullptr,
true) ;
717 ownedCmds.
Add(bincmd) ;
718 argList.
Replace(autoRD,bincmd) ;
723 std::unique_ptr<RooCmdArg> autoRDY{
static_cast<RooCmdArg*
>((
static_cast<RooCmdArg*
>(argList.
find(
"YVar")))->subArgs().find(
"AutoRangeData"))};
736 std::unique_ptr<RooCmdArg> autoRDZ{
static_cast<RooCmdArg*
>((
static_cast<RooCmdArg*
>(argList.
find(
"ZVar")))->subArgs().find(
"AutoRangeData"))};
740 if (!
getRange(
static_cast<RooRealVar&
>(*zvar),zmin,zmax,autoRDZ->getDouble(0),autoRDZ->getInt(0))) {
764 std::string prodName(
"(") ;
765 for(
auto * arg : catSet) {
768 else catSet2.
add(*arg) ;
769 if (prodName.length()>1) {
772 prodName += arg->GetName() ;
774 coutW(InputArguments) <<
"RooAbsData::table(" <<
GetName() <<
") non-RooAbsCategory input argument " << arg->GetName() <<
" ignored" << std::endl ;
780 return table(tmp,cuts,opts) ;
834 if (order==1)
return 0 ;
835 if (order==2)
return 1 ;
837 return moment(var,order,cutSpec,cutRange) / std::pow(
sigma(var,cutSpec,cutRange),order) ;
852 double offset = order>1 ?
moment(var,1,cutSpec,cutRange) : 0 ;
868 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") ERROR: unknown variable: " << var.
GetName() << std::endl;
872 auto varPtr =
dynamic_cast<const RooRealVar*
>(arg);
875 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") ERROR: variable " << var.
GetName() <<
" is not of type RooRealVar" << std::endl ;
881 coutE(InputArguments) <<
"RooDataSet::moment(" <<
GetName() <<
") WARNING: empty dataset" << std::endl ;
886 std::unique_ptr<RooFormula> select;
888 select = std::make_unique<RooFormula>(
"select",cutSpec,*
get());
896 if (select && select->eval()==0) continue ;
897 if (cutRange && vars->
allInRange(cutRange)) continue ;
913 coutE(InputArguments) <<
"RooDataSet::" << methodname <<
"(" <<
GetName() <<
") ERROR: variable : " << extVar.
GetName() <<
" is not in data" << std::endl ;
918 coutE(InputArguments) <<
"RooDataSet::" << methodname <<
"(" <<
GetName() <<
") ERROR: variable : " << extVar.
GetName() <<
" is not of type RooRealVar in data" << std::endl ;
932 if (!xdata||!ydata)
return 0 ;
936 coutW(InputArguments) <<
"RooDataSet::" << (corr?
"correlation":
"covariance") <<
"(" <<
GetName() <<
") WARNING: empty dataset, returning zero" << std::endl ;
941 std::unique_ptr<RooFormula> select;
942 if (cutSpec) select = std::make_unique<RooFormula>(
"select",cutSpec,*
get());
953 if (select && select->eval()==0) continue ;
954 if (cutRange && vars->
allInRange(cutRange)) continue ;
958 ysum +=
weight()*ydata->getVal() ;
961 y2sum +=
weight()*ydata->getVal()*ydata->getVal() ;
976 return (xysum-xsum*ysum)/(sqrt(x2sum-(xsum*xsum))*sqrt(y2sum-(ysum*ysum))) ;
978 return (xysum-xsum*ysum);
988 for(
auto * var : static_range_cast<RooRealVar*>(vars)) {
993 varList.
add(*datavar) ;
999 coutW(InputArguments) <<
"RooDataSet::covariance(" <<
GetName() <<
") WARNING: empty dataset, returning zero" << std::endl ;
1004 std::unique_ptr<RooFormula> select = cutSpec ? std::make_unique<RooFormula>(
"select",cutSpec,*
get()) :
nullptr;
1007 std::vector<double> xsum(varList.
size()) ;
1008 std::vector<double> x2sum(varList.
size()) ;
1013 if (select && select->eval()==0) continue ;
1014 if (cutRange && dvars->
allInRange(cutRange)) continue ;
1016 for(std::size_t iX = 0; iX < varList.
size(); ++iX) {
1017 auto varx =
static_cast<RooRealVar const&
>(varList[iX]);
1018 xsum[iX] +=
weight() * varx.getVal() ;
1020 x2sum[iX] +=
weight() * varx.getVal() * varx.getVal();
1023 for(std::size_t iY = iX; iY < varList.
size(); ++iY) {
1024 auto vary =
static_cast<RooRealVar const&
>(varList[iY]);
1025 xysum(iX,iY) +=
weight() * varx.getVal() * vary.getVal();
1026 xysum(iY,iX) = xysum(iX,iY) ;
1033 for (std::size_t iX=0 ; iX<varList.
size() ; iX++) {
1038 for (std::size_t iY=0 ; iY<varList.
size() ; iY++) {
1039 xysum(iX,iY) /=
sumEntries(cutSpec, cutRange) ;
1044 auto C = std::make_unique<TMatrixDSym>(varList.
size()) ;
1045 for (std::size_t iX=0 ; iX<varList.
size() ; iX++) {
1046 for (std::size_t iY=0 ; iY<varList.
size() ; iY++) {
1047 (*C)(iX,iY) = xysum(iX,iY)-xsum[iX]*xsum[iY] ;
1049 (*C)(iX,iY) /= std::sqrt((x2sum[iX]-(xsum[iX]*xsum[iX]))*(x2sum[iY]-(xsum[iY]*xsum[iY]))) ;
1070 std::string
name = std::string{var.
GetName()} +
"Mean";
1071 std::string title = std::string{
"Mean of "} + var.
GetTitle();
1073 meanv->setConstant(
false) ;
1076 std::string label =
"<" + std::string{var.
getPlotLabel()} +
">";
1077 meanv->setPlotLabel(label.c_str());
1080 double meanVal=
moment(var,1,0,cutSpec,cutRange) ;
1083 double rmsVal= sqrt(
moment(var,2,meanVal,cutSpec,cutRange)*
N/(
N-1));
1084 meanv->setVal(meanVal) ;
1085 meanv->setError(
N > 0 ? rmsVal/sqrt(
N) : 0);
1104 std::string title(
"RMS of ");
1108 rms->setConstant(
false) ;
1113 rms->setPlotLabel(label.c_str());
1116 double meanVal(
moment(var,1,0,cutSpec,cutRange)) ;
1118 double rmsVal= sqrt(
moment(var,2,meanVal,cutSpec,cutRange)*
N/(
N-1));
1119 rms->setVal(rmsVal) ;
1120 rms->setError(rmsVal/sqrt(2*
N));
1172 pc.
defineInt(
"ymaxi",
"Layout",0,
int(0.95*10000)) ;
1175 pc.
defineInt(
"dummy",
"FormatArgs",0,0) ;
1186 const char* label = pc.
getString(
"label") ;
1190 const char* formatStr = pc.
getString(
"formatStr") ;
1191 int sigDigit = pc.
getInt(
"sigDigit") ;
1194 const char* cutSpec = pc.
getString(
"cutString",
nullptr,
true) ;
1195 const char* cutRange = pc.
getString(
"cutRange",
nullptr,
true) ;
1199 return statOn(frame,
what,label,0,
nullptr,
xmin,
xmax,
ymax,cutSpec,cutRange,formatCmd) ;
1210 const char* cutSpec,
const char* cutRange,
const RooCmdArg* formatCmd)
1212 bool showLabel= (label !=
nullptr && strlen(label) > 0);
1214 std::string whatStr{
what};
1215 std::transform(whatStr.begin(), whatStr.end(), whatStr.begin(), [](
unsigned char c){ return std::toupper(c); });
1216 bool showN = whatStr.find(
'N') != std::string::npos;
1217 bool showR = whatStr.find(
'R') != std::string::npos;
1218 bool showM = whatStr.find(
'M') != std::string::npos;
1227 if(showLabel)
ymin-= dy;
1231 if(!
box)
return nullptr;
1233 box->SetFillColor(0);
1234 box->SetBorderSize(1);
1235 box->SetTextAlign(12);
1236 box->SetTextSize(0.04F);
1237 box->SetFillStyle(1001);
1241 N.setPlotLabel(
"Entries") ;
1246 std::unique_ptr<TString> rmsText;
1247 std::unique_ptr<TString> meanText;
1248 std::unique_ptr<TString> NText;
1250 rmsText.reset(rms->format(sigDigits,options));
1251 meanText.reset(meanv->format(sigDigits,options));
1252 NText.reset(
N.format(sigDigits,options));
1254 rmsText.reset(rms->format(*formatCmd));
1255 meanText.reset(meanv->format(*formatCmd));
1256 NText.reset(
N.format(*formatCmd));
1258 if (showR)
box->AddText(rmsText->Data());
1259 if (showM)
box->AddText(meanText->Data());
1260 if (showN)
box->AddText(NText->Data());
1263 if(showLabel)
box->AddText(label);
1278 if(
nullptr == hist) {
1279 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: no valid histogram to fill" << std::endl;
1285 if(hdim != plotVars.
size()) {
1286 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: plotVars has the wrong dimension" << std::endl;
1298 if(realVar ==
nullptr) {
1300 <<
"\" of type " << var->
ClassName() << std::endl;
1306 assert(
nullptr != clone);
1309 <<
":fillHistogram: Data does not contain the variable '" << realVar->
GetName() <<
"'." << std::endl;
1315 localVars.
add(*clone);
1318 localVars.
add(*found);
1323 std::unique_ptr<RooFormula> select;
1324 if (cuts !=
nullptr && strlen(cuts) > 0) {
1325 select = std::make_unique<RooFormula>(cuts, cuts,
_vars,
false);
1326 if (!select || !select->ok()) {
1327 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: invalid cuts \"" << cuts <<
"\"" << std::endl;
1339 assert(
nullptr != zvar);
1343 assert(
nullptr != yvar);
1347 assert(
nullptr != xvar);
1350 coutE(InputArguments) <<
ClassName() <<
"::" <<
GetName() <<
":fillHistogram: cannot fill histogram with "
1351 << hdim <<
" dimensions" << std::endl;
1356 const auto cutVec =
ROOT::Split(cutRange ? cutRange :
"",
",");
1363 for(
int i=0; i < nevent; ++i) {
1370 if (select && select->eval()==0) {
1376 bool selectByRange = true ;
1378 for (
const auto arg :
_vars) {
1379 bool selectThisArg = false ;
1380 for (
auto const& cut : cutVec) {
1381 if (!cut.empty() && arg->inRange(cut.c_str())) {
1382 selectThisArg = true ;
1386 if (!selectThisArg) {
1387 selectByRange = false ;
1393 if (!selectByRange) {
1420 if (we==0) we =
weight() ;
1421 error2 += std::pow(we,2) ;
1445struct SplittingSetup {
1449 bool addWeightVar =
false;
1454 SplittingSetup setup;
1458 oocoutE(&
data, InputArguments) <<
"RooTreeData::split(" <<
data.GetName() <<
") ERROR category "
1459 << splitCat.
GetName() <<
" doesn't depend on any variable in this dataset"
1468 setup.cloneCat->attachDataSet(
data);
1471 if (!setup.cloneCat) {
1472 oocoutE(&
data, InputArguments) <<
"RooTreeData::split(" <<
data.GetName() <<
") ERROR category "
1473 << splitCat.
GetName() <<
" is fundamental and does not appear in this dataset"
1480 setup.subsetVars.add(*
data.get());
1482 std::unique_ptr<RooArgSet> vars{splitCat.
getVariables()};
1483 setup.subsetVars.remove(*vars,
true,
true);
1485 setup.subsetVars.remove(splitCat,
true,
true);
1490 setup.addWeightVar =
data.isWeighted();
1496 std::function<std::unique_ptr<RooAbsData>(
const char *label)> createEmptyData)
1498 auto dsetList = std::make_unique<TList>();
1501 if (createEmptyDataSets) {
1502 for (
const auto &nameIdx : cloneCat) {
1503 dsetList->Add(createEmptyData(nameIdx.first.c_str()).release());
1510 for (
int i = 0; i <
data.numEntries(); ++i) {
1515 dsetList->Add(subset);
1557 SplittingSetup setup = initSplit(*
this, splitCat);
1560 if (!setup.cloneCat)
1563 auto createEmptyData = [&](
const char *label) -> std::unique_ptr<RooAbsData> {
1564 return std::unique_ptr<RooAbsData>{
1565 emptyClone(label, label, &setup.subsetVars, setup.addWeightVar ?
"weight" :
nullptr)};
1568 return splitImpl(*
this, *setup.cloneCat, createEmptyDataSets, createEmptyData);
1591 SplittingSetup setup = initSplit(*
this, splitCat);
1594 if (!setup.cloneCat)
1599 auto getPdfObservables = [
this, &simPdf](
const char *label) {
1602 catPdf->getObservables(this->
get(), obsSet);
1609 for (
const auto &catPair : splitCat) {
1610 allObservables.
add(getPdfObservables(catPair.first.c_str()));
1612 setup.subsetVars.remove(allObservables,
true,
true);
1614 auto createEmptyData = [&](
const char *label) -> std::unique_ptr<RooAbsData> {
1616 RooArgSet subsetVarsCat(setup.subsetVars);
1617 subsetVarsCat.
add(getPdfObservables(label));
1618 return std::unique_ptr<RooAbsData>{
1619 this->
emptyClone(label, label, &subsetVarsCat, setup.addWeightVar ?
"weight" :
nullptr)};
1622 return splitImpl(*
this, *setup.cloneCat, createEmptyDataSets, createEmptyData);
1728 pc.
defineInt(
"nbins",
"BinningSpec",0,100) ;
1733 pc.
defineInt(
"lineColor",
"LineColor",0,-999) ;
1734 pc.
defineInt(
"lineStyle",
"LineStyle",0,-999) ;
1735 pc.
defineInt(
"lineWidth",
"LineWidth",0,-999) ;
1736 pc.
defineInt(
"markerColor",
"MarkerColor",0,-999) ;
1737 pc.
defineInt(
"markerStyle",
"MarkerStyle",0,-999) ;
1739 pc.
defineInt(
"fillColor",
"FillColor",0,-999) ;
1740 pc.
defineInt(
"fillStyle",
"FillStyle",0,-999) ;
1742 pc.
defineInt(
"histInvisible",
"Invisible",0,0) ;
1743 pc.
defineInt(
"refreshFrameNorm",
"RefreshNorm",0,1) ;
1749 pc.
defineMutex(
"DataError",
"Asymmetry",
"Efficiency") ;
1750 pc.
defineMutex(
"Binning",
"BinningName",
"BinningSpec") ;
1790 coutI(InputArguments) <<
"RooAbsData::plotOn(" <<
GetName()
1791 <<
") INFO: dataset has non-integer weights, auto-selecting SumW2 errors instead of Poisson errors" << std::endl ;
1797 <<
" to add to in RooPlot" << std::endl ;
1802 if (!asymCat && !effCat) {
1804 }
else if (asymCat) {
1810 int lineColor = pc.
getInt(
"lineColor") ;
1811 int lineStyle = pc.
getInt(
"lineStyle") ;
1812 int lineWidth = pc.
getInt(
"lineWidth") ;
1813 int markerColor = pc.
getInt(
"markerColor") ;
1814 int markerStyle = pc.
getInt(
"markerStyle") ;
1816 int fillColor = pc.
getInt(
"fillColor") ;
1817 int fillStyle = pc.
getInt(
"fillStyle") ;
1848 if(
nullptr == frame) {
1853 if(
nullptr == var) {
1855 <<
":plotOn: frame does not specify a plot variable" << std::endl;
1860 const std::string histName = std::string{
GetName()} +
"_plot";
1861 std::unique_ptr<TH1> hist;
1877 <<
":plotOn: fillHistogram() failed" << std::endl;
1883 double nomBinWidth ;
1892 if(
nullptr ==
graph) {
1894 <<
":plotOn: unable to create a RooHist object" << std::endl;
1903 std::unique_ptr<RooAbsData> tmp{
const_cast<RooAbsData*
>(
this)->
reduce(*var)};
1904 nEnt = tmp->sumEntries() ;
1909 coutI(Plotting) <<
"RooTreeData::plotOn: plotting " << hist->GetSumOfWeights() <<
" events out of " << nEnt <<
" total events" << std::endl ;
1910 graph->setRawEntries(nEnt) ;
1917 if (!
graph->hasIdenticalBinning(*otherGraph)) {
1918 coutE(Plotting) <<
"RooTreeData::plotOn: ERROR Histogram to be added to, '" << o.
addToHistName <<
"',has different binning" << std::endl ;
1932 std::string hname = std::string{
"h_"} +
GetName();
1934 hname += std::string{
"_CutRange["} + o.
cutRange +
"]";
1937 hname += std::string{
"_Cut["} + o.
cuts +
"]";
1939 graph->SetName(hname.c_str()) ;
1968 if(
nullptr == frame) {
1973 if(
nullptr == var) {
1975 <<
":plotAsymOn: frame does not specify a plot variable" << std::endl;
1980 std::string hist1Name(
GetName());
1981 std::string hist2Name(
GetName());
1982 hist1Name +=
"_plot1";
1983 std::unique_ptr<TH1> hist1;
1984 std::unique_ptr<TH1> hist2;
1985 hist2Name +=
"_plot2";
1999 assert(hist1 && hist2);
2014 <<
":plotAsymOn: createHistogram() failed" << std::endl;
2036 graph->SetName(hname.c_str()) ;
2061 if(
nullptr == frame) {
2066 if(
nullptr == var) {
2068 <<
":plotEffOn: frame does not specify a plot variable" << std::endl;
2073 std::string hist1Name(
GetName());
2074 std::string hist2Name(
GetName());
2075 hist1Name +=
"_plot1";
2076 std::unique_ptr<TH1> hist1;
2077 std::unique_ptr<TH1> hist2;
2078 hist2Name +=
"_plot2";
2092 assert(hist1 && hist2);
2107 <<
":plotEffOn: createHistogram() failed" << std::endl;
2129 graph->SetName(hname.c_str()) ;
2151 std::unique_ptr<RooArgSet> tableSet;
2155 <<
" is not in dataset and is also not dependent on data set" << std::endl ;
2160 tableSet = std::make_unique<RooArgSet>();
2161 if (
RooArgSet(cat).snapshot(*tableSet,
true)) {
2162 coutE(Plotting) <<
"RooTreeData::table(" <<
GetName() <<
") Couldn't deep-clone table category, abort." << std::endl;
2171 std::unique_ptr<RooFormulaVar> cutVar;
2172 std::string tableName{
GetName()};
2173 if (cuts && strlen(cuts)) {
2178 cutVar = std::make_unique<RooFormulaVar>(
"cutVar",cuts,
_vars) ;
2184 for(
int i=0; i < nevent; ++i) {
2187 if (cutVar && cutVar->getVal()==0) continue ;
2205 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") ERROR: unknown variable: " << var.
GetName() << std::endl ;
2209 auto varPtr =
dynamic_cast<const RooRealVar*
>(arg);
2212 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") ERROR: variable " << var.
GetName() <<
" is not of type RooRealVar" << std::endl ;
2218 coutE(InputArguments) <<
"RooDataSet::getRange(" <<
GetName() <<
") WARNING: empty dataset" << std::endl ;
2227 if (varPtr->getVal()<lowest) {
2228 lowest = varPtr->getVal() ;
2230 if (varPtr->getVal()>highest) {
2231 highest = varPtr->getVal() ;
2236 if (symMode==
false) {
2238 double margin = marginFrac*(highest-lowest) ;
2246 double mom1 =
moment(*varPtr,1) ;
2247 double delta = ((highest-mom1)>(mom1-lowest)?(highest-mom1):(mom1-lowest))*(1+marginFrac) ;
2248 lowest = mom1-delta ;
2249 highest = mom1+delta ;
2272 pruneSet.
remove(*usedObs,
true,
true) ;
2275 for(
auto * var : *
get()) {
2277 pruneSet.
add(*var) ;
2282 if (!pruneSet.
empty()) {
2287 for(
auto const* rrv : dynamic_range_cast<RooRealVar*>(*usedObs)) {
2288 if (rrv && !rrv->getBinning().isShareable()) {
2290 RooAbsReal* loFunc = rrv->getBinning().lowBoundFunc() ;
2291 RooAbsReal* hiFunc = rrv->getBinning().highBoundFunc() ;
2298 if (!depObs.
empty()) {
2299 pruneSet.
remove(depObs,
true,
true) ;
2307 pruneSet.
remove(keepObsList,
true,
true) ;
2309 if (!pruneSet.
empty()) {
2312 cxcoutI(Optimization) <<
"RooTreeData::optimizeReadingForTestStatistic(" <<
GetName() <<
"): Observables " << pruneSet
2313 <<
" 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" << std::endl ;
2325 bool anyClient(
false);
2329 if (!cacheList.
find(client->GetName())) {
2335 return anyClient?ret:false ;
2342 _dstore->attachBuffers(extObs) ;
2412 return _dstore->hasFilledCache() ;
2425 coutW(InputArguments) <<
"RooAbsData::tree(" <<
GetName() <<
") WARNING: is not of StorageType::Tree. "
2426 <<
"Use GetClonedTree() instead or convert to tree storage." << std::endl;
2439 return tmp->CloneTree();
2464 if (iter.second == obj) {
2465 iter.second =
nullptr;
2481 arg->setAttribute(
"global",
true);
2483 if(
auto lval =
dynamic_cast<RooAbsRealLValue*
>(arg)) lval->setConstant(
true);
2521 if (eventWeights.empty()) {
2526 for (std::size_t i = 0; i < eventWeights.size(); ++i) {
2529 return kahanWeight.
Sum();
2557 const char *
name)
const
2572 const char *cuts,
const char *
name)
const
2575 static int counter(0);
2577 std::unique_ptr<RooAbsReal> ownedPlotVarX;
2580 if (plotVarX ==
nullptr) {
2584 <<
" is not in dataset and is also not dependent on data set" << std::endl;
2590 plotVarX = ownedPlotVarX.get();
2596 std::unique_ptr<RooAbsReal> ownedPlotVarY;
2599 if (plotVarY ==
nullptr) {
2603 <<
" is not in dataset and is also not dependent on data set" << std::endl;
2609 plotVarY = ownedPlotVarY.get();
2616 std::unique_ptr<RooFormula> select;
2617 if (
nullptr != cuts && strlen(cuts)) {
2618 select = std::make_unique<RooFormula>(cuts, cuts,
_vars);
2619 if (!select->ok()) {
2624 const std::string histName = std::string{
GetName()} +
"_" +
name +
"_" +
Form(
"%08x", counter++);
2630 coutE(DataHandling) <<
GetName() <<
"::createHistogram: unable to create a new histogram" << std::endl;
2636 for (
int i = 0; i < nevent; ++i) {
2639 if (select && select->eval() == 0)
2641 histogram->Fill(plotVarX->getVal(), plotVarY->
getVal(),
weight());
2652 using Map = std::unordered_map<std::string, RooAbsData::ErrorType>;
2658 auto found = enumMap.find(
name);
2659 if (found == enumMap.end()) {
2660 std::stringstream msg;
2661 msg <<
"Unsupported error type type passed to DataError(). "
2662 "Supported decay types are : \"Poisson\", \"SumW2\", \"Auto\", \"Expected\", and None.";
2663 throw std::invalid_argument(msg.str());
2665 return found->second;
static void indent(ostringstream &buf, int indent_level)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
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.
void fill(RooAbsCategory &cat, double weight=1.0) override
Increment the counter of the table slot with the name corresponding to that of the current category s...
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
bool recursiveRedirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool recurseInNewSet=true)
Recursively replace all servers with the new servers in newSet.
void attachArgs(const RooAbsCollection &set)
Bind this node to objects in set.
RooFit::OwningPtr< RooArgSet > getObservables(const RooArgSet &set, bool valueOnly=true) const
Given a set of possible observables, return the observables that this PDF depends on.
const RefCountList_t & valueClients() const
List of all value clients of this object. Value clients receive value updates.
bool redirectServers(const RooAbsCollection &newServerList, bool mustReplaceAll=false, bool nameChange=false, bool isRecursionStep=false)
Replace all direct servers of this object with the new servers in newServerList.
virtual bool isDerived() const
Does value or shape of this arg depend on any other arg?
RooFit::OwningPtr< RooArgSet > getVariables(bool stripDisconnected=true) const
Return RooArgSet with all variables (tree leaf nodes of expression tree)
TObject * Clone(const char *newname=nullptr) const override
Make a clone of an object using the Streamer facility.
void leafNodeServerList(RooAbsCollection *list, const RooAbsArg *arg=nullptr, bool recurseNonDerived=false) const
Fill supplied list with all leaf nodes of the arg tree, starting with ourself as top node.
Abstract base class for RooRealVar binning definitions.
virtual double averageBinWidth() const =0
virtual bool isUniform() const
Abstract base class for objects that represent a discrete value that can be set from the outside,...
A space to attach TBranches.
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 bool remove(const RooAbsArg &var, bool silent=false, bool matchByNameOnly=false)
Remove the specified argument from our list.
bool allInRange(const char *rangeSpec) const
Return true if all contained object report to have their value inside the specified range.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
virtual RooAbsArg * addClone(const RooAbsArg &var, bool silent=false)
Add a clone of the specified argument to list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
Abstract base class for a data collection.
virtual RooAbsData::CategorySpans getCategoryBatches(std::size_t, std::size_t) const
virtual RooAbsData::RealSpans getBatches(std::size_t first, std::size_t len) const =0
Retrieve batches for all observables in this data store.
Abstract base class for binned and unbinned datasets.
virtual double weight() const =0
virtual double sumEntries() const =0
Return effective number of entries in dataset, i.e., sum all weights.
virtual const RooArgSet * get() const
std::map< RooFit::Detail::DataKey, std::span< const double > > RealSpans
RooRealVar * meanVar(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Create a RooRealVar containing the mean of observable 'var' in this dataset.
void printMultiline(std::ostream &os, Int_t contents, bool verbose=false, TString indent="") const override
Interface for detailed printing of object.
const TNamed * _namePtr
! De-duplicated name pointer. This will be equal for all objects with the same name.
RooAbsData()
Default constructor.
static void setDefaultStorageType(StorageType s)
void SetName(const char *name) override
Set the name of the TNamed.
CategorySpans getCategoryBatches(std::size_t first=0, std::size_t len=std::numeric_limits< std::size_t >::max()) const
RooFit::OwningPtr< TMatrixDSym > corrcovMatrix(const RooArgList &vars, const char *cutSpec, const char *cutRange, bool corr) const
Return covariance matrix from data for given list of observables.
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()
void printClassName(std::ostream &os) const override
Print class name of dataset.
RooRealVar * rmsVar(const RooRealVar &var, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Create a RooRealVar containing the RMS of observable 'var' in this dataset.
double standMoment(const RooRealVar &var, double order, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Calculate standardized moment.
virtual RooPlot * statOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={})
Add a box with statistics information to the specified frame.
void Draw(Option_t *option="") override
Forward draw command to data store.
virtual bool changeObservableName(const char *from, const char *to)
void printTitle(std::ostream &os) const override
Print title of dataset.
void RecursiveRemove(TObject *obj) override
If one of the TObject we have a referenced to is deleted, remove the reference.
virtual double weightError(ErrorType=Poisson) const
Return the symmetric error on the current weight.
void setDirtyProp(bool flag)
Control propagation of dirty flags from observables in dataset.
virtual RooFit::OwningPtr< TList > split(const RooAbsCategory &splitCat, bool createEmptyDataSets=false) const
Split the dataset into subsets based on states of a categorical variable in this dataset.
virtual TH1 * fillHistogram(TH1 *hist, const RooArgList &plotVars, const char *cuts="", const char *cutRange=nullptr) const
Loop over columns of our tree data and fill the input histogram.
virtual void setArgStatus(const RooArgSet &set, bool active)
virtual void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=nullptr, bool skipZeroWeights=false)
Internal method – Cache given set of functions with data.
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 StorageType defaultStorageType
std::map< RooFit::Detail::DataKey, std::span< const RooAbsCategory::value_type > > CategorySpans
virtual std::span< 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 std::unique_ptr< RooAbsData > reduceEng(const RooArgSet &varSubset, const RooFormulaVar *cutVar, const char *cutRange=nullptr, std::size_t nStart=0, std::size_t=std::numeric_limits< std::size_t >::max()) const =0
RooFit::OwningPtr< RooAbsData > reduce(const RooCmdArg &arg1, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Create a reduced copy of this dataset.
double corrcov(const RooRealVar &x, const RooRealVar &y, const char *cutSpec, const char *cutRange, bool corr) const
Internal method to calculate single correlation and covariance elements.
bool allClientsCached(RooAbsArg *, const RooArgSet &)
Utility function that determines if all clients of object 'var' appear in given list of cached nodes.
std::unique_ptr< RooAbsDataStore > _dstore
Data storage implementation.
void addOwnedComponent(const char *idxlabel, RooAbsData &data)
RooArgSet _vars
Dimensions of this data set.
bool canSplitFast() const
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...
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
RooAbsData * getSimData(const char *idxstate)
void copyGlobalObservables(const RooAbsData &other)
virtual bool isNonPoissonWeighted() const
bool hasFilledCache() const
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.
void convertToVectorStore()
Convert tree-based storage to vector-based storage.
bool getRange(const RooAbsRealLValue &var, double &lowest, double &highest, double marginFrac=0.0, bool symMode=false) const
Fill Doubles 'lowest' and 'highest' with the lowest and highest value of observable 'var' in this dat...
RooArgSet _cachedVars
! External variables cached with this data set
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.
double moment(const RooRealVar &var, double order, const char *cutSpec=nullptr, const char *cutRange=nullptr) const
Calculate moment of requested order.
RooAbsData & operator=(const RooAbsData &other)
virtual RooFit::OwningPtr< RooAbsData > emptyClone(const char *newName=nullptr, const char *newTitle=nullptr, const RooArgSet *vars=nullptr, const char *wgtVarName=nullptr) const =0
void SetNameTitle(const char *name, const char *title) override
Set all the TNamed parameters (name and title).
void copyImpl(const RooAbsData &other, const char *newname)
virtual void resetCache()
Internal method – Remove cached function values.
Int_t defaultPrintContents(Option_t *opt) const override
Define default print options, for a given print style.
std::unique_ptr< RooArgSet > _globalObservables
Snapshot of global observables.
virtual double weightSquared() const =0
TTree * GetClonedTree() const
Return a clone of the TTree which stores the data or create such a tree if vector storage is used.
void attachBuffers(const RooArgSet &extObs)
std::map< std::string, RooAbsData * > _ownedComponents
Owned external components.
static StorageType getDefaultStorageType()
void Streamer(TBuffer &) override
Stream an object of class RooAbsData.
void printName(std::ostream &os) const override
Print name of dataset.
static ErrorType errorTypeFromString(std::string const &name)
Convert a string to the value of the RooAbsData::ErrorType enum with the same name.
const TTree * tree() const
Return a pointer to the TTree which stores the data.
TH1 * createHistogram(const char *name, const RooAbsRealLValue &xvar, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
Calls createHistogram(const char *name, const RooAbsRealLValue& xvar, const RooLinkedList& argList) c...
void initializeVars(RooArgSet const &vars)
~RooAbsData() override
Destructor.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
virtual Int_t getBins(const char *name=nullptr) const
Get number of bins of currently defined range.
virtual const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const =0
Retrieve binning configuration with given name or default binning.
TH1 * createHistogram(const char *name, const RooCmdArg &arg1={}, const RooCmdArg &arg2={}, const RooCmdArg &arg3={}, const RooCmdArg &arg4={}, const RooCmdArg &arg5={}, const RooCmdArg &arg6={}, const RooCmdArg &arg7={}, const RooCmdArg &arg8={}) const
virtual double getMax(const char *name=nullptr) const
Get maximum of currently defined range.
virtual double getMin(const char *name=nullptr) const
Get minimum of currently defined range.
Abstract base class for objects that represent a real value and implements functionality common to al...
double 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.
Object to represent discrete states.
Named container for two doubles, two integers two object points and three string pointers that can be...
double getDouble(Int_t idx) const
Return double stored in slot idx.
RooLinkedList const & subArgs() const
Return list of sub-arguments in this RooCmdArg.
Int_t getInt(Int_t idx) const
TObject * Clone(const char *newName=nullptr) const override
Make a clone of an object using the Streamer facility.
Configurable parser for RooCmdArg named arguments.
void defineMutex(const char *head, Args_t &&... tail)
Define arguments where any pair is mutually exclusive.
bool process(const RooCmdArg &arg)
Process given RooCmdArg.
bool hasProcessed(const char *cmdName) const
Return true if RooCmdArg with name 'cmdName' has been processed.
double getDouble(const char *name, double defaultValue=0.0) const
Return double property registered with name 'name'.
bool defineDouble(const char *name, const char *argName, int doubleNum, double defValue=0.0)
Define double property name 'name' mapped to double in slot 'doubleNum' in RooCmdArg with name argNam...
static void stripCmdList(RooLinkedList &cmdList, const char *cmdsToPurge)
Utility function that strips command names listed (comma separated) in cmdsToPurge from cmdList.
RooArgSet * getSet(const char *name, RooArgSet *set=nullptr) const
Return RooArgSet property registered with name 'name'.
bool defineSet(const char *name, const char *argName, int setNum, const RooArgSet *set=nullptr)
Define TObject property name 'name' mapped to object in slot 'setNum' in RooCmdArg with name argName ...
bool ok(bool verbose) const
Return true of parsing was successful.
bool defineObject(const char *name, const char *argName, int setNum, const TObject *obj=nullptr, bool isArray=false)
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 convEmptyToNull=false) const
Return string property registered with name 'name'.
bool defineString(const char *name, const char *argName, int stringNum, const char *defValue="", bool appendMode=false)
Define double property name 'name' mapped to double in slot 'stringNum' in RooCmdArg with name argNam...
bool defineInt(const char *name, const char *argName, int intNum, int defValue=0)
Define integer property name 'name' mapped to integer in slot 'intNum' in RooCmdArg with name argName...
void allowUndefined(bool flag=true)
If flag is true the processing of unrecognized RooCmdArgs is not considered an error.
int getInt(const char *name, int defaultValue=0) const
Return integer property registered with name 'name'.
TObject * getObject(const char *name, TObject *obj=nullptr) const
Return TObject property registered with name 'name'.
Combines several disjunct datasets into one.
Container class to hold N-dimensional binned data.
Container class to hold unbinned data.
Graphical representation of binned data based on the TGraphAsymmErrors class.
Collection class for internal use, storing a collection of RooAbsArg pointers in a doubly linked list...
bool Replace(const TObject *oldArg, const TObject *newArg)
Replace object 'oldArg' in collection with new object 'newArg'.
void Delete(Option_t *o=nullptr) override
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)
TObject * FindObject(const char *name) const override
Return pointer to object with given name.
Connects several RooAbsCategory objects into a single category.
@ kRenamedArg
TNamed flag to indicate that some RooAbsArg has been renamed (flag set in new name)
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 constexpr double infinity()
Return internal infinity representation.
Plot frame and a container for graphics objects within that frame.
void addObject(TObject *obj, Option_t *drawOptions="", bool invisible=false)
Add a generic object to this plot.
TObject * findObject(const char *name, const TClass *tClass=nullptr) const
Find the named object in our list of items and return a pointer to it.
double getFitRangeNEvt() const
Return the number of events in the fit range.
TAttLine * getAttLine(const char *name=nullptr) const
Return a pointer to the line attributes of the named object in this plot, or zero if the named object...
TAttFill * getAttFill(const char *name=nullptr) const
Return a pointer to the fill attributes of the named object in this plot, or zero if the named object...
RooAbsRealLValue * getPlotVar() const
TAttMarker * getAttMarker(const char *name=nullptr) const
Return a pointer to the marker attributes of the named object in this plot, or zero if the named obje...
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 invisible=false, bool refreshNorm=false)
Add the specified plotable object to our plot.
double getFitRangeBinW() const
Return the bin width that is being used to normalise the PDF.
A 'mix-in' base class that define the standard RooFit plotting and printing methods.
Variable that can be changed from the outside.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
RooAbsPdf * getPdf(RooStringView catName) const
Return the p.d.f associated with the given index category name.
const RooAbsCategoryLValue & indexCat() const
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
static void destroy(const TObject *obj)
Register deletion of object 'obj'.
static void create(const TObject *obj)
Register creation of object 'obj'.
TTree-backed data storage.
Uses std::vector 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=nullptr)=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.
2-D histogram with a float per channel (see TH1 documentation)
Service class for 2-D histogram classes.
The 3-D histogram classes derived from the 1-D histogram classes.
The TNamed class is the base class for all named ROOT classes.
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
Mother of all ROOT objects.
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.
A Pave (see TPave) with text, lines or/and boxes inside.
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 ZVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg YVar(const RooAbsRealLValue &var, const RooCmdArg &arg={})
RooCmdArg AxisLabel(const char *name)
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.
OwningPtr< T > makeOwningPtr(std::unique_ptr< T > &&ptr)
Internal helper to turn a std::unique_ptr<T> into an OwningPtr.
T * OwningPtr
An alias for raw pointers for indicating that the return type of a RooFit function is an owning point...
const char * addToHistName
RooAbsData::ErrorType etype
static uint64_t sum(uint64_t i)