Public Member Functions | |
def | __init__ |
def | retrieve1D |
def | retrieve2D |
def | retrieve3D |
def | retrieveProfile1D |
def | retrieveProfile2D |
def | retrieve |
def | book |
def | bookProf |
def | __getitem__ |
def | getAsAIDA |
def | getAsROOT |
def | registerObject |
def | unregisterObject |
def | retrieveObject |
def | __setitem__ |
def | __delitem__ |
def | leaves |
def | dump |
def | setRoot |
def | clearStore |
def | retrieveInterface |
def | isValid |
def | getInterface |
def | __call_interface_method__ |
def | __setattr__ |
def | __getattr__ |
def | properties |
def | name |
Static Public Attributes | |
tuple | initialize = lambdaself:self.__call_interface_method__("_isvc","initialize") |
tuple | start = lambdaself:self.__call_interface_method__("_isvc","start") |
tuple | stop = lambdaself:self.__call_interface_method__("_isvc","stop") |
tuple | finalize = lambdaself:self.__call_interface_method__("_isvc","finalize") |
tuple | reinitialize = lambdaself:self.__call_interface_method__("_isvc","reinitialize") |
tuple | restart = lambdaself:self.__call_interface_method__("_isvc","restart") |
Definition at line 355 of file Bindings.py.
def GaudiPython::Bindings::iHistogramSvc::__init__ | ( | self, | ||
name, | ||||
ihs | ||||
) |
Reimplemented from GaudiPython::Bindings::iDataSvc.
Definition at line 356 of file Bindings.py.
00356 : 00357 self.__dict__['_ihs'] = InterfaceCast(gbl.IHistogramSvc)(ihs) 00358 iDataSvc.__init__(self, name, ihs) def retrieve1D(self, path) :
def GaudiPython::Bindings::iHistogramSvc::retrieve1D | ( | self, | ||
path | ||||
) |
Definition at line 359 of file Bindings.py.
00359 : 00360 return Helper.histo1D(self._ihs, path) def retrieve2D(self, path) :
def GaudiPython::Bindings::iHistogramSvc::retrieve2D | ( | self, | ||
path | ||||
) |
Definition at line 361 of file Bindings.py.
00361 : 00362 return Helper.histo2D(self._ihs, path) def retrieve3D(self, path) :
def GaudiPython::Bindings::iHistogramSvc::retrieve3D | ( | self, | ||
path | ||||
) |
Definition at line 363 of file Bindings.py.
00363 : 00364 return Helper.histo3D(self._ihs, path) def retrieveProfile1D(self, path) :
def GaudiPython::Bindings::iHistogramSvc::retrieveProfile1D | ( | self, | ||
path | ||||
) |
Definition at line 365 of file Bindings.py.
00365 : 00366 return Helper.profile1D(self._ihs, path) def retrieveProfile2D(self, path) :
def GaudiPython::Bindings::iHistogramSvc::retrieveProfile2D | ( | self, | ||
path | ||||
) |
def GaudiPython::Bindings::iHistogramSvc::retrieve | ( | self, | ||
path | ||||
) |
Definition at line 369 of file Bindings.py.
00369 : 00370 """ 00371 Retrieve AIDA histogram or AIDA profile histogram by path in Histogram Transient Store 00372 >>> svc = ... 00373 >>> histo = svc.retrieve ( 'path/to/my/histogram' ) 00374 """ 00375 h = self.retrieve1D(path) 00376 if not h : h = self.retrieve2D(path) if not h : h = self.retrieve3D(path)
def GaudiPython::Bindings::iHistogramSvc::book | ( | self, | ||
args | ||||
) |
Book the histograms(1D,2D&3D) , see IHistogramSvc::book >>> svc = ... >>> histo = svc.book( .... )
Definition at line 377 of file Bindings.py.
00377 : h = self.retrieve3D(path) 00378 if not h : h = self.retrieveProfile1D(path) 00379 if not h : h = self.retrieveProfile2D(path) 00380 return h 00381 def book(self, *args) : 00382 """ 00383 Book the histograms(1D,2D&3D) , see IHistogramSvc::book
def GaudiPython::Bindings::iHistogramSvc::bookProf | ( | self, | ||
args | ||||
) |
Book the profile(1D&2D) histograms, see IHistogramSvc::bookProf >>> svc = ... >>> histo = svc.bookProf( .... )
Definition at line 384 of file Bindings.py.
00388 : 00389 """ 00390 Book the profile(1D&2D) histograms, see IHistogramSvc::bookProf >>> svc = ...
def GaudiPython::Bindings::iHistogramSvc::__getitem__ | ( | self, | ||
path | ||||
) |
Retrieve the object from Histogram Transient Store (by path) The reference to AIDA historam is returned (if possible) >>> svc = ... >>> histo = svc['path/to/my/histogram']
Reimplemented from GaudiPython::Bindings::iDataSvc.
Definition at line 391 of file Bindings.py.
00395 : 00396 """ 00397 Retrieve the object from Histogram Transient Store (by path) 00398 The reference to AIDA historam is returned (if possible) 00399 >>> svc = ... 00400 >>> histo = svc['path/to/my/histogram'] """
def GaudiPython::Bindings::iHistogramSvc::getAsAIDA | ( | self, | ||
path | ||||
) |
Retrieve the histogram from Histogram Transient Store (by path) The reference to AIDA historam is returned (if possible) >>> svc = ... >>> histo = svc.getAsAIDA ( 'path/to/my/histogram' )
Definition at line 401 of file Bindings.py.
00403 : return h 00404 return iDataSvc.__getitem__( self , path ) 00405 def getAsAIDA ( self , path ) : 00406 """ 00407 Retrieve the histogram from Histogram Transient Store (by path) 00408 The reference to AIDA historam is returned (if possible)
def GaudiPython::Bindings::iHistogramSvc::getAsROOT | ( | self, | ||
path | ||||
) |
Retrieve the histogram from Histogram Transient Store (by path) The Underlying native ROOT object is returned (if possible) >>> svc = ... >>> histo = svc.getAsROOT ( 'path/to/my/histogram' )
Definition at line 409 of file Bindings.py.
00413 : 00414 """ 00415 Retrieve the histogram from Histogram Transient Store (by path) 00416 The Underlying native ROOT object is returned (if possible) 00417 >>> svc = ... 00418 >>> histo = svc.getAsROOT ( 'path/to/my/histogram' ) 00419 """ fun=gbl.Gaudi.Utils.Aida2ROOT.aida2root
def GaudiPython::Bindings::iDataSvc::registerObject | ( | self, | ||
path, | ||||
obj | ||||
) | [inherited] |
Definition at line 314 of file Bindings.py.
00314 : 00315 if not self._idp : raise AttributeError('C++ service %s does not exist' % self.__dict__['_name']) 00316 return self._idp.registerObject(path,obj) def unregisterObject(self, path) :
def GaudiPython::Bindings::iDataSvc::unregisterObject | ( | self, | ||
path | ||||
) | [inherited] |
Definition at line 317 of file Bindings.py.
00317 : 00318 if not self._idp : raise AttributeError('C++ service %s does not exist' % self.__dict__['_name']) 00319 return self._idp.unregisterObject(path) def retrieveObject(self, path) :
def GaudiPython::Bindings::iDataSvc::retrieveObject | ( | self, | ||
path | ||||
) | [inherited] |
Definition at line 320 of file Bindings.py.
00320 : 00321 if not self._idp : return None 00322 return Helper.dataobject(self._idp, path) def __getitem__(self, path) :
def GaudiPython::Bindings::iDataSvc::__setitem__ | ( | self, | ||
path, | ||||
obj | ||||
) | [inherited] |
Definition at line 326 of file Bindings.py.
00326 : 00327 if not self._idp : raise IndexError('C++ service %s does not exist' % self.__dict__['_name']) 00328 return self._idp.registerObject(path,obj) def __delitem__(self, path) :
def GaudiPython::Bindings::iDataSvc::__delitem__ | ( | self, | ||
path | ||||
) | [inherited] |
Definition at line 329 of file Bindings.py.
00329 : 00330 if not self._idp : raise IndexError('C++ service %s does not exist' % self.__dict__['_name']) 00331 return self._idp.unregisterObject(path) def leaves(self, node=None) :
def GaudiPython::Bindings::iDataSvc::leaves | ( | self, | ||
node = None | ||||
) | [inherited] |
Definition at line 332 of file Bindings.py.
00332 : 00333 if not node : node = self.retrieveObject('') 00334 ll = gbl.std.vector('IRegistry*')() 00335 if type(node) is str : obj = self.retrieveObject(node) 00336 else : obj = node 00337 if self._idm.objectLeaves(node, ll).isSuccess() : return ll def dump(self, node=None) :
def GaudiPython::Bindings::iDataSvc::dump | ( | self, | ||
node = None | ||||
) | [inherited] |
Definition at line 338 of file Bindings.py.
00338 : 00339 if not node : 00340 root = self.retrieveObject('') 00341 if root : node = root.registry() 00342 else : return 00343 print node.identifier() 00344 if node.object() : 00345 for l in self.leaves(node) : self.dump(l) def setRoot(self, name, obj):
def GaudiPython::Bindings::iDataSvc::setRoot | ( | self, | ||
name, | ||||
obj | ||||
) | [inherited] |
Definition at line 346 of file Bindings.py.
00346 : 00347 if not self._idm : raise IndexError('C++ service %s does not exist' % self.__dict__['_name']) 00348 return self._idm.setRoot(name,obj) def clearStore(self):
def GaudiPython::Bindings::iDataSvc::clearStore | ( | self | ) | [inherited] |
Definition at line 349 of file Bindings.py.
00349 : 00350 if not self._idm : raise IndexError('C++ service %s does not exist' % self.__dict__['_name']) 00351 return self._idm.clearStore() 00352 00353 00354 #----iHistogramSvc class--------------------------------------------------------------------- class iHistogramSvc(iDataSvc) :
def GaudiPython::Bindings::iService::retrieveInterface | ( | self | ) | [inherited] |
Reimplemented from GaudiPython::Bindings::iProperty.
Definition at line 251 of file Bindings.py.
00251 : 00252 isvc = Helper.service(self._svcloc,self._name) 00253 if isvc : iService.__init__(self, self._name, isvc) initialize = lambda self : self.__call_interface_method__("_isvc","initialize")
def GaudiPython::Bindings::iService::isValid | ( | self | ) | [inherited] |
Definition at line 260 of file Bindings.py.
00260 : 00261 if self._isvc: return True 00262 else : return False 00263 00264 #----iAlgorithm class--------------------------------------------------------------------- class iAlgorithm(iProperty) :
def GaudiPython::Bindings::iProperty::getInterface | ( | self | ) | [inherited] |
Definition at line 165 of file Bindings.py.
00165 : 00166 if not self._ip : self.retrieveInterface() 00167 return self._ip def retrieveInterface(self) :
def GaudiPython::Bindings::iProperty::__call_interface_method__ | ( | self, | ||
ifname, | ||||
method, | ||||
args | ||||
) | [inherited] |
Definition at line 170 of file Bindings.py.
00170 : 00171 if not getattr(self,ifname) : self.retrieveInterface() 00172 return getattr(getattr(self,ifname),method)(*args) def __setattr__(self, name, value):
def GaudiPython::Bindings::iProperty::__setattr__ | ( | self, | ||
name, | ||||
value | ||||
) | [inherited] |
The method which is used for setting the property from the given value. - In the case of the valid instance it sets the property through IProperty interface - In the case of placeholder the property is added to JobOptionsCatalogue
Definition at line 173 of file Bindings.py.
00173 : 00174 """ 00175 The method which is used for setting the property from the given value. 00176 - In the case of the valid instance it sets the property through IProperty interface 00177 - In the case of placeholder the property is added to JobOptionsCatalogue 00178 """ 00179 if hasattr( value, 'toStringProperty' ): 00180 # user defined behaviour 00181 value = '%s' % value.toStringProperty() 00182 ip = self.getInterface() 00183 if ip : 00184 if not gbl.Gaudi.Utils.hasProperty ( ip , name ) : 00185 raise AttributeError, 'property %s does not exist' % name 00186 prop = ip.getProperty(name) 00187 if not type( value ) == type( prop.value() ) : 00188 if not long == type( value ) : value = '%s' % value 00189 else : value = '%d' % value 00190 if prop.fromString( value ).isFailure() : 00191 raise AttributeError, 'property %s could not be set from %s' % (name,value) 00192 else : 00193 if not prop.setValue( value ) : 00194 raise AttributeError, 'property %s could not be set from %s' % (name,value) 00195 else : 00196 if type(value) == str : value = '"%s"' % value # need double quotes 00197 elif type(value) == long: value = '%d' % value # prevent pending 'L' 00198 sp = StringProperty( name , str(value)) 00199 self._optsvc.addPropertyToCatalogue( self._name , sp ) def __getattr__(self, name ):
def GaudiPython::Bindings::iProperty::__getattr__ | ( | self, | ||
name | ||||
) | [inherited] |
The method which returns the value for the given property - In the case of the valid instance it returns the valid property value through IProperty interface - In the case of placeholder the property value is retrieevd from JobOptionsCatalogue
Definition at line 200 of file Bindings.py.
00200 : 00201 """ 00202 The method which returns the value for the given property 00203 - In the case of the valid instance it returns the valid property value through IProperty interface 00204 - In the case of placeholder the property value is retrieevd from JobOptionsCatalogue 00205 """ 00206 ip = self.getInterface() 00207 if ip : 00208 if not gbl.Gaudi.Utils.hasProperty ( ip , name ) : 00209 raise AttributeError, 'property %s does not exist' % name 00210 prop = ip.getProperty(name) 00211 if StringProperty == type( prop ) : return prop.value() 00212 elif StringPropertyRef == type( prop ) : return prop.value() 00213 try: return eval( prop.toString(), {}, {} ) 00214 except : return p.value() 00215 else : 00216 props = self._optsvc.getProperties(self._name) 00217 for p in props : 00218 if not p.name() == name : continue 00219 # from JobOptionsSvc we always have only strings 00220 try: return eval( p.value(), {}, {} ) 00221 except: return p.value() 00222 raise AttributeError, 'property %s does not exist' % name def properties(self):
def GaudiPython::Bindings::iProperty::properties | ( | self | ) | [inherited] |
Definition at line 223 of file Bindings.py.
00223 : 00224 dct = {} 00225 props = None 00226 ip = self.getInterface() 00227 if ip : 00228 props = ip.getProperties() 00229 propsFrom = self._name # "interface" 00230 else: 00231 props = self._optsvc.getProperties( self._name ) 00232 propsFrom = "jobOptionsSvc" 00233 if props: 00234 for p in props : 00235 try: 00236 dct[p.name()] = PropertyEntry(p) 00237 except (ValueError,TypeError),e: 00238 raise ValueError, "gaudimodule.iProperty.properties(): %s%s processing property %s.%s = %s" % \ 00239 (e.__class__.__name__, e.args, propsFrom, p.name(), p.value()) 00240 return dct def name(self) :
def GaudiPython::Bindings::iProperty::name | ( | self | ) | [inherited] |
Reimplemented in GaudiPython::Bindings::iAlgTool.
Definition at line 241 of file Bindings.py.
00241 : 00242 return self._name 00243 00244 #----iService class--------------------------------------------------------------------- class iService(iProperty) :
tuple GaudiPython::Bindings::iService::initialize = lambdaself:self.__call_interface_method__("_isvc","initialize") [static, inherited] |
Definition at line 254 of file Bindings.py.
tuple GaudiPython::Bindings::iService::start = lambdaself:self.__call_interface_method__("_isvc","start") [static, inherited] |
Definition at line 255 of file Bindings.py.
tuple GaudiPython::Bindings::iService::stop = lambdaself:self.__call_interface_method__("_isvc","stop") [static, inherited] |
Definition at line 256 of file Bindings.py.
tuple GaudiPython::Bindings::iService::finalize = lambdaself:self.__call_interface_method__("_isvc","finalize") [static, inherited] |
Definition at line 257 of file Bindings.py.
tuple GaudiPython::Bindings::iService::reinitialize = lambdaself:self.__call_interface_method__("_isvc","reinitialize") [static, inherited] |
Definition at line 258 of file Bindings.py.
tuple GaudiPython::Bindings::iService::restart = lambdaself:self.__call_interface_method__("_isvc","restart") [static, inherited] |
Definition at line 259 of file Bindings.py.