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
MeasurementCalibration.cpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MeasurementCalibration.cpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2023 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#include "
Acts/EventData/SourceLink.hpp
"
10
#include "
ActsExamples/EventData/IndexSourceLink.hpp
"
11
#include "
ActsExamples/EventData/Measurement.hpp
"
12
#include <
ActsExamples/EventData/MeasurementCalibration.hpp
>
13
14
#include <cassert>
15
#include <variant>
16
17
namespace
Acts {
18
class
VectorMultiTrajectory;
19
}
// namespace Acts
20
21
void
ActsExamples::PassThroughCalibrator::calibrate
(
22
const
MeasurementContainer
& measurements,
23
const
ClusterContainer
*
/*clusters*/
,
const
Acts::GeometryContext
&
/*gctx*/
,
24
const
Acts::CalibrationContext
&
/*cctx*/
,
25
const
Acts::SourceLink
& sourceLink,
26
Acts::VectorMultiTrajectory::TrackStateProxy
& trackState)
const
{
27
trackState.
setUncalibratedSourceLink
(sourceLink);
28
const
IndexSourceLink
& idxSourceLink = sourceLink.
get
<
IndexSourceLink
>();
29
30
assert
((idxSourceLink.
index
() < measurements.size()) and
31
"Source link index is outside the container bounds"
);
32
33
std::visit(
34
[&trackState](
const
auto
& meas) {
35
trackState.
allocateCalibrated
(meas.size());
36
trackState.
setCalibrated
(meas);
37
},
38
(measurements)[idxSourceLink.
index
()]);
39
}
40
41
ActsExamples::MeasurementCalibratorAdapter::MeasurementCalibratorAdapter
(
42
const
MeasurementCalibrator
& calibrator,
43
const
MeasurementContainer
& measurements,
const
ClusterContainer
*
clusters
)
44
: m_calibrator{calibrator},
45
m_measurements
{measurements},
46
m_clusters{
clusters
} {}
47
48
void
ActsExamples::MeasurementCalibratorAdapter::calibrate
(
49
const
Acts::GeometryContext
&
gctx
,
const
Acts::CalibrationContext
& cctx,
50
const
Acts::SourceLink
& sourceLink,
51
Acts::VectorMultiTrajectory::TrackStateProxy
trackState)
const
{
52
return
m_calibrator.calibrate(
m_measurements
, m_clusters, gctx, cctx,
53
sourceLink, trackState);
54
}
acts
blob
sPHENIX
Examples
Framework
src
EventData
MeasurementCalibration.cpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration