33from optparse
import OptionParser
34from reconstruction
import add_cosmics_reconstruction
35home = os.environ[
'BELLE2_LOCAL_DIR']
39parser = OptionParser()
44 default=
'/ghi/fs01/belle2/bdata/users/tkonno/cosmic/cosmic.0002.00951.HLT3.f00000.root')
45parser.add_option(
'-o',
'--output', dest=
'output', default=
'')
46parser.add_option(
'-d',
'--debug', dest=
'debug', default=0)
47parser.add_option(
'-t',
'--tracking', dest=
'tracking', default=0)
48parser.add_option(
'-a',
'--arichtrk', dest=
'arichtrk', default=0)
49parser.add_option(
'-g',
'--gdl', dest=
'gdl', default=0)
50(options, args) = parser.parse_args()
59main = b2.create_path()
60store = b2.create_path()
63input_module = b2.register_module(
'SeqRootInput')
64input_module.param(
'inputFileName', options.filename)
66main.add_module(input_module)
69histo = b2.register_module(
'HistoManager')
70histo.param(
'histoFileName',
"DQMhistograms.root")
74if int(options.tracking):
75 main.add_module(
'Gearbox')
76 geometry = b2.register_module(
'Geometry')
77 geometry.param(
'useDB', 1)
78 main.add_module(geometry)
81unPacker = b2.register_module(
'ARICHUnpacker')
82unPacker.param(
'debug', int(options.debug))
83main.add_module(unPacker)
86arichHits = b2.register_module(
'ARICHFillHits')
88arichHits.param(
"bitMask", 0xFF)
89main.add_module(arichHits)
91if int(options.tracking):
92 cdcunpacker = b2.register_module(
'CDCUnpacker')
93 cdcunpacker.param(
'xmlMapFileName',
"data/cdc/ch_map.dat")
94 cdcunpacker.param(
'enablePrintOut',
False)
95 main.add_module(cdcunpacker)
96 add_cosmics_reconstruction(main,
'CDC',
False)
99 main.add_module(
'TRGGDLUnpacker')
100 main.add_module(
'TRGGDLSummary')
103arichHists = b2.register_module(
'ARICHDQM')
104main.add_module(arichHists)
107if(options.output !=
''):
108 output = b2.register_module(
'RootOutput')
109 output.param(
'outputFileName', options.output)
110 branches = [
'ARICHDigits',
'ARICHHits',
'ARICHInfo']
111 if int(options.tracking):
112 branches.extend([
'Tracks',
'TrackFitResults',
'RecoTracks',
'RecoHitInformations',
'ExtHits'])
114 branches.append(
'TRGSummary')
115 output.param(
'branchNames', branches)
116 if int(options.arichtrk):
117 store.add_module(output)
119 main.add_module(output)
122main.add_module(
'Progress')
124if int(options.arichtrk):
125 arichHists.if_value(
'==1', store)