ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetRec
Root
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
7
#include "
JetRec/JetToolRunner.h
"
8
#include <iomanip>
9
#include "
JetInterface/IJetExecuteTool.h
"
10
11
using
std::string;
12
using
std::setw;
13
using
std::setprecision;
14
using
std::fixed;
15
16
//**********************************************************************
17
18
JetToolRunner::JetToolRunner
(
const
std::string& myname):
19
AsgTool
(myname){
20
}
21
22
//**********************************************************************
23
24
StatusCode
JetToolRunner::initialize
() {
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
54
StatusCode
JetToolRunner::finalize
() {
55
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
56
return
StatusCode::SUCCESS;
57
}
58
59
//**********************************************************************
60
61
int
JetToolRunner::execute
()
const
{
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
96
void
JetToolRunner::print
()
const
{
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
//**********************************************************************
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IJetExecuteTool.h
JetToolRunner.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
JetToolRunner::m_exetools
ToolHandleArray< IJetExecuteTool > m_exetools
Definition
JetToolRunner.h:50
JetToolRunner::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
JetToolRunner.cxx:24
JetToolRunner::execute
int execute() const
Method to be called for each event.
Definition
JetToolRunner.cxx:61
JetToolRunner::finalize
StatusCode finalize()
Definition
JetToolRunner.cxx:54
JetToolRunner::JetToolRunner
JetToolRunner(const std::string &myname)
Definition
JetToolRunner.cxx:18
JetToolRunner::m_evstools
ToolHandleArray< IEventShapeTool > m_evstools
Definition
JetToolRunner.h:49
JetToolRunner::print
void print() const
Print the state of the tool.
Definition
JetToolRunner.cxx:96
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
Generated on
for ATLAS Offline Software by
1.17.0