Belle II Software  release-08-01-10
TrgEclQAM.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 != 3:
26  sys.exit("ztsim02.py> # of arg is strange. Exit.")
27 if argc == 3:
28  f_in_root = argvs[1]
29  f_out_root = argvs[2]
30 
31 
32 b2.set_log_level(b2.LogLevel.INFO)
33 
34 main = b2.create_path()
35 
36 # input
37 input = b2.register_module('RootInput')
38 input.param('inputFileName', f_in_root)
39 main.add_module(input)
40 
41 
42 # Unpacker
43 trgeclUnpacker = b2.register_module("TRGECLUnpacker")
44 trggdlUnpacker = b2.register_module("TRGGDLUnpacker")
45 trggdlsummary = b2.register_module("TRGGDLSummary")
46 
47 main.add_module(trgeclUnpacker)
48 main.add_module(trggdlUnpacker)
49 main.add_module(trggdlsummary)
50 
51 
52 # QAM
53 trgeclqam = b2.register_module('TRGECLQAM')
54 trgeclqam.param('outputFileName', f_out_root)
55 main.add_module(trgeclqam)
56 
57 progress = b2.register_module('Progress')
58 main.add_module(progress)
59 
60 b2.process(main)
61 
62 print(b2.statistics)