ATLAS Offline Software
Loading...
Searching...
No Matches
JetToolRunner.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5// JetToolRunner.cxx
6
8#include <iomanip>
10
11using std::string;
12using std::setw;
13using std::setprecision;
14using std::fixed;
15
16//**********************************************************************
17
18JetToolRunner::JetToolRunner(const std::string& myname):
19 AsgTool(myname){
20}
21
22//**********************************************************************
23
25 StatusCode sc;
26 ATH_MSG_INFO("Initializing " << name() << "...");
27 ATH_MSG_INFO("Retrieving tools...");
28 sc = m_evstools.retrieve();
29 if ( ! sc.isSuccess() ) {
30 ATH_MSG_ERROR("Eventshape tool retrieval failed.");
31 }
32 sc = m_exetools.retrieve();
33 if ( ! sc.isSuccess() ) {
34 ATH_MSG_ERROR("Execute tool retrieval failed.");
35 }
36 ATH_MSG_INFO("Tool retrieval completed.");
37 unsigned int ntool = m_exetools.size();
38 ATH_MSG_INFO(" Tool count: " << ntool);
39 for ( unsigned int itool=0; itool<ntool; ++itool ) {
40 ATH_MSG_INFO(" " << m_exetools[itool]->name());
41 m_exetools[itool]->print();
42 }
43 unsigned int nevstool = m_evstools.size();
44 ATH_MSG_INFO(" Tool count: " << nevstool);
45 for ( unsigned int itool=0; itool<nevstool; ++itool ) {
46 ATH_MSG_INFO(" " << m_evstools[itool]->name());
47 m_evstools[itool]->print();
48 }
49 return StatusCode::SUCCESS;
50}
51
52//**********************************************************************
53
55 ATH_MSG_INFO ("Finalizing " << name() << "...");
56 return StatusCode::SUCCESS;
57}
58
59//**********************************************************************
60
62 ATH_MSG_VERBOSE("Executing " << name() << "...");
63 string line = "---------------------------------------------------";
64 // Loop over event shape tools.
65 unsigned int nevstool = m_evstools.size();
66 ATH_MSG_DEBUG("Looping over " << nevstool << " event shape tools.");
67 if ( nevstool ) ATH_MSG_DEBUG(line);
68 for ( unsigned int itool=0; itool<nevstool; ++itool ) {
69 ToolHandle<IEventShapeTool> htool = m_evstools[itool];
70 ATH_MSG_DEBUG("Executing tool " << htool->name());
71 ATH_MSG_VERBOSE("Retrieving tool with IEventShapeTool interface.");
72 StatusCode sc = htool->fillEventShape();
73 if ( ! sc.isSuccess() ) ATH_MSG_INFO("Events shape tool returned error.");
74 else ATH_MSG_DEBUG("Tool execution succeeded");
75 ATH_MSG_DEBUG(line);
76 }
77 // Loop over execute tools.
78 unsigned int ntool = m_exetools.size();
79 ATH_MSG_DEBUG("Looping over " << ntool << " jet execute tools.");
80 if ( ntool ) ATH_MSG_DEBUG(line);
81 for ( unsigned int itool=0; itool<ntool; ++itool ) {
82 ToolHandle<IJetExecuteTool> htool = m_exetools[itool];
83 ATH_MSG_DEBUG("Executing tool " << htool->name());
84 ATH_MSG_VERBOSE("Retrieving tool with IJetExecuteTool interface.");
85 int jstat = htool->execute();
86 if ( jstat != 0 ) ATH_MSG_INFO("Tool returned error " << jstat);
87 else ATH_MSG_DEBUG("Tool execution succeeded");
88 ATH_MSG_DEBUG(line);
89 }
90
91 return 0;
92}
93
94//**********************************************************************
95
97 ATH_MSG_INFO("Properties for JetToolRunner " << name());
98 ATH_MSG_INFO(" Event Shape tool list has " << m_evstools.size() << " entries:");
99 for ( ToolHandleArray<IEventShapeTool>::const_iterator itoo=m_evstools.begin();
100 itoo!=m_evstools.end(); ++itoo ) {
101 ToolHandle<IEventShapeTool> htool = *itoo;
102 ATH_MSG_INFO(" " << htool->name());
103 }
104 ATH_MSG_INFO(" Execute tool list has " << m_exetools.size() << " entries:");
105 for ( ToolHandleArray<IJetExecuteTool>::const_iterator itoo=m_exetools.begin();
106 itoo!=m_exetools.end(); ++itoo ) {
107 ToolHandle<IJetExecuteTool> htool = *itoo;
108 ATH_MSG_INFO(" " << htool->name());
109 }
110}
111
112//**********************************************************************
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
ToolHandleArray< IJetExecuteTool > m_exetools
StatusCode initialize()
Dummy implementation of the initialisation function.
int execute() const
Method to be called for each event.
StatusCode finalize()
JetToolRunner(const std::string &myname)
ToolHandleArray< IEventShapeTool > m_evstools
void print() const
Print the state of the tool.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58