The Gaudi Framework  v38r0 (2143aa4c)
GaudiPython.Bindings.iDataSvc Class Reference
Inheritance diagram for GaudiPython.Bindings.iDataSvc:
Collaboration diagram for GaudiPython.Bindings.iDataSvc:

Public Member Functions

def __init__ (self, name, idp)
 
def registerObject (self, path, obj)
 
def unregisterObject (self, path)
 
def retrieveObject (self, path)
 
def findObject (self, path)
 
def getObject (self, path, *args)
 
def __getitem__ (self, path)
 
def __setitem__ (self, path, obj)
 
def __delitem__ (self, path)
 
def leaves (self, node=cppyy.nullptr)
 
def dump (self, node=cppyy.nullptr)
 
def getList (self, node=cppyy.nullptr, lst=[], rootFID=None)
 
def getHistoNames (self, node=cppyy.nullptr, lst=[])
 
def setRoot (self, name, obj)
 
def selectOnlyStore (self)
 
def selectStore (self, n)
 
def clearStore (self)
 
- Public Member Functions inherited from GaudiPython.Bindings.iService
def retrieveInterface (self)
 
def initialize (self)
 
def start (self)
 
def stop (self)
 
def finalize (self)
 
def reinitialize (self)
 
def restart (self)
 
def isValid (self)
 
- Public Member Functions inherited from GaudiPython.Bindings.iProperty
def getInterface (self)
 
def __call_interface_method__ (self, ifname, method, *args)
 
def __setattr__ (self, name, value)
 
def __getattr__ (self, name)
 
def properties (self)
 
def name (self)
 

Detailed Description

Definition at line 515 of file Bindings.py.

Constructor & Destructor Documentation

◆ __init__()

def GaudiPython.Bindings.iDataSvc.__init__ (   self,
  name,
  idp 
)

Reimplemented from GaudiPython.Bindings.iService.

Reimplemented in GaudiPython.Bindings.iNTupleSvc, and GaudiPython.Bindings.iHistogramSvc.

Definition at line 516 of file Bindings.py.

516  def __init__(self, name, idp):
517  iService.__init__(self, name, idp)
518  self.__dict__["_idp"] = InterfaceCast(gbl.IDataProviderSvc)(idp)
519  self.__dict__["_idm"] = InterfaceCast(gbl.IDataManagerSvc)(idp)
520  # do not use InterfaceCast as it prints an error on failure
521  self.__dict__["_ihwb"] = None
522  ip = makeNullPointer(gbl.IHiveWhiteBoard)
523  if idp.queryInterface(gbl.IHiveWhiteBoard.interfaceID(), ip).isSuccess():
524  self.__dict__["_ihwb"] = ip
525 

Member Function Documentation

◆ __delitem__()

def GaudiPython.Bindings.iDataSvc.__delitem__ (   self,
  path 
)

Definition at line 602 of file Bindings.py.

602  def __delitem__(self, path):
603  if not self._idp:
604  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
605  return self.unregisterObject(path)
606 

◆ __getitem__()

def GaudiPython.Bindings.iDataSvc.__getitem__ (   self,
  path 
)

Reimplemented in GaudiPython.Bindings.iNTupleSvc, and GaudiPython.Bindings.iHistogramSvc.

Definition at line 592 of file Bindings.py.

592  def __getitem__(self, path):
593  if not self._idp:
594  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
595  return Helper.dataobject(self._idp, path)
596 

◆ __setitem__()

def GaudiPython.Bindings.iDataSvc.__setitem__ (   self,
  path,
  obj 
)

Definition at line 597 of file Bindings.py.

597  def __setitem__(self, path, obj):
598  if not self._idp:
599  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
600  return self.registerObject(path, obj)
601 

◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore (   self)

Definition at line 688 of file Bindings.py.

688  def clearStore(self):
689  if not self._idm:
690  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
691  return self._idm.clearStore()
692 
693 
694 # ----iHistogramSvc class------------------------------------------------------

◆ dump()

def GaudiPython.Bindings.iDataSvc.dump (   self,
  node = cppyy.nullptr 
)

Definition at line 616 of file Bindings.py.

616  def dump(self, node=cppyy.nullptr):
617  if node == cppyy.nullptr:
618  root = self.retrieveObject("")
619  if root:
620  node = root.registry()
621  else:
622  return
623  print(node.identifier())
624  if node.object():
625  for l in self.leaves(node):
626  self.dump(l)
627 

◆ findObject()

def GaudiPython.Bindings.iDataSvc.findObject (   self,
  path 
)
Get the existing object in TransientStore for the given location

- loading of object from persistency is NOT triggered
- 'data-on-demand' action is NOT triggered

>>> svc  =  ...                     ## get the service
>>> path =  ...                     ## get the path in Transient Store
>>> data = svc.findObject ( path )  ## use the method

Definition at line 547 of file Bindings.py.

547  def findObject(self, path):
548  """
549 
550  Get the existing object in TransientStore for the given location
551 
552  - loading of object from persistency is NOT triggered
553  - 'data-on-demand' action is NOT triggered
554 
555  >>> svc = ... ## get the service
556  >>> path = ... ## get the path in Transient Store
557  >>> data = svc.findObject ( path ) ## use the method
558 
559  """
560  if not self._idp:
561  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
562  return Helper.findobject(self._idp, path)
563 

◆ getHistoNames()

def GaudiPython.Bindings.iDataSvc.getHistoNames (   self,
  node = cppyy.nullptr,
  lst = [] 
)

Definition at line 647 of file Bindings.py.

647  def getHistoNames(self, node=cppyy.nullptr, lst=[]):
648  if node == cppyy.nullptr:
649  root = self.retrieveObject("")
650  if root:
651  node = root.registry()
652  # rootFID = node.address().par()
653  lst = []
654  else:
655  return
656  Helper.dataobject(self._idp, node.identifier())
657  if node.object():
658  lst.append(node.identifier())
659  for l in self.leaves(node):
660  if l.name(): # and l.address().par() == rootFID :
661  self.getHistoNames(l, lst)
662  else:
663  continue
664  return lst
665 

◆ getList()

def GaudiPython.Bindings.iDataSvc.getList (   self,
  node = cppyy.nullptr,
  lst = [],
  rootFID = None 
)

Definition at line 628 of file Bindings.py.

628  def getList(self, node=cppyy.nullptr, lst=[], rootFID=None):
629  if node == cppyy.nullptr:
630  root = self.retrieveObject("")
631  if root:
632  node = root.registry()
633  rootFID = node.address().par()
634  lst = []
635  else:
636  return
637  Helper.dataobject(self._idp, node.identifier())
638  if node.object():
639  lst.append(node.identifier())
640  for l in self.leaves(node):
641  if l.address() and l.address().par() == rootFID:
642  self.getList(l, lst, rootFID)
643  else:
644  continue
645  return lst
646 

◆ getObject()

def GaudiPython.Bindings.iDataSvc.getObject (   self,
  path,
args 
)
Get object from Transient Store  for the given location

arguments :
- path                           : Location of object in Transient Store
- retrieve          (bool) True  : retrieve versus find
- disable on-demand (bool) False : temporary disable 'on-demand' actions

>>> svc  = ...   ## get the service
>>> path = ...   ## get the path

>>> data = svc.getObject ( path , False )  ## find object in Transient Store

## find object in Transient Store
#  load form tape or use 'on-demand' action  for missing objects :
>>> data = svc.getObject ( path , True  )

## find object in Transient Store
#  load from tape or for missing objects, disable 'on-demand'-actions
>>> data = svc.getObject ( path , True  , True )

Definition at line 565 of file Bindings.py.

565  def getObject(self, path, *args):
566  """
567  Get object from Transient Store for the given location
568 
569  arguments :
570  - path : Location of object in Transient Store
571  - retrieve (bool) True : retrieve versus find
572  - disable on-demand (bool) False : temporary disable 'on-demand' actions
573 
574  >>> svc = ... ## get the service
575  >>> path = ... ## get the path
576 
577  >>> data = svc.getObject ( path , False ) ## find object in Transient Store
578 
579  ## find object in Transient Store
580  # load form tape or use 'on-demand' action for missing objects :
581  >>> data = svc.getObject ( path , True )
582 
583  ## find object in Transient Store
584  # load from tape or for missing objects, disable 'on-demand'-actions
585  >>> data = svc.getObject ( path , True , True )
586 
587  """
588  if not self._idp:
589  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
590  return Helper.getobject(self._idp, path, *args)
591 

◆ leaves()

def GaudiPython.Bindings.iDataSvc.leaves (   self,
  node = cppyy.nullptr 
)

Definition at line 607 of file Bindings.py.

607  def leaves(self, node=cppyy.nullptr):
608  if node == cppyy.nullptr:
609  node = self.retrieveObject("")
610  ll = gbl.std.vector("IRegistry*")()
611  if isinstance(node, str):
612  _ = self.retrieveObject(node)
613  if self._idm.objectLeaves(node, ll).isSuccess():
614  return ll
615 

◆ registerObject()

def GaudiPython.Bindings.iDataSvc.registerObject (   self,
  path,
  obj 
)

Definition at line 526 of file Bindings.py.

526  def registerObject(self, path, obj):
527  if not self._idp:
528  raise AttributeError(
529  "C++ service %s does not exist" % self.__dict__["_name"]
530  )
531  return Helper.registerObject(self._idp, path, obj)
532 

◆ retrieveObject()

def GaudiPython.Bindings.iDataSvc.retrieveObject (   self,
  path 
)

Definition at line 540 of file Bindings.py.

540  def retrieveObject(self, path):
541  if not self._idp:
542  return cppyy.nullptr
543  return Helper.dataobject(self._idp, path)
544 

◆ selectOnlyStore()

def GaudiPython.Bindings.iDataSvc.selectOnlyStore (   self)

Definition at line 671 of file Bindings.py.

671  def selectOnlyStore(self):
672  # nothing to do if GaudiHive is not used
673  if not self._ihwb:
674  return
675  # check we have a single store raise an error if it' not the case
676  if self._ihwb.getNumberOfStores() > 1:
677  raise IndexError(
678  "Several stores available in Gaudihive mode, unable to figure out which one to use.\nPlease call selectStore instead of selectSingleStore\nIf you're only using GaudiPython, make sure you configure a single thread"
679  )
680  # select the only store
681  self.selectStore(0)
682 

◆ selectStore()

def GaudiPython.Bindings.iDataSvc.selectStore (   self,
  n 
)

Definition at line 683 of file Bindings.py.

683  def selectStore(self, n):
684  if not self._ihwb:
685  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
686  return self._ihwb.selectStore(n)
687 

◆ setRoot()

def GaudiPython.Bindings.iDataSvc.setRoot (   self,
  name,
  obj 
)

Definition at line 666 of file Bindings.py.

666  def setRoot(self, name, obj):
667  if not self._idm:
668  raise IndexError("C++ service %s does not exist" % self.__dict__["_name"])
669  return self._idm.setRoot(name, obj)
670 

◆ unregisterObject()

def GaudiPython.Bindings.iDataSvc.unregisterObject (   self,
  path 
)

Definition at line 533 of file Bindings.py.

533  def unregisterObject(self, path):
534  if not self._idp:
535  raise AttributeError(
536  "C++ service %s does not exist" % self.__dict__["_name"]
537  )
538  return Helper.unregisterObject(self._idp, path)
539 

The documentation for this class was generated from the following file:
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:129
GaudiPython.Pythonizations.__getitem__
__getitem__
Definition: Pythonizations.py:141
GaudiPartProp.DumpParticleProperties.dump
def dump()
Definition: DumpParticleProperties.py:27
GaudiPartProp.Service.InterfaceCast
InterfaceCast
Definition: Service.py:39
compareOutputFiles.par
par
Definition: compareOutputFiles.py:476