Skip to content
Snippets Groups Projects
Commit 120866f5 authored by Jonas Rembser's avatar Jonas Rembser
Browse files

[RF] Remove entry masking feature from RooDataHist

This commit removes some functions from the RooFit data classes:

  * `RooAbsData::valid()` (virtual method that was overridden in
     RooDataHist but not RooDataSet)

  * `RooDataHist::valid(std::size_t i)` and `RooDataHist::valid()`

  * `RooDataHist::cacheValidEntries()`

The `cacheValidEntries` method was originally intended to be used in
`RooAbsOptTestStatistic` to mask histogram entries out of the variable
range in case of a subrange fit. The reasons why `cacheValidEntries` and
the related `valid()` methods should be removed are:

  1. It is redundant. In a subrange fit, the `RooAbsOptTestStatistic` is
     creating a clone of the dataset with the subrange only using
     `RooAbsData::reduce()`. So all entries are valid by definition.

  2. RooDataHist and RooDataSet have inconistent implementations. For
     the RooDataHist, `valid()` tells you "if bin `i` is considered
     valid within the current range definitions of all observables"
     (according to the documentation). For the RooDataSet, it always
     returns `true`. This inconsistency leaves plenty of room for error,
     and means that a subrange selection relying on
     `RooAbsData::vaild()` would be broken anyway because it wouldn't
     work with RooDataSet.

  3. The masking of out-of-range entries unnessecarily increases the
     `mutable` state of the RooDataHist, which can cause trouble if one
     updates the observable range but then forgets to call
     `cacheValidEntries()`.

  4. Even the documentation said that `RooDataHist::cacheValidEntries()`
     was a "shortcut function only for RooAbsOptTestStatistic". Why keep
     it if `RooAbsOptTestStatistic` doesn't even use it in a meaningful
     way anymore?
parent 30d9e625
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment