ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::CorePixelSpacePointFormationTool Class Reference

Pixel space point formation using Acts::PixelSpacePointBuilder for the space point covariance. More...

#include <CorePixelSpacePointFormationTool.h>

Inheritance diagram for ActsTrk::CorePixelSpacePointFormationTool:
Collaboration diagram for ActsTrk::CorePixelSpacePointFormationTool:

Classes

struct  SurfaceCache
 Reference frame of the last module seen, keyed on the identifier hash and stamped with the event so an alignment change cannot go stale. More...

Public Member Functions

virtual ~CorePixelSpacePointFormationTool ()=default
virtual StatusCode initialize () override
virtual StatusCode producePixelSpacePoint (const EventContext &ctx, const Acts::GeometryContext &gctx, const xAOD::PixelCluster &cluster, xAOD::SpacePoint &sp, const InDetDD::SiDetectorElement &element) const override
virtual bool usesGeometryContext () const override

Private Attributes

ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfaceAccessor {}
SG::SlotSpecificObj< SurfaceCache > m_surfaceCache ATLAS_THREAD_SAFE
Gaudi::Property< bool > m_useSurfaceCache
Gaudi::Property< bool > m_useMaxVariance {this, "UseMaxVariance", false}
 Cap the covariance terms, as PixelSpacePointFormationTool does.
Gaudi::Property< float > m_maxVarianceZ {this, "MaxVarianceZ", 0.0014f}
Gaudi::Property< float > m_maxVarianceR {this, "MaxVarianceR", 0.015f}

Detailed Description

Pixel space point formation using Acts::PixelSpacePointBuilder for the space point covariance.

The position is still the cluster global position.

Not equivalent to PixelSpacePointFormationTool: ACTS projects the cluster local covariance to (z, r) with no inflation by the cluster width.

Definition at line 32 of file CorePixelSpacePointFormationTool.h.

Constructor & Destructor Documentation

◆ ~CorePixelSpacePointFormationTool()

virtual ActsTrk::CorePixelSpacePointFormationTool::~CorePixelSpacePointFormationTool ( )
virtualdefault

Member Function Documentation

◆ initialize()

StatusCode ActsTrk::CorePixelSpacePointFormationTool::initialize ( )
overridevirtual

Definition at line 16 of file CorePixelSpacePointFormationTool.cxx.

17 {
19 m_surfaceAccessor = ActsTrk::detail::xAODUncalibMeasSurfAcc(m_trackingGeometrySvc.get());
20
21 return StatusCode::SUCCESS;
22 }
#define ATH_CHECK
Evaluate an expression and check for errors.
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfaceAccessor

◆ producePixelSpacePoint()

StatusCode ActsTrk::CorePixelSpacePointFormationTool::producePixelSpacePoint ( const EventContext & ctx,
const Acts::GeometryContext & gctx,
const xAOD::PixelCluster & cluster,
xAOD::SpacePoint & sp,
const InDetDD::SiDetectorElement & element ) const
overridevirtual

Definition at line 25 of file CorePixelSpacePointFormationTool.cxx.

30 {
31 const xAOD::DetectorIDHashType idHash = cluster.identifierHash();
32 // The accessor is a call into libxAODInDetMeasurement, and the space point
33 // is filled with the same position the variances are computed from.
34 const auto globalPosition = cluster.globalPosition();
35 const Acts::SquareMatrix2 localCov = cluster.localCovariance<2>().cast<double>();
36
37 // Clusters come grouped by module: look up the surface only when the module changes.
38 auto lookupReferenceFrame = [this, &gctx, &cluster, idHash](Acts::RotationMatrix3& rot) -> StatusCode {
39 const Acts::Surface* surface = m_surfaceAccessor.get(&cluster);
40 if (surface == nullptr) {
41 ATH_MSG_FATAL("No ACTS surface for pixel cluster with identifier hash " << idHash);
42 return StatusCode::FAILURE;
43 }
44 // Position and direction are unused by plane and disc surfaces
45 rot = surface->referenceFrame(gctx, Acts::Vector3::Zero(), Acts::Vector3::Zero());
46 return StatusCode::SUCCESS;
47 };
48
49 // Returned in the order (z, r)
50 Acts::Vector2 variance;
52 SurfaceCache& cache = *m_surfaceCache.get(ctx);
53 if (cache.idHash != idHash or cache.evt != ctx.evt()) {
54 // Key updated only on success, so a failed look-up leaves no stale frame.
55 ATH_CHECK( lookupReferenceFrame(cache.rotLocalToGlobal) );
56 cache.idHash = idHash;
57 cache.evt = ctx.evt();
58 }
59 variance = Acts::PixelSpacePointBuilder::computeVarianceZR(cache.rotLocalToGlobal,
60 globalPosition.cast<double>(), localCov);
61 } else {
62 Acts::RotationMatrix3 rotLocalToGlobal;
63 ATH_CHECK( lookupReferenceFrame(rotLocalToGlobal) );
64 variance = Acts::PixelSpacePointBuilder::computeVarianceZR(rotLocalToGlobal,
65 globalPosition.cast<double>(), localCov);
66 }
67
68 float cov_z = static_cast<float>(variance[0]);
69 float cov_r = static_cast<float>(variance[1]);
70
71 if (m_useMaxVariance) {
72 cov_z = std::min(cov_z, m_maxVarianceZ.value());
73 cov_r = std::min(cov_r, m_maxVarianceR.value());
74 }
75
76 sp.setSpacePoint(idHash,
77 globalPosition,
78 cov_r,
79 cov_z,
80 std::vector< const xAOD::UncalibratedMeasurement* >({&cluster}));
81
82 return StatusCode::SUCCESS;
83 }
#define ATH_MSG_FATAL(x,...)
static Double_t sp
Gaudi::Property< bool > m_useMaxVariance
Cap the covariance terms, as PixelSpacePointFormationTool does.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
const IIntersectionCache * cache() const
Retrieve the associated cache block, if it exists.
unsigned int DetectorIDHashType
@ detector ID element hash
Reference frame of the last module seen, keyed on the identifier hash and stamped with the event so a...

◆ usesGeometryContext()

virtual bool ActsTrk::CorePixelSpacePointFormationTool::usesGeometryContext ( ) const
inlineoverridevirtual

Definition at line 45 of file CorePixelSpacePointFormationTool.h.

45{ return true; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

SG::SlotSpecificObj<SurfaceCache> m_surfaceCache ActsTrk::CorePixelSpacePointFormationTool::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 60 of file CorePixelSpacePointFormationTool.h.

◆ m_maxVarianceR

Gaudi::Property<float> ActsTrk::CorePixelSpacePointFormationTool::m_maxVarianceR {this, "MaxVarianceR", 0.015f}
private

Definition at line 68 of file CorePixelSpacePointFormationTool.h.

68{this, "MaxVarianceR", 0.015f};

◆ m_maxVarianceZ

Gaudi::Property<float> ActsTrk::CorePixelSpacePointFormationTool::m_maxVarianceZ {this, "MaxVarianceZ", 0.0014f}
private

Definition at line 67 of file CorePixelSpacePointFormationTool.h.

67{this, "MaxVarianceZ", 0.0014f};

◆ m_surfaceAccessor

ActsTrk::detail::xAODUncalibMeasSurfAcc ActsTrk::CorePixelSpacePointFormationTool::m_surfaceAccessor {}
private

Definition at line 51 of file CorePixelSpacePointFormationTool.h.

51{};

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> ActsTrk::CorePixelSpacePointFormationTool::m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
private

Definition at line 49 of file CorePixelSpacePointFormationTool.h.

49{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ m_useMaxVariance

Gaudi::Property<bool> ActsTrk::CorePixelSpacePointFormationTool::m_useMaxVariance {this, "UseMaxVariance", false}
private

Cap the covariance terms, as PixelSpacePointFormationTool does.

Definition at line 66 of file CorePixelSpacePointFormationTool.h.

66{this, "UseMaxVariance", false};

◆ m_useSurfaceCache

Gaudi::Property<bool> ActsTrk::CorePixelSpacePointFormationTool::m_useSurfaceCache
private
Initial value:
{this, "UseSurfaceCache", true,
"Reuse the surface reference frame across the clusters of a module"}

Definition at line 62 of file CorePixelSpacePointFormationTool.h.

62 {this, "UseSurfaceCache", true,
63 "Reuse the surface reference frame across the clusters of a module"};

The documentation for this class was generated from the following files: