Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
1d1f7ba2
Commit
1d1f7ba2
authored
Oct 25, 2017
by
Daniel Hynds
Browse files
add debug output for alignment of dut
parent
3e3366da
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/algorithms/Alignment.cpp
View file @
1d1f7ba2
...
...
@@ -123,15 +123,22 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result,
// Apply new alignment conditions
globalDetector
->
update
();
LOG
(
DEBUG
)
<<
"Updated parameters for "
<<
detectorToAlign
;
// The chi2 value to be returned
result
=
0.
;
LOG
(
DEBUG
)
<<
"Looping over "
<<
globalTracks
.
size
()
<<
" tracks"
;
// Loop over all tracks
for
(
auto
&
track
:
globalTracks
)
{
// Get all clusters on the track
Clusters
associatedClusters
=
track
->
associatedClusters
();
LOG
(
DEBUG
)
<<
"- track has chi2 "
<<
track
->
chi2
();
LOG
(
DEBUG
)
<<
"- track has gradient x "
<<
track
->
m_direction
.
X
();
LOG
(
DEBUG
)
<<
"- track has gradient y "
<<
track
->
m_direction
.
Y
();
// Find the cluster that needs to have its position recalculated
for
(
auto
&
associatedCluster
:
associatedClusters
)
{
string
detectorID
=
associatedCluster
->
detectorID
();
...
...
@@ -147,8 +154,13 @@ void Alignment::MinimiseResiduals(Int_t& npar, Double_t* grad, Double_t& result,
double
residualX
=
intercept
.
X
()
-
positionGlobal
.
X
();
double
residualY
=
intercept
.
Y
()
-
positionGlobal
.
Y
();
double
error
=
associatedCluster
->
error
();
LOG
(
DEBUG
)
<<
"- track has intercept ("
<<
intercept
.
X
()
<<
","
<<
intercept
.
Y
()
<<
")"
;
LOG
(
DEBUG
)
<<
"- cluster has position ("
<<
positionGlobal
.
X
()
<<
","
<<
positionGlobal
.
Y
()
<<
")"
;
double
deltachi2
=
((
residualX
*
residualX
+
residualY
*
residualY
)
/
(
error
*
error
));
LOG
(
DEBUG
)
<<
"- delta chi2 = "
<<
deltachi2
;
// Add the new residual2
result
+=
((
residualX
*
residualX
+
residualY
*
residualY
)
/
(
error
*
error
));
result
+=
deltachi2
;
LOG
(
DEBUG
)
<<
"- result is now "
<<
result
;
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment