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
a7fb323d
Commit
a7fb323d
authored
Apr 02, 2020
by
Jin Zhang
Browse files
public function name
parent
222a7f2e
Changes
35
Hide whitespace changes
Inline
Side-by-side
src/core/detector/Detector.cpp
View file @
a7fb323d
...
...
@@ -96,11 +96,11 @@ double Detector::getTimeResolution() const {
}
}
std
::
string
Detector
::
n
ame
()
const
{
std
::
string
Detector
::
getN
ame
()
const
{
return
m_detectorName
;
}
std
::
string
Detector
::
t
ype
()
const
{
std
::
string
Detector
::
getT
ype
()
const
{
return
m_detectorType
;
}
...
...
@@ -126,9 +126,9 @@ void Detector::update() {
this
->
initialise
();
}
Configuration
Detector
::
G
etConfiguration
()
const
{
Configuration
Detector
::
g
etConfiguration
()
const
{
Configuration
config
(
n
ame
());
Configuration
config
(
getN
ame
());
config
.
set
(
"type"
,
m_detectorType
);
// Store the role of the detector
...
...
src/core/detector/Detector.hpp
View file @
a7fb323d
...
...
@@ -91,13 +91,13 @@ namespace corryvreckan {
* @brief Get type of the detector
* @return Type of the detector model
*/
std
::
string
t
ype
()
const
;
std
::
string
getT
ype
()
const
;
/**
* @brief Get name of the detector
* @return Detector name
*/
std
::
string
n
ame
()
const
;
std
::
string
getN
ame
()
const
;
/**
* @brief Check whether detector is registered as reference
...
...
@@ -121,21 +121,21 @@ namespace corryvreckan {
* @brief Retrieve configuration object from detector, containing all (potentially updated) parameters
* @return Configuration object for this detector
*/
Configuration
G
etConfiguration
()
const
;
Configuration
g
etConfiguration
()
const
;
/**
* @brief Get the total size of the active matrix, i.e. pitch * number of pixels in both dimensions
* @return 2D vector with the dimensions of the pixle matrix in X and Y
* @to do: this is designed for PixelDetector, find a proper interface for other Detector type
*/
virtual
XYVector
s
ize
()
const
=
0
;
virtual
XYVector
getS
ize
()
const
=
0
;
/**
* @brief Get pitch of a single pixel
* @return Pitch of a pixel
* @to do: this is designed for PixelDetector, find a proper interface for other Detector type
*/
virtual
XYVector
p
itch
()
const
=
0
;
virtual
XYVector
getP
itch
()
const
=
0
;
/**
* @brief Get intrinsic spatial resolution of the detector
...
...
src/core/detector/PixelDetector.cpp
View file @
a7fb323d
...
...
@@ -198,7 +198,7 @@ PositionVector3D<Cartesian3D<double>> PixelDetector::getIntercept(const Track* t
// FIXME: this is else statement can only be temporary
if
(
track
->
getType
()
==
"gbl"
)
{
return
track
->
state
(
n
ame
());
return
track
->
state
(
getN
ame
());
}
else
{
// Get the distance from the plane to the track initial state
double
distance
=
(
m_origin
.
X
()
-
track
->
state
(
m_detectorName
).
X
())
*
m_normal
.
X
();
...
...
@@ -336,7 +336,7 @@ bool PixelDetector::isWithinROI(Cluster* cluster) const {
return
true
;
}
XYVector
PixelDetector
::
s
ize
()
const
{
XYVector
PixelDetector
::
getS
ize
()
const
{
return
XYVector
(
m_pitch
.
X
()
*
m_nPixels
.
X
(),
m_pitch
.
Y
()
*
m_nPixels
.
Y
());
}
...
...
src/core/detector/PixelDetector.hpp
View file @
a7fb323d
...
...
@@ -147,13 +147,13 @@ namespace corryvreckan {
* @brief Get the total size of the active matrix, i.e. pitch * number of pixels in both dimensions
* @return 2D vector with the dimensions of the pixle matrix in X and Y
*/
XYVector
s
ize
()
const
override
;
XYVector
getS
ize
()
const
override
;
/**
* @brief Get pitch of a single pixel
* @return Pitch of a pixel
*/
XYVector
p
itch
()
const
override
{
return
m_pitch
;
}
XYVector
getP
itch
()
const
override
{
return
m_pitch
;
}
/**
* @brief Get intrinsic spatial resolution of the detector
...
...
src/core/detector/exceptions.cpp
View file @
a7fb323d
...
...
@@ -14,7 +14,7 @@
using
namespace
corryvreckan
;
InvalidSettingError
::
InvalidSettingError
(
const
Detector
*
detector
,
const
std
::
string
&
key
,
const
std
::
string
&
reason
)
{
error_message_
=
"Setting '"
+
key
+
"' of detector '"
+
detector
->
n
ame
()
+
"' is not valid"
;
error_message_
=
"Setting '"
+
key
+
"' of detector '"
+
detector
->
getN
ame
()
+
"' is not valid"
;
if
(
!
reason
.
empty
())
{
error_message_
+=
": "
+
reason
;
}
...
...
src/core/module/Module.cpp
View file @
a7fb323d
...
...
@@ -117,7 +117,7 @@ void Module::set_ROOT_directory(TDirectory* directory) {
std
::
shared_ptr
<
Detector
>
Module
::
get_detector
(
std
::
string
name
)
{
auto
it
=
find_if
(
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
n
ame
()
==
name
;
});
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
getN
ame
()
==
name
;
});
if
(
it
==
m_detectors
.
end
())
{
throw
ModuleError
(
"Device with detector ID "
+
name
+
" is not registered."
);
}
...
...
@@ -131,7 +131,7 @@ std::shared_ptr<Detector> Module::get_reference() {
bool
Module
::
has_detector
(
std
::
string
name
)
{
auto
it
=
find_if
(
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
n
ame
()
==
name
;
});
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
getN
ame
()
==
name
;
});
if
(
it
==
m_detectors
.
end
())
{
return
false
;
}
...
...
src/core/module/ModuleManager.cpp
View file @
a7fb323d
...
...
@@ -54,7 +54,7 @@ void ModuleManager::load_detectors() {
// Check if we have a duplicate:
if
(
std
::
find_if
(
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
n
ame
()
==
name
;
return
obj
->
getN
ame
()
==
name
;
})
!=
m_detectors
.
end
())
{
throw
InvalidValueError
(
global_config
,
"detectors_file"
,
"Detector "
+
detector_section
.
getName
()
+
" defined twice"
);
...
...
@@ -307,7 +307,7 @@ std::vector<std::string> ModuleManager::get_type_vector(char* type_tokens) {
std
::
shared_ptr
<
Detector
>
ModuleManager
::
get_detector
(
std
::
string
name
)
{
auto
it
=
find_if
(
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
n
ame
()
==
name
;
});
m_detectors
.
begin
(),
m_detectors
.
end
(),
[
&
name
](
std
::
shared_ptr
<
Detector
>
obj
)
{
return
obj
->
getN
ame
()
==
name
;
});
return
(
it
!=
m_detectors
.
end
()
?
(
*
it
)
:
nullptr
);
}
...
...
@@ -401,8 +401,8 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
continue
;
}
LOG
(
TRACE
)
<<
"Preparing
\"
name
\"
instance for "
<<
det
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
0
));
LOG
(
TRACE
)
<<
"Preparing
\"
name
\"
instance for "
<<
det
->
getN
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
getN
ame
(),
0
));
// Save the name (to not instantiate it again later)
module_names
.
insert
(
name
);
}
...
...
@@ -425,11 +425,11 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
}
for
(
auto
&
det
:
m_detectors
)
{
auto
detectortype
=
det
->
t
ype
();
auto
detectortype
=
det
->
getT
ype
();
std
::
transform
(
detectortype
.
begin
(),
detectortype
.
end
(),
detectortype
.
begin
(),
::
tolower
);
// Skip all that were already added by name
if
(
module_names
.
find
(
det
->
n
ame
())
!=
module_names
.
end
())
{
if
(
module_names
.
find
(
det
->
getN
ame
())
!=
module_names
.
end
())
{
continue
;
}
for
(
auto
&
type
:
ctypes
)
{
...
...
@@ -438,8 +438,8 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
continue
;
}
LOG
(
TRACE
)
<<
"Preparing
\"
type
\"
instance for "
<<
det
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
1
));
LOG
(
TRACE
)
<<
"Preparing
\"
type
\"
instance for "
<<
det
->
getN
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
getN
ame
(),
1
));
}
}
instances_created
=
!
ctypes
.
empty
();
...
...
@@ -448,8 +448,8 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
// Create for all detectors if no name / type provided
if
(
!
instances_created
)
{
for
(
auto
&
det
:
m_detectors
)
{
LOG
(
TRACE
)
<<
"Preparing
\"
other
\"
instance for "
<<
det
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
2
));
LOG
(
TRACE
)
<<
"Preparing
\"
other
\"
instance for "
<<
det
->
getN
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
getN
ame
(),
2
));
}
}
...
...
@@ -465,7 +465,7 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
}
// Do not instantiate module if detector type is not mentioned as supported:
auto
detectortype
=
detector
->
t
ype
();
auto
detectortype
=
detector
->
getT
ype
();
std
::
transform
(
detectortype
.
begin
(),
detectortype
.
end
(),
detectortype
.
begin
(),
::
tolower
);
if
(
!
types
.
empty
()
&&
std
::
find
(
types
.
begin
(),
types
.
end
(),
detectortype
)
==
types
.
end
())
{
LOG
(
TRACE
)
<<
"Skipping instantiation
\"
"
<<
identifier
.
getUniqueName
()
<<
"
\"
, detector type mismatch"
;
...
...
@@ -732,7 +732,7 @@ void ModuleManager::finaliseAll() {
ConfigReader
final_detectors
;
for
(
auto
&
detector
:
m_detectors
)
{
final_detectors
.
addConfiguration
(
detector
->
G
etConfiguration
());
final_detectors
.
addConfiguration
(
detector
->
g
etConfiguration
());
}
final_detectors
.
write
(
file
);
...
...
src/modules/AlignmentDUTResidual/AlignmentDUTResidual.cpp
View file @
a7fb323d
...
...
@@ -36,12 +36,12 @@ AlignmentDUTResidual::AlignmentDUTResidual(Configuration config, std::shared_ptr
m_maxAssocClusters
=
m_config
.
get
<
size_t
>
(
"max_associated_clusters"
,
1
);
m_maxTrackChi2
=
m_config
.
get
<
double
>
(
"max_track_chi2ndof"
,
10.
);
LOG
(
INFO
)
<<
"Aligning detector
\"
"
<<
m_detector
->
n
ame
()
<<
"
\"
"
;
LOG
(
INFO
)
<<
"Aligning detector
\"
"
<<
m_detector
->
getN
ame
()
<<
"
\"
"
;
}
void
AlignmentDUTResidual
::
initialise
()
{
auto
detname
=
m_detector
->
n
ame
();
auto
detname
=
m_detector
->
getN
ame
();
std
::
string
title
=
detname
+
" Residuals X;x_{track}-x [#mum];events"
;
residualsXPlot
=
new
TH1F
(
"residualsX"
,
title
.
c_str
(),
1000
,
-
500
,
500
);
title
=
detname
+
" Residuals Y;y_{track}-y [#mum];events"
;
...
...
@@ -89,7 +89,7 @@ StatusCode AlignmentDUTResidual::run(std::shared_ptr<Clipboard> clipboard) {
// Find the cluster that needs to have its position recalculated
for
(
auto
&
associatedCluster
:
track
->
associatedClusters
())
{
if
(
associatedCluster
->
detectorID
()
!=
m_detector
->
n
ame
())
{
if
(
associatedCluster
->
detectorID
()
!=
m_detector
->
getN
ame
())
{
continue
;
}
// Local position of the cluster
...
...
@@ -137,7 +137,7 @@ void AlignmentDUTResidual::MinimiseResiduals(Int_t&, Double_t*, Double_t& result
// Apply new alignment conditions
globalDetector
->
update
();
LOG
(
DEBUG
)
<<
"Updated parameters for "
<<
globalDetector
->
n
ame
();
LOG
(
DEBUG
)
<<
"Updated parameters for "
<<
globalDetector
->
getN
ame
();
// The chi2 value to be returned
result
=
0.
;
...
...
@@ -152,7 +152,7 @@ void AlignmentDUTResidual::MinimiseResiduals(Int_t&, Double_t*, Double_t& result
// Find the cluster that needs to have its position recalculated
for
(
auto
&
associatedCluster
:
track
->
associatedClusters
())
{
if
(
associatedCluster
->
detectorID
()
!=
globalDetector
->
n
ame
())
{
if
(
associatedCluster
->
detectorID
()
!=
globalDetector
->
getN
ame
())
{
continue
;
}
...
...
@@ -210,7 +210,7 @@ void AlignmentDUTResidual::finalise() {
arglist
[
1
]
=
0.001
;
// tolerance
globalDetector
=
m_detector
;
auto
name
=
m_detector
->
n
ame
();
auto
name
=
m_detector
->
getN
ame
();
size_t
n_associatedClusters
=
0
;
// count associated clusters:
...
...
@@ -273,12 +273,12 @@ void AlignmentDUTResidual::finalise() {
m_detector
->
rotation
(
XYZVector
(
residualFitter
->
GetParameter
(
3
),
residualFitter
->
GetParameter
(
4
),
residualFitter
->
GetParameter
(
5
)));
LOG
(
INFO
)
<<
m_detector
->
n
ame
()
<<
"/"
<<
iteration
<<
" dT"
LOG
(
INFO
)
<<
m_detector
->
getN
ame
()
<<
"/"
<<
iteration
<<
" dT"
<<
Units
::
display
(
m_detector
->
displacement
()
-
old_position
,
{
"mm"
,
"um"
})
<<
" dR"
<<
Units
::
display
(
m_detector
->
rotation
()
-
old_orientation
,
{
"deg"
});
}
LOG
(
STATUS
)
<<
m_detector
->
n
ame
()
<<
" new alignment: "
<<
std
::
endl
LOG
(
STATUS
)
<<
m_detector
->
getN
ame
()
<<
" new alignment: "
<<
std
::
endl
<<
"T"
<<
Units
::
display
(
m_detector
->
displacement
(),
{
"mm"
,
"um"
})
<<
" R"
<<
Units
::
display
(
m_detector
->
rotation
(),
{
"deg"
});
}
src/modules/AlignmentMillepede/AlignmentMillepede.cpp
View file @
a7fb323d
...
...
@@ -55,7 +55,7 @@ void AlignmentMillepede::initialise() {
if
(
det
->
isDUT
()
&&
m_excludeDUT
)
{
continue
;
}
m_millePlanes
[
det
->
n
ame
()]
=
index
;
m_millePlanes
[
det
->
getN
ame
()]
=
index
;
++
index
;
}
...
...
@@ -105,7 +105,7 @@ void AlignmentMillepede::finalise() {
nPlanes
--
;
}
if
(
det
->
isAuxiliary
())
{
LOG
(
INFO
)
<<
"Excluding auxiliary detector "
<<
det
->
n
ame
();
LOG
(
INFO
)
<<
"Excluding auxiliary detector "
<<
det
->
getN
ame
();
nPlanes
--
;
}
}
...
...
@@ -210,7 +210,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
if
(
det
->
isDUT
()
&&
m_excludeDUT
)
{
continue
;
}
const
unsigned
int
i
=
m_millePlanes
[
det
->
n
ame
()];
const
unsigned
int
i
=
m_millePlanes
[
det
->
getN
ame
()];
const
double
sz
=
(
det
->
displacement
().
Z
()
-
avgz
)
/
varz
;
ftx
[
i
]
=
1.0
;
fty
[
i
+
nPlanes
]
=
1.0
;
...
...
@@ -307,7 +307,7 @@ bool AlignmentMillepede::putTrack(Track* track, const size_t nPlanes) {
const
double
errx
=
cluster
->
errorX
();
const
double
erry
=
cluster
->
errorY
();
// Get the internal plane index in Millepede.
const
unsigned
int
plane
=
m_millePlanes
[
detector
->
n
ame
()];
const
unsigned
int
plane
=
m_millePlanes
[
detector
->
getN
ame
()];
// Set the local derivatives for the X equation.
std
::
vector
<
double
>
derlc
=
{
1.
,
zg
,
0.
,
0.
};
// Set the global derivatives (see LHCb-2005-101) for the X equation.
...
...
@@ -593,7 +593,7 @@ void AlignmentMillepede::updateGeometry() {
if
(
det
->
isDUT
()
&&
m_excludeDUT
)
{
continue
;
}
auto
plane
=
m_millePlanes
[
det
->
n
ame
()];
auto
plane
=
m_millePlanes
[
det
->
getN
ame
()];
det
->
displacement
(
XYZPoint
(
det
->
displacement
().
X
()
+
m_dparm
[
plane
+
0
*
nPlanes
],
det
->
displacement
().
Y
()
+
m_dparm
[
plane
+
1
*
nPlanes
],
...
...
src/modules/AlignmentTrackChi2/AlignmentTrackChi2.cpp
View file @
a7fb323d
...
...
@@ -106,7 +106,7 @@ void AlignmentTrackChi2::MinimiseTrackChi2(Int_t&, Double_t*, Double_t& result,
// Find the cluster that needs to have its position recalculated
for
(
size_t
iTrackCluster
=
0
;
iTrackCluster
<
trackClusters
.
size
();
iTrackCluster
++
)
{
Cluster
*
trackCluster
=
trackClusters
[
iTrackCluster
];
if
(
globalDetector
->
n
ame
()
!=
trackCluster
->
detectorID
())
{
if
(
globalDetector
->
getN
ame
()
!=
trackCluster
->
detectorID
())
{
continue
;
}
...
...
@@ -165,7 +165,7 @@ void AlignmentTrackChi2::finalise() {
int
det
=
0
;
for
(
auto
&
detector
:
get_detectors
())
{
string
detectorID
=
detector
->
n
ame
();
string
detectorID
=
detector
->
getN
ame
();
// Do not align the reference plane
if
(
detector
->
isReference
()
||
detector
->
isDUT
()
||
detector
->
isAuxiliary
())
{
...
...
@@ -233,7 +233,7 @@ void AlignmentTrackChi2::finalise() {
rotZ
[
detectorID
].
push_back
(
static_cast
<
double
>
(
Units
::
convert
(
detector
->
rotation
().
Z
()
-
old_orientation
.
Z
(),
"deg"
)));
LOG
(
INFO
)
<<
detector
->
n
ame
()
<<
"/"
<<
iteration
<<
" dT"
LOG
(
INFO
)
<<
detector
->
getN
ame
()
<<
"/"
<<
iteration
<<
" dT"
<<
Units
::
display
(
detector
->
displacement
()
-
old_position
,
{
"mm"
,
"um"
})
<<
" dR"
<<
Units
::
display
(
detector
->
rotation
()
-
old_orientation
,
{
"deg"
});
...
...
@@ -264,7 +264,7 @@ void AlignmentTrackChi2::finalise() {
continue
;
}
LOG
(
STATUS
)
<<
detector
->
n
ame
()
<<
" new alignment: "
<<
std
::
endl
LOG
(
STATUS
)
<<
detector
->
getN
ame
()
<<
" new alignment: "
<<
std
::
endl
<<
"T"
<<
Units
::
display
(
detector
->
displacement
(),
{
"mm"
,
"um"
})
<<
" R"
<<
Units
::
display
(
detector
->
rotation
(),
{
"deg"
});
...
...
@@ -272,39 +272,39 @@ void AlignmentTrackChi2::finalise() {
std
::
vector
<
double
>
iterations
(
nIterations
);
std
::
iota
(
std
::
begin
(
iterations
),
std
::
end
(
iterations
),
0
);
std
::
string
name
=
"alignment_correction_displacementX_"
+
detector
->
n
ame
();
align_correction_shiftX
[
detector
->
n
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
shiftsX
[
detector
->
n
ame
()].
size
()),
&
iterations
[
0
],
&
shiftsX
[
detector
->
n
ame
()][
0
]);
align_correction_shiftX
[
detector
->
n
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_shiftX
[
detector
->
n
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [#mum]"
);
align_correction_shiftX
[
detector
->
n
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_displacementY_"
+
detector
->
n
ame
();
align_correction_shiftY
[
detector
->
n
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
shiftsY
[
detector
->
n
ame
()].
size
()),
&
iterations
[
0
],
&
shiftsY
[
detector
->
n
ame
()][
0
]);
align_correction_shiftY
[
detector
->
n
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_shiftY
[
detector
->
n
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [#mum]"
);
align_correction_shiftY
[
detector
->
n
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationX_"
+
detector
->
n
ame
();
align_correction_rotX
[
detector
->
n
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotX
[
detector
->
n
ame
()].
size
()),
&
iterations
[
0
],
&
rotX
[
detector
->
n
ame
()][
0
]);
align_correction_rotX
[
detector
->
n
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotX
[
detector
->
n
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotX
[
detector
->
n
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationY_"
+
detector
->
n
ame
();
align_correction_rotY
[
detector
->
n
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotY
[
detector
->
n
ame
()].
size
()),
&
iterations
[
0
],
&
rotY
[
detector
->
n
ame
()][
0
]);
align_correction_rotY
[
detector
->
n
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotY
[
detector
->
n
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotY
[
detector
->
n
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationZ_"
+
detector
->
n
ame
();
align_correction_rotZ
[
detector
->
n
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotZ
[
detector
->
n
ame
()].
size
()),
&
iterations
[
0
],
&
rotZ
[
detector
->
n
ame
()][
0
]);
align_correction_rotZ
[
detector
->
n
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotZ
[
detector
->
n
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotZ
[
detector
->
n
ame
()]
->
Write
(
name
.
c_str
());
std
::
string
name
=
"alignment_correction_displacementX_"
+
detector
->
getN
ame
();
align_correction_shiftX
[
detector
->
getN
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
shiftsX
[
detector
->
getN
ame
()].
size
()),
&
iterations
[
0
],
&
shiftsX
[
detector
->
getN
ame
()][
0
]);
align_correction_shiftX
[
detector
->
getN
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_shiftX
[
detector
->
getN
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [#mum]"
);
align_correction_shiftX
[
detector
->
getN
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_displacementY_"
+
detector
->
getN
ame
();
align_correction_shiftY
[
detector
->
getN
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
shiftsY
[
detector
->
getN
ame
()].
size
()),
&
iterations
[
0
],
&
shiftsY
[
detector
->
getN
ame
()][
0
]);
align_correction_shiftY
[
detector
->
getN
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_shiftY
[
detector
->
getN
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [#mum]"
);
align_correction_shiftY
[
detector
->
getN
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationX_"
+
detector
->
getN
ame
();
align_correction_rotX
[
detector
->
getN
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotX
[
detector
->
getN
ame
()].
size
()),
&
iterations
[
0
],
&
rotX
[
detector
->
getN
ame
()][
0
]);
align_correction_rotX
[
detector
->
getN
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotX
[
detector
->
getN
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotX
[
detector
->
getN
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationY_"
+
detector
->
getN
ame
();
align_correction_rotY
[
detector
->
getN
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotY
[
detector
->
getN
ame
()].
size
()),
&
iterations
[
0
],
&
rotY
[
detector
->
getN
ame
()][
0
]);
align_correction_rotY
[
detector
->
getN
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotY
[
detector
->
getN
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotY
[
detector
->
getN
ame
()]
->
Write
(
name
.
c_str
());
name
=
"alignment_correction_rotationZ_"
+
detector
->
getN
ame
();
align_correction_rotZ
[
detector
->
getN
ame
()]
=
new
TGraph
(
static_cast
<
int
>
(
rotZ
[
detector
->
getN
ame
()].
size
()),
&
iterations
[
0
],
&
rotZ
[
detector
->
getN
ame
()][
0
]);
align_correction_rotZ
[
detector
->
getN
ame
()]
->
GetXaxis
()
->
SetTitle
(
"# iteration"
);
align_correction_rotZ
[
detector
->
getN
ame
()]
->
GetYaxis
()
->
SetTitle
(
"correction [deg]"
);
align_correction_rotZ
[
detector
->
getN
ame
()]
->
Write
(
name
.
c_str
());
}
}
src/modules/AnalysisDUT/AnalysisDUT.cpp
View file @
a7fb323d
...
...
@@ -115,12 +115,12 @@ void AnalysisDUT::initialise() {
new
TH1F
(
"clusterWidthColAssociated"
,
"clusterWidthColAssociated;cluster size col; # entries"
,
30
,
0
,
30
);
// In-pixel studies:
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
p
itch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
p
itch
().
Y
(),
"um"
));
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
getP
itch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
getP
itch
().
Y
(),
"um"
));
std
::
string
mod_axes
=
"in-pixel x_{track} [#mum];in-pixel y_{track} [#mum];"
;
// cut flow histogram
std
::
string
title
=
m_detector
->
n
ame
()
+
": number of tracks discarded by different cuts;cut type;tracks"
;
std
::
string
title
=
m_detector
->
getN
ame
()
+
": number of tracks discarded by different cuts;cut type;tracks"
;
hCutHisto
=
new
TH1F
(
"hCutHisto"
,
title
.
c_str
(),
4
,
1
,
5
);
hCutHisto
->
GetXaxis
()
->
SetBinLabel
(
1
,
"High Chi2"
);
hCutHisto
->
GetXaxis
()
->
SetBinLabel
(
2
,
"Outside DUT area"
);
...
...
src/modules/AnalysisEfficiency/AnalysisEfficiency.cpp
View file @
a7fb323d
...
...
@@ -30,16 +30,16 @@ void AnalysisEfficiency::initialise() {
hPixelEfficiency
=
new
TH1D
(
"hPixelEfficiency"
,
"hPixelEfficiency; single pixel efficiency; # entries"
,
201
,
0
,
1.005
);
// get 0.5%-wide bins
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
p
itch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
p
itch
().
Y
(),
"um"
));
auto
pitch_x
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
getP
itch
().
X
(),
"um"
));
auto
pitch_y
=
static_cast
<
double
>
(
Units
::
convert
(
m_detector
->
getP
itch
().
Y
(),
"um"
));
auto
nbins_x
=
static_cast
<
int
>
(
std
::
ceil
(
m_detector
->
p
itch
().
X
()
/
m_inpixelBinSize
));
auto
nbins_y
=
static_cast
<
int
>
(
std
::
ceil
(
m_detector
->
p
itch
().
Y
()
/
m_inpixelBinSize
));
auto
nbins_x
=
static_cast
<
int
>
(
std
::
ceil
(
m_detector
->
getP
itch
().
X
()
/
m_inpixelBinSize
));
auto
nbins_y
=
static_cast
<
int
>
(
std
::
ceil
(
m_detector
->
getP
itch
().
Y
()
/
m_inpixelBinSize
));
if
(
nbins_x
>
1e4
||
nbins_y
>
1e4
)
{
throw
InvalidValueError
(
m_config
,
"inpixel_bin_size"
,
"Too many bins for in-pixel histograms."
);
}
std
::
string
title
=
m_detector
->
n
ame
()
+
" Pixel efficiency map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;efficiency"
;
m_detector
->
getN
ame
()
+
" Pixel efficiency map;in-pixel x_{track} [#mum];in-pixel y_{track} #mum;efficiency"
;
hPixelEfficiencyMap_trackPos
=
new
TProfile2D
(
"pixelEfficiencyMap_trackPos"
,
title
.
c_str
(),
nbins_x
,
...
...
@@ -50,7 +50,7 @@ void AnalysisEfficiency::initialise() {
pitch_y
/
2.
,
0
,
1
);
title
=
m_detector
->
n
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
title
=
m_detector
->
getN
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
hChipEfficiencyMap_trackPos
=
new
TProfile2D
(
"chipEfficiencyMap_trackPos"
,
title
.
c_str
(),
m_detector
->
nPixels
().
X
(),
...
...
@@ -61,18 +61,18 @@ void AnalysisEfficiency::initialise() {
m_detector
->
nPixels
().
Y
()
-
0.5
,
0
,
1
);
title
=
m_detector
->
n
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
title
=
m_detector
->
getN
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
hGlobalEfficiencyMap_trackPos
=
new
TProfile2D
(
"globalEfficiencyMap_trackPos"
,
title
.
c_str
(),
300
,
-
1.5
*
m_detector
->
s
ize
().
X
(),
1.5
*
m_detector
->
s
ize
().
X
(),
-
1.5
*
m_detector
->
getS
ize
().
X
(),
1.5
*
m_detector
->
getS
ize
().
X
(),
300
,
-
1.5
*
m_detector
->
s
ize
().
Y
(),
1.5
*
m_detector
->
s
ize
().
Y
(),
-
1.5
*
m_detector
->
getS
ize
().
Y
(),
1.5
*
m_detector
->
getS
ize
().
Y
(),
0
,
1
);
title
=
m_detector
->
n
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
title
=
m_detector
->
getN
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
hChipEfficiencyMap_clustPos
=
new
TProfile2D
(
"chipEfficiencyMap_clustPos"
,
title
.
c_str
(),
m_detector
->
nPixels
().
X
(),
...
...
@@ -83,25 +83,25 @@ void AnalysisEfficiency::initialise() {
m_detector
->
nPixels
().
Y
()
-
0.5
,
0
,
1
);
title
=
m_detector
->
n
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
title
=
m_detector
->
getN
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
hGlobalEfficiencyMap_clustPos
=
new
TProfile2D
(
"globalEfficiencyMap_clustPos"
,
title
.
c_str
(),
300
,
-
1.5
*
m_detector
->
s
ize
().
X
(),
1.5
*
m_detector
->
s
ize
().
X
(),
-
1.5
*
m_detector
->
getS
ize
().
X
(),
1.5
*
m_detector
->
getS
ize
().
X
(),
300
,
-
1.5
*
m_detector
->
s
ize
().
Y
(),
1.5
*
m_detector
->
s
ize
().
Y
(),
-
1.5
*
m_detector
->
getS
ize
().
Y
(),
1.5
*
m_detector
->
getS
ize
().
Y
(),
0
,
1
);
hDistanceCluster_track
=
new
TH2D
(
"distanceTrack_Hit"
,
"distance between track and hit; track_x - dut_x [mm]; track_y - dut_y [mm] "
,
150
,
-
1.5
*
m_detector
->
p
itch
().
x
(),
1.5
*
m_detector
->
p
itch
().
x
(),
-
1.5
*
m_detector
->
getP
itch
().
x
(),
1.5
*
m_detector
->
getP
itch
().
x
(),
150
,
-
1.5
*
m_detector
->
p
itch
().
y
(),
1.5
*
m_detector
->
p
itch
().
y
());
-
1.5
*
m_detector
->
getP
itch
().
y
(),
1.5
*
m_detector
->
getP
itch
().
y
());
eTotalEfficiency
=
new
TEfficiency
(
"eTotalEfficiency"
,
"totalEfficiency; axis has no meaning; total chip efficiency"
,
1
,
0
,
1
);
totalEfficiency
=
new
TNamed
(
"totalEffiency"
,
"totalEffiency"
);
...
...
@@ -111,11 +111,11 @@ void AnalysisEfficiency::initialise() {
hTrackTimeToPrevHit_notmatched
=
new
TH1D
(
"trackTimeToPrevHit_notmatched"
,
"trackTimeToPrevHit_notmatched;time to prev hit [us];# events"
,
1e6
,
0
,
1e6
);
title
=
m_detector
->
n
ame
()
+
"time difference to previous track (if this has assoc cluster)"
;
title
=
m_detector
->
getN
ame
()
+
"time difference to previous track (if this has assoc cluster)"
;
hTimeDiffPrevTrack_assocCluster
=
new
TH1D
(
"timeDiffPrevTrack_assocCluster"
,
title
.
c_str
(),
11000
,
-
1000
,
10000
);
hTimeDiffPrevTrack_assocCluster
->
GetXaxis
()
->
SetTitle
(
"time diff [#mus]"
);
hTimeDiffPrevTrack_assocCluster
->
GetYaxis
()
->
SetTitle
(
"events"
);
title
=
m_detector
->
n
ame
()
+
"time difference to previous track (if this has no assoc cluster)"
;
title
=
m_detector
->
getN
ame
()
+
"time difference to previous track (if this has no assoc cluster)"
;
hTimeDiffPrevTrack_noAssocCluster
=
new
TH1D
(
"timeDiffPrevTrack_noAssocCluster"
,
title
.
c_str
(),
11000
,
-
1000
,
10000
);
hTimeDiffPrevTrack_noAssocCluster
->
GetXaxis
()
->
SetTitle
(
"time diff [#mus]"
);
hTimeDiffPrevTrack_noAssocCluster
->
GetYaxis
()
->
SetTitle
(
"events"
);
...
...
@@ -256,7 +256,7 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
auto
ymod
=
static_cast
<
double
>
(
Units
::
convert
(
inpixel
.
Y
(),
"um"
));
// Get the DUT clusters from the clipboard
auto
clusters
=
clipboard
->
getData
<
Cluster
>
(
m_detector
->
n
ame
());
auto
clusters
=
clipboard
->
getData
<
Cluster
>
(
m_detector
->
getN
ame
());
if
(
clusters
==
nullptr
)
{
LOG
(
DEBUG
)
<<
" - no DUT clusters"
;
}
else
{
...
...
@@ -329,9 +329,9 @@ StatusCode AnalysisEfficiency::run(std::shared_ptr<Clipboard> clipboard) {
// Before going to the next event, loop over all pixels (all hits incl. noise)
// and fill matrix with timestamps of previous pixels.
auto
pixels
=
clipboard
->
getData
<
Pixel
>
(
m_detector
->
n
ame
());
auto
pixels
=
clipboard
->
getData
<
Pixel
>
(
m_detector
->
getN
ame
());
if
(
pixels
==
nullptr
)
{
LOG
(
DEBUG
)
<<
"Detector "
<<
m_detector
->
n
ame
()
<<
" does not have any pixels on the clipboard"
;
LOG
(
DEBUG
)
<<
"Detector "
<<
m_detector
->
getN
ame
()
<<
" does not have any pixels on the clipboard"
;