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
b59d2f3f
Commit
b59d2f3f
authored
Nov 07, 2018
by
Simon Spannagel
Browse files
Rename CLICpix2Analysis -> AnalysisDUT, make DUT_MODULE
parent
a2adad68
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/modules/
CLICpix2Analysis/CLICpix2
Analysis.cpp
→
src/modules/
AnalysisDUT/
Analysis
DUT
.cpp
View file @
b59d2f3f
#include
"
CLICpix2
Analysis.h"
#include
"Analysis
DUT
.h"
#include
"objects/Cluster.h"
#include
"objects/Pixel.h"
...
...
@@ -6,58 +6,72 @@
using
namespace
corryvreckan
;
CLICpix2Analysis
::
CLICpix2
Analysis
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
)
:
Module
(
std
::
move
(
config
),
std
::
move
(
detector
s
)
)
{
AnalysisDUT
::
Analysis
DUT
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
)
:
Module
(
std
::
move
(
config
),
detector
),
m_detector
(
detector
)
{
m_timeCutFrameEdge
=
m_config
.
get
<
double
>
(
"timeCutFrameEdge"
,
static_cast
<
double
>
(
Units
::
convert
(
20
,
"ns"
)));
spatialCut
=
m_config
.
get
<
double
>
(
"spatialCut"
,
static_cast
<
double
>
(
Units
::
convert
(
50
,
"um"
)));
chi2ndofCut
=
m_config
.
get
<
double
>
(
"chi2ndofCut"
,
3.
);
}
void
CLICpix2Analysis
::
initialise
()
{
// Get DUT detector:
auto
det
=
get_dut
();
void
AnalysisDUT
::
initialise
()
{
hClusterMapAssoc
=
new
TH2F
(
"clusterMapAssoc"
,
"clusterMapAssoc"
,
det
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
0
,
det
->
nPixelsY
());
hClusterMapAssoc
=
new
TH2F
(
"clusterMapAssoc"
,
"clusterMapAssoc"
,
m_detector
->
nPixelsX
(),
0
,
m_detector
->
nPixelsX
(),
m_detector
->
nPixelsY
(),
0
,
m_detector
->
nPixelsY
());
hClusterSizeMapAssoc
=
new
TProfile2D
(
"clusterSizeMapAssoc"
,
"clusterSizeMapAssoc"
,
det
->
nPixelsX
(),
m_
det
ector
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsX
(),
m_
det
ector
->
nPixelsY
(),
0
,
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsY
(),
0
,
100
);
hClusterToTMapAssoc
=
new
TProfile2D
(
"clusterSizeToTAssoc"
,
"clusterToTMapAssoc"
,
det
->
nPixelsX
(),
m_
det
ector
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsX
(),
m_
det
ector
->
nPixelsY
(),
0
,
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsY
(),
0
,
1000
);
// Per-pixel histograms
hHitMapAssoc
=
new
TH2F
(
"hitMapAssoc"
,
"hitMapAssoc"
,
det
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
0
,
det
->
nPixelsY
());
hHitMapROI
=
new
TH2F
(
"hitMapROI"
,
"hitMapROI"
,
det
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
0
,
det
->
nPixelsY
());
hHitMapAssoc
=
new
TH2F
(
"hitMapAssoc"
,
"hitMapAssoc"
,
m_detector
->
nPixelsX
(),
0
,
m_detector
->
nPixelsX
(),
m_detector
->
nPixelsY
(),
0
,
m_detector
->
nPixelsY
());
hHitMapROI
=
new
TH2F
(
"hitMapROI"
,
"hitMapROI"
,
m_detector
->
nPixelsX
(),
0
,
m_detector
->
nPixelsX
(),
m_detector
->
nPixelsY
(),
0
,
m_detector
->
nPixelsY
());
hPixelToTAssoc
=
new
TH1F
(
"pixelToTAssoc"
,
"pixelToTAssoc"
,
32
,
0
,
31
);
hPixelToTMapAssoc
=
new
TProfile2D
(
"pixelToTMapAssoc"
,
"pixelToTMapAssoc"
,
det
->
nPixelsX
(),
m_
det
ector
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsX
(),
m_
det
ector
->
nPixelsY
(),
0
,
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsY
(),
0
,
255
);
...
...
@@ -75,8 +89,8 @@ void CLICpix2Analysis::initialise() {
clusterSizeAssoc
=
new
TH1F
(
"clusterSizeAssociated"
,
"clusterSizeAssociated"
,
30
,
0
,
30
);
// In-pixel studies:
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
det
->
pitch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
det
->
pitch
().
Y
(),
"um"
));
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
m_
det
ector
->
pitch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
m_
det
ector
->
pitch
().
Y
(),
"um"
));
auto
mod_axes
=
"x_{track} mod "
+
std
::
to_string
(
pitch_x
)
+
"#mum;y_{track} mod "
+
std
::
to_string
(
pitch_y
)
+
"#mum;"
;
std
::
string
title
=
"DUT x resolution;"
+
mod_axes
+
"MAD(#Deltax) [#mum]"
;
...
...
@@ -136,22 +150,22 @@ void CLICpix2Analysis::initialise() {
1
);
hChipEfficiencyMap
=
new
TProfile2D
(
"hChipEfficiencyMap"
,
"hChipEfficiencyMap"
,
det
->
nPixelsX
(),
m_
det
ector
->
nPixelsX
(),
0
,
det
->
nPixelsX
(),
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsX
(),
m_
det
ector
->
nPixelsY
(),
0
,
det
->
nPixelsY
(),
m_
det
ector
->
nPixelsY
(),
0
,
1
);
hGlobalEfficiencyMap
=
new
TProfile2D
(
"hGlobalEfficiencyMap"
,
"hGlobalEfficiencyMap"
,
300
,
-
1.5
*
det
->
size
().
X
(),
1.5
*
det
->
size
().
X
(),
-
1.5
*
m_
det
ector
->
size
().
X
(),
1.5
*
m_
det
ector
->
size
().
X
(),
300
,
-
1.5
*
det
->
size
().
Y
(),
1.5
*
det
->
size
().
Y
(),
-
1.5
*
m_
det
ector
->
size
().
Y
(),
1.5
*
m_
det
ector
->
size
().
Y
(),
0
,
1
);
...
...
@@ -170,7 +184,7 @@ void CLICpix2Analysis::initialise() {
new
TH2F
(
"hUnassociatedTracksGlobalPosition"
,
"hUnassociatedTracksGlobalPosition"
,
200
,
-
10
,
10
,
200
,
-
10
,
10
);
}
StatusCode
CLICpix2
Analysis
::
run
(
Clipboard
*
clipboard
)
{
StatusCode
Analysis
DUT
::
run
(
Clipboard
*
clipboard
)
{
// Get the telescope tracks from the clipboard
Tracks
*
tracks
=
reinterpret_cast
<
Tracks
*>
(
clipboard
->
get
(
"tracks"
));
...
...
@@ -179,9 +193,6 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
return
Success
;
}
// Get the DUT detector:
auto
detector
=
get_dut
();
// Loop over all tracks
for
(
auto
&
track
:
(
*
tracks
))
{
// Flags to select clusters and tracks
...
...
@@ -197,21 +208,21 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
}
// Check if it intercepts the DUT
auto
globalIntercept
=
detector
->
getIntercept
(
track
);
auto
localIntercept
=
detector
->
globalToLocal
(
globalIntercept
);
auto
globalIntercept
=
m_
detector
->
getIntercept
(
track
);
auto
localIntercept
=
m_
detector
->
globalToLocal
(
globalIntercept
);
if
(
!
detector
->
hasIntercept
(
track
,
1.
))
{
if
(
!
m_
detector
->
hasIntercept
(
track
,
1.
))
{
LOG
(
DEBUG
)
<<
" - track outside DUT area"
;
continue
;
}
// Check that track is within region of interest using winding number algorithm
if
(
!
detector
->
isWithinROI
(
track
))
{
if
(
!
m_
detector
->
isWithinROI
(
track
))
{
is_within_roi
=
false
;
}
// Check that it doesn't go through/near a masked pixel
if
(
detector
->
hitMasked
(
track
,
1.
))
{
if
(
m_
detector
->
hitMasked
(
track
,
1.
))
{
LOG
(
DEBUG
)
<<
" - track close to masked pixel"
;
continue
;
}
...
...
@@ -232,11 +243,11 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
}
// Calculate in-pixel position of track in microns
auto
xmod
=
static_cast
<
double
>
(
Units
::
convert
(
detector
->
inPixelX
(
localIntercept
),
"um"
));
auto
ymod
=
static_cast
<
double
>
(
Units
::
convert
(
detector
->
inPixelY
(
localIntercept
),
"um"
));
auto
xmod
=
static_cast
<
double
>
(
Units
::
convert
(
m_
detector
->
inPixelX
(
localIntercept
),
"um"
));
auto
ymod
=
static_cast
<
double
>
(
Units
::
convert
(
m_
detector
->
inPixelY
(
localIntercept
),
"um"
));
// Get the DUT clusters from the clipboard
Clusters
*
clusters
=
reinterpret_cast
<
Clusters
*>
(
clipboard
->
get
(
get_dut
()
->
name
(),
"clusters"
));
Clusters
*
clusters
=
reinterpret_cast
<
Clusters
*>
(
clipboard
->
get
(
m_detector
->
name
(),
"clusters"
));
if
(
clusters
==
nullptr
)
{
LOG
(
DEBUG
)
<<
" - no DUT clusters"
;
}
else
{
...
...
@@ -268,11 +279,13 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
// We now have an associated cluster
has_associated_cluster
=
true
;
// FIXME need to understand local coord of clusters - why shifted? what's normal?
auto
clusterLocal
=
detector
->
globalToLocal
(
cluster
->
global
());
hClusterMapAssoc
->
Fill
(
detector
->
getColumn
(
clusterLocal
),
detector
->
getRow
(
clusterLocal
));
hClusterSizeMapAssoc
->
Fill
(
detector
->
getColumn
(
clusterLocal
),
detector
->
getRow
(
clusterLocal
),
static_cast
<
double
>
(
cluster
->
size
()));
hClusterToTMapAssoc
->
Fill
(
detector
->
getColumn
(
clusterLocal
),
detector
->
getRow
(
clusterLocal
),
cluster
->
tot
());
auto
clusterLocal
=
m_detector
->
globalToLocal
(
cluster
->
global
());
hClusterMapAssoc
->
Fill
(
m_detector
->
getColumn
(
clusterLocal
),
m_detector
->
getRow
(
clusterLocal
));
hClusterSizeMapAssoc
->
Fill
(
m_detector
->
getColumn
(
clusterLocal
),
m_detector
->
getRow
(
clusterLocal
),
static_cast
<
double
>
(
cluster
->
size
()));
hClusterToTMapAssoc
->
Fill
(
m_detector
->
getColumn
(
clusterLocal
),
m_detector
->
getRow
(
clusterLocal
),
cluster
->
tot
());
clusterTotAssoc
->
Fill
(
cluster
->
tot
());
...
...
@@ -344,7 +357,7 @@ StatusCode CLICpix2Analysis::run(Clipboard* clipboard) {
// Efficiency plots:
hGlobalEfficiencyMap
->
Fill
(
globalIntercept
.
X
(),
globalIntercept
.
Y
(),
has_associated_cluster
);
hChipEfficiencyMap
->
Fill
(
detector
->
getColumn
(
localIntercept
),
detector
->
getRow
(
localIntercept
),
has_associated_cluster
);
m_
detector
->
getColumn
(
localIntercept
),
m_
detector
->
getRow
(
localIntercept
),
has_associated_cluster
);
// For pixels, only look at the ROI:
if
(
is_within_roi
)
{
...
...
src/modules/
CLICpix2Analysis/CLICpix2
Analysis.h
→
src/modules/
AnalysisDUT/
Analysis
DUT
.h
View file @
b59d2f3f
#ifndef CORRYVRECKAN_
CLICPIX2
_ANALYSIS_H
#define CORRYVRECKAN_
CLICPIX2
_ANALYSIS_H
#ifndef CORRYVRECKAN_
DUT
_ANALYSIS_H
#define CORRYVRECKAN_
DUT
_ANALYSIS_H
#include
<TCanvas.h>
#include
<TH1F.h>
...
...
@@ -11,18 +11,20 @@
namespace
corryvreckan
{
/** @ingroup Modules
*/
class
CLICpix2
Analysis
:
public
Module
{
class
Analysis
DUT
:
public
Module
{
public:
// Constructors and destructors
CLICpix2
Analysis
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>
>
detector
s
);
~
CLICpix2
Analysis
()
{}
Analysis
DUT
(
Configuration
config
,
std
::
shared_ptr
<
Detector
>
detector
);
~
Analysis
DUT
()
{}
// Functions
void
initialise
();
StatusCode
run
(
Clipboard
*
clipboard
);
private:
std
::
shared_ptr
<
Detector
>
m_detector
;
// Histograms
TH2F
*
hClusterMapAssoc
,
*
hHitMapAssoc
,
*
hHitMapROI
;
TProfile2D
*
hClusterSizeMapAssoc
,
*
hClusterToTMapAssoc
;
...
...
@@ -64,4 +66,4 @@ namespace corryvreckan {
};
}
// namespace corryvreckan
#endif // CORRYVRECKAN_
CLICPIX2
_ANALYSIS_H
#endif // CORRYVRECKAN_
DUT
_ANALYSIS_H
src/modules/
CLICpix2
Analysis/CMakeLists.txt
→
src/modules/Analysis
DUT
/CMakeLists.txt
View file @
b59d2f3f
# Define module and return the generated name as MODULE_NAME
CORRYVRECKAN_
GLOBAL
_MODULE
(
MODULE_NAME
)
CORRYVRECKAN_
DUT
_MODULE
(
MODULE_NAME
)
# Add source files to library
CORRYVRECKAN_MODULE_SOURCES
(
${
MODULE_NAME
}
CLICpix2
Analysis.cpp
Analysis
DUT
.cpp
)
# Provide standard install target
...
...
src/modules/
CLICpix2
Analysis/README.md
→
src/modules/Analysis
DUT
/README.md
View file @
b59d2f3f
File moved
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