ATLAS Offline Software
METRecoAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // METRecoAlg.cxx
6 
7 #include "METRecoAlg.h"
9 
10 using std::string;
11 
12 namespace met {
13 
14  //**********************************************************************
15 
16  METRecoAlg::METRecoAlg(const std::string& name,
17  ISvcLocator* pSvcLocator )
18  : ::AthReentrantAlgorithm( name, pSvcLocator ),
19  m_recotools (this)
20  {
21  declareProperty( "RecoTools", m_recotools);
22  }
23 
24  //**********************************************************************
25 
26  METRecoAlg::~METRecoAlg() = default;
27 
28  //**********************************************************************
29 
31  ATH_MSG_VERBOSE("Initializing " << name() << "...");
32 
33  ATH_CHECK( m_recotools.retrieve() );
34 
35  return StatusCode::SUCCESS;
36  }
37 
38  //**********************************************************************
39 
41  ATH_MSG_VERBOSE ("Finalizing " << name() << "...");
42  return StatusCode::SUCCESS;
43  }
44 
45  //**********************************************************************
46 
47  StatusCode METRecoAlg::execute(const EventContext& /*ctx*/) const{
48  ATH_MSG_VERBOSE("Executing " << name() << "...");
49  // Loop over tools.
50 
51  // Run the top-level MET tools in sequence
52  for(auto tool : m_recotools) {
53  ATH_MSG_VERBOSE("Running tool: " << tool->name() );
54  if( tool->execute().isFailure() ) {
55  ATH_MSG_ERROR("Failed to execute tool: " << tool->name());
56  return StatusCode::FAILURE;
57  }
58  }
59 
60  return StatusCode::SUCCESS;
61  }
62 
63  //**********************************************************************
64 
65 }
66 
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
met::METRecoAlg::METRecoAlg
METRecoAlg()
Default constructor:
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
METRecoAlg.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
met
Definition: IMETSignificance.h:24
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
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
met::METRecoAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: METRecoAlg.cxx:47
met::METRecoAlg::finalize
virtual StatusCode finalize() override
Definition: METRecoAlg.cxx:40
met::METRecoAlg::initialize
virtual StatusCode initialize() override
Athena algorithm's Hooks.
Definition: METRecoAlg.cxx:30
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
IMETRecoTool.h
met::METRecoAlg::~METRecoAlg
~METRecoAlg()
Destructor:
met::METRecoAlg::m_recotools
ToolHandleArray< IMETRecoTool > m_recotools
Athena configured tools.
Definition: METRecoAlg.h:39