| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions | Public Attributes

# GaudiMP::GMPBase::MiniWriter Class Reference

List of all members.

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

## Constructor & Destructor Documentation

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

Definition at line 88 of file GMPBase.py.

    00089                                                 :
    00090         self.w     = writer
    00091         self.wType = wType
    00092         # set parameters for directly accessing the correct
    00093         #   part of the configuration, so that later, we can do
    00094         #   config[ key ].Output = modified(output)
    00095         self.key          = None
    00096         self.output       = None
    00097         self.ItemList     = None
    00098         self.OptItemList  = None
    00099         #
    00100         self.wName = writer.getName()
    00101         # Now process the Writer, find where the output is named
    00102         self.woutput     = None
    00103         self.datasvcName = None
    00104         self.svcOutput   = None
    00105         if hasattr( self.w, "Output" ) :
    00106             self.woutput = self.w.Output
    00107             self.getItemLists( config )
    00108             self.set( self.wName, self.w.Output )
    00109             return
    00110         else :
    00111             # if there is no output file, get it via the datasvc
    00112             # (every writer always has a datasvc property)
    00113             self.datasvcName = self.w.EvtDataSvc
    00114             datasvc = config[ self.datasvcName ]
    00115             if hasattr( datasvc, "Output" ) :
    00116                 self.getItemLists( config )
    00117                 self.set( self.datasvcName, datasvc.Output )
    00118                 return

## Member Function Documentation

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

Definition at line 162 of file GMPBase.py.

    00163                          :
    00164         s  = ""
    00165         line = '-'*80
    00166         s += (line+'\n')
    00167         s += "Writer         : %s\n"%( self.wName  )
    00168         s += "Writer Type    : %s\n"%( self.wType  )
    00169         s += "Writer Output  : %s\n"%( self.output )
    00170         s += "DataSvc        : %s\n"%( self.datasvcName )
    00171         s += "DataSvc Output : %s\n"%( self.svcOutput   )
    00172         s += '\n'
    00173         s += "Key for config : %s\n"%( self.key    )
    00174         s += "Output File    : %s\n"%( self.output )
    00175         s += "ItemList       : %s\n"%( self.ItemList )
    00176         s += "OptItemList    : %s\n"%( self.OptItemList )
    00177         s += (line+'\n')
    00178         return s
    00179
    00180 # =============================================================================

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

Definition at line 140 of file GMPBase.py.

    00141                                      :
    00142         # the item list
    00143         if hasattr( self.w, "ItemList" ) :
    00144             self.ItemList = self.w.ItemList
    00145         else :
    00146             datasvc = config[ self.w.EvtDataSvc ]
    00147             if hasattr( datasvc, "ItemList" ) :
    00148                 self.ItemList = datasvc.ItemList
    00149         # The option item list; possibly not a valid variable
    00150         if hasattr( self.w, "OptItemList" ) :
    00151             self.OptItemList = self.w.OptItemList
    00152         else :
    00153             datasvc = config[ self.w.EvtDataSvc ]
    00154             if hasattr( datasvc, "OptItemList" ) :
    00155                 self.OptItemList = datasvc.OptItemList
    00156         return

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

Definition at line 119 of file GMPBase.py.

    00120                                                             :
    00121         # replace one pattern in the output name string
    00122         #  with another, and return the Output name
    00123         # It *might* be in a list, so check for this
    00124         #
    00125         # @param extra : might need to add ROOT flags
    00126         #                i.e.: OPT='RECREATE', or such
    00127         assert replaceThis.__class__.__name__ == 'str'
    00128         assert    withThis.__class__.__name__ == 'str'
    00129         old = self.output
    00130         lst = False
    00131         if old.__class__.__name__ == 'list' :
    00132             old = self.output[0]
    00133             lst = True
    00134         new = old.replace( replaceThis, withThis )
    00135         new += extra
    00136         if lst :
    00137             return [ new ]
    00138         else :
    00139             return new

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

Definition at line 157 of file GMPBase.py.

    00158                                  :
    00159         self.key         = key
    00160         self.output      = output
    00161         return

## Member Data Documentation

GaudiMP::GMPBase::MiniWriter::datasvcName

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::ItemList

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::key

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::OptItemList

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::output

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::svcOutput

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::w

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::wName

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::woutput

Definition at line 88 of file GMPBase.py.

GaudiMP::GMPBase::MiniWriter::wType

Definition at line 88 of file GMPBase.py.

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines