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