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
8dfe5e41
Commit
8dfe5e41
authored
Apr 23, 2021
by
Jens Kroeger
Browse files
AnalysisDUT: unify naming convention of member variables
parent
d377b36f
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/modules/AnalysisDUT/AnalysisDUT.cpp
View file @
8dfe5e41
...
...
@@ -25,11 +25,11 @@ AnalysisDUT::AnalysisDUT(Configuration& config, std::shared_ptr<Detector> detect
config_
.
setDefault
<
int
>
(
"n_time_bins"
,
20000
);
config_
.
setDefault
<
double
>
(
"time_binning"
,
Units
::
get
<
double
>
(
0.1
,
"ns"
));
m_
time
CutF
rame
E
dge
=
config_
.
get
<
double
>
(
"time_cut_frameedge"
);
chi2ndof
C
ut
=
config_
.
get
<
double
>
(
"chi2ndof_cut"
);
use
C
losest
C
luster
=
config_
.
get
<
bool
>
(
"use_closest_cluster"
);
n
T
ime
B
ins
=
config_
.
get
<
int
>
(
"n_time_bins"
);
time
B
inning
=
config_
.
get
<
double
>
(
"time_binning"
);
time
_cut_f
rame
e
dge
_
=
config_
.
get
<
double
>
(
"time_cut_frameedge"
);
chi2
_
ndof
_c
ut
_
=
config_
.
get
<
double
>
(
"chi2ndof_cut"
);
use
_c
losest
_c
luster
_
=
config_
.
get
<
bool
>
(
"use_closest_cluster"
);
n
_t
ime
b
ins
_
=
config_
.
get
<
int
>
(
"n_time_bins"
);
time
_b
inning
_
=
config_
.
get
<
double
>
(
"time_binning"
);
}
void
AnalysisDUT
::
initialize
()
{
...
...
@@ -148,9 +148,9 @@ void AnalysisDUT::initialize() {
residualsPosVsresidualsTime
=
new
TH2F
(
"residualsPosVsresidualsTime"
,
"Time vs. absolute position residuals;time_{track}-time_{hit} [ns];|pos_{track}-pos_{hit}| [mm];# entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
800
,
0.
,
0.2
);
...
...
@@ -338,9 +338,9 @@ void AnalysisDUT::initialize() {
residualsTime
=
new
TH1F
(
"residualsTime"
,
"Time residual;time_{track}-time_{hit} [ns];#entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
);
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
);
hTrackCorrelationX
=
new
TH1F
(
"hTrackCorrelationX"
,
"Track residual X, all clusters;x_{track}-x_{hit} [mm];# entries"
,
4000
,
-
10.
,
10.
);
...
...
@@ -371,15 +371,15 @@ void AnalysisDUT::initialize() {
20000
,
0
,
200
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
);
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
);
residualsTimeVsTot
=
new
TH2F
(
"residualsTimeVsTot"
,
"Time residual vs. pixel charge;time_{track} - time_{hit} [ns];seed pixel ToT [lsb];# entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
1000
,
-
0.5
,
999.5
);
...
...
@@ -387,18 +387,18 @@ void AnalysisDUT::initialize() {
residualsTimeVsCol
=
new
TH2F
(
"residualsTimeVsCol"
,
"Time residual vs. pixel charge;time_{track} - time_{hit} [ns];seed pixel column;# entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
m_detector
->
nPixels
().
X
(),
-
0.5
,
m_detector
->
nPixels
().
X
()
-
0.5
);
residualsTimeVsRow
=
new
TH2F
(
"residualsTimeVsRow"
,
"Time residual vs. pixel charge;time_{track} - time_{hit} [ns];seed pixel row;# entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
m_detector
->
nPixels
().
X
(),
-
0.5
,
m_detector
->
nPixels
().
X
()
-
0.5
);
...
...
@@ -406,9 +406,9 @@ void AnalysisDUT::initialize() {
residualsTimeVsSignal
=
new
TH2F
(
"residualsTimeVsSignal"
,
"Time residual vs. cluster charge;cluster charge [e];time_{track}-time_{hit} [mm];# entries"
,
n
T
ime
B
ins
,
-
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
T
ime
B
ins
/
2.
*
time
B
inning
-
time
B
inning
/
2.
,
n
_t
ime
b
ins
_
,
-
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
n
_t
ime
b
ins
_
/
2.
*
time
_b
inning
_
-
time
_b
inning
_
/
2.
,
20000
,
0
,
100000
);
...
...
@@ -454,10 +454,10 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
LOG
(
DEBUG
)
<<
"Looking at next track"
;
// Cut on the chi2/ndof
if
(
track
->
getChi2ndof
()
>
chi2ndof
C
ut
)
{
if
(
track
->
getChi2ndof
()
>
chi2
_
ndof
_c
ut
_
)
{
LOG
(
DEBUG
)
<<
" - track discarded due to Chi2/ndof"
;
hCutHisto
->
Fill
(
1
);
num_tracks
++
;
num_tracks
_
++
;
continue
;
}
...
...
@@ -468,7 +468,7 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
if
(
!
m_detector
->
hasIntercept
(
track
.
get
(),
0.5
))
{
LOG
(
DEBUG
)
<<
" - track outside DUT area"
;
hCutHisto
->
Fill
(
2
);
num_tracks
++
;
num_tracks
_
++
;
continue
;
}
...
...
@@ -481,7 +481,7 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
if
(
m_detector
->
hitMasked
(
track
.
get
(),
1.
))
{
LOG
(
DEBUG
)
<<
" - track close to masked pixel"
;
hCutHisto
->
Fill
(
3
);
num_tracks
++
;
num_tracks
_
++
;
continue
;
}
...
...
@@ -489,21 +489,21 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
auto
event
=
clipboard
->
getEvent
();
// Discard tracks which are very close to the frame edges
if
(
fabs
(
track
->
timestamp
()
-
event
->
end
())
<
m_
time
CutF
rame
E
dge
)
{
if
(
fabs
(
track
->
timestamp
()
-
event
->
end
())
<
time
_cut_f
rame
e
dge
_
)
{
// Late edge - eventEnd points to the end of the frame`
LOG
(
DEBUG
)
<<
" - track close to end of readout frame: "
<<
Units
::
display
(
fabs
(
track
->
timestamp
()
-
event
->
end
()),
{
"us"
,
"ns"
})
<<
" at "
<<
Units
::
display
(
track
->
timestamp
(),
{
"us"
});
hCutHisto
->
Fill
(
4
);
num_tracks
++
;
num_tracks
_
++
;
continue
;
}
else
if
(
fabs
(
track
->
timestamp
()
-
event
->
start
())
<
m_
time
CutF
rame
E
dge
)
{
}
else
if
(
fabs
(
track
->
timestamp
()
-
event
->
start
())
<
time
_cut_f
rame
e
dge
_
)
{
// Early edge - eventStart points to the beginning of the frame
LOG
(
DEBUG
)
<<
" - track close to start of readout frame: "
<<
Units
::
display
(
fabs
(
track
->
timestamp
()
-
event
->
start
()),
{
"us"
,
"ns"
})
<<
" at "
<<
Units
::
display
(
track
->
timestamp
(),
{
"us"
});
hCutHisto
->
Fill
(
4
);
num_tracks
++
;
num_tracks
_
++
;
continue
;
}
...
...
@@ -517,7 +517,7 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
LOG
(
DEBUG
)
<<
" - Looking at next associated DUT cluster"
;
// if closest cluster should be used continue if current associated cluster is not the closest one
if
(
use
C
losest
C
luster
&&
track
->
getClosestCluster
(
m_detector
->
getName
())
!=
assoc_cluster
)
{
if
(
use
_c
losest
_c
luster
_
&&
track
->
getClosestCluster
(
m_detector
->
getName
())
!=
assoc_cluster
)
{
continue
;
}
has_associated_cluster
=
true
;
...
...
@@ -654,13 +654,13 @@ StatusCode AnalysisDUT::run(const std::shared_ptr<Clipboard>& clipboard) {
if
(
!
has_associated_cluster
)
{
hUnassociatedTracksGlobalPosition
->
Fill
(
globalIntercept
.
X
(),
globalIntercept
.
Y
());
}
num_tracks
++
;
num_tracks
_
++
;
}
// Return value telling analysis to keep running
return
StatusCode
::
Success
;
}
void
AnalysisDUT
::
finalize
(
const
std
::
shared_ptr
<
ReadonlyClipboard
>&
)
{
hCutHisto
->
Scale
(
1
/
double
(
num_tracks
));
hCutHisto
->
Scale
(
1
/
double
(
num_tracks
_
));
clusterSizeAssocNorm
->
Scale
(
1
/
clusterSizeAssoc
->
Integral
());
}
src/modules/AnalysisDUT/AnalysisDUT.h
View file @
8dfe5e41
...
...
@@ -113,12 +113,12 @@ namespace corryvreckan {
TProfile2D
*
hMapLargeClusters
;
// Member variables
double
m_
time
CutF
rame
E
dge
;
double
chi2ndof
C
ut
;
bool
use
C
losest
C
luster
;
int
n
T
ime
B
ins
;
double
time
B
inning
;
int
num_tracks
;
double
time
_cut_f
rame
e
dge
_
;
double
chi2
_
ndof
_c
ut
_
;
bool
use
_c
losest
_c
luster
_
;
int
n
_t
ime
b
ins
_
;
double
time
_b
inning
_
;
int
num_tracks
_
;
};
}
// namespace corryvreckan
...
...
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