The Gaudi Framework  v30r4 (9b837755)
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 #include <boost/none.hpp>
55 #include <boost/optional.hpp>
56 // ============================================================================
57 // Disable warning on windows
58 #ifdef _WIN32
59 #pragma warning( disable : 4661 ) // incomplete explicit templates
60 #endif
61 // ============================================================================
62 
63 // ============================================================================
64 // constructor initialisation
65 // ============================================================================
66 template <class PBASE>
68 {
69  // setup context from parent if available
70  if ( parent ) {
71  if ( const GaudiAlgorithm* gAlg = dynamic_cast<const GaudiAlgorithm*>( parent ) ) {
72  m_context = gAlg->context();
73  m_rootInTES = gAlg->rootInTES();
74  } else if ( const GaudiTool* gTool = dynamic_cast<const GaudiTool*>( parent ) ) {
75  m_context = gTool->context();
76  m_rootInTES = gTool->rootInTES();
77  }
78  }
79 
80  // Get the job option service
81  auto jos = PBASE::template service<IJobOptionsSvc>( "JobOptionsSvc" );
82  if ( !jos ) Exception( "Cannot get JobOptionsSvc" );
83 
84  // Get the "Context" option if in the file...
85  const auto myList = jos->getProperties( this->name() );
86  if ( myList ) {
87  // Iterate over the list to set the options
88  for ( const auto& iter : *myList ) {
89  const Gaudi::Property<std::string>* sp = dynamic_cast<const Gaudi::Property<std::string>*>( iter );
90  if ( sp ) {
91  if ( iter->name().compare( "Context" ) == 0 ) {
92  m_context = sp->value();
93  } else if ( iter->name().compare( "RootInTES" ) == 0 ) {
94  m_rootInTES = sp->value();
95  }
96  }
97  }
98  }
99 }
100 //=============================================================================
101 
102 //=============================================================================
103 // Initialise the common functionality
104 //=============================================================================
105 template <class PBASE>
107 #ifdef __ICC
108  i_gcInitialize
109 #else
110  initialize
111 #endif
112  ()
113 {
114 
115  // initialize base class
116  const StatusCode sc = PBASE::initialize();
117  if ( sc.isFailure() ) {
118  return Error( "Failed to initialise base class PBASE", sc );
119  }
120 
121  // some debug printout
122  if ( this->msgLevel( MSG::DEBUG ) ) {
123  this->debug() << "Initialize base class GaudiCommon<" << System::typeinfoName( typeid( PBASE ) ) << ">" << endmsg;
124  if ( !context().empty() ) this->debug() << "Created with context = '" << context() << "'" << endmsg;
125  }
126 
127  // Check rootInTES ends with a /
128  if ( !m_rootInTES.empty() && m_rootInTES[m_rootInTES.size() - 1] != '/' ) m_rootInTES = m_rootInTES + "/";
129 
130  // Set up the CounterSummarySvc May need to be changed
131  m_counterSummarySvc = this->svcLoc()->service( "CounterSummarySvc", false );
132  if ( this->msgLevel( MSG::DEBUG ) ) {
133  if ( !m_counterSummarySvc )
134  this->debug() << "could not locate CounterSummarySvc, no counter summary will be made" << endmsg;
135  else
136  this->debug() << "found CounterSummarySvc OK" << endmsg;
137  }
138 
139  // properties will be printed if asked for or in "MSG::DEBUG" mode
140  if ( propsPrint() ) {
141  printProps( MSG::ALWAYS );
142  } else if ( this->msgLevel( MSG::DEBUG ) ) {
143  printProps( MSG::DEBUG );
144  }
145 
146  // update DataHandles to point to full TES location
147 
148  // get root of DataManager
149  SmartIF<IDataManagerSvc> dataMgrSvc( PBASE::evtSvc() );
150  auto rootName = dataMgrSvc->rootName();
151  if ( !rootName.empty() && '/' != rootName.back() ) rootName += "/";
152 
153  auto fixLocation = [this, rootName]( const DataObjID& id ) -> boost::optional<DataObjID> {
154  // Compute the updated location
155  const std::string& location = id.key();
156  auto tokens = boost::tokenizer<boost::char_separator<char>>{location, boost::char_separator<char>{":"}};
157  auto fixedLocation =
158  std::accumulate( tokens.begin(), tokens.end(), std::string{}, [&]( std::string s, const std::string& tok ) {
159  std::string r = fullTESLocation( tok, UseRootInTES );
160  // check whether we have an absolute path if yes use it - else prepend DataManager Root
161  if ( r[0] != '/' ) r = rootName + r;
162  return s.empty() ? r : s + ':' + r;
163  } );
164 
165  // If no change occured, signal it to the caller with an empty optional
166  if ( fixedLocation == location ) return boost::none;
167 
168  // Else compute and return an updated DataObjID
169  if ( this->msgLevel( MSG::DEBUG ) ) {
170  this->debug() << "Changing " << location << " to " << fixedLocation << endmsg;
171  }
172  DataObjID result = id;
173  result.updateKey( fixedLocation );
174  return result;
175  };
176 
177  this->m_updateDependencies = fixLocation;
178 
179  return sc;
180 }
181 //=============================================================================
182 
183 //=============================================================================
184 // Finalize the common functionality
185 //=============================================================================
186 template <class PBASE>
188 #ifdef __ICC
189  i_gcFinalize
190 #else
191  finalize
192 #endif
193  ()
194 {
196 
197  // print the general information about statistical counters
198  if ( this->msgLevel( MSG::DEBUG ) || ( statPrint() && !m_counters.empty() ) ) {
199  // print general statistical counters
200  printStat( statPrint() ? MSG::ALWAYS : MSG::DEBUG );
201  }
202  // add all counters to the CounterSummarySvc
203  if ( m_counterSummarySvc && this->svcLoc()->existsService( "CounterSummarySvc" ) ) {
204  if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
205 
206  Gaudi::Utils::RegEx::matchList statList{m_statEntityList.value()};
207  Gaudi::Utils::RegEx::matchList counterList{m_counterList.value()};
208 
209  for ( const auto& i : m_countersOwn ) {
210  if ( statList.Or( i.first ) )
211  m_counterSummarySvc->addCounter( this->name(), i.first, i.second, Gaudi::CounterSummary::SaveStatEntity );
212  else if ( counterList.Or( i.first ) )
213  m_counterSummarySvc->addCounter( this->name(), i.first, i.second );
214  }
215  }
216  // release all located tools and services
217  if ( this->msgLevel( MSG::DEBUG ) ) {
218  this->debug() << "Tools to release :";
219  for ( const auto& i : m_managedTools ) {
220  this->debug() << " " << i->name();
221  }
222  this->debug() << endmsg;
223  }
224  while ( !m_managedTools.empty() ) {
225  sc = ( releaseTool( m_managedTools.back() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
226  }
227 
228  // release all located services
229  if ( this->msgLevel( MSG::DEBUG ) ) {
230  this->debug() << "Services to release :";
231  for ( const auto& i : m_services ) this->debug() << " " << i->name();
232  this->debug() << endmsg;
233  }
234  while ( !m_services.empty() ) {
235  sc = ( releaseSvc( m_services.front() ) && sc ) ? StatusCode::SUCCESS : StatusCode::FAILURE;
236  }
237 
238  // release the CounterSummarySvc manually
239  m_counterSummarySvc.reset();
240 
241  // format printout
242  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() ) {
243  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : " << m_exceptions.size() << "/" << m_errors.size()
244  << "/" << m_warnings.size() << "/" << m_infos.size() << endmsg;
245  if ( errorsPrint() ) {
246  printErrors();
247  }
248  }
249 
250  // clear *ALL* counters explicitly
251  m_counters.clear(); // delete pointers first
252  m_countersOwn.clear(); // then delete any owned counters
253  m_exceptions.clear();
254  m_infos.clear();
255  m_warnings.clear();
256  m_errors.clear();
257  m_counterList.clear();
258  m_statEntityList.clear();
259 
260  // finalize base class
261  return ( sc && PBASE::finalize() ? StatusCode::SUCCESS : StatusCode::FAILURE );
262 }
263 //=============================================================================
264 
265 //=============================================================================
266 // Methods related to tools and services
267 //=============================================================================
268 
269 // ============================================================================
270 // manual forced (and 'safe') release of the active tool or service
271 // ============================================================================
272 template <class PBASE>
274 {
275  if ( !interface ) {
276  return Error( "release(IInterface):: IInterface* points to NULL!" );
277  }
278  // dispatch between tools and services
279  const IAlgTool* algTool = dynamic_cast<const IAlgTool*>( interface );
280  // perform the actual release
281  return algTool ? releaseTool( algTool ) : releaseSvc( interface );
282 }
283 // ============================================================================
284 
285 // ============================================================================
286 // manual forced (and 'save') release of the tool
287 // ============================================================================
288 template <class PBASE>
290 {
291  if ( !algTool ) {
292  return Error( "releaseTool(IAlgTool):: IAlgTool* points to NULL!" );
293  }
294  if ( !this->toolSvc() ) {
295  return Error( "releaseTool(IAlgTool):: IToolSvc* points to NULL!" );
296  }
297  // find a tool in the list of active tools
298  auto it = std::find( m_managedTools.begin(), m_managedTools.end(), algTool );
299  if ( m_managedTools.end() == it ) {
300  return Warning( "releaseTool(IAlgTool):: IAlgTool* is not active" );
301  }
302  // get the tool
303  IAlgTool* t = *it;
304  // cache name
305  const std::string name = t->name();
306  if ( this->msgLevel( MSG::DEBUG ) ) {
307  this->debug() << "Releasing tool '" << name << "'" << endmsg;
308  }
309  // remove the tool from the lists
310  PBASE::deregisterTool( t );
311  m_managedTools.erase( it );
312  // release tool
313  if ( this->msgLevel( MSG::DEBUG ) ) {
314  this->debug() << "The tool '" << t->name() << "' of type '" << System::typeinfoName( typeid( *t ) )
315  << "' is released" << endmsg;
316  }
317  const StatusCode sc = this->toolSvc()->releaseTool( t );
318  return sc.isSuccess() ? sc : Warning( "releaseTool(IAlgTool):: error from IToolSvc releasing " + name, sc );
319 }
320 // ============================================================================
321 
322 // ============================================================================
323 // manual forced (and 'safe') release of the service
324 // ============================================================================
325 template <class PBASE>
327 {
328  if ( !Svc ) return Error( "releaseSvc(IInterface):: IInterface* points to NULL!" );
329  SmartIF<IService> svc{const_cast<IInterface*>( Svc )};
330  if ( !svc ) return Warning( "releaseSvc(IInterface):: IInterface* is not a service" );
331  auto it = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
332  if ( it == m_services.end() || !GaudiCommon_details::svc_eq( *it, svc ) ) {
333  return Warning( "releaseSvc(IInterface):: IInterface* is not active" );
334  }
335  if ( this->msgLevel( MSG::DEBUG ) ) {
336  this->debug() << "Releasing service '" << ( *it )->name() << "'" << endmsg;
337  }
338  m_services.erase( it );
339  return StatusCode::SUCCESS;
340 }
341 // ============================================================================
342 // ============================================================================
343 
344 // ============================================================================
345 // Add the given service to the list of active services
346 // ============================================================================
347 template <class PBASE>
349 {
350  if ( svc ) {
351  auto i = std::lower_bound( std::begin( m_services ), std::end( m_services ), svc, GaudiCommon_details::svc_lt );
352  if ( i == std::end( m_services ) || !GaudiCommon_details::svc_eq( *i, svc ) ) {
353  m_services.insert( i, std::move( svc ) );
354  } else {
355  this->warning() << "Service " << svc->name() << " already present -- skipping" << endmsg;
356  }
357  }
358 }
359 // ============================================================================
360 
361 //=============================================================================
362 // Methods related to messaging
363 //=============================================================================
364 
365 // ============================================================================
366 // Print the error message and return status code
367 // ============================================================================
368 template <class PBASE>
369 StatusCode GaudiCommon<PBASE>::Error( const std::string& msg, const StatusCode st, const size_t mx ) const
370 {
371  // increase local counter of errors
372  const size_t num = ++m_errors[msg];
373  // If suppressed, just return
374  if ( num > mx ) {
375  return st;
376  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
377  {
378  return Print( "The ERROR message is suppressed : '" + msg + "'", st, MSG::ERROR );
379  }
380  // return message
381  return Print( msg, st, MSG::ERROR );
382 }
383 // ============================================================================
384 
385 // ============================================================================
386 // Print the warning message and return status code
387 // ============================================================================
388 template <class PBASE>
389 StatusCode GaudiCommon<PBASE>::Warning( const std::string& msg, const StatusCode st, const size_t mx ) const
390 {
391  // increase local counter of warnings
392  const size_t num = ++m_warnings[msg];
393  // If suppressed, just return
394  if ( num > mx ) {
395  return st;
396  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
397  {
398  return Print( "The WARNING message is suppressed : '" + msg + "'", st, MSG::WARNING );
399  }
400  // return message
401  return Print( msg, st, MSG::WARNING );
402 }
403 // ============================================================================
404 
405 // ============================================================================
406 // Print the info message and return status code
407 // ============================================================================
408 template <class PBASE>
409 StatusCode GaudiCommon<PBASE>::Info( const std::string& msg, const StatusCode st, const size_t mx ) const
410 {
411  // increase local counter of warnings
412  const size_t num = ++m_infos[msg];
413  // If suppressed, just return
414  if ( num > mx ) {
415  return st;
416  } else if ( UNLIKELY( num == mx ) ) // issue one-time suppression message
417  {
418  return Print( "The INFO message is suppressed : '" + msg + "'", st, MSG::INFO );
419  }
420  // return message
421  return Print( msg, st, MSG::INFO );
422 }
423 // ============================================================================
424 
425 // ============================================================================
426 // Print the message and return status code
427 // ============================================================================
428 template <class PBASE>
430 {
431  // perform printout ?
432  if ( !this->msgLevel( lvl ) ) {
433  return st;
434  } // RETURN
435 
436  // use the predefined stream
437  MsgStream& str = this->msgStream( lvl );
438  if ( typePrint() ) {
439  str << System::typeinfoName( typeid( *this ) ) << ":: ";
440  }
441 
442  // print the message
443  str << msg;
444 
445  // test status code
446  if ( st.isSuccess() ) {
447  } else if ( StatusCode::FAILURE != st ) {
448  str << " StatusCode=" << st.getCode();
449  } else {
450  str << " StatusCode=FAILURE";
451  }
452 
453  // perform print operation
454  str << endmsg;
455 
456  // return
457  return st;
458 }
459 // ============================================================================
460 
461 // ============================================================================
462 // Create and (re)-throw the exception
463 // ============================================================================
464 template <class PBASE>
465 void GaudiCommon<PBASE>::Exception( const std::string& msg, const GaudiException& exc, const StatusCode sc ) const
466 {
467  // increase local counter of exceptions
468  ++m_exceptions[msg];
469  Print( "Exception (re)throw: " + msg, sc, MSG::FATAL ).ignore();
470  throw GaudiException( this->name() + ":: " + msg, this->name(), sc, exc );
471 }
472 // ============================================================================
473 
474 // ============================================================================
475 // Create and (re)-throw the exception
476 // ============================================================================
477 template <class PBASE>
478 void GaudiCommon<PBASE>::Exception( const std::string& msg, const std::exception& exc, const StatusCode sc ) const
479 {
480  // increase local counter of exceptions
481  ++m_exceptions[msg];
482  Print( "Exception (re)throw: " + msg, sc, MSG::FATAL ).ignore();
483  throw GaudiException( this->name() + ":: " + msg + "(" + exc.what() + ")", "", sc );
484 }
485 // ============================================================================
486 
487 // ============================================================================
488 // Create and throw the exception
489 // ============================================================================
490 template <class PBASE>
492 {
493  // increase local counter of exceptions
494  ++m_exceptions[msg];
495  Print( "Exception throw: " + msg, sc, MSG::FATAL ).ignore();
496  throw GaudiException( this->name() + ":: " + msg, "", sc );
497 }
498 // ============================================================================
499 
500 // ============================================================================
501 // perform the actual printout of counters
502 // ============================================================================
503 template <class PBASE>
505 {
506  // check how many counters think they should be printed or how many
507  // we anyway want to print
508  unsigned int nbPrintedCounters = 0;
509  if ( !m_printEmptyCounters && !this->msgLevel( MSG::DEBUG ) ) {
510  nbPrintedCounters = std::accumulate(
511  m_counters.begin(), m_counters.end(), nbPrintedCounters,
512  []( unsigned int& sum, const auto& entry ) { return sum + entry.second.get().toBePrinted(); } );
513  } else {
514  nbPrintedCounters = m_counters.size();
515  }
516  // in case nothing should be printed, let's stop here
517  if ( nbPrintedCounters == 0 ) {
518  return 0;
519  }
520  MsgStream& msg = this->msgStream( level );
521  msg << "Number of counters : " << nbPrintedCounters << "\n" << m_header.value();
522  for ( const auto& entry : m_counters ) {
523  if ( m_printEmptyCounters || this->msgLevel( MSG::DEBUG ) || entry.second.get().toBePrinted() ) {
524  std::ostringstream ost;
525  entry.second.get().print( ost, entry.first );
526  msg << "\n" << ost.str();
527  }
528  }
529  //
530  msg << endmsg;
531  //
532  return nbPrintedCounters;
533 }
534 // ============================================================================
535 
536 // ============================================================================
537 // perform the actual printout of error counters
538 // ============================================================================
539 template <class PBASE>
541 {
542  // format for printout
543  boost::format ftm( " #%|-10s| = %|.8s| %|23t| Message = '%s'" );
544 
545  auto print = [&]( const Counter& c, const std::string& label ) {
546  for ( const auto& i : c ) {
547  this->msgStream( level ) << ( ftm % label % i.second % i.first ) << endmsg;
548  }
549  };
550 
551  print( m_exceptions, "EXCEPTIONS" );
552  print( m_errors, "ERRORS" );
553  print( m_warnings, "WARNINGS" );
554  print( m_infos, "INFOS" );
555 
556  // return total number of errors+warnings+exceptions
557  return m_exceptions.size() + m_errors.size() + m_warnings.size() + m_infos.size();
558 }
559 // ============================================================================
560 
561 // ============================================================================
565 // ============================================================================
566 template <class PBASE>
568 {
569 
570  // print ALL properties
571  MsgStream& msg = this->msgStream( level );
572  const auto& properties = this->getProperties();
573  msg << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
574  << " #properties = " << properties.size() << endmsg;
575  for ( const auto& property : reverse( properties ) ) {
576  msg << "Property ['Name': Value] = " << *property << endmsg;
577  }
578  return properties.size();
579 }
580 // ============================================================================
581 
582 // ============================================================================
583 // Methods for dealing with the TES and TDS
584 // ============================================================================
585 
586 // ============================================================================
587 // put results into Gaudi Event Transient Store
588 // ============================================================================
589 template <class PBASE>
591  const std::string& location, const bool useRootInTES ) const
592 {
593  // check arguments
594  Assert( svc, "put():: Invalid 'service'!" );
595  Assert( static_cast<bool>( object ), "put():: Invalid 'Object'!" );
596  Assert( !location.empty(), "put():: Invalid 'address' = '' " );
597  // final data location
598  const std::string& fullLocation = fullTESLocation( location, useRootInTES );
599  // register the object!
600  const StatusCode status = '/' == fullLocation[0] ? svc->registerObject( fullLocation, object.get() )
601  : svc->registerObject( "/Event/" + fullLocation, object.get() );
602  // check the result!
603  if ( status.isFailure() ) {
604  Exception( "put():: could not register '" + System::typeinfoName( typeid( *object ) ) + "' at address '" +
605  fullLocation + "'",
606  status );
607  }
608  if ( this->msgLevel( MSG::DEBUG ) ) {
609  Print( "The object of type '" + System::typeinfoName( typeid( *object ) ) + "' is registered in TS at address '" +
610  fullLocation + "'",
611  status, MSG::DEBUG )
612  .ignore();
613  }
614  // if we get here, ownership has been transferred to the IDataProviderSvc
615  return object.release();
616 }
617 // ============================================================================
618 
619 // ============================================================================
620 // The END
621 // ============================================================================
#define UNLIKELY(x)
Definition: Kernel.h:89
constexpr static const auto FAILURE
Definition: StatusCode.h:88
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:120
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:383
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:332
double sum(double x, double y, double z)
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:287
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:52
Header file for class GaudiAlgorithm.
Gaudi::Details::PropertyBase * property(const std::string &name) const
void updateKey(const std::string &key)
Definition: DataObjID.h:100
T end(T...args)
Data provider interface definition.
T lower_bound(T...args)
bool isFailure() const
Definition: StatusCode.h:139
STL class.
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:51
Definition of the basic interface.
Definition: IInterface.h:277
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)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
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:253
The useful base class for tools.
Definition: GaudiTool.h:101
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:93
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:587
code_t getCode() const
Retrieve value ("checks" the StatusCode)
Definition: StatusCode.h:146
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:209
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.