Add example minimum bias and luminosity lines
This adds a few lines towards #78 (closed).
Minimum bias
- A NoBias line, which passes all events in which the ODIN
NoBias
bit is set - A 'VELO closing' line, which passes all events in which the ODIN
NoBias
bit is set and there are at least five reconstructed VELO tracks
For now, the rate of these can be controlled with the usual per-line prescales. We might want to add some sort of 'conditions-based rate scaler' that automatically determines an output rate based on the known NoBias rate and some value we set in the conditions, but that can wait.
Luminosity
- A luminosity line, which creates an
HltLumiSummary
object from the sizes of the VELO tracks and PVs containers (see Phys!618 (merged) for the new algorithms).
Based on !260 (merged) so targets that branch; will switch to targeting master once that's merged.
Requires Rec!1765 (merged) and Phys!618 (merged).
ODIN bits in MC
A slight aside, but the filter on the NoBias
ODIN bit filters out all Upgrade MC events. This is because the bit is never set in MC. @rmatev has an 'ODIN emulator' algorithm that we're working on getting production-ready, that will allow us to effectively 'simulate' the NoBias bit being set.
Tonic changes
When implementing a test of the lines with the ODINEmulator, I figured that the cleanest way for me to implement it was to address #28 (closed), so this is also added here. This allows for function body substitution of @configurable
functions.
@configurable
def echo(arg=123):
return arg
def replacement():
return 456
with echo.substitute(replacement):
print(echo())
print(echo())
This prints 456
and then 123
.
I also fixed a TODO that caused algorithms which only differed by the return values of their input transforms not to be de-duplicated (cc @nnolte).