Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GaudiCommon.icpp
Go to the documentation of this file.
1 // ============================================================================
2 // include files
3 // ============================================================================
4 // STL & STD
5 // ============================================================================
6 #include <algorithm>
7 #include <cstdlib>
8 #include <numeric>
9 // ============================================================================
10 /* @file GaudiCommon.cpp
11  *
12  * Implementation file for class : GaudiCommon
13  *
14  * @author Chris Jones Christopher.Rob.Jones@cern.ch
15  * @author Vanya BELYAEV Ivan.Belyaev@itep.ru
16  * @author Rob Lambert Rob.Lambert@cern.ch
17  * @date 2009-08-04
18  */
19 // GaudiKernel
20 // ============================================================================
21 #include "GaudiKernel/AlgTool.h"
22 #include "GaudiKernel/Algorithm.h"
26 #include "GaudiKernel/IProperty.h"
28 #include "GaudiKernel/IToolSvc.h"
29 #include "GaudiKernel/MsgStream.h"
31 #include "GaudiKernel/Property.h"
33 #include "GaudiKernel/SmartRef.h"
34 #include "GaudiKernel/Stat.h"
35 #include "GaudiKernel/StatEntity.h"
36 #include "GaudiKernel/System.h"
37 #include "GaudiKernel/reverse.h"
38 // ============================================================================
39 // GaudiAlg
40 // ============================================================================
42 #include "GaudiAlg/GaudiCommon.h"
43 #include "GaudiAlg/GaudiTool.h"
44 #include "GaudiAlg/Print.h"
45 // ============================================================================
46 // GaudiUtils
47 // ============================================================================
48 #include "GaudiUtils/RegEx.h"
49 // ============================================================================
50 // Boost
51 // ============================================================================
52 #include "boost/format.hpp"
53 #include "boost/tokenizer.hpp"
54 // ============================================================================
55 // Disable warning on windows
56 #ifdef _WIN32
57 # pragma warning( disable : 4661 ) // incomplete explicit templates
58 #endif
59 // ============================================================================
60 
61 // ============================================================================
62 // constructor initialisation
63 // ============================================================================
64 template <class PBASE>
66  // setup context from parent if available
67  if ( parent ) {
68  if ( const GaudiAlgorithm* gAlg = dynamic_cast<const GaudiAlgorithm*>( parent ) ) {
69  m_context = gAlg->context();
70  m_rootInTES = gAlg->rootInTES();
71  } else if ( const GaudiTool* gTool = dynamic_cast<const GaudiTool*>( parent ) ) {
72  m_context = gTool->context();
73  m_rootInTES = gTool->rootInTES();
74  }
75  }
76 
77  // Get the job option service
78  auto jos = PBASE::template service<IJobOptionsSvc>( "JobOptionsSvc" );
79  if ( !jos ) Exception( "Cannot get JobOptionsSvc" );
80 
81  // Get the "Context" option if in the file...
82  const auto myList = jos->getProperties( this->name() );
83  if ( myList ) {
84  // Iterate over the list to set the options
85  for ( const auto& iter : *myList ) {
86  const Gaudi::Property<std::string>* sp = dynamic_cast<const Gaudi::Property<std::string>*>( iter );
87  if ( sp ) {
88  if ( iter->name().compare( "Context" ) == 0 ) {
89  m_context = sp->value();
90  } else if ( iter->name().compare( "RootInTES" ) == 0 ) {
91  m_rootInTES = sp->value();
92  }
93  }
94  }
95  }
96 }
97 //=============================================================================
98 
99 //=============================================================================
100 // Initialise the common functionality
101 //=============================================================================
102 template <class PBASE>
104 
105  // initialize base class
106  const StatusCode sc = PBASE::initialize();
107  if ( sc.isFailure() ) { return Error( "Failed to initialise base class PBASE", sc ); }
108 
109  // some debug printout
110  if ( this->msgLevel( MSG::DEBUG ) ) {
111  this->debug() << "Initialize base class GaudiCommon<" << System::typeinfoName( typeid( PBASE ) ) << ">" << endmsg;
112  if ( !context().empty() ) this->debug() << "Created with context = '" << context() << "'" << endmsg;
113  }
114 
115  // Check rootInTES ends with a /
116  if ( !m_rootInTES.empty() && m_rootInTES[m_rootInTES.size() - 1] != '/' ) m_rootInTES = m_rootInTES + "/";
117 
118  // Set up the CounterSummarySvc May need to be changed
119  m_counterSummarySvc = this->svcLoc()->service( "CounterSummarySvc", false );
120  if ( this->msgLevel( MSG::DEBUG ) ) {
121  if ( !m_counterSummarySvc )
122  this->debug() << "could not locate CounterSummarySvc, no counter summary will be made" << endmsg;
123  else
124  this->debug() << "found CounterSummarySvc OK" << endmsg;
125  }
126 
127  // properties will be printed if asked for or in "MSG::DEBUG" mode
128  if ( propsPrint() ) {
129  printProps( MSG::ALWAYS );
130  } else if ( this->msgLevel( MSG::DEBUG ) ) {
131  printProps( MSG::DEBUG );
132  }
133 
134  // update DataHandles to point to full TES location
135 
136  // get root of DataManager
137  SmartIF<IDataManagerSvc> dataMgrSvc( PBASE::evtSvc() );
138  auto rootName = dataMgrSvc->rootName();
139  if ( !rootName.empty() && '/' != rootName.back() ) rootName += "/";
140 
141  auto fixLocation = [this, rootName]( const std::string& location ) -> std::string {
142  auto tokens = boost::tokenizer<boost::char_separator<char>>{location, boost::char_separator<char>{":"}};
143  auto result =
144  std::accumulate( tokens.begin(), tokens.end(), std::string{}, [&]( std::string s, const std::string& tok ) {
145  std::string r = fullTESLocation( tok, UseRootInTES );
146  // check whether we have an absolute path if yes use it - else prepend DataManager Root
147  if ( r[0] != '/' ) r = rootName + r;
148  return s.empty() ? r : s + ':' + r;
149  } );
150  if ( result != location && this->msgLevel( MSG::DEBUG ) )
151  this->debug() << "Changing " << location << " to " << result << endmsg;
152  return result;
153  };
154 
155  class DHHFixer : public IDataHandleVisitor {
156  public:
157  DHHFixer( std::function<std::string( const std::string& )> f ) : m_f( std::move( f ) ) {}
158  void visit( const IDataHandleHolder* idhh ) override {
159  if ( !idhh ) return;
160 
161  std::string r;
162  for ( auto h : idhh->inputHandles() ) {
163  r = m_f( h->objKey() );
164  if ( r != h->objKey() ) h->updateKey( r );
165  }
166  for ( auto h : idhh->outputHandles() ) {
167  r = m_f( h->objKey() );
168  if ( r != h->objKey() ) h->updateKey( r );
169  }
170  }
171 
172  private:
174  };
175 
176  this->m_updateDataHandles = std::make_unique<DHHFixer>( fixLocation );
177 
178  return sc;
179 }
180 //=============================================================================
181 
182 //=============================================================================
183 // Finalize the common functionality
184 //=============================================================================
185 template <class PBASE>
188 
189  // print the general information about statistical counters
190  if ( this->msgLevel( MSG::DEBUG ) || ( statPrint() && this->nCounters() > 0 ) ) {
191  // print general statistical counters
192  printStat( statPrint() ? MSG::ALWAYS : MSG::DEBUG );
193  }
194  // add all counters to the CounterSummarySvc
195  if ( m_counterSummarySvc && this->svcLoc()->existsService( "CounterSummarySvc" ) ) {
196  if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
197 
198  Gaudi::Utils::RegEx::matchList statList{m_statEntityList.value()};
199  Gaudi::Utils::RegEx::matchList counterList{m_counterList.value()};
200 
201  for ( const auto& i : m_countersOwn ) {
202  if ( statList.Or( i.first ) )
203  m_counterSummarySvc->addCounter( this->name(), i.first, i.second, Gaudi::CounterSummary::SaveStatEntity );
204  else if ( counterList.Or( i.first ) )
205  m_counterSummarySvc->addCounter( this->name(), i.first, i.second );
206  }
207  }
208  // release all located tools and services
209  if ( this->msgLevel( MSG::DEBUG ) ) {
210  this->debug() << "Tools to release :";
211  for ( const auto& i : m_managedTools ) { this->debug() << " " << i->name(); }
212  this->debug() << endmsg;
213  }
214  while ( !m_managedTools.empty() ) {
215  sc = ( releaseTool( m_managedTools.back() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
216  }
217 
218  // release all located services
219  if ( this->msgLevel( MSG::DEBUG ) ) {
220  this->debug() << "Services to release :";
221  for ( const auto& i : m_services ) this->debug() << " " << i->name();
222  this->debug() << endmsg;
223  }
224  while ( !m_services.empty() ) {
225  sc = ( releaseSvc( m_services.front() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
226  }
227 
228  // release the CounterSummarySvc manually
229  m_counterSummarySvc.reset();
230 
231  // format printout
232  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() ) {
233  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : " << m_exceptions.size() << "/" << m_errors.size()
234  << "/" << m_warnings.size() << "/" << m_infos.size() << endmsg;
235  if ( errorsPrint() ) { printErrors(); }
236  }
237 
238  // clear *ALL* counters explicitly
239  this->clearCounters();
240  m_countersOwn.clear(); // then delete any owned counters
241  m_exceptions.clear();
242  m_infos.clear();
243  m_warnings.clear();
244  m_errors.clear();
245  m_counterList.clear();
246  m_statEntityList.clear();
247 
248  // finalize base class
249  return ( sc && PBASE::finalize() ? StatusCode::SUCCESS : StatusCode::FAILURE );
250 }
251 //=============================================================================
252 
253 //=============================================================================
254 // Methods related to tools and services
255 //=============================================================================
256 
257 // ============================================================================
258 // manual forced (and 'safe') release of the active tool or service
259 // ============================================================================
260 template <class PBASE>
262  if ( !interface ) { return Error( "release(IInterface):: IInterface* points to NULL!" ); }
263  // dispatch between tools and services
264  const IAlgTool* algTool = dynamic_cast<const IAlgTool*>( interface );
265  // perform the actual release
266  return algTool ? releaseTool( algTool ) : releaseSvc( interface );
267 }
268 // ============================================================================
269 
270 // ============================================================================
271 // manual forced (and 'save') release of the tool
272 // ============================================================================
273 template <class PBASE>
275  if ( !algTool ) { return Error( "releaseTool(IAlgTool):: IAlgTool* points to NULL!" ); }
276  if ( !this->toolSvc() ) { return Error( "releaseTool(IAlgTool):: IToolSvc* points to NULL!" ); }
277  // find a tool in the list of active tools
278  auto it = std::find( m_managedTools.begin(), m_managedTools.end(), algTool );
279  if ( m_managedTools.end() == it ) { return Warning( "releaseTool(IAlgTool):: IAlgTool* is not active" ); }
280  // get the tool
281  IAlgTool* t = *it;
282  // cache name
283  const std::string name = t->name();
284  if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << "Releasing tool '" << name << "'" << endmsg; }
285  // remove the tool from the lists
286  PBASE::deregisterTool( t );
287  m_managedTools.erase( it );
288  // release tool
289  if ( this->msgLevel( MSG::DEBUG ) ) {
290  this->debug() << "The tool '" << t->name() << "' of type '" << System::typeinfoName( typeid( *t ) )
291  << "' is released" << endmsg;
292  }
293  const StatusCode sc = this->toolSvc()->releaseTool( t );
294  return sc.isSuccess() ? sc : Warning( "releaseTool(IAlgTool):: error from IToolSvc releasing " + name, sc );
295 }
296 // ============================================================================
297 
298 // ============================================================================
299 // manual forced (and 'safe') release of the service
300 // ============================================================================
301 template <class PBASE>
303  if ( !Svc ) return Error( "releaseSvc(IInterface):: IInterface* points to NULL!" );
304  SmartIF<IService> svc{const_cast<IInterface*>( Svc )};
305  if ( !svc ) return Warning( "releaseSvc(IInterface):: IInterface* is not a service" );
306  auto it = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
307  if ( it == m_services.end() || !GaudiCommon_details::svc_eq( *it, svc ) ) {
308  return Warning( "releaseSvc(IInterface):: IInterface* is not active" );
309  }
310  if ( this->msgLevel( MSG::DEBUG ) ) { this->debug() << "Releasing service '" << ( *it )->name() << "'" << endmsg; }
311  m_services.erase( it );
312  return StatusCode::SUCCESS;
313 }
314 // ============================================================================
315 // ============================================================================
316 
317 // ============================================================================
318 // Add the given service to the list of active services
319 // ============================================================================
320 template <class PBASE>
322  if ( svc ) {
323  auto i = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
324  if ( i == std::end( m_services ) || !GaudiCommon_details::svc_eq( *i, svc ) ) {
325  m_services.insert( i, std::move( svc ) );
326  } else {
327  this->warning() << "Service " << svc->name() << " already present -- skipping" << endmsg;
328  }
329  }
330 }
331 // ============================================================================
332 
333 //=============================================================================
334 // Methods related to messaging
335 //=============================================================================
336 
337 // ============================================================================
338 // Print the error message and return status code
339 // ============================================================================
340 template <class PBASE>
341 StatusCode GaudiCommon<PBASE>::Error( const std::string& msg, const StatusCode st, const size_t mx ) const {
342  // increase local counter of errors
343  const size_t num = ++m_errors[msg];
344  // If suppressed, just return
345  if ( num > mx ) {
346  return st;
347  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
348  {
349  return Print( "The ERROR message is suppressed : '" + msg + "'", st, MSG::ERROR );
350  }
351  // return message
352  return Print( msg, st, MSG::ERROR );
353 }
354 // ============================================================================
355 
356 // ============================================================================
357 // Print the warning message and return status code
358 // ============================================================================
359 template <class PBASE>
360 StatusCode GaudiCommon<PBASE>::Warning( const std::string& msg, const StatusCode st, const size_t mx ) const {
361  // increase local counter of warnings
362  const size_t num = ++m_warnings[msg];
363  // If suppressed, just return
364  if ( num > mx ) {
365  return st;
366  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
367  {
368  return Print( "The WARNING message is suppressed : '" + msg + "'", st, MSG::WARNING );
369  }
370  // return message
371  return Print( msg, st, MSG::WARNING );
372 }
373 // ============================================================================
374 
375 // ============================================================================
376 // Print the info message and return status code
377 // ============================================================================
378 template <class PBASE>
379 StatusCode GaudiCommon<PBASE>::Info( const std::string& msg, const StatusCode st, const size_t mx ) const {
380  // increase local counter of warnings
381  const size_t num = ++m_infos[msg];
382  // If suppressed, just return
383  if ( num > mx ) {
384  return st;
385  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
386  {
387  return Print( "The INFO message is suppressed : '" + msg + "'", st, MSG::INFO );
388  }
389  // return message
390  return Print( msg, st, MSG::INFO );
391 }
392 // ============================================================================
393 
394 // ============================================================================
395 // Print the message and return status code
396 // ============================================================================
397 template <class PBASE>
399  // perform printout ?
400  if ( !this->msgLevel( lvl ) ) { return st; } // RETURN
401 
402  // use the predefined stream
403  MsgStream& str = this->msgStream( lvl );
404  if ( typePrint() ) { str << System::typeinfoName( typeid( *this ) ) << ":: "; }
405 
406  // print the message
407  str << msg;
408 
409  // test status code
410  if ( st.isSuccess() ) {
411  } else if ( StatusCode::FAILURE != st ) {
412  str << " StatusCode=" << st.getCode();
413  } else {
414  str << " StatusCode=FAILURE";
415  }
416 
417  // perform print operation
418  str << endmsg;
419 
420  // return
421  return st;
422 }
423 // ============================================================================
424 
425 // ============================================================================
426 // Create and (re)-throw the exception
427 // ============================================================================
428 template <class PBASE>
429 void GaudiCommon<PBASE>::Exception( const std::string& msg, const GaudiException& exc, const StatusCode sc ) const {
430  // increase local counter of exceptions
431  ++m_exceptions[msg];
432  Print( "Exception (re)throw: " + msg, sc, MSG::FATAL ).ignore();
433  throw GaudiException( this->name() + ":: " + msg, this->name(), sc, exc );
434 }
435 // ============================================================================
436 
437 // ============================================================================
438 // Create and (re)-throw the exception
439 // ============================================================================
440 template <class PBASE>
441 void GaudiCommon<PBASE>::Exception( const std::string& msg, const std::exception& exc, const StatusCode sc ) const {
442  // increase local counter of exceptions
443  ++m_exceptions[msg];
444  Print( "Exception (re)throw: " + msg, sc, MSG::FATAL ).ignore();
445  throw GaudiException( this->name() + ":: " + msg + "(" + exc.what() + ")", "", sc );
446 }
447 // ============================================================================
448 
449 // ============================================================================
450 // Create and throw the exception
451 // ============================================================================
452 template <class PBASE>
453 void GaudiCommon<PBASE>::Exception( const std::string& msg, const StatusCode sc ) const {
454  // increase local counter of exceptions
455  ++m_exceptions[msg];
456  Print( "Exception throw: " + msg, sc, MSG::FATAL ).ignore();
457  throw GaudiException( this->name() + ":: " + msg, "", sc );
458 }
459 // ============================================================================
460 
461 // ============================================================================
462 // perform the actual printout of counters
463 // ============================================================================
464 template <class PBASE>
466  // check how many counters think they should be printed or how many
467  // we anyway want to print
468  auto countToBePrinted = [&]() {
469  unsigned n = 0;
470  this->forEachCounter( [&n]( const std::string&, const auto& counter ) { n += counter.toBePrinted(); } );
471  return n;
472  };
473  auto nbPrintedCounters =
474  ( ( !m_printEmptyCounters && !this->msgLevel( MSG::DEBUG ) ) ? countToBePrinted() : this->nCounters() );
475  // in case nothing should be printed, let's stop here
476  if ( nbPrintedCounters == 0 ) return 0;
477  MsgStream& msg = this->msgStream( level );
478  msg << "Number of counters : " << nbPrintedCounters << "\n" << m_header.value();
479  this->forEachCounter( [&]( const std::string& label, const auto& counter ) {
480  if ( m_printEmptyCounters || this->msgLevel( MSG::DEBUG ) || counter.toBePrinted() ) {
481  std::ostringstream ost;
482  counter.print( ost, label );
483  msg << "\n" << ost.str();
484  }
485  } );
486  //
487  msg << endmsg;
488  //
489  return nbPrintedCounters;
490 }
491 // ============================================================================
492 
493 // ============================================================================
494 // perform the actual printout of error counters
495 // ============================================================================
496 template <class PBASE>
498  // format for printout
499  boost::format ftm( " #%|-10s| = %|.8s| %|23t| Message = '%s'" );
500 
501  auto print = [&]( const Counter& c, const std::string& label ) {
502  for ( const auto& i : c ) { this->msgStream( level ) << ( ftm % label % i.second % i.first ) << endmsg; }
503  };
504 
505  print( m_exceptions, "EXCEPTIONS" );
506  print( m_errors, "ERRORS" );
507  print( m_warnings, "WARNINGS" );
508  print( m_infos, "INFOS" );
509 
510  // return total number of errors+warnings+exceptions
511  return m_exceptions.size() + m_errors.size() + m_warnings.size() + m_infos.size();
512 }
513 // ============================================================================
514 
515 // ============================================================================
519 // ============================================================================
520 template <class PBASE>
522 
523  // print ALL properties
524  MsgStream& msg = this->msgStream( level );
525  const auto& properties = this->getProperties();
526  msg << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
527  << " #properties = " << properties.size() << endmsg;
528  for ( const auto& property : reverse( properties ) ) { msg << "Property ['Name': Value] = " << *property << endmsg; }
529  return properties.size();
530 }
531 // ============================================================================
532 
533 // ============================================================================
534 // Methods for dealing with the TES and TDS
535 // ============================================================================
536 
537 // ============================================================================
538 // put results into Gaudi Event Transient Store
539 // ============================================================================
540 template <class PBASE>
542  const std::string& location, const bool useRootInTES ) const {
543  // check arguments
544  Assert( svc, "put():: Invalid 'service'!" );
545  Assert( static_cast<bool>( object ), "put():: Invalid 'Object'!" );
546  Assert( !location.empty(), "put():: Invalid 'address' = '' " );
547  // final data location
548  const std::string& fullLocation = fullTESLocation( location, useRootInTES );
549  // register the object!
550  const StatusCode status = '/' == fullLocation[0] ? svc->registerObject( fullLocation, object.get() )
551  : svc->registerObject( "/Event/" + fullLocation, object.get() );
552  // check the result!
553  if ( status.isFailure() ) {
554  Exception( "put():: could not register '" + System::typeinfoName( typeid( *object ) ) + "' at address '" +
555  fullLocation + "'",
556  status );
557  }
558  if ( this->msgLevel( MSG::DEBUG ) ) {
559  Print( "The object of type '" + System::typeinfoName( typeid( *object ) ) + "' is registered in TS at address '" +
560  fullLocation + "'",
561  status, MSG::DEBUG )
562  .ignore();
563  }
564  // if we get here, ownership has been transferred to the IDataProviderSvc
565  return object.release();
566 }
567 // ============================================================================
568 
569 // ============================================================================
570 // The END
571 // ============================================================================
#define UNLIKELY(x)
Definition: Kernel.h:89
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
T empty(T...args)
Header file for class GaudiAlgorithm.
Define general base for Gaudi exception.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
StatusCode releaseSvc(const IInterface *svc) const
manual forced (and &#39;safe&#39;) release of the service
Implementation of property with value of concrete type.
Definition: Property.h:352
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:309
void addToServiceList(SmartIF< IService > svc) const
Add the given service to the list of acquired services.
constexpr const struct GaudiCommon_details::svc_eq_t svc_eq
bool isSuccess() const
Definition: StatusCode.h:267
WARN_UNUSED StatusCode Error(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the error message and return with the given StatusCode.
::details::reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:49
Header file for class GaudiAlgorithm.
Gaudi::Details::PropertyBase * property(const std::string &name) const
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
T end(T...args)
StatusCode finalize() override
standard finalization method
Data provider interface definition.
T lower_bound(T...args)
bool isFailure() const
Definition: StatusCode.h:130
STL class.
virtual std::vector< Gaudi::DataHandle * > inputHandles() const =0
virtual std::vector< Gaudi::DataHandle * > outputHandles() const =0
virtual void visit(const IDataHandleHolder *)=0
constexpr const struct GaudiCommon_details::svc_lt_t svc_lt
T what(T...args)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Definition of the basic interface.
Definition: IInterface.h:244
WARN_UNUSED StatusCode Print(const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
Print the message and return with the given StatusCode.
DataObject * put(IDataProviderSvc *svc, std::unique_ptr< DataObject > object, const std::string &location, const bool useRootInTES=true) const
Register a data object or container into Gaudi Event Transient Store.
The useful base class for data processing algorithms.
WARN_UNUSED StatusCode Warning(const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
Print the warning message and return with the given StatusCode.
collection of useful utilities to print certain objects (currently used for implementation in class G...
STL class.
virtual const std::string & rootName() const =0
Get Name of root Event.
T move(T...args)
StatusCode initialize() override
standard initialization method
T find(T...args)
StatusCode registerObject(boost::string_ref fullPath, DataObject *pObject)
Register object with the data store.
STL class.
T begin(T...args)
StatusCode releaseTool(const IAlgTool *tool) const
manual forced (and &#39;safe&#39;) release of the tool
The interface implemented by the AlgTool base class.
Definition: IAlgTool.h:23
string s
Definition: gaudirun.py:312
constexpr static const auto FAILURE
Definition: StatusCode.h:86
The useful base class for tools.
Definition: GaudiTool.h:101
WARN_UNUSED StatusCode Info(const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
Print the info message and return with the given StatusCode.
const ValueType & value() const
Backward compatibility (.
Definition: Property.h:525
code_t getCode() const
Retrieve value ("checks" the StatusCode)
Definition: StatusCode.h:137
long printStat(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of statistical counters
T accumulate(T...args)
const std::vector< Gaudi::Details::PropertyBase * > & getProperties() const override
get all properties
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
StatusCode release(const IInterface *interface) const
Manual forced (and &#39;safe&#39;) release of the active tool or service.
long printProps(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of properties
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
virtual const std::string & name() const =0
Retrieve the name of the instance.
void initGaudiCommonConstructor(const IInterface *parent=nullptr)
Constructor initializations.
long printErrors(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of error counters
void Exception(const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
Create and (re)-throw a given GaudiException.