Belle II Software  release-08-01-10
TrgEclDQM.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # -----------------------------------------------------------------------------------
13 #
14 # Example of ECL trigger DQM Module
15 #
16 # usage : %> basf2 TrgEclDQM.py [input sroot file name]
17 #
18 # -----------------------------------------------------------------------------------
19 
20 import basf2 as b2
21 
22 import sys # get argv
23 argvs = sys.argv # get arg
24 argc = len(argvs) # of arg
25 if argc != 2:
26  sys.exit("ztsim02.py> # of arg is strange. Exit.")
27 if argc == 2:
28  f_in_root = argvs[1]
29 
30 
31 b2.set_log_level(b2.LogLevel.INFO)
32 
33 main = b2.create_path()
34 
35 # input
36 input = b2.register_module('RootInput')
37 input.param('inputFileName', f_in_root)
38 main.add_module(input)
39 
40 histo = b2.register_module('HistoManager')
41 histo.param("histoFileName", "./histo_output.root")
42 
43 # Unpacker
44 trgeclUnpacker = b2.register_module("TRGECLUnpacker")
45 main.add_module(trgeclUnpacker)
46 main.add_module(histo)
47 
48 # DQM
49 trgecldqm = b2.register_module('TRGECLDQM')
50 main.add_module(trgecldqm)
51 
52 progress = b2.register_module('Progress')
53 main.add_module(progress)
54 
55 b2.process(main)
56 
57 print(b2.statistics)