27 from optparse
import OptionParser
28 home = os.environ[
'BELLE2_LOCAL_DIR']
31 parser = OptionParser()
32 parser.add_option(
'-f',
'--file', dest=
'filename', default=
'ARICHHits.root')
33 parser.add_option(
'-s',
'--display', dest=
'display', default=0)
34 parser.add_option(
'-a',
'--arichtrk', dest=
'arichtrk', default=0)
35 parser.add_option(
'-r',
'--recon', dest=
'recon', default=1)
36 parser.add_option(
'-o',
'--output', dest=
'output', default=
'arich_recon_ntuple.root')
37 (options, args) = parser.parse_args()
40 main = b2.create_path()
41 displ = b2.create_path()
44 input_module = b2.register_module(
'RootInput')
45 input_module.param(
'inputFileName', options.filename)
46 main.add_module(input_module)
49 histo = b2.register_module(
'HistoManager')
50 histo.param(
'histoFileName',
"histograms.root")
51 main.add_module(histo)
54 if int(options.display):
55 gearbox = b2.register_module(
'Gearbox')
56 main.add_module(gearbox)
57 geometry = b2.register_module(
'Geometry')
58 geometry.param(
'components', [
'ARICH',
'MagneticField'])
59 main.add_module(geometry)
61 if int(options.recon):
62 arichHits = b2.register_module(
'ARICHFillHits')
63 arichHits.param(
'MagFieldCorrection', 1)
64 main.add_module(arichHits)
65 arichreco = b2.register_module(
'ARICHReconstructor')
66 arichreco.param(
'storePhotons', 1)
67 arichreco.param(
'useAlignment', 1)
68 main.add_module(arichreco)
69 arichNtuple = b2.register_module(
'ARICHNtuple')
70 arichNtuple.param(
'outputFile', options.output)
71 main.add_module(arichNtuple)
75 arichHists = b2.register_module(
'ARICHDQM')
76 arichHists.param(
'ArichEvents', bool(options.arichtrk))
78 arichHists.param(
'MaxHits', 100)
79 arichHists.param(
'MinHits', 0)
80 main.add_module(arichHists)
83 if int(options.display):
84 display = b2.register_module(
'Display')
86 display.param(
'showARICHHits',
True)
88 display.param(
'showRecoTracks',
True)
90 display.param(
'fullGeometry',
True)
91 displ.add_module(display)
95 progress = b2.register_module(
'Progress')
96 main.add_module(progress)
98 arichHists.if_value(
'==1', displ)
107 if not int(options.display):
108 com =
'root -l histograms.root ' + home +
'/arich/utility/scripts/plotDQM.C'