2 Module to configure the persistency type in GaudiPython. 4 __author__ =
"Marco Clemencic <marco.clemencic@cern.ch>" 9 Base class for exceptions in PersistencyHelper. 16 Exception raised if the persistency type is not known to the module. 20 super(UnknownPersistency, self).
__init__(
21 "Unknown persistency type %r" % type_)
31 Return the PersistencyHerper implementing the given persistency type. 33 for i
in _implementations:
41 Function to extend the list of known helpers. 43 New helpers are added to the top of the list. 45 _implementations.insert(0, instance)
49 def __init__(self, filename, opt, svc, sel=None, collection=None, fun=None):
51 Class to hold/manipulate the file description. 53 @param filename: name of the file 54 @param opt: option (READ/CREATE/RECREATE/WRITE) 55 @param svc: conversion service (or selector) 56 @param sel: selection expression 57 @param collection: collection 58 @param fun: selection class 69 Return a list of pairs describing the instance. 80 Return the string representation of the file description to be passed 83 return " ".join([
"%s='%s'" % (k, v)
for k, v
in self.
__data__()
if v])
88 Base class for extensions to persistency configuration in GaudiPython. 93 Define the type of persistencies supported by the instance. 99 Returns True if the current instance understands the requested 102 return typ
in self.
types 107 Implementation of PersistencyHelper based on Gaudi::RootCnvSvc. 114 Declare the type of supported persistencies to the base class. 116 super(RootPersistency, self).
__init__([
"ROOT",
"POOL_ROOT",
117 "RootCnvSvc",
"Gaudi::RootCnvSvc"])
126 appMgr.service(
'Gaudi::RootCnvSvc/RootCnvSvc')
127 eps = appMgr.service(
'EventPersistencySvc')
128 eps.CnvServices += [
'RootCnvSvc']
133 Translate a list of file names in a list of input descriptions. 135 The optional parameters 'collection', 'sel' and 'fun' should be used to 136 configure Event Tag Collection inputs. 138 @param filenames: the list of files 142 if type(filenames)
is str:
143 filenames = [filenames]
146 fileargs = dict([(k, kwargs[k])
147 for k
in [
"collection",
"sel",
"fun"]
151 svc =
'Gaudi::RootCnvSvc' 153 svc =
'Gaudi::RootEvtSelector' 160 Translate a filename in an output description. 162 @param filenames: the list of files 163 @param lun: Logical Unit for Event Tag Collection outputs (optional) 168 filename,
'RECREATE',
'Gaudi::RootCnvSvc'))
170 retval =
"%s %s" % (kwargs[
'lun'], retval)
def __init__(self, types)
def formatOutput(self, filename, kwargs)
def __init__(self, type_)
def formatInput(self, filenames, kwargs)
def __init__(self, filename, opt, svc, sel=None, collection=None, fun=None)
struct GAUDI_API map
Parametrisation class for map-like implementation.
def configure(self, appMgr)