ATLAS Offline Software
Loading...
Searching...
No Matches
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
10NoPileUpMuWriter::NoPileUpMuWriter(const std::string& name, ISvcLocator* pSvcLocator)
11 : AthReentrantAlgorithm(name,pSvcLocator)
12{
13}
14
16{
17 ATH_CHECK(m_actMuKey.initialize());
18 ATH_CHECK(m_aveMuKey.initialize());
19 return StatusCode::SUCCESS;
20}
21
22StatusCode 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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode initialize() override final
SG::WriteDecorHandleKey< xAOD::EventInfo > m_aveMuKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_actMuKey
NoPileUpMuWriter(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override final
Handle class for adding a decoration to an object.
bool isAvailable()
Test to see if this variable exists in the store, for the referenced object.
bool isPresent() const
Is the referenced container present in SG?