| The Gaudi Framework v27r1

- 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 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.

95 def __init__(self):
96 """
97 Constructor.
98
99 Declare the type of supported persistencies to the base class.
100 """
101 super(RootPersistency, self).__init__(["ROOT", "POOL_ROOT",
102 "RootCnvSvc", "Gaudi::RootCnvSvc"])
103 self.configured = False
104
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:103
GaudiPython.Persistency.RootPersistency.__init__
def __init__(self)
Definition: Persistency.py:95

## Member Function Documentation

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

    Basic configuration.

Definition at line 105 of file Persistency.py.

105 def configure(self, appMgr):
106 """
107 Basic configuration.
108 """
109 if not self.configured:
110 # instantiate the required services
111 appMgr.service('Gaudi::RootCnvSvc/RootCnvSvc')
112 eps = appMgr.service ( 'EventPersistencySvc' )
113 eps.CnvServices += ['RootCnvSvc']
114 self.configured = True
115
GaudiPython.Persistency.RootPersistency.configure
def configure(self, appMgr)
Definition: Persistency.py:105
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:103

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.

116 def formatInput(self, filenames, **kwargs):
117 '''
118 Translate a list of file names in a list of input descriptions.
119
120 The optional parameters 'collection', 'sel' and 'fun' should be used to
121 configure Event Tag Collection inputs.
122
123 @param filenames: the list of files
124 '''
125 if not self.configured:
126 raise PersistencyError("Persistency not configured")
127 if type(filenames) is str:
128 filenames = [filenames]
129 fileargs = {}
130 # check if we are accessing a collection
131 fileargs = dict([(k, kwargs[k])
132 for k in ["collection", "sel", "fun"]
133 if k in kwargs])
134 if fileargs:
135 # is a collection
136 svc = 'Gaudi::RootCnvSvc'
137 else:
138 svc = 'Gaudi::RootEvtSelector'
139 return map(str,
140 [FileDescription(f, 'READ', svc, **fileargs)
141 for f in filenames])
142
GaudiPython.Persistency.RootPersistency.formatInput
def formatInput(self, filenames, kwargs)
Definition: Persistency.py:116
gaudirun.type
string type
Definition: gaudirun.py:151
Containers::map
struct GAUDI_API map
Parametrisation class for map-like implementation.
Definition: KeyedObjectManager.h:25
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:103
GaudiPython.Persistency.PersistencyError
Definition: Persistency.py:6
GaudiPython.Persistency.FileDescription
Definition: Persistency.py:40

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.

143 def formatOutput(self, filename, **kwargs):
144 '''
145 Translate a filename in an output description.
146
147 @param filenames: the list of files
148 @param lun: Logical Unit for Event Tag Collection outputs (optional)
149 '''
150 if not self.configured:
151 raise PersistencyError("Persistency not configured")
152 retval = str(FileDescription(filename, 'RECREATE', 'Gaudi::RootCnvSvc'))
153 if 'lun' in kwargs:
154 retval = "%s %s" % (kwargs['lun'], retval)
155 return retval
156
157 # Adding the know instances to the list of helpers
158 add(RootPersistency())
159
GaudiPython.Persistency.RootPersistency.formatOutput
def formatOutput(self, filename, kwargs)
Definition: Persistency.py:143
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:32
GaudiPython.Persistency.RootPersistency
Definition: Persistency.py:91
GaudiPython.Persistency.RootPersistency.configured
configured
Definition: Persistency.py:103
GaudiPython.Persistency.PersistencyError
Definition: Persistency.py:6
GaudiPython.Persistency.FileDescription
Definition: Persistency.py:40

## Member Data Documentation

GaudiPython.Persistency.RootPersistency.configured

Definition at line 103 of file Persistency.py.

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

- GaudiPython/python/GaudiPython/Persistency.py