| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

## Public Member Functions
def | __init__ (self)
def | configure (self, appMgr)
def | formatInput (self, filenames, kwargs)
def | formatOutput (self, filename, kwargs)
Public Member Functions inherited from GaudiPython.Persistency.PersistencyHelper
def | __init__ (self, types)
def | handle (self, typ)

## Public Attributes
| configured
Public Attributes inherited from GaudiPython.Persistency.PersistencyHelper
| types

## Detailed Description

    Implementation of PersistencyHelper based on Gaudi::RootCnvSvc.

Definition at line 105 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 110 of file Persistency.py.

110 def __init__(self):
111 """
112 Constructor.
113
114 Declare the type of supported persistencies to the base class.
115 """
116 super(RootPersistency, self).__init__(["ROOT", "POOL_ROOT",
117 "RootCnvSvc", "Gaudi::RootCnvSvc"])
118 self.configured = False
119
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:118
GaudiPython.Persistency.RootPersistency.__init__
def __init__(self)
Definition: Persistency.py:110

## Member Function Documentation

def GaudiPython.Persistency.RootPersistency.configure | ( |  | self,
|  |  | appMgr
| ) |  |

    Basic configuration.

Definition at line 120 of file Persistency.py.

120 def configure(self, appMgr):
121 """
122 Basic configuration.
123 """
124 if not self.configured:
125 # instantiate the required services
126 appMgr.service('Gaudi::RootCnvSvc/RootCnvSvc')
127 eps = appMgr.service('EventPersistencySvc')
128 eps.CnvServices += ['RootCnvSvc']
129 self.configured = True
130
GaudiPython.Persistency.RootPersistency.configure
def configure(self, appMgr)
Definition: Persistency.py:120
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:118

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 131 of file Persistency.py.

131 def formatInput(self, filenames, **kwargs):
132 '''
133 Translate a list of file names in a list of input descriptions.
134
135 The optional parameters 'collection', 'sel' and 'fun' should be used to
136 configure Event Tag Collection inputs.
137
138 @param filenames: the list of files
139 '''
140 if not self.configured:
141 raise PersistencyError("Persistency not configured")
142 if type(filenames) is str:
143 filenames = [filenames]
144 fileargs = {}
145 # check if we are accessing a collection
146 fileargs = dict([(k, kwargs[k])
147 for k in ["collection", "sel", "fun"]
148 if k in kwargs])
149 if fileargs:
150 # is a collection
151 svc = 'Gaudi::RootCnvSvc'
152 else:
153 svc = 'Gaudi::RootEvtSelector'
154 return map(str,
155 [FileDescription(f, 'READ', svc, **fileargs)
156 for f in filenames])
157
GaudiPython.Persistency.RootPersistency.formatInput
def formatInput(self, filenames, kwargs)
Definition: Persistency.py:131
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:26
gaudirun.type
type
Definition: gaudirun.py:133
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:118
GaudiPython.Persistency.PersistencyError
Definition: Persistency.py:7
GaudiPython.Persistency.FileDescription
Definition: Persistency.py:48

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 158 of file Persistency.py.

158 def formatOutput(self, filename, **kwargs):
159 '''
160 Translate a filename in an output description.
161
162 @param filenames: the list of files
163 @param lun: Logical Unit for Event Tag Collection outputs (optional)
164 '''
165 if not self.configured:
166 raise PersistencyError("Persistency not configured")
167 retval = str(FileDescription(
168 filename, 'RECREATE', 'Gaudi::RootCnvSvc'))
169 if 'lun' in kwargs:
170 retval = "%s %s" % (kwargs['lun'], retval)
171 return retval
172
173
174 # Adding the know instances to the list of helpers
175 add(RootPersistency())
176
GaudiPython.Persistency.RootPersistency.formatOutput
def formatOutput(self, filename, kwargs)
Definition: Persistency.py:158
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39
GaudiPython.Persistency.RootPersistency
Definition: Persistency.py:105
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:118
GaudiPython.Persistency.PersistencyError
Definition: Persistency.py:7
GaudiPython.Persistency.FileDescription
Definition: Persistency.py:48

## Member Data Documentation

GaudiPython.Persistency.RootPersistency.configured

Definition at line 118 of file Persistency.py.

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

- GaudiPython/python/GaudiPython/Persistency.py