ATLAS Offline Software
METUtilAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // METUtilAlg.cxx
6 
7 #include "METUtilAlg.h"
9 
10 using std::string;
11 
12 namespace met {
13 
14  //**********************************************************************
15 
16  METUtilAlg::METUtilAlg(const std::string& name,
17  ISvcLocator* pSvcLocator )
18  : ::AthAlgorithm( name, pSvcLocator ) {
19  declareProperty( "Rebuilders", m_rebuilders);
20  }
21 
22  //**********************************************************************
23 
24  METUtilAlg::~METUtilAlg() = default;
25 
26  //**********************************************************************
27 
29  ATH_MSG_INFO("Initializing " << name() << "...");
30  ATH_MSG_INFO("Retrieving tools...");
31 
32  // retrieve tools
33  for(ToolHandleArray<IMETRebuilder>::const_iterator iTool=m_rebuilders.begin();
34  iTool != m_rebuilders.end(); ++iTool) {
35  ToolHandle<IMETRebuilder> tool = *iTool;
36  if( tool.retrieve().isFailure() ) {
37  ATH_MSG_ERROR("Failed to retrieve tool: " << tool->name());
38  return StatusCode::FAILURE;
39  };
40  ATH_MSG_INFO("Retrieved tool: " << tool->name() );
41  }
42 
43  return StatusCode::SUCCESS;
44  }
45 
46  //**********************************************************************
47 
49  ATH_MSG_INFO ("Finalizing " << name() << "...");
50  return StatusCode::SUCCESS;
51  }
52 
53  //**********************************************************************
54 
56  ATH_MSG_VERBOSE("Executing " << name() << "...");
57  // Loop over tools.
58 
59  // Run the top-level MET tools in sequence
60  for(ToolHandleArray<IMETRebuilder>::const_iterator iTool=m_rebuilders.begin();
61  iTool != m_rebuilders.end(); ++iTool) {
62  ToolHandle<IMETRebuilder> tool = *iTool;
63  ATH_MSG_VERBOSE("Running tool: " << tool->name() );
64  if( tool->execute().isFailure() ) {
65  ATH_MSG_ERROR("Failed to execute tool: " << tool->name());
66  return StatusCode::FAILURE;
67  }
68  }
69 
70  return StatusCode::SUCCESS;
71  }
72 
73  //**********************************************************************
74 
75 }
76 
IMETRebuilder.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
met::METUtilAlg::~METUtilAlg
~METUtilAlg()
Destructor:
met::METUtilAlg::initialize
StatusCode initialize()
Athena algorithm's Hooks.
Definition: METUtilAlg.cxx:28
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
METUtilAlg.h
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
met::METUtilAlg::finalize
StatusCode finalize()
Definition: METUtilAlg.cxx:48
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
met::METUtilAlg::m_rebuilders
ToolHandleArray< IMETRebuilder > m_rebuilders
Athena configured tools.
Definition: METUtilAlg.h:39
met::METUtilAlg::METUtilAlg
METUtilAlg()
Default constructor:
met::METUtilAlg::execute
StatusCode execute()
Definition: METUtilAlg.cxx:55