ATLAS Offline Software
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 
9 
10 NoPileUpMuWriter::NoPileUpMuWriter(const std::string& name, ISvcLocator* pSvcLocator)
11  : AthReentrantAlgorithm(name,pSvcLocator)
12 {
13 }
14 
16 {
19  return StatusCode::SUCCESS;
20 }
21 
22 StatusCode NoPileUpMuWriter::execute(const EventContext& ctx) const
23 {
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 
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 }
SG::WriteDecorHandle::isAvailable
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
NoPileUpMuWriter::m_aveMuKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_aveMuKey
Definition: NoPileUpMuWriter.h:33
NoPileUpMuWriter::NoPileUpMuWriter
NoPileUpMuWriter(const std::string &name, ISvcLocator *pSvcLocator)
Definition: NoPileUpMuWriter.cxx:10
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
NoPileUpMuWriter::m_actMuKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_actMuKey
Definition: NoPileUpMuWriter.h:28
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WriteDecorHandle.h
Handle class for adding a decoration to an object.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
NoPileUpMuWriter.h
SG::WriteDecorHandle::isPresent
bool isPresent() const
Is the referenced container present in SG?
NoPileUpMuWriter::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: NoPileUpMuWriter.cxx:22
NoPileUpMuWriter::initialize
virtual StatusCode initialize() override final
Definition: NoPileUpMuWriter.cxx:15