12from optparse
import OptionParser
15parser = OptionParser()
16parser.add_option(
'-n',
'--nevents', dest=
'nevents', default=100,
17 help=
'Number of events to process')
18parser.add_option(
'-f',
'--file', dest=
'filename', default=
'ARICHDQM.root')
19parser.add_option(
'-d',
'--debug', dest=
'debugLevel', default=10)
20parser.add_option(
'-s',
'--seed', dest=
'seed', default=111111)
21(options, args) = parser.parse_args()
23nevents = int(options.nevents)
24debugLevel = int(options.debugLevel)
25seed = int(options.seed)
27b2.set_log_level(b2.LogLevel.INFO)
29home = os.environ[
'BELLE2_LOCAL_DIR']
31b2.conditions.append_testing_payloads(home +
"/arich/database/cosmicTest_payloads/cosmicTest_database.txt")
34main = b2.create_path()
37main.add_module(
'EventInfoSetter', evtNumList=nevents, logLevel=b2.LogLevel.DEBUG)
40histo = b2.register_module(
'HistoManager')
41histo.param(
'histoFileName', options.filename)
46main.add_module(
'Gearbox')
49geometry = b2.register_module(
'Geometry')
50geometry.param(
'components', [
'ARICH'])
52geometry.param(
'useDB', 1)
53main.add_module(geometry)
56particlegun = b2.register_module(
'ParticleGun')
58b2.set_random_seed(seed)
60particlegun.param(
'pdgCodes', [11])
62particlegun.param(
'nTracks', 1)
67particlegun.param(
'momentumGeneration',
'fixed')
68particlegun.param(
'momentumParams', [5.0])
70particlegun.param(
'thetaGeneration',
'fixed')
71particlegun.param(
'thetaParams', [95.])
72particlegun.param(
'phiGeneration',
'fixed')
73particlegun.param(
'phiParams', [270])
76particlegun.param(
'vertexGeneration',
'fixed')
78particlegun.param(
'xVertexParams', [-43.88])
79particlegun.param(
'yVertexParams', [10.0])
80particlegun.param(
'zVertexParams', [-40.0])
82b2.print_params(particlegun)
83main.add_module(particlegun)
88simulation = b2.register_module(
'FullSim')
89simulation.param(
'StoreOpticalPhotons',
True)
92simulation.param(
'PhotonFraction', 0.45)
93main.add_module(simulation)
96arichDIGI = b2.register_module(
'ARICHDigitizer')
97arichDIGI.param(
'BackgroundHits', 0)
98main.add_module(arichDIGI)
101main.add_module(
'ARICHFillHits')
104main.add_module(
'ARICHDQM')
121main.add_module(
'Progress')
130com =
'root -l ' + options.filename +
' ' + home +
'/arich/utility/scripts/plotDQM.C'