diff --git a/MooreOnlineConf/options/beamspot.py b/MooreOnlineConf/options/beamspot.py index 14b1a5c13728fffa7ff08301eed559ad90618c6b..c68f168539f66d76b61194c5d36a591c68fcfd41 100644 --- a/MooreOnlineConf/options/beamspot.py +++ b/MooreOnlineConf/options/beamspot.py @@ -15,8 +15,9 @@ from RecoConf.standalone import reco_prefilters from RecoConf.legacy_rec_hlt1_tracking import (make_all_pvs, make_reco_pvs, make_PatPV3DFuture_pvs, make_VeloClusterTrackingSIMD) -from MooreOnlineConf.utils import update_and_reset, is_testbench -from DDDB.CheckDD4Hep import UseDD4Hep +from MooreOnlineConf.utils import (update_and_reset, is_testbench, passes_rb, + if_then, and_, run_all, RoutingBit, + common_monitors_node) from PyConf.Algorithms import BeamSpotMonitor from PyConf.application import make_odin from GaudiKernel.SystemOfUnits import mm, mm2 @@ -85,23 +86,30 @@ def run_hlt1_pvs_with_beamspotmoni(): def with_update_and_reset(): reco = run_hlt1_pvs_with_beamspotmoni() + rb_filt = passes_rb(RoutingBit.PHYSICS) - if options.input_type.lower() == 'online': - from PyConf.Algorithms import LHCb__IOVReset as IOVReset, OdinTypesFilter, HltRoutingBitsFilter - from PyConf.application import make_odin, default_raw_banks - odin_bb_filter = OdinTypesFilter( + # Default configuration for running offline + top_node = reco.node + ev_filters = [rb_filt] + + if options.input_type.lower() == 'online': # Online config + from PyConf.Algorithms import (LHCb__IOVReset as IOVReset, + OdinTypesFilter) + from PyConf.application import make_odin + + odin_bx_filt = OdinTypesFilter( ODIN=make_odin(), BXTypes=['BeamCrossing']) + top_node = run_all("top", [ + common_monitors_node(), + if_then("IfBXRb", and_("BXRb", [odin_bx_filt, rb_filt]), + reco.node), + ]) + ev_filters = [ + IOVReset(ODIN=make_odin()), + ] - rb_filter = HltRoutingBitsFilter( - RawBanks=default_raw_banks('HltRoutingBits'), - RequireMask=(1 << 14, 0, 0), # Phys events - PassOnError=False) - return Reconstruction( - "with_update_and_reset", - [IOVReset(ODIN=make_odin()), - update_and_reset(), reco.node], - filters=[odin_bb_filter, rb_filter]) - return reco + return Reconstruction( + "with_update_and_reset", [top_node], filters=ev_filters) # NOTE the switch to retina clusters is done in vp_retina_clusters.py @@ -110,8 +118,3 @@ with make_VeloClusterTrackingSIMD.bind(SkipForward=4),\ make_PatPV3DFuture_pvs.bind(velo_open=True, use_3D_seeding=True, use_beam_spot_cut=False),\ make_reco_pvs.bind(make_pvs_from_velo_tracks=make_PatPV3DFuture_pvs): run_reconstruction(options, with_update_and_reset) - -if UseDD4Hep: - from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc - dd4hep_svc = LHCb__Det__LbDD4hep__DD4hepSvc() - dd4hep_svc.DetectorList = ['/world', 'VP']