6#include "CoralBase/AttributeListException.h"
10 EventIDBase::UNDEFNUM,
11 EventIDBase::UNDEFNUM,
13 EventIDBase { EventIDBase::UNDEFNUM - 1,
14 EventIDBase::UNDEFEVT,
15 EventIDBase::UNDEFNUM,
16 EventIDBase::UNDEFNUM,
17 EventIDBase::UNDEFNUM - 1 }
35 return StatusCode::SUCCESS;
46 "Forcing update of Store contents" );
47 return StatusCode::SUCCESS;
69 return StatusCode::FAILURE;
72 int status { (*raw)[
"status"].data<
int>() };
73 float posX { (*raw)[
"posX"].data<
float>() };
74 float posY { (*raw)[
"posY"].data<
float>() };
75 float posZ { (*raw)[
"posZ"].data<
float>() };
76 float sigmaX { (*raw)[
"sigmaX"].data<
float>() };
77 float sigmaY { (*raw)[
"sigmaY"].data<
float>() };
78 float sigmaZ { (*raw)[
"sigmaZ"].data<
float>() };
79 float tiltX { (*raw)[
"tiltX"].data<
float>() };
80 float tiltY { (*raw)[
"tiltY"].data<
float>() };
84 sigmaXY = (*raw)[
"sigmaXY"].data<
float>();
86 catch (coral::AttributeListException& e)
88 ATH_MSG_DEBUG(
"No sigmaXY value present in database, using default value of " << sigmaXY );
92 <<
" status " << status
93 <<
" pos (" << posX <<
"," << posY <<
"," << posZ <<
")"
94 <<
" sigma (" << sigmaX <<
"," << sigmaY <<
"," << sigmaZ <<
")"
95 <<
" tilt (" << tiltX <<
"," << tiltY <<
")"
96 <<
" sigmaXY " << sigmaXY );
98 if ( !readHandle.
range(rangeW) )
100 ATH_MSG_ERROR(
"Failed to retrieve validity range for " << readHandle.
key() );
101 return StatusCode::FAILURE;
105 sigmaX, sigmaY, sigmaZ,
106 tiltX, tiltY, sigmaXY );
109 if ( writeHandle.
record( rangeW, writeCdo ).isFailure() )
111 ATH_MSG_ERROR(
"Could not record InDet::BeamSpotData " << writeHandle.
key() <<
112 " with EventRange " << rangeW <<
" into conditions store." );
113 return StatusCode::FAILURE;
116 ATH_MSG_INFO(
"Recorded new InDet::BeamSpotData to " << writeHandle.
key() <<
" with range " << rangeW <<
117 " into conditions store." );
119 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Base class for conditions algorithms.
An AttributeList represents a logical row of attributes in a metadata table.
virtual StatusCode execute(const EventContext &ctx) const override final
Gaudi::Property< float > m_tiltX
Gaudi::Property< float > m_posY
Gaudi::Property< float > m_sigmaY
Gaudi::Property< float > m_sigmaXY
Gaudi::Property< int > m_status
Gaudi::Property< float > m_sigmaX
Gaudi::Property< float > m_posZ
Gaudi::Property< float > m_tiltY
SG::WriteCondHandleKey< InDet::BeamSpotData > m_writeKey
virtual ~BeamSpotCondAlg()
BeamSpotCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
static const EventIDRange alwaysValid
SG::ReadCondHandleKey< AthenaAttributeList > m_readKey
Gaudi::Property< bool > m_useDB
Gaudi::Property< float > m_posX
virtual StatusCode initialize() override final
Gaudi::Property< float > m_sigmaZ
bool range(EventIDRange &r)
const std::string & key() const
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const