The Gaudi Framework  v30r3 (a5ef0a68)
GaudiPython.GaudiAlgs Namespace Reference

Classes

class  GaudiAlgo
 
class  HistoAlgo
 
class  objectmethod
 
class  TupleAlgo
 
class  TupleDecColumnDispatcher
 

Functions

def _tool_ (self, interface, typename, name=None, parent=None, create=True)
 
def _service_ (self, interface, name, create=True)
 
def _init_ (self, name, args)
 
def _initialize_ (self)
 
def _initialize_histo_ (self)
 
def _initialize_tuple_ (self)
 
def _evtSvc (self, location=None)
 
def _detSvc (self)
 
def _histoSvc (self, address=None)
 
def _get (self, location)
 
def _getDet (self, location)
 
def _get_ (self, location, rootInTES=True)
 
def _exist_ (self, location, rootInTES=True)
 
def _ntupleSvc (self)
 
def _evtcolSvc (self)
 
def _finalize_ (self)
 
def _success_ (self)
 
def _hasProperty_ (self, pname)
 
def _getProperty_ (self, pname)
 
def _setProperty_ (self, pname, pvalue)
 
def _get_attr_ (self, pname)
 
def _set_attr_ (self, pname, pvalue)
 
def _start_ (self)
 
def _execute_ (self)
 
def _stop_ (self)
 
def _plot1D_ (s, a)
 
def _plot2D_ (s, a)
 
def _plot3D_ (s, a)
 
def _profile1D_ (s, a)
 
def _profile2D_ (s, a)
 
def _decorate_plots_ (klasses)
 
def _nTuple_ (s, a)
 
def _evtCol_ (s, a)
 
def _decorate_tuples_ (klasses)
 
def _t_nTuple_ (s, a)
 
def _t_ntuple_ (s, a)
 
def _t_valid_ (s, a)
 
def _t_write_ (s, a)
 
def _t_column_ (s, a)
 
def _t_column_ll_ (s, a)
 
def _t_column_ull_ (s, a)
 
def _t_array_ (s, a)
 
def _t_matrix_ (s, a)
 
def _t_farray_ (s, a)
 
def _t_fmatrix_ (s, a)
 
def _decorate_algs_ (klasses)
 
def mapvct (func, sequence, ovct=None)
 
def _get_all_tools_ (self, method)
 
def _Tools_a_ (self)
 
def _Tools_t_ (self)
 
def _get_all_counters_ (self, method, name=None)
 
def _Counters_a_ (self, name=None)
 
def _Counters_t_ (self, name=None)
 
def _get_counter_ (self, method, name)
 
def _Counter_a_ (self, name)
 
def _Counter_t_ (self, name)
 
def _get_all_histos_ (component, method, name)
 
def _Histos_a_ (self, name=None)
 
def _Histos_t_ (self, name=None)
 
def _help_ ()
 

Variables

string __author__ = 'Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr'
 
tuple __all__
 
 iAlgorithm = GaudiPython.Bindings.iAlgorithm
 
 iAlgTool = GaudiPython.Bindings.iAlgTool
 
 std = cpp.std
 
 Vector = std.vector('double')
 
 Matrix = std.vector('std::vector<double>')
 
 HID = cpp.GaudiAlg.ID
 
 HistoID = HID
 
 TID = HID
 
 TupleID = TID
 
 AlgDecorator = cpp.GaudiPython.AlgDecorator
 
 HistoDecorator = cpp.GaudiPython.HistoDecorator
 
 TupleAlgDecorator = cpp.GaudiPython.TupleAlgDecorator
 
 TupleDecorator = cpp.GaudiPython.TupleDecorator
 
 _GaudiAlgorithm = cpp.GaudiPython.PyAlg('GaudiAlgorithm')
 
 _GaudiHistoAlg = cpp.GaudiPython.PyAlg('GaudiHistoAlg')
 
 _GaudiTupleAlg = cpp.GaudiPython.PyAlg('GaudiTupleAlg')
 
 Tuple = cpp.Tuples.Tuple
 
 _Dec = TupleDecorator
 
 column
 
 nTuple
 
 ntuple
 
 valid
 
 write
 
 column_ll
 
 column_ull
 
 array
 
 matrix
 
 farray
 
 fmatrix
 
dictionary _alg_map_
 
 Tools
 
 Counters
 
 Counter
 
 Histos
 
 _evtSvc_
 
 _detSvc_
 
 _histoSvc_
 
 _ntupleSvc_
 
 _evtcolSvc_
 

Function Documentation

def GaudiPython.GaudiAlgs._Counter_a_ (   self,
  name 
)
private
Retrieve the counter managed GaudiCommon<TYPE> base by name:

>>> alg  = ...                     ## get the algorithm
>>> cnt  = alg.Counter('#accept')  ## get the counter
>>> print cnt

Definition at line 1474 of file GaudiAlgs.py.

1474 def _Counter_a_(self, name):
1475  """
1476  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1477 
1478  >>> alg = ... ## get the algorithm
1479  >>> cnt = alg.Counter('#accept') ## get the counter
1480  >>> print cnt
1481 
1482  """
1483  _cmp = getattr(self, '_ialg')
1484  if not _cmp:
1485  self.retrieveInterface()
1486  _cmp = getattr(self, '_ialg')
1487  return _get_counter_(_cmp, '_counter_a_', name)
1488 # ==============================================================================
1489 
1490 
def _Counter_a_(self, name)
Definition: GaudiAlgs.py:1474
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1465
def GaudiPython.GaudiAlgs._Counter_t_ (   self,
  name 
)
private
Retrieve the counter managed GaudiCommon<TYPE> base by name:

>>> tool = ...                      ## get the tool
>>> cnt  = tool.Counter('#accept')  ## get the counter
>>> print cnt

Definition at line 1491 of file GaudiAlgs.py.

1491 def _Counter_t_(self, name):
1492  """
1493  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1494 
1495  >>> tool = ... ## get the tool
1496  >>> cnt = tool.Counter('#accept') ## get the counter
1497  >>> print cnt
1498 
1499  """
1500  _cmp = getattr(self, '_itool')
1501  if not _cmp:
1502  self.retrieveInterface()
1503  _cmp = getattr(self, '_itool')
1504  return _get_counter_(_cmp, '_counter_t_', name)
1505 
1506 
1507 # =============================================================================
1508 # get all histos
1509 # =============================================================================
1510 cpp.GaudiAlg.ID .__repr__ = cpp.GaudiAlg.ID.idAsString
1511 cpp.GaudiAlg.ID . __str__ = cpp.GaudiAlg.ID.idAsString
1512 cpp.StatEntity .__repr__ = cpp.StatEntity.toString
1513 cpp.StatEntity . __str__ = cpp.StatEntity.toString
1514 # =============================================================================
1515 
1516 
def _Counter_t_(self, name)
Definition: GaudiAlgs.py:1491
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1465
def GaudiPython.GaudiAlgs._Counters_a_ (   self,
  name = None 
)
private
Retrieve the counters, managed GaudiCommon<TYPE> base:

>>> alg  = ...             ## get the algorithm
>>> cnts = alg.Counters()  ## get the counters
>>> for key in cnts :
...        print key, cnts[key]


Retrieve the counter, managed GaudiCommon<TYPE> base by name:

>>> alg = ...                        ## get the algorithm
>>> cnt = alg.Counters('MyCounter')  ## get the counter
>>> print cnt

Definition at line 1413 of file GaudiAlgs.py.

1413 def _Counters_a_(self, name=None):
1414  """
1415  Retrieve the counters, managed GaudiCommon<TYPE> base:
1416 
1417  >>> alg = ... ## get the algorithm
1418  >>> cnts = alg.Counters() ## get the counters
1419  >>> for key in cnts :
1420  ... print key, cnts[key]
1421 
1422 
1423  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1424 
1425  >>> alg = ... ## get the algorithm
1426  >>> cnt = alg.Counters('MyCounter') ## get the counter
1427  >>> print cnt
1428 
1429  """
1430  _cmp = getattr(self, '_ialg')
1431  if not _cmp:
1432  self.retrieveInterface()
1433  _cmp = getattr(self, '_ialg')
1434  return _get_all_counters_(_cmp, '_counters_a_', name)
1435 # =============================================================================
1436 
1437 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1391
def _Counters_a_(self, name=None)
Definition: GaudiAlgs.py:1413
def GaudiPython.GaudiAlgs._Counters_t_ (   self,
  name = None 
)
private
Retrieve the counters, managed GaudiCommon<TYPE> base:

>>> tool = ...              ## get the tool
>>> cnts = tool.Counters()  ## get the counters
>>> for key in cnts :
...        print key, cnts[key]


Retrieve the counter, managed GaudiCommon<TYPE> base by name:

>>> tool = ...                         ## get the tool
>>> cnt  = tool.Counters('MyCounter')  ## get the counter
>>> print cnt

Definition at line 1438 of file GaudiAlgs.py.

1438 def _Counters_t_(self, name=None):
1439  """
1440  Retrieve the counters, managed GaudiCommon<TYPE> base:
1441 
1442  >>> tool = ... ## get the tool
1443  >>> cnts = tool.Counters() ## get the counters
1444  >>> for key in cnts :
1445  ... print key, cnts[key]
1446 
1447 
1448  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1449 
1450  >>> tool = ... ## get the tool
1451  >>> cnt = tool.Counters('MyCounter') ## get the counter
1452  >>> print cnt
1453 
1454  """
1455  _cmp = getattr(self, '_itool')
1456  if not _cmp:
1457  self.retrieveInterface()
1458  _cmp = getattr(self, '_itool')
1459  return _get_all_counters_(_cmp, '_counters_t_', name)
1460 # =============================================================================
1461 # get the counter
1462 # =============================================================================
1463 
1464 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1391
def _Counters_t_(self, name=None)
Definition: GaudiAlgs.py:1438
def GaudiPython.GaudiAlgs._decorate_algs_ (   klasses)
private

Definition at line 1294 of file GaudiAlgs.py.

1294 def _decorate_algs_(klasses):
1295  t = type(klasses)
1296  if not issubclass(t, list) and \
1297  not issubclass(t, tuple):
1298  klasses = [klasses]
1299  for _alg in klasses:
1300  for key in _alg_map_:
1301  setattr(_alg, key, _alg_map_[key])
1302 
1303 
1304 # =
1305 _decorate_algs_(GaudiAlgo)
1306 _decorate_algs_(HistoAlgo)
1307 _decorate_algs_(TupleAlgo)
1308 
1309 # =============================================================================
1310 # Helper function to fill histogram/ntuple using 'map'-operation
1311 # =============================================================================
1312 
1313 
def _decorate_algs_(klasses)
Definition: GaudiAlgs.py:1294
def GaudiPython.GaudiAlgs._decorate_plots_ (   klasses)
private

Definition at line 1071 of file GaudiAlgs.py.

1071 def _decorate_plots_(klasses):
1072  t = type(klasses)
1073  if not issubclass(t, list) and \
1074  not issubclass(t, tuple):
1075  klasses = [klasses]
1076  for klass in klasses:
1077  klass .plot = _plot1D_
1078  klass .plot1D = _plot1D_
1079  klass .plot2D = _plot2D_
1080  klass .plot3D = _plot3D_
1081  klass .profile1D = _profile1D_
1082  klass .profile2D = _profile2D_
1083 
1084 
1085 _decorate_plots_(HistoAlgo)
1086 _decorate_plots_(TupleAlgo)
1087 
1088 
1089 # =============================================================================
def _decorate_plots_(klasses)
Definition: GaudiAlgs.py:1071
def GaudiPython.GaudiAlgs._decorate_tuples_ (   klasses)
private

Definition at line 1109 of file GaudiAlgs.py.

1109 def _decorate_tuples_(klasses):
1110  t = type(klasses)
1111  if not issubclass(t, list) and \
1112  not issubclass(t, tuple):
1113  klasses = [klasses]
1114  for klass in klasses:
1115  klass . nTuple = _nTuple_
1116  klass . evtCol = _evtCol_
1117  klass . ntupleSvc = _ntupleSvc
1118  klass . tupleSvc = _ntupleSvc
1119  klass . ntupSvc = _ntupleSvc
1120  klass . tupSvc = _ntupleSvc
1121  klass . evtColSvc = _evtcolSvc
1122  klass . evtcolSvc = _evtcolSvc
1123 
1124 
1125 # ==========================================================
1126 _decorate_tuples_(TupleAlgo)
1127 
1128 
1129 # "decorate N-Tuple object
def _decorate_tuples_(klasses)
Definition: GaudiAlgs.py:1109
def GaudiPython.GaudiAlgs._detSvc (   self)
private
Trivial helper function to access Detector Data and Event Data Service

Usage:
# get detector data service
svc = self.detSvc()

# get the data
lhcb = self.detSvc('/dd/Structure/LHCb')

Definition at line 351 of file GaudiAlgs.py.

351 def _detSvc(self):
352  """
353  Trivial helper function to access Detector Data and Event Data Service
354 
355  Usage:
356  # get detector data service
357  svc = self.detSvc()
358 
359  # get the data
360  lhcb = self.detSvc('/dd/Structure/LHCb')
361  """
362  if not location:
363  return self._detSvc_
364  return self._detSvc_[location]
365 
366 # =============================================================================
367 # Trivial helper function to access Histogram Data and Histogram Data Service
368 #
369 # Usage:
370 #
371 # @code
372 #
373 # # get histogram data service
374 # svc = self.histoSvc()
375 #
376 # # get the data
377 # histo = self.histoSvc('/stat/Calo/1')
378 #
379 # @endcode
380 #
381 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
382 # @date 2006-11-26
383 
384 
def GaudiPython.GaudiAlgs._evtCol_ (   s,
  a 
)
private
Retrieve (book-on-demand) N-Tuple object for Event Tag Collections

Definition at line 1098 of file GaudiAlgs.py.

1098 def _evtCol_(s, *a):
1099  """
1100  Retrieve (book-on-demand) N-Tuple object for Event Tag Collections
1101  """
1102  return TupleAlgDecorator.evtCol(s, *a)
1103 
1104 
1105 _nTuple_.__doc__ += '\n' + TupleAlgDecorator.nTuple.__doc__
1106 _evtCol_.__doc__ += '\n' + TupleAlgDecorator.evtCol.__doc__
1107 
1108 
def GaudiPython.GaudiAlgs._evtcolSvc (   self)
private
Trivial function to access Event Collection Service

Definition at line 456 of file GaudiAlgs.py.

456 def _evtcolSvc(self):
457  """
458  Trivial function to access Event Collection Service
459  """
460  return self._evtcolSvc_
461 
462 
463 # =============================================================================
464 # The default finalization (finalization of base C++ class)
def _evtcolSvc(self)
Definition: GaudiAlgs.py:456
def GaudiPython.GaudiAlgs._evtSvc (   self,
  location = None 
)
private
Trivial helper function to access Event Data and Event Data Service

Usage:

# get event data service
svc = self.evtSvc()

# get the data
hits = self.evtSvc('MC/Calo/Hits')

Definition at line 316 of file GaudiAlgs.py.

316 def _evtSvc(self, location=None):
317  """
318  Trivial helper function to access Event Data and Event Data Service
319 
320  Usage:
321 
322  # get event data service
323  svc = self.evtSvc()
324 
325  # get the data
326  hits = self.evtSvc('MC/Calo/Hits')
327  """
328  if not location:
329  return self._evtSvc_
330  return self._evtSvc_[location]
331 
332 # =============================================================================
333 # Trivial helper function to access Detector Data and Detector Data Service
334 #
335 # Usage:
336 #
337 # @code
338 #
339 # # get detector data service
340 # svc = self.detSvc()
341 #
342 # # get the data
343 # lhcb = self.detSvc('/dd/Structure/LHCb')
344 #
345 # @endcode
346 #
347 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
348 # @date 2006-11-26
349 
350 
def _evtSvc(self, location=None)
Definition: GaudiAlgs.py:316
def GaudiPython.GaudiAlgs._execute_ (   self)
private
The fictive 'execute' method, which MUST be overwitten by user

Definition at line 925 of file GaudiAlgs.py.

925 def _execute_(self):
926  """
927  The fictive 'execute' method, which MUST be overwitten by user
928  """
929  raise RuntimeError, 'Execute method is not implemented for %s' % self.name()
930 
931 
932 GaudiAlgo.execute = _execute_
933 HistoAlgo.execute = _execute_
934 TupleAlgo.execute = _execute_
935 
936 
def GaudiPython.GaudiAlgs._exist_ (   self,
  location,
  rootInTES = True 
)
private
Check  the object in Transient Event Store using GaudiCommon machinery,
respecting RootInTES behaviour

Definition at line 435 of file GaudiAlgs.py.

435 def _exist_(self, location, rootInTES=True):
436  """
437  Check the object in Transient Event Store using GaudiCommon machinery,
438  respecting RootInTES behaviour
439  """
440  return AlgDecorator.exist_(self, location, rootInTES)
441 
442 # =============================================================================
443 # Trivial helper function to access NTuple Service
444 
445 
def _exist_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:435
def GaudiPython.GaudiAlgs._finalize_ (   self)
private
The default finalization : finalize the base C++ class

Definition at line 465 of file GaudiAlgs.py.

465 def _finalize_(self):
466  """
467  The default finalization : finalize the base C++ class
468  """
469  status = self._Base.finalize_(self)
470  return status
471 # =============================================================================
472 # Dummy method returning success
473 
474 
def _finalize_(self)
Definition: GaudiAlgs.py:465
def GaudiPython.GaudiAlgs._get (   self,
  location 
)
private
Trivial function to access the data in TES using the data service

Definition at line 405 of file GaudiAlgs.py.

405 def _get(self, location):
406  """
407  Trivial function to access the data in TES using the data service
408  """
409  return self._evtSvc_[location]
410 
411 # =============================================================================
412 # Trivial function to access the data in TDS
413 
414 
def _get(self, location)
Definition: GaudiAlgs.py:405
def GaudiPython.GaudiAlgs._get_ (   self,
  location,
  rootInTES = True 
)
private
Get the object from Transient Event Store using GaudiCommon machinery,
respecting RootInTES behaviour

Definition at line 425 of file GaudiAlgs.py.

425 def _get_(self, location, rootInTES=True):
426  """
427  Get the object from Transient Event Store using GaudiCommon machinery,
428  respecting RootInTES behaviour
429  """
430  return AlgDecorator.get_(self, location, rootInTES)
431 # =============================================================================
432 # check the data from TES using GaudiCommon methods, respecting RootInTES
433 
434 
def _get_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:425
def GaudiPython.GaudiAlgs._get_all_counters_ (   self,
  method,
  name = None 
)
private
get all counters

Definition at line 1391 of file GaudiAlgs.py.

1391 def _get_all_counters_(self, method, name=None):
1392  """
1393  get all counters
1394  """
1395  _cnts = std.vector('const StatEntity*')()
1396  _nams = std.vector('std::string')()
1397  _func = getattr(AlgDecorator, method)
1398  _num = _func(self, _nams, _cnts)
1399  if _nams.size() != _num or _cnts.size() != _num:
1400  raise RuntimeError, 'Unable to extract Counters'
1401  _res = {}
1402  for _i in range(0, _num):
1403  _nam = _nams[_i]
1404  _cnt = _cnts[_i]
1405  _res[_nam] = _cnt
1406  if not name:
1407  return _res
1408  return _res.get(name, None)
1409 # =============================================================================
1410 # get all counters
1411 
1412 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1391
decltype(auto) range(Args &&...args)
Zips multiple containers together to form a single range.
STL class.
def GaudiPython.GaudiAlgs._get_all_histos_ (   component,
  method,
  name 
)
private
Get All histogram form the component

Definition at line 1517 of file GaudiAlgs.py.

1517 def _get_all_histos_(component, method, name):
1518  """
1519  Get All histogram form the component
1520  """
1521  _res = {}
1522  for _his in (std.vector('AIDA::IProfile2D*'),
1523  std.vector('AIDA::IProfile1D*'),
1524  std.vector('AIDA::IHistogram3D*'),
1525  std.vector('AIDA::IHistogram2D*'),
1526  std.vector('AIDA::IHistogram1D*')):
1527  _his = _his()
1528  _ids = std.vector('GaudiAlg::ID')()
1529  _fun = getattr(HistoDecorator, method)
1530  _num = _fun(component, _ids, _his)
1531  if _ids.size() != _num or _his.size() != _num:
1532  raise RuntimeError, 'Unable to extract Histos!'
1533  for _i in range(0, _num):
1534  _id = _ids[_i]
1535  if _id.numeric():
1536  _id = _id.numericID()
1537  elif _id.literal():
1538  _id = _id.literalID()
1539  else:
1540  _id = _is.idAsString()
1541  _res[_id] = _his[_i]
1542 
1543  if not name:
1544  return _res # return the dictionary
1545 
1546  id = cpp.GaudiAlg.ID(name)
1547  for i in (name,
1548  id.literalID(),
1549  id.numericID(),
1550  id.idAsString(), id):
1551  h = _res.get(i, None)
1552  if not not h:
1553  return h # return the histogram
1554 
1555  return None
1556 # =============================================================================
1557 
1558 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1517
decltype(auto) range(Args &&...args)
Zips multiple containers together to form a single range.
STL class.
def GaudiPython.GaudiAlgs._get_all_tools_ (   self,
  method 
)
private
Get all tools

Definition at line 1334 of file GaudiAlgs.py.

1334 def _get_all_tools_(self, method):
1335  """
1336  Get all tools
1337  """
1338  _tools = std.vector('IAlgTool*')()
1339  _func = getattr(AlgDecorator, method)
1340  _num = _func(self, _tools)
1341  if _tools.size() != _num:
1342  raise RuntimeError, 'Unable to extract Tools'
1343  _res = []
1344  for _tool in _tools:
1345  _res += [iAlgTool(_tool.name(), _tool)]
1346  return _res
1347 # =============================================================================
1348 
1349 
STL class.
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1334
def GaudiPython.GaudiAlgs._get_attr_ (   self,
  pname 
)
private
Get the attribute (or property)
- if the attribute name corresponds to the property name, property value is returned

Definition at line 514 of file GaudiAlgs.py.

514 def _get_attr_(self, pname):
515  """
516  Get the attribute (or property)
517  - if the attribute name corresponds to the property name, property value is returned
518  """
519  if self.hasProperty(pname):
520  return iAlgorithm.__getattr__(self, pname)
521  raise AttributeError, 'attribute/property %s does not exist' % pname
522 
523 # =============================================================================
524 # set the attribute or property
525 
526 
def _get_attr_(self, pname)
Definition: GaudiAlgs.py:514
def GaudiPython.GaudiAlgs._get_counter_ (   self,
  method,
  name 
)
private
get the counter

Definition at line 1465 of file GaudiAlgs.py.

1465 def _get_counter_(self, method, name):
1466  """
1467  get the counter
1468  """
1469  _func = getattr(AlgDecorator, method)
1470  return _func(self, name)
1471 # ==============================================================================
1472 
1473 
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1465
def GaudiPython.GaudiAlgs._getDet (   self,
  location 
)
private
Trivial function to access the data in TDS using data service

Definition at line 415 of file GaudiAlgs.py.

415 def _getDet(self, location):
416  """
417  Trivial function to access the data in TDS using data service
418  """
419  return self._detSvc_[location]
420 
421 # =============================================================================
422 # get the data from TES using GaudiCommon methods, respecting RootInTES
423 
424 
def _getDet(self, location)
Definition: GaudiAlgs.py:415
def GaudiPython.GaudiAlgs._getProperty_ (   self,
  pname 
)
private
Get the property by name

Definition at line 490 of file GaudiAlgs.py.

490 def _getProperty_(self, pname):
491  """
492  Get the property by name
493  """
494  if not self.hasProperty(pname):
495  raise AttributeError, 'property %s does not exist' % pname
496  return iAlgorithm.__getattr__(self, pname)
497 
498 # =============================================================================
499 # set the value for the given property
500 
501 
def _getProperty_(self, pname)
Definition: GaudiAlgs.py:490
def GaudiPython.GaudiAlgs._hasProperty_ (   self,
  pname 
)
private
The trivial function which checks the existence of the property with given name

Definition at line 480 of file GaudiAlgs.py.

480 def _hasProperty_(self, pname):
481  """
482  The trivial function which checks the existence of the property with given name
483  """
484  return cpp.Gaudi.Utils.hasProperty(self, pname)
485 
486 # =============================================================================
487 # get the value of the given property
488 
489 
def _hasProperty_(self, pname)
Definition: GaudiAlgs.py:480
def GaudiPython.GaudiAlgs._help_ ( )
private

Definition at line 1633 of file GaudiAlgs.py.

1633 def _help_():
1634  print __doc__, __author__
1635  print '\t\t\tDoc-string for class GaudiAlgo \n', GaudiAlgo.__doc__
1636  print '\t\t\tDoc-string for class HistoAlgo \n', HistoAlgo.__doc__
1637  print '\t\t\tDoc-string for class TupleAlgo \n', TupleAlgo.__doc__
1638 
1639 
1640 # =============================================================================
1641 # pseudo-test suite
1642 # =============================================================================
def GaudiPython.GaudiAlgs._Histos_a_ (   self,
  name = None 
)
private
Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:

>>> alg = ...              ## get the algorithm
>>> histos = alg.Histos()  ## get all histograms & profiles
>>> for key in histos :
...        print key, histos[key]

Retrive the histogram with the certain ID :

>>> alg = ...                           ## get the algorithm
>>> histo = alg.Histos('some histo ID') ## get the histo by ID
>>> print histo

Definition at line 1559 of file GaudiAlgs.py.

1559 def _Histos_a_(self, name=None):
1560  """
1561  Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:
1562 
1563  >>> alg = ... ## get the algorithm
1564  >>> histos = alg.Histos() ## get all histograms & profiles
1565  >>> for key in histos :
1566  ... print key, histos[key]
1567 
1568  Retrive the histogram with the certain ID :
1569 
1570  >>> alg = ... ## get the algorithm
1571  >>> histo = alg.Histos('some histo ID') ## get the histo by ID
1572  >>> print histo
1573 
1574  """
1575  _cmp = getattr(self, '_ialg')
1576  if not _cmp:
1577  self.retrieveInterface()
1578  _cmp = getattr(self, '_ialg')
1579  return _get_all_histos_(_cmp, '_histos_a_', name)
1580 # =============================================================================
1581 
1582 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1517
def _Histos_a_(self, name=None)
Definition: GaudiAlgs.py:1559
def GaudiPython.GaudiAlgs._Histos_t_ (   self,
  name = None 
)
private
Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:

>>> tool = ...              ## get the tool
>>> histos = tool.Histos()  ## get all histograms & profiles
>>> for key in histos :
...        print key, histos[key]

Retrive the historgam with certain ID :

>>> tool = ...                           ## get the tool
>>> histo = tool.Histos('some histo ID') ## get the histo by ID
>>> print histo

Definition at line 1583 of file GaudiAlgs.py.

1583 def _Histos_t_(self, name=None):
1584  """
1585  Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:
1586 
1587  >>> tool = ... ## get the tool
1588  >>> histos = tool.Histos() ## get all histograms & profiles
1589  >>> for key in histos :
1590  ... print key, histos[key]
1591 
1592  Retrive the historgam with certain ID :
1593 
1594  >>> tool = ... ## get the tool
1595  >>> histo = tool.Histos('some histo ID') ## get the histo by ID
1596  >>> print histo
1597 
1598  """
1599  _cmp = getattr(self, '_itool')
1600  if not _cmp:
1601  self.retrieveInterface()
1602  _cmp = getattr(self, '_itool')
1603  return _get_all_histos_(_cmp, '_histos_t_', name)
1604 # =============================================================================
1605 
1606 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1517
def _Histos_t_(self, name=None)
Definition: GaudiAlgs.py:1583
def GaudiPython.GaudiAlgs._histoSvc (   self,
  address = None 
)
private
Trivial helper function to access Histogram  Data and Histogram  Data Service

Usage:

# get histogram data service
svc = self.histoSvc()

# get the data
histo = self.histoSvc('/stat/Calo/1')

Definition at line 385 of file GaudiAlgs.py.

385 def _histoSvc(self, address=None):
386  """
387  Trivial helper function to access Histogram Data and Histogram Data Service
388 
389  Usage:
390 
391  # get histogram data service
392  svc = self.histoSvc()
393 
394  # get the data
395  histo = self.histoSvc('/stat/Calo/1')
396  """
397  if not address:
398  return self._histoSvc_
399  return self._histoSvc_[address]
400 
401 # =============================================================================
402 # Trivial function to access the data in TES
403 
404 
def _histoSvc(self, address=None)
Definition: GaudiAlgs.py:385
def GaudiPython.GaudiAlgs._init_ (   self,
  name,
  args 
)
private
The constructor from unique algorithm instance name & parameters

Definition at line 203 of file GaudiAlgs.py.

203 def _init_(self, name, **args):
204  """
205  The constructor from unique algorithm instance name & parameters
206  """
207  self._Base.__init__(self, self, name)
208  appMgr = AppMgr()
209  algMgr = appMgr._algmgr
210  status = algMgr.addAlgorithm(self)
211  if status.isFailure():
212  raise RuntimeError, 'Unable to add Algorithm "' + name + '"'
213  iAlgorithm.__init__(self, name, self)
214  for key in args:
215  setattr(self, key, args[key])
216  # take some care about the ownership of the algorithms
217  if not appMgr.__dict__.has_key('GaudiPythonAlgos'):
218  appMgr.__dict__['GaudiPythonAlgos'] = []
219  appMgr.__dict__['GaudiPythonAlgos'].append(self)
220 
221 # =============================================================================
222 # The default initialization (initialization of base C++ class + data
223 #
224 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
225 # @date 2006-11-26
226 
227 
def _init_(self, name, args)
Definition: GaudiAlgs.py:203
def GaudiPython.GaudiAlgs._initialize_ (   self)
private
The default initialization (initialization of base C++ class + data)

Definition at line 228 of file GaudiAlgs.py.

228 def _initialize_(self):
229  """
230  The default initialization (initialization of base C++ class + data)
231  """
232  status = self._Base.initialize_(self)
233  if status.isFailure():
234  return status
235 
236  # set the basic services
237  _e = self._Base.evtSvc(self)
238  _s = InterfaceCast(cpp.IService)(_e)
239  self._evtSvc_ = iDataSvc(_s.name(), _e)
240 
241  _d = self._Base.detSvc(self)
242  _s = InterfaceCast(cpp.IService)(_d)
243  self._detSvc_ = iDataSvc(_s.name(), _d)
244 
245  return status
246 
247 # =============================================================================
248 # The default initialization (initialization of base C++ class + data members)
249 #
250 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
251 # @date 2006-11-26
252 
253 
def _initialize_(self)
Definition: GaudiAlgs.py:228
def GaudiPython.GaudiAlgs._initialize_histo_ (   self)
private
The default initialization (initialization of base C++ class + data members)

Definition at line 254 of file GaudiAlgs.py.

255  """
256  The default initialization (initialization of base C++ class + data members)
257  """
258  status = _initialize_(self)
259  if status.isFailure():
260  return status
261 
262  # set the basic services
263  _h = self._Base.histoSvc(self)
264  _s = InterfaceCast(cpp.IService)(_h)
265  self._histoSvc_ = iHistogramSvc(_s.name(), _h)
266 
267  return status
268 
269 # =============================================================================
270 # The default initialization (initialization of base C++ class + data members)
271 #
272 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
273 # @date 2006-11-26
274 
275 
def _initialize_(self)
Definition: GaudiAlgs.py:228
def _initialize_histo_(self)
Definition: GaudiAlgs.py:254
def GaudiPython.GaudiAlgs._initialize_tuple_ (   self)
private
The default initialization (initialization of base C++ class + data members)

Definition at line 276 of file GaudiAlgs.py.

277  """
278  The default initialization (initialization of base C++ class + data members)
279  """
280  status = _initialize_histo_(self)
281  if status.isFailure():
282  return status
283 
284  # set the basic services
285  if self.produceNTuples():
286  _n = self._Base.ntupleSvc(self)
287  _s = InterfaceCast(cpp.IService)(_n)
288  self._ntupleSvc_ = iNTupleSvc(_s.name(), _n)
289 
290  if self.produceEvtCols():
291  _n = self._Base.evtColSvc(self)
292  _s = InterfaceCast(cpp.IService)(_n)
293  self._evtcolSvc_ = iNTupleSvc(_s.name(), _n)
294 
295  return status
296 
297 # =============================================================================
298 # Trivial helper function to access Event Data and Event Data Service
299 #
300 # Usage:
301 #
302 # @code
303 #
304 # # get event data service
305 # svc = self.evtSvc()
306 #
307 # # get the data
308 # hits = self.evtSvc('MC/Calo/Hits')
309 #
310 # @endcode
311 #
312 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
313 # @date 2006-11-26
314 
315 
def _initialize_tuple_(self)
Definition: GaudiAlgs.py:276
def _initialize_histo_(self)
Definition: GaudiAlgs.py:254
def GaudiPython.GaudiAlgs._nTuple_ (   s,
  a 
)
private
Retrieve (book-on-demand) N-Tuple object

Definition at line 1090 of file GaudiAlgs.py.

1090 def _nTuple_(s, *a):
1091  """
1092  Retrieve (book-on-demand) N-Tuple object
1093  """
1094  return TupleAlgDecorator.nTuple(s, *a)
1095 # =============================================================================
1096 
1097 
def GaudiPython.GaudiAlgs._ntupleSvc (   self)
private
Trivial function to access N-Tuple Service

Definition at line 446 of file GaudiAlgs.py.

446 def _ntupleSvc(self):
447  """
448  Trivial function to access N-Tuple Service
449  """
450  return self._ntupleSvc_
451 
452 # =============================================================================
453 # Trivial helper function to access Event Collection Service
454 
455 
def _ntupleSvc(self)
Definition: GaudiAlgs.py:446
def GaudiPython.GaudiAlgs._plot1D_ (   s,
  a 
)
private
The basic method to fill (book-on-demand) 1D-histogram

The histogram will be created/booked dautomatically according to the
specifications:

   - literal or numerical ID (optional)
   - title
   - low edge
   - high edge
   - number of bins (default is 100)

The reference to the histogram is returned and could be used for later manipulations

Definition at line 952 of file GaudiAlgs.py.

952 def _plot1D_(s, *a):
953  """
954  The basic method to fill (book-on-demand) 1D-histogram
955 
956  The histogram will be created/booked dautomatically according to the
957  specifications:
958 
959  - literal or numerical ID (optional)
960  - title
961  - low edge
962  - high edge
963  - number of bins (default is 100)
964 
965  The reference to the histogram is returned and could be used for later manipulations
966 
967  """
968  return HistoDecorator.plot1D(s, *a)
969 # =============================================================================
970 
971 
def GaudiPython.GaudiAlgs._plot2D_ (   s,
  a 
)
private
The basic method to fill (book-on-demand) 2D-histogram

The histogram will be created/booked dautomatically according to the
specifications:

   - literal or numerical ID (optional)
   - title
   - low X-edge
   - high X-edge
   - low Y-edge
   - high Y-edge
   - number of X-bins (default is 50)
   - number of Y-bins (default is 50)

The reference to the histogram is returned and could be used for later manipulations

Definition at line 972 of file GaudiAlgs.py.

972 def _plot2D_(s, *a):
973  """
974  The basic method to fill (book-on-demand) 2D-histogram
975 
976  The histogram will be created/booked dautomatically according to the
977  specifications:
978 
979  - literal or numerical ID (optional)
980  - title
981  - low X-edge
982  - high X-edge
983  - low Y-edge
984  - high Y-edge
985  - number of X-bins (default is 50)
986  - number of Y-bins (default is 50)
987 
988  The reference to the histogram is returned and could be used for later manipulations
989 
990  """
991  return HistoDecorator.plot2D(s, *a)
992 # =============================================================================
993 
994 
def GaudiPython.GaudiAlgs._plot3D_ (   s,
  a 
)
private
The basic method to fill (book-on-demand) 3D-histogram

The histogram will be created/booked dautomatically according to the
specifications:

   - literal or numerical ID (optional)
   - title
   - low X-edge
   - high X-edge
   - low Y-edge
   - high Y-edge
   - low Z-edge
   - high Z-edge
   - number of X-bins (default is 10)
   - number of Y-bins (default is 10)
   - number of Y-bins (default is 10)

The reference to the histogram is returned and could be used for later manipulations

Definition at line 995 of file GaudiAlgs.py.

995 def _plot3D_(s, *a):
996  """
997  The basic method to fill (book-on-demand) 3D-histogram
998 
999  The histogram will be created/booked dautomatically according to the
1000  specifications:
1001 
1002  - literal or numerical ID (optional)
1003  - title
1004  - low X-edge
1005  - high X-edge
1006  - low Y-edge
1007  - high Y-edge
1008  - low Z-edge
1009  - high Z-edge
1010  - number of X-bins (default is 10)
1011  - number of Y-bins (default is 10)
1012  - number of Y-bins (default is 10)
1013 
1014  The reference to the histogram is returned and could be used for later manipulations
1015 
1016  """
1017  return HistoDecorator.plot3D(s, *a)
1018 # =============================================================================
1019 
1020 
def GaudiPython.GaudiAlgs._profile1D_ (   s,
  a 
)
private
The basic method to fill (book-on-demand) 1D profile histogram

The profile histogram will be created/booked dautomatically
according to the specifications:

   - literal or numerical ID (optional)
   - title
   - low X-edge
   - high X-edge
   - number of X-bins (default is 100)

The reference to the histogram is returned and could be used for later manipulations

Definition at line 1021 of file GaudiAlgs.py.

1021 def _profile1D_(s, *a):
1022  """
1023  The basic method to fill (book-on-demand) 1D profile histogram
1024 
1025  The profile histogram will be created/booked dautomatically
1026  according to the specifications:
1027 
1028  - literal or numerical ID (optional)
1029  - title
1030  - low X-edge
1031  - high X-edge
1032  - number of X-bins (default is 100)
1033 
1034  The reference to the histogram is returned and could be used for later manipulations
1035 
1036  """
1037  return HistoDecorator.profile1D(s, *a)
1038 # =============================================================================
1039 
1040 
def GaudiPython.GaudiAlgs._profile2D_ (   s,
  a 
)
private
The basic method to fill (book-on-demand) 2D profile histiogram

The profile histogram will be created/booked automatically
according to the specifications:

   - literal or numerical ID (optional)
   - title
   - low X-edge
   - high X-edge
   - low Y-edge
   - high Y-edge
   - number of X-bins (default is 50)
   - number of Y-bins (default is 50)

The reference to the histogram is returned and could be used for later manipulations

Definition at line 1041 of file GaudiAlgs.py.

1041 def _profile2D_(s, *a):
1042  """
1043  The basic method to fill (book-on-demand) 2D profile histiogram
1044 
1045  The profile histogram will be created/booked automatically
1046  according to the specifications:
1047 
1048  - literal or numerical ID (optional)
1049  - title
1050  - low X-edge
1051  - high X-edge
1052  - low Y-edge
1053  - high Y-edge
1054  - number of X-bins (default is 50)
1055  - number of Y-bins (default is 50)
1056 
1057  The reference to the histogram is returned and could be used for later manipulations
1058 
1059  """
1060  return HistoDecorator.profile2D(s, *a)
1061 # =============================================================================
1062 
1063 
def GaudiPython.GaudiAlgs._service_ (   self,
  interface,
  name,
  create = True 
)
private
Useful method to locate a service:

Usage:

ntsvc = self.svc( INTupleSvc , 'NTUpleSvc' )

Definition at line 176 of file GaudiAlgs.py.

176  create=True):
177  """
178  Useful method to locate a service:
179 
180  Usage:
181 
182  ntsvc = self.svc( INTupleSvc , 'NTUpleSvc' )
183 
184  """
185  if not interface:
186  interface = cpp.IInterface
187  _svc = AlgDecorator.svc_(self, name, create)
188  if not _svc:
189  return None
190  _svc = InterfaceCast(interface)(_svc)
191  if not _svc:
192  self.Warning('Invalid cast to interface %s' % interface)
193  return None
194  return _svc
195 
196 # =============================================================================
197 # The constructor from unique algorithm instance name,
198 #
199 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
200 # @date 2006-11-26
201 
202 
def GaudiPython.GaudiAlgs._set_attr_ (   self,
  pname,
  pvalue 
)
private
Set the attribute (or property) :
- if the attribute name corresponds to the property name, the property is updated

Definition at line 527 of file GaudiAlgs.py.

527 def _set_attr_(self, pname, pvalue):
528  """
529  Set the attribute (or property) :
530  - if the attribute name corresponds to the property name, the property is updated
531  """
532  if not self.hasProperty(pname):
533  self.__dict__[pname] = pvalue
534  else:
535  iAlgorithm.__setattr__(self, pname, pvalue)
536 
537 
def _set_attr_(self, pname, pvalue)
Definition: GaudiAlgs.py:527
def GaudiPython.GaudiAlgs._setProperty_ (   self,
  pname,
  pvalue 
)
private
Set the property from the value

Definition at line 502 of file GaudiAlgs.py.

502 def _setProperty_(self, pname, pvalue):
503  """
504  Set the property from the value
505  """
506  if not self.hasProperty(pname):
507  raise AttributeError, 'property %s does not exist' % pname
508  return iAlgorithm.__setattr__(self, pname, pvalue)
509 
510 # =============================================================================
511 # get the attribute or property
512 
513 
def _setProperty_(self, pname, pvalue)
Definition: GaudiAlgs.py:502
def GaudiPython.GaudiAlgs._start_ (   self)
private
The stub 'start' method needed by the internal implementation of PyAlg<>.

Definition at line 912 of file GaudiAlgs.py.

912 def _start_(self):
913  """
914  The stub 'start' method needed by the internal implementation of PyAlg<>.
915  """
916  # return self._Base.start_(self)
917  return SUCCESS
918 
919 
920 GaudiAlgo.start = _start_
921 HistoAlgo.start = _start_
922 TupleAlgo.start = _start_
923 
924 
def GaudiPython.GaudiAlgs._stop_ (   self)
private
The stub 'stop' method needed by the internal implementation of PyAlg<>.

Definition at line 937 of file GaudiAlgs.py.

937 def _stop_(self):
938  """
939  The stub 'stop' method needed by the internal implementation of PyAlg<>.
940  """
941  # return self._Base.stop_(self)
942  return SUCCESS
943 
944 
945 GaudiAlgo.stop = _stop_
946 HistoAlgo.stop = _stop_
947 TupleAlgo.stop = _stop_
948 
949 # =============================================================================
950 
951 
def GaudiPython.GaudiAlgs._success_ (   self)
private

Definition at line 475 of file GaudiAlgs.py.

475 def _success_(self): return SUCCESS
476 
477 
478 # =============================================================================
479 # check the existence of the property with the given name
def GaudiPython.GaudiAlgs._t_array_ (   s,
  a 
)
private
Fill the fixed-size array column

Definition at line 1216 of file GaudiAlgs.py.

1216 def _t_array_(s, *a):
1217  """
1218  Fill the fixed-size array column
1219  """
1220  return _Dec.array(s, *a)
1221 
1222 
def GaudiPython.GaudiAlgs._t_column_ (   s,
  a 
)
private
Fill the certain column to n-tuple

Definition at line 1195 of file GaudiAlgs.py.

1195 def _t_column_(s, *a):
1196  """
1197  Fill the certain column to n-tuple
1198  """
1199  return _Dec.column(s, *a)
1200 
1201 
def GaudiPython.GaudiAlgs._t_column_ll_ (   s,
  a 
)
private
Fill the 'long long' column

Definition at line 1202 of file GaudiAlgs.py.

1202 def _t_column_ll_(s, *a):
1203  """
1204  Fill the 'long long' column
1205  """
1206  return _Dec.column_ll(s, *a)
1207 
1208 
def _t_column_ll_(s, a)
Definition: GaudiAlgs.py:1202
def GaudiPython.GaudiAlgs._t_column_ull_ (   s,
  a 
)
private
Fill the 'unsigned long long' column

Definition at line 1209 of file GaudiAlgs.py.

1209 def _t_column_ull_(s, *a):
1210  """
1211  Fill the 'unsigned long long' column
1212  """
1213  return _Dec.column_ull(s, *a)
1214 
1215 
def _t_column_ull_(s, a)
Definition: GaudiAlgs.py:1209
def GaudiPython.GaudiAlgs._t_farray_ (   s,
  a 
)
private
Fill the floating-size array column

Definition at line 1230 of file GaudiAlgs.py.

1230 def _t_farray_(s, *a):
1231  """
1232  Fill the floating-size array column
1233  """
1234  return _Dec.farray(s, *a)
1235 
1236 
def GaudiPython.GaudiAlgs._t_fmatrix_ (   s,
  a 
)
private
Fill the floating-size matrix column

Definition at line 1237 of file GaudiAlgs.py.

1237 def _t_fmatrix_(s, *a):
1238  """
1239  Fill the floating-size matrix column
1240  """
1241  return _Dec.fmatrix(s, *a)
1242 
1243 
def GaudiPython.GaudiAlgs._t_matrix_ (   s,
  a 
)
private
Fill the fixed-size matrix column

Definition at line 1223 of file GaudiAlgs.py.

1223 def _t_matrix_(s, *a):
1224  """
1225  Fill the fixed-size matrix column
1226  """
1227  return _Dec.matrix(s, *a)
1228 
1229 
def GaudiPython.GaudiAlgs._t_nTuple_ (   s,
  a 
)
private
Access to underlying INTuple object

Definition at line 1167 of file GaudiAlgs.py.

1167 def _t_nTuple_(s, *a):
1168  """
1169  Access to underlying INTuple object
1170  """
1171  return _Dec.nTuple(s, *a)
1172 
1173 
def GaudiPython.GaudiAlgs._t_ntuple_ (   s,
  a 
)
private
Access to underlying NTuple::Tuple object

Definition at line 1174 of file GaudiAlgs.py.

1174 def _t_ntuple_(s, *a):
1175  """
1176  Access to underlying NTuple::Tuple object
1177  """
1178  return _Dec.ntuple(s, *a)
1179 
1180 
def GaudiPython.GaudiAlgs._t_valid_ (   s,
  a 
)
private
Valid NTuple::Tuple object?

Definition at line 1181 of file GaudiAlgs.py.

1181 def _t_valid_(s, *a):
1182  """
1183  Valid NTuple::Tuple object?
1184  """
1185  return _Dec.valid(s, *a)
1186 
1187 
def GaudiPython.GaudiAlgs._t_write_ (   s,
  a 
)
private
Commit the row/record to n-tuple

Definition at line 1188 of file GaudiAlgs.py.

1188 def _t_write_(s, *a):
1189  """
1190  Commit the row/record to n-tuple
1191  """
1192  return _Dec.write(s, *a)
1193 
1194 
def GaudiPython.GaudiAlgs._tool_ (   self,
  interface,
  typename,
  name = None,
  parent = None,
  create = True 
)
private
Useful method to locate the tool a certain

Usage:

# locate public tool
t1 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator')
# locate private tool
t2 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator',parent=self)
# locate public tool with defined name
t3 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator/MyExt1')
# locate private tool with defined name
t4 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator/MyExt2',parent=self)
# locate public tool with defined name
t5 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator','MyExt3')
# locate private tool with defined name
t6 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator','MyExt4',parent=self)

Definition at line 123 of file GaudiAlgs.py.

123  create=True):
124  """
125  Useful method to locate the tool a certain
126 
127  Usage:
128 
129  # locate public tool
130  t1 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator')
131  # locate private tool
132  t2 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator',parent=self)
133  # locate public tool with defined name
134  t3 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator/MyExt1')
135  # locate private tool with defined name
136  t4 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator/MyExt2',parent=self)
137  # locate public tool with defined name
138  t5 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator','MyExt3')
139  # locate private tool with defined name
140  t6 = self.tool(ITrExtrapolator,'TrParabolicExtrapolator','MyExt4',parent=self)
141 
142  """
143  if not interface:
144  interface = cpp.IAlgTool
145  if not parent:
146  parent = self
147  if name:
148  typename += '/' + name
149  _tool = AlgDecorator.tool_(self, typename, parent, create)
150  if not _tool:
151  return None
152  _tool = InterfaceCast(interface)(_tool)
153  if not _tool:
154  self.Warning('Invalid cast to interface %s' % interface)
155  return None
156  return _tool
157 
158 # =============================================================================
159 # Useful method to locate a service:
160 #
161 # Usage:
162 #
163 # @code
164 #
165 # ntsvc = self.svc( INTupleSvc , 'NTUpleSvc' )
166 #
167 # @endcode
168 #
169 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
170 # @date 2006-11-26
171 
172 
def GaudiPython.GaudiAlgs._Tools_a_ (   self)
private
Retrieve the list of tools,
    aquired by component through GaudiCommon<TYPE> base:

>>> alg   = ...             ## get the algorithm
>>> tools = alg.Tools()     ## get the tools
>>> for tool in tools :
...        print tool

Definition at line 1350 of file GaudiAlgs.py.

1350 def _Tools_a_(self):
1351  """
1352  Retrieve the list of tools,
1353  aquired by component through GaudiCommon<TYPE> base:
1354 
1355  >>> alg = ... ## get the algorithm
1356  >>> tools = alg.Tools() ## get the tools
1357  >>> for tool in tools :
1358  ... print tool
1359 
1360  """
1361  _cmp = getattr(self, '_ialg')
1362  if not _cmp:
1363  self.retrieveInterface()
1364  _cmp = getattr(self, '_ialg')
1365  return _get_all_tools_(_cmp, '_tools_a_')
1366 # =============================================================================
1367 
1368 
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1334
def GaudiPython.GaudiAlgs._Tools_t_ (   self)
private
Retrieve the list of tools,
    aquired by component through GaudiCommon<TYPE> base:

>>> tool  = ...              ## get the tool
>>> tools = tool.Tools()     ## get the tools
>>> for t in tools :
...        print t

Definition at line 1369 of file GaudiAlgs.py.

1369 def _Tools_t_(self):
1370  """
1371  Retrieve the list of tools,
1372  aquired by component through GaudiCommon<TYPE> base:
1373 
1374  >>> tool = ... ## get the tool
1375  >>> tools = tool.Tools() ## get the tools
1376  >>> for t in tools :
1377  ... print t
1378 
1379  """
1380  _cmp = getattr(self, '_itool')
1381  if not _cmp:
1382  self.retrieveInterface()
1383  _cmp = getattr(self, '_itool')
1384  return _get_all_tools_(_cmp, '_tools_t_')
1385 
1386 
1387 # =============================================================================
1388 # get the list of counters
1389 # =============================================================================
1390 # get all counters
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1334
def GaudiPython.GaudiAlgs.mapvct (   func,
  sequence,
  ovct = None 
)
Helper function to fill histogram/ntuple using 'map'-operation 

Definition at line 1314 of file GaudiAlgs.py.

1314 def mapvct(func, sequence, ovct=None):
1315  """ Helper function to fill histogram/ntuple using 'map'-operation """
1316  if not ovct:
1317  vct = GaudiPython.Vector
1318  else:
1319  vct = ovct
1320  if hasattr(sequence, 'size'):
1321  vct.reserve(vct.size() + sequence.size())
1322  elif hasattr(sequence, '__len__'):
1323  vct.reserve(vct.size() + len(sequence))
1324  for object in sequence:
1325  vct.push_back(func(object))
1326  if not ovct:
1327  return vct
1328 # =============================================================================
1329 
1330 
1331 # =============================================================================
1332 # get the list of tools
1333 # =============================================================================
def mapvct(func, sequence, ovct=None)
Definition: GaudiAlgs.py:1314

Variable Documentation

tuple GaudiPython.GaudiAlgs.__all__
private
Initial value:
1 = (
2  'GaudiAlgo', # base class for algorithms
3  'HistoAlgo', # base class for histo-related algorithms
4  'TupleAlgo', # base class for tuple-related algorithms
5  'Tuple', # N-Tuple
6  'HistoID', # ID for N-tuples
7  'TupleID', # ID for Histograms
8  'aida2root', # AIDA -> ROOT converter
9  'SUCCESS' # status code
10 )

Definition at line 41 of file GaudiAlgs.py.

string GaudiPython.GaudiAlgs.__author__ = 'Vanya BELYAEV Ivan.Belyaev@lapp.in2p3.fr'
private

Definition at line 37 of file GaudiAlgs.py.

dictionary GaudiPython.GaudiAlgs._alg_map_
private
Initial value:
1 = {
2  '__init__': _init_, # constructor
3  'tool': _tool_, # service locator
4  'svc': _service_, # tool locator
5  'evtSvc': _evtSvc, # event data service
6  'eventSvc': _evtSvc, # event data service
7  'detSvc': _detSvc, # detector data service
8  'histoSvc': _histoSvc, # histogram data service
9  'histSvc': _histoSvc, # histogram data service
10  'get': _get, # access to event data
11  'get_': _get_, # access to event data
12  'exist_': _exist_, # check the event data
13  'getDet': _getDet, # access to detector data
14  'finalize': _finalize_, # algorithm finalization
15  'beginRun': _success_, # dummy function returning success
16  'endRun': _success_, # dummy function returning success
17  #
18  'hasProperty': _hasProperty_, # check the existence of property with given name
19  'getProperty': _getProperty_, # get the property value with given name
20  'setProperty': _setProperty_, # set the property with given name
21  '__setattr__': _set_attr_, # set the attribute/property with given name
22  '__getattr__': _get_attr_ # set the attribute/property with given name
23 }

Definition at line 1268 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._Dec = TupleDecorator
private

Definition at line 1131 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._detSvc_
private

Definition at line 243 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._evtcolSvc_
private

Definition at line 293 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._evtSvc_
private

Definition at line 239 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._GaudiAlgorithm = cpp.GaudiPython.PyAlg('GaudiAlgorithm')
private

Definition at line 538 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._GaudiHistoAlg = cpp.GaudiPython.PyAlg('GaudiHistoAlg')
private

Definition at line 539 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._GaudiTupleAlg = cpp.GaudiPython.PyAlg('GaudiTupleAlg')
private

Definition at line 540 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._histoSvc_
private

Definition at line 265 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs._ntupleSvc_
private

Definition at line 288 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.AlgDecorator = cpp.GaudiPython.AlgDecorator

Definition at line 87 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.array

Definition at line 1263 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.column

Definition at line 1164 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.column_ll

Definition at line 1261 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.column_ull

Definition at line 1262 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Counter

Definition at line 1620 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Counters

Definition at line 1618 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.farray

Definition at line 1265 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.fmatrix

Definition at line 1266 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.HID = cpp.GaudiAlg.ID

Definition at line 81 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.HistoDecorator = cpp.GaudiPython.HistoDecorator

Definition at line 88 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.HistoID = HID

Definition at line 82 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Histos

Definition at line 1622 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.iAlgorithm = GaudiPython.Bindings.iAlgorithm

Definition at line 54 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.iAlgTool = GaudiPython.Bindings.iAlgTool

Definition at line 55 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Matrix = std.vector('std::vector<double>')

Definition at line 78 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.matrix

Definition at line 1264 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.nTuple

Definition at line 1256 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.ntuple

Definition at line 1257 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.std = cpp.std

Definition at line 73 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TID = HID

Definition at line 83 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Tools

Definition at line 1616 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Tuple = cpp.Tuples.Tuple

Definition at line 1130 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleAlgDecorator = cpp.GaudiPython.TupleAlgDecorator

Definition at line 89 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleDecorator = cpp.GaudiPython.TupleDecorator

Definition at line 90 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.TupleID = TID

Definition at line 84 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.valid

Definition at line 1258 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.Vector = std.vector('double')

Definition at line 76 of file GaudiAlgs.py.

GaudiPython.GaudiAlgs.write

Definition at line 1259 of file GaudiAlgs.py.