Belle II Software development
TrgEcl.py
1#!/usr/bin/env python
2
3
10
11# -------------------------------------------------------------------------------------------------------
12# TSim-ecl example code.
13# -------------------------------------------------------------------------------------------------------
14# In order to test Tsim-ecl code, you need a root file which has ECLHit table.(after Gsim)
15# ex)
16# commend > basf2 TrgEcl.py [Name of Gsim root file] [Name of output root file]
17# -------------------------------------------------------------------------------------------------------
18
19import basf2 as b2
20from L1trigger import add_trigger_simulation
21
22import sys # get argv
23argvs = sys.argv # get arg
24argc = len(argvs) # of arg
25if argc != 3:
26 sys.exit("ztsim02.py> # of arg is strange. Exit.")
27if argc == 3:
28 f_in_root = argvs[1]
29 f_out_root = argvs[2]
30# print
31# print 'f_in_root = %s' % f_in_root
32# print 'f_out_root = %s\n' % f_out_root
33
34
35
36b2.set_log_level(b2.LogLevel.ERROR)
37# set_log_level(LogLevel.INFO)
38# set_log_level(LogLevel.DEBUG)
39# use_local_database('./trg_ecl/database.txt')
40
41gearbox = b2.register_module('Gearbox')
42
43# input
44rootinput1 = b2.register_module('RootInput')
45rootinput1.param('inputFileName', f_in_root)
46
47
48# output
49rootoutput = b2.register_module('RootOutput')
50rootoutput.param('outputFileName', f_out_root)
51
52# import random
53progress = b2.register_module('Progress')
54
55
56# Create paths
57main = b2.create_path()
58
59main.add_module(rootinput1)
60
61main.add_module(progress)
62main.add_module(gearbox)
63
64add_trigger_simulation(main, component=["ECL"])
65
66
67main.add_module(rootoutput, branchNames=["TRGECLTrgs", "TRGECLHits", "TRGECLClusters"])
68
69
70# main
71b2.process(main)
72
75print(b2.statistics)
76# ===<END>