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