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 out.
add(*args,
true);
346 if (observables.
empty()) {
358 std::vector<RooAbsData *>
const &
data,
JSONNode &rootnode)
375 if (!var || !var->hasError()) {
410 "RooFitHS3: skipping parameter_stepwidths entry for unknown or non-real variable '" +
name +
"'.");
414 var->setError(
stepWidthNode.find(
"step_width")->val_double());
421 std::stringstream expression;
422 std::string classname(
ex.tclass->GetName());
423 size_t colon = classname.find_last_of(
':');
424 expression << (
colon < classname.size() ? classname.substr(
colon + 1) : classname);
427 for (
auto k :
ex.arguments) {
428 expression << (first ?
"::" +
name +
"(" :
",");
430 if (k ==
"true" || k ==
"false") {
431 expression << (k ==
"true" ?
"1" :
"0");
432 }
else if (!
p.has_child(k)) {
434 errMsg <<
"node '" <<
name <<
"' is missing key '" << k <<
"'";
436 }
else if (
p[k].is_seq()) {
446 expression <<
p[k].val();
450 return expression.str();
476template <
typename...
Keys_t>
479 return node.
find(
"misc",
"ROOT_internal", keys...);
533 if (it.first ==
"factory_tag" || it.first ==
"PROD_TERM_TYPE")
536 (*node)[
"dict"].set_map()[it.first] << it.second;
542 if (
attr ==
"SnapShot_ExtRefClone" ||
attr ==
"RooRealConstant_Factory_Object")
545 (*node)[
"tags"].set_seq().append_child() <<
attr;
565 for (
const auto &
p : node[
"axes"].
children()) {
571 errMsg <<
"The observable \"" <<
name <<
"\" could not be found in the workspace!";
594 std::string
const &
type =
p[
"type"].val();
595 if (
type ==
"binned") {
598 }
else if (
type ==
"unbinned") {
601 getObservables(workspace,
p, varlist);
604 auto &coords =
p[
"entries"];
605 if (!coords.is_seq()) {
609 if (
p.has_child(
"weights")) {
610 auto &weights =
p[
"weights"];
611 if (coords.num_children() != weights.num_children()) {
614 for (
auto const &weight : weights.children()) {
619 for (
auto const &point : coords.children()) {
620 if (!point.is_seq()) {
622 errMsg <<
"coordinate point '" << i <<
"' is not a list!";
625 if (point.num_children() != varlist.
size()) {
629 for (
auto const &
pointj : point.children()) {
644 std::stringstream
ss;
645 ss <<
"RooJSONFactoryWSTool() failed to create dataset " <<
name << std::endl;
667 const std::vector<std::unique_ptr<RooAbsData>> &datasets)
680 mc->SetWS(workspace);
684 throw std::runtime_error(
"likelihood node not found!");
686 if (!
nllNode->has_child(
"distributions")) {
687 throw std::runtime_error(
"likelihood node has no distributions attached!");
689 if (!
nllNode->has_child(
"data")) {
690 throw std::runtime_error(
"likelihood node has no data attached!");
694 for (
auto &
nameNode : (*nllNode)[
"aux_distributions"].children()) {
700 for (
auto &
nameNode : (*nllNode)[
"data"].children()) {
702 for (
const auto &
d : datasets) {
705 observables.
add(*
d->get(),
true);
708 if (
nameNode.val() !=
"0" && !found)
709 throw std::runtime_error(
"dataset '" +
nameNode.val() +
"' cannot be found!");
727 std::map<std::string, RooAbsPdf *>
pdfMap;
751 mc->SetParametersOfInterest(
readArgSet(
"parameters_of_interest"));
752 mc->SetObservables(observables);
763 for (
auto &domain :
analysisNode[
"domains"].children()) {
767 for (
auto &var : (*thisDomain)[
"axes"].children()) {
776 for (
const auto &
p : pars) {
777 if (
mc->GetParametersOfInterest()->find(*
p))
786 mc->SetGlobalObservables(globs);
787 mc->SetNuisanceParameters(
nps);
790 if (
auto found =
mcAuxNode->find(
"combined_data_name")) {
815 std::vector<int> indices;
817 for (
auto &
n :
info[
"indices"].children()) {
818 indices.push_back(
n.val_int());
822 std::map<std::string, RooAbsPdf *>
pdfMap;
849 std::vector<int> indices;
850 for (
auto &
n :
info[
"indices"].children()) {
851 indices.push_back(
n.val_int());
853 if (indices.size() != labels.size()) {
858 std::map<std::string, std::unique_ptr<RooAbsData>>
dsMap;
865 std::unique_ptr<RooAbsData> &
component = *std::find_if(
866 datasets.begin(), datasets.end(), [&](
auto &
d) { return d && d->GetName() == componentName; });
876 datasets.emplace_back(std::move(
combined));
883 std::sort(
coll.
begin(),
coll.
end(), [](
auto &
l,
auto &
r) { return strcmp(l->GetName(), r->GetName()) < 0; });
908 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
928 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
971 if (str.empty() || !(std::isalpha(str[0]) || str[0] ==
'_')) {
978 if (!(std::isalnum(
c) ||
c ==
'_')) {
992 std::stringstream
ss;
993 ss <<
"RooJSONFactoryWSTool() name '" <<
name <<
"' is not valid!" << std::endl
994 <<
"Sanitize names by setting RooJSONFactoryWSTool::allowSanitizeNames = True." << std::endl;
1021 if (
const auto &node = vars->find(
objname)) {
1089 var[
"value"] <<
cv->getVal();
1090 var[
"const"] <<
true;
1092 var[
"value"] <<
rrv->getVal();
1094 var[
"const"] <<
rrv->isConstant();
1096 var[
"min"] <<
rrv->getMin();
1097 var[
"max"] <<
rrv->getMax();
1100 var[
"nbins"] <<
rrv->getBins();
1126 const std::string &formula)
1164 for (
auto const &
item :
simPdf->indexCat()) {
1170 child[
"index_cat"] <<
simPdf->indexCat().GetName();
1172 child[
"distributions"].set_seq();
1173 for (
auto const &
item :
simPdf->indexCat()) {
1174 child[
"distributions"].append_child() <<
simPdf->getPdf(
item.first.c_str())->GetName();
1186 auto &
collectionNode = (*_rootnodeOutput)[
dynamic_cast<RooAbsPdf const *
>(&func) ?
"distributions" :
"functions"];
1195 auto it = exporters.find(cl);
1196 if (it != exporters.end()) {
1197 for (
auto &exp : it->second) {
1200 if (!exp->exportObject(
this, &func,
elem)) {
1210 if (exp->autoExportDependants()) {
1223 const auto &dict = exportKeys.find(cl);
1224 if (dict == exportKeys.end()) {
1225 std::cerr <<
"unable to export class '" << cl->
GetName() <<
"' - no export keys available!\n"
1226 <<
"there are several possible reasons for this:\n"
1227 <<
" 1. " << cl->
GetName() <<
" is a custom class that you or some package you are using added.\n"
1229 <<
" is a ROOT class that nobody ever bothered to write a serialization definition for.\n"
1230 <<
" 3. something is wrong with your setup, e.g. you might have called "
1231 "RooFit::JSONIO::clearExportKeys() and/or never successfully read a file defining these "
1232 "keys with RooFit::JSONIO::loadExportKeys(filename)\n"
1233 <<
"either way, please make sure that:\n"
1234 <<
" 3: you are reading a file with export keys - call RooFit::JSONIO::printExportKeys() to "
1235 "see what is available\n"
1236 <<
" 2 & 1: you might need to write a serialization definition yourself. check "
1237 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to "
1238 "see how to do this!\n";
1242 elem[
"type"] << dict->second.type;
1246 for (
size_t i = 0; i <
nprox; ++i) {
1252 std::string
pname(
p->name());
1253 if (
pname[0] ==
'!')
1256 auto k = dict->second.proxies.find(
pname);
1257 if (k == dict->second.proxies.end()) {
1258 std::cerr <<
"failed to find key matching proxy '" <<
pname <<
"' for type '" << dict->second.type
1259 <<
"', encountered in '" << func.
GetName() <<
"', skipping" << std::endl;
1264 if (k->second.empty())
1274 elem[k->second] <<
r->absArg()->GetName();
1282 std::cerr <<
"unable to locate server of " << func.
GetName() << std::endl;
1320 std::stringstream
ss;
1321 ss <<
"RooJSONFactoryWSTool() function node " +
name +
" is not a map!";
1326 if (!prefix.empty())
1328 if (!
p.has_child(
"type")) {
1329 std::stringstream
ss;
1330 ss <<
"RooJSONFactoryWSTool() no type given for function '" <<
name <<
"', skipping." << std::endl;
1343 auto it = importers.find(
functype);
1345 if (it != importers.end()) {
1346 for (
auto &
imp : it->second) {
1348 ok =
imp->importArg(
this,
p);
1349 }
catch (
const std::exception &
e) {
1350 std::stringstream
ss;
1351 const auto *ptr =
imp.get();
1352 ss <<
"RooJSONFactoryWSTool() failed. The importer " <<
typeid(*ptr).name()
1353 <<
" emitted and error: " <<
e.what() << std::endl;
1363 std::string expression = ::generate(
expr->second,
p,
this);
1365 std::stringstream
ss;
1366 ss <<
"RooJSONFactoryWSTool() failed to create " <<
expr->second.tclass->GetName() <<
" '" <<
name
1367 <<
"', skipping. expression was\n"
1368 << expression << std::endl;
1372 std::stringstream
ss;
1373 ss <<
"RooJSONFactoryWSTool() no handling for type '" <<
functype <<
"' implemented, skipping."
1375 <<
"there are several possible reasons for this:\n"
1376 <<
" 1. " <<
functype <<
" is a custom type that is not available in RooFit.\n"
1378 <<
" is a ROOT class that nobody ever bothered to write a deserialization definition for.\n"
1379 <<
" 3. something is wrong with your setup, e.g. you might have called "
1380 "RooFit::JSONIO::clearFactoryExpressions() and/or never successfully read a file defining "
1381 "these expressions with RooFit::JSONIO::loadFactoryExpressions(filename)\n"
1382 <<
"either way, please make sure that:\n"
1383 <<
" 3: you are reading a file with factory expressions - call "
1384 "RooFit::JSONIO::printFactoryExpressions() "
1385 "to see what is available\n"
1386 <<
" 2 & 1: you might need to write a deserialization definition yourself. check "
1387 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to see "
1396 std::stringstream err;
1397 err <<
"something went wrong importing function '" <<
name <<
"'.";
1434 std::string
name = var->GetName();
1438 if (var->getBinning().isUniform()) {
1439 obsNode[
"min"] << var->getMin();
1440 obsNode[
"max"] << var->getMax();
1441 obsNode[
"nbins"] << var->getBins();
1443 auto &edges =
obsNode[
"edges"];
1445 double val = var->getBinning().binLow(0);
1446 edges.append_child() << val;
1447 for (
int i = 0; i < var->getBinning().numBins(); ++i) {
1448 val = var->getBinning().binHigh(i);
1449 edges.append_child() << val;
1471 for (std::size_t i = 0; i <
n; ++i) {
1472 double w = contents[i];
1494 auto &labels = node[
"labels"].
set_seq();
1495 auto &indices = node[
"indices"].
set_seq();
1497 for (
auto const &
item : cat) {
1499 if (std::isalpha(
item.first[0])) {
1501 if (label !=
item.first) {
1502 oocoutW(
nullptr, IO) <<
"RooFitHS3: changed '" <<
item.first <<
"' to '" << label
1503 <<
"' to become a valid name";
1507 "' to make a valid name!");
1510 labels.append_child() << label;
1511 indices.append_child() <<
item.second;
1533 " has several category observables!");
1573 if (std::isalpha(
catName[0])) {
1577 <<
"' to become a valid name";
1581 "' to make a valid name!");
1609 " has several category observables!");
1627 if (
auto weightVar = variables.find(
"weightVar")) {
1628 variables.remove(*weightVar);
1633 output[
"type"] <<
"binned";
1637 return exportHisto(variables,
dh->numEntries(),
dh->weightArray(), output);
1646 if (
data.isWeighted() && variables.size() == 1) {
1648 auto &
x =
static_cast<RooRealVar const &
>(*variables[0]);
1649 std::vector<double> contents;
1651 for (; i <
data.numEntries(); ++i) {
1653 if (
x.getBin() != i)
1655 contents.push_back(
data.weight());
1657 if (i ==
x.getBins())
1660 output[
"type"] <<
"binned";
1664 return exportHisto(variables,
data.numEntries(), contents.data(), output);
1669 output[
"type"] <<
"unbinned";
1671 auto &coords = output[
"entries"].
set_seq();
1674 for (
int i = 0; i <
data.numEntries(); ++i) {
1676 coords.append_child().fill_seq(variables, [](
auto x) {
return static_cast<RooRealVar *
>(
x)->getVal(); });
1678 if (
data.isWeighted()) {
1680 if (
data.weight() != 1.)
1703 if (node.has_child(
"edges")) {
1704 std::vector<double> edges;
1705 for (
auto const &
bound : node[
"edges"].children()) {
1706 edges.push_back(
bound.val_double());
1708 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(), edges[0],
1709 edges[edges.size() - 1]);
1710 RooBinning bins(obs->getMin(), obs->getMax());
1711 for (
auto b : edges) {
1714 obs->setBinning(bins);
1717 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(),
1718 node[
"min"].val_double(), node[
"max"].val_double());
1719 obs->setBins(node[
"nbins"].val_int());
1738std::unique_ptr<RooDataHist>
1741 if (!
n.has_child(
"contents"))
1744 JSONNode const &contents =
n[
"contents"];
1750 if (
n.has_child(
"errors")) {
1758 std::stringstream
errMsg;
1759 errMsg <<
"inconsistent bin numbers: contents=" << contents.
num_children() <<
", bins=" << bins.size();
1762 auto dh = std::make_unique<RooDataHist>(
name,
name, vars);
1771 for (
auto const &err :
errors->children()) {
1800 std::stringstream
ss;
1801 ss <<
"RooJSONFactoryWSTool() node '" <<
name <<
"' is not a map, skipping.";
1802 oocoutE(
nullptr, InputArguments) <<
ss.str() << std::endl;
1808 if (
attrNode->has_child(
"is_const_var") && (*
attrNode)[
"is_const_var"].val_int() == 1) {
1830 for (
const auto &
p :
varsNode->children()) {
1834 if (
auto seq =
n.find(
"functions")) {
1835 for (
const auto &
p :
seq->children()) {
1839 if (
auto seq =
n.find(
"distributions")) {
1840 for (
const auto &
p :
seq->children()) {
1850 auto pdf =
mc.GetPdf();
1853 for (std::size_t i = 0; i < std::max(
combDataSets.size(), std::size_t(1)); ++i) {
1869 std::map<std::string, std::string>
mapping;
1885 auto pdf =
mc.GetPdf();
1894 nllNode[
"distributions"].set_seq();
1900 for (
auto const &
item :
simPdf->indexCat()) {
1902 nllNode[
"distributions"].append_child() <<
simPdf->getPdf(
item.first)->GetName();
1907 nllNode[
"distributions"].append_child() << it.first;
1908 nllNode[
"data"].append_child() << it.second;
1912 nllNode[
"distributions"].append_child() << pdf->GetName();
1913 nllNode[
"data"].append_child() << 0;
1916 if (
mc.GetExternalConstraints()) {
1919 for (
const auto &
constr : *
mc.GetExternalConstraints()) {
1925 if (!args || !args->size())
1928 std::vector<std::string> names;
1929 names.reserve(args->size());
1931 names.push_back(arg->GetName());
1932 std::sort(names.begin(), names.end());
1936 writeList(
"parameters_of_interest",
mc.GetParametersOfInterest());
1941 if (!args || args->empty())
1973 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1978 std::vector<RooAbsPdf *>
allpdfs;
1980 if (!arg->hasClients()) {
1981 if (
auto *pdf =
dynamic_cast<RooAbsPdf *
>(arg)) {
1991 std::vector<RooAbsReal *>
allfuncs;
1993 if (!arg->hasClients()) {
1994 if (
auto *func =
dynamic_cast<RooAbsReal *
>(arg)) {
2008 std::vector<RooAbsData *>
alldata;
2015 std::vector<RooJSONFactoryWSTool::CombinedData>
combData;
2018 if (!
data.components.empty())
2019 combData.push_back(
data);
2044 for (
const auto &pdf :
allpdfs) {
2045 if (pdf->dependsOn(*arg)) {
2056 if (
name !=
"default_values") {
2075 std::stringstream
ss(s);
2087 std::stringstream
ss(s);
2098 std::stringstream
ss;
2110 std::stringstream
ss;
2122 std::unique_ptr<JSONTree> tree = JSONTree::create();
2125 auto &metadata =
n[
"metadata"].set_map();
2164 std::ofstream out(
filename.c_str());
2165 if (!out.is_open()) {
2166 std::stringstream
ss;
2167 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2197 std::ofstream out(
filename.c_str());
2198 if (!out.is_open()) {
2199 std::stringstream
ss;
2200 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2213 for (
auto &
a :
seq->children()) {
2224 auto &
tags = (*node)[
"tags"];
2234 if (
auto dict =
attrNode->find(
"dict")) {
2235 if (
auto *
a = dict->find(
attrib)) {
2243 const std::string &
value)
2246 auto &dict = (*node)[
"dict"];
2264 auto metadata =
n.find(
"metadata");
2265 if (!metadata || !metadata->find(
"hs3_version")) {
2266 std::stringstream
ss;
2267 ss <<
"The HS3 version is missing in the JSON!\n"
2268 <<
"Please include the HS3 version in the metadata field, e.g.:\n"
2269 <<
" \"metadata\" :\n"
2276 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2277 if (
auto domains =
n.find(
"domains")) {
2294 if (
auto seq =
n.find(
"functions")) {
2295 if (
seq->is_seq()) {
2297 for (
const auto &
p :
seq->children()) {
2302 if (
auto seq =
n.find(
"distributions")) {
2303 if (
seq->is_seq()) {
2305 for (
const auto &
p :
seq->children()) {
2319 for (
const auto &var :
snsh[
"parameters"].children()) {
2345 std::vector<std::unique_ptr<RooAbsData>> datasets;
2347 for (
const auto &
p :
dataNode->children()) {
2362 for (
auto const &
d : datasets) {
2365 for (
auto const &obs : *
d->get()) {
2388 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2389 JSONNode const &rootnode = tree->rootnode();
2391 if (this->
workspace()->getSnapshot(
"default_values")) {
2409 std::stringstream
ss;
2410 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2426 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2427 JSONNode const &rootnode = tree->rootnode();
2444 std::stringstream
ss;
2445 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2458 bool isVariable =
true;
2459 if (
n.find(
"type")) {
2474 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2475 if (
auto domains =
n.find(
"domains"))
2489 const auto &var =
snsh[
"parameters"].child(0);
2528 throw std::runtime_error(s);
2541 for (
char c : str) {
2546 case '(':
result +=
'_';
break;
2551 case '.':
result +=
"_dot_";
break;
2552 case '@':
result +=
"at";
break;
2553 case '-':
result +=
"minus";
break;
2554 case '/':
result +=
"_div_";
break;
2578 for (
auto *pdf : ws.
allPdfs()) {
2579 if (!pdf->hasClients()) {
2585 if (!func->hasClients()) {
2621 for (
auto *obj : list) {
2637 for (
auto *obj : *
data->get()) {
2641 for (
auto *
data :
tmpWS.allEmbeddedData()) {
2644 for (
auto *obj : *
data->get()) {
2652 std::cerr <<
"Warning: found snapshot that is not a RooArgSet, skipping\n";
2662 for (
auto *arg : *
snsh) {
2670 for (
auto *obj :
tmpWS.allGenericObjects()) {
2675 std::cerr <<
"Warning: object " << obj->GetName() <<
" is not TNamed, cannot rename.\n";
2686 for (
auto *obs :
mc->GetObservables()->get()) {
2691 for (
auto *poi :
mc->GetParametersOfInterest()->get()) {
2696 for (
auto *
nuis :
mc->GetNuisanceParameters()->get()) {
2701 for (
auto *
glob :
mc->GetGlobalObservables()->get()) {
2708 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 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...
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 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.
void fill_seq(Collection const &coll)
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()
void readVariable(const RooRealVar &)
void writeJSON(RooFit::Detail::JSONNode &) const
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()