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 rotLocalToGlobal.setZero();
64 ATH_CHECK( lookupReferenceFrame(rotLocalToGlobal) );
65 variance = Acts::PixelSpacePointBuilder::computeVarianceZR(rotLocalToGlobal,
66 globalPosition.cast<double>(), localCov);
67 }
68
69 float cov_z = static_cast<float>(variance[0]);
70 float cov_r = static_cast<float>(variance[1]);
71
75 }
76
77 sp.setSpacePoint(idHash,
78 globalPosition,
79 cov_r,
80 cov_z,
81 std::vector< const xAOD::UncalibratedMeasurement* >({&cluster}));
82
83 return StatusCode::SUCCESS;
84 }
#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