28std::string at(
const char *section, std::size_t
index, std::string
const &
name)
30 return std::string(section) +
"[" + std::to_string(
index) +
"](" +
name +
")";
35 Validator(HS3Document
const &doc,
Diagnostics &diagnostics, ValidateOptions
const &options)
44 checkCategoricalAxes();
49 for (std::size_t i = 0; i <
_doc.distributions.size(); ++i) {
50 auto const &
dist =
_doc.distributions[i];
51 if (
auto const *histFactory = std::get_if<HistFactoryDist>(&
dist.body)) {
52 checkHistFactory(*histFactory,
dist.name, at(
"distributions", i,
dist.name));
55 for (
auto const &item :
_doc.rooFit.combinedDistributions) {
56 for (
auto const &ref : item.second.distributions) {
57 requireDistribution(ref.name,
"misc.ROOT_internal.combined_distributions." + item.first,
"distribution");
60 for (
auto const &item :
_doc.rooFit.channelConstraints) {
61 requireDistribution(item.first,
"misc.ROOT_internal.histfactory_constraints",
"distribution");
62 for (
auto const &ref : item.second) {
63 requireDistribution(ref.name,
"misc.ROOT_internal.histfactory_constraints." + item.first,
"constraint");
68 void error(std::string
const &path, std::string
const &
message)
73 void warning(std::string
const &path, std::string
const &
message)
79 void strictError(std::string
const &path, std::string
const &
message)
85 void checkHistFactory(HistFactoryDist
const &dist, std::string
const &
name, std::string
const &path);
90 char const *sectionOf(std::string
const &
name)
const
93 return found !=
_sections.end() ? found->second.front() :
nullptr;
96 bool isDefinedIn(std::string
const &
name,
char const *section)
const
102 return std::any_of(found->second.begin(), found->second.end(),
103 [&](
char const *s) { return std::string(s) == section; });
106 void requireDistribution(std::string
const &
name, std::string
const &path, std::string
const &
what)
109 if (!isDefinedIn(
name,
"distributions") && !
_doc.rooFit.combinedDistributions.count(
name) && !isExternal(
name)) {
110 error(path,
"the " +
what +
" '" +
name +
"' does not exist");
117 std::size_t checkAxis(BinnedAxis
const &axis, std::string
const &path);
118 std::size_t checkAxis(CategoricalAxis
const &axis, std::string
const &path);
119 template <
class... Axis>
120 std::size_t checkAxis(std::variant<Axis...>
const &axis, std::string
const &path)
122 return std::visit([&](
auto const &
a) {
return checkAxis(
a, path); }, axis);
125 template <
class Axes>
126 std::optional<std::size_t> numBins(Axes
const &axes, std::string
const &path);
129 void checkFixedAxes();
130 void checkCategoricalAxes();
131 void checkLikelihoods();
132 void checkAnalyses();
134 void checkCombinedData();
139 std::map<std::string, std::vector<char const *>>
_sections;
145void Validator::collectNames()
147 auto check = [&](
char const *section, std::string
const &
name) {
149 sections.push_back(section);
150 if (sections.size() == 1) {
153 std::string
const firstSection = sections.front();
157 auto isLegacyNamed = [](std::string
const &s) {
return s ==
"likelihoods" || s ==
"analyses"; };
160 auto isReferable = [](std::string
const &s) {
return s ==
"distributions" || s ==
"functions"; };
161 const bool ambiguous = firstSection == section || (isReferable(firstSection) && isReferable(section));
162 if (!
_options.strict || !ambiguous || isLegacyNamed(firstSection) || isLegacyNamed(section)) {
163 warning(
"",
"the name '" +
name +
"' is used in \"" + firstSection +
"\" and in \"" + section +
164 "\", which is not allowed by the HS3 standard.");
167 error(
"",
"duplicate name '" +
name +
"': it is defined in \"" + firstSection +
"\" and in \"" + section +
168 "\", but names must be unique within the document");
170 auto checkSection = [&](
char const *section,
auto const &objects) {
171 for (
auto const &
object : objects) {
172 check(section,
object.
name);
175 checkSection(
"distributions",
_doc.distributions);
176 checkSection(
"functions",
_doc.functions);
177 checkSection(
"data",
_doc.data);
178 checkSection(
"domains",
_doc.domains);
179 checkSection(
"parameter_points",
_doc.parameterPoints);
180 checkSection(
"likelihoods",
_doc.likelihoods);
181 checkSection(
"analyses",
_doc.analyses);
185 for (
auto const &domain :
_doc.domains) {
186 for (
auto const &axis : domain.axes) {
187 addParameter(std::visit([](
auto const &
a) -> std::string
const & {
return a.name; }, axis));
190 for (
auto const &point :
_doc.parameterPoints) {
191 for (
auto const ¶meter : point.parameters) {
192 addParameter(parameter.name);
195 for (
auto const &item :
_doc.rooFit.combinedDistributions) {
196 addParameter(item.second.indexCat);
198 for (
auto const &dist :
_doc.distributions) {
199 auto const *histFactory = std::get_if<HistFactoryDist>(&
dist.body);
203 for (
auto const &sample : histFactory->samples) {
204 for (
auto const &
modifier : sample.modifiers) {
205 std::visit(overloaded{[&](NormFactor
const &
m) { addParameter(
m.parameter.name); },
206 [&](NormSys
const &
m) { addParameter(
m.parameter.name); },
207 [&](HistoSys
const &
m) { addParameter(
m.parameter.name); },
208 [&](ShapeSys
const &
m) {
209 for (
auto const &
p :
m.parameters) {
210 addParameter(
p.name);
213 [&](StatError
const &
m) {
214 for (
auto const &
p :
m.parameters) {
215 addParameter(
p.name);
218 [](CustomModifier
const &) {}},
224 if (
char const *section = sectionOf(parameter)) {
225 strictError(
"",
"the name '" + parameter +
"' is used in \"" + section +
226 "\" and for a parameter, which is not allowed by the HS3 standard.");
233void Validator::checkFixedAxes()
237 std::string
const *domain =
nullptr;
239 std::map<std::string, FixedAxis> fixedAxes;
240 auto forEachAxis = [&](
auto &&fn) {
241 for (std::size_t i = 0; i <
_doc.domains.size(); ++i) {
242 for (
auto const &axis :
_doc.domains[i].axes) {
244 fn(i, std::visit([](
auto const &
a) -> std::string
const & {
return a.name; }, axis),
245 std::get_if<DomainAxis>(&axis));
249 forEachAxis([&](std::size_t i, std::string
const &, DomainAxis
const *continuous) {
250 if (!continuous || !continuous->fixedValue) {
253 DomainAxis
const &axis = *continuous;
254 Domain
const &domain =
_doc.domains[i];
255 if (!std::isfinite(*axis.fixedValue)) {
256 error(at(
"domains", i, domain.name),
257 "the single value of the parameter '" + axis.name +
"' is not finite, which JSON can't represent");
259 auto inserted = fixedAxes.insert({axis.name, FixedAxis{*axis.fixedValue, &domain.name}});
260 if (!inserted.second && inserted.first->second.value != *axis.fixedValue) {
261 error(at(
"domains", i, domain.name),
262 "the parameter '" + axis.name +
"' has different single values in the domains '" +
263 *inserted.first->second.domain +
"' and '" + domain.name +
"'");
266 if (fixedAxes.empty()) {
269 forEachAxis([&](std::size_t i, std::string
const &
name, DomainAxis
const *continuous) {
270 auto found = fixedAxes.find(
name);
271 if (found != fixedAxes.end() && !(continuous && continuous->fixedValue)) {
272 Domain const &domain = _doc.domains[i];
273 error(at(
"domains", i, domain.name),
274 "the parameter '" + name +
"' has the single value " + std::to_string(found->second.value) +
275 " in the domain '" + *found->second.domain +
"', but " + (continuous ?
"a range" :
"categories") +
276 " in the domain '" + domain.name +
"'");
279 for (std::size_t i = 0; i <
_doc.parameterPoints.size(); ++i) {
280 ParameterPoint
const &point =
_doc.parameterPoints[i];
281 for (ParameterValue
const ¶meter : point.parameters) {
282 auto found = fixedAxes.find(parameter.name);
283 double const *
value = parameter.value ? std::get_if<double>(&*parameter.value) : nullptr;
284 if (
value && found != fixedAxes.end() && *
value != found->second.value) {
285 error(at(
"parameter_points", i, point.name),
286 "the parameter point '" + point.name +
"' gives the parameter '" + parameter.name +
"' the value " +
287 std::to_string(*
value) +
", but its domain only has the value " +
288 std::to_string(found->second.value));
296void Validator::checkCategoricalAxes()
299 std::vector<std::string>
const *categories =
nullptr;
300 std::string
const *domain =
nullptr;
302 std::map<std::string, Declaration> categorical;
303 for (std::size_t i = 0; i <
_doc.domains.size(); ++i) {
304 Domain
const &domain =
_doc.domains[i];
305 for (
auto const &axis : domain.axes) {
306 auto const *cat = std::get_if<CategoricalAxis>(&axis);
310 auto inserted = categorical.insert({cat->name, Declaration{&cat->categories, &domain.name}});
311 if (!inserted.second && *inserted.first->second.categories != cat->categories) {
312 error(at(
"domains", i, domain.name),
"the categorical axis '" + cat->name +
"' is listed in the domains '" +
313 *inserted.first->second.domain +
"' and '" + domain.name +
314 "' with different categories");
318 for (std::size_t i = 0; i <
_doc.domains.size(); ++i) {
319 Domain
const &domain =
_doc.domains[i];
320 for (
auto const &axis : domain.axes) {
321 auto const *continuous = std::get_if<DomainAxis>(&axis);
322 if (!continuous || continuous->fixedValue) {
325 auto found = categorical.find(continuous->name);
326 if (found != categorical.end()) {
327 error(at(
"domains", i, domain.name),
328 "the axis '" + continuous->name +
"' is listed in a domain as categorical and as continuous");
336void Validator::checkCombinedData()
338 std::map<std::string, std::vector<std::string>
const *> categorical;
339 for (Domain
const &domain :
_doc.domains) {
340 for (
auto const &axis : domain.axes) {
341 if (
auto const *cat = std::get_if<CategoricalAxis>(&axis)) {
342 categorical.emplace(cat->name, &cat->categories);
346 std::set<std::string> combinedNames;
348 if (std::holds_alternative<CombinedData>(
data.body)) {
349 combinedNames.insert(
data.name);
352 std::set<std::string> usedComponents;
353 for (std::size_t i = 0; i <
_doc.data.size(); ++i) {
354 auto const *combined = std::get_if<CombinedData>(&
_doc.data[i].body);
358 std::string
const path = at(
"data", i,
_doc.data[i].name);
359 std::string
const context =
"the combined data set '" +
_doc.data[i].name +
"'";
360 std::vector<std::vector<std::string>
const *> columnCategories;
361 std::set<std::string> columns;
362 for (std::string
const &column : combined->columns) {
363 auto found = categorical.find(column);
364 if (found == categorical.end() && !isExternal(column)) {
366 "the column '" + column +
"' of " + context +
" is not declared by a categorical axis of a domain");
369 if (!columns.insert(column).second) {
370 error(path,
"the column '" + column +
"' of " + context +
" is listed twice");
373 columnCategories.push_back(found != categorical.end() ? found->second : nullptr);
375 std::set<std::vector<std::string>> keys;
376 for (CombinedDataComponent
const &component : combined->components) {
377 for (std::size_t k = 0; k < component.key.size(); ++k) {
378 auto const *categories = columnCategories[k];
380 std::find(categories->begin(), categories->end(), component.key[k]) == categories->end()) {
381 error(path,
"the label '" + component.key[k] +
"' in position " + std::to_string(k) +
" of a key of " +
382 context +
" is not one of the categories of '" + combined->columns[k] +
"'");
385 if (!keys.insert(component.key).second) {
386 std::string key =
"[";
387 for (std::size_t k = 0; k < component.key.size(); ++k) {
388 key += (k == 0 ?
"\"" :
", \"") + component.key[k] +
"\"";
390 error(path,
"the key " + key +
"] is used by two components of " + context);
392 std::string
const &
name = component.data.name;
393 if (!isDefinedIn(
name,
"data") || combinedNames.count(
name) || !usedComponents.insert(
name).second) {
394 error(path,
"the component '" +
name +
"' of " + context +
395 " is not a data set of the document, or it is already a component of another combined "
402void Validator::checkLikelihoods()
404 for (std::size_t i = 0; i <
_doc.likelihoods.size(); ++i) {
405 auto const &likelihood =
_doc.likelihoods[i];
406 const std::string path = at(
"likelihoods", i, likelihood.name);
407 for (
auto const &term : likelihood.terms) {
408 requireDistribution(term.distribution.name, path +
".distributions",
"distribution");
409 if (
auto const *
data = std::get_if<DataRef>(&term.data)) {
410 if (!isDefinedIn(
data->name,
"data")) {
411 error(path +
".data",
"dataset '" +
data->name +
"' cannot be found!");
415 for (
auto const &aux : likelihood.auxDistributions) {
416 if (!isDefinedIn(aux.name,
"distributions") && !isExternal(aux.name)) {
417 strictError(path +
".aux_distributions",
"the distribution '" + aux.name +
"' does not exist");
423void Validator::checkAnalyses()
425 for (std::size_t i = 0; i <
_doc.analyses.size(); ++i) {
426 auto const &analysis =
_doc.analyses[i];
427 const std::string path = at(
"analyses", i, analysis.name);
428 if (!isDefinedIn(analysis.likelihood.name,
"likelihoods")) {
429 error(path +
".likelihood",
"likelihood node not found!");
431 for (
auto const &poi : analysis.parametersOfInterest) {
432 if (
char const *section = sectionOf(poi.name)) {
433 error(path,
"the parameter of interest '" + poi.name +
"' of analysis '" + analysis.name +
434 "' is defined in \"" + section +
"\", but it must be a parameter");
435 }
else if (!
_parameters.count(poi.name) && !isExternal(poi.name)) {
436 error(path,
"the object '" + poi.name +
"' in \"parameters_of_interest\" of analysis '" + analysis.name +
440 for (
auto const &domain : analysis.domains) {
441 if (!isDefinedIn(domain.name,
"domains")) {
442 strictError(path +
".domains",
"the domain '" + domain.name +
"' does not exist");
445 if (analysis.init && !isDefinedIn(analysis.init->name,
"parameter_points")) {
446 warning(path,
"the parameter point '" + analysis.init->name +
"' used as \"init\" of analysis '" +
447 analysis.name +
"' does not exist.");
449 if (analysis.prior && !isDefinedIn(analysis.prior->name,
"distributions") && !isExternal(analysis.prior->name)) {
450 strictError(path +
".prior",
"the distribution '" + analysis.prior->name +
"' does not exist");
455std::size_t Validator::checkAxis(BinnedAxis
const &axis, std::string
const &path)
457 if (
auto const *regular = std::get_if<RegularBinning>(&axis.binning)) {
458 if (regular->nbins <= 0) {
459 error(path,
"the axis '" + axis.name +
"' needs a positive number of bins");
462 if (!(axis.min < axis.max)) {
463 error(path,
"the axis '" + axis.name +
"' needs \"min\" smaller than \"max\"");
465 return regular->nbins;
467 auto const &edges = std::get<EdgesBinning>(axis.binning).edges;
468 return edges.empty() ? 0 : edges.size() - 1;
471std::size_t Validator::checkAxis(CategoricalAxis
const &axis, std::string
const &path)
473 if (axis.categories.empty()) {
474 error(path,
"the axis '" + axis.name +
"' needs at least one category");
476 return axis.categories.size();
480std::optional<std::size_t> Validator::numBins(Axes
const &axes, std::string
const &path)
482 std::size_t nBins = 1;
484 for (std::size_t i = 0; i < axes.size(); ++i) {
485 const std::size_t
n = checkAxis(axes[i], path +
".axes[" + std::to_string(i) +
"]");
488 }
else if (nBins > std::numeric_limits<std::size_t>::max() /
n) {
489 error(path +
".axes",
"the axes have more bins than can be stored");
494 return valid ? std::optional<std::size_t>{nBins} : std::nullopt;
497void Validator::checkData()
499 for (std::size_t i = 0; i <
_doc.data.size(); ++i) {
501 auto const *
binned = std::get_if<BinnedData>(&
data.body);
505 const std::string path = at(
"data", i,
data.name);
506 std::optional<std::size_t> nBinsOrNone = numBins(
binned->axes, path);
510 const std::size_t nBins = *nBinsOrNone;
511 if (
binned->contents.size() != nBins) {
512 error(path,
"inconsistent bin numbers: contents=" + std::to_string(
binned->contents.size()) +
513 ", bins=" + std::to_string(nBins));
515 if (
binned->uncertainty) {
518 error(path,
"inconsistent number of errors and contents in '" +
data.name +
519 "': errors=" + std::to_string(
sigma.size()) +
520 ", contents=" + std::to_string(
binned->contents.size()));
522 auto const &correlation =
binned->uncertainty->correlation;
523 if (!correlation.empty()) {
524 bool square = correlation.size() ==
binned->contents.size();
525 for (
auto const &row : correlation) {
526 square = square && row.size() ==
binned->contents.size();
529 error(path +
".uncertainty.correlation",
"must be a square matrix of the size of \"contents\"");
536void Validator::checkHistFactory(HistFactoryDist
const &dist, std::string
const &
name, std::string
const &path)
538 if (
dist.axes.empty()) {
539 error(path +
".axes",
"a HistFactory distribution needs at least one axis");
542 std::optional<std::size_t> nBinsOrNone = numBins(
dist.axes, path);
546 const std::size_t nBins = *nBinsOrNone;
553 auto checkSize = [&](std::string
const &where, std::size_t
size,
char const *
what) {
555 error(where, std::string(
what) +
" has " + std::to_string(
size) +
" entries, but the channel has " +
556 std::to_string(nBins) +
" bins");
561 std::map<std::string, std::pair<Constraint, std::string>> constraintOfParameter;
562 auto checkCorrelated = [&](std::string
const &where, std::string
const ¶meter,
Constraint const &constraint) {
563 auto inserted = constraintOfParameter.emplace(parameter, std::make_pair(constraint, where));
564 if (inserted.second) {
567 if (!(inserted.first->second.first == constraint)) {
568 warning(where,
"the parameter '" + parameter +
"' has a different constraint than in " +
569 inserted.first->second.second +
570 ", but modifiers with the same parameter must share the constraint");
574 auto checkConstraint = [&](std::string
const &where,
Constraint const &constraint) {
575 if (
auto const *pdf = std::get_if<ConstraintPdf>(&constraint)) {
576 requireDistribution(pdf->pdf.name, where,
"constraint");
581 auto checkGammaConstraint = [&](std::string
const &where,
GammaConstraint const &constraint) {
582 auto const *pdfs = std::get_if<GammaConstraintPdfs>(&constraint);
586 checkSize(where +
".constraints", pdfs->pdfs.size(),
"\"constraints\"");
587 for (
auto const &pdf : pdfs->pdfs) {
589 requireDistribution(pdf->name, where +
".constraints",
"constraint");
594 auto checkParameter = [&](std::string
const &where, std::string
const ¶meter, std::string
const &
modifier) {
595 if (
char const *section = sectionOf(parameter)) {
596 error(where,
"the parameter '" + parameter +
"' of the modifier '" +
modifier +
"' is defined in \"" +
597 section +
"\", but it must be a parameter");
601 checkGammaConstraint(path +
".staterror",
dist.statError.constraint);
605 GammaConstraintPdfs
const *statErrorConstraints =
nullptr;
606 auto checkStatErrorConstraints = [&](std::string
const &where,
GammaConstraint const &constraint) {
607 auto const *pdfs = std::get_if<GammaConstraintPdfs>(&constraint);
611 if (!statErrorConstraints) {
612 statErrorConstraints = pdfs;
615 auto const &first = statErrorConstraints->pdfs;
616 const bool same = std::equal(first.begin(), first.end(), pdfs->pdfs.begin(), pdfs->pdfs.end(),
617 [](
auto const &
l,
auto const &
r) { return l && r ? l->name == r->name : !l && !r; });
620 "the staterror modifiers of the samples of channel '" +
channelName +
"' name different constraints");
624 std::set<std::string> sampleNames;
625 for (std::size_t iSample = 0; iSample <
dist.samples.size(); ++iSample) {
626 auto const &sample =
dist.samples[iSample];
627 const std::string samplePath = path +
".samples[" + std::to_string(iSample) +
"](" + sample.name +
")";
628 if (!sampleNames.insert(sample.name).second) {
629 error(samplePath,
"the name of the sample is not unique in the channel");
631 checkSize(samplePath +
".data.contents", sample.contents.size(),
"\"contents\"");
633 std::set<std::string> objectNames;
634 auto checkUniqueName = [&](std::string
const &where,
char const *
type, std::string
const &modifierName) {
635 if (!objectNames.insert(std::string(
type) +
" " + modifierName).second) {
637 std::string(
"there is another ") +
type +
" modifier named '" + modifierName +
"' in the sample");
640 if (sample.errors && sample.errors->size() != sample.contents.size()) {
641 error(samplePath +
".data",
"inconsistent number of errors and contents in '" + sample.name +
642 "': errors=" + std::to_string(sample.errors->size()) +
643 ", contents=" + std::to_string(sample.contents.size()));
645 for (std::size_t iModifier = 0; iModifier < sample.modifiers.size(); ++iModifier) {
646 std::string modifierPath = samplePath +
".modifiers[" + std::to_string(iModifier) +
"]";
647 auto checkInterpolation = [&](std::optional<Interpolation>
const &interpolation,
char const *
type,
648 std::string
const &modifierName) {
649 if (!interpolation && !
dist.defaultInterpolation) {
650 error(modifierPath, std::string(
"interpolation for ") +
type +
" modifier '" + modifierName +
651 "' in sample '" + sample.name +
"' of channel '" +
channelName +
652 "' is not given, and the channel has no \"default_interpolation\"");
655 std::visit(overloaded{
656 [&](NormFactor
const &
m) {
657 modifierPath +=
"(" +
m.name +
")";
658 checkParameter(modifierPath,
m.parameter.name,
m.name);
659 checkConstraint(modifierPath,
m.constraint);
660 checkCorrelated(modifierPath,
m.parameter.name,
m.constraint);
662 [&](NormSys
const &
m) {
663 modifierPath +=
"(" +
m.name +
")";
664 checkParameter(modifierPath,
m.parameter.name,
m.name);
665 checkConstraint(modifierPath,
m.constraint);
666 checkCorrelated(modifierPath,
m.parameter.name,
m.constraint);
667 checkInterpolation(
m.interpolation,
"normsys",
m.name);
669 [&](HistoSys
const &
m) {
670 modifierPath +=
"(" +
m.name +
")";
671 checkUniqueName(modifierPath,
"histosys",
m.name);
672 checkParameter(modifierPath,
m.parameter.name,
m.name);
673 checkConstraint(modifierPath,
m.constraint);
674 checkCorrelated(modifierPath,
m.parameter.name,
m.constraint);
675 checkInterpolation(
m.interpolation,
"histosys",
m.name);
676 checkSize(modifierPath +
".data.hi.contents",
m.hi.contents.size(),
"\"contents\"");
677 checkSize(modifierPath +
".data.lo.contents",
m.lo.contents.size(),
"\"contents\"");
679 [&](ShapeSys
const &
m) {
680 modifierPath +=
"(" +
m.name +
")";
681 checkUniqueName(modifierPath,
"shapesys",
m.name);
682 if (!
m.vals.empty()) {
683 checkSize(modifierPath +
".data.vals",
m.vals.size(),
"\"vals\"");
685 if (!
m.parameters.empty()) {
686 checkSize(modifierPath +
".parameters",
m.parameters.size(),
"\"parameters\"");
688 for (
auto const &
p :
m.parameters) {
689 checkParameter(modifierPath,
p.name,
m.name);
691 checkGammaConstraint(modifierPath,
m.constraint);
693 [&](StatError
const &
m) {
694 modifierPath +=
"(" +
m.name +
")";
695 if (!
m.parameters.empty()) {
696 checkSize(modifierPath +
".parameters",
m.parameters.size(),
"\"parameters\"");
698 checkGammaConstraint(modifierPath,
m.constraint);
699 checkStatErrorConstraints(modifierPath,
m.constraint);
701 [&](CustomModifier
const &
m) {
702 modifierPath +=
"(" +
m.name +
")";
703 if (!isDefinedIn(
m.name,
"functions") && !isDefinedIn(
m.name,
"distributions") &&
704 !isExternal(
m.name)) {
705 error(modifierPath,
"unable to find custom modifier '" +
m.name +
"'");
709 sample.modifiers[iModifier]);
718 Validator{doc, diagnostics, options}.run();
735 options.
isExternal = [](std::string
const &) {
return true; };
736 Validator{empty, diagnostics, options}.checkHistFactory(dist,
name,
"");
ValidateOptions const & _options
Diagnostics & _diagnostics
std::map< std::string, std::vector< char const * > > _sections
The sections where a name is defined.
std::set< std::string > _parameters
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 char Point_t Rectangle_t WindowAttributes_t index
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 modifier
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
An HS3 document. It is move-only, because generic objects refer to the JSON tree that the document wa...
A document that passed validate().
double dist(Rotation3D const &r1, Rotation3D const &r2)
Types that represent an HS3 document.
void validateHistFactoryDist(HistFactoryDist const &dist, std::string const &name, Diagnostics &diagnostics)
Same as validate(), but for a single HistFactory distribution that doesn't come with a document.
void checkDocument(HS3Document const &doc, Diagnostics &diagnostics, ValidateOptions const &options={})
The checks of validate(), for a document that is still needed if it doesn't pass them.
std::optional< ValidatedHS3Document > validate(HS3Document doc, Diagnostics &diagnostics, ValidateOptions const &options)
Checks what can be checked without knowing how the objects are built: unique names,...
bool hasErrors(Diagnostics const &diagnostics)
Whether there is a diagnostic with error severity.
std::vector< Diagnostic > Diagnostics
std::variant< Unconstrained, ConstraintType, ConstantGammas, GammaConstraintPdfs > GammaConstraint
std::variant< Unconstrained, ConstraintType, ConstraintPdf > Constraint
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
std::function< bool(std::string const &) isExternal)
Whether a name that is not defined in the document is known in some other way, e.g....