GaudiMP.GMPBase.MiniWriter Class Reference
Inheritance diagram for GaudiMP.GMPBase.MiniWriter:
Collaboration diagram for GaudiMP.GMPBase.MiniWriter:

Public Member Functions

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

Definition at line 90 of file GMPBase.py.

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

Member Function Documentation

def GaudiMP.GMPBase.MiniWriter.__repr__ (   self)

Definition at line 164 of file GMPBase.py.

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

Definition at line 164 of file GMPBase.py.

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

Definition at line 142 of file GMPBase.py.

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

Definition at line 142 of file GMPBase.py.

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

Definition at line 121 of file GMPBase.py.

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

Definition at line 121 of file GMPBase.py.

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

Definition at line 159 of file GMPBase.py.

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

Definition at line 159 of file GMPBase.py.

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

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: