Belle II Software development
EclDQM.py
1#!/usr/bin/env python3
2
3
10
11"""This steering file creates ECL DQM histograms from
12 input SeqRoot file
13
14The user should provide input and output file names and
15control 'ECLDQM' module parameters.
16
17Usage:
18 $ basf2 -i <path_to_input_files> -o <path_to_output_files>
19 EclDQM.py
20"""
21
22import basf2 as b2
23
24
25# Create path. Register necessary modules to this path.
26mainPath = b2.create_path()
27
28b2.set_log_level(b2.LogLevel.ERROR)
29
30# Register and add 'SeqRootInput' module
31seqRootInput = b2.register_module('SeqRootInput')
32mainPath.add_module(seqRootInput)
33
34# Register and add 'ECLUnpacker' module
35eclUnpacker = b2.register_module('ECLUnpacker')
36eclUnpacker.param('storeTrigTime', True)
37mainPath.add_module(eclUnpacker)
38
39# Register and add 'ECLDigitCalibrator' module
40eclDigitCalibrator = b2.register_module('ECLDigitCalibrator')
41mainPath.add_module(eclDigitCalibrator)
42
43# Register and add 'HistoManager' module
44histoManager = b2.register_module('HistoManager')
45mainPath.add_module(histoManager)
46
47# Register and add 'TriggerSkim' module and settings
48triggerSkim = b2.register_module('TriggerSkim')
49triggerSkim.param('triggerLines',
50 ['software_trigger_cut&all&total_result'])
51triggerSkim.if_value('==0', b2.Path(), b2.AfterConditionPath.END)
52mainPath.add_module(triggerSkim)
53
54# Register and add 'ECLDQM' module and settings
55eclDQM = b2.register_module('ECLDQM')
56eclDQM.param('histogramDirectoryName', 'ECL')
57eclDQM.param('EnergyUpperThr', 1.5)
58eclDQM.param('PedestalMeanUpperThr', 7000)
59eclDQM.param('PedestalMeanLowerThr', -1000)
60eclDQM.param('PedestalRmsUpperThr', 100.)
61mainPath.add_module(eclDQM)
62
63# Process the events and print call statistics
64mainPath.add_module('Progress')
65b2.process(mainPath)
66print(b2.statistics)