ATLAS Offline Software
InnerDetector
InDetRecEvent
InDetRIO_OnTrack
src
TRTRIO_OnTrackErrorScaling.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h
"
5
#include <iostream>
6
7
const
char
*
const
TRTRIO_OnTrackErrorScaling::s_names
[
TRTRIO_OnTrackErrorScaling::kNParamTypes
]={
8
"TRT Barrel"
,
9
"TRT Endcap"
10
};
11
12
namespace
{
13
inline
double
square(
double
a
) {
return
a
*
a
; }
14
}
15
16
CLID
TRTRIO_OnTrackErrorScaling::clid
()
const
{
17
return
ClassID_traits<CondCont<TRTRIO_OnTrackErrorScaling>
>
::ID
();
18
}
19
20
bool
TRTRIO_OnTrackErrorScaling::postProcess
() {
21
if
(
params
().
size
() !=
kNParamTypes
) {
22
std::stringstream
message
;
23
message
<<
" TRTRIO_OnTrackErrorScaling: Expecting parameters for et least 2 parameters for"
;
24
for
(
const
auto
*s_name :
s_names
) {
25
message
<<
" "
<< s_name;
26
}
27
message
<<
"("
<<
kNParamTypes
<<
") for run2."
;
28
message
<<
" But got "
<<
params
().size() <<
"."
;
29
throw
std::runtime_error(
message
.str() );
30
}
31
for
(
unsigned
int
idx
=0;
idx
<
params
().size(); ++
idx
) {
32
if
(
params
()[
idx
].size() != 3) {
33
if
(
params
()[
idx
].size() == 2) {
34
params
()[
idx
].push_back(0.);
35
}
36
else
{
37
assert(
idx
<
kNParamTypes
);
38
std::stringstream
message
;
39
message
<<
" TRTRIO_OnTrackErrorScaling: Expected 2 or 3 parameters for "
<<
s_names
[
idx
] <<
" but got "
<<
params
()[
idx
].size()
40
<<
"."
;
41
throw
std::runtime_error(
message
.str() );
42
}
43
}
44
}
45
return
true
;
46
}
47
48
Amg::MatrixX
TRTRIO_OnTrackErrorScaling::getScaledCovariance
(
Amg::MatrixX
&& cov_input,
49
bool
is_endcap,
50
double
mu
)
const
51
{
52
Amg::MatrixX
newCov = std::move(cov_input);
53
double
a
= (is_endcap) ?
params
()[
kEndcap
][0] :
params
()[
kBarrel
][0];
54
double
b
= (is_endcap) ?
params
()[
kEndcap
][1] :
params
()[
kBarrel
][1];
55
double
c
= (is_endcap) ?
params
()[
kEndcap
][2] :
params
()[
kBarrel
][2];
56
newCov(0,0) *= square(
a
);
57
newCov(0,0) += square(
b
);
58
newCov(0,0) *= (1. +
mu
*
c
);
59
return
newCov;
60
}
61
62
TRTRIO_OnTrackErrorScaling::kEndcap
@ kEndcap
Definition:
TRTRIO_OnTrackErrorScaling.h:21
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition:
EventPrimitives.h:27
ID
std::vector< Identifier > ID
Definition:
CalibHitIDCheck.h:24
TRTRIO_OnTrackErrorScaling::kBarrel
@ kBarrel
Definition:
TRTRIO_OnTrackErrorScaling.h:20
ReweightUtils.message
message
Definition:
ReweightUtils.py:15
python.setupRTTAlg.size
int size
Definition:
setupRTTAlg.py:39
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition:
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
TRTRIO_OnTrackErrorScaling::kNParamTypes
@ kNParamTypes
Definition:
TRTRIO_OnTrackErrorScaling.h:22
CLID
uint32_t CLID
The Class ID type.
Definition:
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
plotBeamSpotMon.b
b
Definition:
plotBeamSpotMon.py:77
TRTRIO_OnTrackErrorScaling::clid
virtual CLID clid() const override final
Definition:
TRTRIO_OnTrackErrorScaling.cxx:16
TRTRIO_OnTrackErrorScaling::postProcess
virtual bool postProcess() override final
Definition:
TRTRIO_OnTrackErrorScaling.cxx:20
a
TList * a
Definition:
liststreamerinfos.cxx:10
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition:
LArNewCalib_DelayDump_OFC_Cali.py:69
TRTRIO_OnTrackErrorScaling::getScaledCovariance
Amg::MatrixX getScaledCovariance(Amg::MatrixX &&cov_input, bool is_endcap, double mu) const
Definition:
TRTRIO_OnTrackErrorScaling.cxx:48
TRTRIO_OnTrackErrorScaling.h
RIO_OnTrackErrorScaling::params
std::vector< std::vector< double > > & params()
Definition:
RIO_OnTrackErrorScaling.h:29
TRTRIO_OnTrackErrorScaling::s_names
static const char *const s_names[kNParamTypes]
Definition:
TRTRIO_OnTrackErrorScaling.h:30
CaloNoise_fillDB.mu
mu
Definition:
CaloNoise_fillDB.py:53
python.compressB64.c
def c
Definition:
compressB64.py:93
Generated on Thu Nov 7 2024 21:31:01 for ATLAS Offline Software by
1.8.18