ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "TBEventStreamer.h"
8
9TBEventStreamer::TBEventStreamer(const std::string& name,
10 ISvcLocator* pService)
11 : AthAlgorithm(name,pService)
12{
13 declareProperty("ToolNames",m_tools);
14}
15
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 {
68 m_invokeCounter[tool]++;
69 successFlag = tool->accept() == StatusCode::SUCCESS;
70 if ( successFlag )
71 {
72 m_acceptCounter[tool]++;
73 }
74 else
75 {
76 m_rejectCounter[tool]++;
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
virtual ~TBEventStreamer()
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_acceptCounter
virtual StatusCode initialize() override
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_invokeCounter
virtual StatusCode execute() override
ToolHandleArray< TBEventStreamerTool > m_tools
std::map< ToolHandle< TBEventStreamerTool >, unsigned int > m_rejectCounter
virtual StatusCode finalize() override
TBEventStreamer(const std::string &name, ISvcLocator *pService)
Algorithm constructor.