ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsDataPreparation
src
CorePixelSpacePointFormationTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
CorePixelSpacePointFormationTool.h
"
6
7
#include "Acts/SpacePointFormation/PixelSpacePointBuilder.hpp"
8
#include "Acts/Surfaces/Surface.hpp"
9
10
#include "
xAODMeasurementBase/UncalibratedMeasurementContainer.h
"
11
12
namespace
ActsTrk
{
13
14
StatusCode
CorePixelSpacePointFormationTool::initialize
()
15
{
16
ATH_CHECK
(
m_trackingGeometrySvc
.retrieve());
17
m_surfaceAccessor
=
ActsTrk::detail::xAODUncalibMeasSurfAcc
(
m_trackingGeometrySvc
.get());
18
19
return
StatusCode::SUCCESS;
20
}
21
22
StatusCode
23
CorePixelSpacePointFormationTool::producePixelSpacePoint
(
const
EventContext& ctx,
24
const
Acts::GeometryContext& gctx,
25
const
xAOD::PixelCluster
& cluster,
26
xAOD::SpacePoint
&
sp
,
27
const
InDetDD::SiDetectorElement
&
/*element*/
)
const
28
{
29
const
xAOD::DetectorIDHashType
idHash = cluster.
identifierHash
();
30
// The accessor is a call into libxAODInDetMeasurement, and the space point
31
// is filled with the same position the variances are computed from.
32
const
auto
globalPosition = cluster.
globalPosition
();
33
const
Acts::SquareMatrix2 localCov = cluster.
localCovariance
<2>().cast<double>();
34
35
// Clusters come grouped by module: look up the surface only when the module changes.
36
auto
lookupReferenceFrame = [
this
, &gctx, &cluster, idHash](Acts::RotationMatrix3& rot) -> StatusCode {
37
const
Acts::Surface* surface =
m_surfaceAccessor
.get(&cluster);
38
if
(surface ==
nullptr
) {
39
ATH_MSG_FATAL
(
"No ACTS surface for pixel cluster with identifier hash "
<< idHash);
40
return
StatusCode::FAILURE;
41
}
42
// Position and direction are unused by plane and disc surfaces
43
rot = surface->referenceFrame(gctx, Acts::Vector3::Zero(), Acts::Vector3::Zero());
44
return
StatusCode::SUCCESS;
45
};
46
47
// Returned in the order (z, r)
48
Acts::Vector2 variance;
49
if
(
m_useSurfaceCache
) {
50
SurfaceCache
& cache = *m_surfaceCache.get(ctx);
51
if
(cache.idHash != idHash or cache.evt != ctx.evt()) {
52
// Key updated only on success, so a failed look-up leaves no stale frame.
53
ATH_CHECK
( lookupReferenceFrame(cache.rotLocalToGlobal) );
54
cache.idHash = idHash;
55
cache.evt = ctx.evt();
56
}
57
variance = Acts::PixelSpacePointBuilder::computeVarianceZR(cache.rotLocalToGlobal,
58
globalPosition.cast<
double
>(), localCov);
59
}
else
{
60
Acts::RotationMatrix3 rotLocalToGlobal;
61
rotLocalToGlobal.setZero();
62
ATH_CHECK
( lookupReferenceFrame(rotLocalToGlobal) );
63
variance = Acts::PixelSpacePointBuilder::computeVarianceZR(rotLocalToGlobal,
64
globalPosition.cast<
double
>(), localCov);
65
}
66
67
sp
.setSpacePoint(idHash,
68
globalPosition,
69
static_cast<
float
>
(variance[1]),
70
static_cast<
float
>
(variance[0]),
71
std::vector< const xAOD::UncalibratedMeasurement* >({&cluster}));
72
73
return
StatusCode::SUCCESS;
74
}
75
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
CorePixelSpacePointFormationTool.h
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
UncalibratedMeasurementContainer.h
ActsTrk::CorePixelSpacePointFormationTool::initialize
virtual StatusCode initialize() override
Definition
CorePixelSpacePointFormationTool.cxx:14
ActsTrk::CorePixelSpacePointFormationTool::m_trackingGeometrySvc
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Definition
CorePixelSpacePointFormationTool.h:49
ActsTrk::CorePixelSpacePointFormationTool::m_useSurfaceCache
Gaudi::Property< bool > m_useSurfaceCache
Definition
CorePixelSpacePointFormationTool.h:62
ActsTrk::CorePixelSpacePointFormationTool::producePixelSpacePoint
virtual StatusCode producePixelSpacePoint(const EventContext &ctx, const Acts::GeometryContext &gctx, const xAOD::PixelCluster &cluster, xAOD::SpacePoint &sp, const InDetDD::SiDetectorElement &element) const override
Definition
CorePixelSpacePointFormationTool.cxx:23
ActsTrk::CorePixelSpacePointFormationTool::m_surfaceAccessor
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfaceAccessor
Definition
CorePixelSpacePointFormationTool.h:51
ActsTrk::detail::xAODUncalibMeasSurfAcc
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
Definition
xAODUncalibMeasSurfAcc.h:22
InDetDD::SiDetectorElement
Class to hold geometrical description of a silicon detector element.
Definition
SiDetectorElement.h:109
xAOD::PixelCluster_v1::globalPosition
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
Definition
PixelCluster_v1.cxx:16
xAOD::UncalibratedMeasurement_v1::localCovariance
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
xAOD::SpacePoint
SpacePoint_v1 SpacePoint
Definition
Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/SpacePoint.h:12
xAOD::PixelCluster
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
Definition
Event/xAOD/xAODInDetMeasurement/xAODInDetMeasurement/PixelCluster.h:13
xAOD::DetectorIDHashType
unsigned int DetectorIDHashType
@ detector ID element hash
Definition
MeasurementDefs.h:48
ActsTrk::CorePixelSpacePointFormationTool::SurfaceCache
Reference frame of the last module seen, keyed on the identifier hash and stamped with the event so a...
Definition
CorePixelSpacePointFormationTool.h:55
Generated on
for ATLAS Offline Software by
1.17.0