| The Gaudi Framework v30r0 (c919700c)

- 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 (self, replaceThis, withThis, extra='')
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 84 of file GMPBase.py.

## Constructor & Destructor Documentation

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

Definition at line 93 of file GMPBase.py.

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

## Member Function Documentation

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

Definition at line 167 of file GMPBase.py.

167 def __repr__(self):
168 s = ""
169 line = '-' * 80
170 s += (line + '\n')
171 s += "Writer : %s\n" % (self.wName)
172 s += "Writer Type : %s\n" % (self.wType)
173 s += "Writer Output : %s\n" % (self.output)
174 s += "DataSvc : %s\n" % (self.datasvcName)
175 s += "DataSvc Output : %s\n" % (self.svcOutput)
176 s += '\n'
177 s += "Key for config : %s\n" % (self.key)
178 s += "Output File : %s\n" % (self.output)
179 s += "ItemList : %s\n" % (self.ItemList)
180 s += "OptItemList : %s\n" % (self.OptItemList)
181 s += (line + '\n')
182 return s
183
184 # =============================================================================
185
186
GaudiMP.GMPBase.MiniWriter.ItemList
ItemList
Definition: GMPBase.py:101
GaudiMP.GMPBase.MiniWriter.wType
wType
Definition: GMPBase.py:95
GaudiMP.GMPBase.MiniWriter.key
key
Definition: GMPBase.py:99
GaudiMP.GMPBase.MiniWriter.wName
wName
Definition: GMPBase.py:104
GaudiMP.GMPBase.MiniWriter.__repr__
def __repr__(self)
Definition: GMPBase.py:167
GaudiMP.GMPBase.MiniWriter.datasvcName
datasvcName
Definition: GMPBase.py:107
GaudiMP.GMPBase.MiniWriter.OptItemList
OptItemList
Definition: GMPBase.py:102
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:100
GaudiMP.GMPBase.MiniWriter.svcOutput
svcOutput
Definition: GMPBase.py:108

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

Definition at line 145 of file GMPBase.py.

145 def getItemLists(self, config):
146 # the item list
147 if hasattr(self.w, "ItemList"):
148 self.ItemList = self.w.ItemList
149 else:
150 datasvc = config[self.w.EvtDataSvc]
151 if hasattr(datasvc, "ItemList"):
152 self.ItemList = datasvc.ItemList
153 # The option item list; possibly not a valid variable
154 if hasattr(self.w, "OptItemList"):
155 self.OptItemList = self.w.OptItemList
156 else:
157 datasvc = config[self.w.EvtDataSvc]
158 if hasattr(datasvc, "OptItemList"):
159 self.OptItemList = datasvc.OptItemList
160 return
161
GaudiMP.GMPBase.MiniWriter.ItemList
ItemList
Definition: GMPBase.py:101
GaudiMP.GMPBase.MiniWriter.getItemLists
def getItemLists(self, config)
Definition: GMPBase.py:145
GaudiMP.GMPBase.MiniWriter.w
w
Definition: GMPBase.py:94
GaudiMP.GMPBase.MiniWriter.OptItemList
OptItemList
Definition: GMPBase.py:102

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

Definition at line 124 of file GMPBase.py.

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

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

Definition at line 162 of file GMPBase.py.

162 def set(self, key, output):
163 self.key = key
164 self.output = output
165 return
166
GaudiMP.GMPBase.MiniWriter.key
key
Definition: GMPBase.py:99
GaudiMP.GMPBase.MiniWriter.set
def set(self, key, output)
Definition: GMPBase.py:162
GaudiMP.GMPBase.MiniWriter.output
output
Definition: GMPBase.py:100

## Member Data Documentation

GaudiMP.GMPBase.MiniWriter.datasvcName

Definition at line 107 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.ItemList

Definition at line 101 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.key

Definition at line 99 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.OptItemList

Definition at line 102 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.output

Definition at line 100 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.svcOutput

Definition at line 108 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.w

Definition at line 94 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wName

Definition at line 104 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.woutput

Definition at line 106 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wType

Definition at line 95 of file GMPBase.py.

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

- GaudiMP/python/GaudiMP/GMPBase.py