119 std::vector<std::string> out;
122 out.push_back(
elem.val());
140 return data.components.size() == pdf->
indexCat().size();
154 std::vector<double> edges;
160 Var(
int n) : nbins(
n), min(0), max(
n) {}
179bool isNumber(
const std::string &str)
187 for (
size_t i = 0; i < str.size(); ++i) {
190 if (std::isdigit(
c)) {
228 if (!
p.has_child(
"name")) {
231 if (
auto n =
p.find(
"value"))
232 v.setVal(
n->val_double());
234 if (
auto n =
p.find(
"nbins"))
235 v.setBins(
n->val_int());
236 if (
auto n =
p.find(
"relErr"))
237 v.setError(
v.getVal() *
n->val_double());
238 if (
auto n =
p.find(
"err"))
239 v.setError(
n->val_double());
240 if (
auto n =
p.find(
"const")) {
241 v.setConstant(
n->val_bool());
243 v.setConstant(
false);
255 return &((*out)[
"parameters"]);
260 if (val.
find(
"edges")) {
262 this->edges.push_back(
child.val_double());
264 this->nbins = this->edges.size();
265 this->min = this->edges[0];
266 this->max = this->edges[this->nbins - 1];
268 if (!val.
find(
"nbins")) {
271 this->nbins = val[
"nbins"].
val_int();
273 if (!val.
find(
"min")) {
278 if (!val.
find(
"max")) {
291 if (
auto node =
p.find(
"namespaces")) {
292 for (
const auto &ns : node->
children()) {
330 if (
auto seq = node.
find(
"dict")) {
331 for (
const auto &
attr :
seq->children()) {
335 if (
auto seq = node.
find(
"tags")) {
336 for (
const auto &
attr :
seq->children()) {
345 std::stringstream expression;
346 std::string classname(
ex.tclass->GetName());
347 size_t colon = classname.find_last_of(
':');
348 expression << (
colon < classname.size() ? classname.substr(
colon + 1) : classname);
351 for (
auto k :
ex.arguments) {
352 expression << (first ?
"::" +
name +
"(" :
",");
354 if (k ==
"true" || k ==
"false") {
355 expression << (k ==
"true" ?
"1" :
"0");
356 }
else if (!
p.has_child(k)) {
358 errMsg <<
"node '" <<
name <<
"' is missing key '" << k <<
"'";
360 }
else if (
p[k].is_seq()) {
370 expression <<
p[k].val();
374 return expression.str();
400template <
typename...
Keys_t>
403 return node.
find(
"misc",
"ROOT_internal", keys...);
457 if (it.first ==
"factory_tag" || it.first ==
"PROD_TERM_TYPE")
460 (*node)[
"dict"].set_map()[it.first] << it.second;
466 if (
attr ==
"SnapShot_ExtRefClone" ||
attr ==
"RooRealConstant_Factory_Object")
469 (*node)[
"tags"].set_seq().append_child() <<
attr;
489 std::map<std::string, Var> vars;
490 for (
const auto &
p : node[
"axes"].
children()) {
494 for (
auto v : vars) {
495 std::string
name(
v.first);
500 errMsg <<
"The observable \"" <<
name <<
"\" could not be found in the workspace!";
523 std::string
const &
type =
p[
"type"].val();
524 if (
type ==
"binned") {
527 }
else if (
type ==
"unbinned") {
530 getObservables(workspace,
p, vars);
533 auto &coords =
p[
"entries"];
534 if (!coords.is_seq()) {
538 if (
p.has_child(
"weights")) {
539 auto &weights =
p[
"weights"];
540 if (coords.num_children() != weights.num_children()) {
543 for (
auto const &weight : weights.children()) {
548 for (
auto const &point : coords.children()) {
549 if (!point.is_seq()) {
551 errMsg <<
"coordinate point '" << i <<
"' is not a list!";
554 if (point.num_children() != varlist.
size()) {
558 for (
auto const &
pointj : point.children()) {
573 std::stringstream
ss;
574 ss <<
"RooJSONFactoryWSTool() failed to create dataset " <<
name << std::endl;
596 const std::vector<std::unique_ptr<RooAbsData>> &datasets)
609 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) {
635 observables.
add(*
d->get());
655 std::map<std::string, RooAbsPdf *>
pdfMap;
674 out.add(*workspace.
arg(
child.val()));
679 mc->SetParametersOfInterest(
readArgSet(
"parameters_of_interest"));
680 mc->SetObservables(observables);
691 for (
auto &domain :
analysisNode[
"domains"].children()) {
695 for (
auto &var : (*thisDomain)[
"axes"].children()) {
704 for (
const auto &
p : pars) {
705 if (
mc->GetParametersOfInterest()->find(*
p))
713 mc->SetGlobalObservables(globs);
714 mc->SetNuisanceParameters(
nps);
717 if (
auto found =
mcAuxNode->find(
"combined_data_name")) {
738 std::vector<int> indices;
740 for (
auto &
n :
info[
"indices"].children()) {
741 indices.push_back(
n.val_int());
745 std::map<std::string, RooAbsPdf *>
pdfMap;
772 std::vector<int> indices;
773 for (
auto &
n :
info[
"indices"].children()) {
774 indices.push_back(
n.val_int());
776 if (indices.size() != labels.size()) {
781 std::map<std::string, std::unique_ptr<RooAbsData>>
dsMap;
788 std::unique_ptr<RooAbsData> &
component = *std::find_if(
789 datasets.begin(), datasets.end(), [&](
auto &
d) { return d && d->GetName() == componentName; });
799 datasets.emplace_back(std::move(
combined));
806 std::sort(
coll.
begin(),
coll.
end(), [](
auto &
l,
auto &
r) { return strcmp(l->GetName(), r->GetName()) < 0; });
831 error(
"unable to stream collection " + std::string(
coll.GetName()) +
" to " + node.
key());
874 if (str.empty() || !(std::isalpha(str[0]) || str[0] ==
'_')) {
881 if (!(std::isalnum(
c) ||
c ==
'_')) {
894 std::stringstream
ss;
895 ss <<
"RooJSONFactoryWSTool() name '" <<
name <<
"' is not valid!" << std::endl;
922 if (
const auto &node = vars->find(
objname)) {
997 var[
"value"] <<
cv->getVal();
998 var[
"const"] <<
true;
1000 var[
"value"] <<
rrv->getVal();
1001 if (
rrv->isConstant()) {
1002 var[
"const"] <<
rrv->isConstant();
1004 if (
rrv->getBins() != 100) {
1005 var[
"nbins"] <<
rrv->getBins();
1030 const std::string &formula)
1067 for (
auto const &
item :
simPdf->indexCat()) {
1073 child[
"index_cat"] <<
simPdf->indexCat().GetName();
1075 child[
"distributions"].set_seq();
1076 for (
auto const &
item :
simPdf->indexCat()) {
1077 child[
"distributions"].append_child() <<
simPdf->getPdf(
item.first.c_str())->GetName();
1089 auto &
collectionNode = (*_rootnodeOutput)[
dynamic_cast<RooAbsPdf const *
>(&func) ?
"distributions" :
"functions"];
1098 auto it = exporters.find(cl);
1099 if (it != exporters.end()) {
1100 for (
auto &exp : it->second) {
1103 if (!exp->exportObject(
this, &func,
elem)) {
1113 if (exp->autoExportDependants()) {
1126 const auto &dict = exportKeys.find(cl);
1127 if (dict == exportKeys.end()) {
1128 std::cerr <<
"unable to export class '" << cl->
GetName() <<
"' - no export keys available!\n"
1129 <<
"there are several possible reasons for this:\n"
1130 <<
" 1. " << cl->
GetName() <<
" is a custom class that you or some package you are using added.\n"
1132 <<
" is a ROOT class that nobody ever bothered to write a serialization definition for.\n"
1133 <<
" 3. something is wrong with your setup, e.g. you might have called "
1134 "RooFit::JSONIO::clearExportKeys() and/or never successfully read a file defining these "
1135 "keys with RooFit::JSONIO::loadExportKeys(filename)\n"
1136 <<
"either way, please make sure that:\n"
1137 <<
" 3: you are reading a file with export keys - call RooFit::JSONIO::printExportKeys() to "
1138 "see what is available\n"
1139 <<
" 2 & 1: you might need to write a serialization definition yourself. check "
1140 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to "
1141 "see how to do this!\n";
1145 elem[
"type"] << dict->second.type;
1149 for (
size_t i = 0; i <
nprox; ++i) {
1155 std::string
pname(
p->name());
1156 if (
pname[0] ==
'!')
1159 auto k = dict->second.proxies.find(
pname);
1160 if (k == dict->second.proxies.end()) {
1161 std::cerr <<
"failed to find key matching proxy '" <<
pname <<
"' for type '" << dict->second.type
1162 <<
"', encountered in '" << func.
GetName() <<
"', skipping" << std::endl;
1167 if (k->second.empty())
1177 elem[k->second] <<
r->absArg()->GetName();
1185 std::cerr <<
"unable to locate server of " << func.
GetName() << std::endl;
1223 std::stringstream
ss;
1224 ss <<
"RooJSONFactoryWSTool() function node " +
name +
" is not a map!";
1229 if (!prefix.empty())
1231 if (!
p.has_child(
"type")) {
1232 std::stringstream
ss;
1233 ss <<
"RooJSONFactoryWSTool() no type given for function '" <<
name <<
"', skipping." << std::endl;
1246 auto it = importers.find(
functype);
1248 if (it != importers.end()) {
1249 for (
auto &
imp : it->second) {
1250 ok =
imp->importArg(
this,
p);
1258 std::string expression = ::generate(
expr->second,
p,
this);
1260 std::stringstream
ss;
1261 ss <<
"RooJSONFactoryWSTool() failed to create " <<
expr->second.tclass->GetName() <<
" '" <<
name
1262 <<
"', skipping. expression was\n"
1263 << expression << std::endl;
1267 std::stringstream
ss;
1268 ss <<
"RooJSONFactoryWSTool() no handling for type '" <<
functype <<
"' implemented, skipping."
1270 <<
"there are several possible reasons for this:\n"
1271 <<
" 1. " <<
functype <<
" is a custom type that is not available in RooFit.\n"
1273 <<
" is a ROOT class that nobody ever bothered to write a deserialization definition for.\n"
1274 <<
" 3. something is wrong with your setup, e.g. you might have called "
1275 "RooFit::JSONIO::clearFactoryExpressions() and/or never successfully read a file defining "
1276 "these expressions with RooFit::JSONIO::loadFactoryExpressions(filename)\n"
1277 <<
"either way, please make sure that:\n"
1278 <<
" 3: you are reading a file with factory expressions - call "
1279 "RooFit::JSONIO::printFactoryExpressions() "
1280 "to see what is available\n"
1281 <<
" 2 & 1: you might need to write a deserialization definition yourself. check "
1282 "https://root.cern/doc/master/group__roofit__dev__docs__hs3.html to see "
1291 std::stringstream err;
1292 err <<
"something went wrong importing function '" <<
name <<
"'.";
1330 std::string
name = var->GetName();
1333 if (var->getBinning().isUniform()) {
1334 obsNode[
"min"] << var->getMin();
1335 obsNode[
"max"] << var->getMax();
1336 obsNode[
"nbins"] << var->getBins();
1338 auto &edges =
obsNode[
"edges"];
1340 double val = var->getBinning().binLow(0);
1341 edges.append_child() << val;
1342 for (
int i = 0; i < var->getBinning().numBins(); ++i) {
1343 val = var->getBinning().binHigh(i);
1344 edges.append_child() << val;
1366 for (std::size_t i = 0; i <
n; ++i) {
1367 double w = contents[i];
1389 auto &labels = node[
"labels"].
set_seq();
1390 auto &indices = node[
"indices"].
set_seq();
1392 for (
auto const &
item : cat) {
1394 if (std::isalpha(
item.first[0])) {
1396 if (label !=
item.first) {
1397 oocoutW(
nullptr, IO) <<
"RooFitHS3: changed '" <<
item.first <<
"' to '" << label
1398 <<
"' to become a valid name";
1402 "' to make a valid name!");
1405 labels.append_child() << label;
1406 indices.append_child() <<
item.second;
1428 " has several category observables!");
1468 if (std::isalpha(
catName[0])) {
1472 <<
"' to become a valid name";
1476 "' to make a valid name!");
1503 " has several category observables!");
1516 output[
"type"] <<
"binned";
1529 if (
auto weightVar = variables.find(
"weightVar")) {
1530 variables.remove(*weightVar);
1539 if (
data.isWeighted() && variables.size() == 1) {
1541 auto &
x =
static_cast<RooRealVar const &
>(*variables[0]);
1542 std::vector<double> contents;
1544 for (; i <
data.numEntries(); ++i) {
1546 if (
x.getBin() != i)
1548 contents.push_back(
data.weight());
1550 if (i ==
x.getBins())
1553 output[
"type"] <<
"binned";
1558 output[
"type"] <<
"unbinned";
1563 auto &coords =
output[
"entries"].set_seq();
1566 for (
int i = 0; i <
data.numEntries(); ++i) {
1568 coords.append_child().fill_seq(variables, [](
auto x) {
return static_cast<RooRealVar *
>(
x)->getVal(); });
1569 if (
data.isWeighted()) {
1571 if (
data.weight() != 1.)
1594 if (node.has_child(
"edges")) {
1595 std::vector<double> edges;
1596 for (
auto const &
bound : node[
"edges"].children()) {
1597 edges.push_back(
bound.val_double());
1599 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(), edges[0],
1600 edges[edges.size() - 1]);
1601 RooBinning bins(obs->getMin(), obs->getMax());
1602 for (
auto b : edges) {
1605 obs->setBinning(bins);
1608 auto obs = std::make_unique<RooRealVar>(node[
"name"].val().c_str(), node[
"name"].val().c_str(),
1609 node[
"min"].val_double(), node[
"max"].val_double());
1610 obs->setBins(node[
"nbins"].val_int());
1629std::unique_ptr<RooDataHist>
1632 if (!
n.has_child(
"contents"))
1635 JSONNode const &contents =
n[
"contents"];
1641 if (
n.has_child(
"errors")) {
1649 std::stringstream
errMsg;
1650 errMsg <<
"inconsistent bin numbers: contents=" << contents.
num_children() <<
", bins=" << bins.size();
1653 auto dh = std::make_unique<RooDataHist>(
name,
name, vars);
1662 for (
auto const &err :
errors->children()) {
1691 std::stringstream
ss;
1692 ss <<
"RooJSONFactoryWSTool() node '" <<
name <<
"' is not a map, skipping.";
1693 oocoutE(
nullptr, InputArguments) <<
ss.str() << std::endl;
1699 if (
attrNode->has_child(
"is_const_var") && (*
attrNode)[
"is_const_var"].val_int() == 1) {
1721 for (
const auto &
p :
varsNode->children()) {
1725 if (
auto seq =
n.find(
"functions")) {
1726 for (
const auto &
p :
seq->children()) {
1730 if (
auto seq =
n.find(
"distributions")) {
1731 for (
const auto &
p :
seq->children()) {
1741 if (pdf ==
nullptr) {
1742 warning(
"RooFitHS3 only supports ModelConfigs with RooSimultaneous! Skipping ModelConfig.");
1746 for (std::size_t i = 0; i < std::max(
combDataSets.size(), std::size_t(1)); ++i) {
1772 nllNode[
"distributions"].set_seq();
1776 for (
auto const &
item : pdf->indexCat()) {
1778 nllNode[
"distributions"].append_child() << pdf->getPdf(
item.first)->GetName();
1783 if (
mc.GetExternalConstraints()) {
1786 for (
const auto &
constr : *
mc.GetExternalConstraints()) {
1795 std::vector<std::string> names;
1796 names.reserve(args->size());
1798 names.push_back(arg->GetName());
1799 std::sort(names.begin(), names.end());
1803 writeList(
"parameters_of_interest",
mc.GetParametersOfInterest());
1807 if (
mc.GetNuisanceParameters()) {
1817 if (
mc.GetGlobalObservables()) {
1827 if (
mc.GetParametersOfInterest()) {
1854 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
1859 std::vector<RooAbsPdf *>
allpdfs;
1861 if (!arg->hasClients()) {
1862 if (
auto *pdf =
dynamic_cast<RooAbsPdf *
>(arg)) {
1872 std::vector<RooAbsReal *>
allfuncs;
1874 if (!arg->hasClients()) {
1875 if (
auto *func =
dynamic_cast<RooAbsReal *
>(arg)) {
1889 std::vector<RooAbsData *>
alldata;
1895 std::vector<RooJSONFactoryWSTool::CombinedData>
combData;
1898 if (!
data.components.empty())
1899 combData.push_back(
data);
1921 for (
const auto &pdf :
allpdfs) {
1922 if (pdf->dependsOn(*arg)) {
1934 if (
name !=
"default_values") {
1952 std::stringstream
ss(s);
1964 std::stringstream
ss(s);
1975 std::stringstream
ss;
1987 std::stringstream
ss;
1999 std::unique_ptr<JSONTree> tree = JSONTree::create();
2002 auto &metadata =
n[
"metadata"].set_map();
2041 std::ofstream out(
filename.c_str());
2042 if (!out.is_open()) {
2043 std::stringstream
ss;
2044 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2074 std::ofstream out(
filename.c_str());
2075 if (!out.is_open()) {
2076 std::stringstream
ss;
2077 ss <<
"RooJSONFactoryWSTool() invalid output file '" <<
filename <<
"'." << std::endl;
2090 for (
auto &
a :
seq->children()) {
2101 auto &
tags = (*node)[
"tags"];
2111 if (
auto dict =
attrNode->find(
"dict")) {
2112 if (
auto *
a = dict->find(
attrib)) {
2120 const std::string &
value)
2123 auto &dict = (*node)[
"dict"];
2141 auto metadata =
n.find(
"metadata");
2142 if (!metadata || !metadata->find(
"hs3_version")) {
2143 std::stringstream
ss;
2144 ss <<
"The HS3 version is missing in the JSON!\n"
2145 <<
"Please include the HS3 version in the metadata field, e.g.:\n"
2146 <<
" \"metadata\" :\n"
2153 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2154 if (
auto domains =
n.find(
"domains")) {
2171 for (
const auto &var :
snsh[
"parameters"].children()) {
2197 std::vector<std::unique_ptr<RooAbsData>> datasets;
2199 for (
const auto &
p :
dataNode->children()) {
2214 for (
auto const &
d : datasets) {
2232 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2234 if (this->
workspace()->getSnapshot(
"default_values")) {
2251 std::stringstream
ss;
2252 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2268 std::unique_ptr<JSONTree> tree = JSONTree::create(
is);
2284 std::stringstream
ss;
2285 ss <<
"RooJSONFactoryWSTool() invalid input file '" <<
filename <<
"'." << std::endl;
2298 bool isVariable =
true;
2299 if (
n.find(
"type")) {
2314 _domains = std::make_unique<RooFit::JSONIO::Detail::Domains>();
2315 if (
auto domains =
n.find(
"domains"))
2329 const auto &var =
snsh[
"parameters"].child(0);
2368 throw std::runtime_error(s);
std::unique_ptr< RooFit::Detail::JSONTree > varJSONString(const JSONNode &treeRoot)
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 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.
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.
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.
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
virtual double val_double() const
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
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Persistable container for RooFit projects.
TObject * obj(RooStringView name) const
Return any type of object (RooAbsArg, RooAbsData or generic object) with given name)
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.
const char * GetName() const override
Returns name of object.
TClass * IsA() const override
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()