1. Using Linear Least Squares Fit in
Station to Station Alignment
Chris Heidt
3/11/2016
2. Method
● Collect approved events
● Remove single station from event in detector
– Perform LLSF to determine expected value
● Write translation matrix to transform measured value
into expected value
● Solve translation matrix using LLSF
● Remove next event in detector and repeat
● After each station has had a turn move each station
using a defined step size and solved translation
matrices.
3. Collect Approved Events
● Select PR track with 5 triplet seeds
● If more than one track in detector event try and
remove bad tracks (tracks < 3 triplets)
● If only one track and that track meets the triplet
cut it passes acceptance.
4. Determine Expected Values
● Remove single station from PR track
● Use space points in other 4 stations to perform
LLSF
● Trace line to removed station[]
S = ∑
i=1
4
[xi−(m zi + b)]
2 dS
db
= 0 =
dS
db [∑i=1
4
[xi−(m zi+ b)]2
]
∑i=1
4
[( xi
zi xi
)]= ∑i=1
4
[(zi 1
zi
2
zi
)](m
b)
dS
dm
= 0 =
dS
dm [∑
i=1
4
[xi−(m zi+ b)]
2
]
5. Write Translation Matrix
● Has form:
● Where if the rotation is RxRyRz the coefficients are
(
a11 a12 a13 xT
a21 a22 a23 yT
a31 a32 a33 yT
0 0 0 1
)(
xMi
yMi
zMi
1
)=
(
xEi
yEi
zEi
1
)
a11 = cosθ cosϕ a12 = cosθ sin ϕ a13 = −sinθ
a21 = sin ψ sinθ cosϕ − cos ψ sin ϕ a22 = sin ψ sinθ sinϕ + cosψ sin ϕ
a23 = cosθ sin ψ
a31 = cos ψ sin θ cosϕ + sin ψ sinϕ a32 = cos ψ sinθ sin ϕ − sin ψ cosϕ
a33 = cosθ cos ψ
6. Write Translation Matrix
● These are hard to solve!
– Taylor expand the trig functions keep only up to
second order – ish
– Looking at the second row
● Much easier!
a21 = ψ θ − ϕ
a22 = ϕ + ψ θ ϕ
a23 = ψ
7. Solve Translation Matrix
● Three equations need to be solved
– Only look at the row two equation for pitch yaw and
roll. Also gives translation in y
– Other two equations are needed for translation
values in x/z
● Same form as before but longer
S1 = ∑
i=1
n
[xEi − (a11 xMi + a12 yMi + a13 zMi + xT )]
2
S2 = ∑
i=1
n
[ yEi − (a21 xMi + a22 yMi + a23 zMi + yT )]
2
S3 = ∑
i=1
n
[zEi − (a31 xMi + a32 yMi + a33 zMi + zT )]
2
9. Solve Translation Matrix
● The coefficients for the first matrix look like
● Numpy!
b1 = ∑
i = 1
n
xMi
2
b2 = ∑
i = 1
n
xMi yMi
b3 = ∑
i = 1
n
xMi zMi
b4 = ∑
i = 1
n
xMi
b5 = ∑
i = 1
n
yMi
2
b6 = ∑
i = 1
n
yMi zMi
b7 = ∑
i = 1
n
yMi
b8 = ∑
i = 1
n
zMi
2
b9 = ∑
i = 1
n
xMi
b10 = ∑
i = 1
n
1
e1 = ∑
i = 1
n
xMi xEi
e2 = ∑
i = 1
n
yMi xEi
e3 = ∑
i = 1
n
zMi xEi
e4 = ∑
i = 1
n
xEi
10. Rinse and Repeat and Rinse and
Repeat and Rinse...
● The previous method will give you
the amount you need to adjust a
single station to come into line with
4 other stations
– Align all the stations!
● Pick a new station and do this
analysis again
● Pick a new station and do this
analysis again
● …...
● Pick a new detector and pick a
new station and do this again
● Pick a new station and do this
again
11. Move the Stations
● After each station has been through the rinse
– Define a step size, say 25%
– Move each station 25% of value misalignment
– Calculate new Chi^2, have things improved?
– Maybe a dynamic-ish step size (50%, 25%, 10%) and
test each step for improved Chi^2
● Seems kind of redundant at this point, but it might be
resource intensive.
● Go back and do everything all over again!
– Probably both a Chi^2 requirement and a number of
iterations requirement, which ever is first.