Belle II Software development
TrgEclRawdataAnalysis.py
1#!/usr/bin/env python
2
3
10
11# -----------------------------------------------------------------------------------
12#
13# Example of ECL trigger
14#
15# usage : %> basf2 TrgEclRawdataAnalysis.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 != 2:
27 sys.exit("ReadEclTrgUnpacker.py> # of arg is strange.\n 1.rootname\n Exit.")
28
29if argc == 2:
30 f_in_root = argvs[1]
31
32b2.set_log_level(b2.LogLevel.ERROR)
33# set_log_level(LogLevel.INFO)
34
35# input
36input = b2.register_module('SeqRootInput')
37# unpacker
38unpacker = b2.register_module('TRGECLUnpacker')
39# output
40output = b2.register_module('RootOutput')
41# unpacker
42trgeclrawana = b2.register_module('TRGECLRawdataAnalysis')
43
44# Create main path
45main = b2.create_path()
46
47# Add modules to main path
48main.add_module(input)
49main.add_module(unpacker)
50main.add_module(trgeclrawana)
51
52input.param("inputFileName", f_in_root)
53output.param("outputFileName", "TRGECLRawdataAnalysis_Cluster.root")
54
55# main.add_module(output);
56main.add_module(output, branchNames=["TRGECLUnpackerStores", "TRGECLClusters", "TRGECLTimings"])
57
58# Process all events
59b2.process(main)
60#
61#
62print(b2.statistics)
63#