32 return StatusCode::SUCCESS;
38 if (!beamSpotHandle.
isValid()) {
40 return StatusCode::FAILURE;
44 if (!inputEventInfo.
isValid()) {
45 ATH_MSG_ERROR(
"Could not get input xAOD::EventInfo " << inputEventInfo.
name() <<
" from store " << inputEventInfo.
store());
46 return StatusCode::FAILURE;
48 ATH_MSG_DEBUG(
"Found input xAOD::EventInfo " << inputEventInfo.
name() <<
" in store " << inputEventInfo.
store());
51 ATH_CHECK(eventInfo.
record(std::make_unique<xAOD::EventInfo>(), std::make_unique<xAOD::EventAuxInfo>()));
53 ATH_MSG_ERROR(
"Could not record output xAOD::EventInfo " << eventInfo.
name() <<
" to store " << eventInfo.
store());
54 return StatusCode::FAILURE;
56 ATH_MSG_DEBUG(
"Recorded output xAOD::EventInfo " << eventInfo.
name() <<
" in store " << eventInfo.
store());
59 *eventInfo = *inputEventInfo;
62 eventInfo->setBeamPos( beamSpotHandle->beamPos()[
Amg::x ],
63 beamSpotHandle->beamPos()[
Amg::y ],
64 beamSpotHandle->beamPos()[
Amg::z ] );
65 eventInfo->setBeamPosSigma( beamSpotHandle->beamSigma( 0 ),
66 beamSpotHandle->beamSigma( 1 ),
67 beamSpotHandle->beamSigma( 2 ) );
68 eventInfo->setBeamPosSigmaXY( beamSpotHandle->beamSigmaXY() );
69 eventInfo->setBeamTiltXZ( beamSpotHandle->beamTilt( 0 ) );
70 eventInfo->setBeamTiltYZ( beamSpotHandle->beamTilt( 1 ) );
71 eventInfo->setBeamStatus( beamSpotHandle->beamStatus() );
73 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string store() const
Return the name of the store holding the object we are proxying.
const std::string & name() const
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual StatusCode execute(const EventContext &ctx) const override final
Athena algorithm's interface method execute()
SG::ReadHandleKey< xAOD::EventInfo > m_inputKey
BeamSpotFixerAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::WriteHandleKey< xAOD::EventInfo > m_outputKey
virtual StatusCode initialize() override final
Athena algorithm's interface method initialize()