The Gaudi Framework  v33r0 (d5ea422b)
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
 
dictionary _alg_map_
 
 _evtSvc_
 
 _detSvc_
 
 _histoSvc_
 
 _ntupleSvc_
 
 _evtcolSvc_
 

Function Documentation

◆ _Counter_a_()

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 1525 of file GaudiAlgs.py.

1525 def _Counter_a_(self, name):
1526  """
1527  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1528 
1529  >>> alg = ... ## get the algorithm
1530  >>> cnt = alg.Counter('#accept') ## get the counter
1531  >>> print cnt
1532 
1533  """
1534  _cmp = getattr(self, '_ialg')
1535  if not _cmp:
1536  self.retrieveInterface()
1537  _cmp = getattr(self, '_ialg')
1538  return _get_counter_(_cmp, '_counter_a_', name)
1539 
1540 
1541 # ==============================================================================
1542 
1543 
def _Counter_a_(self, name)
Definition: GaudiAlgs.py:1525
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1514

◆ _Counter_t_()

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 1544 of file GaudiAlgs.py.

1544 def _Counter_t_(self, name):
1545  """
1546  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1547 
1548  >>> tool = ... ## get the tool
1549  >>> cnt = tool.Counter('#accept') ## get the counter
1550  >>> print cnt
1551 
1552  """
1553  _cmp = getattr(self, '_itool')
1554  if not _cmp:
1555  self.retrieveInterface()
1556  _cmp = getattr(self, '_itool')
1557  return _get_counter_(_cmp, '_counter_t_', name)
1558 
1559 
1560 # =============================================================================
1561 # get all histos
1562 # =============================================================================
1563 cpp.GaudiAlg.ID.__repr__ = cpp.GaudiAlg.ID.idAsString
1564 cpp.GaudiAlg.ID.__str__ = cpp.GaudiAlg.ID.idAsString
1565 cpp.StatEntity.__repr__ = cpp.StatEntity.toString
1566 cpp.StatEntity.__str__ = cpp.StatEntity.toString
1567 
1568 # =============================================================================
1569 
1570 
def _Counter_t_(self, name)
Definition: GaudiAlgs.py:1544
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1514

◆ _Counters_a_()

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 1458 of file GaudiAlgs.py.

1458 def _Counters_a_(self, name=None):
1459  """
1460  Retrieve the counters, managed GaudiCommon<TYPE> base:
1461 
1462  >>> alg = ... ## get the algorithm
1463  >>> cnts = alg.Counters() ## get the counters
1464  >>> for key in cnts :
1465  ... print key, cnts[key]
1466 
1467 
1468  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1469 
1470  >>> alg = ... ## get the algorithm
1471  >>> cnt = alg.Counters('MyCounter') ## get the counter
1472  >>> print cnt
1473 
1474  """
1475  _cmp = getattr(self, '_ialg')
1476  if not _cmp:
1477  self.retrieveInterface()
1478  _cmp = getattr(self, '_ialg')
1479  return _get_all_counters_(_cmp, '_counters_a_', name)
1480 
1481 
1482 # =============================================================================
1483 
1484 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1434
def _Counters_a_(self, name=None)
Definition: GaudiAlgs.py:1458

◆ _Counters_t_()

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 1485 of file GaudiAlgs.py.

1485 def _Counters_t_(self, name=None):
1486  """
1487  Retrieve the counters, managed GaudiCommon<TYPE> base:
1488 
1489  >>> tool = ... ## get the tool
1490  >>> cnts = tool.Counters() ## get the counters
1491  >>> for key in cnts :
1492  ... print key, cnts[key]
1493 
1494 
1495  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1496 
1497  >>> tool = ... ## get the tool
1498  >>> cnt = tool.Counters('MyCounter') ## get the counter
1499  >>> print cnt
1500 
1501  """
1502  _cmp = getattr(self, '_itool')
1503  if not _cmp:
1504  self.retrieveInterface()
1505  _cmp = getattr(self, '_itool')
1506  return _get_all_counters_(_cmp, '_counters_t_', name)
1507 
1508 
1509 # =============================================================================
1510 # get the counter
1511 # =============================================================================
1512 
1513 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1434
def _Counters_t_(self, name=None)
Definition: GaudiAlgs.py:1485

◆ _decorate_algs_()

def GaudiPython.GaudiAlgs._decorate_algs_ (   klasses)
private

Definition at line 1331 of file GaudiAlgs.py.

1331 def _decorate_algs_(klasses):
1332  t = type(klasses)
1333  if not issubclass(t, list) and \
1334  not issubclass(t, tuple):
1335  klasses = [klasses]
1336  for _alg in klasses:
1337  for key in _alg_map_:
1338  setattr(_alg, key, _alg_map_[key])
1339 
1340 
1341 # =
1342 _decorate_algs_(GaudiAlgo)
1343 _decorate_algs_(HistoAlgo)
1344 _decorate_algs_(TupleAlgo)
1345 
1346 # =============================================================================
1347 # Helper function to fill histogram/ntuple using 'map'-operation
1348 # =============================================================================
1349 
1350 
def _decorate_algs_(klasses)
Definition: GaudiAlgs.py:1331

◆ _decorate_plots_()

def GaudiPython.GaudiAlgs._decorate_plots_ (   klasses)
private

Definition at line 1108 of file GaudiAlgs.py.

1108 def _decorate_plots_(klasses):
1109  t = type(klasses)
1110  if not issubclass(t, list) and \
1111  not issubclass(t, tuple):
1112  klasses = [klasses]
1113  for klass in klasses:
1114  klass.plot = _plot1D_
1115  klass.plot1D = _plot1D_
1116  klass.plot2D = _plot2D_
1117  klass.plot3D = _plot3D_
1118  klass.profile1D = _profile1D_
1119  klass.profile2D = _profile2D_
1120 
1121 
1122 _decorate_plots_(HistoAlgo)
1123 _decorate_plots_(TupleAlgo)
1124 
1125 
1126 # =============================================================================
def _decorate_plots_(klasses)
Definition: GaudiAlgs.py:1108

◆ _decorate_tuples_()

def GaudiPython.GaudiAlgs._decorate_tuples_ (   klasses)
private

Definition at line 1148 of file GaudiAlgs.py.

1148 def _decorate_tuples_(klasses):
1149  t = type(klasses)
1150  if not issubclass(t, list) and \
1151  not issubclass(t, tuple):
1152  klasses = [klasses]
1153  for klass in klasses:
1154  klass.nTuple = _nTuple_
1155  klass.evtCol = _evtCol_
1156  klass.ntupleSvc = _ntupleSvc
1157  klass.tupleSvc = _ntupleSvc
1158  klass.ntupSvc = _ntupleSvc
1159  klass.tupSvc = _ntupleSvc
1160  klass.evtColSvc = _evtcolSvc
1161  klass.evtcolSvc = _evtcolSvc
1162 
1163 
1164 # ==========================================================
1165 _decorate_tuples_(TupleAlgo)
1166 
1167 # "decorate N-Tuple object
def _decorate_tuples_(klasses)
Definition: GaudiAlgs.py:1148

◆ _detSvc()

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 361 of file GaudiAlgs.py.

361 def _detSvc(self):
362  """
363  Trivial helper function to access Detector Data and Event Data Service
364 
365  Usage:
366  # get detector data service
367  svc = self.detSvc()
368 
369  # get the data
370  lhcb = self.detSvc('/dd/Structure/LHCb')
371  """
372  if not location:
373  return self._detSvc_
374  return self._detSvc_[location]
375 
376 
377 # =============================================================================
378 # Trivial helper function to access Histogram Data and Histogram Data Service
379 #
380 # Usage:
381 #
382 # @code
383 #
384 # # get histogram data service
385 # svc = self.histoSvc()
386 #
387 # # get the data
388 # histo = self.histoSvc('/stat/Calo/1')
389 #
390 # @endcode
391 #
392 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
393 # @date 2006-11-26
394 
395 

◆ _evtCol_()

def GaudiPython.GaudiAlgs._evtCol_ (   s,
a 
)
private
Retrieve (book-on-demand) N-Tuple object for Event Tag Collections

Definition at line 1137 of file GaudiAlgs.py.

1137 def _evtCol_(s, *a):
1138  """
1139  Retrieve (book-on-demand) N-Tuple object for Event Tag Collections
1140  """
1141  return TupleAlgDecorator.evtCol(s, *a)
1142 
1143 
1144 _nTuple_.__doc__ += '\n' + TupleAlgDecorator.nTuple.__doc__
1145 _evtCol_.__doc__ += '\n' + TupleAlgDecorator.evtCol.__doc__
1146 
1147 

◆ _evtcolSvc()

def GaudiPython.GaudiAlgs._evtcolSvc (   self)
private
Trivial function to access Event Collection Service

Definition at line 474 of file GaudiAlgs.py.

474 def _evtcolSvc(self):
475  """
476  Trivial function to access Event Collection Service
477  """
478  return self._evtcolSvc_
479 
480 
481 # =============================================================================
482 # The default finalization (finalization of base C++ class)
def _evtcolSvc(self)
Definition: GaudiAlgs.py:474

◆ _evtSvc()

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 325 of file GaudiAlgs.py.

325 def _evtSvc(self, location=None):
326  """
327  Trivial helper function to access Event Data and Event Data Service
328 
329  Usage:
330 
331  # get event data service
332  svc = self.evtSvc()
333 
334  # get the data
335  hits = self.evtSvc('MC/Calo/Hits')
336  """
337  if not location:
338  return self._evtSvc_
339  return self._evtSvc_[location]
340 
341 
342 # =============================================================================
343 # Trivial helper function to access Detector Data and Detector Data Service
344 #
345 # Usage:
346 #
347 # @code
348 #
349 # # get detector data service
350 # svc = self.detSvc()
351 #
352 # # get the data
353 # lhcb = self.detSvc('/dd/Structure/LHCb')
354 #
355 # @endcode
356 #
357 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
358 # @date 2006-11-26
359 
360 
def _evtSvc(self, location=None)
Definition: GaudiAlgs.py:325

◆ _execute_()

def GaudiPython.GaudiAlgs._execute_ (   self)
private
The fictive 'execute' method, which MUST be overwitten by user

Definition at line 952 of file GaudiAlgs.py.

952 def _execute_(self):
953  """
954  The fictive 'execute' method, which MUST be overwitten by user
955  """
956  raise RuntimeError(
957  'Execute method is not implemented for %s' % self.name())
958 
959 
960 GaudiAlgo.execute = _execute_
961 HistoAlgo.execute = _execute_
962 TupleAlgo.execute = _execute_
963 
964 

◆ _exist_()

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 451 of file GaudiAlgs.py.

451 def _exist_(self, location, rootInTES=True):
452  """
453  Check the object in Transient Event Store using GaudiCommon machinery,
454  respecting RootInTES behaviour
455  """
456  return AlgDecorator.exist_(self, location, rootInTES)
457 
458 
459 # =============================================================================
460 # Trivial helper function to access NTuple Service
461 
462 
def _exist_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:451

◆ _finalize_()

def GaudiPython.GaudiAlgs._finalize_ (   self)
private
The default finalization : finalize the base C++ class

Definition at line 483 of file GaudiAlgs.py.

483 def _finalize_(self):
484  """
485  The default finalization : finalize the base C++ class
486  """
487  status = self._Base.finalize_(self)
488  return status
489 
490 
491 # =============================================================================
492 # Dummy method returning success
493 
494 
def _finalize_(self)
Definition: GaudiAlgs.py:483

◆ _get()

def GaudiPython.GaudiAlgs._get (   self,
  location 
)
private
Trivial function to access the data in TES using the data service

Definition at line 417 of file GaudiAlgs.py.

417 def _get(self, location):
418  """
419  Trivial function to access the data in TES using the data service
420  """
421  return self._evtSvc_[location]
422 
423 
424 # =============================================================================
425 # Trivial function to access the data in TDS
426 
427 
def _get(self, location)
Definition: GaudiAlgs.py:417

◆ _get_()

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 439 of file GaudiAlgs.py.

439 def _get_(self, location, rootInTES=True):
440  """
441  Get the object from Transient Event Store using GaudiCommon machinery,
442  respecting RootInTES behaviour
443  """
444  return AlgDecorator.get_(self, location, rootInTES)
445 
446 
447 # =============================================================================
448 # check the data from TES using GaudiCommon methods, respecting RootInTES
449 
450 
def _get_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:439

◆ _get_all_counters_()

def GaudiPython.GaudiAlgs._get_all_counters_ (   self,
  method,
  name = None 
)
private
get all counters

Definition at line 1434 of file GaudiAlgs.py.

1434 def _get_all_counters_(self, method, name=None):
1435  """
1436  get all counters
1437  """
1438  _cnts = std.vector('const StatEntity*')()
1439  _nams = std.vector('std::string')()
1440  _func = getattr(AlgDecorator, method)
1441  _num = _func(self, _nams, _cnts)
1442  if _nams.size() != _num or _cnts.size() != _num:
1443  raise RuntimeError('Unable to extract Counters')
1444  _res = {}
1445  for _i in range(0, _num):
1446  _nam = _nams[_i]
1447  _cnt = _cnts[_i]
1448  _res[_nam] = _cnt
1449  if not name:
1450  return _res
1451  return _res.get(name, None)
1452 
1453 
1454 # =============================================================================
1455 # get all counters
1456 
1457 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1434
STL class.
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.

◆ _get_all_histos_()

def GaudiPython.GaudiAlgs._get_all_histos_ (   component,
  method,
  name 
)
private
Get All histogram form the component

Definition at line 1571 of file GaudiAlgs.py.

1571 def _get_all_histos_(component, method, name):
1572  """
1573  Get All histogram form the component
1574  """
1575  _res = {}
1576  for _his in (std.vector('AIDA::IProfile2D*'),
1577  std.vector('AIDA::IProfile1D*'),
1578  std.vector('AIDA::IHistogram3D*'),
1579  std.vector('AIDA::IHistogram2D*'),
1580  std.vector('AIDA::IHistogram1D*')):
1581  _his = _his()
1582  _ids = std.vector('GaudiAlg::ID')()
1583  _fun = getattr(HistoDecorator, method)
1584  _num = _fun(component, _ids, _his)
1585  if _ids.size() != _num or _his.size() != _num:
1586  raise RuntimeError('Unable to extract Histos!')
1587  for _i in range(0, _num):
1588  _id = _ids[_i]
1589  if _id.numeric():
1590  _id = _id.numericID()
1591  elif _id.literal():
1592  _id = _id.literalID()
1593  else:
1594  _id = _is.idAsString()
1595  _res[_id] = _his[_i]
1596 
1597  if not name:
1598  return _res # return the dictionary
1599 
1600  id = cpp.GaudiAlg.ID(name)
1601  for i in (name, id.literalID(), id.numericID(), id.idAsString(), id):
1602  h = _res.get(i, None)
1603  if not not h:
1604  return h # return the histogram
1605 
1606  return None
1607 
1608 
1609 # =============================================================================
1610 
1611 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1571
STL class.
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.

◆ _get_all_tools_()

def GaudiPython.GaudiAlgs._get_all_tools_ (   self,
  method 
)
private
Get all tools

Definition at line 1373 of file GaudiAlgs.py.

1373 def _get_all_tools_(self, method):
1374  """
1375  Get all tools
1376  """
1377  _tools = std.vector('IAlgTool*')()
1378  _func = getattr(AlgDecorator, method)
1379  _num = _func(self, _tools)
1380  if _tools.size() != _num:
1381  raise RuntimeError('Unable to extract Tools')
1382  _res = []
1383  for _tool in _tools:
1384  _res += [iAlgTool(_tool.name(), _tool)]
1385  return _res
1386 
1387 
1388 # =============================================================================
1389 
1390 
STL class.
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1373

◆ _get_attr_()

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 538 of file GaudiAlgs.py.

538 def _get_attr_(self, pname):
539  """
540  Get the attribute (or property)
541  - if the attribute name corresponds to the property name, property value is returned
542  """
543  if self.hasProperty(pname):
544  return iAlgorithm.__getattr__(self, pname)
545  raise AttributeError('attribute/property %s does not exist' % pname)
546 
547 
548 # =============================================================================
549 # set the attribute or property
550 
551 
def _get_attr_(self, pname)
Definition: GaudiAlgs.py:538

◆ _get_counter_()

def GaudiPython.GaudiAlgs._get_counter_ (   self,
  method,
  name 
)
private
get the counter

Definition at line 1514 of file GaudiAlgs.py.

1514 def _get_counter_(self, method, name):
1515  """
1516  get the counter
1517  """
1518  _func = getattr(AlgDecorator, method)
1519  return _func(self, name)
1520 
1521 
1522 # ==============================================================================
1523 
1524 
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1514

◆ _getDet()

def GaudiPython.GaudiAlgs._getDet (   self,
  location 
)
private
Trivial function to access the data in TDS using data service

Definition at line 428 of file GaudiAlgs.py.

428 def _getDet(self, location):
429  """
430  Trivial function to access the data in TDS using data service
431  """
432  return self._detSvc_[location]
433 
434 
435 # =============================================================================
436 # get the data from TES using GaudiCommon methods, respecting RootInTES
437 
438 
def _getDet(self, location)
Definition: GaudiAlgs.py:428

◆ _getProperty_()

def GaudiPython.GaudiAlgs._getProperty_ (   self,
  pname 
)
private
Get the property by name

Definition at line 512 of file GaudiAlgs.py.

512 def _getProperty_(self, pname):
513  """
514  Get the property by name
515  """
516  if not self.hasProperty(pname):
517  raise AttributeError('property %s does not exist' % pname)
518  return iAlgorithm.__getattr__(self, pname)
519 
520 
521 # =============================================================================
522 # set the value for the given property
523 
524 
def _getProperty_(self, pname)
Definition: GaudiAlgs.py:512

◆ _hasProperty_()

def GaudiPython.GaudiAlgs._hasProperty_ (   self,
  pname 
)
private
The trivial function which checks the existence of the property with given name

Definition at line 501 of file GaudiAlgs.py.

501 def _hasProperty_(self, pname):
502  """
503  The trivial function which checks the existence of the property with given name
504  """
505  return cpp.Gaudi.Utils.hasProperty(self, pname)
506 
507 
508 # =============================================================================
509 # get the value of the given property
510 
511 
def _hasProperty_(self, pname)
Definition: GaudiAlgs.py:501

◆ _help_()

def GaudiPython.GaudiAlgs._help_ ( )
private

Definition at line 1689 of file GaudiAlgs.py.

1689 def _help_():
1690  print(__doc__, __author__)
1691  print('\t\t\tDoc-string for class GaudiAlgo \n', GaudiAlgo.__doc__)
1692  print('\t\t\tDoc-string for class HistoAlgo \n', HistoAlgo.__doc__)
1693  print('\t\t\tDoc-string for class TupleAlgo \n', TupleAlgo.__doc__)
1694 
1695 
1696 # =============================================================================
1697 # pseudo-test suite
1698 # =============================================================================

◆ _Histos_a_()

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 1612 of file GaudiAlgs.py.

1612 def _Histos_a_(self, name=None):
1613  """
1614  Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:
1615 
1616  >>> alg = ... ## get the algorithm
1617  >>> histos = alg.Histos() ## get all histograms & profiles
1618  >>> for key in histos :
1619  ... print key, histos[key]
1620 
1621  Retrive the histogram with the certain ID :
1622 
1623  >>> alg = ... ## get the algorithm
1624  >>> histo = alg.Histos('some histo ID') ## get the histo by ID
1625  >>> print histo
1626 
1627  """
1628  _cmp = getattr(self, '_ialg')
1629  if not _cmp:
1630  self.retrieveInterface()
1631  _cmp = getattr(self, '_ialg')
1632  return _get_all_histos_(_cmp, '_histos_a_', name)
1633 
1634 
1635 # =============================================================================
1636 
1637 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1571
def _Histos_a_(self, name=None)
Definition: GaudiAlgs.py:1612

◆ _Histos_t_()

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 1638 of file GaudiAlgs.py.

1638 def _Histos_t_(self, name=None):
1639  """
1640  Retrieve all histograms & profiles, booked through GauydiHistos<TYPE> base:
1641 
1642  >>> tool = ... ## get the tool
1643  >>> histos = tool.Histos() ## get all histograms & profiles
1644  >>> for key in histos :
1645  ... print key, histos[key]
1646 
1647  Retrive the historgam with certain ID :
1648 
1649  >>> tool = ... ## get the tool
1650  >>> histo = tool.Histos('some histo ID') ## get the histo by ID
1651  >>> print histo
1652 
1653  """
1654  _cmp = getattr(self, '_itool')
1655  if not _cmp:
1656  self.retrieveInterface()
1657  _cmp = getattr(self, '_itool')
1658  return _get_all_histos_(_cmp, '_histos_t_', name)
1659 
1660 
1661 # =============================================================================
1662 
1663 _Tools_a_.__doc__ += '\n' + AlgDecorator._tools_a_.__doc__
1664 _Tools_t_.__doc__ += '\n' + AlgDecorator._tools_t_.__doc__
1665 _Counters_a_.__doc__ += '\n' + AlgDecorator._counters_a_.__doc__
1666 _Counters_t_.__doc__ += '\n' + AlgDecorator._counters_t_.__doc__
1667 _Counter_a_.__doc__ += '\n' + AlgDecorator._counter_a_.__doc__
1668 _Counter_t_.__doc__ += '\n' + AlgDecorator._counter_t_.__doc__
1669 _Histos_a_.__doc__ += '\n' + HistoDecorator._histos_a_.__doc__
1670 _Histos_t_.__doc__ += '\n' + HistoDecorator._histos_t_.__doc__
1671 
1672 iAlgorithm.Tools = _Tools_a_
1673 iAlgTool.Tools = _Tools_t_
1674 iAlgorithm.Counters = _Counters_a_
1675 iAlgTool.Counters = _Counters_t_
1676 iAlgorithm.Counter = _Counter_a_
1677 iAlgTool.Counter = _Counter_t_
1678 iAlgorithm.Histos = _Histos_a_
1679 iAlgTool.Histos = _Histos_t_
1680 
1681 # finally add some decoration for histograms
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1571
def _Histos_t_(self, name=None)
Definition: GaudiAlgs.py:1638

◆ _histoSvc()

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 396 of file GaudiAlgs.py.

396 def _histoSvc(self, address=None):
397  """
398  Trivial helper function to access Histogram Data and Histogram Data Service
399 
400  Usage:
401 
402  # get histogram data service
403  svc = self.histoSvc()
404 
405  # get the data
406  histo = self.histoSvc('/stat/Calo/1')
407  """
408  if not address:
409  return self._histoSvc_
410  return self._histoSvc_[address]
411 
412 
413 # =============================================================================
414 # Trivial function to access the data in TES
415 
416 
def _histoSvc(self, address=None)
Definition: GaudiAlgs.py:396

◆ _init_()

def GaudiPython.GaudiAlgs._init_ (   self,
  name,
**  args 
)
private
The constructor from unique algorithm instance name & parameters

Definition at line 208 of file GaudiAlgs.py.

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

◆ _initialize_()

def GaudiPython.GaudiAlgs._initialize_ (   self)
private
The default initialization (initialization of base C++ class + data)

Definition at line 234 of file GaudiAlgs.py.

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

◆ _initialize_histo_()

def GaudiPython.GaudiAlgs._initialize_histo_ (   self)
private
The default initialization (initialization of base C++ class + data members)

Definition at line 261 of file GaudiAlgs.py.

261 def _initialize_histo_(self):
262  """
263  The default initialization (initialization of base C++ class + data members)
264  """
265  status = _initialize_(self)
266  if status.isFailure():
267  return status
268 
269  # set the basic services
270  _h = self._Base.histoSvc(self)
271  _s = InterfaceCast(cpp.IService)(_h)
272  self._histoSvc_ = iHistogramSvc(_s.name(), _h)
273 
274  return status
275 
276 
277 # =============================================================================
278 # The default initialization (initialization of base C++ class + data members)
279 #
280 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
281 # @date 2006-11-26
282 
283 
def _initialize_(self)
Definition: GaudiAlgs.py:234
def _initialize_histo_(self)
Definition: GaudiAlgs.py:261

◆ _initialize_tuple_()

def GaudiPython.GaudiAlgs._initialize_tuple_ (   self)
private
The default initialization (initialization of base C++ class + data members)

Definition at line 284 of file GaudiAlgs.py.

284 def _initialize_tuple_(self):
285  """
286  The default initialization (initialization of base C++ class + data members)
287  """
288  status = _initialize_histo_(self)
289  if status.isFailure():
290  return status
291 
292  # set the basic services
293  if self.produceNTuples():
294  _n = self._Base.ntupleSvc(self)
295  _s = InterfaceCast(cpp.IService)(_n)
296  self._ntupleSvc_ = iNTupleSvc(_s.name(), _n)
297 
298  if self.produceEvtCols():
299  _n = self._Base.evtColSvc(self)
300  _s = InterfaceCast(cpp.IService)(_n)
301  self._evtcolSvc_ = iNTupleSvc(_s.name(), _n)
302 
303  return status
304 
305 
306 # =============================================================================
307 # Trivial helper function to access Event Data and Event Data Service
308 #
309 # Usage:
310 #
311 # @code
312 #
313 # # get event data service
314 # svc = self.evtSvc()
315 #
316 # # get the data
317 # hits = self.evtSvc('MC/Calo/Hits')
318 #
319 # @endcode
320 #
321 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
322 # @date 2006-11-26
323 
324 
def _initialize_tuple_(self)
Definition: GaudiAlgs.py:284
def _initialize_histo_(self)
Definition: GaudiAlgs.py:261

◆ _nTuple_()

def GaudiPython.GaudiAlgs._nTuple_ (   s,
a 
)
private
Retrieve (book-on-demand) N-Tuple object

Definition at line 1127 of file GaudiAlgs.py.

1127 def _nTuple_(s, *a):
1128  """
1129  Retrieve (book-on-demand) N-Tuple object
1130  """
1131  return TupleAlgDecorator.nTuple(s, *a)
1132 
1133 
1134 # =============================================================================
1135 
1136 

◆ _ntupleSvc()

def GaudiPython.GaudiAlgs._ntupleSvc (   self)
private
Trivial function to access N-Tuple Service

Definition at line 463 of file GaudiAlgs.py.

463 def _ntupleSvc(self):
464  """
465  Trivial function to access N-Tuple Service
466  """
467  return self._ntupleSvc_
468 
469 
470 # =============================================================================
471 # Trivial helper function to access Event Collection Service
472 
473 
def _ntupleSvc(self)
Definition: GaudiAlgs.py:463

◆ _plot1D_()

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 980 of file GaudiAlgs.py.

980 def _plot1D_(s, *a):
981  """
982  The basic method to fill (book-on-demand) 1D-histogram
983 
984  The histogram will be created/booked dautomatically according to the
985  specifications:
986 
987  - literal or numerical ID (optional)
988  - title
989  - low edge
990  - high edge
991  - number of bins (default is 100)
992 
993  The reference to the histogram is returned and could be used for later manipulations
994 
995  """
996  return HistoDecorator.plot1D(s, *a)
997 
998 
999 # =============================================================================
1000 
1001 
def _plot1D_(s, *a)
Definition: GaudiAlgs.py:980

◆ _plot2D_()

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 1002 of file GaudiAlgs.py.

1002 def _plot2D_(s, *a):
1003  """
1004  The basic method to fill (book-on-demand) 2D-histogram
1005 
1006  The histogram will be created/booked dautomatically according to the
1007  specifications:
1008 
1009  - literal or numerical ID (optional)
1010  - title
1011  - low X-edge
1012  - high X-edge
1013  - low Y-edge
1014  - high Y-edge
1015  - number of X-bins (default is 50)
1016  - number of Y-bins (default is 50)
1017 
1018  The reference to the histogram is returned and could be used for later manipulations
1019 
1020  """
1021  return HistoDecorator.plot2D(s, *a)
1022 
1023 
1024 # =============================================================================
1025 
1026 

◆ _plot3D_()

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 1027 of file GaudiAlgs.py.

1027 def _plot3D_(s, *a):
1028  """
1029  The basic method to fill (book-on-demand) 3D-histogram
1030 
1031  The histogram will be created/booked dautomatically according to the
1032  specifications:
1033 
1034  - literal or numerical ID (optional)
1035  - title
1036  - low X-edge
1037  - high X-edge
1038  - low Y-edge
1039  - high Y-edge
1040  - low Z-edge
1041  - high Z-edge
1042  - number of X-bins (default is 10)
1043  - number of Y-bins (default is 10)
1044  - number of Y-bins (default is 10)
1045 
1046  The reference to the histogram is returned and could be used for later manipulations
1047 
1048  """
1049  return HistoDecorator.plot3D(s, *a)
1050 
1051 
1052 # =============================================================================
1053 
1054 

◆ _profile1D_()

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 1055 of file GaudiAlgs.py.

1055 def _profile1D_(s, *a):
1056  """
1057  The basic method to fill (book-on-demand) 1D profile histogram
1058 
1059  The profile histogram will be created/booked dautomatically
1060  according to the specifications:
1061 
1062  - literal or numerical ID (optional)
1063  - title
1064  - low X-edge
1065  - high X-edge
1066  - number of X-bins (default is 100)
1067 
1068  The reference to the histogram is returned and could be used for later manipulations
1069 
1070  """
1071  return HistoDecorator.profile1D(s, *a)
1072 
1073 
1074 # =============================================================================
1075 
1076 
def _profile1D_(s, *a)
Definition: GaudiAlgs.py:1055

◆ _profile2D_()

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 1077 of file GaudiAlgs.py.

1077 def _profile2D_(s, *a):
1078  """
1079  The basic method to fill (book-on-demand) 2D profile histiogram
1080 
1081  The profile histogram will be created/booked automatically
1082  according to the specifications:
1083 
1084  - literal or numerical ID (optional)
1085  - title
1086  - low X-edge
1087  - high X-edge
1088  - low Y-edge
1089  - high Y-edge
1090  - number of X-bins (default is 50)
1091  - number of Y-bins (default is 50)
1092 
1093  The reference to the histogram is returned and could be used for later manipulations
1094 
1095  """
1096  return HistoDecorator.profile2D(s, *a)
1097 
1098 
1099 # =============================================================================
1100 
1101 _plot1D_.__doc__ += '\n' + HistoDecorator.plot1D.__doc__
1102 _plot2D_.__doc__ += '\n' + HistoDecorator.plot2D.__doc__
1103 _plot3D_.__doc__ += '\n' + HistoDecorator.plot3D.__doc__
1104 _profile1D_.__doc__ += '\n' + HistoDecorator.profile1D.__doc__
1105 _profile2D_.__doc__ += '\n' + HistoDecorator.profile2D.__doc__
1106 
1107 
def _profile2D_(s, *a)
Definition: GaudiAlgs.py:1077

◆ _service_()

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 180 of file GaudiAlgs.py.

180 def _service_(self, interface, name, create=True):
181  """
182  Useful method to locate a service:
183 
184  Usage:
185 
186  ntsvc = self.svc( INTupleSvc , 'NTUpleSvc' )
187 
188  """
189  if not interface:
190  interface = cpp.IInterface
191  _svc = AlgDecorator.svc_(self, name, create)
192  if not _svc:
193  return None
194  _svc = InterfaceCast(interface)(_svc)
195  if not _svc:
196  self.Warning('Invalid cast to interface %s' % interface)
197  return None
198  return _svc
199 
200 
201 # =============================================================================
202 # The constructor from unique algorithm instance name,
203 #
204 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
205 # @date 2006-11-26
206 
207 
def _service_(self, interface, name, create=True)
Definition: GaudiAlgs.py:180

◆ _set_attr_()

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 552 of file GaudiAlgs.py.

552 def _set_attr_(self, pname, pvalue):
553  """
554  Set the attribute (or property) :
555  - if the attribute name corresponds to the property name, the property is updated
556  """
557  if not self.hasProperty(pname):
558  self.__dict__[pname] = pvalue
559  else:
560  iAlgorithm.__setattr__(self, pname, pvalue)
561 
562 
def _set_attr_(self, pname, pvalue)
Definition: GaudiAlgs.py:552

◆ _setProperty_()

def GaudiPython.GaudiAlgs._setProperty_ (   self,
  pname,
  pvalue 
)
private
Set the property from the value

Definition at line 525 of file GaudiAlgs.py.

525 def _setProperty_(self, pname, pvalue):
526  """
527  Set the property from the value
528  """
529  if not self.hasProperty(pname):
530  raise AttributeError('property %s does not exist' % pname)
531  return iAlgorithm.__setattr__(self, pname, pvalue)
532 
533 
534 # =============================================================================
535 # get the attribute or property
536 
537 
def _setProperty_(self, pname, pvalue)
Definition: GaudiAlgs.py:525

◆ _start_()

def GaudiPython.GaudiAlgs._start_ (   self)
private
The stub 'start' method needed by the internal implementation of PyAlg<>.

Definition at line 939 of file GaudiAlgs.py.

939 def _start_(self):
940  """
941  The stub 'start' method needed by the internal implementation of PyAlg<>.
942  """
943  # return self._Base.start_(self)
944  return SUCCESS
945 
946 
947 GaudiAlgo.start = _start_
948 HistoAlgo.start = _start_
949 TupleAlgo.start = _start_
950 
951 

◆ _stop_()

def GaudiPython.GaudiAlgs._stop_ (   self)
private
The stub 'stop' method needed by the internal implementation of PyAlg<>.

Definition at line 965 of file GaudiAlgs.py.

965 def _stop_(self):
966  """
967  The stub 'stop' method needed by the internal implementation of PyAlg<>.
968  """
969  # return self._Base.stop_(self)
970  return SUCCESS
971 
972 
973 GaudiAlgo.stop = _stop_
974 HistoAlgo.stop = _stop_
975 TupleAlgo.stop = _stop_
976 
977 # =============================================================================
978 
979 

◆ _success_()

def GaudiPython.GaudiAlgs._success_ (   self)
private

Definition at line 495 of file GaudiAlgs.py.

495 def _success_(self):
496  return SUCCESS
497 
498 
499 # =============================================================================
500 # check the existence of the property with the given name

◆ _t_array_()

def GaudiPython.GaudiAlgs._t_array_ (   s,
a 
)
private
Fill the fixed-size array column

Definition at line 1254 of file GaudiAlgs.py.

1254 def _t_array_(s, *a):
1255  """
1256  Fill the fixed-size array column
1257  """
1258  return _Dec.array(s, *a)
1259 
1260 
def _t_array_(s, *a)
Definition: GaudiAlgs.py:1254

◆ _t_column_()

def GaudiPython.GaudiAlgs._t_column_ (   s,
a 
)
private
Fill the certain column to n-tuple

Definition at line 1233 of file GaudiAlgs.py.

1233 def _t_column_(s, *a):
1234  """
1235  Fill the certain column to n-tuple
1236  """
1237  return _Dec.column(s, *a)
1238 
1239 
def _t_column_(s, *a)
Definition: GaudiAlgs.py:1233

◆ _t_column_ll_()

def GaudiPython.GaudiAlgs._t_column_ll_ (   s,
a 
)
private
Fill the 'long long' column

Definition at line 1240 of file GaudiAlgs.py.

1240 def _t_column_ll_(s, *a):
1241  """
1242  Fill the 'long long' column
1243  """
1244  return _Dec.column_ll(s, *a)
1245 
1246 
def _t_column_ll_(s, *a)
Definition: GaudiAlgs.py:1240

◆ _t_column_ull_()

def GaudiPython.GaudiAlgs._t_column_ull_ (   s,
a 
)
private
Fill the 'unsigned long long' column

Definition at line 1247 of file GaudiAlgs.py.

1247 def _t_column_ull_(s, *a):
1248  """
1249  Fill the 'unsigned long long' column
1250  """
1251  return _Dec.column_ull(s, *a)
1252 
1253 
def _t_column_ull_(s, *a)
Definition: GaudiAlgs.py:1247

◆ _t_farray_()

def GaudiPython.GaudiAlgs._t_farray_ (   s,
a 
)
private
Fill the floating-size array column

Definition at line 1268 of file GaudiAlgs.py.

1268 def _t_farray_(s, *a):
1269  """
1270  Fill the floating-size array column
1271  """
1272  return _Dec.farray(s, *a)
1273 
1274 
def _t_farray_(s, *a)
Definition: GaudiAlgs.py:1268

◆ _t_fmatrix_()

def GaudiPython.GaudiAlgs._t_fmatrix_ (   s,
a 
)
private
Fill the floating-size matrix column

Definition at line 1275 of file GaudiAlgs.py.

1275 def _t_fmatrix_(s, *a):
1276  """
1277  Fill the floating-size matrix column
1278  """
1279  return _Dec.fmatrix(s, *a)
1280 
1281 
1282 _t_nTuple_.__doc__ += '\n' + _Dec.nTuple.__doc__
1283 _t_ntuple_.__doc__ += '\n' + _Dec.ntuple.__doc__
1284 _t_valid_.__doc__ += '\n' + _Dec.valid.__doc__
1285 _t_write_.__doc__ += '\n' + _Dec.write.__doc__
1286 _t_column_.__doc__ += '\n' + _Dec.column.__doc__
1287 _t_column_ll_.__doc__ += '\n' + _Dec.column_ll.__doc__
1288 _t_column_ull_.__doc__ += '\n' + _Dec.column_ull.__doc__
1289 _t_array_.__doc__ += '\n' + _Dec.array.__doc__
1290 _t_matrix_.__doc__ += '\n' + _Dec.matrix.__doc__
1291 _t_farray_.__doc__ += '\n' + _Dec.farray.__doc__
1292 _t_fmatrix_.__doc__ += '\n' + _Dec.fmatrix.__doc__
1293 
1294 Tuple.nTuple = _t_nTuple_
1295 Tuple.ntuple = _t_ntuple_
1296 Tuple.valid = _t_valid_
1297 Tuple.write = _t_write_
1298 Tuple.column = _t_column_
1299 Tuple.column_ll = _t_column_ll_
1300 Tuple.column_ull = _t_column_ull_
1301 Tuple.array = _t_array_
1302 Tuple.matrix = _t_matrix_
1303 Tuple.farray = _t_farray_
1304 Tuple.fmatrix = _t_fmatrix_
1305 
def _t_fmatrix_(s, *a)
Definition: GaudiAlgs.py:1275

◆ _t_matrix_()

def GaudiPython.GaudiAlgs._t_matrix_ (   s,
a 
)
private
Fill the fixed-size matrix column

Definition at line 1261 of file GaudiAlgs.py.

1261 def _t_matrix_(s, *a):
1262  """
1263  Fill the fixed-size matrix column
1264  """
1265  return _Dec.matrix(s, *a)
1266 
1267 
def _t_matrix_(s, *a)
Definition: GaudiAlgs.py:1261

◆ _t_nTuple_()

def GaudiPython.GaudiAlgs._t_nTuple_ (   s,
a 
)
private
Access to underlying INTuple object

Definition at line 1205 of file GaudiAlgs.py.

1205 def _t_nTuple_(s, *a):
1206  """
1207  Access to underlying INTuple object
1208  """
1209  return _Dec.nTuple(s, *a)
1210 
1211 
def _t_nTuple_(s, *a)
Definition: GaudiAlgs.py:1205

◆ _t_ntuple_()

def GaudiPython.GaudiAlgs._t_ntuple_ (   s,
a 
)
private
Access to underlying NTuple::Tuple object

Definition at line 1212 of file GaudiAlgs.py.

1212 def _t_ntuple_(s, *a):
1213  """
1214  Access to underlying NTuple::Tuple object
1215  """
1216  return _Dec.ntuple(s, *a)
1217 
1218 
def _t_ntuple_(s, *a)
Definition: GaudiAlgs.py:1212

◆ _t_valid_()

def GaudiPython.GaudiAlgs._t_valid_ (   s,
a 
)
private
Valid NTuple::Tuple object?

Definition at line 1219 of file GaudiAlgs.py.

1219 def _t_valid_(s, *a):
1220  """
1221  Valid NTuple::Tuple object?
1222  """
1223  return _Dec.valid(s, *a)
1224 
1225 
def _t_valid_(s, *a)
Definition: GaudiAlgs.py:1219

◆ _t_write_()

def GaudiPython.GaudiAlgs._t_write_ (   s,
a 
)
private
Commit the row/record to n-tuple

Definition at line 1226 of file GaudiAlgs.py.

1226 def _t_write_(s, *a):
1227  """
1228  Commit the row/record to n-tuple
1229  """
1230  return _Dec.write(s, *a)
1231 
1232 
def _t_write_(s, *a)
Definition: GaudiAlgs.py:1226

◆ _tool_()

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 129 of file GaudiAlgs.py.

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

◆ _Tools_a_()

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 1391 of file GaudiAlgs.py.

1391 def _Tools_a_(self):
1392  """
1393  Retrieve the list of tools,
1394  aquired by component through GaudiCommon<TYPE> base:
1395 
1396  >>> alg = ... ## get the algorithm
1397  >>> tools = alg.Tools() ## get the tools
1398  >>> for tool in tools :
1399  ... print tool
1400 
1401  """
1402  _cmp = getattr(self, '_ialg')
1403  if not _cmp:
1404  self.retrieveInterface()
1405  _cmp = getattr(self, '_ialg')
1406  return _get_all_tools_(_cmp, '_tools_a_')
1407 
1408 
1409 # =============================================================================
1410 
1411 
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1373

◆ _Tools_t_()

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 1412 of file GaudiAlgs.py.

1412 def _Tools_t_(self):
1413  """
1414  Retrieve the list of tools,
1415  aquired by component through GaudiCommon<TYPE> base:
1416 
1417  >>> tool = ... ## get the tool
1418  >>> tools = tool.Tools() ## get the tools
1419  >>> for t in tools :
1420  ... print t
1421 
1422  """
1423  _cmp = getattr(self, '_itool')
1424  if not _cmp:
1425  self.retrieveInterface()
1426  _cmp = getattr(self, '_itool')
1427  return _get_all_tools_(_cmp, '_tools_t_')
1428 
1429 
1430 # =============================================================================
1431 # get the list of counters
1432 # =============================================================================
1433 # get all counters
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1373

◆ mapvct()

def GaudiPython.GaudiAlgs.mapvct (   func,
  sequence,
  ovct = None 
)
Helper function to fill histogram/ntuple using 'map'-operation 

Definition at line 1351 of file GaudiAlgs.py.

1351 def mapvct(func, sequence, ovct=None):
1352  """ Helper function to fill histogram/ntuple using 'map'-operation """
1353  if not ovct:
1354  vct = GaudiPython.Vector
1355  else:
1356  vct = ovct
1357  if hasattr(sequence, 'size'):
1358  vct.reserve(vct.size() + sequence.size())
1359  elif hasattr(sequence, '__len__'):
1360  vct.reserve(vct.size() + len(sequence))
1361  for object in sequence:
1362  vct.push_back(func(object))
1363  if not ovct:
1364  return vct
1365 
1366 
1367 # =============================================================================
1368 
1369 
1370 # =============================================================================
1371 # get the list of tools
1372 # =============================================================================
def mapvct(func, sequence, ovct=None)
Definition: GaudiAlgs.py:1351

Variable Documentation

◆ __all__

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 52 of file GaudiAlgs.py.

◆ __author__

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

Definition at line 48 of file GaudiAlgs.py.

◆ _alg_map_

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  #
16  'hasProperty':
17  _hasProperty_, # check the existence of property with given name
18  'getProperty': _getProperty_, # get the property value with given name
19  'setProperty': _setProperty_, # set the property with given name
20  '__setattr__': _set_attr_, # set the attribute/property with given name
21  '__getattr__': _get_attr_ # set the attribute/property with given name
22 }

Definition at line 1306 of file GaudiAlgs.py.

◆ _Dec

GaudiPython.GaudiAlgs._Dec = TupleDecorator
private

Definition at line 1169 of file GaudiAlgs.py.

◆ _detSvc_

GaudiPython.GaudiAlgs._detSvc_
private

Definition at line 249 of file GaudiAlgs.py.

◆ _evtcolSvc_

GaudiPython.GaudiAlgs._evtcolSvc_
private

Definition at line 301 of file GaudiAlgs.py.

◆ _evtSvc_

GaudiPython.GaudiAlgs._evtSvc_
private

Definition at line 245 of file GaudiAlgs.py.

◆ _GaudiAlgorithm

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

Definition at line 563 of file GaudiAlgs.py.

◆ _GaudiHistoAlg

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

Definition at line 564 of file GaudiAlgs.py.

◆ _GaudiTupleAlg

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

Definition at line 565 of file GaudiAlgs.py.

◆ _histoSvc_

GaudiPython.GaudiAlgs._histoSvc_
private

Definition at line 272 of file GaudiAlgs.py.

◆ _ntupleSvc_

GaudiPython.GaudiAlgs._ntupleSvc_
private

Definition at line 296 of file GaudiAlgs.py.

◆ AlgDecorator

GaudiPython.GaudiAlgs.AlgDecorator = cpp.GaudiPython.AlgDecorator

Definition at line 98 of file GaudiAlgs.py.

◆ column

GaudiPython.GaudiAlgs.column

Definition at line 1202 of file GaudiAlgs.py.

◆ HID

GaudiPython.GaudiAlgs.HID = cpp.GaudiAlg.ID

Definition at line 92 of file GaudiAlgs.py.

◆ HistoDecorator

GaudiPython.GaudiAlgs.HistoDecorator = cpp.GaudiPython.HistoDecorator

Definition at line 99 of file GaudiAlgs.py.

◆ HistoID

GaudiPython.GaudiAlgs.HistoID = HID

Definition at line 93 of file GaudiAlgs.py.

◆ iAlgorithm

GaudiPython.GaudiAlgs.iAlgorithm = GaudiPython.Bindings.iAlgorithm

Definition at line 65 of file GaudiAlgs.py.

◆ iAlgTool

GaudiPython.GaudiAlgs.iAlgTool = GaudiPython.Bindings.iAlgTool

Definition at line 66 of file GaudiAlgs.py.

◆ Matrix

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

Definition at line 89 of file GaudiAlgs.py.

◆ std

GaudiPython.GaudiAlgs.std = cpp.std

Definition at line 84 of file GaudiAlgs.py.

◆ TID

GaudiPython.GaudiAlgs.TID = HID

Definition at line 94 of file GaudiAlgs.py.

◆ Tuple

GaudiPython.GaudiAlgs.Tuple = cpp.Tuples.Tuple

Definition at line 1168 of file GaudiAlgs.py.

◆ TupleAlgDecorator

GaudiPython.GaudiAlgs.TupleAlgDecorator = cpp.GaudiPython.TupleAlgDecorator

Definition at line 100 of file GaudiAlgs.py.

◆ TupleDecorator

GaudiPython.GaudiAlgs.TupleDecorator = cpp.GaudiPython.TupleDecorator

Definition at line 101 of file GaudiAlgs.py.

◆ TupleID

GaudiPython.GaudiAlgs.TupleID = TID

Definition at line 95 of file GaudiAlgs.py.

◆ Vector

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

Definition at line 87 of file GaudiAlgs.py.