Belle II Software  release-05-01-25
TrgEclRawdataAnalysis.py
1 #!/usr/bin/env python
2 #
3 # -----------------------------------------------------------------------------------
4 #
5 # Example of ECL trigger
6 #
7 # usage : %> basf2 TrgEclRawdataAnalysis.py [input sroot file name]
8 #
9 # -----------------------------------------------------------------------------------
10 from basf2 import *
11 
12 import sys
13 
14 argvs = sys.argv # get arg
15 argc = len(argvs) # of arg
16 
17 if argc != 2:
18  sys.exit("ReadEclTrgUnpacker.py> # of arg is strange.\n 1.rootname\n Exit.")
19 
20 if argc == 2:
21  f_in_root = argvs[1]
22 
23 set_log_level(LogLevel.ERROR)
24 # set_log_level(LogLevel.INFO)
25 
26 # input
27 input = register_module('SeqRootInput')
28 # unpacker
29 unpacker = register_module('TRGECLUnpacker')
30 # output
31 output = register_module('RootOutput')
32 # unpacker
33 trgeclrawana = register_module('TRGECLRawdataAnalysis')
34 
35 # Create main path
36 main = create_path()
37 
38 # Add modules to main path
39 main.add_module(input)
40 main.add_module(unpacker)
41 main.add_module(trgeclrawana)
42 
43 input.param("inputFileName", f_in_root)
44 output.param("outputFileName", "TRGECLRawdataAnalysis_Cluster.root")
45 
46 # main.add_module(output);
47 main.add_module(output, branchNames=["TRGECLUnpackerStores", "TRGECLClusters", "TRGECLTimings"])
48 
49 # Process all events
50 process(main)
51 #
52 #
53 print(statistics)
54 #