Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
Calibrator.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Calibrator.cc
1
#include "
Calibrator.h
"
2
3
void
Calibrator::calibrate
(
const
Calibrator::MeasurementContainer
& measurements,
4
const
Acts::GeometryContext
&
gctx
,
5
const
Acts::CalibrationContext
&,
6
const
Acts::SourceLink
& sourceLink,
7
Acts::VectorMultiTrajectory::TrackStateProxy
& trackState)
const
8
{
9
trackState.
setUncalibratedSourceLink
(sourceLink);
10
const
ActsSourceLink
sl = sourceLink.
get
<
ActsSourceLink
>();
11
const
ActsSourceLink::Index
index
= sl.
index
();
12
std::visit(
13
[&](
const
auto
& uncalibmeas)
14
{
15
std::array<Acts::BoundIndices, 2> indices;
16
indices[0] =
Acts::BoundIndices::eBoundLoc0
;
17
indices[1] =
Acts::BoundIndices::eBoundLoc1
;
18
19
Acts::ActsVector<2>
loc
;
20
loc
(0) = uncalibmeas.parameters()[
Acts::eBoundLoc0
];
21
loc
(1) = uncalibmeas.parameters()[
Acts::eBoundLoc1
];
22
23
auto
cov
= uncalibmeas.covariance();
24
const
TrkrDefs::cluskey
cluskey
= sl.
cluskey
();
25
const
uint8_t
layer
=
TrkrDefs::getLayer
(cluskey);
26
const
double
misalignmentFactor = gctx.get<
alignmentTransformationContainer
*>()->getMisalignmentFactor(layer);
27
28
Acts::ActsSquareMatrix<2>
expandedCov =
Acts::ActsSquareMatrix<2>::Zero
();
29
30
for
(
int
i
= 0;
i
<
cov
.rows();
i
++)
31
{
32
for
(
int
j
= 0;
j
<
cov
.cols();
j
++)
33
{
34
expandedCov(
i
,
j
) =
cov
(
i
,
j
) * misalignmentFactor;
35
}
36
}
37
38
Acts::Measurement<Acts::BoundIndices, 2>
meas(sourceLink,
39
indices,
40
loc, expandedCov);
41
42
trackState.
allocateCalibrated
(meas.
size
());
43
trackState.
setCalibrated
(meas);
44
},
45
(measurements)[index]);
46
}
47
48
void
CalibratorAdapter::calibrate
(
49
const
Acts::GeometryContext
&
gctx
,
50
const
Acts::CalibrationContext
& cctx,
51
const
Acts::SourceLink
& sourceLink,
52
Acts::VectorMultiTrajectory::TrackStateProxy
trackState)
const
53
{
54
return
m_calibrator
.
calibrate
(
m_measurements
,
55
gctx,
56
cctx,
57
sourceLink,
58
trackState);
59
}
coresoftware
blob
master
offline
packages
trackbase
Calibrator.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:08
using
1.8.2 with
sPHENIX GitHub integration