DataOnDemandSvc Class Reference

The DataOnDemandSvc listens to incidents typically triggered by the data service of the configurable name "IncidentName". More...

#include <src/IncidentSvc/DataOnDemandSvc.h>

Inheritance diagram for DataOnDemandSvc:
Collaboration diagram for DataOnDemandSvc:

Classes

struct  Leaf
 
struct  Node
 Helper class of the DataOnDemandSvc. More...
 
struct  Protection
 Helper class of the DataOnDemandSvc. More...
 

Public Types

typedef std::vector< std::string > Setup
 
typedef TClass * ClassH
 
typedef GaudiUtils::HashMap< Gaudi::StringKey, NodeNodeMap
 
typedef GaudiUtils::HashMap< Gaudi::StringKey, LeafAlgMap
 
- Public Types inherited from extends< BASE, Interfaces >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Public Member Functions

StatusCode initialize () override
 Inherited Service overrides: Service initialization. More...
 
StatusCode finalize () override
 Inherited Service overrides: Service finalization. More...
 
StatusCode reinitialize () override
 Inherited Service overrides: Service reinitialization. More...
 
void handle (const Incident &incident) override
 IIncidentListener interfaces overrides: incident handling. More...
 
 DataOnDemandSvc (const std::string &name, ISvcLocator *svc)
 Standard initializing service constructor. More...
 
 ~DataOnDemandSvc () override=default
 Standard destructor. More...
 
void update_1 (Property &p)
 
void update_2 (Property &p)
 
void update_3 (Property &p)
 
void update_dump (Property &)
 update handler for 'Dump' property More...
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

StatusCode configureHandler (Leaf &leaf)
 Configure handler for leaf. More...
 
StatusCode execHandler (const std::string &tag, Leaf &leaf)
 Execute leaf handler (algorithm) More...
 
StatusCode execHandler (const std::string &tag, Node &node)
 Execute node handler (simple object creation using seal reflection) More...
 
StatusCode setupNodeHandlers ()
 Initialize node handlers. More...
 
StatusCode setupAlgHandlers ()
 Initialize leaf handlers. More...
 
StatusCode setup ()
 Setup routine (called by (re-) initialize. More...
 
void i_setNodeHandler (const std::string &name, const std::string &type)
 Internal method to initialize a node handler. More...
 
StatusCode i_setAlgHandler (const std::string &name, const Gaudi::Utils::TypeNameString &alg)
 Internal method to initialize an algorithm handler. More...
 
StatusCode update ()
 update the handlers More...
 
MsgStreamstream () const
 get the message stream More...
 
void dump (const MSG::Level level, const bool mode=true) const
 dump the content of DataOnDemand service More...
 

Private Types

typedef std::map< std::string, std::string > Map
 

Private Attributes

SmartIF< IIncidentSvcm_incSvc = nullptr
 Incident service. More...
 
SmartIF< IAlgManagerm_algMgr = nullptr
 Algorithm manager. More...
 
SmartIF< IDataProviderSvcm_dataSvc = nullptr
 Data provider reference. More...
 
SmartIF< IToolSvcm_toolSvc
 Data provider reference. More...
 
std::string m_trapType = "DataFault"
 Trap name. More...
 
std::string m_dataSvcName = "EventDataSvc"
 Data service name. More...
 
bool m_partialPath = true
 Flag to allow for the creation of partial leaves. More...
 
bool m_dump = false
 flag to force the printout More...
 
bool m_init = false
 flag to warm up the configuration More...
 
bool m_allowInitFailure = false
 flag to allow DataOnDemand initialization to succeed even if the (pre)initialization of the algorithms fails (m_init). More...
 
Setup m_algMapping
 Mapping to algorithms. More...
 
Setup m_nodeMapping
 Mapping to nodes. More...
 
AlgMap m_algs
 Map of algorithms to handle incidents. More...
 
NodeMap m_nodes
 Map of "empty" objects to be placed as intermediate nodes. More...
 
Map m_algMap
 the major configuration property { 'data' : 'algorithm' } More...
 
Map m_nodeMap
 the major configuration property { 'data' : 'type' } More...
 
bool m_updateRequired = true
 
std::string m_prefix = "/Event/"
 
std::unique_ptr< MsgStreamm_log
 
ChronoEntity m_total
 
ulonglong m_statAlg = 0
 
ulonglong m_statNode = 0
 
ulonglong m_stat = 0
 
ChronoEntity m_timer_nodes
 
ChronoEntity m_timer_algs
 
ChronoEntity m_timer_all
 
bool m_locked_nodes = false
 
bool m_locked_algs = false
 
bool m_locked_all = false
 
std::vector< std::string > m_nodeMapTools
 
std::vector< IDODNodeMapper * > m_nodeMappers
 
std::vector< std::string > m_algMapTools
 
std::vector< IDODAlgMapper * > m_algMappers
 

Detailed Description

The DataOnDemandSvc listens to incidents typically triggered by the data service of the configurable name "IncidentName".

In the job options handlers can be declared, which allow to configure this service. Such handlers are either:

  • Node handlers, if objects other than the default object type have to be instantiated. DataOnDemandSvc.Nodes = { "DATA='/Event/Rec' TYPE='DataObject'", "DATA='/Event/Rec/Muon' TYPE='DataObject'" };
  • Leaf handlers (Algorithms), which get instantiated and executed on demand. DataOnDemandSvc.Algorithms = { "DATA='/Event/Rec/Muon/Digits' TYPE='MuonDigitAlg/MyMuonDigits'" }; If the algorithm name is omitted the class name will be the instance name.

The handlers only get called if the exact path matches. In the event already the partial path to any handler is missing a leaf handler may be triggered, which includes the partial paths ( DataOnDemandSvc.UsePreceedingPath = true )

2006-10-15: New options (using map-like semantics:)

{ "Phys/StdLoosePions/Particles" : "PreLoadParticles/StdLoosePions" ,
"Phys/StdLoosePions/Vertioces" : "PreLoadParticles/StdLoosePions" } ;
{ "Phys" : "DataObject" ,
"MC" : "DataObject" } ;

New treatment of preceding paths. for each registered leaf or node the all parent nodes are added into the node-map with default directory type 'DataObject'

The major properties are equipped with handlers (more or less mandatory for interactive work in python)

From now the default prefix ( "/Event/" ) could be omitted from any data-item. It will be added automatically.

Author
M.Frank
Version
1.0

Definition at line 90 of file DataOnDemandSvc.h.

Member Typedef Documentation

typedef TClass* DataOnDemandSvc::ClassH

Definition at line 96 of file DataOnDemandSvc.h.

typedef std::map<std::string,std::string> DataOnDemandSvc::Map
private

Definition at line 274 of file DataOnDemandSvc.h.

typedef std::vector<std::string> DataOnDemandSvc::Setup

Definition at line 95 of file DataOnDemandSvc.h.

Constructor & Destructor Documentation

DataOnDemandSvc::DataOnDemandSvc ( const std::string &  name,
ISvcLocator svc 
)

Standard initializing service constructor.

Parameters
name[IN] Service instance name
svc[IN] Pointer to service locator
Returns
Reference to DataOnDemandSvc object.

Definition at line 41 of file DataOnDemandSvc.cpp.

42  : base_class( name, svc )
43 {
44  // ==========================================================================
45  declareProperty
46  ( "IncidentName" ,
47  m_trapType ,
48  "The type of handled Incident" ) ;
49  //
50  declareProperty ( "DataSvc" , m_dataSvcName ) ;
51  //
52  declareProperty ( "UsePreceedingPath" , m_partialPath ) ;
53  declareProperty
54  ( "Dump" ,
55  m_dump ,
56  "Dump the configuration and stastics" ) ->
57  declareUpdateHandler ( &DataOnDemandSvc::update_dump , this ) ;
58  //
59  declareProperty
60  ( "PreInitialize" ,
61  m_init ,
62  "Flag to (pre)initialize all algorithms" ) ;
63  declareProperty
64  ( "AllowPreInitializeFailure" ,
66  "Allow (pre)initialization of algorithms to fail without stopping the application" ) ;
67  //
68  declareProperty ( "Algorithms" , m_algMapping ) ->
69  declareUpdateHandler ( &DataOnDemandSvc::update_2 , this ) ;
70  declareProperty ( "Nodes" , m_nodeMapping ) ->
71  declareUpdateHandler ( &DataOnDemandSvc::update_3 , this ) ;
72  //
73  declareProperty ( "AlgMap" , m_algMap ) ->
74  declareUpdateHandler ( &DataOnDemandSvc::update_1 , this ) ;
75  declareProperty ( "NodeMap" , m_nodeMap ) ->
76  declareUpdateHandler ( &DataOnDemandSvc::update_1 , this ) ;
77 
78  declareProperty ( "Prefix" , m_prefix ) ;
79 
80  declareProperty("NodeMappingTools", m_nodeMapTools,
81  "List of tools of type IDODNodeMapper");
82  declareProperty("AlgMappingTools", m_algMapTools,
83  "List of tools of type IDODAlgMapper");
84  // ==========================================================================
85 }
std::vector< std::string > m_algMapTools
std::string m_trapType
Trap name.
std::string m_dataSvcName
Data service name.
Setup m_nodeMapping
Mapping to nodes.
extends base_class
Typedef to this class.
Definition: extends.h:14
Map m_algMap
the major configuration property { 'data' : 'algorithm' }
Setup m_algMapping
Mapping to algorithms.
bool m_allowInitFailure
flag to allow DataOnDemand initialization to succeed even if the (pre)initialization of the algorithm...
void update_dump(Property &)
update handler for 'Dump' property
std::vector< std::string > m_nodeMapTools
std::string m_prefix
bool m_partialPath
Flag to allow for the creation of partial leaves.
bool m_dump
flag to force the printout
bool m_init
flag to warm up the configuration
Map m_nodeMap
the major configuration property { 'data' : 'type' }
void update_2(Property &p)
void update_3(Property &p)
void update_1(Property &p)
DataOnDemandSvc::~DataOnDemandSvc ( )
overridedefault

Standard destructor.

Member Function Documentation

StatusCode DataOnDemandSvc::configureHandler ( Leaf leaf)
protected

Configure handler for leaf.

Parameters
leaf[IN] Reference to leaf handler
Returns
StatusCode indicating success or failure

Definition at line 528 of file DataOnDemandSvc.cpp.

529 {
530  if ( l.algorithm ) { return StatusCode::SUCCESS ; }
531  if ( ! m_algMgr ) { return StatusCode::FAILURE ; }
532  l.algorithm = m_algMgr->algorithm(l.name, false);
533  if ( l.algorithm ) { return StatusCode::SUCCESS ; }
534  // create it!
535  StatusCode sc = m_algMgr->createAlgorithm ( l.type , l.name , l.algorithm , true ) ;
536  if ( sc.isFailure() )
537  {
538  stream()
539  << MSG::ERROR
540  << "Failed to create algorithm "
541  << l.type << "('" << l.name<< "')" << endmsg;
542  l.algorithm = nullptr ;
543  return sc ; // RETURN
544  }
545  if ( l.algorithm->isInitialized() ) { return StatusCode:: SUCCESS ;}
546  // initialize it!
547  sc = l.algorithm -> sysInitialize () ;
548  if ( sc.isFailure() )
549  {
550  stream()
551  << MSG::ERROR
552  << "Failed to initialize algorithm "
553  << l.type << "('" << l.name<< "')" << endmsg;
554  l.algorithm = nullptr ;
555  return sc ; // RETURN
556  }
557  if ( Gaudi::StateMachine::RUNNING == l.algorithm->FSMState() )
558  { return StatusCode::SUCCESS ; }
559  // run it!
560  sc = l.algorithm->sysStart() ;
561  if ( sc.isFailure() )
562  {
563  stream()
564  << MSG::ERROR
565  << "Failed to 'run' algorithm "
566  << l.type << "('" << l.name<< "')" << endmsg;
567  l.algorithm = nullptr ;
568  return sc ; // RETURN
569  }
570  return StatusCode::SUCCESS ;
571 }
virtual SmartIF< IAlgorithm > & algorithm(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
virtual StatusCode createAlgorithm(const std::string &algtype, const std::string &algname, IAlgorithm *&alg, bool managed=false, bool checkIfExists=true)=0
Create an instance of a algorithm type that has been declared beforehand and assigns to it a name...
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
dictionary l
Definition: gaudirun.py:421
SmartIF< IAlgManager > m_algMgr
Algorithm manager.
void DataOnDemandSvc::dump ( const MSG::Level  level,
const bool  mode = true 
) const
protected

dump the content of DataOnDemand service

Parameters
levelthe printout level
modethe printout mode

Definition at line 805 of file DataOnDemandSvc.cpp.

807 {
808  if ( m_algs.empty() && m_nodes.empty() ) { return ; }
809 
810  typedef std::pair<std::string,std::string> Pair ;
811  std::map<std::string,Pair> _m ;
812  for ( auto& alg : m_algs )
813  {
814  auto check = _m.find(alg.first) ;
815  if ( _m.end() != check )
816  {
817  stream()
818  << MSG::WARNING
819  << " The data item is activated for '"
820  << check->first << "' as '" << check->second.first << "'" << endmsg ;
821  }
822  const Leaf& l = alg.second ;
823  std::string nam = ( l.name == l.type ? l.type : (l.type+"/"+l.name) ) ;
824  //
825  if ( !mode && 0 == l.num ) { continue ; }
826  //
827  std::string val ;
828  if ( mode ) { val = ( ! l.algorithm ) ? "F" : "T" ; }
829  else { val = std::to_string( l.num ) ; }
830  //
831  _m[ no_prefix ( alg.first , m_prefix ) ] = { nam , val } ;
832  }
833  // nodes:
834  for ( const auto& node : m_nodes )
835  {
836  auto check = _m.find(node.first) ;
837  if ( _m.end() != check )
838  {
839  stream()
840  << MSG::WARNING
841  << " The data item is already activated for '"
842  << check->first << "' as '" << check->second.first << "'" << endmsg ;
843  }
844  const Node& n = node.second ;
845  std::string nam = "'" + n.name + "'" ;
846  //
847  std::string val ;
848 
849  if ( !mode && 0 == n.num ) { continue ; }
850 
851  if ( mode ) { val = ( 0 == n.clazz ) ? "F" : "T" ; }
852  else { val = std::to_string( n.num ) ; }
853  //
854  _m[ no_prefix ( node.first , m_prefix ) ] = { nam , val } ;
855  }
856  //
857  if ( _m.empty() ) { return ; }
858 
859  // find the correct formats
860  size_t n1 = 0 ;
861  size_t n2 = 0 ;
862  size_t n3 = 0 ;
863  for ( const auto& i : _m )
864  {
865  n1 = std::max ( n1 , i.first.size() ) ;
866  n2 = std::max ( n2 , i.second.first.size() ) ;
867  n3 = std::max ( n3 , i.second.second.size() ) ;
868  }
869  if ( 10 > n1 ) { n1 = 10 ; }
870  if ( 10 > n2 ) { n2 = 10 ; }
871  if ( 60 < n1 ) { n1 = 60 ; }
872  if ( 60 < n2 ) { n2 = 60 ; }
873  //
874 
875  const std::string _f = " | %%1$-%1%.%1%s | %%2$-%2%.%2%s | %%3$%3%.%3%s |" ;
876  boost::format _ff ( _f ) ;
877  _ff % n1 % n2 % n3 ;
878 
879  const std::string _format = _ff.str() ;
880 
881  MsgStream& msg = stream() << level ;
882 
883  if ( mode ) { msg << "Data-On-Demand Actions enabled for:" ; }
884  else { msg << "Data-On-Demand Actions has been used for:" ; }
885 
886  boost::format fmt1( _format) ;
887  fmt1 % "Address" % "Creator" % ( mode ? "S" : "#" ) ;
888  //
889  const std::string header = fmt1.str() ;
890  std::string line = std::string( header.size() , '-' ) ;
891  line[0] = ' ' ;
892 
893  msg << '\n' << line
894  << '\n' << header
895  << '\n' << line ;
896 
897  // make the actual printout:
898  for ( const auto& item : _m )
899  {
900  boost::format fmt( _format) ;
901  msg << '\n' <<
902  ( fmt % item.first % item.second.first % item.second.second ) ;
903  }
904 
905  msg << '\n' << line << endmsg ;
906 
907 }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
string to_string(const T &value)
Definition: mergesort.cpp:40
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
bool empty() const
Definition: Map.h:184
NodeMap m_nodes
Map of "empty" objects to be placed as intermediate nodes.
std::string m_prefix
dictionary l
Definition: gaudirun.py:421
AlgMap m_algs
Map of algorithms to handle incidents.
tuple item
print s1,s2
Definition: ana.py:146
list header
Definition: Test.py:33
list i
Definition: ana.py:128
StatusCode DataOnDemandSvc::execHandler ( const std::string &  tag,
Leaf leaf 
)
protected

Execute leaf handler (algorithm)

Parameters
tag[IN] Path to requested leaf
leaf[IN] Reference to leaf handler
Returns
StatusCode indicating success or failure

Definition at line 764 of file DataOnDemandSvc.cpp.

765 {
767  //
768  if ( l.executing ) { return StatusCode::FAILURE ; } // RETURN
769  //
770  if ( ! l.algorithm )
771  {
773  if ( sc.isFailure() )
774  {
775  stream()
776  << MSG::ERROR
777  << "Failed to configure handler for: "
778  << l.name << "[" << l.type << "] " << tag << endmsg;
779  return sc ; // RETURN
780  }
781  }
782  //
783  Chrono atimer ( m_total ) ;
784  //
785  Protection p(l.executing);
786  StatusCode sc = l.algorithm->sysExecute();
787  if ( sc.isFailure() )
788  {
789  stream() << MSG::ERROR
790  << "Failed to execute the algorithm:"
791  << l.algorithm->name() << " for location:" << tag << endmsg;
792  return sc ; // RETURN
793  }
794  ++l.num ;
795  //
796  return StatusCode::SUCCESS ;
797 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ChronoEntity m_timer_algs
MsgStream & stream() const
get the message stream
A small utility class for chronometry of user codes.
Definition: Chrono.h:25
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
dictionary l
Definition: gaudirun.py:421
Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g.
Definition: LockedChrono.h:52
ChronoEntity m_total
StatusCode configureHandler(Leaf &leaf)
Configure handler for leaf.
StatusCode DataOnDemandSvc::execHandler ( const std::string &  tag,
Node node 
)
protected

Execute node handler (simple object creation using seal reflection)

Parameters
tag[IN] Path to requested leaf
node[IN] Reference to node handler
Returns
StatusCode indicating success or failure

Definition at line 708 of file DataOnDemandSvc.cpp.

709 {
710 
712 
713  if ( n.executing ) { return StatusCode::FAILURE ; } // RETURN
714 
715  Protection p(n.executing);
716 
717  std::unique_ptr<DataObject> object;
718 
719  if ( n.dataObject ) { object.reset( new DataObject() ) ; }
720  else
721  {
722  // try to recover the handler
723  if ( !n.clazz ) { n.clazz = TClass::GetClass(n.name.c_str()) ; }
724  if ( !n.clazz )
725  {
726  stream()
727  << MSG::ERROR
728  << "Failed to get dictionary for class '"
729  << n.name
730  << "' for location:" << tag << endmsg;
731  return StatusCode::FAILURE ; // RETURN
732  }
733 
734  object.reset( reinterpret_cast<DataObject*>(n.clazz->New()) );
735 
736  if ( !object )
737  {
738  stream()
739  << MSG::ERROR
740  << "Failed to create an object of type:"
741  << n.clazz->GetName() << " for location:" << tag
742  << endmsg;
743  return StatusCode::FAILURE ; // RETURN
744  }
745  }
746  //
747  StatusCode sc = m_dataSvc->registerObject(tag, object.release() );
748  if ( sc.isFailure() )
749  {
750  stream()
751  << MSG::ERROR << "Failed to register an object of type:"
752  << n.name << " at location:" << tag
753  << endmsg;
754  return sc ; // RETURN
755  }
756  ++n.num ;
757  //
758  return StatusCode::SUCCESS ;
759 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
SmartIF< IDataProviderSvc > m_dataSvc
Data provider reference.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g.
Definition: LockedChrono.h:52
ChronoEntity m_timer_nodes
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
StatusCode DataOnDemandSvc::finalize ( )
override

Inherited Service overrides: Service finalization.

Definition at line 316 of file DataOnDemandSvc.cpp.

317 {
318  //
319  stream ()
320  << MSG::INFO
321  << "Handled \"" << m_trapType << "\" incidents: "
322  << m_statAlg << "/" << m_statNode << "/" << m_stat << "(Alg/Node/Total)."
323  << endmsg ;
324  if ( m_dump || MSG::DEBUG >= outputLevel() )
325  {
326  stream ()
327  << MSG::INFO
329  ( "Algorithm timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] " , System::milliSec )
330  << m_total.outputUserTime ( "Total:%2%[s]" , System::Sec ) << endmsg ;
331  stream ()
332  << MSG::INFO
334  ( "Nodes timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] " , System::milliSec )
335  << m_timer_nodes.outputUserTime ( "Total:%2%[s]" , System::Sec ) << endmsg ;
336  stream ()
337  << MSG::INFO
339  ( "Algs timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] " , System::milliSec )
340  << m_timer_algs .outputUserTime ( "Total:%2%[s]" , System::Sec ) << endmsg ;
341  stream ()
342  << MSG::INFO
344  ( "All timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] " , System::milliSec )
345  << m_timer_all .outputUserTime ( "Total:%2%[s]" , System::Sec ) << endmsg ;
346  }
347  // dump it!
348  if ( m_dump ) { dump ( MSG::INFO , false ) ; }
349  else if ( MSG::DEBUG >= outputLevel() ) { dump ( MSG::DEBUG , false ) ; }
350  //
351  if ( m_incSvc )
352  {
354  m_incSvc.reset();
355  }
356  m_algMgr.reset();
357  m_dataSvc.reset();
358  if (m_toolSvc) { // we may not have retrieved the ToolSvc
359  // Do not call releaseTool if the ToolSvc was already finalized.
361  for(const auto& i : m_nodeMappers ) m_toolSvc->releaseTool(i).ignore();
362  for(const auto& i : m_algMappers ) m_toolSvc->releaseTool(i).ignore();
363  } else {
364  warning() << "ToolSvc already finalized: cannot release tools. Check options." << endmsg;
365  }
366  m_nodeMappers.clear();
367  m_algMappers.clear();
368  m_toolSvc.reset();
369  }
370  return Service::finalize();
371 }
ChronoEntity m_timer_all
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode finalize() override
Definition: Service.cpp:188
ChronoEntity m_timer_algs
std::vector< IDODNodeMapper * > m_nodeMappers
MsgStream & stream() const
get the message stream
SmartIF< IIncidentSvc > m_incSvc
Incident service.
std::string m_trapType
Trap name.
SmartIF< IDataProviderSvc > m_dataSvc
Data provider reference.
ulonglong m_statNode
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
void dump(const MSG::Level level, const bool mode=true) const
dump the content of DataOnDemand service
std::string outputUserTime() const
print the chrono ;
std::vector< IDODAlgMapper * > m_algMappers
SmartIF< IAlgManager > m_algMgr
Algorithm manager.
SmartIF< IToolSvc > m_toolSvc
Data provider reference.
bool m_dump
flag to force the printout
ChronoEntity m_timer_nodes
virtual StatusCode releaseTool(IAlgTool *tool)=0
Release the tool.
ChronoEntity m_total
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
void ignore() const
Definition: StatusCode.h:108
list i
Definition: ana.py:128
void DataOnDemandSvc::handle ( const Incident incident)
override

IIncidentListener interfaces overrides: incident handling.

Definition at line 636 of file DataOnDemandSvc.cpp.

637 {
638 
640 
641  ++m_stat ;
642  // proper incident type?
643  if ( incident.type() != m_trapType ) { return ; } // RETURN
644  const DataIncident* inc = dynamic_cast<const DataIncident*>(&incident);
645  if ( ! inc ) { return ; } // RETURN
646  // update if needed!
647  if ( m_updateRequired ) { update() ; }
648 
649  if ( MSG::VERBOSE >= outputLevel() )
650  {
651  verbose()
652  << "Incident: [" << incident.type () << "] "
653  << " = " << incident.source ()
654  << " Location:" << inc->tag() << endmsg;
655  }
656  // ==========================================================================
657  Gaudi::StringKey tag ( inc->tag() ) ;
658  // ==========================================================================
659  auto icl = m_nodes.find ( tag ) ;
660  if ( icl != m_nodes.end() )
661  {
662  StatusCode sc = execHandler ( tag , icl->second ) ;
663  if ( sc.isSuccess() ) { ++m_statNode ; }
664  return ; // RETURN
665  }
666  // ==========================================================================
667  auto ialg = m_algs.find ( tag ) ;
668  if ( ialg != m_algs.end() )
669  {
670  StatusCode sc = execHandler ( tag , ialg->second ) ;
671  if ( sc.isSuccess() ) { ++m_statAlg ; }
672  return ; // RETURN
673  }
674  // ==========================================================================
675  // Fall back on the tools
676  if (m_toolSvc) {
677  if (MSG::VERBOSE >= outputLevel())
678  verbose() << "Try to find mapping with mapping tools" << endmsg;
679  Finder finder(no_prefix(inc->tag(), m_prefix), m_nodeMappers, m_algMappers);
680  // - try the node mappers
681  std::string node = finder.node();
682  if (isGood(node)) {
683  // if one is found update the internal node mapping and try again.
684  if (MSG::VERBOSE >= outputLevel())
685  verbose() << "Found Node handler: " << node << endmsg;
686  i_setNodeHandler(inc->tag(), node);
687  handle(incident);
688  --m_stat; // avoid double counting because of recursion
689  return;
690  }
691  // - try alg mappings
692  Gaudi::Utils::TypeNameString alg = finder.alg();
693  if (isGood(alg)) {
694  // we got an algorithm, update alg map and try to handle again
695  if (MSG::VERBOSE >= outputLevel())
696  verbose() << "Found Algorithm handler: " << alg << endmsg;
697  i_setAlgHandler(inc->tag(), alg).ignore();
698  handle(incident);
699  --m_stat; // avoid double counting because of recursion
700  return;
701  }
702  }
703 }
void i_setNodeHandler(const std::string &name, const std::string &type)
Internal method to initialize a node handler.
ChronoEntity m_timer_all
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
const std::string & type() const
Access to the incident type.
Definition: Incident.h:34
const std::string & source() const
Access to the source of the incident.
Definition: Incident.h:40
std::vector< IDODNodeMapper * > m_nodeMappers
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
void handle(const Incident &incident) override
IIncidentListener interfaces overrides: incident handling.
std::string m_trapType
Trap name.
The helper class to represent the efficient "key" for access.
Definition: StringKey.h:35
ulonglong m_statNode
iterator end()
Definition: Map.h:132
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode execHandler(const std::string &tag, Leaf &leaf)
Execute leaf handler (algorithm)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
iterator find(const key_type &key)
Definition: Map.h:149
NodeMap m_nodes
Map of "empty" objects to be placed as intermediate nodes.
std::string m_prefix
std::vector< IDODAlgMapper * > m_algMappers
SmartIF< IToolSvc > m_toolSvc
Data provider reference.
Helper object, useful for measurement of CPU-performance of highly-recursive structures, e.g.
Definition: LockedChrono.h:52
AlgMap m_algs
Map of algorithms to handle incidents.
Data service incident class.
StatusCode i_setAlgHandler(const std::string &name, const Gaudi::Utils::TypeNameString &alg)
Internal method to initialize an algorithm handler.
StatusCode update()
update the handlers
StatusCode DataOnDemandSvc::i_setAlgHandler ( const std::string &  name,
const Gaudi::Utils::TypeNameString alg 
)
protected

Internal method to initialize an algorithm handler.

Definition at line 217 of file DataOnDemandSvc.cpp.

217  {
218  Leaf leaf(alg.type(), alg.name());
219  if (m_init)
220  {
222  if (sc.isFailure()) {
223  if (m_allowInitFailure) {
224  // re-store the content of the leaf object to try again to initialize
225  // the algorithm later (on demand)
226  leaf = Leaf(alg.type(), alg.name());
227  }
228  else
229  return sc;
230  }
231  }
232  m_algs[name] = leaf;
233  return StatusCode::SUCCESS;
234 }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
bool m_allowInitFailure
flag to allow DataOnDemand initialization to succeed even if the (pre)initialization of the algorithm...
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
AlgMap m_algs
Map of algorithms to handle incidents.
bool m_init
flag to warm up the configuration
const std::string & type() const
const std::string & name() const
StatusCode configureHandler(Leaf &leaf)
Configure handler for leaf.
void DataOnDemandSvc::i_setNodeHandler ( const std::string &  name,
const std::string &  type 
)
protected

Internal method to initialize a node handler.

Definition at line 207 of file DataOnDemandSvc.cpp.

207  {
208  ClassH cl = TClass::GetClass(type.c_str()) ;
209  if (!cl) {
210  warning()
211  << "Failed to access dictionary class for "
212  << name << " of type:" << type << endmsg;
213  }
214  m_nodes[name] = Node(cl, false, type);
215 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
NodeMap m_nodes
Map of "empty" objects to be placed as intermediate nodes.
string type
Definition: gaudirun.py:151
StatusCode DataOnDemandSvc::initialize ( )
override

Inherited Service overrides: Service initialization.

Definition at line 298 of file DataOnDemandSvc.cpp.

299 {
300  // initialize the Service Base class
302  if ( sc.isFailure() ) { return sc; }
303  sc = setup();
304  if ( sc.isFailure() ) { return sc; }
305  //
306  if ( m_dump ) { dump ( MSG::INFO ) ; }
307  else if ( MSG::DEBUG >= outputLevel() ) { dump ( MSG::DEBUG ) ; }
308  //
309  if ( m_init ) { return update () ; }
310  //
311  return StatusCode::SUCCESS ;
312 }
StatusCode initialize() override
Definition: Service.cpp:63
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode setup()
Setup routine (called by (re-) initialize.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
void dump(const MSG::Level level, const bool mode=true) const
dump the content of DataOnDemand service
bool m_dump
flag to force the printout
bool m_init
flag to warm up the configuration
StatusCode update()
update the handlers
StatusCode DataOnDemandSvc::reinitialize ( )
override

Inherited Service overrides: Service reinitialization.

re-initialization of the service

Definition at line 375 of file DataOnDemandSvc.cpp.

376 {
377  // reinitialize the Service Base class
378  if ( m_incSvc )
379  {
380  m_incSvc -> removeListener ( this , m_trapType );
381  m_incSvc.reset();
382  }
383  m_algMgr.reset();
384  m_dataSvc.reset();
385  for(const auto& i : m_nodeMappers ) m_toolSvc->releaseTool(i).ignore();
386  m_nodeMappers.clear();
387  for(const auto& i : m_algMappers ) m_toolSvc->releaseTool(i).ignore();
388  m_algMappers.clear();
389  m_toolSvc.reset();
390  m_log.reset();
391  //
393  if ( sc.isFailure() ) { return sc; }
394  //
395  sc = setup() ;
396  if ( sc.isFailure() ) { return sc; }
397  //
398  if ( m_dump ) { dump ( MSG::INFO ) ; }
399  else if ( MSG::DEBUG >= outputLevel() ) { dump ( MSG::DEBUG ) ; }
400  //
401  return StatusCode::SUCCESS ;
402 }
std::vector< IDODNodeMapper * > m_nodeMappers
SmartIF< IIncidentSvc > m_incSvc
Incident service.
std::unique_ptr< MsgStream > m_log
std::string m_trapType
Trap name.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
SmartIF< IDataProviderSvc > m_dataSvc
Data provider reference.
StatusCode setup()
Setup routine (called by (re-) initialize.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode reinitialize() override
Definition: Service.cpp:283
void dump(const MSG::Level level, const bool mode=true) const
dump the content of DataOnDemand service
std::vector< IDODAlgMapper * > m_algMappers
SmartIF< IAlgManager > m_algMgr
Algorithm manager.
SmartIF< IToolSvc > m_toolSvc
Data provider reference.
bool m_dump
flag to force the printout
virtual StatusCode releaseTool(IAlgTool *tool)=0
Release the tool.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
void ignore() const
Definition: StatusCode.h:108
list i
Definition: ana.py:128
StatusCode DataOnDemandSvc::setup ( )
protected

Setup routine (called by (re-) initialize.

Definition at line 406 of file DataOnDemandSvc.cpp.

407 {
408  if ( !(m_algMgr = serviceLocator()) ) // assignment meant
409  {
410  error() << "Failed to retrieve the IAlgManager interface." << endmsg;
411  return StatusCode::FAILURE;
412  }
413 
414  if ( !(m_incSvc = serviceLocator()->service("IncidentSvc")) ) // assignment meant
415  {
416  error() << "Failed to retrieve Incident service." << endmsg;
417  return StatusCode::FAILURE;
418  }
420 
421  if ( !(m_dataSvc = serviceLocator()->service(m_dataSvcName)) ) // assignment meant
422  {
423  error()
424  << "Failed to retrieve the data provider interface of "
425  << m_dataSvcName << endmsg;
426  return StatusCode::FAILURE;
427  }
428 
429  // No need to get the ToolSvc if we are not using tools
430  if (!(m_nodeMapTools.empty() && m_algMapTools.empty())) {
431  if ( !(m_toolSvc = serviceLocator()->service("ToolSvc")) ) // assignment meant
432  {
433  error() << "Failed to retrieve ToolSvc" << endmsg;
434  return StatusCode::FAILURE;
435  }
436 
437  // load the node mapping tools
438  IDODNodeMapper *nodetool = nullptr;
439  for(const auto& i : m_nodeMapTools) {
440  const StatusCode sc = m_toolSvc->retrieveTool(i, nodetool);
441  if (sc.isFailure()) return sc;
442  m_nodeMappers.push_back(nodetool);
443  }
444  IDODAlgMapper *algtool = nullptr;
445  for(const auto& i : m_algMapTools) {
446  const StatusCode sc = m_toolSvc->retrieveTool(i, algtool);
447  if (sc.isFailure()) return sc;
448  m_algMappers.push_back(algtool);
449  }
450  }
451  return update();
452 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< IDODNodeMapper * > m_nodeMappers
SmartIF< IIncidentSvc > m_incSvc
Incident service.
std::vector< std::string > m_algMapTools
std::string m_trapType
Trap name.
std::string m_dataSvcName
Data service name.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode retrieveTool(const std::string &type, T *&tool, const IInterface *parent=nullptr, bool createIf=true)
Retrieve specified tool sub-type with tool dependent part of the name automatically assigned...
Definition: IToolSvc.h:145
SmartIF< IDataProviderSvc > m_dataSvc
Data provider reference.
Interface of tools used by the DataOnDemandSvc to choose the type of node to be created at a path...
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::vector< std::string > m_nodeMapTools
std::vector< IDODAlgMapper * > m_algMappers
Interface of tools used by the DataOnDemandSvc to choose the algorithm to be run to produce the data ...
Definition: IDODAlgMapper.h:17
SmartIF< IAlgManager > m_algMgr
Algorithm manager.
SmartIF< IToolSvc > m_toolSvc
Data provider reference.
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
list i
Definition: ana.py:128
StatusCode update()
update the handlers
StatusCode DataOnDemandSvc::setupAlgHandlers ( )
protected

Initialize leaf handlers.

Definition at line 493 of file DataOnDemandSvc.cpp.

494 {
495  std::string typ, tag;
496 
497  for (auto alg: m_algMapping)
498  {
499  using Parser = Gaudi::Utils::AttribStringParser;
500  for (auto attrib: Parser(alg)) {
501  switch( ::toupper(attrib.tag[0]) ) {
502  case 'D':
503  tag = std::move(attrib.value);
504  break;
505  case 'T':
506  typ = std::move(attrib.value);
507  break;
508  }
509  }
511  if ( m_algMap .end () != m_algMap .find ( tag ) ||
512  m_nodeMap .end () != m_nodeMap .find ( tag ) )
513  {
514  stream()
515  << MSG::WARNING
516  << "The obsolete property 'Algorithms' redefines the action for '"
517  + tag + "' to be '" +item.type() +"/"+item.name()+"'"
518  << endmsg ;
519  }
520  m_algMap[tag] = item.type() + "/" + item.name() ;
521  }
522  m_updateRequired = true ;
523  return StatusCode::SUCCESS;
524 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
Map m_algMap
the major configuration property { 'data' : 'algorithm' }
Setup m_algMapping
Mapping to algorithms.
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
tuple item
print s1,s2
Definition: ana.py:146
Map m_nodeMap
the major configuration property { 'data' : 'type' }
void toupper(std::string &s)
StatusCode DataOnDemandSvc::setupNodeHandlers ( )
protected

Initialize node handlers.

Definition at line 456 of file DataOnDemandSvc.cpp.

457 {
458  std::string nam, typ, tag;
460  // Setup for node leafs, where simply a constructor is called...
461  for (auto node: m_nodeMapping)
462  {
463  using Parser = Gaudi::Utils::AttribStringParser;
464  for (auto attrib: Parser(node)) {
465  switch( ::toupper(attrib.tag[0]) ) {
466  case 'D':
467  tag = std::move(attrib.value);
468  break;
469  case 'T':
470  nam = std::move(attrib.value);
471  break;
472  }
473  }
474  if ( m_algMap .end () != m_algMap .find ( tag ) ||
475  m_nodeMap .end () != m_nodeMap .find ( tag ) )
476  {
477  stream()
478  << MSG::WARNING
479  << "The obsolete property 'Nodes' redefines the action for '"
480  + tag + "' to be '" +nam+"'"
481  << endmsg ;
482  }
483  m_nodeMap[tag] = nam ;
484  }
485  //
486  m_updateRequired = true ;
487  //
488  return sc;
489 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
Setup m_nodeMapping
Mapping to nodes.
Map m_algMap
the major configuration property { 'data' : 'algorithm' }
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Map m_nodeMap
the major configuration property { 'data' : 'type' }
void toupper(std::string &s)
MsgStream& DataOnDemandSvc::stream ( ) const
inlineprotected

get the message stream

Definition at line 231 of file DataOnDemandSvc.h.

232  {
233  if ( !m_log ) m_log.reset( new MsgStream( msgSvc() , name() ) );
234  return *m_log;
235  }
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
std::unique_ptr< MsgStream > m_log
StatusCode DataOnDemandSvc::update ( )
protected

update the handlers

convert obsolete "Nodes" into new "NodeMap"

convert obsolete "Algorithms" into new "AlgMap"

add the default prefix

add the default prefix

get all directories

setup algorithms

setup nodes

Definition at line 239 of file DataOnDemandSvc.cpp.

240 {
241  if ( !m_updateRequired ) { return StatusCode::SUCCESS ; }
242 
244  StatusCode sc = setupNodeHandlers() ; // convert "Nodes" new "NodeMap"
245  if ( sc.isFailure() )
246  {
247  stream() << MSG::ERROR << "Failed to setup old \"Nodes\"" << endmsg ;
248  return sc ;
249  }
251  sc = setupAlgHandlers() ; // convert "Algorithms" into "AlgMap"
252  if ( sc.isFailure() )
253  {
254  stream() << MSG::ERROR << "Failed to setup old \"Algorithms\"" << endmsg ;
255  return sc ;
256  }
258  add_prefix ( m_algMap , m_prefix ) ;
260  add_prefix ( m_nodeMap , m_prefix ) ;
262  std::set<std::string> dirs ;
263  if ( m_partialPath ){ get_dirs ( m_algMap , dirs ) ; }
264  if ( m_partialPath ){ get_dirs ( m_nodeMap , dirs ) ; }
265  //
266  auto _e = dirs.find("/Event") ;
267  if ( dirs.end() != _e ) { dirs.erase( _e ) ; }
268  // add all directories as nodes
269  for ( const auto& dir : dirs )
270  {
271  if ( m_algMap .end () == m_algMap .find ( dir ) &&
272  m_nodeMap .end () == m_nodeMap .find ( dir ) )
273  m_nodeMap [dir] = "DataObject" ;
274  }
275  //
276  m_algs .clear () ;
277  m_nodes .clear () ;
278  //
280  for ( const auto& alg : m_algMap )
281  {
282  if (i_setAlgHandler(alg.first, alg.second).isFailure())
283  return StatusCode::FAILURE;
284  }
286  for ( const auto& node : m_nodeMap )
287  {
288  i_setNodeHandler(node.first, node.second);
289  }
291  m_updateRequired = false ;
292  //
293  return StatusCode::SUCCESS ;
294 }
void i_setNodeHandler(const std::string &name, const std::string &type)
Internal method to initialize a node handler.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
Map m_algMap
the major configuration property { 'data' : 'algorithm' }
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode setupNodeHandlers()
Initialize node handlers.
NodeMap m_nodes
Map of "empty" objects to be placed as intermediate nodes.
std::string m_prefix
bool m_partialPath
Flag to allow for the creation of partial leaves.
AlgMap m_algs
Map of algorithms to handle incidents.
void clear()
Definition: Map.h:178
Map m_nodeMap
the major configuration property { 'data' : 'type' }
StatusCode setupAlgHandlers()
Initialize leaf handlers.
StatusCode i_setAlgHandler(const std::string &name, const Gaudi::Utils::TypeNameString &alg)
Internal method to initialize an algorithm handler.
void DataOnDemandSvc::update_1 ( Property p)

Definition at line 89 of file DataOnDemandSvc.cpp.

90 {
91  stream() << MSG::VERBOSE << " I am update handler for property " << p << endmsg ;
92  // force update
93  m_updateRequired = true ;
94 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
void DataOnDemandSvc::update_2 ( Property p)

Definition at line 110 of file DataOnDemandSvc.cpp.

111 {
112  stream() << MSG::WARNING
113  << "The property 'Algorithms' is obsolete, switch to map-like 'AlgMap' "
114  << " = { 'data' : 'algorithm' } "
115  << endmsg ;
116  // force update
117  m_updateRequired = true ;
118 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
void DataOnDemandSvc::update_3 ( Property p)

Definition at line 98 of file DataOnDemandSvc.cpp.

99 {
100  stream() << MSG::WARNING
101  << "The property 'Nodes' is obsolete, switch to map-like 'NodeMap' "
102  << " = { 'data' : 'type' } "
103  << endmsg ;
104  // force update
105  m_updateRequired = true ;
106 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MsgStream & stream() const
get the message stream
void DataOnDemandSvc::update_dump ( Property )

update handler for 'Dump' property

Definition at line 122 of file DataOnDemandSvc.cpp.

123 {
124  // no action if not yet initialized
125  if ( FSMState() < Gaudi::StateMachine::INITIALIZED ) { return ; }
126  // dump the configuration:
127  if ( m_dump ) { dump ( MSG::ALWAYS ) ; }
128 }
void dump(const MSG::Level level, const bool mode=true) const
dump the content of DataOnDemand service
bool m_dump
flag to force the printout

Member Data Documentation

Map DataOnDemandSvc::m_algMap
private

the major configuration property { 'data' : 'algorithm' }

Definition at line 276 of file DataOnDemandSvc.h.

std::vector<IDODAlgMapper *> DataOnDemandSvc::m_algMappers
private

Definition at line 298 of file DataOnDemandSvc.h.

Setup DataOnDemandSvc::m_algMapping
private

Mapping to algorithms.

Definition at line 266 of file DataOnDemandSvc.h.

std::vector<std::string> DataOnDemandSvc::m_algMapTools
private

Definition at line 297 of file DataOnDemandSvc.h.

SmartIF<IAlgManager> DataOnDemandSvc::m_algMgr = nullptr
private

Algorithm manager.

Definition at line 247 of file DataOnDemandSvc.h.

AlgMap DataOnDemandSvc::m_algs
private

Map of algorithms to handle incidents.

Definition at line 270 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_allowInitFailure = false
private

flag to allow DataOnDemand initialization to succeed even if the (pre)initialization of the algorithms fails (m_init).

Definition at line 264 of file DataOnDemandSvc.h.

SmartIF<IDataProviderSvc> DataOnDemandSvc::m_dataSvc = nullptr
private

Data provider reference.

Definition at line 249 of file DataOnDemandSvc.h.

std::string DataOnDemandSvc::m_dataSvcName = "EventDataSvc"
private

Data service name.

Definition at line 255 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_dump = false
private

flag to force the printout

Definition at line 259 of file DataOnDemandSvc.h.

SmartIF<IIncidentSvc> DataOnDemandSvc::m_incSvc = nullptr
private

Incident service.

Definition at line 245 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_init = false
private

flag to warm up the configuration

Definition at line 261 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_locked_algs = false
private

Definition at line 292 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_locked_all = false
private

Definition at line 293 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_locked_nodes = false
private

Definition at line 291 of file DataOnDemandSvc.h.

std::unique_ptr<MsgStream> DataOnDemandSvc::m_log
mutableprivate

Definition at line 281 of file DataOnDemandSvc.h.

Map DataOnDemandSvc::m_nodeMap
private

the major configuration property { 'data' : 'type' }

Definition at line 278 of file DataOnDemandSvc.h.

std::vector<IDODNodeMapper *> DataOnDemandSvc::m_nodeMappers
private

Definition at line 296 of file DataOnDemandSvc.h.

Setup DataOnDemandSvc::m_nodeMapping
private

Mapping to nodes.

Definition at line 268 of file DataOnDemandSvc.h.

std::vector<std::string> DataOnDemandSvc::m_nodeMapTools
private

Definition at line 295 of file DataOnDemandSvc.h.

NodeMap DataOnDemandSvc::m_nodes
private

Map of "empty" objects to be placed as intermediate nodes.

Definition at line 272 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_partialPath = true
private

Flag to allow for the creation of partial leaves.

Definition at line 257 of file DataOnDemandSvc.h.

std::string DataOnDemandSvc::m_prefix = "/Event/"
private

Definition at line 280 of file DataOnDemandSvc.h.

ulonglong DataOnDemandSvc::m_stat = 0
private

Definition at line 286 of file DataOnDemandSvc.h.

ulonglong DataOnDemandSvc::m_statAlg = 0
private

Definition at line 284 of file DataOnDemandSvc.h.

ulonglong DataOnDemandSvc::m_statNode = 0
private

Definition at line 285 of file DataOnDemandSvc.h.

ChronoEntity DataOnDemandSvc::m_timer_algs
private

Definition at line 289 of file DataOnDemandSvc.h.

ChronoEntity DataOnDemandSvc::m_timer_all
private

Definition at line 290 of file DataOnDemandSvc.h.

ChronoEntity DataOnDemandSvc::m_timer_nodes
private

Definition at line 288 of file DataOnDemandSvc.h.

SmartIF<IToolSvc> DataOnDemandSvc::m_toolSvc
private

Data provider reference.

Definition at line 251 of file DataOnDemandSvc.h.

ChronoEntity DataOnDemandSvc::m_total
private

Definition at line 283 of file DataOnDemandSvc.h.

std::string DataOnDemandSvc::m_trapType = "DataFault"
private

Trap name.

Definition at line 253 of file DataOnDemandSvc.h.

bool DataOnDemandSvc::m_updateRequired = true
private

Definition at line 279 of file DataOnDemandSvc.h.


The documentation for this class was generated from the following files: