Belle II Software development
TrgEclUnpacker.py
1#!/usr/bin/env python
2
3
10
11# -----------------------------------------------------------------------------------
12#
13# ECL trigger Unpacker module
14#
15# usage : %> basf2 TrgEclUnpacker.py [input sroot file name]
16#
17# -----------------------------------------------------------------------------------
18
19import basf2 as b2
20
21import sys
22
23argvs = sys.argv # get arg
24argc = len(argvs) # of arg
25
26if argc == 3:
27 f_in_root = argvs[1]
28 f_out_root = argvs[2]
29
30if f_in_root[-6:] == ".sroot":
31 input = b2.register_module('SeqRootInput')
32if f_in_root[-5:] == ".root":
33 input = b2.register_module('RootInput')
34
35b2.set_log_level(b2.LogLevel.ERROR)
36# set_log_level(LogLevel.INFO)
37
38# input
39# unpacker
40unpacker = b2.register_module('TRGECLUnpacker')
41# output
42output = b2.register_module('RootOutput')
43
44# Create main path
45main = b2.create_path()
46
47# Add modules to main path
48main.add_module(input)
49main.add_module(unpacker)
50
51input.param("inputFileName", f_in_root)
52output.param("outputFileName", f_out_root)
53
54# main.add_module(output);
55main.add_module(
56 output,
57 branchNames=[
58 "TRGECLUnpackerStores",
59 "TRGECLUnpackerEvtStores",
60 "TRGECLUnpackerSumStores"])
61
62# Process all events
63b2.process(main)