121 std::vector<std::string> out;
124 out.push_back(
elem.val());
142 return data.components.size() == pdf->
indexCat().size();
156 std::vector<double> edges;
162 Var(
int n) : nbins(
n), min(0), max(
n) {}
175bool isNumber(
const std::string &str)
183 for (
size_t i = 0; i < str.size(); ++i) {
186 if (std::isdigit(
c)) {
224 if (!
p.has_child(
"name")) {
227 if (
auto n =
p.find(
"value"))
228 v.setVal(
n->val_double());
230 if (
auto n =
p.find(
"nbins"))
231 v.setBins(
n->val_int());
232 if (
auto n =
p.find(
"relErr"))
233 v.setError(
v.getVal() *
n->val_double());
234 if (
auto n =
p.find(
"err"))
235 v.setError(
n->val_double());
236 if (
auto n =
p.find(
"const")) {
237 v.setConstant(
n->val_bool());
239 v.setConstant(
false);
251 return &((*out)[
"parameters"]);
259 if (
auto node =
p.find(
"namespaces")) {
260 for (
const auto &ns : node->
children()) {
298 if (
auto seq = node.
find(
"dict")) {
299 for (
const auto &
attr :
seq->children()) {
303 if (
auto seq = node.
find(
"tags")) {
304 for (
const auto &
attr :
seq->children()) {
313 std::stringstream expression;
314 std::string classname(
ex.tclass->GetName());
315 size_t colon = classname.find_last_of(
':');
316 expression << (
colon < classname.size() ? classname.substr(
colon + 1) : classname);
319 for (
auto k :
ex.arguments) {
320 expression << (first ?
"::" +
name +
"(" :
",");
322 if (k ==
"true" || k ==
"false") {
323 expression << (k ==
"true" ?
"1" :
"0");
324 }
else if (!
p.has_child(k)) {
326 errMsg <<
"node '" <<
name <<
"' is missing key '" << k <<
"'";
328 }
else if (
p[k].is_seq()) {
338 expression <<
p[k].val();
342 return expression.str();
368template <
typename...
Keys_t>
371 return node.
find(
"misc",
"ROOT_internal", keys...);
425 if (it.first ==
"factory_tag" || it.first ==
"PROD_TERM_TYPE")
428 (*node)[
"dict"].set_map()[it.first] << it.second;
434 if (
attr ==
"SnapShot_ExtRefClone" ||
attr ==
"RooRealConstant_Factory_Object")
437 (*node)[
"tags"].set_seq().append_child() <<
attr;
457 for (
const auto &
p : node[
"axes"].
children()) {
463 errMsg <<
"The observable \"" <<
name <<
"\" could not be found in the workspace!";
486 std::string
const &
type =
p[
"type"].val();
487 if (
type ==
"binned") {
490 }
else if (
type ==
"unbinned") {
493 getObservables(workspace,
p, varlist);
496 auto &coords =
p[
"entries"];
497 if (!coords.is_seq()) {
501 if (
p.has_child(
"weights")) {
502 auto &weights =
p[
"weights"];
503 if (coords.num_children() != weights.num_children()) {
506 for (
auto const &weight : weights.children()) {
511 for (
auto const &point : coords.children()) {
512 if (!point.is_seq()) {
514 errMsg <<
"coordinate point '" << i <<
"' is not a list!";
517 if (point.num_children() != varlist.
size()) {
521 for (
auto const &
pointj : point.children()) {
536 std::stringstream
ss;
537 ss <<
"RooJSONFactoryWSTool() failed to create dataset " <<
name << std::endl;
559 const std::vector<std::unique_ptr<RooAbsData>> &datasets)
572 mc->SetWS(workspace);
576 throw std::runtime_error(
"likelihood node not found!");
578 if (!
nllNode->has_child(
"distributions")) {
579 throw std::runtime_error(
"likelihood node has no distributions attached!");
581 if (!
nllNode->has_child(
"data")) {
582 throw std::runtime_error(
"likelihood node has no data attached!");
586 for (
auto &
nameNode : (*nllNode)[
"aux_distributions"].children()) {
592 for (
auto &
nameNode : (*nllNode)[
"data"].children()) {
594 for (
const auto &
d : datasets) {
597 observables.
add(*
d->get());
600 if (
nameNode.val() !=
"0" && !found)
601 throw std::runtime_error(
"dataset '" +
nameNode.val() +
"' cannot be found!");
619 std::map<std::string, RooAbsPdf *>
pdfMap;
638 out.add(*workspace.
arg(
child.val()));
643 mc->SetParametersOfInterest(
readArgSet(
"parameters_of_interest"));
644 mc->SetObservables(observables);
655 for (
auto &domain :
analysisNode[
"domains"].children()) {
659 for (
auto &var : (*thisDomain)[
"axes"].children()) {
668 for (
const auto &
p : pars) {
669 if (
mc->GetParametersOfInterest()->find(*
p))
678 mc->SetGlobalObservables(globs);
679 mc->SetNuisanceParameters(
nps);
682 if (
auto found =
mcAuxNode->find(
"combined_data_name")) {
707 std::vector<int> indices;
709 for (
auto &
n :
info[
"indices"].children()) {
710 indices.push_back(
n.val_int());
714 std::map<std::string, RooAbsPdf *>
pdfMap;
741 std::vector<int> indices;
742 for (
auto &
n :
info[
"indices"].children()) {
743 indices.push_back(
n.val_int());
745 if (indices.size() != labels.size()) {
750 std::map<std::string, std::unique_ptr<RooAbsData>>
dsMap;
757 std::unique_ptr<RooAbsData> &
component = *std::find_if(
758 datasets.begin(), datasets.end(), [&](
auto &
d) { return d && d->GetName() == componentName; });
768 datasets.emplace_back(std::move(
combined));
775 std::sort(
coll.
begin(),
coll.
end(), [](
auto &
l,
auto &
r) { return strcmp(l->GetName(), r->GetName()) < 0; });
800 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
820 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
863 if (str.empty() || !(std::isalpha(str[0]) || str[0] ==
'_')) {
870 if (!(std::isalnum(
c) ||
c ==
'_')) {
884 std::stringstream
ss;
885 ss <<
"RooJSONFactoryWSTool() name '" <<
name <<
"' is not valid!" << std::endl
886 <<
"Sanitize names by setting RooJSONFactoryWSTool::allowSanitizeNames = True." << std::endl;
913 if (
const auto &node = vars->find(
objname)) {
983 var[
"value"] <<
cv->getVal();
984 var[
"const"] <<
true;
986 var[
"value"] <<
rrv->getVal();
988 var[
"const"] <<
rrv->isConstant();
991 var[
"nbins"] <<
rrv->getBins();
1017 const std::string &formula)
1055 for (
auto const &
item :
simPdf->indexCat()) {
1061 child[
"index_cat"] <<
simPdf->indexCat().GetName();
1063 child[
"distributions"].set_seq();
1064 for (
auto const &
item :
simPdf->indexCat()) {
1065 child[
"distributions"].append_child() <<
simPdf->getPdf(
item.first.c_str())->GetName();
1077 auto &
collectionNode = (*_rootnodeOutput)[
dynamic_cast<RooAbsPdf const *
>(&func) ?
"distributions" :
"functions"];
1086 auto it = exporters.find(cl);
1087 if (it != exporters.end()) {
1088 for (
auto &exp : it->second) {
1091 if (!exp->exportObject(
this, &func,
elem)) {
1101 if (exp->autoExportDependants()) {
1114 const auto &dict = exportKeys.find(cl);
1115 if (dict == exportKeys.end()) {
1116 std::cerr <<
"unable to export class '" << cl->
GetName() <<
"' - no export keys available!\n"
1117 <<
"there are several possible reasons for this:\n"
1118 <<
" 1. " << cl->
GetName() <<
" is a custom class that you or some package you are using added.\n"
1120 <<
" is a ROOT class that nobody ever bothered to write a serialization definition for.\n"
1121 <<
" 3. something is wrong with your setup, e.g. you might have called "
1122 "RooFit::JSONIO::clearExportKeys() and/or never successfully read a file defining these "
1123 "keys with RooFit::JSONIO::loadExportKeys(filename)\n"
1124 <<
"either way, please make sure that:\n"
1125 <<
" 3: you are reading a file with export keys - call RooFit::JSONIO::printExportKeys() to "
1126 "see what is available\n"
1127 <<
" 2 & 1: you might need to write a serialization definition yourself. check "
1128 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to "
1129 "see how to do this!\n";
1133 elem[
"type"] << dict->second.type;
1137 for (
size_t i = 0; i <
nprox; ++i) {
1143 std::string
pname(
p->name());
1144 if (
pname[0] ==
'!')
1147 auto k = dict->second.proxies.find(
pname);
1148 if (k == dict->second.proxies.end()) {
1149 std::cerr <<
"failed to find key matching proxy '" <<
pname <<
"' for type '" << dict->second.type
1150 <<
"', encountered in '" << func.
GetName() <<
"', skipping" << std::endl;
1155 if (k->second.empty())
1165 elem[k->second] <<
r->absArg()->GetName();
1173 std::cerr <<
"unable to locate server of " << func.
GetName() << std::endl;
1211 std::stringstream
ss;
1212 ss <<
"RooJSONFactoryWSTool() function node " +
name +
" is not a map!";
1217 if (!prefix.empty())
1219 if (!
p.has_child(
"type")) {
1220 std::stringstream
ss;
1221 ss <<
"RooJSONFactoryWSTool() no type given for function '" <<
name <<
"', skipping." << std::endl;
1234 auto it = importers.find(
functype);
1236 if (it != importers.end()) {
1237 for (
auto &
imp : it->second) {
1239 ok =
imp->importArg(
this,
p);
1240 }
catch (
const std::exception &
e) {
1241 std::stringstream
ss;
1242 const auto *ptr =
imp.get();
1243 ss <<
"RooJSONFactoryWSTool() failed. The importer " <<
typeid(*ptr).name()
1244 <<
" emitted and error: " <<
e.what() << std::endl;
1254 std::string expression = ::generate(
expr->second,
p,
this);
1256 std::stringstream
ss;
1257 ss <<
"RooJSONFactoryWSTool() failed to create " <<
expr->second.tclass->GetName() <<
" '" <<
name
1258 <<
"', skipping. expression was\n"
1259 << expression << std::endl;
1263 std::stringstream
ss;
1264 ss <<
"RooJSONFactoryWSTool() no handling for type '" <<
functype <<
"' implemented, skipping."
1266 <<
"there are several possible reasons for this:\n"
1267 <<
" 1. " <<
functype <<
" is a custom type that is not available in RooFit.\n"
1269 <<
" is a ROOT class that nobody ever bothered to write a deserialization definition for.\n"
1270 <<
" 3. something is wrong with your setup, e.g. you might have called "
1271 "RooFit::JSONIO::clearFactoryExpressions() and/or never successfully read a file defining "
1272 "these expressions with RooFit::JSONIO::loadFactoryExpressions(filename)\n"
1273 <<
"either way, please make sure that:\n"
1274 <<
" 3: you are reading a file with factory expressions - call "
1275 "RooFit::JSONIO::printFactoryExpressions() "
1276 "to see what is available\n"
1277 <<
" 2 & 1: you might need to write a deserialization definition yourself. check "
1278 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to see "
1287 std::stringstream err;
1288 err <<
"something went wrong importing function '" <<
name <<
"'.";
1325 std::string
name = var->GetName();
1329 if (var->getBinning().isUniform()) {
1330 obsNode[
"min"] << var->getMin();
1331 obsNode[
"max"] << var->getMax();
1332 obsNode[
"nbins"] << var->getBins();
1334 auto &edges =
obsNode[
"edges"];
1336 double val = var->getBinning().binLow(0);
1337 edges.append_child() << val;
1338 for (
int i = 0; i < var->getBinning().numBins(); ++i) {
1339 val = var->getBinning().binHigh(i);
1340 edges.append_child() << val;
1362 for (std::size_t i = 0; i <
n; ++i) {
1363 double w = contents[i];
1385 auto &labels = node[
"labels"].
set_seq();
1386 auto &indices = node[
"indices"].
set_seq();
1388 for (
auto const &
item : cat) {
1390 if (std::isalpha(
item.first[0])) {
1392 if (label !=
item.first) {
1393 oocoutW(
nullptr, IO) <<
"RooFitHS3: changed '" <<
item.first <<
"' to '" << label
1394 <<
"' to become a valid name";
1398 "' to make a valid name!");
1401 labels.append_child() << label;
1402 indices.append_child() <<
item.second;
1424 " has several category observables!");
1464 if (std::isalpha(
catName[0])) {
1468 <<
"' to become a valid name";
1472 "' to make a valid name!");
1500 " has several category observables!");
1522 if (
auto weightVar = variables.find(
"weightVar")) {
1523 variables.remove(*weightVar);
1528 output[
"type"] <<
"binned";
1541 if (
data.isWeighted() && variables.size() == 1) {
1543 auto &
x =
static_cast<RooRealVar const &
>(*variables[0]);
1544 std::vector<double> contents;
1546 for (; i <
data.numEntries(); ++i) {
1548 if (
x.getBin() != i)
1550 contents.push_back(
data.weight());
1552 if (i ==
x.getBins())
1555 output[
"type"] <<
"binned";
1564 output[
"type"] <<
"unbinned";
1566 auto &coords =
output[
"entries"].set_seq();
1569 for (
int i = 0; i <
data.numEntries(); ++i) {
1571 coords.append_child().fill_seq(variables, [](
auto x) {
return static_cast<RooRealVar *
>(
x)->getVal(); });
1573 if (
data.isWeighted()) {
1575 if (
data.weight() != 1.)
1598 if (node.has_child(
"edges")) {
1599 std::vector<double> edges;
1600 for (
auto const &
bound : node[
"edges"].children()) {
1601 edges.push_back(
bound.val_double());
1603 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(), edges[0],
1604 edges[edges.size() - 1]);
1605 RooBinning bins(obs->getMin(), obs->getMax());
1606 for (
auto b : edges) {
1609 obs->setBinning(bins);
1612 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(),
1613 node[
"min"].val_double(), node[
"max"].val_double());
1614 obs->setBins(node[
"nbins"].val_int());
1633std::unique_ptr<RooDataHist>
1636 if (!
n.has_child(
"contents"))
1639 JSONNode const &contents =
n[
"contents"];
1645 if (
n.has_child(
"errors")) {
1653 std::stringstream
errMsg;
1654 errMsg <<
"inconsistent bin numbers: contents=" << contents.
num_children() <<
", bins=" << bins.size();
1657 auto dh = std::make_unique<RooDataHist>(
name,
name, vars);
1666 for (
auto const &err :
errors->children()) {
1695 std::stringstream
ss;
1696 ss <<
"RooJSONFactoryWSTool() node '" <<
name <<
"' is not a map, skipping.";
1697 oocoutE(
nullptr, InputArguments) <<
ss.str() << std::endl;
1703 if (
attrNode->has_child(
"is_const_var") && (*
attrNode)[
"is_const_var"].val_int() == 1) {
1725 for (
const auto &
p :
varsNode->children()) {
1729 if (
auto seq =
n.find(
"functions")) {
1730 for (
const auto &
p :
seq->children()) {
1734 if (
auto seq =
n.find(
"distributions")) {
1735 for (
const auto &
p :
seq->children()) {
1745 auto pdf =
mc.GetPdf();
1748 for (std::size_t i = 0; i < std::max(
combDataSets.size(), std::size_t(1)); ++i) {
1764 std::map<std::string, std::string>
mapping;
1780 auto pdf =
mc.GetPdf();
1789 nllNode[
"distributions"].set_seq();
1795 for (
auto const &
item :
simPdf->indexCat()) {
1797 nllNode[
"distributions"].append_child() <<
simPdf->getPdf(
item.first)->GetName();
1802 nllNode[
"distributions"].append_child() << it.first;
1803 nllNode[
"data"].append_child() << it.second;
1807 nllNode[
"distributions"].append_child() << pdf->GetName();
1808 nllNode[
"data"].append_child() << 0;
1811 if (
mc.GetExternalConstraints()) {
1814 for (
const auto &
constr : *
mc.GetExternalConstraints()) {
1820 if (!args || !args->size())
1823 std::vector<std::string> names;
1824 names.reserve(args->size());
1826 names.push_back(arg->GetName());
1827 std::sort(names.begin(), names.end());
1831 writeList(
"parameters_of_interest",
mc.GetParametersOfInterest());
1835 if (
mc.GetNuisanceParameters() &&
mc.GetNuisanceParameters()->size() > 0) {
1845 if (
mc.GetGlobalObservables() &&
mc.GetGlobalObservables()->size() > 0) {
1855 if (
mc.GetParametersOfInterest() &&
mc.GetParametersOfInterest()->size() > 0) {
1882 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1887 std::vector<RooAbsPdf *>
allpdfs;
1889 if (!arg->hasClients()) {
1890 if (
auto *pdf =
dynamic_cast<RooAbsPdf *
>(arg)) {
1900 std::vector<RooAbsReal *>
allfuncs;
1902 if (!arg->hasClients()) {
1903 if (
auto *func =
dynamic_cast<RooAbsReal *
>(arg)) {
1917 std::vector<RooAbsData *>
alldata;
1924 std::vector<RooJSONFactoryWSTool::CombinedData>
combData;
1927 if (!
data.components.empty())
1928 combData.push_back(
data);
1952 for (
const auto &pdf :
allpdfs) {
1953 if (pdf->dependsOn(*arg)) {
1965 if (
name !=
"default_values") {
1984 std::stringstream
ss(s);
1996 std::stringstream
ss(s);
2007 std::stringstream
ss;
2019 std::stringstream
ss;
2031 std::unique_ptr<JSONTree> tree = JSONTree::create();
2034 auto &metadata =
n[
"metadata"].set_map();
2073 std::ofstream out(
filename.c_str());
2074 if (!out.is_open()) {
2075 std::stringstream
ss;
2076 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2106 std::ofstream out(
filename.c_str());
2107 if (!out.is_open()) {
2108 std::stringstream
ss;
2109 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2122 for (
auto &
a :
seq->children()) {
2133 auto &
tags = (*node)[
"tags"];
2143 if (
auto dict =
attrNode->find(
"dict")) {
2144 if (
auto *
a = dict->find(
attrib)) {
2152 const std::string &
value)
2155 auto &dict = (*node)[
"dict"];
2173 auto metadata =
n.find(
"metadata");
2174 if (!metadata || !metadata->find(
"hs3_version")) {
2175 std::stringstream
ss;
2176 ss <<
"The HS3 version is missing in the JSON!\n"
2177 <<
"Please include the HS3 version in the metadata field, e.g.:\n"
2178 <<
" \"metadata\" :\n"
2185 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2186 if (
auto domains =
n.find(
"domains")) {
2203 for (
const auto &var :
snsh[
"parameters"].children()) {
2229 std::vector<std::unique_ptr<RooAbsData>> datasets;
2231 for (
const auto &
p :
dataNode->children()) {
2246 for (
auto const &
d : datasets) {
2249 for (
auto const &obs : *
d->get()) {
2270 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2272 if (this->
workspace()->getSnapshot(
"default_values")) {
2289 std::stringstream
ss;
2290 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2306 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2322 std::stringstream
ss;
2323 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2336 bool isVariable =
true;
2337 if (
n.find(
"type")) {
2352 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2353 if (
auto domains =
n.find(
"domains"))
2367 const auto &var =
snsh[
"parameters"].child(0);
2406 throw std::runtime_error(s);
2419 for (
char c : str) {
2424 case '(':
result +=
'_';
break;
2429 case '.':
result +=
"_dot_";
break;
2430 case '@':
result +=
"at";
break;
2431 case '-':
result +=
"minus";
break;
2432 case '/':
result +=
"_div_";
break;
2456 for (
auto *pdf : ws.
allPdfs()) {
2457 if (!pdf->hasClients()) {
2463 if (!func->hasClients()) {
2536 for (
auto *obj :
tmpWS.allVars()) {
2543 for (
auto *obj :
tmpWS.allFunctions()) {
2550 for (
auto *obj :
tmpWS.allPdfs()) {
2557 for (
auto *obj :
tmpWS.allResolutionModels()) {
2568 for (
auto *obj : *
data->get()) {
2592 for (
auto *
data :
tmpWS.allEmbeddedData()) {
2595 for (
auto *obj : *
data->get()) {
2603 std::cerr <<
"Warning: found snapshot that is not a RooArgSet, skipping\n";
2613 for (
auto *arg : *
snsh) {
2621 for (
auto *obj :
tmpWS.allGenericObjects()) {
2626 std::cerr <<
"Warning: object " << obj->GetName() <<
" is not TNamed, cannot rename.\n";
2637 for (
auto *obs :
mc->GetObservables()->get()) {
2642 for (
auto *poi :
mc->GetParametersOfInterest()->get()) {
2647 for (
auto *
nuis :
mc->GetNuisanceParameters()->get()) {
2652 for (
auto *
glob :
mc->GetGlobalObservables()->get()) {
2659 std::string
wsName = std::string{ws.
GetName()} +
"_sanitized";
std::unique_ptr< RooFit::Detail::JSONTree > varJSONString(const JSONNode &treeRoot)
double toDouble(const char *s)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
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 filename
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 np
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 r
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 Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
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 type
const_iterator begin() const
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
TClass * IsA() const override
void setStringAttribute(const Text_t *key, const Text_t *value)
Associate string 'value' to this object under key 'key'.
RooFit::OwningPtr< RooArgSet > getParameters(const RooAbsData *data, bool stripDisconnected=true) const
Create a list of leaf nodes in the arg tree starting with ourself as top node that don't match any of...
const std::set< std::string > & attributes() const
const RefCountList_t & servers() const
List of all servers of this object.
const std::map< std::string, std::string > & stringAttributes() const
Int_t numProxies() const
Return the number of registered proxies.
void setAttribute(const Text_t *name, bool value=true)
Set (default) or clear a named boolean attribute of this object.
RooAbsProxy * getProxy(Int_t index) const
Return the nth proxy from the proxy list.
A space to attach TBranches.
Abstract container object that can hold multiple RooAbsArg objects.
bool equals(const RooAbsCollection &otherColl) const
Check if this and other collection have identically-named contents.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
virtual bool addOwned(RooAbsArg &var, bool silent=false)
Add an argument and transfer the ownership to the collection.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
std::unique_ptr< RooArgSet > getAllConstraints(const RooArgSet &observables, RooArgSet &constrainedParams, bool stripDisconnected=true) const
This helper function finds and collects all constraints terms of all component p.d....
Abstract interface for proxy classes.
Abstract base class for objects that represent a real value and implements functionality common to al...
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.
Abstract interface for RooAbsArg proxy classes.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Implements a RooAbsBinning in terms of an array of boundary values, posing no constraints on the choi...
bool addBoundary(double boundary)
Add bin boundary at given value.
Object to represent discrete states.
Represents a constant real-valued object.
Container class to hold N-dimensional binned data.
virtual JSONNode & set_map()=0
virtual JSONNode & append_child()=0
virtual children_view children()
virtual size_t num_children() const =0
virtual JSONNode & set_seq()=0
virtual bool is_seq() const =0
virtual bool is_map() const =0
virtual std::string key() const =0
JSONNode const * find(std::string const &key) const
static std::unique_ptr< JSONTree > create()
static RooMsgService & instance()
Return reference to singleton instance.
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
const RooAbsCategoryLValue & indexCat() const
< A class that holds configuration information for a model using a workspace as a store
Persistable container for RooFit projects.
TObject * obj(RooStringView name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
const RooArgSet * getSnapshot(const char *name) const
Return the RooArgSet containing a snapshot of variables contained in the workspace.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooArgSet allResolutionModels() const
Return set with all resolution model objects.
bool saveSnapshot(RooStringView, const char *paramNames)
Save snapshot of values and attributes (including "Constant") of given parameters.
RooArgSet allPdfs() const
Return set with all probability density function objects.
std::list< RooAbsData * > allData() const
Return list of all dataset in the workspace.
RooLinkedList const & getSnapshots() const
std::list< TObject * > allGenericObjects() const
Return list of all generic objects in the workspace.
RooAbsReal * function(RooStringView name) const
Retrieve function (RooAbsReal) with given name. Note that all RooAbsPdfs are also RooAbsReals....
RooAbsArg * arg(RooStringView name) const
Return RooAbsArg with given name. A null pointer is returned if none is found.
const RooArgSet & components() const
RooArgSet allFunctions() const
Return set with all function objects.
RooFactoryWSTool & factory()
Return instance to factory tool.
RooRealVar * var(RooStringView name) const
Retrieve real-valued variable (RooRealVar) with given name. A null pointer is returned if not found.
bool loadSnapshot(const char *name)
Load the values and attributes of the parameters in the snapshot saved with the given name.
bool import(const RooAbsArg &arg, 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 RooCmdArg &arg9={})
Import a RooAbsArg object, e.g.
TClass instances represent classes, structs and namespaces in the ROOT type system.
The TNamed class is the base class for all named ROOT classes.
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
RooCmdArg RecycleConflictNodes(bool flag=true)
RooConstVar & RooConst(double val)
RooCmdArg Silence(bool flag=true)
RooCmdArg Index(RooCategory &icat)
RooCmdArg WeightVar(const char *name="weight", bool reinterpretAsWeight=false)
RooCmdArg Import(const char *state, TH1 &histo)
std::string makeValidVarName(std::string const &in)
ImportExpressionMap & importExpressions()
ExportKeysMap & exportKeys()