Skip to content
Snippets Groups Projects

Monitoring task for detector correlations

Merged Titus Mombaecher requested to merge tm_correlmon into master
Files
6
+ 124
0
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
import os
from Moore import options
from RecoConf.config import Reconstruction, run_reconstruction
from RecoConf.standalone import reco_prefilters
from Hlt2Conf.settings.hlt2_binds import config_pp_2025
from MooreOnlineConf.utils import update_and_reset, if_then, run_all, common_monitors_node, passes_rb, RoutingBit
from RecoConf.legacy_rec_hlt1_tracking import make_VeloClusterTrackingSIMD_hits
from RecoConf.hlt2_tracking import (
make_PrStoreSciFiHits_hits,
make_PrStoreUTHit_hits,
)
from RecoConf.muonid import make_muon_hits
from RecoConf.rich_reconstruction import default_rich_reco_options, make_rich_pixels
from RecoConf.calorimeter_reconstruction import make_digits, make_clusters
from PyConf.Algorithms import LHCb__IOVReset as IOVReset, OdinTypesFilter, HltRoutingBitsFilter, MonitorDetectorCorrelations
from PyConf.application import make_odin
def corrmon_reco(suffix):
velohits = make_VeloClusterTrackingSIMD_hits()
scifihits = make_PrStoreSciFiHits_hits()
muonhits = make_muon_hits()
rich_pixels = make_rich_pixels(default_rich_reco_options())
uthits = make_PrStoreUTHit_hits()
digits = make_digits(calo_raw_bank=True)
ecalClusters = make_clusters(digits["digitsEcal"])
calo_objects = digits | {
"ecalClusters": ecalClusters,
}
data = [
MonitorDetectorCorrelations(
name="MonitorDetectorCorrelations_" + suffix,
allow_duplicate_instances_with_distinct_names=True,
VeloHits=velohits,
SciFiHits=scifihits,
UTHits=uthits,
MuonHits=muonhits,
ECALClusters=calo_objects["ecalClusters"],
ECALDigits=calo_objects["digitsEcal"],
HCALDigits=calo_objects["digitsHcal"],
RichPixels=rich_pixels["RichDecodedData"],
CollisionType="pp",
), # set pp for pp, PbPb for PbPb
MonitorDetectorCorrelations(
name="MonitorDetectorCorrelations_coarse_" + suffix,
allow_duplicate_instances_with_distinct_names=True,
VeloHits=velohits,
SciFiHits=scifihits,
UTHits=uthits,
MuonHits=muonhits,
ECALClusters=calo_objects["ecalClusters"],
ECALDigits=calo_objects["digitsEcal"],
HCALDigits=calo_objects["digitsHcal"],
RichPixels=rich_pixels["RichDecodedData"],
CollisionType="PbPb",
), # set pp for pp, PbPb for PbPb
]
return Reconstruction(
"corrmon_reco_" + suffix,
data,
)
task_type = os.getenv("TASK_TYPE", "GenericTask")
## Global event cut specifications:
# If a GEC is applied (as is set explicitly in the bind below)
# prefer to make explicit so it's clear which a GEC is applied
GEC_cut = 10_000
def with_update_and_reset():
if options.input_type.lower() == 'online':
odin_bb_filter = OdinTypesFilter(
ODIN=make_odin(), BXTypes=['BeamCrossing'])
odin_be_filter = OdinTypesFilter(
ODIN=make_odin(), BXTypes=[
'Beam1'
]) # only filter on SMOG collisions that fly into LHCb
top_node = run_all(
"top",
[
common_monitors_node(), # common monitoring to all tasks
if_then("IfBB", odin_bb_filter,
corrmon_reco(suffix="bb").node),
if_then("IfBE", odin_be_filter,
corrmon_reco(suffix="be").node),
])
return Reconstruction(
"with_update_and_reset", [top_node],
filters=[
IOVReset(ODIN=make_odin()),
update_and_reset(),
passes_rb(RoutingBit.LUMI)
])
return reco
# NOTE the switch to retina clusters is done in vp_retina_clusters.py
# the global event cut is added for the PbPb run case, in doubt remove for pp
with config_pp_2025(), reco_prefilters.bind(
gec=False,
gec_cut=1e11,
):
run_reconstruction(options, with_update_and_reset)
Loading