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