8#include "Acts/Surfaces/PerigeeSurface.hpp"
9#include "Acts/Surfaces/StrawSurface.hpp"
10#include "Acts/Definitions/Units.hpp"
11#include "Acts/Utilities/UnitVectors.hpp"
13using namespace Acts::UnitLiterals;
23 return StatusCode::SUCCESS;
32 if (!measCreator.ok()) {
33 ATH_MSG_ERROR(
"Cannot create the auxilary measurement container");
34 return StatusCode::FAILURE;
43 Acts::Matrix<2,3> projector{Acts::Matrix<2,3>::Zero()};
44 projector.row(0) =
m_sigmaScaleR* Acts::makeDirectionFromPhiTheta(vertex->position().phi(),
48 AmgSymMatrix(2) cov = projector * vertex->covariancePosition() * projector.transpose();
50 auto surface = Acts::Surface::makeShared<Acts::PerigeeSurface>(surfaceTrf);
51 measCreator->newMeasurement<2>(surface, ProjectorType::e2DimNoTime, cov);
53 }
else if (beamSpotData) {
60 beamCov(0,0) = beamSpot->beamSigma(0);
61 beamCov(1,1) = beamSpot->beamSigma(1);
62 beamCov(2,2) = beamSpot->beamSigma(2);
63 beamCov(0,1) = beamCov(1,0) = beamSpot->beamSigma(5);
65 Acts::Matrix<2,3> projector{Acts::Matrix<2,3>::Zero()};
66 projector(0,0) =
m_sigmaScaleR* Amg::Vector3D::UnitX().dot(beamSpotTrf.linear() * Amg::Vector3D::UnitX());
67 projector(0,1) =
m_sigmaScaleR* Amg::Vector3D::UnitY().dot(beamSpotTrf.linear() * Amg::Vector3D::UnitY());
70 AmgSymMatrix(2) cov = projector * beamCov * projector.transpose();
71 ATH_MSG_DEBUG(__func__<<
"() "<<__LINE__<<
" - Covariance \n"<<cov
72 <<
",\n projector:\n"<<projector);
74 auto surface = Acts::Surface::makeShared<Acts::PerigeeSurface>(beamSpotTrf);
75 measCreator->newMeasurement<2>(surface, ProjectorType::e2DimNoTime, cov);
77 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define AmgSymMatrix(dim)
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
virtual StatusCode initialize() override final
Gaudi::Property< double > m_sigmaScaleZ
Extra scale factor on the longitudinal beam spot covariance position.
virtual StatusCode execute(const EventContext &ctx) const override final
ActsTrk::AuxiliaryMeasurementHandler m_beamSpotHandle
Handle the beam spot auxiliary measurement.
Gaudi::Property< std::string > m_writeKey
Key under which the auxiliary container will be registered in store gate.
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Optional dependency on the beamspot container.
Gaudi::Property< double > m_sigmaScaleR
Extra scal factor on the radial beam spot covariance position.
Gaudi::Property< bool > m_useBeamSpot
Switch to toggle whether the beam spot or the primary vertex will be used as beamspot measuremenmt.
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Data dependency on the vertex container.
ActsTrk::detail::MeasurementCalibratorBase::ProjectorType ProjectorType
Use the calibration projector.
Amg::Transform3D getRotateX3D(double angle)
Rotate the coordinate system by an angle around the x-axis.
Amg::Transform3D getTranslate3D(const double X, const double Y, const double Z)
: Returns a shift transformation along an arbitrary axis
Eigen::Affine3d Transform3D
Amg::Transform3D getRotateY3D(double angle)
Rotate the coordinate system by an angle around the z-axis.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.