Starterkit bandwidth example
The snippet can be accessed without any authentication.
Authored by
Andy Morris
This snippet stolen with only slight modification from @rjhunter - the original is here: https://gitlab.cern.ch/-/snippets/3269
hlt2_starterkit_example.py 3.07 KiB
###############################################################################
# (c) Copyright 2024 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. #
###############################################################################
"""Options for running a set of HLT2 lines -> mdf to calculate BW on high-mu HLT1-filtered real data.
Run like any other options file:
./run gaudirun.py hlt2_starterkit_example.py
file_size = ls -lh --si hlt2_starterkit_example.mdf
b/w (GB/s) = input rate (1193 kHz for this min bias) x file_size (MB) / options.evt_max
Note also that the output .mdf is written without compression, whereas in data-taking we
compress the HLT2 output separately in the data movers. You can do the same compression with e.g.:
zstd -3 <filepath>
and with this compressed output, you should get a representative file size for a bandwidth estimate.
"""
from Moore import options, run_moore
from DDDB.CheckDD4Hep import UseDD4Hep
# Current reconstruction configuration for 2024
from Hlt2Conf.settings.hlt2_binds import config_pp_2024
from RecoConf.global_tools import (
stateProvider_with_simplified_geom,
trackMasterExtrapolator_with_simplified_geom,
)
from RecoConf.reconstruction_objects import reconstruction
from Moore.streams import DETECTORS, Stream, Streams
from Hlt2Conf.lines.qee import all_lines
if UseDD4Hep:
raise RuntimeError("Sorry, you'll need a detdesc stack to run over this simulation. Please see https://lhcbdoc.web.cern.ch/lhcbdoc/moore/master/tutorials/running_over_mc.html#switching-to-a-detdesc-compatible-platform")
options.evt_max = 1000
options.set_input_and_conds_from_testfiledb('expected_2024_min_bias_hlt1_filtered_v2')
options.output_file = 'hlt2_starterkit_example_{stream}.mdf'
options.output_type = 'MDF'
def make_streams():
streams = [
Stream(
"dummystream",
lines=[builder() for name, builder in all_lines.items() if name == "Hlt2QEE_DiMuonNoIP_massRange3"], #Only the line we're interested in
routing_bit=85, # some dummy value != 94 or 95
# lines=[line_to_run()] # single line
detectors=[]) # Turbo and Full case - no detector raw banks
# detectors=DETECTORS) # if persisting detector raw banks i.e. special cases or TurCal lines
]
return Streams(streams=streams)
public_tools = [
trackMasterExtrapolator_with_simplified_geom(),
stateProvider_with_simplified_geom(),
]
with reconstruction.bind(from_file=False), config_pp_2024():
config = run_moore(options, make_streams, public_tools)
Please register or sign in to comment