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) {}
181bool isNumber(
const std::string &str)
189 for (
size_t i = 0; i < str.size(); ++i) {
192 if (std::isdigit(
c)) {
230 if (!
p.has_child(
"name")) {
233 if (
auto n =
p.find(
"value"))
234 v.setVal(
n->val_double());
236 if (
auto n =
p.find(
"nbins"))
237 v.setBins(
n->val_int());
238 if (
auto n =
p.find(
"relErr"))
239 v.setError(
v.getVal() *
n->val_double());
240 if (
auto n =
p.find(
"err"))
241 v.setError(
n->val_double());
242 if (
auto n =
p.find(
"const")) {
243 v.setConstant(
n->val_bool());
245 v.setConstant(
false);
257 return &((*out)[
"parameters"]);
262 if (val.
find(
"edges")) {
264 this->edges.push_back(
child.val_double());
266 this->nbins = this->edges.size();
267 this->min = this->edges[0];
268 this->max = this->edges[this->nbins - 1];
270 if (!val.
find(
"nbins")) {
273 this->nbins = val[
"nbins"].
val_int();
275 if (!val.
find(
"min")) {
280 if (!val.
find(
"max")) {
293 if (
auto node =
p.find(
"namespaces")) {
294 for (
const auto &ns : node->
children()) {
332 if (
auto seq = node.
find(
"dict")) {
333 for (
const auto &
attr :
seq->children()) {
337 if (
auto seq = node.
find(
"tags")) {
338 for (
const auto &
attr :
seq->children()) {
347 std::stringstream expression;
348 std::string classname(
ex.tclass->GetName());
349 size_t colon = classname.find_last_of(
':');
350 expression << (
colon < classname.size() ? classname.substr(
colon + 1) : classname);
353 for (
auto k :
ex.arguments) {
354 expression << (first ?
"::" +
name +
"(" :
",");
356 if (k ==
"true" || k ==
"false") {
357 expression << (k ==
"true" ?
"1" :
"0");
358 }
else if (!
p.has_child(k)) {
360 errMsg <<
"node '" <<
name <<
"' is missing key '" << k <<
"'";
362 }
else if (
p[k].is_seq()) {
372 expression <<
p[k].val();
376 return expression.str();
402template <
typename...
Keys_t>
405 return node.
find(
"misc",
"ROOT_internal", keys...);
459 if (it.first ==
"factory_tag" || it.first ==
"PROD_TERM_TYPE")
462 (*node)[
"dict"].set_map()[it.first] << it.second;
468 if (
attr ==
"SnapShot_ExtRefClone" ||
attr ==
"RooRealConstant_Factory_Object")
471 (*node)[
"tags"].set_seq().append_child() <<
attr;
491 std::map<std::string, Var> vars;
492 for (
const auto &
p : node[
"axes"].
children()) {
496 for (
auto v : vars) {
497 std::string
name(
v.first);
502 errMsg <<
"The observable \"" <<
name <<
"\" could not be found in the workspace!";
525 std::string
const &
type =
p[
"type"].val();
526 if (
type ==
"binned") {
529 }
else if (
type ==
"unbinned") {
532 getObservables(workspace,
p, vars);
535 auto &coords =
p[
"entries"];
536 if (!coords.is_seq()) {
540 if (
p.has_child(
"weights")) {
541 auto &weights =
p[
"weights"];
542 if (coords.num_children() != weights.num_children()) {
545 for (
auto const &weight : weights.children()) {
550 for (
auto const &point : coords.children()) {
551 if (!point.is_seq()) {
553 errMsg <<
"coordinate point '" << i <<
"' is not a list!";
556 if (point.num_children() != varlist.
size()) {
560 for (
auto const &
pointj : point.children()) {
575 std::stringstream
ss;
576 ss <<
"RooJSONFactoryWSTool() failed to create dataset " <<
name << std::endl;
598 const std::vector<std::unique_ptr<RooAbsData>> &datasets)
611 mc->SetWS(workspace);
615 throw std::runtime_error(
"likelihood node not found!");
617 if (!
nllNode->has_child(
"distributions")) {
618 throw std::runtime_error(
"likelihood node has no distributions attached!");
620 if (!
nllNode->has_child(
"data")) {
621 throw std::runtime_error(
"likelihood node has no data attached!");
625 for (
auto &
nameNode : (*nllNode)[
"aux_distributions"].children()) {
631 for (
auto &
nameNode : (*nllNode)[
"data"].children()) {
633 for (
const auto &
d : datasets) {
636 observables.
add(*
d->get());
639 if (
nameNode.val() !=
"0" && !found)
640 throw std::runtime_error(
"dataset '" +
nameNode.val() +
"' cannot be found!");
658 std::map<std::string, RooAbsPdf *>
pdfMap;
677 out.add(*workspace.
arg(
child.val()));
682 mc->SetParametersOfInterest(
readArgSet(
"parameters_of_interest"));
683 mc->SetObservables(observables);
694 for (
auto &domain :
analysisNode[
"domains"].children()) {
698 for (
auto &var : (*thisDomain)[
"axes"].children()) {
707 for (
const auto &
p : pars) {
708 if (
mc->GetParametersOfInterest()->find(*
p))
717 mc->SetGlobalObservables(globs);
718 mc->SetNuisanceParameters(
nps);
721 if (
auto found =
mcAuxNode->find(
"combined_data_name")) {
746 std::vector<int> indices;
748 for (
auto &
n :
info[
"indices"].children()) {
749 indices.push_back(
n.val_int());
753 std::map<std::string, RooAbsPdf *>
pdfMap;
780 std::vector<int> indices;
781 for (
auto &
n :
info[
"indices"].children()) {
782 indices.push_back(
n.val_int());
784 if (indices.size() != labels.size()) {
789 std::map<std::string, std::unique_ptr<RooAbsData>>
dsMap;
796 std::unique_ptr<RooAbsData> &
component = *std::find_if(
797 datasets.begin(), datasets.end(), [&](
auto &
d) { return d && d->GetName() == componentName; });
807 datasets.emplace_back(std::move(
combined));
814 std::sort(
coll.
begin(),
coll.
end(), [](
auto &
l,
auto &
r) { return strcmp(l->GetName(), r->GetName()) < 0; });
839 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
859 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
902 if (str.empty() || !(std::isalpha(str[0]) || str[0] ==
'_')) {
909 if (!(std::isalnum(
c) ||
c ==
'_')) {
923 std::stringstream
ss;
924 ss <<
"RooJSONFactoryWSTool() name '" <<
name <<
"' is not valid!" << std::endl
925 <<
"Sanitize names by setting RooJSONFactoryWSTool::allowSanitizeNames = True." << std::endl;
952 if (
const auto &node = vars->find(
objname)) {
1027 var[
"value"] <<
cv->getVal();
1028 var[
"const"] <<
true;
1030 var[
"value"] <<
rrv->getVal();
1031 if (
rrv->isConstant()) {
1032 var[
"const"] <<
rrv->isConstant();
1034 if (
rrv->getBins() != 100) {
1035 var[
"nbins"] <<
rrv->getBins();
1061 const std::string &formula)
1099 for (
auto const &
item :
simPdf->indexCat()) {
1105 child[
"index_cat"] <<
simPdf->indexCat().GetName();
1107 child[
"distributions"].set_seq();
1108 for (
auto const &
item :
simPdf->indexCat()) {
1109 child[
"distributions"].append_child() <<
simPdf->getPdf(
item.first.c_str())->GetName();
1121 auto &
collectionNode = (*_rootnodeOutput)[
dynamic_cast<RooAbsPdf const *
>(&func) ?
"distributions" :
"functions"];
1130 auto it = exporters.find(cl);
1131 if (it != exporters.end()) {
1132 for (
auto &exp : it->second) {
1135 if (!exp->exportObject(
this, &func,
elem)) {
1145 if (exp->autoExportDependants()) {
1158 const auto &dict = exportKeys.find(cl);
1159 if (dict == exportKeys.end()) {
1160 std::cerr <<
"unable to export class '" << cl->
GetName() <<
"' - no export keys available!\n"
1161 <<
"there are several possible reasons for this:\n"
1162 <<
" 1. " << cl->
GetName() <<
" is a custom class that you or some package you are using added.\n"
1164 <<
" is a ROOT class that nobody ever bothered to write a serialization definition for.\n"
1165 <<
" 3. something is wrong with your setup, e.g. you might have called "
1166 "RooFit::JSONIO::clearExportKeys() and/or never successfully read a file defining these "
1167 "keys with RooFit::JSONIO::loadExportKeys(filename)\n"
1168 <<
"either way, please make sure that:\n"
1169 <<
" 3: you are reading a file with export keys - call RooFit::JSONIO::printExportKeys() to "
1170 "see what is available\n"
1171 <<
" 2 & 1: you might need to write a serialization definition yourself. check "
1172 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to "
1173 "see how to do this!\n";
1177 elem[
"type"] << dict->second.type;
1181 for (
size_t i = 0; i <
nprox; ++i) {
1187 std::string
pname(
p->name());
1188 if (
pname[0] ==
'!')
1191 auto k = dict->second.proxies.find(
pname);
1192 if (k == dict->second.proxies.end()) {
1193 std::cerr <<
"failed to find key matching proxy '" <<
pname <<
"' for type '" << dict->second.type
1194 <<
"', encountered in '" << func.
GetName() <<
"', skipping" << std::endl;
1199 if (k->second.empty())
1209 elem[k->second] <<
r->absArg()->GetName();
1217 std::cerr <<
"unable to locate server of " << func.
GetName() << std::endl;
1255 std::stringstream
ss;
1256 ss <<
"RooJSONFactoryWSTool() function node " +
name +
" is not a map!";
1261 if (!prefix.empty())
1263 if (!
p.has_child(
"type")) {
1264 std::stringstream
ss;
1265 ss <<
"RooJSONFactoryWSTool() no type given for function '" <<
name <<
"', skipping." << std::endl;
1278 auto it = importers.find(
functype);
1280 if (it != importers.end()) {
1281 for (
auto &
imp : it->second) {
1282 ok =
imp->importArg(
this,
p);
1290 std::string expression = ::generate(
expr->second,
p,
this);
1292 std::stringstream
ss;
1293 ss <<
"RooJSONFactoryWSTool() failed to create " <<
expr->second.tclass->GetName() <<
" '" <<
name
1294 <<
"', skipping. expression was\n"
1295 << expression << std::endl;
1299 std::stringstream
ss;
1300 ss <<
"RooJSONFactoryWSTool() no handling for type '" <<
functype <<
"' implemented, skipping."
1302 <<
"there are several possible reasons for this:\n"
1303 <<
" 1. " <<
functype <<
" is a custom type that is not available in RooFit.\n"
1305 <<
" is a ROOT class that nobody ever bothered to write a deserialization definition for.\n"
1306 <<
" 3. something is wrong with your setup, e.g. you might have called "
1307 "RooFit::JSONIO::clearFactoryExpressions() and/or never successfully read a file defining "
1308 "these expressions with RooFit::JSONIO::loadFactoryExpressions(filename)\n"
1309 <<
"either way, please make sure that:\n"
1310 <<
" 3: you are reading a file with factory expressions - call "
1311 "RooFit::JSONIO::printFactoryExpressions() "
1312 "to see what is available\n"
1313 <<
" 2 & 1: you might need to write a deserialization definition yourself. check "
1314 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to see "
1323 std::stringstream err;
1324 err <<
"something went wrong importing function '" <<
name <<
"'.";
1361 std::string
name = var->GetName();
1365 if (var->getBinning().isUniform()) {
1366 obsNode[
"min"] << var->getMin();
1367 obsNode[
"max"] << var->getMax();
1368 obsNode[
"nbins"] << var->getBins();
1370 auto &edges =
obsNode[
"edges"];
1372 double val = var->getBinning().binLow(0);
1373 edges.append_child() << val;
1374 for (
int i = 0; i < var->getBinning().numBins(); ++i) {
1375 val = var->getBinning().binHigh(i);
1376 edges.append_child() << val;
1398 for (std::size_t i = 0; i <
n; ++i) {
1399 double w = contents[i];
1421 auto &labels = node[
"labels"].
set_seq();
1422 auto &indices = node[
"indices"].
set_seq();
1424 for (
auto const &
item : cat) {
1426 if (std::isalpha(
item.first[0])) {
1428 if (label !=
item.first) {
1429 oocoutW(
nullptr, IO) <<
"RooFitHS3: changed '" <<
item.first <<
"' to '" << label
1430 <<
"' to become a valid name";
1434 "' to make a valid name!");
1437 labels.append_child() << label;
1438 indices.append_child() <<
item.second;
1460 " has several category observables!");
1500 if (std::isalpha(
catName[0])) {
1504 <<
"' to become a valid name";
1508 "' to make a valid name!");
1536 " has several category observables!");
1558 if (
auto weightVar = variables.find(
"weightVar")) {
1559 variables.remove(*weightVar);
1564 output[
"type"] <<
"binned";
1577 if (
data.isWeighted() && variables.size() == 1) {
1579 auto &
x =
static_cast<RooRealVar const &
>(*variables[0]);
1580 std::vector<double> contents;
1582 for (; i <
data.numEntries(); ++i) {
1584 if (
x.getBin() != i)
1586 contents.push_back(
data.weight());
1588 if (i ==
x.getBins())
1591 output[
"type"] <<
"binned";
1600 output[
"type"] <<
"unbinned";
1602 auto &coords =
output[
"entries"].set_seq();
1605 for (
int i = 0; i <
data.numEntries(); ++i) {
1607 coords.append_child().fill_seq(variables, [](
auto x) {
return static_cast<RooRealVar *
>(
x)->getVal(); });
1613 if (
data.isWeighted()) {
1615 if (
data.weight() != 1.)
1639 if (node.has_child(
"edges")) {
1640 std::vector<double> edges;
1641 for (
auto const &
bound : node[
"edges"].children()) {
1642 edges.push_back(
bound.val_double());
1644 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(), edges[0],
1645 edges[edges.size() - 1]);
1646 RooBinning bins(obs->getMin(), obs->getMax());
1647 for (
auto b : edges) {
1650 obs->setBinning(bins);
1653 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(),
1654 node[
"min"].val_double(), node[
"max"].val_double());
1655 obs->setBins(node[
"nbins"].val_int());
1674std::unique_ptr<RooDataHist>
1677 if (!
n.has_child(
"contents"))
1680 JSONNode const &contents =
n[
"contents"];
1686 if (
n.has_child(
"errors")) {
1694 std::stringstream
errMsg;
1695 errMsg <<
"inconsistent bin numbers: contents=" << contents.
num_children() <<
", bins=" << bins.size();
1698 auto dh = std::make_unique<RooDataHist>(
name,
name, vars);
1707 for (
auto const &err :
errors->children()) {
1736 std::stringstream
ss;
1737 ss <<
"RooJSONFactoryWSTool() node '" <<
name <<
"' is not a map, skipping.";
1738 oocoutE(
nullptr, InputArguments) <<
ss.str() << std::endl;
1744 if (
attrNode->has_child(
"is_const_var") && (*
attrNode)[
"is_const_var"].val_int() == 1) {
1766 for (
const auto &
p :
varsNode->children()) {
1770 if (
auto seq =
n.find(
"functions")) {
1771 for (
const auto &
p :
seq->children()) {
1775 if (
auto seq =
n.find(
"distributions")) {
1776 for (
const auto &
p :
seq->children()) {
1786 auto pdf =
mc.GetPdf();
1789 for (std::size_t i = 0; i < std::max(
combDataSets.size(), std::size_t(1)); ++i) {
1805 std::map<std::string, std::string>
mapping;
1821 auto pdf =
mc.GetPdf();
1830 nllNode[
"distributions"].set_seq();
1836 for (
auto const &
item :
simPdf->indexCat()) {
1838 nllNode[
"distributions"].append_child() <<
simPdf->getPdf(
item.first)->GetName();
1843 nllNode[
"distributions"].append_child() << it.first;
1844 nllNode[
"data"].append_child() << it.second;
1848 nllNode[
"distributions"].append_child() << pdf->GetName();
1849 nllNode[
"data"].append_child() << 0;
1852 if (
mc.GetExternalConstraints()) {
1855 for (
const auto &
constr : *
mc.GetExternalConstraints()) {
1861 if (!args || !args->size())
1864 std::vector<std::string> names;
1865 names.reserve(args->size());
1867 names.push_back(arg->GetName());
1868 std::sort(names.begin(), names.end());
1872 writeList(
"parameters_of_interest",
mc.GetParametersOfInterest());
1876 if (
mc.GetNuisanceParameters() &&
mc.GetNuisanceParameters()->size() > 0) {
1886 if (
mc.GetGlobalObservables() &&
mc.GetGlobalObservables()->size() > 0) {
1896 if (
mc.GetParametersOfInterest() &&
mc.GetParametersOfInterest()->size() > 0) {
1923 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1928 std::vector<RooAbsPdf *>
allpdfs;
1930 if (!arg->hasClients()) {
1931 if (
auto *pdf =
dynamic_cast<RooAbsPdf *
>(arg)) {
1941 std::vector<RooAbsReal *>
allfuncs;
1943 if (!arg->hasClients()) {
1944 if (
auto *func =
dynamic_cast<RooAbsReal *
>(arg)) {
1958 std::vector<RooAbsData *>
alldata;
1965 std::vector<RooJSONFactoryWSTool::CombinedData>
combData;
1968 if (!
data.components.empty())
1969 combData.push_back(
data);
1993 for (
const auto &pdf :
allpdfs) {
1994 if (pdf->dependsOn(*arg)) {
2006 if (
name !=
"default_values") {
2024 std::stringstream
ss(s);
2036 std::stringstream
ss(s);
2047 std::stringstream
ss;
2059 std::stringstream
ss;
2071 std::unique_ptr<JSONTree> tree = JSONTree::create();
2074 auto &metadata =
n[
"metadata"].set_map();
2113 std::ofstream out(
filename.c_str());
2114 if (!out.is_open()) {
2115 std::stringstream
ss;
2116 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2146 std::ofstream out(
filename.c_str());
2147 if (!out.is_open()) {
2148 std::stringstream
ss;
2149 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2162 for (
auto &
a :
seq->children()) {
2173 auto &
tags = (*node)[
"tags"];
2183 if (
auto dict =
attrNode->find(
"dict")) {
2184 if (
auto *
a = dict->find(
attrib)) {
2192 const std::string &
value)
2195 auto &dict = (*node)[
"dict"];
2213 auto metadata =
n.find(
"metadata");
2214 if (!metadata || !metadata->find(
"hs3_version")) {
2215 std::stringstream
ss;
2216 ss <<
"The HS3 version is missing in the JSON!\n"
2217 <<
"Please include the HS3 version in the metadata field, e.g.:\n"
2218 <<
" \"metadata\" :\n"
2225 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2226 if (
auto domains =
n.find(
"domains")) {
2243 for (
const auto &var :
snsh[
"parameters"].children()) {
2269 std::vector<std::unique_ptr<RooAbsData>> datasets;
2271 for (
const auto &
p :
dataNode->children()) {
2286 for (
auto const &
d : datasets) {
2304 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2306 if (this->
workspace()->getSnapshot(
"default_values")) {
2323 std::stringstream
ss;
2324 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2340 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2356 std::stringstream
ss;
2357 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2370 bool isVariable =
true;
2371 if (
n.find(
"type")) {
2386 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2387 if (
auto domains =
n.find(
"domains"))
2401 const auto &var =
snsh[
"parameters"].child(0);
2440 throw std::runtime_error(s);
2453 for (
char c : str) {
2458 case '(':
result +=
'_';
break;
2463 case '.':
result +=
"_dot_";
break;
2464 case '@':
result +=
"at";
break;
2465 case '-':
result +=
"minus";
break;
2466 case '/':
result +=
"_div_";
break;
2490 for (
auto *pdf : ws.
allPdfs()) {
2491 if (!pdf->hasClients()) {
2497 if (!func->hasClients()) {
2566 for (
auto *obj :
tmpWS.allVars()) {
2573 for (
auto *obj :
tmpWS.allFunctions()) {
2580 for (
auto *obj :
tmpWS.allPdfs()) {
2592 for (
auto *obj : *
data->get()) {
2616 for (
auto *
data :
tmpWS.allEmbeddedData()) {
2619 for (
auto *obj : *
data->get()) {
2627 std::cerr <<
"Warning: found snapshot that is not a RooArgSet, skipping\n";
2637 for (
auto *arg : *
snsh) {
2645 for (
auto *obj :
tmpWS.allGenericObjects()) {
2650 std::cerr <<
"Warning: object " << obj->GetName() <<
" is not TNamed, cannot rename.\n";
2661 for (
auto *obs :
mc->GetObservables()->get()) {
2666 for (
auto *poi :
mc->GetParametersOfInterest()->get()) {
2671 for (
auto *
nuis :
mc->GetNuisanceParameters()->get()) {
2676 for (
auto *
glob :
mc->GetGlobalObservables()->get()) {
2683 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 double val_double() const
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
virtual int val_int() 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.
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()