31outputFile =
'comparePDF.root'
36if direction ==
'incoming':
41alpha = (slot - 0.5) * 360 / 16 - 90
42ca = math.cos(math.radians(alpha))
43sa = math.sin(math.radians(alpha))
44x = xloc * ca - (yloc + 120) * sa
45y = xloc * sa + (yloc + 120) * ca
50b2.set_log_level(b2.LogLevel.WARNING)
53main = b2.create_path()
56eventinfosetter = b2.register_module(
'EventInfoSetter')
57eventinfosetter.param(
'evtNumList', [1000])
58main.add_module(eventinfosetter)
61histo = b2.register_module(
'HistoManager')
62histo.param(
'histoFileName', outputFile)
66gearbox = b2.register_module(
'Gearbox')
67main.add_module(gearbox)
70geometry = b2.register_module(
'Geometry')
71geometry.param(
'useDB',
False)
72geometry.param(
'components', [
'MagneticField',
'TOP'])
73main.add_module(geometry)
76particlegun = b2.register_module(
'ParticleGun')
77particlegun.param(
'pdgCodes', [pdg])
78particlegun.param(
'nTracks', 1)
79particlegun.param(
'varyNTracks',
False)
80particlegun.param(
'momentumGeneration',
'fixed')
81particlegun.param(
'momentumParams', [p])
82particlegun.param(
'thetaGeneration',
'fixed')
83particlegun.param(
'thetaParams', [theta])
84particlegun.param(
'phiGeneration',
'fixed')
85particlegun.param(
'phiParams', [phi])
86particlegun.param(
'vertexGeneration',
'fixed')
87particlegun.param(
'xVertexParams', [x])
88particlegun.param(
'yVertexParams', [y])
89particlegun.param(
'zVertexParams', [z])
90particlegun.param(
'independentVertices',
False)
91main.add_module(particlegun)
94simulation = b2.register_module(
'FullSim')
95main.add_module(simulation)
98topdigi = b2.register_module(
'TOPDigitizer')
99topdigi.param(
'useWaveforms',
False)
100topdigi.param(
'simulateTTS',
False)
101topdigi.param(
'electronicJitter', 0.0)
102topdigi.param(
'timeZeroJitter', 0.0)
103main.add_module(topdigi)
106trackmaker = b2.register_module(
'TOPMCTrackMaker')
107main.add_module(trackmaker)
110toppdf = b2.register_module(
'TOPPDFChecker')
111main.add_module(toppdf)
114progress = b2.register_module(
'Progress')
115main.add_module(progress)