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