ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LumiBlock
LumiBlockComps
src
LumiBlockMuTool.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
#include "
LumiBlockMuTool.h
"
6
#include "
StoreGate/ReadDecorHandle.h
"
7
8
//--------------------------------------------------
9
10
StatusCode
11
LumiBlockMuTool::initialize
()
12
{
13
ATH_MSG_DEBUG
(
"LumiBlockMuTool::initialize() begin"
);
14
ATH_CHECK
(
m_eventInfoKey
.initialize());
15
ATH_CHECK
(
m_rdhkActMu
.initialize());
16
ATH_CHECK
(
m_rdhkAveMu
.initialize());
17
return
StatusCode::SUCCESS;
18
}
19
20
float
21
LumiBlockMuTool::actualInteractionsPerCrossing
(
const
EventContext& ctx)
const
{
22
23
SG::ReadHandle<xAOD::EventInfo>
eventInfo(
m_eventInfoKey
, ctx);
24
SG::ReadDecorHandle<xAOD::EventInfo,float>
actMu(
m_rdhkActMu
, ctx);
25
float
mu = actMu.
isPresent
() ? actMu(0) : 0.;
26
return
mu;
27
}
28
29
float
30
LumiBlockMuTool::averageInteractionsPerCrossing
(
const
EventContext& ctx)
const
{
31
32
SG::ReadHandle<xAOD::EventInfo>
eventInfo(
m_eventInfoKey
, ctx);
33
SG::ReadDecorHandle<xAOD::EventInfo,float>
aveMu(
m_rdhkAveMu
, ctx);
34
float
mu = aveMu.
isPresent
() ? aveMu(0) : 0.;
35
return
mu;
36
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
LumiBlockMuTool.h
ReadDecorHandle.h
Handle class for reading a decoration on an object.
LumiBlockMuTool::initialize
virtual StatusCode initialize() override
Definition
LumiBlockMuTool.cxx:11
LumiBlockMuTool::averageInteractionsPerCrossing
virtual float averageInteractionsPerCrossing(const EventContext &ctx) const override final
Definition
LumiBlockMuTool.cxx:30
LumiBlockMuTool::m_rdhkAveMu
SG::ReadDecorHandleKey< xAOD::EventInfo > m_rdhkAveMu
Definition
LumiBlockMuTool.h:56
LumiBlockMuTool::m_rdhkActMu
SG::ReadDecorHandleKey< xAOD::EventInfo > m_rdhkActMu
Definition
LumiBlockMuTool.h:51
LumiBlockMuTool::actualInteractionsPerCrossing
virtual float actualInteractionsPerCrossing(const EventContext &ctx) const override final
Definition
LumiBlockMuTool.cxx:21
LumiBlockMuTool::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition
LumiBlockMuTool.h:46
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition
StoreGate/StoreGate/ReadDecorHandle.h:94
SG::ReadDecorHandle::isPresent
bool isPresent() const
Is the referenced container present in SG?
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Generated on
for ATLAS Offline Software by
1.17.0