16 const std::string& name, ISvcLocator* loc )
25 ATH_MSG_ERROR(
"Cannot use multiple Vertex position sources for the local coordinates calculation");
26 return StatusCode::FAILURE;
28 ATH_MSG_DEBUG(
"Calculating local coordinates w.r.t. EventInfo Beamspot");
30 ATH_MSG_DEBUG(
"Calculating local coordinates w.r.t. Primary Vertex");
32 ATH_MSG_DEBUG(
"Calculating local coordinates w.r.t. detector origin (same coordinates)");
45 return StatusCode::SUCCESS;
53 ROOT::Math::XYZVector vtx;
60 return StatusCode::FAILURE;
70 correctedHitX(*hit) = hit->globalX() - vtx.X();
71 correctedHitY(*hit) = hit->globalY() - vtx.Y();
72 correctedHitZ(*hit) = hit->globalZ() - vtx.Z();
75 return StatusCode::SUCCESS;
85 if(!eventInfoHandle.
isValid()) {
87 return StatusCode::FAILURE;
91 eventInfoHandle->beamPosX(),
92 eventInfoHandle->beamPosY(),
93 eventInfoHandle->beamPosZ()
101 return StatusCode::FAILURE;
104 if(verticesHandle->empty()) {
106 return StatusCode::FAILURE;
117 if(!pv) pv = verticesHandle->front();
126 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
HitDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::VertexContainer > m_verticesKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_OutputHitXKey
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_OutputHitZKey
StatusCode getEventVertex(const EventContext &ctx, ROOT::Math::XYZVector &vtx) const
SG::ReadHandleKey< xAOD::TrackMeasurementValidationContainer > m_HitContainerKey
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_OutputHitYKey
virtual StatusCode initialize() override
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.