26 from optparse
import OptionParser
27 home = os.environ[
'BELLE2_LOCAL_DIR']
30 parser = OptionParser()
31 parser.add_option(
'-f',
'--file', dest=
'filename', default=
'ARICHHits.root')
32 parser.add_option(
'-s',
'--display', dest=
'display', default=0)
33 parser.add_option(
'-a',
'--arichtrk', dest=
'arichtrk', default=0)
34 parser.add_option(
'-r',
'--recon', dest=
'recon', default=1)
35 parser.add_option(
'-o',
'--output', dest=
'output', default=
'arich_recon_ntuple.root')
36 (options, args) = parser.parse_args()
39 main = b2.create_path()
40 displ = b2.create_path()
43 input_module = b2.register_module(
'RootInput')
44 input_module.param(
'inputFileName', options.filename)
45 main.add_module(input_module)
48 histo = b2.register_module(
'HistoManager')
49 histo.param(
'histoFileName',
"histograms.root")
50 main.add_module(histo)
53 if int(options.display):
54 main.add_module(
'Gearbox')
55 geometry = b2.register_module(
'Geometry')
56 geometry.param(
'components', [
'ARICH',
'MagneticField'])
57 main.add_module(geometry)
59 if int(options.recon):
60 arichHits = b2.register_module(
'ARICHFillHits')
61 arichHits.param(
'MagFieldCorrection', 1)
62 main.add_module(arichHits)
63 arichreco = b2.register_module(
'ARICHReconstructor')
64 arichreco.param(
'storePhotons', 1)
65 arichreco.param(
'useAlignment', 1)
66 main.add_module(arichreco)
67 arichNtuple = b2.register_module(
'ARICHNtuple')
68 arichNtuple.param(
'outputFile', options.output)
69 main.add_module(arichNtuple)
73 arichHists = b2.register_module(
'ARICHDQM')
74 arichHists.param(
'ArichEvents', bool(options.arichtrk))
76 arichHists.param(
'MaxHits', 100)
77 arichHists.param(
'MinHits', 0)
78 main.add_module(arichHists)
81 if int(options.display):
82 display = b2.register_module(
'Display')
84 display.param(
'showARICHHits',
True)
86 display.param(
'showRecoTracks',
True)
88 display.param(
'fullGeometry',
True)
89 displ.add_module(display)
93 main.add_module(
'Progress')
95 arichHists.if_value(
'==1', displ)
104 if not int(options.display):
105 com =
'root -l histograms.root ' + home +
'/arich/utility/scripts/plotDQM.C'