21from optparse
import OptionParser
22from reconstruction
import add_cosmics_reconstruction
23home = os.environ[
'BELLE2_LOCAL_DIR']
25parser = OptionParser()
30 default=
'hsm/belle2/bdata/Data/Raw/e0007/r01640/sub00/cosmic.0007.01640.HLT1.f00000.root')
31parser.add_option(
'-o',
'--output', dest=
'output', default=
'trggrl_unpacker.root')
32parser.add_option(
'-t',
'--tracking', dest=
'tracking', default=0)
33parser.add_option(
'-g',
'--gdl', dest=
'gdl', default=0)
34(options, args) = parser.parse_args()
36runID = str(options.run)
38b2.set_log_level(b2.LogLevel.ERROR)
40main = b2.create_path()
43input = b2.register_module(
'RootInput')
44input.param(
'inputFileName', options.filename)
48histo = b2.register_module(
'HistoManager')
49histo.param(
'histoFileName',
"dqm.root")
52unpacker = b2.register_module(
'TRGGRLUnpacker')
53main.add_module(unpacker)
55trggrldqm = b2.register_module(
'TRGGRLDQM')
56main.add_module(trggrldqm)
59if int(options.tracking):
60 cdcunpacker = b2.register_module(
'CDCUnpacker')
61 cdcunpacker.param(
'xmlMapFileName',
"cdc/data/ch_map.dat")
62 cdcunpacker.param(
'enablePrintOut',
False)
63 main.add_module(cdcunpacker)
64 add_cosmics_reconstruction(main,
'CDC',
False)
68 trggdlUnpacker = b2.register_module(
"TRGGDLUnpacker")
69 main.add_module(trggdlUnpacker)
70 trggdlsummary = b2.register_module(
'TRGGDLSummary')
71 main.add_module(trggdlsummary)
73output = b2.register_module(
'RootOutput')
74output.param(
"outputFileName", options.output)
75main.add_module(output, branchNames=[
"TRGGRLUnpackerStore"])