34 from optparse
import OptionParser
35 from reconstruction
import add_cosmics_reconstruction
36 home = os.environ[
'BELLE2_LOCAL_DIR']
40 parser = OptionParser()
45 default=
'/ghi/fs01/belle2/bdata/users/tkonno/cosmic/cosmic.0002.00951.HLT3.f00000.root')
46 parser.add_option(
'-o',
'--output', dest=
'output', default=
'')
47 parser.add_option(
'-d',
'--debug', dest=
'debug', default=0)
48 parser.add_option(
'-t',
'--tracking', dest=
'tracking', default=0)
49 parser.add_option(
'-a',
'--arichtrk', dest=
'arichtrk', default=0)
50 parser.add_option(
'-g',
'--gdl', dest=
'gdl', default=0)
51 (options, args) = parser.parse_args()
60 main = b2.create_path()
61 store = b2.create_path()
64 input_module = b2.register_module(
'SeqRootInput')
65 input_module.param(
'inputFileName', options.filename)
67 main.add_module(input_module)
70 histo = b2.register_module(
'HistoManager')
71 histo.param(
'histoFileName',
"DQMhistograms.root")
72 main.add_module(histo)
75 if int(options.tracking):
76 gearbox = b2.register_module(
'Gearbox')
77 main.add_module(gearbox)
78 geometry = b2.register_module(
'Geometry')
79 geometry.param(
'useDB', 1)
80 main.add_module(geometry)
83 unPacker = b2.register_module(
'ARICHUnpacker')
84 unPacker.param(
'debug', int(options.debug))
85 main.add_module(unPacker)
88 arichHits = b2.register_module(
'ARICHFillHits')
90 arichHits.param(
"bitMask", 0xFF)
91 main.add_module(arichHits)
93 if int(options.tracking):
94 cdcunpacker = b2.register_module(
'CDCUnpacker')
95 cdcunpacker.param(
'xmlMapFileName',
"data/cdc/ch_map.dat")
96 cdcunpacker.param(
'enablePrintOut',
False)
97 main.add_module(cdcunpacker)
98 add_cosmics_reconstruction(main,
'CDC',
False)
101 trggdlUnpacker = b2.register_module(
"TRGGDLUnpacker")
102 main.add_module(trggdlUnpacker)
103 trggdlsummary = b2.register_module(
'TRGGDLSummary')
104 main.add_module(trggdlsummary)
107 arichHists = b2.register_module(
'ARICHDQM')
108 main.add_module(arichHists)
111 if(options.output !=
''):
112 output = b2.register_module(
'RootOutput')
113 output.param(
'outputFileName', options.output)
114 branches = [
'ARICHDigits',
'ARICHHits',
'ARICHInfo']
115 if int(options.tracking):
116 branches.extend([
'Tracks',
'TrackFitResults',
'RecoTracks',
'RecoHitInformations',
'ExtHits'])
118 branches.append(
'TRGSummary')
119 output.param(
'branchNames', branches)
120 if int(options.arichtrk):
121 store.add_module(output)
123 main.add_module(output)
126 progress = b2.register_module(
'Progress')
127 main.add_module(progress)
129 if int(options.arichtrk):
130 arichHists.if_value(
'==1', store)