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
d1588bd7
Commit
d1588bd7
authored
Mar 24, 2020
by
Jin Zhang
Browse files
disentangle rename function
parent
2ff73139
Changes
34
Hide whitespace changes
Inline
Side-by-side
src/core/detector/Detector.cpp
View file @
d1588bd7
...
...
@@ -86,26 +86,26 @@ double Detector::getTimeResolution() const {
}
}
std
::
string
Detector
::
N
ame
()
const
{
std
::
string
Detector
::
n
ame
()
const
{
return
m_detectorName
;
}
std
::
string
Detector
::
T
ype
()
const
{
std
::
string
Detector
::
t
ype
()
const
{
return
m_detectorType
;
}
std
::
string
Detector
::
C
oordinate
()
const
{
std
::
string
Detector
::
c
oordinate
()
const
{
return
m_detectorCoordinate
;
}
bool
Detector
::
I
sReference
()
const
{
bool
Detector
::
i
sReference
()
const
{
return
static_cast
<
bool
>
(
m_role
&
DetectorRole
::
REFERENCE
);
}
bool
Detector
::
I
sDUT
()
const
{
bool
Detector
::
i
sDUT
()
const
{
return
static_cast
<
bool
>
(
m_role
&
DetectorRole
::
DUT
);
}
bool
Detector
::
I
sAuxiliary
()
const
{
bool
Detector
::
i
sAuxiliary
()
const
{
return
static_cast
<
bool
>
(
m_role
&
DetectorRole
::
AUXILIARY
);
}
...
...
@@ -121,18 +121,18 @@ void Detector::update() {
Configuration
Detector
::
GetConfiguration
()
const
{
Configuration
config
(
N
ame
());
Configuration
config
(
n
ame
());
config
.
set
(
"type"
,
m_detectorType
);
// Store the role of the detector
std
::
vector
<
std
::
string
>
roles
;
if
(
this
->
I
sDUT
())
{
if
(
this
->
i
sDUT
())
{
roles
.
push_back
(
"dut"
);
}
if
(
this
->
I
sReference
())
{
if
(
this
->
i
sReference
())
{
roles
.
push_back
(
"reference"
);
}
if
(
this
->
I
sAuxiliary
())
{
if
(
this
->
i
sAuxiliary
())
{
roles
.
push_back
(
"auxiliary"
);
}
...
...
@@ -155,7 +155,7 @@ Configuration Detector::GetConfiguration() const {
}
// only if detector is not auxiliary:
if
(
!
this
->
I
sAuxiliary
())
{
if
(
!
this
->
i
sAuxiliary
())
{
this
->
configureDetector
(
config
);
}
...
...
src/core/detector/Detector.hpp
View file @
d1588bd7
...
...
@@ -84,37 +84,37 @@ namespace corryvreckan {
* @brief Get type of the detector
* @return Type of the detector model
*/
std
::
string
T
ype
()
const
;
std
::
string
t
ype
()
const
;
/**
* @brief Get name of the detector
* @return Detector name
*/
std
::
string
N
ame
()
const
;
std
::
string
n
ame
()
const
;
/**
* @brief Get coordinate of the detector
* @return Detector coordinate
*/
std
::
string
C
oordinate
()
const
;
std
::
string
c
oordinate
()
const
;
/**
* @brief Check whether detector is registered as reference
* @return Reference status
*/
bool
I
sReference
()
const
;
bool
i
sReference
()
const
;
/**
* @brief Check whether detector is registered as DUT
* @return DUT status
*/
bool
I
sDUT
()
const
;
bool
i
sDUT
()
const
;
/**
* @brief Check whether detector is registered as auxiliary device and should not parttake in the reconstruction
* @return Auxiliary status
*/
bool
I
sAuxiliary
()
const
;
bool
i
sAuxiliary
()
const
;
/**
* @brief Retrieve configuration object from detector, containing all (potentially updated) parameters
...
...
src/core/detector/PlanarDetector.cpp
View file @
d1588bd7
...
...
@@ -31,7 +31,7 @@ PlanarDetector::PlanarDetector(const Configuration& config) : Detector(config) {
this
->
initialise
();
// Auxiliary devices don't have: number_of_pixels, pixel_pitch, spatial_resolution, mask_file, region-of-interest
if
(
!
I
sAuxiliary
())
{
if
(
!
i
sAuxiliary
())
{
buildAxes
(
config
);
}
}
...
...
@@ -198,7 +198,7 @@ PositionVector3D<Cartesian3D<double>> PlanarDetector::getIntercept(const Track*
// FIXME: this is else statement can only be temporary
if
(
track
->
getType
()
==
"gbl"
)
{
return
track
->
state
(
N
ame
());
return
track
->
state
(
n
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
();
...
...
src/core/detector/exceptions.cpp
View file @
d1588bd7
...
...
@@ -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
->
n
ame
()
+
"' is not valid"
;
if
(
!
reason
.
empty
())
{
error_message_
+=
": "
+
reason
;
}
...
...
src/core/module/Module.cpp
View file @
d1588bd7
...
...
@@ -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
->
n
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
->
n
ame
()
==
name
;
});
if
(
it
==
m_detectors
.
end
())
{
return
false
;
}
...
...
src/core/module/ModuleManager.cpp
View file @
d1588bd7
...
...
@@ -55,7 +55,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
->
n
ame
()
==
name
;
})
!=
m_detectors
.
end
())
{
throw
InvalidValueError
(
global_config
,
"detectors_file"
,
"Detector "
+
detector_section
.
getName
()
+
" defined twice"
);
...
...
@@ -68,12 +68,12 @@ void ModuleManager::load_detectors() {
detector
=
std
::
make_shared
<
PlanarDetector
>
(
detector_section
);
// Check if we already found a reference plane:
if
(
m_reference
!=
nullptr
&&
detector
->
I
sReference
())
{
if
(
m_reference
!=
nullptr
&&
detector
->
i
sReference
())
{
throw
InvalidValueError
(
global_config
,
"detectors_file"
,
"Found more than one reference detector"
);
}
// Switch flag if we found the reference plane:
if
(
detector
->
I
sReference
())
{
if
(
detector
->
i
sReference
())
{
m_reference
=
detector
;
}
...
...
@@ -309,7 +309,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
->
n
ame
()
==
name
;
});
return
(
it
!=
m_detectors
.
end
()
?
(
*
it
)
:
nullptr
);
}
...
...
@@ -403,8 +403,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
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
0
));
// Save the name (to not instantiate it again later)
module_names
.
insert
(
name
);
}
...
...
@@ -427,11 +427,11 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
}
for
(
auto
&
det
:
m_detectors
)
{
auto
detectortype
=
det
->
T
ype
();
auto
detectortype
=
det
->
t
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
->
n
ame
())
!=
module_names
.
end
())
{
continue
;
}
for
(
auto
&
type
:
ctypes
)
{
...
...
@@ -440,8 +440,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
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
1
));
}
}
instances_created
=
!
ctypes
.
empty
();
...
...
@@ -450,8 +450,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
->
n
ame
();
instantiations
.
emplace_back
(
det
,
ModuleIdentifier
(
module_base_name
,
det
->
n
ame
(),
2
));
}
}
...
...
@@ -461,13 +461,13 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
auto
identifier
=
instance
.
second
;
// If this should only be instantiated for DUTs, skip otherwise:
if
(
dut_only
&&
!
detector
->
I
sDUT
())
{
if
(
dut_only
&&
!
detector
->
i
sDUT
())
{
LOG
(
TRACE
)
<<
"Skipping instantiation
\"
"
<<
identifier
.
getUniqueName
()
<<
"
\"
, detector is no DUT"
;
continue
;
}
// Do not instantiate module if detector type is not mentioned as supported:
auto
detectortype
=
detector
->
T
ype
();
auto
detectortype
=
detector
->
t
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"
;
...
...
src/modules/AlignmentDUTResidual/AlignmentDUTResidual.cpp
View file @
d1588bd7
...
...
@@ -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
->
n
ame
()
<<
"
\"
"
;
}
void
AlignmentDUTResidual
::
initialise
()
{
auto
detname
=
m_detector
->
N
ame
();
auto
detname
=
m_detector
->
n
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
->
n
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
->
n
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
->
n
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
->
n
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
->
n
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
->
n
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 @
d1588bd7
...
...
@@ -52,10 +52,10 @@ void AlignmentMillepede::initialise() {
// Renumber the planes in Millepede, ignoring masked planes.
unsigned
int
index
=
0
;
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
continue
;
}
m_millePlanes
[
det
->
N
ame
()]
=
index
;
m_millePlanes
[
det
->
n
ame
()]
=
index
;
++
index
;
}
...
...
@@ -101,11 +101,11 @@ void AlignmentMillepede::finalise() {
size_t
nPlanes
=
num_detectors
();
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
nPlanes
--
;
}
if
(
det
->
I
sAuxiliary
())
{
LOG
(
INFO
)
<<
"Excluding auxiliary detector "
<<
det
->
N
ame
();
if
(
det
->
i
sAuxiliary
())
{
LOG
(
INFO
)
<<
"Excluding auxiliary detector "
<<
det
->
n
ame
();
nPlanes
--
;
}
}
...
...
@@ -176,7 +176,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the mean z-position.
double
avgz
=
0.
;
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
continue
;
}
avgz
+=
det
->
displacement
().
Z
();
...
...
@@ -185,7 +185,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the variance.
double
varz
=
0.0
;
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
continue
;
}
const
double
dz
=
det
->
displacement
().
Z
()
-
avgz
;
...
...
@@ -207,10 +207,10 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
m_constraints
.
clear
();
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
continue
;
}
const
unsigned
int
i
=
m_millePlanes
[
det
->
N
ame
()];
const
unsigned
int
i
=
m_millePlanes
[
det
->
n
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
->
n
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.
...
...
@@ -584,16 +584,16 @@ bool AlignmentMillepede::fitTrack(const std::vector<Equation>& equations,
void
AlignmentMillepede
::
updateGeometry
()
{
auto
nPlanes
=
num_detectors
();
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
nPlanes
--
;
}
}
for
(
const
auto
&
det
:
get_detectors
())
{
if
(
det
->
I
sDUT
()
&&
m_excludeDUT
)
{
if
(
det
->
i
sDUT
()
&&
m_excludeDUT
)
{
continue
;
}
auto
plane
=
m_millePlanes
[
det
->
N
ame
()];
auto
plane
=
m_millePlanes
[
det
->
n
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 @
d1588bd7
...
...
@@ -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
->
n
ame
()
!=
trackCluster
->
detectorID
())
{
continue
;
}
...
...
@@ -165,10 +165,10 @@ void AlignmentTrackChi2::finalise() {
int
det
=
0
;
for
(
auto
&
detector
:
get_detectors
())
{
string
detectorID
=
detector
->
N
ame
();
string
detectorID
=
detector
->
n
ame
();
// Do not align the reference plane
if
(
detector
->
I
sReference
()
||
detector
->
I
sDUT
()
||
detector
->
I
sAuxiliary
())
{
if
(
detector
->
i
sReference
()
||
detector
->
i
sDUT
()
||
detector
->
i
sAuxiliary
())
{
continue
;
}
...
...
@@ -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
->
n
ame
()
<<
"/"
<<
iteration
<<
" dT"
<<
Units
::
display
(
detector
->
displacement
()
-
old_position
,
{
"mm"
,
"um"
})
<<
" dR"
<<
Units
::
display
(
detector
->
rotation
()
-
old_orientation
,
{
"deg"
});
...
...
@@ -260,11 +260,11 @@ void AlignmentTrackChi2::finalise() {
// Now list the new alignment parameters
for
(
auto
&
detector
:
get_detectors
())
{
// Do not align the reference plane
if
(
detector
->
I
sReference
()
||
detector
->
I
sDUT
()
||
detector
->
I
sAuxiliary
())
{
if
(
detector
->
i
sReference
()
||
detector
->
i
sDUT
()
||
detector
->
i
sAuxiliary
())
{
continue
;
}
LOG
(
STATUS
)
<<
detector
->
N
ame
()
<<
" new alignment: "
<<
std
::
endl
LOG
(
STATUS
)
<<
detector
->
n
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
->
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
());
}
}
src/modules/AnalysisDUT/AnalysisDUT.cpp
View file @
d1588bd7
...
...
@@ -120,7 +120,7 @@ void AnalysisDUT::initialise() {
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
->
n
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 @
d1588bd7
...
...
@@ -39,7 +39,7 @@ void AnalysisEfficiency::initialise() {
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
->
n
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
->
n
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
hChipEfficiencyMap_trackPos
=
new
TProfile2D
(
"chipEfficiencyMap_trackPos"
,
title
.
c_str
(),
m_detector
->
nPixels
().
X
(),
...
...
@@ -61,7 +61,7 @@ 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
->
n
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
hGlobalEfficiencyMap_trackPos
=
new
TProfile2D
(
"globalEfficiencyMap_trackPos"
,
title
.
c_str
(),
300
,
...
...
@@ -72,7 +72,7 @@ void AnalysisEfficiency::initialise() {
1.5
*
m_detector
->
size
().
Y
(),
0
,
1
);
title
=
m_detector
->
N
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
title
=
m_detector
->
n
ame
()
+
" Chip efficiency map;x [px];y [px];efficiency"
;
hChipEfficiencyMap_clustPos
=
new
TProfile2D
(
"chipEfficiencyMap_clustPos"
,
title
.
c_str
(),
m_detector
->
nPixels
().
X
(),
...
...
@@ -83,7 +83,7 @@ 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
->
n
ame
()
+
" Global efficiency map;x [mm];y [mm];efficiency"
;
hGlobalEfficiencyMap_clustPos
=
new
TProfile2D
(
"globalEfficiencyMap_clustPos"
,
title
.
c_str
(),
300
,
...
...
@@ -111,11 +111,11 @@ void AnalysisEfficiency::initialise() {
hTrackTimeToPrevHit_notmatched
=
new
TH1D
(
"trackTimeToPrevHit_notmatched"
,
"trackTimeToPrevHit_notmatched;time to prev hit [us];# events"
,
1e6
,
0
,
1e6
);