122 std::vector<std::string> out;
125 out.push_back(
elem.val());
133 return data.components.size() == pdf->
indexCat().size();
137bool isNumber(
const std::string &str)
142 std::istringstream stream(str);
144 return (stream >>
value) && stream.eof();
150 if (!
p.has_child(
"name")) {
153 if (
auto n =
p.find(
"value"))
154 v.setVal(
n->val_double());
156 if (
auto n =
p.find(
"nbins"))
157 v.setBins(
n->val_int());
158 if (
auto n =
p.find(
"relErr"))
159 v.setError(
v.getVal() *
n->val_double());
160 if (
auto n =
p.find(
"err"))
161 v.setError(
n->val_double());
162 if (
auto n =
p.find(
"const")) {
163 v.setConstant(
n->val_bool());
165 v.setConstant(
false);
177 return &((*out)[
"parameters"]);
185 if (
auto node =
p.find(
"namespaces")) {
186 for (
const auto &ns : node->
children()) {
215 if (
auto seq = node.
find(
"dict")) {
216 for (
const auto &
attr :
seq->children()) {
220 if (
auto seq = node.
find(
"tags")) {
221 for (
const auto &
attr :
seq->children()) {
230 out.
add(*args,
true);
263 if (observables.
empty()) {
275 std::vector<RooAbsData *>
const &
data,
JSONNode &rootnode)
292 if (!var || !var->hasError()) {
327 "RooFitHS3: skipping parameter_stepwidths entry for unknown or non-real variable '" +
name +
"'.");
331 var->setError(
stepWidthNode.find(
"step_width")->val_double());
338 std::stringstream expression;
339 std::string classname(
ex.tclass->GetName());
340 size_t colon = classname.find_last_of(
':');
341 expression << (
colon < classname.size() ? classname.substr(
colon + 1) : classname);
344 for (
auto k :
ex.arguments) {
345 expression << (first ?
"::" +
name +
"(" :
",");
347 if (k ==
"true" || k ==
"false") {
348 expression << (k ==
"true" ?
"1" :
"0");
349 }
else if (!
p.has_child(k)) {
351 errMsg <<
"node '" <<
name <<
"' is missing key '" << k <<
"'";
353 }
else if (
p[k].is_seq()) {
363 expression <<
p[k].val();
367 return expression.str();
384template <
typename...
Keys_t>
387 return node.
find(
"misc",
"ROOT_internal", keys...);
422 if (it.first ==
"factory_tag" || it.first ==
"PROD_TERM_TYPE")
425 (*node)[
"dict"].set_map()[it.first] << it.second;
431 if (
attr ==
"SnapShot_ExtRefClone" ||
attr ==
"RooRealConstant_Factory_Object")
434 (*node)[
"tags"].set_seq().append_child() <<
attr;
442 for (
const auto &
p : node[
"axes"].
children()) {
448 errMsg <<
"The observable \"" <<
name <<
"\" could not be found in the workspace!";
461 std::string
const &
type =
p[
"type"].val();
462 if (
type ==
"binned") {
465 }
else if (
type ==
"unbinned") {
468 getObservables(workspace,
p, varlist);
471 auto &coords =
p[
"entries"];
472 if (!coords.is_seq()) {
476 if (
p.has_child(
"weights")) {
477 auto &weights =
p[
"weights"];
478 if (coords.num_children() != weights.num_children()) {
481 for (
auto const &weight : weights.children()) {
486 for (
auto const &point : coords.children()) {
487 if (!point.is_seq()) {
489 errMsg <<
"coordinate point '" << i <<
"' is not a list!";
492 if (point.num_children() != varlist.
size()) {
496 for (
auto const &
pointj : point.children()) {
511 std::stringstream
ss;
512 ss <<
"RooJSONFactoryWSTool() failed to create dataset " <<
name << std::endl;
520 const std::vector<std::unique_ptr<RooAbsData>> &datasets)
533 mc->SetWS(workspace);
537 throw std::runtime_error(
"likelihood node not found!");
539 if (!
nllNode->has_child(
"distributions")) {
540 throw std::runtime_error(
"likelihood node has no distributions attached!");
542 if (!
nllNode->has_child(
"data")) {
543 throw std::runtime_error(
"likelihood node has no data attached!");
547 for (
auto &
nameNode : (*nllNode)[
"aux_distributions"].children()) {
553 for (
auto &
nameNode : (*nllNode)[
"data"].children()) {
555 for (
const auto &
d : datasets) {
558 observables.
add(*
d->get(),
true);
561 if (
nameNode.val() !=
"0" && !found)
562 throw std::runtime_error(
"dataset '" +
nameNode.val() +
"' cannot be found!");
580 std::map<std::string, RooAbsPdf *>
pdfMap;
604 mc->SetParametersOfInterest(
readArgSet(
"parameters_of_interest"));
605 mc->SetObservables(observables);
616 for (
auto &domain :
analysisNode[
"domains"].children()) {
620 for (
auto &var : (*thisDomain)[
"axes"].children()) {
629 for (
const auto &
p : pars) {
630 if (
mc->GetParametersOfInterest()->find(*
p))
639 mc->SetGlobalObservables(globs);
640 mc->SetNuisanceParameters(
nps);
643 if (
auto found =
mcAuxNode->find(
"combined_data_name")) {
668 std::vector<int> indices;
670 for (
auto &
n :
info[
"indices"].children()) {
671 indices.push_back(
n.val_int());
675 std::map<std::string, RooAbsPdf *>
pdfMap;
702 std::vector<int> indices;
703 for (
auto &
n :
info[
"indices"].children()) {
704 indices.push_back(
n.val_int());
706 if (indices.size() != labels.size()) {
711 std::map<std::string, std::unique_ptr<RooAbsData>>
dsMap;
718 std::unique_ptr<RooAbsData> &
component = *std::find_if(
719 datasets.begin(), datasets.end(), [&](
auto &
d) { return d && d->GetName() == componentName; });
729 datasets.emplace_back(std::move(
combined));
736 std::sort(
coll.
begin(),
coll.
end(), [](
auto &
l,
auto &
r) { return strcmp(l->GetName(), r->GetName()) < 0; });
761 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
804 if (str.empty() || !(std::isalpha(str[0]) || str[0] ==
'_')) {
811 if (!(std::isalnum(
c) ||
c ==
'_')) {
823 std::stringstream
ss;
824 ss <<
"RooJSONFactoryWSTool() name '" <<
name <<
"' is not valid!" << std::endl
825 <<
"Sanitize names by setting RooJSONFactoryWSTool::config().allowSanitizeNames = true." << std::endl;
852 if (
const auto &node = vars->find(
objname)) {
913 var[
"value"] <<
cv->getVal();
914 var[
"const"] <<
true;
916 var[
"value"] <<
rrv->getVal();
918 var[
"const"] <<
true;
920 var[
"min"] <<
rrv->getMin();
921 var[
"max"] <<
rrv->getMax();
924 var[
"nbins"] <<
rrv->getBins();
941 const std::string &formula)
975 child[
"index_cat"] <<
simPdf->indexCat().GetName();
977 child[
"distributions"].set_seq();
979 child[
"distributions"].append_child() <<
simPdf->getPdf(
item.first.c_str())->GetName();
991 auto &
collectionNode = (*_rootnodeOutput)[
dynamic_cast<RooAbsPdf const *
>(&func) ?
"distributions" :
"functions"];
1000 auto it = exporters.find(cl);
1001 if (it != exporters.end()) {
1002 for (
auto &exp : it->second) {
1005 if (!exp->exportObject(
this, &func,
elem)) {
1015 if (exp->autoExportDependants()) {
1028 const auto &dict = exportKeys.find(cl);
1029 if (dict == exportKeys.end()) {
1030 std::cerr <<
"unable to export class '" << cl->
GetName() <<
"' - no export keys available!\n"
1031 <<
"there are several possible reasons for this:\n"
1032 <<
" 1. " << cl->
GetName() <<
" is a custom class that you or some package you are using added.\n"
1034 <<
" is a ROOT class that nobody ever bothered to write a serialization definition for.\n"
1035 <<
" 3. something is wrong with your setup, e.g. you might have called "
1036 "RooFit::JSONIO::clearExportKeys() and/or never successfully read a file defining these "
1037 "keys with RooFit::JSONIO::loadExportKeys(filename)\n"
1038 <<
"either way, please make sure that:\n"
1039 <<
" 3: you are reading a file with export keys - call RooFit::JSONIO::printExportKeys() to "
1040 "see what is available\n"
1041 <<
" 2 & 1: you might need to write a serialization definition yourself. check "
1042 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to "
1043 "see how to do this!\n";
1047 elem[
"type"] << dict->second.type;
1051 for (
size_t i = 0; i <
nprox; ++i) {
1057 std::string
pname(
p->name());
1058 if (
pname[0] ==
'!')
1061 auto k = dict->second.proxies.find(
pname);
1062 if (k == dict->second.proxies.end()) {
1063 std::cerr <<
"failed to find key matching proxy '" <<
pname <<
"' for type '" << dict->second.type
1064 <<
"', encountered in '" << func.
GetName() <<
"', skipping" << std::endl;
1069 if (k->second.empty())
1079 elem[k->second] <<
r->absArg()->GetName();
1087 std::cerr <<
"unable to locate server of " << func.
GetName() << std::endl;
1125 std::stringstream
ss;
1126 ss <<
"RooJSONFactoryWSTool() function node " +
name +
" is not a map!";
1131 if (!prefix.empty())
1133 if (!
p.has_child(
"type")) {
1134 std::stringstream
ss;
1135 ss <<
"RooJSONFactoryWSTool() no type given for function '" <<
name <<
"', skipping." << std::endl;
1148 auto it = importers.find(
functype);
1150 if (it != importers.end()) {
1151 for (
auto &
imp : it->second) {
1153 ok =
imp->importArg(
this,
p);
1154 }
catch (
const std::exception &
e) {
1155 std::stringstream
ss;
1156 const auto *ptr =
imp.get();
1157 ss <<
"RooJSONFactoryWSTool() failed. The importer " <<
typeid(*ptr).name()
1158 <<
" emitted and error: " <<
e.what() << std::endl;
1168 std::string expression = ::generate(
expr->second,
p,
this);
1170 std::stringstream
ss;
1171 ss <<
"RooJSONFactoryWSTool() failed to create " <<
expr->second.tclass->GetName() <<
" '" <<
name
1172 <<
"', skipping. expression was\n"
1173 << expression << std::endl;
1177 std::stringstream
ss;
1178 ss <<
"RooJSONFactoryWSTool() no handling for type '" <<
functype <<
"' implemented, skipping."
1180 <<
"there are several possible reasons for this:\n"
1181 <<
" 1. " <<
functype <<
" is a custom type that is not available in RooFit.\n"
1183 <<
" is a ROOT class that nobody ever bothered to write a deserialization definition for.\n"
1184 <<
" 3. something is wrong with your setup, e.g. you might have called "
1185 "RooFit::JSONIO::clearFactoryExpressions() and/or never successfully read a file defining "
1186 "these expressions with RooFit::JSONIO::loadFactoryExpressions(filename)\n"
1187 <<
"either way, please make sure that:\n"
1188 <<
" 3: you are reading a file with factory expressions - call "
1189 "RooFit::JSONIO::printFactoryExpressions() "
1190 "to see what is available\n"
1191 <<
" 2 & 1: you might need to write a deserialization definition yourself. check "
1192 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to see "
1201 std::stringstream err;
1202 err <<
"something went wrong importing function '" <<
name <<
"'.";
1236 if (binning.isUniform()) {
1241 auto &edges =
obsNode[
"edges"].set_seq();
1242 edges.append_child() << binning.binLow(0);
1243 for (
int i = 0; i < binning.numBins(); ++i) {
1244 edges.append_child() << binning.binHigh(i);
1286 for (std::size_t i = 0; i <
n; ++i) {
1287 double w = contents[i];
1303 if (!std::isalpha(
in[0])) {
1308 oocoutW(
nullptr, IO) <<
"RooFitHS3: changed '" <<
in <<
"' to '" << out <<
"' to become a valid name";
1327 auto &labels = node[
"labels"].
set_seq();
1328 auto &indices = node[
"indices"].
set_seq();
1330 for (
auto const &
item : cat) {
1332 indices.append_child() <<
item.second;
1346 " has several category observables!");
1403 " has several category observables!");
1421 if (
auto weightVar = variables.find(
"weightVar")) {
1422 variables.remove(*weightVar);
1427 output[
"type"] <<
"binned";
1431 return exportHisto(variables,
dh->numEntries(),
dh->weightArray(), output);
1440 if (
data.isWeighted() && variables.size() == 1) {
1442 auto &
x =
static_cast<RooRealVar const &
>(*variables[0]);
1443 std::vector<double> contents;
1445 for (; i <
data.numEntries(); ++i) {
1447 if (
x.getBin() != i)
1449 contents.push_back(
data.weight());
1451 if (i ==
x.getBins())
1454 output[
"type"] <<
"binned";
1458 return exportHisto(variables,
data.numEntries(), contents.data(), output);
1463 output[
"type"] <<
"unbinned";
1469 auto &coords = output[
"entries"].
set_seq();
1472 for (
int i = 0; i <
data.numEntries(); ++i) {
1474 coords.append_child().fill_seq(variables, [](
auto x) {
return static_cast<RooRealVar *
>(
x)->getVal(); });
1475 if (
data.isWeighted()) {
1477 if (
data.weight() != 1.)
1500 if (node.has_child(
"edges")) {
1501 std::vector<double> edges;
1502 for (
auto const &
bound : node[
"edges"].children()) {
1503 edges.push_back(
bound.val_double());
1505 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(), edges[0],
1506 edges[edges.size() - 1]);
1507 RooBinning bins(obs->getMin(), obs->getMax());
1508 for (
auto b : edges) {
1511 obs->setBinning(bins);
1514 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(),
1515 node[
"min"].val_double(), node[
"max"].val_double());
1516 obs->setBins(node[
"nbins"].val_int());
1535std::unique_ptr<RooDataHist>
1538 if (!
n.has_child(
"contents"))
1541 JSONNode const &contents =
n[
"contents"];
1547 if (
n.has_child(
"errors")) {
1555 std::stringstream
errMsg;
1556 errMsg <<
"inconsistent bin numbers: contents=" << contents.
num_children() <<
", bins=" << bins.size();
1559 auto dh = std::make_unique<RooDataHist>(
name,
name, vars);
1568 for (
auto const &err :
errors->children()) {
1589 std::stringstream
ss;
1590 ss <<
"RooJSONFactoryWSTool() node '" <<
name <<
"' is not a map, skipping.";
1591 oocoutE(
nullptr, InputArguments) <<
ss.str() << std::endl;
1594 if (
config().importNoDomainParametersAsRooConstVars && !
_domains->hasVariable(
name.c_str())) {
1595 if (!
p.has_child(
"value")) {
1609 for (
const auto &
p :
varsNode->children()) {
1613 if (
auto seq =
n.find(
"functions")) {
1614 for (
const auto &
p :
seq->children()) {
1618 if (
auto seq =
n.find(
"distributions")) {
1619 for (
const auto &
p :
seq->children()) {
1629 auto pdf =
mc.GetPdf();
1632 for (std::size_t i = 0; i < std::max(
combDataSets.size(), std::size_t(1)); ++i) {
1648 std::map<std::string, std::string>
mapping;
1664 auto pdf =
mc.GetPdf();
1673 nllNode[
"distributions"].set_seq();
1679 for (
auto const &
item :
simPdf->indexCat()) {
1681 nllNode[
"distributions"].append_child() <<
simPdf->getPdf(
item.first)->GetName();
1686 nllNode[
"distributions"].append_child() << it.first;
1687 nllNode[
"data"].append_child() << it.second;
1691 nllNode[
"distributions"].append_child() << pdf->GetName();
1692 nllNode[
"data"].append_child() << 0;
1695 if (
mc.GetExternalConstraints()) {
1698 for (
const auto &
constr : *
mc.GetExternalConstraints()) {
1704 if (!args || !args->size())
1707 std::vector<std::string> names;
1708 names.reserve(args->size());
1710 names.push_back(arg->GetName());
1711 std::sort(names.begin(), names.end());
1715 writeList(
"parameters_of_interest",
mc.GetParametersOfInterest());
1720 if (!args || args->empty())
1744 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1749 std::vector<RooAbsPdf *>
allpdfs;
1751 if (!arg->hasClients()) {
1752 if (
auto *pdf =
dynamic_cast<RooAbsPdf *
>(arg)) {
1762 std::vector<RooAbsReal *>
allfuncs;
1764 if (!arg->hasClients()) {
1765 if (
auto *func =
dynamic_cast<RooAbsReal *
>(arg)) {
1779 std::vector<RooAbsData *>
alldata;
1786 std::vector<RooJSONFactoryWSTool::CombinedData>
combData;
1789 if (!
data.components.empty())
1790 combData.push_back(
data);
1815 for (
const auto &pdf :
allpdfs) {
1816 if (pdf->dependsOn(*arg)) {
1827 if (
name !=
"default_values") {
1846 std::stringstream
ss(s);
1857 std::stringstream
ss;
1869 std::unique_ptr<JSONTree> tree = JSONTree::create();
1872 auto &metadata =
n[
"metadata"].set_map();
1911 std::ofstream out(
filename.c_str());
1923 for (
auto &
a :
seq->children()) {
1934 auto &
tags = (*node)[
"tags"];
1944 if (
auto dict =
attrNode->find(
"dict")) {
1945 if (
auto *
a = dict->find(
attrib)) {
1953 const std::string &
value)
1956 auto &dict = (*node)[
"dict"];
1969 auto metadata =
n.find(
"metadata");
1970 if (!metadata || !metadata->find(
"hs3_version")) {
1971 std::stringstream
ss;
1972 ss <<
"The HS3 version is missing in the JSON!\n"
1973 <<
"Please include the HS3 version in the metadata field, e.g.:\n"
1974 <<
" \"metadata\" :\n"
1985 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1986 if (
auto domains =
n.find(
"domains")) {
1999 if (
auto seq =
n.find(
"functions")) {
2000 if (
seq->is_seq()) {
2002 for (
const auto &
p :
seq->children()) {
2007 if (
auto seq =
n.find(
"distributions")) {
2008 if (
seq->is_seq()) {
2010 for (
const auto &
p :
seq->children()) {
2024 for (
const auto &var :
snsh[
"parameters"].children()) {
2050 std::vector<std::unique_ptr<RooAbsData>> datasets;
2052 for (
const auto &
p :
dataNode->children()) {
2067 for (
auto const &
d : datasets) {
2070 for (
auto const &obs : *
d->get()) {
2093 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2094 JSONNode const &rootnode = tree->rootnode();
2096 if (this->
workspace()->getSnapshot(
"default_values")) {
2125 if (
n.find(
"poi")) {
2128 std::string poi =
n.find(
"poi")->val();
2129 std::string
pdname =
n.find(
"pdfName")->val();
2140 bool isVariable =
true;
2143 if (
n.find(
"type")) {
2166 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2167 if (
auto domains =
n.find(
"domains"))
2181 const auto &var =
snsh[
"parameters"].child(0);
2220 throw std::runtime_error(s);
2233 for (
char c : str) {
2238 case '(':
result +=
'_';
break;
2243 case '.':
result +=
"_dot_";
break;
2244 case '@':
result +=
"at";
break;
2245 case '-':
result +=
"minus";
break;
2246 case '/':
result +=
"_div_";
break;
2270 for (
auto *pdf : ws.
allPdfs()) {
2271 if (!pdf->hasClients()) {
2277 if (!func->hasClients()) {
2319 for (
auto *obj : list) {
2335 for (
auto *obj : *
data->get()) {
2339 for (
auto *
data :
tmpWS.allEmbeddedData()) {
2342 for (
auto *obj : *
data->get()) {
2350 std::cerr <<
"Warning: found snapshot that is not a RooArgSet, skipping\n";
2360 for (
auto *arg : *
snsh) {
2368 for (
auto *obj :
tmpWS.allGenericObjects()) {
2373 std::cerr <<
"Warning: object " << obj->GetName() <<
" is not TNamed, cannot rename.\n";
2384 for (
auto *obs :
mc->GetObservables()->get()) {
2389 for (
auto *poi :
mc->GetParametersOfInterest()->get()) {
2394 for (
auto *
nuis :
mc->GetNuisanceParameters()->get()) {
2399 for (
auto *
glob :
mc->GetGlobalObservables()->get()) {
2406 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.
virtual Int_t getBins(const char *name=nullptr) const
Get number of bins of currently defined range.
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...
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'.
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false, bool shared=true) const override
Return binning definition with name.
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 argSet(RooStringView nameList) const
Return set of RooAbsArgs matching to given list of names.
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()