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