14 from optparse
import OptionParser
15 from simulation
import add_simulation
16 from reconstruction
import add_mc_reconstruction
20 parser = OptionParser()
21 parser.add_option(
'-n',
'--nevents', dest=
'nevents', default=10000,
22 help=
'Number of events to process')
23 parser.add_option(
'-f',
'--file', dest=
'filename',
24 default=
'../ARICHEvents.root')
25 parser.add_option(
'-d',
'--debug', dest=
'debugLevel', default=10)
26 (options, args) = parser.parse_args()
27 nevents = int(options.nevents)
28 filename = options.filename
29 debugLevel = int(options.debugLevel)
32 set_log_level(LogLevel.INFO)
38 eventinfosetter = register_module(
'EventInfoSetter')
39 eventinfosetter.param({
'evtNumList': [nevents]})
40 main.add_module(eventinfosetter)
43 particlegun = register_module(
'ParticleGun')
45 set_random_seed(123456)
47 particlegun.param(
'pdgCodes', [-211, 211, 321, -321])
49 particlegun.param(
'nTracks', 1)
52 particlegun.param(
'momentumGeneration',
'uniform')
53 particlegun.param(
'momentumParams', [3.0, 3.5])
56 particlegun.param(
'thetaGeneration',
'uniformCos')
57 particlegun.param(
'thetaParams', [17.0, 35.0])
58 particlegun.param(
'vertexGeneration',
'fixed')
59 particlegun.param(
'xVertexParams', [0.0, 0.0])
60 particlegun.param(
'yVertexParams', [0.0, 0.0])
61 particlegun.param(
'zVertexParams', [0.0, 0.0])
62 particlegun.param(
'independentVertices',
False)
64 print_params(particlegun)
65 main.add_module(particlegun)
73 add_mc_reconstruction(main)
76 arichEfficiency = register_module(
'ARICHNtuple')
77 arichEfficiency.logging.log_level = LogLevel.DEBUG
78 arichEfficiency.logging.debug_level = debugLevel
79 arichEfficiency.param(
'outputFile', filename)
80 main.add_module(arichEfficiency)
83 progress = register_module(
'Progress')
84 main.add_module(progress)