ATLAS Offline Software
TBEventStreamer.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #include "TBEventStreamerTool.h"
7 #include "TBEventStreamer.h"
8 
10  ISvcLocator* pService)
11  : AthAlgorithm(name,pService)
12 {
13  declareProperty("ToolNames",m_tools);
14 }
15 
17 { }
18 
20 {
21  ATH_CHECK( m_tools.retrieve() );
22 
23 
24  // check tools
25  if ( m_tools.size() == 0 )
26  {
27  ATH_MSG_ERROR ( "no tools found!" );
28  return StatusCode::FAILURE;
29  } else {
30  for(unsigned int i = 0; i < m_tools.size(); ++i) {
34  }
35  }
36 
37 
38  // print out list of tools
39  ATH_MSG_INFO ( " " );
40  ATH_MSG_INFO ( "List of tools in execution sequence:" );
41  ATH_MSG_INFO ( "------------------------------------" );
42  ATH_MSG_INFO ( " " );
43  unsigned int toolCtr = 0;
44  for (ToolHandle<TBEventStreamerTool>& tool : m_tools) {
45  toolCtr++;
46  ATH_MSG_INFO (std::setw(2)
47  //<< std::setiosflags(std::ios_base::right)
48  << toolCtr << ".) "
49  //<< std::resetiosflags(std::ios_base::right)
50  //<< std::setw(36)
51  //<< std::setfill('.')
52  //<< std::setiosflags(std::ios_base::left)
53  << tool->type()
54  //<< std::setfill('.')
55  << tool->name() );
56  //<< std::setfill(' ')
57  }
58 
59  return StatusCode::SUCCESS;
60 
61 }
62 
64 {
65  bool successFlag = true;
66  for (ToolHandle<TBEventStreamerTool>& tool : m_tools)
67  {
69  successFlag = tool->accept() == StatusCode::SUCCESS;
70  if ( successFlag )
71  {
73  }
74  else
75  {
77  break;
78  }
79  }
80 
81  setFilterPassed(successFlag);
82  return StatusCode::SUCCESS;
83 }
84 
86 {
87  // print summary
88  for (ToolHandle<TBEventStreamerTool>& tool : m_tools) {
89  ATH_MSG_INFO ( "Tool "
90  << tool->name()
91  << " (invoked/accept/reject) "
92  << "(" << m_invokeCounter[tool]
93  << "/" << m_acceptCounter[tool]
94  << "/" << m_rejectCounter[tool]
95  << ")" );
96  }
97 
98  return StatusCode::SUCCESS;
99 }
TBEventStreamer::initialize
virtual StatusCode initialize() override
Definition: TBEventStreamer.cxx:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TBEventStreamer::m_acceptCounter
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_acceptCounter
Definition: TBEventStreamer.h:38
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TBEventStreamer::~TBEventStreamer
virtual ~TBEventStreamer()
Definition: TBEventStreamer.cxx:16
TBEventStreamer::finalize
virtual StatusCode finalize() override
Definition: TBEventStreamer.cxx:85
TBEventStreamer::m_invokeCounter
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_invokeCounter
Definition: TBEventStreamer.h:40
TBEventStreamerTool.h
TBEventStreamer::m_rejectCounter
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_rejectCounter
Definition: TBEventStreamer.h:39
TBEventStreamer.h
TBEventStreamer::execute
virtual StatusCode execute() override
Definition: TBEventStreamer.cxx:63
TBEventStreamer::TBEventStreamer
TBEventStreamer(const std::string &name, ISvcLocator *pService)
Algorithm constructor.
Definition: TBEventStreamer.cxx:9
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
TBEventStreamer::m_tools
ToolHandleArray< TBEventStreamerTool > m_tools
Definition: TBEventStreamer.h:36