Belle II Software  release-08-01-10
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 
19 import basf2 as b2
20 
21 import sys
22 
23 argvs = sys.argv # get arg
24 argc = len(argvs) # of arg
25 
26 if argc != 2:
27  sys.exit("ReadEclTrgUnpacker.py> # of arg is strange.\n 1.rootname\n Exit.")
28 
29 if argc == 2:
30  f_in_root = argvs[1]
31 
32 b2.set_log_level(b2.LogLevel.ERROR)
33 # set_log_level(LogLevel.INFO)
34 
35 # input
36 input = b2.register_module('SeqRootInput')
37 # unpacker
38 unpacker = b2.register_module('TRGECLUnpacker')
39 # output
40 output = b2.register_module('RootOutput')
41 # unpacker
42 trgeclrawana = b2.register_module('TRGECLRawdataAnalysis')
43 
44 # Create main path
45 main = b2.create_path()
46 
47 # Add modules to main path
48 main.add_module(input)
49 main.add_module(unpacker)
50 main.add_module(trgeclrawana)
51 
52 input.param("inputFileName", f_in_root)
53 output.param("outputFileName", "TRGECLRawdataAnalysis_Cluster.root")
54 
55 # main.add_module(output);
56 main.add_module(output, branchNames=["TRGECLUnpackerStores", "TRGECLClusters", "TRGECLTimings"])
57 
58 # Process all events
59 b2.process(main)
60 #
61 #
62 print(b2.statistics)
63 #