-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.jl
49 lines (35 loc) · 884 Bytes
/
utils.jl
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function sensordims(s::SiliconSensor)
return s.xwidth, s.ywidth, s.thickness
end
function pixeldims(s::SiliconSensor)
return s.xpitch, s.ypitch
end
function sensor(s::PlacedSensor)
return s.sensor
end
function position(s::PlacedSensor)
return s.position
end
function sensors(t::Tracker)
return t.sensors
end
position0(t::ParticleTrack) = t.position0
direction(t::ParticleTrack) = t.direction
function (t::ParticleTrack)(τ::Real)
p = position0(t)
d = direction(t)
x = d.x * τ + p.x
y = d.y * τ + p.y
z = d.z * τ + p.z
return GlobalVector(x, y, z)
end
position0(t::ProjectedTrack) = t.position0
direction(t::ProjectedTrack) = t.direction
function (t::ProjectedTrack)(τ::Real)
p = position0(t)
d = direction(t)
u = d.u * τ + p.u
v = d.v * τ + p.v
w = d.w * τ + p.w
return LocalVector(u, v, w)
end