The Gaudi Framework  v32r2 (46d42edc)
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 1517 of file GaudiAlgs.py.

1517 def _Counter_a_(self, name):
1518  """
1519  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1520 
1521  >>> alg = ... ## get the algorithm
1522  >>> cnt = alg.Counter('#accept') ## get the counter
1523  >>> print cnt
1524 
1525  """
1526  _cmp = getattr(self, '_ialg')
1527  if not _cmp:
1528  self.retrieveInterface()
1529  _cmp = getattr(self, '_ialg')
1530  return _get_counter_(_cmp, '_counter_a_', name)
1531 
1532 
1533 # ==============================================================================
1534 
1535 
def _Counter_a_(self, name)
Definition: GaudiAlgs.py:1517
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1506

◆ _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 1536 of file GaudiAlgs.py.

1536 def _Counter_t_(self, name):
1537  """
1538  Retrieve the counter managed GaudiCommon<TYPE> base by name:
1539 
1540  >>> tool = ... ## get the tool
1541  >>> cnt = tool.Counter('#accept') ## get the counter
1542  >>> print cnt
1543 
1544  """
1545  _cmp = getattr(self, '_itool')
1546  if not _cmp:
1547  self.retrieveInterface()
1548  _cmp = getattr(self, '_itool')
1549  return _get_counter_(_cmp, '_counter_t_', name)
1550 
1551 
1552 # =============================================================================
1553 # get all histos
1554 # =============================================================================
1555 cpp.GaudiAlg.ID.__repr__ = cpp.GaudiAlg.ID.idAsString
1556 cpp.GaudiAlg.ID.__str__ = cpp.GaudiAlg.ID.idAsString
1557 cpp.StatEntity.__repr__ = cpp.StatEntity.toString
1558 cpp.StatEntity.__str__ = cpp.StatEntity.toString
1559 
1560 # =============================================================================
1561 
1562 
def _Counter_t_(self, name)
Definition: GaudiAlgs.py:1536
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1506

◆ _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 1450 of file GaudiAlgs.py.

1450 def _Counters_a_(self, name=None):
1451  """
1452  Retrieve the counters, managed GaudiCommon<TYPE> base:
1453 
1454  >>> alg = ... ## get the algorithm
1455  >>> cnts = alg.Counters() ## get the counters
1456  >>> for key in cnts :
1457  ... print key, cnts[key]
1458 
1459 
1460  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1461 
1462  >>> alg = ... ## get the algorithm
1463  >>> cnt = alg.Counters('MyCounter') ## get the counter
1464  >>> print cnt
1465 
1466  """
1467  _cmp = getattr(self, '_ialg')
1468  if not _cmp:
1469  self.retrieveInterface()
1470  _cmp = getattr(self, '_ialg')
1471  return _get_all_counters_(_cmp, '_counters_a_', name)
1472 
1473 
1474 # =============================================================================
1475 
1476 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1426
def _Counters_a_(self, name=None)
Definition: GaudiAlgs.py:1450

◆ _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 1477 of file GaudiAlgs.py.

1477 def _Counters_t_(self, name=None):
1478  """
1479  Retrieve the counters, managed GaudiCommon<TYPE> base:
1480 
1481  >>> tool = ... ## get the tool
1482  >>> cnts = tool.Counters() ## get the counters
1483  >>> for key in cnts :
1484  ... print key, cnts[key]
1485 
1486 
1487  Retrieve the counter, managed GaudiCommon<TYPE> base by name:
1488 
1489  >>> tool = ... ## get the tool
1490  >>> cnt = tool.Counters('MyCounter') ## get the counter
1491  >>> print cnt
1492 
1493  """
1494  _cmp = getattr(self, '_itool')
1495  if not _cmp:
1496  self.retrieveInterface()
1497  _cmp = getattr(self, '_itool')
1498  return _get_all_counters_(_cmp, '_counters_t_', name)
1499 
1500 
1501 # =============================================================================
1502 # get the counter
1503 # =============================================================================
1504 
1505 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1426
def _Counters_t_(self, name=None)
Definition: GaudiAlgs.py:1477

◆ _decorate_algs_()

def GaudiPython.GaudiAlgs._decorate_algs_ (   klasses)
private

Definition at line 1323 of file GaudiAlgs.py.

1323 def _decorate_algs_(klasses):
1324  t = type(klasses)
1325  if not issubclass(t, list) and \
1326  not issubclass(t, tuple):
1327  klasses = [klasses]
1328  for _alg in klasses:
1329  for key in _alg_map_:
1330  setattr(_alg, key, _alg_map_[key])
1331 
1332 
1333 # =
1334 _decorate_algs_(GaudiAlgo)
1335 _decorate_algs_(HistoAlgo)
1336 _decorate_algs_(TupleAlgo)
1337 
1338 # =============================================================================
1339 # Helper function to fill histogram/ntuple using 'map'-operation
1340 # =============================================================================
1341 
1342 
def _decorate_algs_(klasses)
Definition: GaudiAlgs.py:1323

◆ _decorate_plots_()

def GaudiPython.GaudiAlgs._decorate_plots_ (   klasses)
private

Definition at line 1098 of file GaudiAlgs.py.

1098 def _decorate_plots_(klasses):
1099  t = type(klasses)
1100  if not issubclass(t, list) and \
1101  not issubclass(t, tuple):
1102  klasses = [klasses]
1103  for klass in klasses:
1104  klass.plot = _plot1D_
1105  klass.plot1D = _plot1D_
1106  klass.plot2D = _plot2D_
1107  klass.plot3D = _plot3D_
1108  klass.profile1D = _profile1D_
1109  klass.profile2D = _profile2D_
1110 
1111 
1112 _decorate_plots_(HistoAlgo)
1113 _decorate_plots_(TupleAlgo)
1114 
1115 
1116 # =============================================================================
def _decorate_plots_(klasses)
Definition: GaudiAlgs.py:1098

◆ _decorate_tuples_()

def GaudiPython.GaudiAlgs._decorate_tuples_ (   klasses)
private

Definition at line 1138 of file GaudiAlgs.py.

1138 def _decorate_tuples_(klasses):
1139  t = type(klasses)
1140  if not issubclass(t, list) and \
1141  not issubclass(t, tuple):
1142  klasses = [klasses]
1143  for klass in klasses:
1144  klass.nTuple = _nTuple_
1145  klass.evtCol = _evtCol_
1146  klass.ntupleSvc = _ntupleSvc
1147  klass.tupleSvc = _ntupleSvc
1148  klass.ntupSvc = _ntupleSvc
1149  klass.tupSvc = _ntupleSvc
1150  klass.evtColSvc = _evtcolSvc
1151  klass.evtcolSvc = _evtcolSvc
1152 
1153 
1154 # ==========================================================
1155 _decorate_tuples_(TupleAlgo)
1156 
1157 # "decorate N-Tuple object
def _decorate_tuples_(klasses)
Definition: GaudiAlgs.py:1138

◆ _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 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 # =============================================================================
368 # Trivial helper function to access Histogram Data and Histogram Data Service
369 #
370 # Usage:
371 #
372 # @code
373 #
374 # # get histogram data service
375 # svc = self.histoSvc()
376 #
377 # # get the data
378 # histo = self.histoSvc('/stat/Calo/1')
379 #
380 # @endcode
381 #
382 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
383 # @date 2006-11-26
384 
385 

◆ _evtCol_()

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

Definition at line 1127 of file GaudiAlgs.py.

1127 def _evtCol_(s, *a):
1128  """
1129  Retrieve (book-on-demand) N-Tuple object for Event Tag Collections
1130  """
1131  return TupleAlgDecorator.evtCol(s, *a)
1132 
1133 
1134 _nTuple_.__doc__ += '\n' + TupleAlgDecorator.nTuple.__doc__
1135 _evtCol_.__doc__ += '\n' + TupleAlgDecorator.evtCol.__doc__
1136 
1137 

◆ _evtcolSvc()

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

Definition at line 464 of file GaudiAlgs.py.

464 def _evtcolSvc(self):
465  """
466  Trivial function to access Event Collection Service
467  """
468  return self._evtcolSvc_
469 
470 
471 # =============================================================================
472 # The default finalization (finalization of base C++ class)
def _evtcolSvc(self)
Definition: GaudiAlgs.py:464

◆ _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 315 of file GaudiAlgs.py.

315 def _evtSvc(self, location=None):
316  """
317  Trivial helper function to access Event Data and Event Data Service
318 
319  Usage:
320 
321  # get event data service
322  svc = self.evtSvc()
323 
324  # get the data
325  hits = self.evtSvc('MC/Calo/Hits')
326  """
327  if not location:
328  return self._evtSvc_
329  return self._evtSvc_[location]
330 
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:315

◆ _execute_()

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

Definition at line 942 of file GaudiAlgs.py.

942 def _execute_(self):
943  """
944  The fictive 'execute' method, which MUST be overwitten by user
945  """
946  raise RuntimeError(
947  'Execute method is not implemented for %s' % self.name())
948 
949 
950 GaudiAlgo.execute = _execute_
951 HistoAlgo.execute = _execute_
952 TupleAlgo.execute = _execute_
953 
954 

◆ _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 441 of file GaudiAlgs.py.

441 def _exist_(self, location, rootInTES=True):
442  """
443  Check the object in Transient Event Store using GaudiCommon machinery,
444  respecting RootInTES behaviour
445  """
446  return AlgDecorator.exist_(self, location, rootInTES)
447 
448 
449 # =============================================================================
450 # Trivial helper function to access NTuple Service
451 
452 
def _exist_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:441

◆ _finalize_()

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

Definition at line 473 of file GaudiAlgs.py.

473 def _finalize_(self):
474  """
475  The default finalization : finalize the base C++ class
476  """
477  status = self._Base.finalize_(self)
478  return status
479 
480 
481 # =============================================================================
482 # Dummy method returning success
483 
484 
def _finalize_(self)
Definition: GaudiAlgs.py:473

◆ _get()

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

Definition at line 407 of file GaudiAlgs.py.

407 def _get(self, location):
408  """
409  Trivial function to access the data in TES using the data service
410  """
411  return self._evtSvc_[location]
412 
413 
414 # =============================================================================
415 # Trivial function to access the data in TDS
416 
417 
def _get(self, location)
Definition: GaudiAlgs.py:407

◆ _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 429 of file GaudiAlgs.py.

429 def _get_(self, location, rootInTES=True):
430  """
431  Get the object from Transient Event Store using GaudiCommon machinery,
432  respecting RootInTES behaviour
433  """
434  return AlgDecorator.get_(self, location, rootInTES)
435 
436 
437 # =============================================================================
438 # check the data from TES using GaudiCommon methods, respecting RootInTES
439 
440 
def _get_(self, location, rootInTES=True)
Definition: GaudiAlgs.py:429

◆ _get_all_counters_()

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

Definition at line 1426 of file GaudiAlgs.py.

1426 def _get_all_counters_(self, method, name=None):
1427  """
1428  get all counters
1429  """
1430  _cnts = std.vector('const StatEntity*')()
1431  _nams = std.vector('std::string')()
1432  _func = getattr(AlgDecorator, method)
1433  _num = _func(self, _nams, _cnts)
1434  if _nams.size() != _num or _cnts.size() != _num:
1435  raise RuntimeError('Unable to extract Counters')
1436  _res = {}
1437  for _i in range(0, _num):
1438  _nam = _nams[_i]
1439  _cnt = _cnts[_i]
1440  _res[_nam] = _cnt
1441  if not name:
1442  return _res
1443  return _res.get(name, None)
1444 
1445 
1446 # =============================================================================
1447 # get all counters
1448 
1449 
def _get_all_counters_(self, method, name=None)
Definition: GaudiAlgs.py:1426
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 1563 of file GaudiAlgs.py.

1563 def _get_all_histos_(component, method, name):
1564  """
1565  Get All histogram form the component
1566  """
1567  _res = {}
1568  for _his in (std.vector('AIDA::IProfile2D*'),
1569  std.vector('AIDA::IProfile1D*'),
1570  std.vector('AIDA::IHistogram3D*'),
1571  std.vector('AIDA::IHistogram2D*'),
1572  std.vector('AIDA::IHistogram1D*')):
1573  _his = _his()
1574  _ids = std.vector('GaudiAlg::ID')()
1575  _fun = getattr(HistoDecorator, method)
1576  _num = _fun(component, _ids, _his)
1577  if _ids.size() != _num or _his.size() != _num:
1578  raise RuntimeError('Unable to extract Histos!')
1579  for _i in range(0, _num):
1580  _id = _ids[_i]
1581  if _id.numeric():
1582  _id = _id.numericID()
1583  elif _id.literal():
1584  _id = _id.literalID()
1585  else:
1586  _id = _is.idAsString()
1587  _res[_id] = _his[_i]
1588 
1589  if not name:
1590  return _res # return the dictionary
1591 
1592  id = cpp.GaudiAlg.ID(name)
1593  for i in (name, id.literalID(), id.numericID(), id.idAsString(), id):
1594  h = _res.get(i, None)
1595  if not not h:
1596  return h # return the histogram
1597 
1598  return None
1599 
1600 
1601 # =============================================================================
1602 
1603 
def _get_all_histos_(component, method, name)
Definition: GaudiAlgs.py:1563
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 1365 of file GaudiAlgs.py.

1365 def _get_all_tools_(self, method):
1366  """
1367  Get all tools
1368  """
1369  _tools = std.vector('IAlgTool*')()
1370  _func = getattr(AlgDecorator, method)
1371  _num = _func(self, _tools)
1372  if _tools.size() != _num:
1373  raise RuntimeError('Unable to extract Tools')
1374  _res = []
1375  for _tool in _tools:
1376  _res += [iAlgTool(_tool.name(), _tool)]
1377  return _res
1378 
1379 
1380 # =============================================================================
1381 
1382 
STL class.
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1365

◆ _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 528 of file GaudiAlgs.py.

528 def _get_attr_(self, pname):
529  """
530  Get the attribute (or property)
531  - if the attribute name corresponds to the property name, property value is returned
532  """
533  if self.hasProperty(pname):
534  return iAlgorithm.__getattr__(self, pname)
535  raise AttributeError('attribute/property %s does not exist' % pname)
536 
537 
538 # =============================================================================
539 # set the attribute or property
540 
541 
def _get_attr_(self, pname)
Definition: GaudiAlgs.py:528

◆ _get_counter_()

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

Definition at line 1506 of file GaudiAlgs.py.

1506 def _get_counter_(self, method, name):
1507  """
1508  get the counter
1509  """
1510  _func = getattr(AlgDecorator, method)
1511  return _func(self, name)
1512 
1513 
1514 # ==============================================================================
1515 
1516 
def _get_counter_(self, method, name)
Definition: GaudiAlgs.py:1506

◆ _getDet()

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

Definition at line 418 of file GaudiAlgs.py.

418 def _getDet(self, location):
419  """
420  Trivial function to access the data in TDS using data service
421  """
422  return self._detSvc_[location]
423 
424 
425 # =============================================================================
426 # get the data from TES using GaudiCommon methods, respecting RootInTES
427 
428 
def _getDet(self, location)
Definition: GaudiAlgs.py:418

◆ _getProperty_()

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

Definition at line 502 of file GaudiAlgs.py.

502 def _getProperty_(self, pname):
503  """
504  Get the property by name
505  """
506  if not self.hasProperty(pname):
507  raise AttributeError('property %s does not exist' % pname)
508  return iAlgorithm.__getattr__(self, pname)
509 
510 
511 # =============================================================================
512 # set the value for the given property
513 
514 
def _getProperty_(self, pname)
Definition: GaudiAlgs.py:502

◆ _hasProperty_()

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

Definition at line 491 of file GaudiAlgs.py.

491 def _hasProperty_(self, pname):
492  """
493  The trivial function which checks the existence of the property with given name
494  """
495  return cpp.Gaudi.Utils.hasProperty(self, pname)
496 
497 
498 # =============================================================================
499 # get the value of the given property
500 
501 
def _hasProperty_(self, pname)
Definition: GaudiAlgs.py:491

◆ _help_()

def GaudiPython.GaudiAlgs._help_ ( )
private

Definition at line 1681 of file GaudiAlgs.py.

1681 def _help_():
1682  print(__doc__, __author__)
1683  print('\t\t\tDoc-string for class GaudiAlgo \n', GaudiAlgo.__doc__)
1684  print('\t\t\tDoc-string for class HistoAlgo \n', HistoAlgo.__doc__)
1685  print('\t\t\tDoc-string for class TupleAlgo \n', TupleAlgo.__doc__)
1686 
1687 
1688 # =============================================================================
1689 # pseudo-test suite
1690 # =============================================================================

◆ _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 1604 of file GaudiAlgs.py.

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

◆ _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 1630 of file GaudiAlgs.py.

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

◆ _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 386 of file GaudiAlgs.py.

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

◆ _init_()

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

Definition at line 198 of file GaudiAlgs.py.

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

◆ _initialize_()

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

Definition at line 224 of file GaudiAlgs.py.

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

◆ _initialize_histo_()

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

Definition at line 251 of file GaudiAlgs.py.

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

◆ _initialize_tuple_()

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

Definition at line 274 of file GaudiAlgs.py.

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

◆ _nTuple_()

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

Definition at line 1117 of file GaudiAlgs.py.

1117 def _nTuple_(s, *a):
1118  """
1119  Retrieve (book-on-demand) N-Tuple object
1120  """
1121  return TupleAlgDecorator.nTuple(s, *a)
1122 
1123 
1124 # =============================================================================
1125 
1126 

◆ _ntupleSvc()

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

Definition at line 453 of file GaudiAlgs.py.

453 def _ntupleSvc(self):
454  """
455  Trivial function to access N-Tuple Service
456  """
457  return self._ntupleSvc_
458 
459 
460 # =============================================================================
461 # Trivial helper function to access Event Collection Service
462 
463 
def _ntupleSvc(self)
Definition: GaudiAlgs.py:453

◆ _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 970 of file GaudiAlgs.py.

970 def _plot1D_(s, *a):
971  """
972  The basic method to fill (book-on-demand) 1D-histogram
973 
974  The histogram will be created/booked dautomatically according to the
975  specifications:
976 
977  - literal or numerical ID (optional)
978  - title
979  - low edge
980  - high edge
981  - number of bins (default is 100)
982 
983  The reference to the histogram is returned and could be used for later manipulations
984 
985  """
986  return HistoDecorator.plot1D(s, *a)
987 
988 
989 # =============================================================================
990 
991 
def _plot1D_(s, *a)
Definition: GaudiAlgs.py:970

◆ _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 992 of file GaudiAlgs.py.

992 def _plot2D_(s, *a):
993  """
994  The basic method to fill (book-on-demand) 2D-histogram
995 
996  The histogram will be created/booked dautomatically according to the
997  specifications:
998 
999  - literal or numerical ID (optional)
1000  - title
1001  - low X-edge
1002  - high X-edge
1003  - low Y-edge
1004  - high Y-edge
1005  - number of X-bins (default is 50)
1006  - number of Y-bins (default is 50)
1007 
1008  The reference to the histogram is returned and could be used for later manipulations
1009 
1010  """
1011  return HistoDecorator.plot2D(s, *a)
1012 
1013 
1014 # =============================================================================
1015 
1016 
def _plot2D_(s, *a)
Definition: GaudiAlgs.py:992

◆ _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 1017 of file GaudiAlgs.py.

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

◆ _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 1045 of file GaudiAlgs.py.

1045 def _profile1D_(s, *a):
1046  """
1047  The basic method to fill (book-on-demand) 1D profile histogram
1048 
1049  The profile histogram will be created/booked dautomatically
1050  according to the specifications:
1051 
1052  - literal or numerical ID (optional)
1053  - title
1054  - low X-edge
1055  - high X-edge
1056  - number of X-bins (default is 100)
1057 
1058  The reference to the histogram is returned and could be used for later manipulations
1059 
1060  """
1061  return HistoDecorator.profile1D(s, *a)
1062 
1063 
1064 # =============================================================================
1065 
1066 
def _profile1D_(s, *a)
Definition: GaudiAlgs.py:1045

◆ _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 1067 of file GaudiAlgs.py.

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

◆ _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 170 of file GaudiAlgs.py.

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

◆ _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 542 of file GaudiAlgs.py.

542 def _set_attr_(self, pname, pvalue):
543  """
544  Set the attribute (or property) :
545  - if the attribute name corresponds to the property name, the property is updated
546  """
547  if not self.hasProperty(pname):
548  self.__dict__[pname] = pvalue
549  else:
550  iAlgorithm.__setattr__(self, pname, pvalue)
551 
552 
def _set_attr_(self, pname, pvalue)
Definition: GaudiAlgs.py:542

◆ _setProperty_()

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

Definition at line 515 of file GaudiAlgs.py.

515 def _setProperty_(self, pname, pvalue):
516  """
517  Set the property from the value
518  """
519  if not self.hasProperty(pname):
520  raise AttributeError('property %s does not exist' % pname)
521  return iAlgorithm.__setattr__(self, pname, pvalue)
522 
523 
524 # =============================================================================
525 # get the attribute or property
526 
527 
def _setProperty_(self, pname, pvalue)
Definition: GaudiAlgs.py:515

◆ _start_()

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

Definition at line 929 of file GaudiAlgs.py.

929 def _start_(self):
930  """
931  The stub 'start' method needed by the internal implementation of PyAlg<>.
932  """
933  # return self._Base.start_(self)
934  return SUCCESS
935 
936 
937 GaudiAlgo.start = _start_
938 HistoAlgo.start = _start_
939 TupleAlgo.start = _start_
940 
941 

◆ _stop_()

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

Definition at line 955 of file GaudiAlgs.py.

955 def _stop_(self):
956  """
957  The stub 'stop' method needed by the internal implementation of PyAlg<>.
958  """
959  # return self._Base.stop_(self)
960  return SUCCESS
961 
962 
963 GaudiAlgo.stop = _stop_
964 HistoAlgo.stop = _stop_
965 TupleAlgo.stop = _stop_
966 
967 # =============================================================================
968 
969 

◆ _success_()

def GaudiPython.GaudiAlgs._success_ (   self)
private

Definition at line 485 of file GaudiAlgs.py.

485 def _success_(self):
486  return SUCCESS
487 
488 
489 # =============================================================================
490 # 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 1244 of file GaudiAlgs.py.

1244 def _t_array_(s, *a):
1245  """
1246  Fill the fixed-size array column
1247  """
1248  return _Dec.array(s, *a)
1249 
1250 
def _t_array_(s, *a)
Definition: GaudiAlgs.py:1244

◆ _t_column_()

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

Definition at line 1223 of file GaudiAlgs.py.

1223 def _t_column_(s, *a):
1224  """
1225  Fill the certain column to n-tuple
1226  """
1227  return _Dec.column(s, *a)
1228 
1229 
def _t_column_(s, *a)
Definition: GaudiAlgs.py:1223

◆ _t_column_ll_()

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

Definition at line 1230 of file GaudiAlgs.py.

1230 def _t_column_ll_(s, *a):
1231  """
1232  Fill the 'long long' column
1233  """
1234  return _Dec.column_ll(s, *a)
1235 
1236 
def _t_column_ll_(s, *a)
Definition: GaudiAlgs.py:1230

◆ _t_column_ull_()

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

Definition at line 1237 of file GaudiAlgs.py.

1237 def _t_column_ull_(s, *a):
1238  """
1239  Fill the 'unsigned long long' column
1240  """
1241  return _Dec.column_ull(s, *a)
1242 
1243 
def _t_column_ull_(s, *a)
Definition: GaudiAlgs.py:1237

◆ _t_farray_()

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

Definition at line 1258 of file GaudiAlgs.py.

1258 def _t_farray_(s, *a):
1259  """
1260  Fill the floating-size array column
1261  """
1262  return _Dec.farray(s, *a)
1263 
1264 
def _t_farray_(s, *a)
Definition: GaudiAlgs.py:1258

◆ _t_fmatrix_()

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

Definition at line 1265 of file GaudiAlgs.py.

1265 def _t_fmatrix_(s, *a):
1266  """
1267  Fill the floating-size matrix column
1268  """
1269  return _Dec.fmatrix(s, *a)
1270 
1271 
1272 _t_nTuple_.__doc__ += '\n' + _Dec.nTuple.__doc__
1273 _t_ntuple_.__doc__ += '\n' + _Dec.ntuple.__doc__
1274 _t_valid_.__doc__ += '\n' + _Dec.valid.__doc__
1275 _t_write_.__doc__ += '\n' + _Dec.write.__doc__
1276 _t_column_.__doc__ += '\n' + _Dec.column.__doc__
1277 _t_column_ll_.__doc__ += '\n' + _Dec.column_ll.__doc__
1278 _t_column_ull_.__doc__ += '\n' + _Dec.column_ull.__doc__
1279 _t_array_.__doc__ += '\n' + _Dec.array.__doc__
1280 _t_matrix_.__doc__ += '\n' + _Dec.matrix.__doc__
1281 _t_farray_.__doc__ += '\n' + _Dec.farray.__doc__
1282 _t_fmatrix_.__doc__ += '\n' + _Dec.fmatrix.__doc__
1283 
1284 Tuple.nTuple = _t_nTuple_
1285 Tuple.ntuple = _t_ntuple_
1286 Tuple.valid = _t_valid_
1287 Tuple.write = _t_write_
1288 Tuple.column = _t_column_
1289 Tuple.column_ll = _t_column_ll_
1290 Tuple.column_ull = _t_column_ull_
1291 Tuple.array = _t_array_
1292 Tuple.matrix = _t_matrix_
1293 Tuple.farray = _t_farray_
1294 Tuple.fmatrix = _t_fmatrix_
1295 
def _t_fmatrix_(s, *a)
Definition: GaudiAlgs.py:1265

◆ _t_matrix_()

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

Definition at line 1251 of file GaudiAlgs.py.

1251 def _t_matrix_(s, *a):
1252  """
1253  Fill the fixed-size matrix column
1254  """
1255  return _Dec.matrix(s, *a)
1256 
1257 
def _t_matrix_(s, *a)
Definition: GaudiAlgs.py:1251

◆ _t_nTuple_()

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

Definition at line 1195 of file GaudiAlgs.py.

1195 def _t_nTuple_(s, *a):
1196  """
1197  Access to underlying INTuple object
1198  """
1199  return _Dec.nTuple(s, *a)
1200 
1201 
def _t_nTuple_(s, *a)
Definition: GaudiAlgs.py:1195

◆ _t_ntuple_()

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

Definition at line 1202 of file GaudiAlgs.py.

1202 def _t_ntuple_(s, *a):
1203  """
1204  Access to underlying NTuple::Tuple object
1205  """
1206  return _Dec.ntuple(s, *a)
1207 
1208 
def _t_ntuple_(s, *a)
Definition: GaudiAlgs.py:1202

◆ _t_valid_()

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

Definition at line 1209 of file GaudiAlgs.py.

1209 def _t_valid_(s, *a):
1210  """
1211  Valid NTuple::Tuple object?
1212  """
1213  return _Dec.valid(s, *a)
1214 
1215 
def _t_valid_(s, *a)
Definition: GaudiAlgs.py:1209

◆ _t_write_()

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

Definition at line 1216 of file GaudiAlgs.py.

1216 def _t_write_(s, *a):
1217  """
1218  Commit the row/record to n-tuple
1219  """
1220  return _Dec.write(s, *a)
1221 
1222 
def _t_write_(s, *a)
Definition: GaudiAlgs.py:1216

◆ _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 119 of file GaudiAlgs.py.

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

◆ _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 1383 of file GaudiAlgs.py.

1383 def _Tools_a_(self):
1384  """
1385  Retrieve the list of tools,
1386  aquired by component through GaudiCommon<TYPE> base:
1387 
1388  >>> alg = ... ## get the algorithm
1389  >>> tools = alg.Tools() ## get the tools
1390  >>> for tool in tools :
1391  ... print tool
1392 
1393  """
1394  _cmp = getattr(self, '_ialg')
1395  if not _cmp:
1396  self.retrieveInterface()
1397  _cmp = getattr(self, '_ialg')
1398  return _get_all_tools_(_cmp, '_tools_a_')
1399 
1400 
1401 # =============================================================================
1402 
1403 
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1365

◆ _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 1404 of file GaudiAlgs.py.

1404 def _Tools_t_(self):
1405  """
1406  Retrieve the list of tools,
1407  aquired by component through GaudiCommon<TYPE> base:
1408 
1409  >>> tool = ... ## get the tool
1410  >>> tools = tool.Tools() ## get the tools
1411  >>> for t in tools :
1412  ... print t
1413 
1414  """
1415  _cmp = getattr(self, '_itool')
1416  if not _cmp:
1417  self.retrieveInterface()
1418  _cmp = getattr(self, '_itool')
1419  return _get_all_tools_(_cmp, '_tools_t_')
1420 
1421 
1422 # =============================================================================
1423 # get the list of counters
1424 # =============================================================================
1425 # get all counters
def _get_all_tools_(self, method)
Definition: GaudiAlgs.py:1365

◆ mapvct()

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

Definition at line 1343 of file GaudiAlgs.py.

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

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

◆ __author__

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

Definition at line 38 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  'beginRun': _success_, # dummy function returning success
16  'endRun': _success_, # dummy function returning success
17  #
18  'hasProperty':
19  _hasProperty_, # check the existence of property with given name
20  'getProperty': _getProperty_, # get the property value with given name
21  'setProperty': _setProperty_, # set the property with given name
22  '__setattr__': _set_attr_, # set the attribute/property with given name
23  '__getattr__': _get_attr_ # set the attribute/property with given name
24 }

Definition at line 1296 of file GaudiAlgs.py.

◆ _Dec

GaudiPython.GaudiAlgs._Dec = TupleDecorator
private

Definition at line 1159 of file GaudiAlgs.py.

◆ _detSvc_

GaudiPython.GaudiAlgs._detSvc_
private

Definition at line 239 of file GaudiAlgs.py.

◆ _evtcolSvc_

GaudiPython.GaudiAlgs._evtcolSvc_
private

Definition at line 291 of file GaudiAlgs.py.

◆ _evtSvc_

GaudiPython.GaudiAlgs._evtSvc_
private

Definition at line 235 of file GaudiAlgs.py.

◆ _GaudiAlgorithm

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

Definition at line 553 of file GaudiAlgs.py.

◆ _GaudiHistoAlg

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

Definition at line 554 of file GaudiAlgs.py.

◆ _GaudiTupleAlg

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

Definition at line 555 of file GaudiAlgs.py.

◆ _histoSvc_

GaudiPython.GaudiAlgs._histoSvc_
private

Definition at line 262 of file GaudiAlgs.py.

◆ _ntupleSvc_

GaudiPython.GaudiAlgs._ntupleSvc_
private

Definition at line 286 of file GaudiAlgs.py.

◆ AlgDecorator

GaudiPython.GaudiAlgs.AlgDecorator = cpp.GaudiPython.AlgDecorator

Definition at line 88 of file GaudiAlgs.py.

◆ column

GaudiPython.GaudiAlgs.column

Definition at line 1192 of file GaudiAlgs.py.

◆ HID

GaudiPython.GaudiAlgs.HID = cpp.GaudiAlg.ID

Definition at line 82 of file GaudiAlgs.py.

◆ HistoDecorator

GaudiPython.GaudiAlgs.HistoDecorator = cpp.GaudiPython.HistoDecorator

Definition at line 89 of file GaudiAlgs.py.

◆ HistoID

GaudiPython.GaudiAlgs.HistoID = HID

Definition at line 83 of file GaudiAlgs.py.

◆ iAlgorithm

GaudiPython.GaudiAlgs.iAlgorithm = GaudiPython.Bindings.iAlgorithm

Definition at line 55 of file GaudiAlgs.py.

◆ iAlgTool

GaudiPython.GaudiAlgs.iAlgTool = GaudiPython.Bindings.iAlgTool

Definition at line 56 of file GaudiAlgs.py.

◆ Matrix

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

Definition at line 79 of file GaudiAlgs.py.

◆ std

GaudiPython.GaudiAlgs.std = cpp.std

Definition at line 74 of file GaudiAlgs.py.

◆ TID

GaudiPython.GaudiAlgs.TID = HID

Definition at line 84 of file GaudiAlgs.py.

◆ Tuple

GaudiPython.GaudiAlgs.Tuple = cpp.Tuples.Tuple

Definition at line 1158 of file GaudiAlgs.py.

◆ TupleAlgDecorator

GaudiPython.GaudiAlgs.TupleAlgDecorator = cpp.GaudiPython.TupleAlgDecorator

Definition at line 90 of file GaudiAlgs.py.

◆ TupleDecorator

GaudiPython.GaudiAlgs.TupleDecorator = cpp.GaudiPython.TupleDecorator

Definition at line 91 of file GaudiAlgs.py.

◆ TupleID

GaudiPython.GaudiAlgs.TupleID = TID

Definition at line 85 of file GaudiAlgs.py.

◆ Vector

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

Definition at line 77 of file GaudiAlgs.py.