The Gaudi Framework  v36r9p1 (5c15b2bb)
GaudiCommon.icpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // ============================================================================
12 /* @file GaudiCommon.cpp
13  *
14  * Implementation file for class : GaudiCommon
15  *
16  * @author Chris Jones Christopher.Rob.Jones@cern.ch
17  * @author Vanya BELYAEV Ivan.Belyaev@itep.ru
18  * @author Rob Lambert Rob.Lambert@cern.ch
19  * @date 2009-08-04
20  */
21 // ============================================================================
22 #include "GaudiAlg/GaudiCommon.h"
23 
25 #include "GaudiAlg/GaudiTool.h"
26 #include "GaudiAlg/Print.h"
27 #include "GaudiKernel/AlgTool.h"
28 #include "GaudiKernel/Algorithm.h"
31 #include "GaudiKernel/IProperty.h"
33 #include "GaudiKernel/IToolSvc.h"
34 #include "GaudiKernel/MsgStream.h"
37 #include "GaudiKernel/SmartRef.h"
38 #include "GaudiKernel/Stat.h"
39 #include "GaudiKernel/StatEntity.h"
40 #include "GaudiKernel/System.h"
41 #include "GaudiKernel/reverse.h"
42 #include "GaudiUtils/RegEx.h"
43 #include <algorithm>
44 #include <cstdlib>
45 #include <fmt/format.h>
46 #include <numeric>
47 
48 // ============================================================================
49 // constructor initialisation
50 // ============================================================================
51 template <class PBASE>
53  // setup context from parent if available
54  if ( parent ) {
55  if ( const GaudiAlgorithm* gAlg = dynamic_cast<const GaudiAlgorithm*>( parent ) ) {
56  m_context = gAlg->context();
57  } else if ( const GaudiTool* gTool = dynamic_cast<const GaudiTool*>( parent ) ) {
58  m_context = gTool->context();
59  }
60  }
61 
62  // Get options values from IOptionsSvc
63  // \fixme this part is not needed because this method is called in the constructor,
64  // and properties are, anyway, set during the initialize... except for Context
65  // which might be set in the contructor by GaudiSequencer.
66  const auto& optsSvc = this->serviceLocator()->getOptsSvc();
67  const std::string key = this->name() + ".Context";
68  if ( optsSvc.has( key ) ) { this->setPropertyRepr( "Context", optsSvc.get( key ) ).ignore(); }
69 }
70 //=============================================================================
71 
72 //=============================================================================
73 // Initialise the common functionality
74 //=============================================================================
75 template <class PBASE>
77 
78  // initialize base class
79  const StatusCode sc = base_class::initialize();
80  if ( sc.isFailure() ) { return Error( "Failed to initialise base class PBASE", sc ); }
81 
82  // some debug printout
83  if ( this->msgLevel( MSG::DEBUG ) ) {
84  this->debug() << "Initialize base class GaudiCommon<" << System::typeinfoName( typeid( PBASE ) ) << ">" << endmsg;
85  if ( !context().empty() ) this->debug() << "Created with context = '" << context() << "'" << endmsg;
86  }
87 
88  // Set up the CounterSummarySvc May need to be changed
89  m_counterSummarySvc = this->svcLoc()->service( "CounterSummarySvc", false );
90  if ( this->msgLevel( MSG::DEBUG ) ) {
91  if ( !m_counterSummarySvc )
92  this->debug() << "could not locate CounterSummarySvc, no counter summary will be made" << endmsg;
93  else
94  this->debug() << "found CounterSummarySvc OK" << endmsg;
95  }
96 
97  // properties will be printed if asked for or in "MSG::DEBUG" mode
98  if ( m_propsPrint.value() ) {
99  printProps( MSG::ALWAYS );
100  } else if ( this->msgLevel( MSG::DEBUG ) ) {
101  printProps( MSG::DEBUG );
102  }
103 
104  return sc;
105 }
106 //=============================================================================
107 
108 //=============================================================================
109 // Finalize the common functionality
110 //=============================================================================
111 template <class PBASE>
114 
115  // add all counters to the CounterSummarySvc
116  if ( m_counterSummarySvc && this->svcLoc()->existsService( "CounterSummarySvc" ) ) {
117  if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
118 
119  Gaudi::Utils::RegEx::matchList counterList{ m_counterList.value() };
120 
121  for ( const auto& i : m_countersOwn ) {
122  if ( counterList.Or( i.first ) ) m_counterSummarySvc->addCounter( this->name(), i.first, i.second );
123  }
124  }
125  // release all located tools and services
126  if ( this->msgLevel( MSG::DEBUG ) ) {
127  this->debug() << "Tools to release :";
128  for ( const auto& i : m_managedTools ) { this->debug() << " " << i->name(); }
129  this->debug() << endmsg;
130  }
131  while ( !m_managedTools.empty() ) {
132  sc = ( releaseTool( m_managedTools.back() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
133  }
134 
135  // release all located services
136  if ( this->msgLevel( MSG::DEBUG ) ) {
137  this->debug() << "Services to release :";
138  for ( const auto& i : m_services ) this->debug() << " " << i->name();
139  this->debug() << endmsg;
140  }
141  while ( !m_services.empty() ) {
142  sc = ( releaseSvc( m_services.front() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
143  }
144 
145  // release the CounterSummarySvc manually
146  m_counterSummarySvc.reset();
147 
148  // format printout
149  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() ) {
150  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : " << m_exceptions.size() << "/" << m_errors.size()
151  << "/" << m_warnings.size() << "/" << m_infos.size() << endmsg;
152  if ( m_errorsPrint.value() ) { printErrors(); }
153  }
154 
155  // clear *ALL* counters explicitly
156  m_countersOwn.clear(); // then delete any owned counters
157  m_exceptions.clear();
158  m_infos.clear();
159  m_warnings.clear();
160  m_errors.clear();
161  m_counterList.clear();
162 
163  // finalize base class
164  return ( sc && base_class::finalize() ? StatusCode::SUCCESS : StatusCode::FAILURE );
165 }
166 //=============================================================================
167 
168 //=============================================================================
169 // Methods related to tools and services
170 //=============================================================================
171 
172 // ============================================================================
173 // manual forced (and 'safe') release of the active tool or service
174 // ============================================================================
175 template <class PBASE>
177  if ( !interface ) { return Error( "release(IInterface):: IInterface* points to NULL!" ); }
178  // dispatch between tools and services
179  const IAlgTool* algTool = dynamic_cast<const IAlgTool*>( interface );
180  // perform the actual release
181  return algTool ? releaseTool( algTool ) : releaseSvc( interface );
182 }
183 // ============================================================================
184 
185 // ============================================================================
186 // manual forced (and 'save') release of the tool
187 // ============================================================================
188 template <class PBASE>
190  if ( !algTool ) { return Error( "releaseTool(IAlgTool):: IAlgTool* points to NULL!" ); }
191  if ( !this->toolSvc() ) { return Error( "releaseTool(IAlgTool):: IToolSvc* points to NULL!" ); }
192  // find a tool in the list of active tools
193  auto it = std::find( m_managedTools.begin(), m_managedTools.end(), algTool );
194  if ( m_managedTools.end() == it ) { return Warning( "releaseTool(IAlgTool):: IAlgTool* is not active" ); }
195  // get the tool
196  IAlgTool* t = *it;
197  // cache name
198  const std::string name = t->name();
199  if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << "Releasing tool '" << name << "'" << endmsg; }
200  // remove the tool from the lists
201  base_class::deregisterTool( t );
202  m_managedTools.erase( it );
203  // release tool
204  if ( this->msgLevel( MSG::DEBUG ) ) {
205  this->debug() << "The tool '" << t->name() << "' of type '" << System::typeinfoName( typeid( *t ) )
206  << "' is released" << endmsg;
207  }
208  const StatusCode sc = this->toolSvc()->releaseTool( t );
209  return sc.isSuccess() ? sc : Warning( "releaseTool(IAlgTool):: error from IToolSvc releasing " + name, sc );
210 }
211 // ============================================================================
212 
213 // ============================================================================
214 // manual forced (and 'safe') release of the service
215 // ============================================================================
216 template <class PBASE>
218  if ( !Svc ) return Error( "releaseSvc(IInterface):: IInterface* points to NULL!" );
219  SmartIF<IService> svc{ const_cast<IInterface*>( Svc ) };
220  if ( !svc ) return Warning( "releaseSvc(IInterface):: IInterface* is not a service" );
221  auto it = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
222  if ( it == m_services.end() || !GaudiCommon_details::svc_eq( *it, svc ) ) {
223  return Warning( "releaseSvc(IInterface):: IInterface* is not active" );
224  }
225  if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << "Releasing service '" << ( *it )->name() << "'" << endmsg; }
226  m_services.erase( it );
227  return StatusCode::SUCCESS;
228 }
229 // ============================================================================
230 // ============================================================================
231 
232 // ============================================================================
233 // Add the given service to the list of active services
234 // ============================================================================
235 template <class PBASE>
237  if ( svc ) {
238  auto i = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
239  if ( i == std::end( m_services ) || !GaudiCommon_details::svc_eq( *i, svc ) ) {
240  m_services.insert( i, std::move( svc ) );
241  } else {
242  this->warning() << "Service " << svc->name() << " already present -- skipping" << endmsg;
243  }
244  }
245 }
246 // ============================================================================
247 
248 //=============================================================================
249 // Methods related to messaging
250 //=============================================================================
251 
252 // ============================================================================
253 // Print the error message and return status code
254 // ============================================================================
255 template <class PBASE>
256 StatusCode GaudiCommon<PBASE>::Error( std::string_view msg, const StatusCode st, const size_t mx ) const {
257  // increase local counter of errors
258  const size_t num = increment( m_errors, msg );
259  // If suppressed, just return
260  if ( num > mx ) {
261  return st;
262  } else if ( num == mx ) // issue one-time suppression message
263  {
264  return Print( std::string{ "The ERROR message is suppressed : '" }.append( msg ).append( "'" ), st, MSG::ERROR );
265  }
266  // return message
267  return Print( msg, st, MSG::ERROR );
268 }
269 // ============================================================================
270 
271 // ============================================================================
272 // Print the warning message and return status code
273 // ============================================================================
274 template <class PBASE>
275 StatusCode GaudiCommon<PBASE>::Warning( std::string_view msg, const StatusCode st, const size_t mx ) const {
276  // increase local counter of warnings
277  const size_t num = increment( m_warnings, msg );
278  // If suppressed, just return
279  if ( num > mx ) {
280  return st;
281  } else if ( num == mx ) // issue one-time suppression message
282  {
283  return Print( std::string{ "The WARNING message is suppressed : '" }.append( msg ).append( "'" ), st,
284  MSG::WARNING );
285  }
286  // return message
287  return Print( msg, st, MSG::WARNING );
288 }
289 // ============================================================================
290 
291 // ============================================================================
292 // Print the info message and return status code
293 // ============================================================================
294 template <class PBASE>
295 StatusCode GaudiCommon<PBASE>::Info( std::string_view msg, const StatusCode st, const size_t mx ) const {
296  // increase local counter of warnings
297  const size_t num = increment( m_infos, msg );
298  // If suppressed, just return
299  if ( num > mx ) {
300  return st;
301  } else if ( num == mx ) // issue one-time suppression message
302  {
303  return Print( std::string{ "The INFO message is suppressed : '" }.append( msg ).append( "'" ), st, MSG::INFO );
304  }
305  // return message
306  return Print( msg, st, MSG::INFO );
307 }
308 // ============================================================================
309 
310 // ============================================================================
311 // Print the message and return status code
312 // ============================================================================
313 template <class PBASE>
314 StatusCode GaudiCommon<PBASE>::Print( std::string_view msg, const StatusCode st, const MSG::Level lvl ) const {
315  // perform printout ?
316  if ( !this->msgLevel( lvl ) ) { return st; } // RETURN
317 
318  // use the predefined stream
319  MsgStream& str = this->msgStream( lvl );
320  if ( m_typePrint.value() ) { str << System::typeinfoName( typeid( *this ) ) << ":: "; }
321 
322  // print the message
323  str << msg;
324 
325  // test status code
326  if ( st.isSuccess() ) {
327  } else if ( StatusCode::FAILURE != st ) {
328  str << " StatusCode=" << st.getCode();
329  } else {
330  str << " StatusCode=FAILURE";
331  }
332 
333  // perform print operation
334  str << endmsg;
335 
336  // return
337  return st;
338 }
339 // ============================================================================
340 
341 // ============================================================================
342 // Create and (re)-throw the exception
343 // ============================================================================
344 template <class PBASE>
345 void GaudiCommon<PBASE>::Exception( std::string_view msg, const GaudiException& exc, const StatusCode sc ) const {
346  // increase local counter of exceptions
347  increment( m_exceptions, msg );
348  Print( std::string{ "Exception (re)throw: " }.append( msg ), sc, MSG::FATAL ).ignore();
349  throw GaudiException( ( this->name() + ":: " ).append( msg ), this->name(), sc, exc );
350 }
351 // ============================================================================
352 
353 // ============================================================================
354 // Create and (re)-throw the exception
355 // ============================================================================
356 template <class PBASE>
357 void GaudiCommon<PBASE>::Exception( std::string_view msg, const std::exception& exc, const StatusCode sc ) const {
358  // increase local counter of exceptions
359  increment( m_exceptions, msg );
360  Print( std::string{ "Exception (re)throw: " }.append( msg ), sc, MSG::FATAL ).ignore();
361  throw GaudiException( ( this->name() + ":: " ).append( msg ) + "(" + exc.what() + ")", "", sc );
362 }
363 // ============================================================================
364 
365 // ============================================================================
366 // Create and throw the exception
367 // ============================================================================
368 template <class PBASE>
369 void GaudiCommon<PBASE>::Exception( std::string_view msg, const StatusCode sc ) const {
370  // increase local counter of exceptions
371  increment( m_exceptions, msg );
372  Print( std::string{ "Exception throw: " }.append( msg ), sc, MSG::FATAL ).ignore();
373  throw GaudiException( ( this->name() + ":: " ).append( msg ), "", sc );
374 }
375 // ============================================================================
376 
377 // ============================================================================
378 // perform the actual printout of error counters
379 // ============================================================================
380 template <class PBASE>
382  auto print = [&]( const Counter& c, const auto& label ) {
383  for ( const auto& i : c ) {
384  this->msgStream( level ) << fmt::format( " #{:<10s} = {:<8d} Message = '{}'", label, i.second, i.first )
385  << endmsg;
386  }
387  };
388 
389  print( m_exceptions, "EXCEPTIONS" );
390  print( m_errors, "ERRORS" );
391  print( m_warnings, "WARNINGS" );
392  print( m_infos, "INFOS" );
393 
394  // return total number of errors+warnings+exceptions
395  return m_exceptions.size() + m_errors.size() + m_warnings.size() + m_infos.size();
396 }
397 // ============================================================================
398 
399 // ============================================================================
403 // ============================================================================
404 template <class PBASE>
406 
407  // print ALL properties
408  MsgStream& msg = this->msgStream( level );
409  const auto& properties = this->getProperties();
410  msg << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
411  << " #properties = " << properties.size() << endmsg;
412  for ( const auto& property : reverse( properties ) ) { msg << "Property ['Name': Value] = " << *property << endmsg; }
413  return properties.size();
414 }
415 // ============================================================================
416 
417 // ============================================================================
418 // Methods for dealing with the TES and TDS
419 // ============================================================================
420 
421 // ============================================================================
422 // put results into Gaudi Event Transient Store
423 // ============================================================================
424 template <class PBASE>
426  std::string_view location, const bool useRootInTES ) const {
427  // check arguments
428  Assert( svc, "put():: Invalid 'service'!" );
429  Assert( static_cast<bool>( object ), "put():: Invalid 'Object'!" );
430  Assert( !location.empty(), "put():: Invalid 'address' = '' " );
431  // final data location
432  const auto& fullLocation = this->fullTESLocation( location, useRootInTES );
433  // register the object!
434  const StatusCode status = '/' == fullLocation[0] ? svc->registerObject( fullLocation, object.get() )
435  : svc->registerObject( "/Event/" + fullLocation, object.get() );
436  // check the result!
437  DataObject& obj = *object;
438  if ( status.isFailure() ) {
439  Exception( "put():: could not register '" + System::typeinfoName( typeid( obj ) ) + "' at address '" +
440  fullLocation + "'",
441  status );
442  }
443  if ( this->msgLevel( MSG::DEBUG ) ) {
444  Print( "The object of type '" + System::typeinfoName( typeid( obj ) ) + "' is registered in TS at address '" +
445  fullLocation + "'",
446  status, MSG::DEBUG )
447  .ignore();
448  }
449  // if we get here, ownership has been transferred to the IDataProviderSvc
450  return object.release();
451 }
452 // ============================================================================
453 
454 // ============================================================================
455 // The END
456 // ============================================================================
GaudiCommon.h
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
GaudiTool.h
Gaudi::Utils::RegEx::matchList
Definition: RegEx.h:34
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:965
std::string
STL class.
IAlgTool
Definition: IAlgTool.h:33
std::exception
STL class.
GaudiCommon::printErrors
long printErrors(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of error counters
Definition: GaudiCommon.icpp:381
std::move
T move(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
MSG::INFO
@ INFO
Definition: IMessageSvc.h:25
System.h
GaudiCommon::releaseTool
StatusCode releaseTool(const IAlgTool *tool) const
manual forced (and 'safe') release of the tool
Definition: GaudiCommon.icpp:189
reverse
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:59
reverse.h
std::find
T find(T... args)
GaudiException
Definition: GaudiException.h:31
StatEntity.h
Algorithm.h
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:19
MSG::WARNING
@ WARNING
Definition: IMessageSvc.h:25
GaudiCommon_details::svc_lt
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
FixTESPathDetails::fullTESLocation
std::string fullTESLocation(std::string_view location, std::string_view rit)
Definition: FixTESPath.cpp:56
gaudirun.c
c
Definition: gaudirun.py:525
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:310
Counter
Definition: Counter.py:1
IDataProviderSvc.h
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:72
IToolSvc.h
bug_34121.t
t
Definition: bug_34121.py:30
GaudiCommon::initGaudiCommonConstructor
void initGaudiCommonConstructor(const IInterface *parent=nullptr)
Constructor initializations.
Definition: GaudiCommon.icpp:52
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
TimingHistograms.name
name
Definition: TimingHistograms.py:25
StatusCode
Definition: StatusCode.h:65
ObjectVector.h
GaudiAlgorithm
Definition: GaudiAlgorithm.h:104
GaudiCommon::Print
StatusCode Print(std::string_view msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
Print the message and return with the given StatusCode.
Definition: GaudiCommon.icpp:314
SmartDataPtr.h
GaudiCommon_details::svc_eq
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
SmartIF< IService >
GaudiCommon::Warning
StatusCode Warning(std::string_view msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the warning message and return with the given StatusCode.
Definition: GaudiCommon.icpp:275
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
GaudiCommon::releaseSvc
StatusCode releaseSvc(const IInterface *svc) const
manual forced (and 'safe') release of the service
Definition: GaudiCommon.icpp:217
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
GaudiCommon::addToServiceList
void addToServiceList(SmartIF< IService > svc) const
Add the given service to the list of acquired services.
Definition: GaudiCommon.icpp:236
GaudiCommon::release
StatusCode release(const IInterface *interface) const
Manual forced (and 'safe') release of the active tool or service.
Definition: GaudiCommon.icpp:176
gaudirun.level
level
Definition: gaudirun.py:364
MsgStream
Definition: MsgStream.h:34
MSG::FATAL
@ FATAL
Definition: IMessageSvc.h:25
std::string::append
T append(T... args)
gaudiComponentHelp.properties
properties
Definition: gaudiComponentHelp.py:69
Stat.h
SmartRef.h
RegEx.h
GaudiCommon::put
DataObject * put(IDataProviderSvc *svc, std::unique_ptr< DataObject > object, std::string_view location, const bool useRootInTES=true) const
Register a data object or container into Gaudi Event Transient Store.
Definition: GaudiCommon.icpp:425
GaudiCommon::initialize
StatusCode initialize() override
standard initialization method
Definition: GaudiCommon.icpp:76
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
Print.h
MSG::Level
Level
Definition: IMessageSvc.h:25
GaudiCommon::printProps
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
Definition: GaudiCommon.icpp:405
std::lower_bound
T lower_bound(T... args)
GaudiCommon::finalize
StatusCode finalize() override
standard finalization method
Definition: GaudiCommon.icpp:112
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
MSG::ALWAYS
@ ALWAYS
Definition: IMessageSvc.h:25
GaudiCommon::Exception
void Exception(std::string_view msg, const GaudiException &exc, const StatusCode sc=StatusCode::FAILURE) const
Create and (re)-throw a given GaudiException.
Definition: GaudiCommon.icpp:345
std::begin
T begin(T... args)
GaudiAlgorithm.h
MSG::ERROR
@ ERROR
Definition: IMessageSvc.h:25
IInterface
Definition: IInterface.h:237
DataObject
Definition: DataObject.h:40
StatusCode::getCode
code_t getCode() const
Retrieve value.
Definition: StatusCode.h:136
AlgTool.h
IProperty.h
std::end
T end(T... args)
IDataProviderSvc
Definition: IDataProviderSvc.h:53
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
ISvcLocator.h
GaudiCommon::Info
StatusCode Info(std::string_view msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
Print the info message and return with the given StatusCode.
Definition: GaudiCommon.icpp:295
std::unique_ptr
STL class.
GaudiTool
Definition: GaudiTool.h:110
ProduceConsume.key
key
Definition: ProduceConsume.py:81
GaudiCommon::Error
StatusCode Error(std::string_view msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
Definition: GaudiCommon.icpp:256
IDataManagerSvc.h
std::exception::what
T what(T... args)
MsgStream.h