| 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
GaudiMP.GMPBase.MiniWriter Class Reference
Inheritance diagram for GaudiMP.GMPBase.MiniWriter:
[legend]
Collaboration diagram for GaudiMP.GMPBase.MiniWriter:
[legend]

## Public Member Functions
def | __init__ (self, writer, wType, config)
def | getNewName
def | getItemLists (self, config)
def | set (self, key, output)
def | __repr__ (self)

## Public Attributes
| w
| wType
| key
| output
| ItemList
| OptItemList
| wName
| woutput
| datasvcName
| svcOutput

## Detailed Description

    A class to represent a writer in the GaudiPython configuration
    It can be non-trivial to access the name of the output file; it may be
    specified in the DataSvc, or just on the writer, may be a list, or string
    Also, there are three different types of writer (events, records, tuples)
    so this bootstrap class provides easy access to this info while configuring

Definition at line 81 of file GMPBase.py.

## Constructor & Destructor Documentation

def GaudiMP.GMPBase.MiniWriter.__init__ | ( |  | self,
|  |  | writer,
|  |  | wType,
|  |  | config
| ) |  |

Definition at line 89 of file GMPBase.py.

89 def __init__( self, writer, wType, config ) :
90 self.w = writer
91 self.wType = wType
92 # set parameters for directly accessing the correct
93 # part of the configuration, so that later, we can do
94 # config[ key ].Output = modified(output)
95 self.key = None
96 self.output = None
97 self.ItemList = None
98 self.OptItemList = None
99 #
100 self.wName = writer.getName()
101 # Now process the Writer, find where the output is named
102 self.woutput = None
103 self.datasvcName = None
104 self.svcOutput = None
105 if hasattr( self.w, "Output" ) :
106 self.woutput = self.w.Output
107 self.getItemLists( config )
108 self.set( self.wName, self.w.Output )
109 return
110 else :
111 # if there is no output file, get it via the datasvc
112 # (every writer always has a datasvc property)
113 self.datasvcName = self.w.EvtDataSvc
114 datasvc = config[ self.datasvcName ]
115 if hasattr( datasvc, "Output" ) :
116 self.getItemLists( config )
117 self.set( self.datasvcName, datasvc.Output )
118 return
119
GaudiMP.GMPBase.MiniWriter.ItemList
ItemList
Definition: GMPBase.py:97
GaudiMP.GMPBase.MiniWriter.wType
wType
Definition: GMPBase.py:91
GaudiMP.GMPBase.MiniWriter.woutput
woutput
Definition: GMPBase.py:102
GaudiMP.GMPBase.MiniWriter.key
key
Definition: GMPBase.py:95
GaudiMP.GMPBase.MiniWriter.getItemLists
def getItemLists(self, config)
Definition: GMPBase.py:141
GaudiMP.GMPBase.MiniWriter.set
def set(self, key, output)
Definition: GMPBase.py:158
GaudiMP.GMPBase.MiniWriter.wName
wName
Definition: GMPBase.py:100
GaudiMP.GMPBase.MiniWriter.w
w
Definition: GMPBase.py:90
GaudiMP.GMPBase.MiniWriter.__init__
def __init__(self, writer, wType, config)
Definition: GMPBase.py:89
GaudiMP.GMPBase.MiniWriter.datasvcName
datasvcName
Definition: GMPBase.py:103
GaudiMP.GMPBase.MiniWriter.OptItemList
OptItemList
Definition: GMPBase.py:98
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:96
GaudiMP.GMPBase.MiniWriter.svcOutput
svcOutput
Definition: GMPBase.py:104

## Member Function Documentation

def GaudiMP.GMPBase.MiniWriter.__repr__ | ( |  | self | ) |

Definition at line 163 of file GMPBase.py.

163 def __repr__( self ) :
164 s = ""
165 line = '-'*80
166 s += (line+'\n')
167 s += "Writer : %s\n"%( self.wName )
168 s += "Writer Type : %s\n"%( self.wType )
169 s += "Writer Output : %s\n"%( self.output )
170 s += "DataSvc : %s\n"%( self.datasvcName )
171 s += "DataSvc Output : %s\n"%( self.svcOutput )
172 s += '\n'
173 s += "Key for config : %s\n"%( self.key )
174 s += "Output File : %s\n"%( self.output )
175 s += "ItemList : %s\n"%( self.ItemList )
176 s += "OptItemList : %s\n"%( self.OptItemList )
177 s += (line+'\n')
178 return s
179
180 # =============================================================================
181
GaudiMP.GMPBase.MiniWriter.ItemList
ItemList
Definition: GMPBase.py:97
GaudiMP.GMPBase.MiniWriter.wType
wType
Definition: GMPBase.py:91
GaudiMP.GMPBase.MiniWriter.key
key
Definition: GMPBase.py:95
GaudiMP.GMPBase.MiniWriter.wName
wName
Definition: GMPBase.py:100
GaudiMP.GMPBase.MiniWriter.__repr__
def __repr__(self)
Definition: GMPBase.py:163
GaudiMP.GMPBase.MiniWriter.datasvcName
datasvcName
Definition: GMPBase.py:103
GaudiMP.GMPBase.MiniWriter.OptItemList
OptItemList
Definition: GMPBase.py:98
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:96
GaudiMP.GMPBase.MiniWriter.svcOutput
svcOutput
Definition: GMPBase.py:104

def GaudiMP.GMPBase.MiniWriter.getItemLists | ( |  | self,
|  |  | config
| ) |  |

Definition at line 141 of file GMPBase.py.

141 def getItemLists( self, config ) :
142 # the item list
143 if hasattr( self.w, "ItemList" ) :
144 self.ItemList = self.w.ItemList
145 else :
146 datasvc = config[ self.w.EvtDataSvc ]
147 if hasattr( datasvc, "ItemList" ) :
148 self.ItemList = datasvc.ItemList
149 # The option item list; possibly not a valid variable
150 if hasattr( self.w, "OptItemList" ) :
151 self.OptItemList = self.w.OptItemList
152 else :
153 datasvc = config[ self.w.EvtDataSvc ]
154 if hasattr( datasvc, "OptItemList" ) :
155 self.OptItemList = datasvc.OptItemList
156 return
157
GaudiMP.GMPBase.MiniWriter.ItemList
ItemList
Definition: GMPBase.py:97
GaudiMP.GMPBase.MiniWriter.getItemLists
def getItemLists(self, config)
Definition: GMPBase.py:141
GaudiMP.GMPBase.MiniWriter.w
w
Definition: GMPBase.py:90
GaudiMP.GMPBase.MiniWriter.OptItemList
OptItemList
Definition: GMPBase.py:98

def GaudiMP.GMPBase.MiniWriter.getNewName | ( |  | self,
|  |  | replaceThis,
|  |  | withThis,
|  |  | extra = `''`
| ) |  |

Definition at line 120 of file GMPBase.py.

120 def getNewName( self, replaceThis, withThis, extra='' ) :
121 # replace one pattern in the output name string
122 # with another, and return the Output name
123 # It *might* be in a list, so check for this
124 #
125 # @param extra : might need to add ROOT flags
126 # i.e.: OPT='RECREATE', or such
127 assert replaceThis.__class__.__name__ == 'str'
128 assert withThis.__class__.__name__ == 'str'
129 old = self.output
130 lst = False
131 if old.__class__.__name__ == 'list' :
132 old = self.output[0]
133 lst = True
134 new = old.replace( replaceThis, withThis )
135 new += extra
136 if lst :
137 return [ new ]
138 else :
139 return new
140
GaudiMP.GMPBase.MiniWriter.getNewName
def getNewName
Definition: GMPBase.py:120
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:96

def GaudiMP.GMPBase.MiniWriter.set | ( |  | self,
|  |  | key,
|  |  | output
| ) |  |

Definition at line 158 of file GMPBase.py.

158 def set( self, key, output ) :
159 self.key = key
160 self.output = output
161 return
162
GaudiMP.GMPBase.MiniWriter.key
key
Definition: GMPBase.py:95
GaudiMP.GMPBase.MiniWriter.set
def set(self, key, output)
Definition: GMPBase.py:158
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:96

## Member Data Documentation

GaudiMP.GMPBase.MiniWriter.datasvcName

Definition at line 103 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.ItemList

Definition at line 97 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.key

Definition at line 95 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.OptItemList

Definition at line 98 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.output

Definition at line 96 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.svcOutput

Definition at line 104 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.w

Definition at line 90 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wName

Definition at line 100 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.woutput

Definition at line 102 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wType

Definition at line 91 of file GMPBase.py.

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

- GaudiMP/python/GaudiMP/GMPBase.py