ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
PileUpComps
src
NoPileUpMuWriter.cxx
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#include "
NoPileUpMuWriter.h
"
7
8
#include <
StoreGate/WriteDecorHandle.h
>
9
10
NoPileUpMuWriter::NoPileUpMuWriter
(
const
std::string& name, ISvcLocator* pSvcLocator)
11
:
AthReentrantAlgorithm
(name,pSvcLocator)
12
{
13
}
14
15
StatusCode
NoPileUpMuWriter::initialize
()
16
{
17
ATH_CHECK
(
m_actMuKey
.initialize());
18
ATH_CHECK
(
m_aveMuKey
.initialize());
19
return
StatusCode::SUCCESS;
20
}
21
22
StatusCode
NoPileUpMuWriter::execute
(
const
EventContext& ctx)
const
23
{
24
SG::WriteDecorHandle<xAOD::EventInfo, float>
actMu(
m_actMuKey
, ctx);
25
if
(!actMu.
isPresent
()) {
26
ATH_MSG_ERROR
(
"actualInteractionsPerCrossing.isPresent check fails"
);
27
return
StatusCode::FAILURE;
28
}
29
if
(!actMu.
isAvailable
()) {
30
actMu(0) = 0.;
31
}
32
33
SG::WriteDecorHandle<xAOD::EventInfo, float>
aveMu(
m_aveMuKey
, ctx);
34
if
(!aveMu.
isPresent
()) {
35
ATH_MSG_ERROR
(
"averageInteractionsPerCrossing.isPresent check fails"
);
36
return
StatusCode::FAILURE;
37
}
38
if
(!aveMu.
isAvailable
()) {
39
aveMu(0) = 0.;
40
}
41
42
return
StatusCode::SUCCESS;
43
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
NoPileUpMuWriter.h
WriteDecorHandle.h
Handle class for adding a decoration to an object.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
NoPileUpMuWriter::initialize
virtual StatusCode initialize() override final
Definition
NoPileUpMuWriter.cxx:15
NoPileUpMuWriter::m_aveMuKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_aveMuKey
Definition
NoPileUpMuWriter.h:33
NoPileUpMuWriter::m_actMuKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_actMuKey
Definition
NoPileUpMuWriter.h:28
NoPileUpMuWriter::NoPileUpMuWriter
NoPileUpMuWriter(const std::string &name, ISvcLocator *pSvcLocator)
Definition
NoPileUpMuWriter.cxx:10
NoPileUpMuWriter::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
NoPileUpMuWriter.cxx:22
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
SG::WriteDecorHandle::isAvailable
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
SG::WriteDecorHandle::isPresent
bool isPresent() const
Is the referenced container present in SG?
Generated on
for ATLAS Offline Software by
1.17.0