ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODEventInfoCnv
src
EventInfoBeamSpotDecoratorAlg.cxx
Go to the documentation of this file.
1
//
2
// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
//
4
5
// Local include(s).
6
#include "
EventInfoBeamSpotDecoratorAlg.h
"
7
8
// Gaudi/Athena include(s).
9
#include "
StoreGate/ReadCondHandle.h
"
10
#include "
StoreGate/WriteDecorHandle.h
"
11
12
// System include(s).
13
#include <cstdint>
14
15
// Declare the algorithm to Gaudi.
16
DECLARE_COMPONENT
(
xAODMaker::EventInfoBeamSpotDecoratorAlg
)
17
18
namespace
xAODMaker
{
19
20
StatusCode
EventInfoBeamSpotDecoratorAlg::initialize
() {
21
22
// Initialise all of the keys.
23
ATH_CHECK
(
m_beamSpotKey
.initialize() );
24
ATH_CHECK
(
m_eventInfoKey
.initialize() );
25
26
ATH_CHECK
(
m_beamPosXKey
.initialize() );
27
ATH_CHECK
(
m_beamPosYKey
.initialize() );
28
ATH_CHECK
(
m_beamPosZKey
.initialize() );
29
30
ATH_CHECK
(
m_beamPosSigmaXKey
.initialize() );
31
ATH_CHECK
(
m_beamPosSigmaYKey
.initialize() );
32
ATH_CHECK
(
m_beamPosSigmaZKey
.initialize() );
33
ATH_CHECK
(
m_beamPosSigmaXYKey
.initialize() );
34
35
ATH_CHECK
(
m_beamTiltXZKey
.initialize() );
36
ATH_CHECK
(
m_beamTiltYZKey
.initialize() );
37
38
ATH_CHECK
(
m_beamStatusKey
.initialize() );
39
40
// Greet the user.
41
ATH_MSG_INFO
(
"Creating beamspot decorations on "
42
<<
m_beamPosXKey
.contHandleKey().fullKey() <<
" from "
43
<<
m_beamSpotKey
.fullKey() );
44
ATH_MSG_DEBUG
(
"Keys used by the algorithm:"
);
45
ATH_MSG_DEBUG
(
" - "
<<
m_beamSpotKey
.fullKey() );
46
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosXKey
.fullKey() );
47
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosYKey
.fullKey() );
48
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosZKey
.fullKey() );
49
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosSigmaXKey
.fullKey() );
50
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosSigmaYKey
.fullKey() );
51
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosSigmaZKey
.fullKey() );
52
ATH_MSG_DEBUG
(
" - "
<<
m_beamPosSigmaXYKey
.fullKey() );
53
ATH_MSG_DEBUG
(
" - "
<<
m_beamTiltXZKey
.fullKey() );
54
ATH_MSG_DEBUG
(
" - "
<<
m_beamTiltYZKey
.fullKey() );
55
ATH_MSG_DEBUG
(
" - "
<<
m_beamStatusKey
.fullKey() );
56
57
// Return gracefully.
58
return
StatusCode::SUCCESS;
59
}
60
61
StatusCode
62
EventInfoBeamSpotDecoratorAlg::execute
(
const
EventContext& ctx )
const
{
63
64
// Read in the condition object.
65
SG::ReadCondHandle< InDet::BeamSpotData >
66
beamSpotHandle(
m_beamSpotKey
, ctx );
67
const
InDet::BeamSpotData
* beamSpotData = beamSpotHandle.
retrieve
();
68
ATH_CHECK
( beamSpotData !=
nullptr
);
69
70
// Set all of the decorations on the EventInfo object.
71
SG::WriteDecorHandle< xAOD::EventInfo, float >
72
beamPosXHandle(
m_beamPosXKey
, ctx );
73
beamPosXHandle( *beamPosXHandle ) = beamSpotData->
beamPos
()[
Amg::x
];
74
SG::WriteDecorHandle< xAOD::EventInfo, float >
75
beamPosYHandle(
m_beamPosYKey
, ctx );
76
beamPosYHandle( *beamPosYHandle ) = beamSpotData->
beamPos
()[
Amg::y
];
77
SG::WriteDecorHandle< xAOD::EventInfo, float >
78
beamPosZHandle(
m_beamPosZKey
, ctx );
79
beamPosZHandle( *beamPosZHandle ) = beamSpotData->
beamPos
()[
Amg::z
];
80
81
SG::WriteDecorHandle< xAOD::EventInfo, float >
82
beamPosSigmaXHandle(
m_beamPosSigmaXKey
, ctx );
83
beamPosSigmaXHandle( *beamPosSigmaXHandle ) =
84
beamSpotData->
beamSigma
( 0 );
85
SG::WriteDecorHandle< xAOD::EventInfo, float >
86
beamPosSigmaYHandle(
m_beamPosSigmaYKey
, ctx );
87
beamPosSigmaYHandle( *beamPosSigmaYHandle ) =
88
beamSpotData->
beamSigma
( 1 );
89
SG::WriteDecorHandle< xAOD::EventInfo, float >
90
beamPosSigmaZHandle(
m_beamPosSigmaZKey
, ctx );
91
beamPosSigmaZHandle( *beamPosSigmaZHandle ) =
92
beamSpotData->
beamSigma
( 2 );
93
SG::WriteDecorHandle< xAOD::EventInfo, float >
94
beamPosSigmaXYHandle(
m_beamPosSigmaXYKey
, ctx );
95
beamPosSigmaXYHandle( *beamPosSigmaXYHandle ) =
96
beamSpotData->
beamSigmaXY
();
97
98
SG::WriteDecorHandle< xAOD::EventInfo, float >
99
beamTiltXZHandle(
m_beamTiltXZKey
, ctx );
100
beamTiltXZHandle( *beamTiltXZHandle ) = beamSpotData->
beamTilt
( 0 );
101
SG::WriteDecorHandle< xAOD::EventInfo, float >
102
beamTiltYZHandle(
m_beamTiltYZKey
, ctx );
103
beamTiltYZHandle( *beamTiltYZHandle ) = beamSpotData->
beamTilt
( 1 );
104
105
SG::WriteDecorHandle< xAOD::EventInfo, uint32_t >
106
beamStatusHandle(
m_beamStatusKey
, ctx );
107
beamStatusHandle( *beamStatusHandle ) = beamSpotData->
beamStatus
();
108
109
// Return gracefully.
110
return
StatusCode::SUCCESS;
111
}
112
113
}
// namespace xAODMaker
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
EventInfoBeamSpotDecoratorAlg.h
DECLARE_COMPONENT
DECLARE_COMPONENT(MuonGMR4::ReadoutGeomCnvAlg)
ReadCondHandle.h
WriteDecorHandle.h
Handle class for adding a decoration to an object.
InDet::BeamSpotData
Definition
BeamSpotData.h:21
InDet::BeamSpotData::beamTilt
float beamTilt(int i) const noexcept
Returns the beam sigma for the i+3-th error matrix element (the 'tilt').
Definition
BeamSpotData.h:74
InDet::BeamSpotData::beamSigma
float beamSigma(int i) const noexcept
Returns the beam sigma for the i-th error matrix element.
Definition
BeamSpotData.h:70
InDet::BeamSpotData::beamStatus
int beamStatus() const noexcept
Definition
BeamSpotData.h:76
InDet::BeamSpotData::beamPos
const Amg::Vector3D & beamPos() const noexcept
Definition
BeamSpotData.h:68
InDet::BeamSpotData::beamSigmaXY
float beamSigmaXY() const noexcept
Definition
BeamSpotData.h:72
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::retrieve
const_pointer_type retrieve()
Definition
ReadCondHandle.h:161
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
xAODMaker::EventInfoBeamSpotDecoratorAlg
Algorithm for filling the beam position variables on xAOD::EventInfo.
Definition
EventInfoBeamSpotDecoratorAlg.h:27
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosSigmaXKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosSigmaXKey
Decorator handle for beamPosSigmaX.
Definition
EventInfoBeamSpotDecoratorAlg.h:69
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosYKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosYKey
Decorator handle for beamPosY.
Definition
EventInfoBeamSpotDecoratorAlg.h:60
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosSigmaYKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosSigmaYKey
Decorator handle for beamPosSigmaY.
Definition
EventInfoBeamSpotDecoratorAlg.h:73
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Read handle for EventInfo object to be decorated.
Definition
EventInfoBeamSpotDecoratorAlg.h:52
xAODMaker::EventInfoBeamSpotDecoratorAlg::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition
EventInfoBeamSpotDecoratorAlg.cxx:20
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Conditions object with the beamspot information.
Definition
EventInfoBeamSpotDecoratorAlg.h:48
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamStatusKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamStatusKey
Decorator handle for beamStatus.
Definition
EventInfoBeamSpotDecoratorAlg.h:95
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamTiltXZKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamTiltXZKey
Decorator handle for beamTiltXZ.
Definition
EventInfoBeamSpotDecoratorAlg.h:86
xAODMaker::EventInfoBeamSpotDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition
EventInfoBeamSpotDecoratorAlg.cxx:62
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamTiltYZKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamTiltYZKey
Decorator handle for beamTiltYZ.
Definition
EventInfoBeamSpotDecoratorAlg.h:90
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosZKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosZKey
Decorator handle for beamPosZ.
Definition
EventInfoBeamSpotDecoratorAlg.h:64
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosSigmaXYKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosSigmaXYKey
Decorator handle for beamPosSigmaXY.
Definition
EventInfoBeamSpotDecoratorAlg.h:81
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosSigmaZKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosSigmaZKey
Decorator handle for beamPosSigmaZ.
Definition
EventInfoBeamSpotDecoratorAlg.h:77
xAODMaker::EventInfoBeamSpotDecoratorAlg::m_beamPosXKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_beamPosXKey
Decorator handle for beamPosX.
Definition
EventInfoBeamSpotDecoratorAlg.h:56
Amg::y
@ y
Definition
GeoPrimitives.h:35
Amg::x
@ x
Definition
GeoPrimitives.h:34
Amg::z
@ z
Definition
GeoPrimitives.h:36
xAODMaker
Definition
StoreGateSvc.h:70
Generated on
for ATLAS Offline Software by
1.17.0