Repository navigation
Description
Feature description
HS3 #129 (merged) adds a histfactory function to the standard, next to the existing histfactory_dist:
- It has the same components as
histfactory_dist(axes,default_interpolation,sampleswithdataandmodifiers). Only thetypediffers. - It evaluates the HistFactory prediction, i.e. the expected bin yields
$\lambda_i(\theta)$ .histfactory_distis now defined as$\prod_i \mathrm{Pois}(n_i \mid \lambda_i(\theta))$ on top of that prediction. - The constraint terms belong to the prediction: a likelihood that contains a
histfactory_dist, or a distribution that depends on ahistfactoryfunction, includes the constraint terms of all its modifiers, in addition toaux_likelihood.
RooFit currently supports only histfactory_dist. A document containing a histfactory function fails to import with "no handling for type 'histfactory' implemented". For histfactory_dist, RooFit already conforms to #129: it puts the modifier constraint terms into the RooProdPdf of the channel.
Supporting the function would roughly require:
- an importer for
histfactory, sharing the sample/modifier code of thehistfactory_distimporter, that produces aRooRealSumFuncof the samples; - an exporter that recognizes HistFactory-structured
RooRealSumFuncs and writes them ashistfactory; - adding the constraint terms of every
histfactoryfunction that a likelihood depends on when building theModelConfig, and not repeating them inaux_distributionson export; - possibly an opt-in setting to export existing
RooProdPdf/RooRealSumPdfHistFactory channels as ahistfactoryfunction plus a wrapper distribution.
This is deferred until two open questions are settled: what the function returns at a point x, discussed in HS3 #143, and the bin width discussion in #23301.
The spec defines the function per bin (bincounts_density_dist, rate_density_dist) integrate their input over
- If the function returns bin yields, using it in a likelihood requires an explicit bin-volume factor
$1/\lvert B_i\rvert$ in the serialized model. How bin volumes are represented is open on both sides:- in HS3,
binvolume/inverse_binvolumeare proposed in #121, which is blocked by [RF] Introduce a first-classRooBinIndexfor reusable bin-index computation #23301; - in RooFit, the representation of
RooBinWidthFunctionis under discussion in [RF] Make RooBinWidthFunction depend directly on observables #23298 and [RF] Introduce a first-classRooBinIndexfor reusable bin-index computation #23301.
- in HS3,
- If the function returns yields per unit bin volume,
bincounts_density_distwith the function asdensityis equivalent tohistfactory_dist, and no bin-volume object appears in the serialized model. Bin widths then only matter inside RooFit's importer and exporter.
histfactory_dist never ran into this: it is evaluated at the count vector, never at a point x.
HS3 #143 proposes to make this explicit with a field on the function, yield_per: "bin" | "volume", and asks the community for input. The outcome determines the RooFit implementation:
- the bin-width division inside the samples, which today is part of the
RooRealSumPdfbuilt forhistfactory_dist; - the wrapper distribution used by the opt-in export setting;
- whether RooFit needs a serialized bin-volume function at all.
Alternatives considered
- Writing
$1/\lvert B_i\rvert$ as a standardgenericfunction (piecewise constant viaifelse), plus a marker inmisc.ROOT_internalso that RooFit maps it back toRooBinWidthFunction. - Writing
$1/\lvert B_i\rvert$ as a second, modifier-freehistfactoryfunction whose contents are the inverse bin volumes. - Fixing one reading without a field: either the yield per unit bin volume, so that
bincounts_density_distcan consume the function directly; or the bin yield, together with a new HS3 distribution that consumes per-bin expected counts directly (a bin-space counterpart ofbincounts_density_dist).
The first two are conformant workarounds that serialize the bin-volume conversion explicitly. The last requires a spec change and is one of the options under discussion in HS3 #143. None of them seemed worth committing to before HS3 #143 and the bin width discussion have concluded.
Additional context
- HS3: #143 (what the
histfactoryfunction returns at a point; proposalyield_per), #129 (adds thehistfactoryfunction), #141 (clarifies yields vs. intensity), #121 (bin-volume primitives), #124 (modifier constraints) - ROOT: [RF] Make RooBinWidthFunction depend directly on observables #23298 (
RooBinWidthFunctiondepending on observables), [RF] Introduce a first-classRooBinIndexfor reusable bin-index computation #23301 (RooBinIndex), [RF][HS3] HS3 v0.3 conformance: follow HS3 #135 and #124 #23840 (HS3 conformance fixes, which explicitly leave out thehistfactoryfunction)
Activity