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()
308 : std::numeric_limits<
double>::epsilon());
309 overall_high.push_back(
data[
"hi"].val_double() > 0 ?
data[
"hi"].val_double()
310 : std::numeric_limits<
double>::epsilon());
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()) {
364 if (!histNps.
empty()) {
367 v.setAllInterpCodes(4);
375 if (!normElems.
empty()) {
378 ws.
factory(
"RooConstVar::" + prefixedName +
"_scaleFactors(1.)");
389 if (!
p.has_child(
"samples")) {
392 double statErrThresh = 0;
393 std::string statErrType =
"Poisson";
394 if (
p.has_child(::Literals::staterror)) {
395 auto &staterr =
p[::Literals::staterror];
396 if (staterr.has_child(
"relThreshold"))
397 statErrThresh = staterr[
"relThreshold"].val_double();
398 if (staterr.has_child(
"constraint"))
399 statErrType = staterr[
"constraint"].val();
401 std::vector<double> sumW;
402 std::vector<double> sumW2;
403 std::vector<std::string> gammaParnames;
406 std::string fprefix =
name;
408 std::vector<std::unique_ptr<RooDataHist>>
data;
409 for (
const auto &comp :
p[
"samples"].children()) {
412 size_t nbins = dh->numEntries();
414 if (hasStaterror(comp)) {
419 for (
size_t i = 0; i < nbins; ++i) {
420 sumW[i] += dh->weight(i);
421 sumW2[i] += dh->weightSquared(i);
423 if (gammaParnames.empty()) {
424 if (
auto staterrorParams = findStaterror(comp).find(
"parameters")) {
425 for (
const auto &
v : staterrorParams->children()) {
426 gammaParnames.push_back(
v.val());
431 data.emplace_back(std::move(dh));
437 std::string channelName =
name;
438 erasePrefix(channelName,
"model_");
440 std::vector<double> errs(sumW.size());
441 for (
size_t i = 0; i < sumW.size(); ++i) {
442 errs[i] = std::sqrt(sumW2[i]) / sumW[i];
444 errs[i] = std::max(errs[i], 0.);
448 &createPHF(
"mc_stat_" + channelName,
"stat_" + channelName, gammaParnames, errs, *tool, constraints,
455 for (
const auto &comp :
p[
"samples"].children()) {
456 importHistSample(*tool, *
data[idx], observables, mcStatObject, fprefix, comp, constraints);
464 if (constraints.
empty()) {
467 std::string sumName =
name +
"_model";
468 erasePrefix(sumName,
"model_");
479 std::string
const &
key()
const override
481 static const std::string keystring =
"interpolation0d";
487 elem[
"type"] <<
key();
488 elem[
"interpolationCodes"].
fill_seq(fip->interpolationCodes());
490 elem[
"nom"] << fip->nominal();
491 elem[
"high"].
fill_seq(fip->high(), fip->variables().size());
492 elem[
"low"].
fill_seq(fip->low(), fip->variables().size());
499 std::string
const &
key()
const override
501 static const std::string keystring =
"interpolation";
507 elem[
"type"] <<
key();
532 if (
p.has_child(
"interpolationCodes")) {
534 for (
auto const &node :
p[
"interpolationCodes"].children()) {
549 if (!
p.has_child(
"high")) {
552 if (!
p.has_child(
"low")) {
555 if (!
p.has_child(
"nom")) {
559 double nom(
p[
"nom"].val_double());
563 std::vector<double> high;
566 std::vector<double> low;
569 if (vars.size() != low.size() || vars.size() != high.size()) {
571 "' has non-matching lengths of 'vars', 'high' and 'low'!");
576 if (
p.has_child(
"interpolationCodes")) {
578 for (
auto const &node :
p[
"interpolationCodes"].children()) {
590 if (
auto prod =
dynamic_cast<RooProduct *
>(arg)) {
591 for (
const auto &
e : prod->components()) {
592 collectElements(elems,
e);
604 :
name{par.
GetName()}, param{&par}, constraint{constr}
616 :
name(
n), param(
p), low(
l), high(
h), constraint(
c)
623 std::vector<double> low;
624 std::vector<double> high;
627 :
name(
n), param(
p), constraint(
c)
629 low.assign(
l->dataHist().weightArray(),
l->dataHist().weightArray() +
l->dataHist().numEntries());
630 high.assign(
h->dataHist().weightArray(),
h->dataHist().weightArray() +
h->dataHist().numEntries());
635 std::vector<double> constraints;
636 std::vector<std::string> parameters;
637 TClass *constraint =
nullptr;
642 std::vector<double> hist;
643 std::vector<double> histError;
644 std::vector<NormFactor> normfactors;
645 std::vector<NormSys> normsys;
646 std::vector<HistoSys> histosys;
647 std::vector<ShapeSys> shapesys;
648 std::vector<RooAbsReal *> otherElements;
649 bool useBarlowBeestonLight =
false;
650 std::vector<std::string> staterrorParameters;
657 std::string parname = par->
GetName();
658 bool isConstrained =
false;
659 for (
RooAbsArg const *pdf : ws->allPdfs()) {
660 if (
auto gauss =
dynamic_cast<RooGaussian const *
>(pdf)) {
661 if (parname == gauss->getX().GetName()) {
662 sample.normfactors.emplace_back(*par, gauss);
663 isConstrained =
true;
668 sample.normfactors.emplace_back(*par);
685 std::cout << pdfname <<
" is not a sumpdf" << std::endl;
690 std::string channelName = pdfname;
691 erasePrefix(channelName,
"model_");
692 eraseSuffix(channelName,
"_model");
694 for (
RooAbsArg *sample : sumpdf->funcList()) {
697 std::cout <<
"sample " << sample->
GetName() <<
" is no RooProduct or RooRealSumPdf in " << pdfname
703 std::map<int, double> tot_yield;
704 std::map<int, double> tot_yield2;
705 std::map<int, double> rel_errors;
707 long unsigned int nBins = 0;
709 std::vector<Sample> samples;
711 for (
size_t sampleidx = 0; sampleidx < sumpdf->
funcList().
size(); ++sampleidx) {
713 std::vector<RooStats::HistFactory::FlexibleInterpVar *> fips;
714 std::vector<ParamHistFunc *> phfs;
716 const auto func = sumpdf->
funcList().
at(sampleidx);
718 erasePrefix(sample.name,
"L_x_");
719 eraseSuffix(sample.name,
"_shapes");
720 eraseSuffix(sample.name,
"_" + channelName);
721 erasePrefix(sample.name, pdfname +
"_");
723 collectElements(elems, func);
724 collectElements(elems, sumpdf->
coefList().
at(sampleidx));
726 auto updateObservables = [&](
RooDataHist const &dataHist) {
727 if (varSet ==
nullptr) {
728 varSet = dataHist.
get();
729 nBins = dataHist.numEntries();
731 if (sample.hist.empty()) {
732 auto *
w = dataHist.weightArray();
733 sample.hist.assign(
w,
w + dataHist.numEntries());
746 }
else if (
auto constVar =
dynamic_cast<RooConstVar *
>(
e)) {
747 if (constVar->getVal() != 1.) {
748 sample.normfactors.emplace_back(*
e);
750 }
else if (
auto par =
dynamic_cast<RooRealVar *
>(
e)) {
751 addNormFactor(par, sample, ws);
752 }
else if (
auto hf =
dynamic_cast<const RooHistFunc *
>(
e)) {
753 updateObservables(hf->dataHist());
761 }
else if (
auto real =
dynamic_cast<RooAbsReal *
>(
e)) {
762 sample.otherElements.push_back(real);
769 updateObservables(nh->dataHist());
774 sortByName(sample.normfactors);
777 for (
auto *fip : fips) {
778 for (
size_t i = 0; i < fip->variables().
size(); ++i) {
780 std::string sysname(var->
GetName());
781 erasePrefix(sysname,
"alpha_");
782 const auto *constraint = findConstraint(var);
785 sample.normsys.emplace_back(sysname, var, fip->high()[i], fip->low()[i],
786 constraint ? constraint->
IsA() : nullptr);
789 sortByName(sample.normsys);
795 std::string sysname(var->
GetName());
796 erasePrefix(sysname,
"alpha_");
799 const auto *constraint = findConstraint(var);
802 sample.histosys.emplace_back(sysname, var, lo,
hi, constraint ? constraint->
IsA() : nullptr);
806 sortByName(sample.histosys);
810 if (
startsWith(std::string(phf->GetName()),
"mc_stat_")) {
812 for (
const auto &
g : phf->paramList()) {
813 sample.staterrorParameters.push_back(
g->GetName());
816 if (tot_yield.find(idx) == tot_yield.end()) {
820 tot_yield[idx] += sample.hist[idx - 1];
821 tot_yield2[idx] += (sample.hist[idx - 1] * sample.hist[idx - 1]);
823 sample.barlowBeestonLightConstraint = constraint->
IsA();
825 double erel = 1. / std::sqrt(constraint_p->
getX().
getVal());
826 rel_errors[idx] = erel;
829 rel_errors[idx] = erel;
832 "currently, only RooPoisson and RooGaussian are supported as constraint types");
836 sample.useBarlowBeestonLight =
true;
839 erasePrefix(sys.name, channelName +
"_");
840 eraseSuffix(sys.name,
"_ShapeSys");
842 for (
const auto &
g : phf->paramList()) {
843 sys.parameters.push_back(
g->GetName());
846 constraint = ws->
pdf(constraintName(
g->GetName()));
847 if (!constraint && !
g->isConstant()) {
849 }
else if (!constraint) {
850 sys.constraints.push_back(0.0);
851 }
else if (
auto constraint_p =
dynamic_cast<RooPoisson *
>(constraint)) {
852 sys.constraints.push_back(1. / std::sqrt(constraint_p->
getX().
getVal()));
853 if (!sys.constraint) {
856 }
else if (
auto constraint_g =
dynamic_cast<RooGaussian *
>(constraint)) {
858 if (!sys.constraint) {
863 sample.shapesys.emplace_back(std::move(sys));
866 sortByName(sample.shapesys);
869 samples.emplace_back(std::move(sample));
874 for (
auto &sample : samples) {
875 if (sample.hist.empty()) {
878 if (sample.useBarlowBeestonLight) {
879 sample.histError.resize(sample.hist.size());
880 for (
auto bin : rel_errors) {
883 const int i = bin.first;
884 const double relerr_tot = bin.second;
885 const double count = sample.hist[i - 1];
888 sample.histError[i - 1] = round_prec(relerr_tot * tot_yield[i] / std::sqrt(tot_yield2[i]) * count, 7);
893 bool observablesWritten =
false;
894 for (
const auto &sample : samples) {
896 elem[
"type"] <<
"histfactory_dist";
900 auto &modifiers = s[
"modifiers"];
903 for (
const auto &nf : sample.normfactors) {
906 mod[
"name"] << nf.name;
907 mod[
"parameter"] << nf.param->GetName();
908 mod[
"type"] <<
"normfactor";
910 mod[
"constraint_name"] << nf.constraint->GetName();
915 for (
const auto &sys : sample.normsys) {
918 mod[
"name"] << sys.name;
919 mod[
"type"] <<
"normsys";
920 mod[
"parameter"] << sys.param->GetName();
921 mod[
"constraint"] << toString(sys.constraint);
923 data[
"lo"] << sys.low;
924 data[
"hi"] << sys.high;
927 for (
const auto &sys : sample.histosys) {
930 mod[
"name"] << sys.name;
931 mod[
"type"] <<
"histosys";
932 mod[
"parameter"] << sys.param->GetName();
933 mod[
"constraint"] << toString(sys.constraint);
935 if (nBins != sys.low.size() || nBins != sys.high.size()) {
936 std::stringstream ss;
937 ss <<
"inconsistent binning: " << nBins <<
" bins expected, but " << sys.low.size() <<
"/"
938 << sys.high.size() <<
" found in nominal histogram errors!";
945 for (
const auto &sys : sample.shapesys) {
948 mod[
"name"] << sys.name;
949 mod[
"type"] <<
"shapesys";
950 optionallyExportGammaParameters(mod, sys.name, sys.parameters);
951 mod[
"constraint"] << toString(sys.constraint);
952 if (sys.constraint) {
953 auto &vals = mod[
"data"].
set_map()[
"vals"];
956 auto &vals = mod[
"data"].
set_map()[
"vals"];
958 for (std::size_t i = 0; i < sys.parameters.size(); ++i) {
964 for (
const auto &other : sample.otherElements) {
967 mod[
"name"] << other->GetName();
968 customModifiers.
add(*other);
969 mod[
"type"] <<
"custom";
972 if (sample.useBarlowBeestonLight) {
975 mod[
"name"] << ::Literals::staterror;
976 mod[
"type"] << ::Literals::staterror;
977 optionallyExportGammaParameters(mod,
"stat_" + channelName, sample.staterrorParameters);
978 mod[
"constraint"] << toString(sample.barlowBeestonLightConstraint);
981 if (!observablesWritten) {
984 auto &
out =
output.append_child().set_map();
986 writeAxis(out, *obs);
988 observablesWritten =
true;
990 auto &dataNode = s[
"data"].set_map();
991 if (nBins != sample.hist.size()) {
992 std::stringstream ss;
993 ss <<
"inconsistent binning: " << nBins <<
" bins expected, but " << sample.hist.size()
994 <<
" found in nominal histogram!";
998 if (!sample.histError.empty()) {
999 if (nBins != sample.histError.size()) {
1000 std::stringstream ss;
1001 ss <<
"inconsistent binning: " << nBins <<
" bins expected, but " << sample.histError.size()
1002 <<
" found in nominal histogram errors!";
1045 return tryExportHistFactory(tool, prodpdf->
GetName(), sumpdf, elem);
1047 std::string
const &
key()
const override
1049 static const std::string keystring =
"histfactory_dist";
1054 return tryExport(tool,
static_cast<const RooProdPdf *
>(
p), elem);
1063 return tryExportHistFactory(tool, sumpdf->
GetName(), sumpdf, elem);
1065 std::string
const &
key()
const override
1067 static const std::string keystring =
"histfactory_dist";
1072 return tryExport(tool,
static_cast<const RooRealSumPdf *
>(
p), elem);
1079 registerImporter<HistFactoryImporter>(
"histfactory_dist",
true);
1080 registerImporter<PiecewiseInterpolationFactory>(
"interpolation",
true);
1081 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
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
const RooArgList & lowList() const
void setInterpCode(RooAbsReal ¶m, int code, bool silent=true)
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.
Returns the bin width (or volume) given a RooHistFunc.
Represents a constant real-valued object.
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.
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.
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
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)
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
std::string GetName() const
get name of sample
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....
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 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.
TClass * IsA() const override
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)