Belle II Software  release-08-01-10
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 
15 import basf2
16 
17 from rawdata import add_raw_seqoutput
18 from softwaretrigger import constants
19 from 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
25 components = constants.DEFAULT_HLT_COMPONENTS
26 
27 main_path = basf2.create_path()
28 
29 main_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
33 main_path.add_module("HistoManager")
34 
35 add_hlt_processing(main_path, store_array_debug_prescale=1, components=components)
36 
37 add_raw_seqoutput(main_path, additionalObjects=["SoftwareTriggerResults", "SoftwareTriggerVariables", "ROIs"])
38 
39 basf2.print_path(main_path)
40 basf2.process(main_path)
41 
42 print(basf2.statistics)