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
5f71cfa4
Commit
5f71cfa4
authored
Nov 02, 2017
by
Simon Spannagel
Browse files
Merge branch 'master' of
ssh://gitlab.cern.ch:7999/simonspa/corryvreckan
parents
e204bf36
3f06aeca
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/algorithms/Alignment.cpp
View file @
5f71cfa4
...
...
@@ -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
;
}
}
}
...
...
@@ -301,8 +313,10 @@ void Alignment::finalise() {
for
(
auto
&
detector
:
get_detectors
())
{
string
detectorID
=
detector
->
name
();
// Do not align the reference plane
if
(
detectorID
==
m_config
.
get
<
std
::
string
>
(
"reference"
))
continue
;
if
(
detectorID
==
m_config
.
get
<
std
::
string
>
(
"reference"
)
||
detectorID
==
m_config
.
get
<
std
::
string
>
(
"DUT"
))
{
continue
;
}
// Get the alignment parameters
double
displacementX
=
residualFitter
->
GetParameter
(
det
*
6
+
0
);
...
...
src/algorithms/DUTAnalysis.cpp
View file @
5f71cfa4
...
...
@@ -51,8 +51,8 @@ StatusCode DUTAnalysis::run(Clipboard* clipboard) {
LOG
(
TRACE
)
<<
"Power on time: "
<<
m_powerOnTime
/
(
4096.
*
40000000.
);
LOG
(
TRACE
)
<<
"Power off time: "
<<
m_powerOffTime
/
(
4096.
*
40000000.
);
if
(
clipboard
->
get_persistent
(
"currentTime"
)
<
13.5
)
return
Success
;
//
if(clipboard->get_persistent("currentTime") < 13.5)
//
return Success;
// Timing cut for association
double
timingCut
=
200.
/
1000000000.
;
// 200 ns
...
...
src/algorithms/Timepix3Clustering.cpp
View file @
5f71cfa4
...
...
@@ -176,9 +176,14 @@ void Timepix3Clustering::calculateClusterCentre(Cluster* cluster) {
// Loop over all pixels
for
(
int
pix
=
0
;
pix
<
pixels
->
size
();
pix
++
)
{
tot
+=
(
*
pixels
)[
pix
]
->
m_adc
;
row
+=
((
*
pixels
)[
pix
]
->
m_row
*
(
*
pixels
)[
pix
]
->
m_adc
);
column
+=
((
*
pixels
)[
pix
]
->
m_column
*
(
*
pixels
)[
pix
]
->
m_adc
);
double
pixelToT
=
(
*
pixels
)[
pix
]
->
m_adc
;
if
(
pixelToT
==
0
){
LOG
(
DEBUG
)
<<
"Pixel with ToT 0!"
;
pixelToT
=
1
;
}
tot
+=
pixelToT
;
row
+=
((
*
pixels
)[
pix
]
->
m_row
*
pixelToT
);
column
+=
((
*
pixels
)[
pix
]
->
m_column
*
pixelToT
);
if
((
*
pixels
)[
pix
]
->
m_timestamp
<
timestamp
)
timestamp
=
(
*
pixels
)[
pix
]
->
m_timestamp
;
}
...
...
src/core/Analysis.cpp
View file @
5f71cfa4
...
...
@@ -102,8 +102,8 @@ void Analysis::load_detectors() {
LOG
(
STATUS
)
<<
"Loaded "
<<
detectors
.
size
()
<<
" detectors"
;
// Finally, sort the list of detectors by z position (from lowest to highest)
// FIXME reimplement - std::sort(m_parameters->detectors.begin(), m_parameters->detectors.end(), sortByZ
);
//
std
::
sort
(
detectors
.
begin
(),
detectors
.
end
(),
[](
Detector
*
det1
,
Detector
*
det2
){
return
det1
->
displacementZ
()
<
det2
->
displacementZ
();}
);
}
void
Analysis
::
load_algorithms
()
{
...
...
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