Belle II Software development
run_hlt.py
1#!/usr/bin/env python3
2
3
10
11# Usage:
12# basf2 run_hlt.py -i inputfilename.sroot -o outputfilename.sroot
13# you can take the output file of rawdata_simulation.py as the input file
14
15import basf2
16
17from rawdata import add_raw_seqoutput
18from softwaretrigger import constants
19from softwaretrigger.processing import add_hlt_processing
20
21# You could use your own components here or just use the default for the HLT (everything except PXD)
22# e.g. without SVD
23# components = ["CDC", "ECL", "TOP", "ARICH", "KLM"]
24# if you leave out the components in all calls, the default will be used
25components = constants.DEFAULT_HLT_COMPONENTS
26
27main_path = basf2.create_path()
28
29main_path.add_module("SeqRootInput", inputFileName="hlt_rawdata_simulation.sroot")
30
31# adding the HistoManager is important because the add_hlt_processing call
32# adds DQM modules which will crash, if the HistoManager is not registered
33main_path.add_module("HistoManager")
34
35add_hlt_processing(main_path, store_array_debug_prescale=1, components=components)
36
37add_raw_seqoutput(main_path, additionalObjects=["SoftwareTriggerResults", "SoftwareTriggerVariables", "ROIs"])
38
39basf2.print_path(main_path)
40basf2.process(main_path)
41
42print(basf2.statistics)