-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_simulation.py
More file actions
33 lines (23 loc) · 802 Bytes
/
test_simulation.py
File metadata and controls
33 lines (23 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import numpy as np
from geometry import *
from simulation import *
geometry = Geometry(
surfaces=[0,50,100,150,200,250,300],
surface_radius=100,
thickness_in_x0=1/kSiRadiationLength,
b_field = 2*kTesla
)
simulation = Simulation(geometry, smearing_stddev=1, simulate_radiation_loss=True)
geometry.draw_surfaces()
start_pars = np.array([
0, # loc0
0.5*np.pi, # phi
-1 / (2*kGeV) # qop
])
measurements, truth = simulation.simulate(start_pars, kElectronMass)
print("Measurements", measurements)
for pars, surface_id in zip(truth, range(1, len(truth)+1)):
geometry.draw_circle(pars, surface_id)
geometry.draw_local_params(pars, surface_id)
geometry.ax.scatter(geometry.surfaces[1:len(measurements)+1], measurements, color='black', marker="x", s=100)
plt.show()