28 {
30
31
33 const Acts::SquareMatrix2 localCov = cluster.
localCovariance<2>().cast<double>();
34
35
36 auto lookupReferenceFrame = [this, &gctx, &cluster, idHash](Acts::RotationMatrix3& rot) -> StatusCode {
38 if (surface == nullptr) {
39 ATH_MSG_FATAL(
"No ACTS surface for pixel cluster with identifier hash " << idHash);
40 return StatusCode::FAILURE;
41 }
42
43 rot = surface->referenceFrame(gctx, Acts::Vector3::Zero(), Acts::Vector3::Zero());
44 return StatusCode::SUCCESS;
45 };
46
47
48 Acts::Vector2 variance;
51 if (
cache.idHash != idHash or
cache.evt != ctx.evt()) {
52
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 }
#define ATH_MSG_FATAL(x,...)
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