SlideShare a Scribd company logo
1 of 11
Download to read offline
Using Linear Least Squares Fit in
Station to Station Alignment
Chris Heidt
3/11/2016
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.
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.
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
]
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 ψ
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 = ψ
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
Solve Translation Matrix
● The three matrices to be solved then:
(
e1
e2
e3
e4
)=
(
b1 b2 b3 b4
b2 b5 b6 b7
b3 b6 b8 b9
b4 b7 b9 b10
)(
a11
a12
a13
xT
) (
e5
e6
e7
e8
)=
(
c1 c2 c3 c4
c2 c5 c6 c7
c3 c6 c8 c9
c4 c7 c9 c10
)(
a21
a22
a23
yT
)
(
e9
e10
e11
e12
)=
(
d1 d2 d3 d4
d2 d5 d6 d7
d3 d6 d8 d9
d4 d7 d9 d10
)(
a31
a32
a33
zT
)
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
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
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.

More Related Content

What's hot

7 3 the sine and cosine functions
7 3 the sine and cosine functions7 3 the sine and cosine functions
7 3 the sine and cosine functions
hisema01
 
Jmet Ppt3 Higher Maths
Jmet   Ppt3   Higher MathsJmet   Ppt3   Higher Maths
Jmet Ppt3 Higher Maths
kapil1312
 
Advanced Complex Analysis
Advanced Complex AnalysisAdvanced Complex Analysis
Advanced Complex Analysis
ambareen50
 

What's hot (20)

Tsp branch and bound
Tsp branch and boundTsp branch and bound
Tsp branch and bound
 
Gradient
GradientGradient
Gradient
 
Traveling salesman problem
Traveling salesman problemTraveling salesman problem
Traveling salesman problem
 
Differential Calculus
Differential CalculusDifferential Calculus
Differential Calculus
 
Trigonometric functions
Trigonometric functionsTrigonometric functions
Trigonometric functions
 
7 3 the sine and cosine functions
7 3 the sine and cosine functions7 3 the sine and cosine functions
7 3 the sine and cosine functions
 
Trapezoidal rule
Trapezoidal ruleTrapezoidal rule
Trapezoidal rule
 
Black & White tiles problem
Black & White tiles problemBlack & White tiles problem
Black & White tiles problem
 
Lecture two
Lecture twoLecture two
Lecture two
 
Calculus 4.1-4.3
Calculus 4.1-4.3Calculus 4.1-4.3
Calculus 4.1-4.3
 
Graph of trigo diploma
Graph of trigo diplomaGraph of trigo diploma
Graph of trigo diploma
 
All pair shortest path
All pair shortest pathAll pair shortest path
All pair shortest path
 
Graphing lines using slopeintercept
Graphing lines using slopeinterceptGraphing lines using slopeintercept
Graphing lines using slopeintercept
 
6.2-3 Slope-Intercept and Standard forms
6.2-3 Slope-Intercept and Standard forms6.2-3 Slope-Intercept and Standard forms
6.2-3 Slope-Intercept and Standard forms
 
Graphing day 1 worked
Graphing day 1 workedGraphing day 1 worked
Graphing day 1 worked
 
4.5 tan and cot.ppt worked
4.5   tan and cot.ppt worked4.5   tan and cot.ppt worked
4.5 tan and cot.ppt worked
 
4.5 sec and csc worked 3rd
4.5   sec and csc worked 3rd4.5   sec and csc worked 3rd
4.5 sec and csc worked 3rd
 
Jmet Ppt3 Higher Maths
Jmet   Ppt3   Higher MathsJmet   Ppt3   Higher Maths
Jmet Ppt3 Higher Maths
 
Advanced Complex Analysis
Advanced Complex AnalysisAdvanced Complex Analysis
Advanced Complex Analysis
 
Polar area
Polar areaPolar area
Polar area
 

Viewers also liked

Power Family of Cobb County
Power Family of Cobb CountyPower Family of Cobb County
Power Family of Cobb County
Todd Frary, CP
 

Viewers also liked (13)

Chattowah Thumbnail
Chattowah ThumbnailChattowah Thumbnail
Chattowah Thumbnail
 
Barometrul "Business 2more Business" Brasov 2016
Barometrul "Business 2more Business" Brasov 2016Barometrul "Business 2more Business" Brasov 2016
Barometrul "Business 2more Business" Brasov 2016
 
Barometrul "Business 2more Business" Bucuresti 2016
Barometrul "Business 2more Business" Bucuresti 2016Barometrul "Business 2more Business" Bucuresti 2016
Barometrul "Business 2more Business" Bucuresti 2016
 
Chattowah Brief
Chattowah BriefChattowah Brief
Chattowah Brief
 
Previziuni de afaceri 2016
Previziuni de afaceri 2016Previziuni de afaceri 2016
Previziuni de afaceri 2016
 
Almacenamiento en la nuve
Almacenamiento en la nuveAlmacenamiento en la nuve
Almacenamiento en la nuve
 
Cowan Paper
Cowan PaperCowan Paper
Cowan Paper
 
Barometrul "Business 2more Business" Iasi 2016
Barometrul "Business 2more Business" Iasi 2016Barometrul "Business 2more Business" Iasi 2016
Barometrul "Business 2more Business" Iasi 2016
 
Tracker_MC_Noise_Summary
Tracker_MC_Noise_SummaryTracker_MC_Noise_Summary
Tracker_MC_Noise_Summary
 
Business outlook 2016
Business outlook 2016Business outlook 2016
Business outlook 2016
 
Power Family of Cobb County
Power Family of Cobb CountyPower Family of Cobb County
Power Family of Cobb County
 
Question 4 e finish
Question 4 e finishQuestion 4 e finish
Question 4 e finish
 
El barroco
El barroco El barroco
El barroco
 

Similar to LLSF_for_Imperial

Chapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptxChapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptx
MdSazolAhmmed
 
Chapter 3 linear equations
Chapter 3 linear equationsChapter 3 linear equations
Chapter 3 linear equations
Chandran Chan
 
Mathnasium Presentation (1)
Mathnasium Presentation (1)Mathnasium Presentation (1)
Mathnasium Presentation (1)
Muhammad Arslan
 

Similar to LLSF_for_Imperial (20)

Assignment model
Assignment modelAssignment model
Assignment model
 
February 16 2016
February 16 2016February 16 2016
February 16 2016
 
Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem Ap for b.tech. (mechanical) Assignment Problem
Ap for b.tech. (mechanical) Assignment Problem
 
Chapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/SlidesChapter 3: Linear Systems and Matrices - Part 2/Slides
Chapter 3: Linear Systems and Matrices - Part 2/Slides
 
TABREZ KHAN.ppt
TABREZ KHAN.pptTABREZ KHAN.ppt
TABREZ KHAN.ppt
 
Unit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptxUnit-1 Basic Concept of Algorithm.pptx
Unit-1 Basic Concept of Algorithm.pptx
 
Lecture 6 (factorizing quadratic functions)
Lecture 6 (factorizing  quadratic functions)Lecture 6 (factorizing  quadratic functions)
Lecture 6 (factorizing quadratic functions)
 
Division of Polynomials
Division of PolynomialsDivision of Polynomials
Division of Polynomials
 
Slopeinterceptform
SlopeinterceptformSlopeinterceptform
Slopeinterceptform
 
Module Four Lesson 2 Remediation Notes - Slope intercept form
Module Four Lesson 2 Remediation Notes - Slope intercept formModule Four Lesson 2 Remediation Notes - Slope intercept form
Module Four Lesson 2 Remediation Notes - Slope intercept form
 
Chapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptxChapter 12 Dynamic programming.pptx
Chapter 12 Dynamic programming.pptx
 
dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)dynamic programming complete by Mumtaz Ali (03154103173)
dynamic programming complete by Mumtaz Ali (03154103173)
 
Singlevaropt
SinglevaroptSinglevaropt
Singlevaropt
 
Line Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - NotesLine Drawing Algorithms - Computer Graphics - Notes
Line Drawing Algorithms - Computer Graphics - Notes
 
cgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdfcgrchapter2version-1-200729063505 (1).pdf
cgrchapter2version-1-200729063505 (1).pdf
 
18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.ppt18-21 Principles of Least Squares.ppt
18-21 Principles of Least Squares.ppt
 
Ch9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdfCh9-Gauss_Elimination4.pdf
Ch9-Gauss_Elimination4.pdf
 
Chapter 3 linear equations
Chapter 3 linear equationsChapter 3 linear equations
Chapter 3 linear equations
 
add math form 4/5
add math form 4/5add math form 4/5
add math form 4/5
 
Mathnasium Presentation (1)
Mathnasium Presentation (1)Mathnasium Presentation (1)
Mathnasium Presentation (1)
 

LLSF_for_Imperial

  • 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
  • 8. Solve Translation Matrix ● The three matrices to be solved then: ( e1 e2 e3 e4 )= ( b1 b2 b3 b4 b2 b5 b6 b7 b3 b6 b8 b9 b4 b7 b9 b10 )( a11 a12 a13 xT ) ( e5 e6 e7 e8 )= ( c1 c2 c3 c4 c2 c5 c6 c7 c3 c6 c8 c9 c4 c7 c9 c10 )( a21 a22 a23 yT ) ( e9 e10 e11 e12 )= ( d1 d2 d3 d4 d2 d5 d6 d7 d3 d6 d8 d9 d4 d7 d9 d10 )( a31 a32 a33 zT )
  • 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.