| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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__
def | getNewName
def | getItemLists
def | set
def | __repr__

## 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 82 of file GMPBase.py.

## Constructor & Destructor Documentation

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

Definition at line 90 of file GMPBase.py.

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

## Member Function Documentation

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

Definition at line 164 of file GMPBase.py.

164
165 def __repr__( self ) :
166 s = ""
167 line = '-'*80
168 s += (line+'\n')
169 s += "Writer : %s\n"%( self.wName )
170 s += "Writer Type : %s\n"%( self.wType )
171 s += "Writer Output : %s\n"%( self.output )
172 s += "DataSvc : %s\n"%( self.datasvcName )
173 s += "DataSvc Output : %s\n"%( self.svcOutput )
174 s += '\n'
175 s += "Key for config : %s\n"%( self.key )
176 s += "Output File : %s\n"%( self.output )
177 s += "ItemList : %s\n"%( self.ItemList )
178 s += "OptItemList : %s\n"%( self.OptItemList )
179 s += (line+'\n')
180 return s
181
182 # =============================================================================

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

Definition at line 142 of file GMPBase.py.

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

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

Definition at line 121 of file GMPBase.py.

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

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

Definition at line 159 of file GMPBase.py.

159
160 def set( self, key, output ) :
161 self.key = key
162 self.output = output
163 return

## Member Data Documentation

GaudiMP.GMPBase.MiniWriter.datasvcName

Definition at line 104 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.ItemList

Definition at line 98 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.key

Definition at line 96 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.OptItemList

Definition at line 99 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.output

Definition at line 97 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.svcOutput

Definition at line 105 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.w

Definition at line 91 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wName

Definition at line 101 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.woutput

Definition at line 103 of file GMPBase.py.

GaudiMP.GMPBase.MiniWriter.wType

Definition at line 92 of file GMPBase.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiMP/python/GaudiMP/GMPBase.py