Loading [MathJax]/jax/output/HTML-CSS/config.js
The Gaudi Framework  v28r2p1 (f1a77ff4)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GaudiPython.Persistency.RootPersistency Class Reference
Inheritance diagram for GaudiPython.Persistency.RootPersistency:
Collaboration diagram for GaudiPython.Persistency.RootPersistency:

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 

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 
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 
def formatInput(self, filenames, kwargs)
Definition: Persistency.py:116
struct GAUDI_API map
Parametrisation class for map-like implementation.
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

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: