48   if (binning.isUniform()) {
 
   50      axis[
"min"] << obs.
getMin();
 
   51      axis[
"max"] << obs.
getMax();
 
   53      auto &edges = axis[
"edges"];
 
   55      double val = binning.binLow(0);
 
   57      for (
int i = 0; i < binning.numBins(); ++i) {
 
   58         val = binning.binHigh(i);
 
   59         edges.append_child() << val;
 
   64double round_prec(
double d, 
int nSig)
 
   68   int ndigits = std::floor(std::log10(std::abs(
d))) + 1 - nSig;
 
   69   double sf = std::pow(10, ndigits);
 
   70   if (std::abs(
d / sf) < 2)
 
   72   return sf * std::round(
d / sf);
 
   78constexpr auto staterror = 
"staterror";
 
   81void erasePrefix(std::string &str, std::string_view prefix)
 
   84      str.erase(0, prefix.size());
 
   88void eraseSuffix(std::string &str, std::string_view suffix)
 
   91      str.erase(str.size() - suffix.size());
 
   96void sortByName(Coll &coll)
 
   98   std::sort(coll.begin(), coll.end(), [](
auto &
l, 
auto &
r) { return l.name < r.name; });
 
  104   for (
const auto &client : 
gamma->clients()) {
 
  105      if (
auto casted = 
dynamic_cast<T *
>(client)) {
 
  108         T *
c = findClient<T>(client);
 
  118   RooPoisson *constraint_p = findClient<RooPoisson>(
g);
 
  147inline std::string defaultGammaName(std::string 
const &sysname, std::size_t i)
 
  149   return "gamma_" + sysname + 
"_bin_" + std::to_string(i);
 
  154void optionallyExportGammaParameters(
JSONNode &mod, std::string 
const &sysname,
 
  155                                     std::vector<std::string> 
const ¶mNames)
 
  157   for (std::size_t i = 0; i < paramNames.size(); ++i) {
 
  158      if (paramNames[i] != defaultGammaName(sysname, i)) {
 
  159         mod[
"parameters"].
fill_seq(paramNames);
 
  165RooRealVar &createNominal(
RooWorkspace &ws, std::string 
const &parname, 
double val, 
double min, 
double max)
 
  167   RooRealVar &nom = getOrCreate<RooRealVar>(ws, 
"nom_" + parname, val, min, max);
 
  174std::string constraintName(std::string 
const ¶mName)
 
  176   return paramName + 
"Constraint";
 
  183   return getOrCreate<RooGaussian>(ws, constraintName(pname), *constrParam, *ws.
var(
"nom_" + pname), 1.);
 
  186ParamHistFunc &createPHF(
const std::string &phfname, std::string 
const &sysname,
 
  187                         const std::vector<std::string> &parnames, 
const std::vector<double> &vals,
 
  189                         const std::string &constraintType, 
double gammaMin, 
double gammaMax, 
double minSigma)
 
  194   for (std::size_t i = 0; i < vals.size(); ++i) {
 
  195      const std::string 
name = parnames.
empty() ? defaultGammaName(sysname, i) : parnames[i];
 
  196      gammas.
add(getOrCreate<RooRealVar>(ws, 
name, 1., gammaMin, gammaMax));
 
  201   if (constraintType != 
"Const") {
 
  204      for (
auto const &term : constraintsInfo.constraints) {
 
  206         constraints.
add(*ws.
pdf(term->GetName()));
 
  210         gamma->setConstant(
true);
 
  217bool hasStaterror(
const JSONNode &comp)
 
  221   for (
const auto &mod : comp[
"modifiers"].children()) {
 
  222      if (mod[
"type"].val() == ::Literals::staterror)
 
  231      for (
const auto &mod : comp[
"modifiers"].children()) {
 
  232         if (mod[
"type"].val() == ::Literals::staterror)
 
  237                               ::Literals::staterror + 
" modifier!");
 
  247   std::string prefixedName = fprefix + 
"_" + sampleName;
 
  249   std::string channelName = fprefix;
 
  250   erasePrefix(channelName, 
"model_");
 
  252   if (!
p.has_child(
"data")) {
 
  264   if (hasStaterror(
p)) {
 
  265      shapeElems.
add(*mcStatObject);
 
  268   if (
p.has_child(
"modifiers")) {
 
  270      std::vector<double> overall_low;
 
  271      std::vector<double> overall_high;
 
  278      for (
const auto &mod : 
p[
"modifiers"].children()) {
 
  279         std::string 
const &modtype = mod[
"type"].
val();
 
  280         std::string 
const &sysname =
 
  283               : (mod.
has_child(
"parameter") ? mod[
"parameter"].
val() : 
"syst_" + std::to_string(idx));
 
  285         if (modtype == 
"staterror") {
 
  287         } 
else if (modtype == 
"normfactor") {
 
  288            RooRealVar &constrParam = getOrCreate<RooRealVar>(ws, sysname, 1., -3, 5);
 
  289            normElems.
add(constrParam);
 
  290            if (
auto constrInfo = mod.
find(
"constraint_name")) {
 
  292               if (
auto gauss = 
dynamic_cast<RooGaussian const *
>(constraint)) {
 
  293                  constrParam.
setError(gauss->getSigma().getVal());
 
  295               constraints.
add(*constraint);
 
  297         } 
else if (modtype == 
"normsys") {
 
  298            auto *parameter = mod.
find(
"parameter");
 
  299            std::string parname(parameter ? parameter->val() : 
"alpha_" + sysname);
 
  300            createNominal(ws, parname, 0.0, -10, 10);
 
  301            overall_nps.
add(getOrCreate<RooRealVar>(ws, parname, 0., -5, 5));
 
  302            auto &
data = mod[
"data"];
 
  307            overall_low.push_back(
data[
"lo"].val_double() > 0 ? 
data[
"lo"].val_double()
 
  309            overall_high.push_back(
data[
"hi"].val_double() > 0 ? 
data[
"hi"].val_double()
 
  311            constraints.
add(getConstraint(ws, parname));
 
  312         } 
else if (modtype == 
"histosys") {
 
  313            auto *parameter = mod.
find(
"parameter");
 
  314            std::string parname(parameter ? parameter->val() : 
"alpha_" + sysname);
 
  315            createNominal(ws, parname, 0.0, -10, 10);
 
  316            histNps.
add(getOrCreate<RooRealVar>(ws, parname, 0., -5, 5));
 
  317            auto &
data = mod[
"data"];
 
  319               sysname + 
"Low_" + prefixedName, varlist,
 
  322               sysname + 
"High_" + prefixedName, varlist,
 
  324            constraints.
add(getConstraint(ws, parname));
 
  325         } 
else if (modtype == 
"shapesys") {
 
  326            std::string funcName = channelName + 
"_" + sysname + 
"_ShapeSys";
 
  328            std::vector<double> vals;
 
  329            for (
const auto &
v : mod[
"data"][
"vals"].children()) {
 
  330               vals.push_back(
v.val_double());
 
  332            std::vector<std::string> parnames;
 
  333            for (
const auto &
v : mod[
"parameters"].children()) {
 
  334               parnames.push_back(
v.val());
 
  339            std::string constraint(mod[
"constraint"].val());
 
  340            shapeElems.
add(createPHF(funcName, sysname, parnames, vals, tool, constraints, varlist, constraint,
 
  342         } 
else if (modtype == 
"custom") {
 
  348               shapeElems.
add(*obj);
 
  357      std::string interpName = sampleName + 
"_" + channelName + 
"_epsilon";
 
  358      if (!overall_nps.
empty()) {
 
  367      if (!histNps.
empty()) {
 
  370         v.setAllInterpCodes(4); 
 
  378   if (!normElems.
empty()) {
 
  381      ws.
factory(
"RooConstVar::" + prefixedName + 
"_scaleFactors(1.)");
 
  392      if (!
p.has_child(
"samples")) {
 
  395      double statErrThresh = 0;
 
  396      std::string statErrType = 
"Poisson";
 
  397      if (
p.has_child(::Literals::staterror)) {
 
  398         auto &staterr = 
p[::Literals::staterror];
 
  399         if (staterr.has_child(
"relThreshold"))
 
  400            statErrThresh = staterr[
"relThreshold"].val_double();
 
  401         if (staterr.has_child(
"constraint"))
 
  402            statErrType = staterr[
"constraint"].val();
 
  404      std::vector<double> sumW;
 
  405      std::vector<double> sumW2;
 
  406      std::vector<std::string> gammaParnames;
 
  409      std::string fprefix = 
name;
 
  411      std::vector<std::unique_ptr<RooDataHist>> 
data;
 
  412      for (
const auto &comp : 
p[
"samples"].children()) {
 
  415         size_t nbins = dh->numEntries();
 
  417         if (hasStaterror(comp)) {
 
  422            for (
size_t i = 0; i < nbins; ++i) {
 
  423               sumW[i] += dh->weight(i);
 
  424               sumW2[i] += dh->weightSquared(i);
 
  426            if (gammaParnames.empty()) {
 
  427               if (
auto staterrorParams = findStaterror(comp).find(
"parameters")) {
 
  428                  for (
const auto &
v : staterrorParams->children()) {
 
  429                     gammaParnames.push_back(
v.val());
 
  434         data.emplace_back(std::move(dh));
 
  440         std::string channelName = 
name;
 
  441         erasePrefix(channelName, 
"model_");
 
  443         std::vector<double> errs(sumW.size());
 
  444         for (
size_t i = 0; i < sumW.size(); ++i) {
 
  445            errs[i] = std::sqrt(sumW2[i]) / sumW[i];
 
  447            errs[i] = std::max(errs[i], 0.);
 
  451            &createPHF(
"mc_stat_" + channelName, 
"stat_" + channelName, gammaParnames, errs, *tool, constraints,
 
  458      for (
const auto &comp : 
p[
"samples"].children()) {
 
  459         importHistSample(*tool, *
data[idx], observables, mcStatObject, fprefix, comp, constraints);
 
  467      if (constraints.
empty()) {
 
  470         std::string sumName = 
name + 
"_model";
 
  471         erasePrefix(sumName, 
"model_");
 
  482   std::string 
const &
key()
 const override 
  484      static const std::string keystring = 
"interpolation0d";
 
  490      elem[
"type"] << 
key();
 
  491      elem[
"interpolationCodes"].
fill_seq(fip->interpolationCodes());
 
  493      elem[
"nom"] << fip->nominal();
 
  494      elem[
"high"].
fill_seq(fip->high(), fip->variables().size());
 
  495      elem[
"low"].
fill_seq(fip->low(), fip->variables().size());
 
  502   std::string 
const &
key()
 const override 
  504      static const std::string keystring = 
"interpolation";
 
  510      elem[
"type"] << 
key();
 
  535      if (
p.has_child(
"interpolationCodes")) {
 
  537         for (
auto const &node : 
p[
"interpolationCodes"].children()) {
 
  552      if (!
p.has_child(
"high")) {
 
  555      if (!
p.has_child(
"low")) {
 
  558      if (!
p.has_child(
"nom")) {
 
  562      double nom(
p[
"nom"].val_double());
 
  566      std::vector<double> high;
 
  569      std::vector<double> low;
 
  572      if (vars.size() != low.size() || vars.size() != high.size()) {
 
  574                                     "' has non-matching lengths of 'vars', 'high' and 'low'!");
 
  579      if (
p.has_child(
"interpolationCodes")) {
 
  581         for (
auto const &node : 
p[
"interpolationCodes"].children()) {
 
  593   if (
auto prod = 
dynamic_cast<RooProduct *
>(arg)) {
 
  594      for (
const auto &
e : prod->components()) {
 
  595         collectElements(elems, 
e);
 
  607      : 
name{par.
GetName()}, param{&par}, constraint{constr}
 
  619      : 
name(
n), param(
p), low(
l), high(
h), constraint(
c)
 
  626   std::vector<double> low;
 
  627   std::vector<double> high;
 
  630      : 
name(
n), param(
p), constraint(
c)
 
  632      low.assign(
l->dataHist().weightArray(), 
l->dataHist().weightArray() + 
l->dataHist().numEntries());
 
  633      high.assign(
h->dataHist().weightArray(), 
h->dataHist().weightArray() + 
h->dataHist().numEntries());
 
  638   std::vector<double> constraints;
 
  639   std::vector<std::string> parameters;
 
  640   TClass *constraint = 
nullptr;
 
  645   std::vector<double> hist;
 
  646   std::vector<double> histError;
 
  647   std::vector<NormFactor> normfactors;
 
  648   std::vector<NormSys> normsys;
 
  649   std::vector<HistoSys> histosys;
 
  650   std::vector<ShapeSys> shapesys;
 
  651   std::vector<RooAbsReal *> otherElements;
 
  652   bool useBarlowBeestonLight = 
false;
 
  653   std::vector<std::string> staterrorParameters;
 
  660   std::string parname = par->
GetName();
 
  661   bool isConstrained = 
false;
 
  662   for (
RooAbsArg const *pdf : ws->allPdfs()) {
 
  663      if (
auto gauss = 
dynamic_cast<RooGaussian const *
>(pdf)) {
 
  664         if (parname == gauss->getX().GetName()) {
 
  665            sample.normfactors.emplace_back(*par, gauss);
 
  666            isConstrained = 
true;
 
  671      sample.normfactors.emplace_back(*par);
 
  683   std::string channelName = pdfname;
 
  684   erasePrefix(channelName, 
"model_");
 
  685   eraseSuffix(channelName, 
"_model");
 
  687   for (
RooAbsArg *sample : sumpdf->funcList()) {
 
  693   std::map<int, double> tot_yield;
 
  694   std::map<int, double> tot_yield2;
 
  695   std::map<int, double> rel_errors;
 
  697   long unsigned int nBins = 0;
 
  699   std::vector<Sample> samples;
 
  701   for (
size_t sampleidx = 0; sampleidx < sumpdf->
funcList().
size(); ++sampleidx) {
 
  704      std::vector<ParamHistFunc *> phfs;
 
  706      const auto func = sumpdf->
funcList().
at(sampleidx);
 
  708      erasePrefix(sample.name, 
"L_x_");
 
  709      eraseSuffix(sample.name, 
"_shapes");
 
  710      eraseSuffix(sample.name, 
"_" + channelName);
 
  711      erasePrefix(sample.name, pdfname + 
"_");
 
  713      collectElements(elems, func);
 
  714      collectElements(elems, sumpdf->
coefList().
at(sampleidx));
 
  716      auto updateObservables = [&](
RooDataHist const &dataHist) {
 
  717         if (varSet == 
nullptr) {
 
  718            varSet = dataHist.
get();
 
  719            nBins = dataHist.numEntries();
 
  721         if (sample.hist.empty()) {
 
  722            auto *
w = dataHist.weightArray();
 
  723            sample.hist.assign(
w, 
w + dataHist.numEntries());
 
  736         } 
else if (
auto constVar = 
dynamic_cast<RooConstVar *
>(
e)) {
 
  737            if (constVar->getVal() != 1.) {
 
  738               sample.normfactors.emplace_back(*
e);
 
  740         } 
else if (
auto par = 
dynamic_cast<RooRealVar *
>(
e)) {
 
  741            addNormFactor(par, sample, ws);
 
  742         } 
else if (
auto hf = 
dynamic_cast<const RooHistFunc *
>(
e)) {
 
  743            updateObservables(hf->dataHist());
 
  748         } 
else if (
auto real = 
dynamic_cast<RooAbsReal *
>(
e)) {
 
  749            sample.otherElements.push_back(real);
 
  756            updateObservables(nh->dataHist());
 
  761      sortByName(sample.normfactors);
 
  767            std::string sysname(var->
GetName());
 
  768            erasePrefix(sysname, 
"alpha_");
 
  769            sample.normsys.emplace_back(sysname, var, fip->
high()[i], fip->
low()[i], findConstraint(var)->
IsA());
 
  771         sortByName(sample.normsys);
 
  778            std::string sysname(var->
GetName());
 
  779            erasePrefix(sysname, 
"alpha_");
 
  782                  sample.histosys.emplace_back(sysname, var, lo, 
hi, findConstraint(var)->
IsA());
 
  786         sortByName(sample.histosys);
 
  790         if (
startsWith(std::string(phf->GetName()), 
"mc_stat_")) { 
 
  792            for (
const auto &
g : phf->paramList()) {
 
  793               sample.staterrorParameters.push_back(
g->GetName());
 
  796               if (tot_yield.find(idx) == tot_yield.end()) {
 
  800               tot_yield[idx] += sample.hist[idx - 1];
 
  801               tot_yield2[idx] += (sample.hist[idx - 1] * sample.hist[idx - 1]);
 
  803                  sample.barlowBeestonLightConstraint = constraint->
IsA();
 
  805                     double erel = 1. / std::sqrt(constraint_p->
getX().
getVal());
 
  806                     rel_errors[idx] = erel;
 
  809                     rel_errors[idx] = erel;
 
  812                        "currently, only RooPoisson and RooGaussian are supported as constraint types");
 
  816            sample.useBarlowBeestonLight = 
true;
 
  819            erasePrefix(sys.name, channelName + 
"_");
 
  820            eraseSuffix(sys.name, 
"_ShapeSys");
 
  822            for (
const auto &
g : phf->paramList()) {
 
  823               sys.parameters.push_back(
g->GetName());
 
  826                  constraint = ws->
pdf(constraintName(
g->GetName()));
 
  827               if (!constraint && !
g->isConstant())
 
  829               else if (!constraint) {
 
  830                  sys.constraints.push_back(0.0);
 
  831               } 
else if (
auto constraint_p = 
dynamic_cast<RooPoisson *
>(constraint)) {
 
  832                  sys.constraints.push_back(1. / std::sqrt(constraint_p->
getX().
getVal()));
 
  833                  if (!sys.constraint) {
 
  836               } 
else if (
auto constraint_g = 
dynamic_cast<RooGaussian *
>(constraint)) {
 
  838                  if (!sys.constraint) {
 
  843            sample.shapesys.emplace_back(std::move(sys));
 
  846      sortByName(sample.shapesys);
 
  849      samples.emplace_back(std::move(sample));
 
  854   for (
auto &sample : samples) {
 
  855      if (sample.hist.empty()) {
 
  858      if (sample.useBarlowBeestonLight) {
 
  859         sample.histError.resize(sample.hist.size());
 
  860         for (
auto bin : rel_errors) {
 
  863            const int i = bin.first;
 
  864            const double relerr_tot = bin.second;
 
  865            const double count = sample.hist[i - 1];
 
  868            sample.histError[i - 1] = round_prec(relerr_tot * tot_yield[i] / std::sqrt(tot_yield2[i]) * count, 7);
 
  873   bool observablesWritten = 
false;
 
  874   for (
const auto &sample : samples) {
 
  876      elem[
"type"] << 
"histfactory_dist";
 
  880      auto &modifiers = s[
"modifiers"];
 
  883      for (
const auto &nf : sample.normfactors) {
 
  886         mod[
"name"] << nf.name;
 
  887         mod[
"parameter"] << nf.param->GetName();
 
  888         mod[
"type"] << 
"normfactor";
 
  890            mod[
"constraint_name"] << nf.constraint->GetName();
 
  895      for (
const auto &sys : sample.normsys) {
 
  898         mod[
"name"] << sys.name;
 
  899         mod[
"type"] << 
"normsys";
 
  900         mod[
"parameter"] << sys.param->GetName();
 
  901         mod[
"constraint"] << toString(sys.constraint);
 
  903         data[
"lo"] << sys.low;
 
  904         data[
"hi"] << sys.high;
 
  907      for (
const auto &sys : sample.histosys) {
 
  910         mod[
"name"] << sys.name;
 
  911         mod[
"type"] << 
"histosys";
 
  912         mod[
"parameter"] << sys.param->GetName();
 
  913         mod[
"constraint"] << toString(sys.constraint);
 
  915         if (nBins != sys.low.size() || nBins != sys.high.size()) {
 
  916            std::stringstream ss;
 
  917            ss << 
"inconsistent binning: " << nBins << 
" bins expected, but " << sys.low.size() << 
"/" 
  918               << sys.high.size() << 
" found in nominal histogram errors!";
 
  925      for (
const auto &sys : sample.shapesys) {
 
  928         mod[
"name"] << sys.name;
 
  929         mod[
"type"] << 
"shapesys";
 
  930         optionallyExportGammaParameters(mod, sys.name, sys.parameters);
 
  931         mod[
"constraint"] << toString(sys.constraint);
 
  932         if (sys.constraint) {
 
  933            auto &vals = mod[
"data"].
set_map()[
"vals"];
 
  936            auto &vals = mod[
"data"].
set_map()[
"vals"];
 
  938            for (std::size_t i = 0; i < sys.parameters.size(); ++i) {
 
  944      for (
const auto &other : sample.otherElements) {
 
  947         mod[
"name"] << other->GetName();
 
  948         customModifiers.
add(*other);
 
  949         mod[
"type"] << 
"custom";
 
  952      if (sample.useBarlowBeestonLight) {
 
  955         mod[
"name"] << ::Literals::staterror;
 
  956         mod[
"type"] << ::Literals::staterror;
 
  957         optionallyExportGammaParameters(mod, 
"stat_" + channelName, sample.staterrorParameters);
 
  958         mod[
"constraint"] << toString(sample.barlowBeestonLightConstraint);
 
  961      if (!observablesWritten) {
 
  964            auto &
out = 
output.append_child().set_map();
 
  966            writeAxis(out, *obs);
 
  968         observablesWritten = 
true;
 
  970      auto &dataNode = s[
"data"].set_map();
 
  971      if (nBins != sample.hist.size()) {
 
  972         std::stringstream ss;
 
  973         ss << 
"inconsistent binning: " << nBins << 
" bins expected, but " << sample.hist.size()
 
  974            << 
" found in nominal histogram!";
 
  978      if (!sample.histError.empty()) {
 
  979         if (nBins != sample.histError.size()) {
 
  980            std::stringstream ss;
 
  981            ss << 
"inconsistent binning: " << nBins << 
" bins expected, but " << sample.histError.size()
 
  982               << 
" found in nominal histogram errors!";
 
 1016      return tryExportHistFactory(tool, prodpdf->
GetName(), sumpdf, elem);
 
 1018   std::string 
const &
key()
 const override 
 1020      static const std::string keystring = 
"histfactory_dist";
 
 1025      return tryExport(tool, 
static_cast<const RooProdPdf *
>(
p), elem);
 
 1034      return tryExportHistFactory(tool, sumpdf->
GetName(), sumpdf, elem);
 
 1036   std::string 
const &
key()
 const override 
 1038      static const std::string keystring = 
"histfactory_dist";
 
 1043      return tryExport(tool, 
static_cast<const RooRealSumPdf *
>(
p), elem);
 
 1050   registerImporter<HistFactoryImporter>(
"histfactory_dist", 
true);
 
 1051   registerImporter<PiecewiseInterpolationFactory>(
"interpolation", 
true);
 
 1052   registerImporter<FlexibleInterpVarFactory>(
"interpolation0d", 
true);
 
bool startsWith(std::string_view str, std::string_view prefix)
bool endsWith(std::string_view str, std::string_view suffix)
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void funcs
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t modifier
TClass * IsA() const override
A class which maps the current values of a RooRealVar (or a set of RooRealVars) to one of a number of...
The PiecewiseInterpolation is a class that can morph distributions into each other,...
const RooArgList & highList() const
const RooAbsReal * nominalHist() const
Return pointer to the nominal hist function.
bool positiveDefinite() const
void setInterpCode(RooAbsReal ¶m, int code, bool silent=false)
const RooArgList & lowList() const
void setPositiveDefinite(bool flag=true)
const RooArgList & paramList() const
const std::vector< int > & interpolationCodes() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool dependsOn(const RooAbsCollection &serverList, const RooAbsArg *ignoreArg=nullptr, bool valueOnly=false) const
Test whether we depend on (ie, are served by) any object in the specified collection.
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...
Storage_t const & get() const
Const access to the underlying stl container.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Storage_t::size_type size() const
Abstract interface for all probability density functions.
TClass * IsA() const override
Int_t numBins(const char *rangeName=nullptr) const override
void setConstant(bool value=true)
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...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
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.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooBinWidthFunction is a class that returns the bin width (or volume) given a RooHistFunc.
RooConstVar represent a constant real-valued object.
The RooDataHist is a container class to hold N-dimensional binned data.
virtual std::string val() const =0
void fill_seq(Collection const &coll)
virtual JSONNode & set_map()=0
virtual JSONNode & append_child()=0
virtual JSONNode & set_seq()=0
virtual bool has_child(std::string const &) const =0
JSONNode const * find(std::string const &key) const
virtual bool autoExportDependants() const
virtual std::string const & key() const =0
virtual bool exportObject(RooJSONFactoryWSTool *, const RooAbsArg *, RooFit::Detail::JSONNode &) const
virtual bool importArg(RooJSONFactoryWSTool *tool, const RooFit::Detail::JSONNode &node) const
RooAbsReal const & getMean() const
Get the mean parameter.
RooAbsReal const & getSigma() const
Get the sigma parameter.
RooHistFunc implements a real-valued function sampled from a multidimensional histogram.
RooAbsReal const & getX() const
Get the x variable.
Efficient implementation of a product of PDFs of the form.
A RooProduct represents the product of a given set of RooAbsReal objects.
Implements a PDF constructed from a sum of functions:
const RooArgList & funcList() const
const RooArgList & coefList() const
RooRealVar represents a variable that can be changed from the outside.
void setError(double value)
const RooAbsBinning & getBinning(const char *name=nullptr, bool verbose=true, bool createOnTheFly=false) const override
Return binning definition with name.
void setInterpCode(RooAbsReal ¶m, int code)
void setAllInterpCodes(int code)
const RooListProxy & variables() const
const std::vector< double > & high() const
const std::vector< double > & low() const
Configuration for a constrained, coherent shape variation of affected samples.
Configuration for an un- constrained overall systematic to scale sample normalisations.
std::string GetName() const
Constrained bin-by-bin variation of affected histogram.
Persistable container for RooFit projects.
RooAbsPdf * pdf(RooStringView name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooAbsReal * function(RooStringView name) const
Retrieve function (RooAbsReal) with given name. Note that all RooAbsPdfs are also RooAbsReals....
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.
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.
TClass instances represent classes, structs and namespaces in the ROOT type system.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
RooCmdArg RecycleConflictNodes(bool flag=true)
RooCmdArg Conditional(const RooArgSet &pdfSet, const RooArgSet &depSet, bool depsAreCond=false)
constexpr double defaultShapeSysGammaMax
constexpr double minShapeUncertainty
constexpr double defaultStatErrorGammaMax
constexpr double defaultGammaMin
CreateGammaConstraintsOutput createGammaConstraints(RooArgList const ¶mList, std::span< const double > relSigmas, double minSigma, Constraint::Type type)
#define STATIC_EXECUTE(MY_FUNC)
static uint64_t sum(uint64_t i)