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