Belle II Software development
trggdlDST.py
1#!/usr/bin/env python3
2
3
10
11# -----------------------------------------------------------------------------------
12#
13# GDL trigger DST Module
14#
15# usage : %> basf2 trggdlDST.py [input sroot file name]
16#
17# -----------------------------------------------------------------------------------
18
19import basf2 as b2
20
21import sys # get argv
22argvs = sys.argv # get arg
23argc = len(argvs) # of arg
24if argc != 2:
25 sys.exit("trggdlDST.py> # of arg is strange. Exit.")
26if argc == 2:
27 f_in_root = argvs[1]
28
29
30b2.set_log_level(b2.LogLevel.INFO)
31
32main = b2.create_path()
33
34# input
35if f_in_root[-6:] == ".sroot":
36 rootfiletype = "sroot"
37 input = b2.register_module('SeqRootInput')
38if f_in_root[-5:] == ".root":
39 rootfiletype = "root"
40 input = b2.register_module('RootInput')
41
42input.param('inputFileName', f_in_root)
43main.add_module(input)
44
45# Unpacker
46trggdlUnpacker = b2.register_module("TRGGDLUnpacker")
47main.add_module(trggdlUnpacker)
48
49# Fill DST
50trggdldst = b2.register_module('TRGGDLDST')
51main.add_module(trggdldst)
52
53output = b2.register_module('RootOutput')
54output.param("outputFileName", "gdldst.root")
55main.add_module(output, branchNames=["TRGGDLDST"])
56
57progress = b2.register_module('Progress')
58main.add_module(progress)
59
60b2.process(main)
61
62print(b2.statistics)