| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | List of all members
GaudiPython.Bindings.iDataSvc Class Reference
Inheritance diagram for GaudiPython.Bindings.iDataSvc:
[legend]
Collaboration diagram for GaudiPython.Bindings.iDataSvc:
[legend]

## 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=None)
def | dump (self, node=None)
def | getList (self, node=None, lst=[], rootFID=None)
def | getHistoNames (self, node=None, lst=[])
def | setRoot (self, name, obj)
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

## Member Function Documentation

## ◆ __delitem__()

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

Definition at line 599 of file Bindings.py.

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

## ◆ __getitem__()

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

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

Definition at line 587 of file Bindings.py.

587 def __getitem__(self, path):
588 if not self._idp:
589 raise IndexError(
590 'C++ service %s does not exist' % self.__dict__['_name'])
591 return Helper.dataobject(self._idp, path)
592
GaudiPython.Pythonizations.__getitem__
__getitem__
Definition: Pythonizations.py:115

## ◆ __setitem__()

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

Definition at line 593 of file Bindings.py.

593 def __setitem__(self, path, obj):
594 if not self._idp:
595 raise IndexError(
596 'C++ service %s does not exist' % self.__dict__['_name'])
597 return self.registerObject(path, obj)
598

## ◆ clearStore()

def GaudiPython.Bindings.iDataSvc.clearStore | ( |  | self | ) |

Definition at line 672 of file Bindings.py.

672 def clearStore(self):
673 if not self._idm:
674 raise IndexError(
675 'C++ service %s does not exist' % self.__dict__['_name'])
676 return self._idm.clearStore()
677
678
679 # ----iHistogramSvc class------------------------------------------------------

## ◆ dump()

def GaudiPython.Bindings.iDataSvc.dump | ( |  | self,
|  |  | node = `None`
| ) |  |

Definition at line 616 of file Bindings.py.

616 def dump(self, node=None):
617 if not node:
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 540 of file Bindings.py.

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

## ◆ getHistoNames()

def GaudiPython.Bindings.iDataSvc.getHistoNames | ( |  | self,
|  |  | node = `None`,
|  |  | lst = `[]`
| ) |  |

Definition at line 647 of file Bindings.py.

647 def getHistoNames(self, node=None, lst=[]):
648 if not node:
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 = `None`,
|  |  | lst = `[]`,
|  |  | rootFID = `None`
| ) |  |

Definition at line 628 of file Bindings.py.

628 def getList(self, node=None, lst=[], rootFID=None):
629 if not node:
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
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465

## ◆ 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 559 of file Bindings.py.

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

## ◆ leaves()

def GaudiPython.Bindings.iDataSvc.leaves | ( |  | self,
|  |  | node = `None`
| ) |  |

Definition at line 605 of file Bindings.py.

605 def leaves(self, node=None):
606 if not node:
607 node = self.retrieveObject('')
608 ll = gbl.std.vector('IRegistry*')()
609 if type(node) is str:
610 obj = self.retrieveObject(node)
611 else:
612 obj = node
613 if self._idm.objectLeaves(node, ll).isSuccess():
614 return ll
615
gaudirun.type
type
Definition: gaudirun.py:142

## ◆ registerObject()

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

Definition at line 521 of file Bindings.py.

521 def registerObject(self, path, obj):
522 if not self._idp:
523 raise AttributeError(
524 'C++ service %s does not exist' % self.__dict__['_name'])
525 return Helper.registerObject(self._idp, path, obj)
526

## ◆ retrieveObject()

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

Definition at line 533 of file Bindings.py.

533 def retrieveObject(self, path):
534 if not self._idp:
535 return None
536 return Helper.dataobject(self._idp, path)
537

## ◆ 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(
669 'C++ service %s does not exist' % self.__dict__['_name'])
670 return self._idm.setRoot(name, obj)
671

## ◆ unregisterObject()

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

Definition at line 527 of file Bindings.py.

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

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

- GaudiPython/python/GaudiPython/Bindings.py