Gaudi Framework, version v23r2

Home   Generated: Thu Jun 28 2012
Public Member Functions | Public Attributes

GaudiPython::Persistency::RootPersistency Class Reference

Inheritance diagram for GaudiPython::Persistency::RootPersistency:
Inheritance graph
[legend]
Collaboration diagram for GaudiPython::Persistency::RootPersistency:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def configure
def formatInput
def formatOutput

Public Attributes

 configured

Detailed Description

Implementation of PersistencyHelper based on Gaudi::RootCnvSvc.

Definition at line 91 of file Persistency.py.


Constructor & Destructor Documentation

def GaudiPython::Persistency::RootPersistency::__init__ (   self )
Constructor.

Declare the type of supported persistencies to the base class.

Definition at line 95 of file Persistency.py.

00096                       :
00097         """
00098         Constructor.
00099 
00100         Declare the type of supported persistencies to the base class.
00101         """
00102         super(RootPersistency, self).__init__(["ROOT", "POOL_ROOT",
00103                                                "RootCnvSvc", "Gaudi::RootCnvSvc"])
00104         self.configured = False


Member Function Documentation

def GaudiPython::Persistency::RootPersistency::configure (   self,
  appMgr 
)
Basic configuration.

Definition at line 105 of file Persistency.py.

00106                                :
00107         """
00108         Basic configuration.
00109         """
00110         if not self.configured:
00111             # instantiate the required services
00112             appMgr.service('Gaudi::RootCnvSvc/RootCnvSvc')
00113             eps = appMgr.service ( 'EventPersistencySvc' )
00114             eps.CnvServices += ['RootCnvSvc']
00115             self.configured = True

def GaudiPython::Persistency::RootPersistency::formatInput (   self,
  filenames,
  kwargs 
)
Translate a list of file names in a list of input descriptions.

The optional parameters 'collection', 'sel' and 'fun' should be used to
configure Event Tag Collection inputs.

@param filenames: the list of files

Definition at line 116 of file Persistency.py.

00117                                               :
00118         '''
00119         Translate a list of file names in a list of input descriptions.
00120 
00121         The optional parameters 'collection', 'sel' and 'fun' should be used to
00122         configure Event Tag Collection inputs.
00123 
00124         @param filenames: the list of files
00125         '''
00126         if not self.configured:
00127             raise PersistencyError("Persistency not configured")
00128         if type(filenames) is str:
00129             filenames = [filenames]
00130         fileargs = {}
00131         # check if we are accessing a collection
00132         fileargs = dict([(k, kwargs[k])
00133                          for k in ["collection", "sel", "fun"]
00134                          if k in kwargs])
00135         if fileargs:
00136             # is a collection
00137             svc = 'Gaudi::RootCnvSvc'
00138         else:
00139             svc = 'Gaudi::RootEvtSelector'
00140         return map(str,
00141                    [FileDescription(f, 'READ', svc, **fileargs)
00142                     for f in filenames])

def GaudiPython::Persistency::RootPersistency::formatOutput (   self,
  filename,
  kwargs 
)
Translate a filename in an output description.

@param filenames: the list of files
@param lun: Logical Unit for Event Tag Collection outputs (optional)

Definition at line 143 of file Persistency.py.

00144                                               :
00145         '''
00146         Translate a filename in an output description.
00147 
00148         @param filenames: the list of files
00149         @param lun: Logical Unit for Event Tag Collection outputs (optional)
00150         '''
00151         if not self.configured:
00152             raise PersistencyError("Persistency not configured")
00153         retval = str(FileDescription(filename, 'RECREATE', 'Gaudi::RootCnvSvc'))
00154         if 'lun' in kwargs:
00155             retval = "%s %s" % (kwargs['lun'], retval)
00156         return retval
00157 
00158 # Adding the know instances to the list of helpers
00159 add(RootPersistency())

Member Data Documentation

Definition at line 99 of file Persistency.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Thu Jun 28 2012 23:27:52 for Gaudi Framework, version v23r2 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004