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,
21 self).
__init__(
"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,
52 Class to hold/manipulate the file description. 54 @param filename: name of the file 55 @param opt: option (READ/CREATE/RECREATE/WRITE) 56 @param svc: conversion service (or selector) 57 @param sel: selection expression 58 @param collection: collection 59 @param fun: selection class 70 Return a list of pairs describing the instance. 72 return [(
"DATAFILE", self.
filename), (
"OPT", self.
opt),
73 (
"SVC", self.
svc), (
"SEL", self.
sel),
78 Return the string representation of the file description to be passed 81 return " ".join([
"%s='%s'" % (k, v)
for k, v
in self.
__data__()
if v])
86 Base class for extensions to persistency configuration in GaudiPython. 91 Define the type of persistencies supported by the instance. 97 Returns True if the current instance understands the requested 100 return typ
in self.
types 105 Implementation of PersistencyHelper based on Gaudi::RootCnvSvc. 112 Declare the type of supported persistencies to the base class. 114 super(RootPersistency, self).
__init__(
115 [
"ROOT",
"POOL_ROOT",
"RootCnvSvc",
"Gaudi::RootCnvSvc"])
124 appMgr.service(
'Gaudi::RootCnvSvc/RootCnvSvc')
125 eps = appMgr.service(
'EventPersistencySvc')
126 eps.CnvServices += [
'RootCnvSvc']
131 Translate a list of file names in a list of input descriptions. 133 The optional parameters 'collection', 'sel' and 'fun' should be used to 134 configure Event Tag Collection inputs. 136 @param filenames: the list of files 140 if type(filenames)
is str:
141 filenames = [filenames]
144 fileargs = dict([(k, kwargs[k])
for k
in [
"collection",
"sel",
"fun"]
148 svc =
'Gaudi::RootCnvSvc' 150 svc =
'Gaudi::RootEvtSelector' 157 Translate a filename in an output description. 159 @param filenames: the list of files 160 @param lun: Logical Unit for Event Tag Collection outputs (optional) 167 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)