Skip to content
Snippets Groups Projects
Commit 4b41783e authored by Rosen Matev's avatar Rosen Matev :sunny:
Browse files

Merge branch 'mstahl_monitoring' into 'master'

Fix default monitoring if last alg in control flow does not have producer

See merge request !2642

(cherry picked from commit 8761bf51)

4b23cb62 [monitoring] :bug: do not return empty monitoring algs if last alg in control...
372a9f0c [monitoring doc] update documentation of default monitoring
cc786f76 remove unused functions
parent 0683d6fc
No related branches found
No related tags found
1 merge request!2718Fix default monitoring if last alg in control flow does not have producer
Pipeline #6357783 failed
......@@ -73,25 +73,6 @@ def _hlt2_lumi_calibration_line(name='Hlt2LumiCalibration', prescale=1):
)
def _hlt2_no_bias_line(name="Hlt2NoBias", prescale=0.1):
return Hlt2Line(
name=name,
algs=[],
hlt1_filter_code="Hlt1ODINNoBiasDecision",
prescale=prescale)
def _hlt2_hlt1passthrough_line(name="Hlt2Hlt1PassThrough", prescale=0.01):
'''
Anything else than the nobias line
'''
return Hlt2Line(
name=name,
algs=[],
hlt1_filter_code=r"^Hlt1(?!ODINNoBias|ODINLumi|ODIN1kHzLumi).*Decision",
prescale=prescale)
def _MIP_MIN(cut, pvs=make_pvs):
return F.MINIPCUT(IPCut=cut, Vertices=pvs())
......
......@@ -37,14 +37,14 @@ def monitoring(algs, name, mon_vars):
"""
monitoring_algs = []
producer = None
try:
for alg in reversed(algs):
for alg in reversed(algs):
if hasattr(alg, "producer"):
if "BodyCombiner" in alg.producer.typename:
last_combiner = alg.producer
producer = alg.producer
producer_output = producer.OutputParticles
break
elif alg.producer.typename == "ParticleRangeFilter" or alg.producer.typename == "ChargedBasicsFilter":
if alg.producer.typename == "ParticleRangeFilter" or alg.producer.typename == "ChargedBasicsFilter":
# we only want to have this working if the filter sits on top of a combiner
filter_input = alg.producer.inputs["Input"].producer
last_combiner = filter_input if "BodyCombiner" in filter_input.typename else None
......@@ -52,7 +52,7 @@ def monitoring(algs, name, mon_vars):
producer_output = producer.Output
break
# try to resurrect the last combiner for parsing ranges in case the top alg is a merger
elif alg.producer.typename == "ParticleContainerMerger":
if alg.producer.typename == "ParticleContainerMerger":
for dalg in reversed(
alg.producer.__dict__["_inputs"]["InputContainers"]):
if "BodyCombiner" in dalg.producer.typename:
......@@ -61,8 +61,6 @@ def monitoring(algs, name, mon_vars):
producer = alg.producer
producer_output = producer.OutputContainer
break
except:
return monitoring_algs
if producer is None or last_combiner is None:
return monitoring_algs
......
......@@ -863,13 +863,15 @@ offline production, as proposed by the Early Measurements Task Force
The documentation here concerns the online-monitoring that **can** be configured in Moore.
If you choose to not configure any monitoring, a set of default monitors will run.
This means that every Hlt2 line will fill, currently 5 histograms by default
(|pT|, :math:`\eta`, mass, vertex :math:`\chi^2` and |chi2ip| w.r.t. the "best" PV).
This means that every Hlt2 line will fill, currently 6 histograms by default
(|pT|, :math:`\eta`, mass, vertex :math:`\chi^2`, |chi2ip| w.r.t. the "best" PV and the candidate multiplicity).
These default monitors can be configured individually for your line by passing a list
other than `("pt", "eta", "m", "vchi2", "ipchi2")` as `monitoring_variables` to your
other than `("pt", "eta", "m", "vchi2", "ipchi2", "n_candidates")` as `monitoring_variables` to your
``Hlt2Line`` instance.
Any new variables need to be defined in
`monitoring.py <https://gitlab.cern.ch/lhcb/Moore/-/blob/master/Hlt/Moore/python/Moore/monitoring.py>`_.
In that file, the variable names/aliases are those to which `mon_var.lower()` is compared to.
Currently, only the decay time (`dectime`) is available in addition to the 6 variables mentioned above.
For switching off the default monitors for a line entirely, simply pass an empty tuple:
(``Hlt2Line(name=..., algs=[...], monitoring_variables=(), ...)``).
Default monitoring can also be switched off globally with
......
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