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 // ============================================================================
9 /* @file GaudiCommon.cpp
10  *
11  * Implementation file for class : GaudiCommon
12  *
13  * @author Chris Jones Christopher.Rob.Jones@cern.ch
14  * @author Vanya BELYAEV Ivan.Belyaev@itep.ru
15  * @author Rob Lambert Rob.Lambert@cern.ch
16  * @date 2009-08-04
17  */
18 // GaudiKernel
19 // ============================================================================
20 #include "GaudiKernel/AlgTool.h"
21 #include "GaudiKernel/Algorithm.h"
25 #include "GaudiKernel/IProperty.h"
27 #include "GaudiKernel/IToolSvc.h"
28 #include "GaudiKernel/MsgStream.h"
30 #include "GaudiKernel/Property.h"
32 #include "GaudiKernel/SmartRef.h"
33 #include "GaudiKernel/Stat.h"
34 #include "GaudiKernel/StatEntity.h"
35 #include "GaudiKernel/System.h"
36 #include "GaudiKernel/reverse.h"
37 // ============================================================================
38 // GaudiAlg
39 // ============================================================================
41 #include "GaudiAlg/GaudiCommon.h"
42 #include "GaudiAlg/GaudiTool.h"
43 #include "GaudiAlg/Print.h"
44 // ============================================================================
45 // GaudiUtils
46 // ============================================================================
47 #include "GaudiUtils/RegEx.h"
48 // ============================================================================
49 // Boost
50 // ============================================================================
51 #include "boost/format.hpp"
52 // ============================================================================
53 // Disable warning on windows
54 #ifdef _WIN32
55 #pragma warning( disable : 4661 ) // incomplete explicit templates
56 #endif
57 // ============================================================================
58 
59 // ============================================================================
60 // constructor initialisation
61 // ============================================================================
62 template <class PBASE>
64 {
65  m_errorsPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printErrorHandler, this );
66  m_propsPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printPropsHandler, this );
67  m_statPrint.declareUpdateHandler( &GaudiCommon<PBASE>::printStatHandler, this );
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  SmartIF<IJobOptionsSvc> jos( PBASE::service( "JobOptionsSvc" ) );
82  if ( !jos.isValid() ) 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  std::string rootName( dataMgrSvc->rootName() );
151  if ( "" != rootName && '/' != rootName[rootName.size() - 1] ) {
152  rootName = rootName + "/";
153  }
154 
155  auto fixLocation = [this, rootName]( const std::string& location ) -> std::string {
156  std::string result = fullTESLocation( location, UseRootInTES );
157  // check whether we have an absolute path if yes return it - else prepend DataManager Root
158  result = ( result[0] == '/' ? result : rootName + result );
159 
160  if ( result != location && this->msgLevel( MSG::DEBUG ) )
161  this->debug() << "Changing " << location << " to " << result << endmsg;
162 
163  return result;
164  };
165 
166  class DHHFixer : public IDataHandleVisitor
167  {
168  public:
169  DHHFixer( std::function<std::string( const std::string& )> f ) : m_f( f ) {}
170  void visit( const IDataHandleHolder* idhh ) override
171  {
172  if ( idhh == 0 ) return;
173 
174  std::string r;
175  for ( auto h : idhh->inputHandles() ) {
176  r = m_f( h->objKey() );
177  if ( r != h->objKey() ) h->updateKey( r );
178  }
179  for ( auto h : idhh->outputHandles() ) {
180  r = m_f( h->objKey() );
181  if ( r != h->objKey() ) h->updateKey( r );
182  }
183  }
184 
185  private:
187  };
188 
189  this->m_updateDataHandles.reset( new DHHFixer( fixLocation ) );
190 
191  return sc;
192 }
193 //=============================================================================
194 
195 //=============================================================================
196 // Finalize the common functionality
197 //=============================================================================
198 template <class PBASE>
200 #ifdef __ICC
201  i_gcFinalize
202 #else
203  finalize
204 #endif
205  ()
206 {
208 
209  // print the general information about statistical counters
210  if ( this->msgLevel( MSG::DEBUG ) || ( statPrint() && !counters().empty() ) ) {
211  // print general statistical counters
212  printStat( statPrint() ? MSG::ALWAYS : MSG::DEBUG );
213  }
214  // add all counters to the CounterSummarySvc
215  if ( m_counterSummarySvc && this->svcLoc()->existsService( "CounterSummarySvc" ) ) {
216  if ( this->msgLevel( MSG::DEBUG ) ) this->debug() << "adding counters to CounterSummarySvc" << endmsg;
217 
218  Gaudi::Utils::RegEx::matchList statList{m_statEntityList.value()};
219  Gaudi::Utils::RegEx::matchList counterList{m_counterList.value()};
220 
221  for ( const auto& i : this->counters() ) {
222  if ( statList.Or( i.first ) )
223  m_counterSummarySvc->addCounter( this->name(), i.first, i.second, Gaudi::CounterSummary::SaveStatEntity );
224  else if ( counterList.Or( i.first ) )
225  m_counterSummarySvc->addCounter( this->name(), i.first, i.second );
226  }
227  }
228  // release all located tools and services
229  if ( this->msgLevel( MSG::DEBUG ) ) {
230  this->debug() << "Tools to release :";
231  for ( const auto& i : m_managedTools ) {
232  this->debug() << " " << i->name();
233  }
234  this->debug() << endmsg;
235  }
236  while ( !m_managedTools.empty() ) {
237  sc = releaseTool( m_managedTools.back() ) && sc;
238  }
239 
240  // release all located services
241  if ( this->msgLevel( MSG::DEBUG ) ) {
242  this->debug() << "Services to release :";
243  for ( const auto& i : m_services ) this->debug() << " " << i->name();
244  this->debug() << endmsg;
245  }
246  while ( !m_services.empty() ) {
247  sc = releaseSvc( m_services.front() ) && sc;
248  }
249 
250  // release the CounterSummarySvc manually
251  m_counterSummarySvc.reset();
252 
253  // format printout
254  if ( !m_errors.empty() || !m_warnings.empty() || !m_exceptions.empty() ) {
255  this->always() << "Exceptions/Errors/Warnings/Infos Statistics : " << m_exceptions.size() << "/" << m_errors.size()
256  << "/" << m_warnings.size() << "/" << m_infos.size() << endmsg;
257  if ( errorsPrint() ) {
258  printErrors();
259  }
260  }
261 
262  // clear *ALL* counters explicitly
263  m_counters.clear();
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();
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.getCode() ) {
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  // print statistics
518  if ( counters().empty() ) {
519  return 0;
520  }
521  MsgStream& msg = this->msgStream( level );
522  //
523  msg << "Number of counters : " << counters().size();
524  //
525  if ( !counters().empty() ) {
526  msg << std::endl << m_header.value();
527  }
528  //
529  for ( const auto& entry : counters() ) {
530  msg << std::endl
531  << Gaudi::Utils::formatAsTableRow( entry.first, entry.second, m_useEffFormat, m_format1, m_format2 );
532  }
533  //
534  msg << endmsg;
535  //
536  return counters().size();
537 }
538 // ============================================================================
539 
540 // ============================================================================
541 // perform the actual printout of error counters
542 // ============================================================================
543 template <class PBASE>
545 {
546  // format for printout
547  boost::format ftm( " #%|-10s| = %|.8s| %|23t| Message = '%s'" );
548 
549  auto print = [&]( const Counter& c, const std::string& label ) {
550  for ( const auto& i : c ) {
551  this->msgStream( level ) << ( ftm % label % i.second % i.first ) << endmsg;
552  }
553  };
554 
555  print( m_exceptions, "EXCEPTIONS" );
556  print( m_errors, "ERRORS" );
557  print( m_warnings, "WARNINGS" );
558  print( m_infos, "INFOS" );
559 
560  // return total number of errors+warnings+exceptions
561  return m_exceptions.size() + m_errors.size() + m_warnings.size() + m_infos.size();
562 }
563 // ============================================================================
564 
565 // ============================================================================
569 // ============================================================================
570 template <class PBASE>
572 {
573 
574  // print ALL properties
575  MsgStream& msg = this->msgStream( level );
576  const auto& properties = this->getProperties();
577  msg << "List of ALL properties of " << System::typeinfoName( typeid( *this ) ) << "/" << this->name()
578  << " #properties = " << properties.size() << endmsg;
579  for ( const auto& property : reverse( properties ) ) {
580  msg << "Property ['Name': Value] = " << *property << endmsg;
581  }
582  return properties.size();
583 }
584 // ============================================================================
585 
586 // ============================================================================
587 // Methods for dealing with the TES and TDS
588 // ============================================================================
589 
590 // ============================================================================
591 // put results into Gaudi Event Transient Store
592 // ============================================================================
593 template <class PBASE>
595  const bool useRootInTES ) const
596 {
597  // check arguments
598  Assert( svc, "put():: Invalid 'service'!" );
599  Assert( object, "put():: Invalid 'Object'!" );
600  Assert( !location.empty(), "put():: Invalid 'address' = '' " );
601  // final data location
602  const std::string& fullLocation = fullTESLocation( location, useRootInTES );
603  // register the object!
604  const StatusCode status = '/' == fullLocation[0] ? svc->registerObject( fullLocation, object )
605  : svc->registerObject( "/Event/" + fullLocation, object );
606  // check the result!
607  if ( status.isFailure() ) {
608  Exception( "put():: could not register '" + System::typeinfoName( typeid( *object ) ) + "' at address '" +
609  fullLocation + "'",
610  status );
611  }
612  if ( this->msgLevel( MSG::DEBUG ) ) {
613  Print( "The object of type '" + System::typeinfoName( typeid( *object ) ) + "' is registered in TS at address '" +
614  fullLocation + "'",
615  status, MSG::DEBUG )
616  .ignore();
617  }
618  return object;
619 }
620 // ============================================================================
621 
622 // ============================================================================
623 // Handle method for changes in the 'ErrorsPrint'
624 // ============================================================================
625 template <class PBASE>
627 {
628  // no action if not yet initialized
629  if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
630  return;
631  }
632  if ( this->errorsPrint() ) {
633  this->printErrors();
634  }
635 }
636 // ============================================================================
637 // Handle method for changes in the 'PropertiesPrint'
638 // ============================================================================
639 template <class PBASE>
641 {
642  // no action if not yet initialized
643  if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
644  return;
645  }
646  if ( this->propsPrint() ) {
647  this->printProps( MSG::ALWAYS );
648  }
649 }
650 // ============================================================================
651 // Handle method for changes in the 'StatPrint'
652 // ============================================================================
653 template <class PBASE>
655 {
656  // no action if not yet initialized
657  if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
658  return;
659  }
660  if ( this->statPrint() ) {
661  this->printStat( MSG::ALWAYS );
662  }
663 }
664 // ============================================================================
665 
666 // ============================================================================
667 // The END
668 // ============================================================================
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
void printErrorHandler(Gaudi::Details::PropertyBase &)
handler for "ErrorPrint" property
T empty(T...args)
virtual const std::string & rootName() const =0
Get Name of root Event.
Header file for class GaudiAlgorithm.
Define general base for Gaudi exception.
void printStatHandler(Gaudi::Details::PropertyBase &)
handler for "StatPrint" property
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
StatusCode releaseSvc(const IInterface *svc) const
manual forced (and &#39;safe&#39;) release of the service
DataObject * put(IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
Register a data object or container into Gaudi Event Transient Store.
Implementation of property with value of concrete type.
Definition: Property.h:313
unsigned long getCode() const
Get the status code by value.
Definition: StatusCode.h:91
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
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
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
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.
Header file for class GaudiAlgorithm.
T endl(T...args)
Gaudi::Details::PropertyBase * property(const std::string &name) const
#define UNLIKELY(x)
Definition: Kernel.h:126
void printPropsHandler(Gaudi::Details::PropertyBase &)
handler for "PropertiesPrint" property
T end(T...args)
void initGaudiCommonConstructor(const IInterface *parent=0)
Constructor initializations.
Data provider interface definition.
T lower_bound(T...args)
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
GAUDI_API std::string formatAsTableRow(const StatEntity &counter, const bool flag, const std::string &format1=" |%|7d| |%|11.7g| |%|#11.5g| |%|#10.5g| |%|#10.5g| |%|#10.5g| |", const std::string &format2="*|%|7d| |%|11.5g| |(%|#9.7g| +- %|-#8.6g|)%%| ----- | ----- |")
print the counter in a form of the table row
Definition: StatEntity.cpp:299
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:26
Definition of the basic interface.
Definition: IInterface.h:234
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.
The useful base class for data processing algorithms.
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...
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
virtual const std::vector< const Gaudi::Details::PropertyBase * > * getProperties(const std::string &client) const =0
Get the properties associated to a given client.
STL class.
T move(T...args)
reverse_wrapper< T > reverse(T &&iterable)
Definition: reverse.h:32
T find(T...args)
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
T begin(T...args)
void print(string text)
Definition: mergesort.cpp:33
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
The useful base class for tools.
Definition: GaudiTool.h:101
Implements the common functionality between GaudiTools and GaudiAlgorithms.
Definition: GaudiCommon.h:80
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:462
long printStat(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of statistical counters
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
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:244
virtual const std::string & name() const =0
Retrieve the name of the instance.
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.