13 from optparse
import OptionParser
16 parser = OptionParser()
17 parser.add_option(
'-n',
'--nevents', dest=
'nevents', default=100,
18 help=
'Number of events to process')
19 parser.add_option(
'-f',
'--file', dest=
'filename', default=
'ARICHDQM.root')
20 parser.add_option(
'-d',
'--debug', dest=
'debugLevel', default=10)
21 parser.add_option(
'-s',
'--seed', dest=
'seed', default=111111)
22 (options, args) = parser.parse_args()
24 nevents = int(options.nevents)
25 debugLevel = int(options.debugLevel)
26 seed = int(options.seed)
28 b2.set_log_level(b2.LogLevel.INFO)
30 home = os.environ[
'BELLE2_LOCAL_DIR']
32 b2.use_local_database(home +
"/arich/database/cosmicTest_payloads/cosmicTest_database.txt",
33 home +
"/arich/database/cosmicTest_payloads")
36 main = b2.create_path()
39 main.add_module(
'EventInfoSetter', evtNumList=nevents, logLevel=b2.LogLevel.DEBUG)
42 histo = b2.register_module(
'HistoManager')
43 histo.param(
'histoFileName', options.filename)
44 main.add_module(histo)
48 gearbox = b2.register_module(
'Gearbox')
49 main.add_module(gearbox)
52 geometry = b2.register_module(
'Geometry')
53 geometry.param(
'components', [
'ARICH'])
55 geometry.param(
'useDB', 1)
56 main.add_module(geometry)
59 particlegun = b2.register_module(
'ParticleGun')
61 b2.set_random_seed(seed)
63 particlegun.param(
'pdgCodes', [11])
65 particlegun.param(
'nTracks', 1)
70 particlegun.param(
'momentumGeneration',
'fixed')
71 particlegun.param(
'momentumParams', [5.0])
73 particlegun.param(
'thetaGeneration',
'fixed')
74 particlegun.param(
'thetaParams', [95.])
75 particlegun.param(
'phiGeneration',
'fixed')
76 particlegun.param(
'phiParams', [270])
79 particlegun.param(
'vertexGeneration',
'fixed')
81 particlegun.param(
'xVertexParams', [-43.88])
82 particlegun.param(
'yVertexParams', [10.0])
83 particlegun.param(
'zVertexParams', [-40.0])
85 b2.print_params(particlegun)
86 main.add_module(particlegun)
91 simulation = b2.register_module(
'FullSim')
92 simulation.param(
'StoreOpticalPhotons',
True)
95 simulation.param(
'PhotonFraction', 0.45)
96 main.add_module(simulation)
99 arichDIGI = b2.register_module(
'ARICHDigitizer')
100 arichDIGI.param(
'BackgroundHits', 0)
101 main.add_module(arichDIGI)
104 arichHits = b2.register_module(
'ARICHFillHits')
105 main.add_module(arichHits)
108 arichDQM = b2.register_module(
'ARICHDQM')
109 main.add_module(arichDQM)
126 progress = b2.register_module(
'Progress')
127 main.add_module(progress)
136 com =
'root -l ' + options.filename +
' ' + home +
'/arich/utility/scripts/plotDQM.C'