[RF][HS3] Identical factors and likelihoods that combine several documents (HS3 #161) #24250
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #24250"
general
weight: 0.35
guitargeek
This PR implements the ROOT side of HS3 PR #161 ("Define identity and composition of factors"), which is merged. It builds on #24201.
HS3 #161 defines when two factors are the same and how distributions compose:
combined_distand anarray_distuse union composition: they stand for a set of factors, in which identical factors are contained once, however many times and under whatever names they occur.combined_dist, which may contain combined distributions itself, and listed as one term.The main use case is the combination of models from several documents, e.g. two HistFactory models written by RooFit that share a systematic or the luminosity. The constraint terms of each document are collected in its own array distribution, so the arrays of both documents contain identical components for the shared parameters, which have to count once.
Identical components of array distributions
RooAbsPdf::getAllConstraints()finds it once. A component that is not identical is an error.One flat RooSimultaneous and one data set per likelihood
A ModelConfig has one pdf. Without the name of that pdf in RooFit's metadata (
misc.ROOT_internal), the importer took the pdf namedsimPdfif there was one. That silently dropped the other terms of the likelihood.Now the model of a likelihood becomes one RooSimultaneous
<analysis>_simPdf:""in a column that doesn't apply to it (HS3 #161 allows relabelling).<analysis>_categoryIndex, labelled with the names of the terms, is added if a term is not a combined distribution, or if the channels can't be told apart by their labels. Several columns are a RooSuperCategory.exportConstraintData, see #24201) would each be evaluated on their data. Array channels of one component type, each with one data entry, are therefore merged into one array with the union of their components, and their entries into one entry. Differing observed values of a shared variate are an error.<analysis>_datawith these columns. Combined data sets may now have combined data sets as components.Changes to code that came with #24201
constraintsof HistFactory modifiers descend into nested combined distributions, and a nested combined distribution is not wrapped with constraints like other channels that are no products.Tests
ArrayDistIdenticalComponents: a model and two arrays overx1…x4andx3…x6, as components of one combined distribution, give the likelihood of the model and one array overx1…x6; RooFit merges the two array channels. The round trip is stable after the first export. The two arrays as auxiliary distributions of the likelihood are rejected (two terms with shared variates), as are a component with another width and identical components with different observed values.MergedHistFactoryDocumentsWithArrayConstraints: two documents written by RooFit withexportConstraintData, with a shared systematic and luminosity, joined in a combined distribution whose components are their combined distributions. Both documents use the same column in one variant and each their own column in the other. The flattened model has one array per type, and its likelihood matches that of a single HistFactory model of both channels. The export has one likelihood with one combined distribution, and the round trip is stable after the first export. The two models as two terms of a likelihood are rejected, as is a combination in which the luminosity uncertainties differ.LikelihoodOfCombinedAndPlainTerms: a combined and a plain distribution in one likelihood.Open question
Without RooFit's metadata, constraint terms that are written as data (
exportConstraintData) are channels of the RooSimultaneous rather than external constraints. How RooFit should treat global observables and external constraints in the future is asked in #24251.🤖 Generated with Claude Code