| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Classes | Functions | Variables
GaudiPython.HistoUtils Namespace Reference

## Classes
class | HistoFile

## Functions
def | _getAppMgr (kwargs)
| Helper private auxiliary function to get Application Manager. More...
def | _getHistoSvc (kwargs)
| Helper private auxiliary function to get iHistogramSvs. More...
def | _getEvtSvc (kwargs)
| Helper private auxiliary function to get iDataSvs. More...
def | book (args, kwargs)
| The trivial function to book the various 1D,2D&3D-histograms. More...
def | bookProf (args, kwargs)
| The trivial function to book 1D&2D profile histograms: More...
def | getAsAIDA (path, kwargs)
| The most trivial function to retrieve the histogram from Histogram Transient Store. More...
def | getAsROOT (path, kwargs)
| The most trivial function to retrieve the histogram from Histogram Transient Store. More...
def | fill (histo, data, fun=lambda x:x, cut=lambda x:True, kwargs)
| The function which allows 'the smart fill' of 1D-histogram. More...
def | _to_root_ (self)
| Convert AIDA to ROOT. More...
def | _moment_
| Evaluate 'bin-by-bin' momentum of certain order around the value. More...
def | _momentErr_ (self, order)
| Evaluate error in 'bin-by-bin' momentum of certain order around the value. More...
def | _centralMoment_ (self, order)
| Evaluate 'bin-by-bin' central momentum (around mean value) More...
def | _centralMomentErr_ (self, order)
| Evaluate error in 'bin-by-bin' momentum of certain order around the value. More...
def | _skewness_ (self)
| Evaluate 'bin-by-bin' skewness for 1D histogram. More...
def | _skewnessErr_ (self)
| Evaluate error for 'bin-by-bin' skewness for 1D histogram. More...
def | _kurtosis_ (self)
| Evaluate 'bin-by-bin' kurtosis for 1D histogram. More...
def | _kurtosisErr_ (self)
| Evaluate error for 'bin-by-bin' kurtosis for 1D histogram. More...
def | _nEff_ (self)
def | _mean_ (self)
def | _meanErr_ (self)
def | _rms_ (self)
def | _rmsErr_ (self)
def | _sumBinHeightErr_ (self)
def | _sumAllBinHeightErr_ (self)
def | _overflowEntriesFrac_ (self)
def | _overflowEntriesFracErr_ (self)
def | _underflowEntriesFrac_ (self)
def | _underflowEntriesFracErr_ (self)
def | _overflowIntegralFrac_ (self)
def | _overflowIntegralFracErr_ (self)
def | _underflowIntegralFrac_ (self)
def | _underflowIntegralFracErr_ (self)
def | _nEntries_
| get number of entries in histogram up to the certain bin (not-included) get number of entries in histogram form the certain minimal bin up to the certain maximal bin (not-included) More...
def | _nEntriesFrac_
def | _nEntriesFracErr_
def | _path_ (self)
| ============================================================================ More...
def | __dumpHisto__ (histo, args)
| ============================================================================= More...

## Variables
string | __author__ = "Vanya BELYAEV ibelyaev@physics.syr.edu"
| This module contains set of simple and useful utilities for booking and manipulations with Gaudi-AIDA histograms, inspired by Thomas' request. More...
tuple | __all__
| HID = cpp.GaudiAlg.ID
| useROOT = False
| global flag More...
| aida2root = cpp.Gaudi.Utils.Aida2ROOT.aida2root
| AIDA -> ROOT converter. More...
| HistoStats = cpp.Gaudi.Utils.HistoStats
| i1DH = cpp.AIDA.IHistogram1D
| iBH = cpp.AIDA.IBaseHistogram
| histoDump = __dumpHisto__
| the actual function for text dump of the histogram More...
| dumpHisto = __dumpHisto__

## Function Documentation

def GaudiPython.HistoUtils.__dumpHisto__ | ( |  | histo,
|  |  | args
| ) |  |

=============================================================================

    Dump the histogram/profile in text format (a'la HBOOK)

    >>> histo
    >>> print dumpHisto ( histo )

    >>> print histo.dump()
    >>> print histo.dump( 20 , 20 )
    >>> print histo.dump( 20 , 20 , True )

    Uses:

Definition at line 778 of file HistoUtils.py.

778 def __dumpHisto__ ( histo , *args ) :
779 """
780
781 Dump the histogram/profile in text format (a'la HBOOK)
782
783 >>> histo
784 >>> print dumpHisto ( histo )
785
786 >>> print histo.dump()
787 >>> print histo.dump( 20 , 20 )
788 >>> print histo.dump( 20 , 20 , True )
789
790 Uses:
791
792 """
793 return cpp.Gaudi.Utils.Histos.histoDump ( histo , *args )
794
GaudiPython.HistoUtils.__dumpHisto__
def __dumpHisto__(histo, args)
=============================================================================
Definition: HistoUtils.py:778

def GaudiPython.HistoUtils._centralMoment_ | ( |  | self,
|  |  | order
| ) |  |
| private

Evaluate 'bin-by-bin' central momentum (around mean value)

    Evaluate 'bin-by-bin' central momentum (around mean value)
    for 1D histogram

    >>> h1 = ...
    >>> print h1.centralMoment ( 5 )

Definition at line 502 of file HistoUtils.py.

502 def _centralMoment_ ( self , order ) :
503 """
504 Evaluate 'bin-by-bin' central momentum (around mean value)
505 for 1D histogram
506
507 >>> h1 = ...
508 >>> print h1.centralMoment ( 5 )
509
510 """
511 return HistoStats.centralMoment ( self , order )
512
513 # =============================================================================
GaudiPython.HistoUtils._centralMoment_
def _centralMoment_(self, order)
Evaluate 'bin-by-bin' central momentum (around mean value)
Definition: HistoUtils.py:502

def GaudiPython.HistoUtils._centralMomentErr_ | ( |  | self,
|  |  | order
| ) |  |
| private

Evaluate error in 'bin-by-bin' momentum of certain order around the value.

    Evaluate error for 'bin-by-bin' central momentum (around mean value)
    for 1D histogram

    >>> h1 = ...
    >>> print h1.centralMomentErr ( 5 )

Definition at line 515 of file HistoUtils.py.

515 def _centralMomentErr_ ( self , order ) :
516 """
517 Evaluate error for 'bin-by-bin' central momentum (around mean value)
518 for 1D histogram
519
520 >>> h1 = ...
521 >>> print h1.centralMomentErr ( 5 )
522
523 """
524 return HistoStats.centralMomentErr ( self , order )
525
526 # =============================================================================
GaudiPython.HistoUtils._centralMomentErr_
def _centralMomentErr_(self, order)
Evaluate error in 'bin-by-bin' momentum of certain order around the value.
Definition: HistoUtils.py:515

def GaudiPython.HistoUtils._getAppMgr | ( |  | kwargs | ) |
| private

Helper private auxiliary function to get Application Manager.

    Helper private auxiliary function to get Application Manager

Definition at line 54 of file HistoUtils.py.

54 def _getAppMgr ( **kwargs ) :
55 """
56 Helper private auxiliary function to get Application Manager
57 """
58 gaudi = kwargs.get ( 'gaudi' , None )
59 if not gaudi : gaudi = AppMgr()
60 if not gaudi : raise RuntimeError, 'Unable to get valid ApplicationMgr'
61
62 state = gaudi._isvc.FSMState()
63 if state < cpp.Gaudi.StateMachine.CONFIGURED : gaudi.config ()
64 state = gaudi._isvc.FSMState()
65 if state < cpp.Gaudi.StateMachine.INITIALIZED : gaudi.initialize ()
66
67 return gaudi ## RETURN
68
69 # =============================================================================
GaudiPython.HistoUtils._getAppMgr
def _getAppMgr(kwargs)
Helper private auxiliary function to get Application Manager.
Definition: HistoUtils.py:54
GaudiPython.Bindings.AppMgr
Definition: Bindings.py:653

def GaudiPython.HistoUtils._getEvtSvc | ( |  | kwargs | ) |
| private

Helper private auxiliary function to get iDataSvs.

    Helper private auxiliary function to get iDataSvs

Definition at line 83 of file HistoUtils.py.

83 def _getEvtSvc ( **kwargs ) :
84 """
85 Helper private auxiliary function to get iDataSvs
86 """
87 svc = kwargs.get ( 'service' , None )
88 if not svc : svc = kwargs.get ( 'svc' , None )
89 else : return svc ## RETURN
90 gaudi = _getAppMgr ( **kwargs )
91 return gaudi.evtsvc() ## RETURN
92
93 # =============================================================================
GaudiPython.HistoUtils._getEvtSvc
def _getEvtSvc(kwargs)
Helper private auxiliary function to get iDataSvs.
Definition: HistoUtils.py:83

def GaudiPython.HistoUtils._getHistoSvc | ( |  | kwargs | ) |
| private

Helper private auxiliary function to get iHistogramSvs.

    Helper private auxiliary function to get iHistogramSvs

Definition at line 71 of file HistoUtils.py.

71 def _getHistoSvc ( **kwargs ) :
72 """
73 Helper private auxiliary function to get iHistogramSvs
74 """
75 svc = kwargs.get ( 'service' , None )
76 if not svc : svc = kwargs.get ( 'svc' , None )
77 else : return svc ## RETURN
78 gaudi = _getAppMgr ( **kwargs )
79 return gaudi.histsvc () ## RETURN
80
81 # =============================================================================
GaudiPython.HistoUtils._getHistoSvc
def _getHistoSvc(kwargs)
Helper private auxiliary function to get iHistogramSvs.
Definition: HistoUtils.py:71

def GaudiPython.HistoUtils._kurtosis_ | ( |  | self | ) |
| private

Evaluate 'bin-by-bin' kurtosis for 1D histogram.

    Evaluate 'bin-by-bin' kurtosis

    >>> h1 = ...
    >>> print h1.kurtosis ()

Definition at line 552 of file HistoUtils.py.

552 def _kurtosis_ ( self ) :
553 """
554 Evaluate 'bin-by-bin' kurtosis
555
556 >>> h1 = ...
557 >>> print h1.kurtosis ()
558
559 """
560 return HistoStats.kurtosis ( self )
561
562 # =============================================================================
GaudiPython.HistoUtils._kurtosis_
def _kurtosis_(self)
Evaluate 'bin-by-bin' kurtosis for 1D histogram.
Definition: HistoUtils.py:552

def GaudiPython.HistoUtils._kurtosisErr_ | ( |  | self | ) |
| private

Evaluate error for 'bin-by-bin' kurtosis for 1D histogram.

    Evaluate error for 'bin-by-bin' kurtotis for 1D AIDA histogram

    >>> h1 = ...
    >>> print h1.kurtotisErr()

Definition at line 564 of file HistoUtils.py.

564 def _kurtosisErr_ ( self ) :
565 """
566 Evaluate error for 'bin-by-bin' kurtotis for 1D AIDA histogram
567
568 >>> h1 = ...
569 >>> print h1.kurtotisErr()
570
571 """
572 return HistoStats.kurtosisErr ( self )
573
574 # =============================================================================
GaudiPython.HistoUtils._kurtosisErr_
def _kurtosisErr_(self)
Evaluate error for 'bin-by-bin' kurtosis for 1D histogram.
Definition: HistoUtils.py:564

def GaudiPython.HistoUtils._mean_ | ( |  | self | ) |
| private

    Evaluate the MEAN value

Definition at line 581 of file HistoUtils.py.

581 def _mean_ ( self ) :
582 """
583 Evaluate the MEAN value
584 """
585 return HistoStats.mean ( self )
586 # =============================================================================
GaudiPython.HistoUtils._mean_
def _mean_(self)
Definition: HistoUtils.py:581

def GaudiPython.HistoUtils._meanErr_ | ( |  | self | ) |
| private

    Evaluate the error for MEAN estimate

Definition at line 587 of file HistoUtils.py.

587 def _meanErr_ ( self ) :
588 """
589 Evaluate the error for MEAN estimate
590 """
591 return HistoStats.meanErr ( self )
592
593 # =============================================================================
GaudiPython.HistoUtils._meanErr_
def _meanErr_(self)
Definition: HistoUtils.py:587

def GaudiPython.HistoUtils._moment_ | ( |  | self,
|  |  | order,
|  |  | value = `0`
| ) |  |
| private

Evaluate 'bin-by-bin' momentum of certain order around the value.

    Evaluate 'bin-by-bin' momentum of order 'order' around the value 'value'
    for 1D histogram

    >>> h1 = ...
    >>> print h1.moment ( 5 )

Definition at line 477 of file HistoUtils.py.

477 def _moment_ ( self , order , value = 0 ) :
478 """
479 Evaluate 'bin-by-bin' momentum of order 'order' around the value 'value'
480 for 1D histogram
481
482 >>> h1 = ...
483 >>> print h1.moment ( 5 )
484
485 """
486 return HistoStats.moment ( self , order , value )
487
488 # =============================================================================
GaudiPython.HistoUtils._moment_
def _moment_
Evaluate 'bin-by-bin' momentum of certain order around the value.
Definition: HistoUtils.py:477

def GaudiPython.HistoUtils._momentErr_ | ( |  | self,
|  |  | order
| ) |  |
| private

Evaluate error in 'bin-by-bin' momentum of certain order around the value.

    Evaluate error for 'bin-by-bin' momentum of order 'order' around the value 'value'
    for 1D histogram

    >>> h1 = ...
    >>> print h1.momentErr ( 5 )

Definition at line 490 of file HistoUtils.py.

490 def _momentErr_ ( self , order ) :
491 """
492 Evaluate error for 'bin-by-bin' momentum of order 'order' around the value 'value'
493 for 1D histogram
494
495 >>> h1 = ...
496 >>> print h1.momentErr ( 5 )
497
498 """
499 return HistoStats.momentErr ( self , order )
500 # =============================================================================
GaudiPython.HistoUtils._momentErr_
def _momentErr_(self, order)
Evaluate error in 'bin-by-bin' momentum of certain order around the value.
Definition: HistoUtils.py:490

def GaudiPython.HistoUtils._nEff_ | ( |  | self | ) |
| private

    Number of equivalent entries

Definition at line 575 of file HistoUtils.py.

575 def _nEff_ ( self ) :
576 """
577 Number of equivalent entries
578 """
579 return HistoStats.nEff ( self )
580 # =============================================================================
GaudiPython.HistoUtils._nEff_
def _nEff_(self)
Definition: HistoUtils.py:575

def GaudiPython.HistoUtils._nEntries_ | ( |  | self,
|  |  | i1,
|  |  | i2 = `-10000000`
| ) |  |
| private

get number of entries in histogram up to the certain bin (not-included) get number of entries in histogram form the certain minimal bin up to the certain maximal bin (not-included)

    Get number of entries in histogram up to  the certain bin (not-included)

    attention: underflow bin is included!

    >>> h1
    >>> print h1.nEntries ( 10 )

    Get number of entries in histogram form the certain
    minimal bin up to the certain maximal bin (not-included)

    >>> h1
    >>> print h1.nEntries ( 10 , 15 )

Definition at line 672 of file HistoUtils.py.

672 def _nEntries_ ( self , i1 , i2 = -10000000 ) :
673 """
674 Get number of entries in histogram up to the certain bin (not-included)
675
676 attention: underflow bin is included!
677
678 >>> h1
679 >>> print h1.nEntries ( 10 )
680
681 Get number of entries in histogram form the certain
682 minimal bin up to the certain maximal bin (not-included)
683
684 >>> h1
685 >>> print h1.nEntries ( 10 , 15 )
686
687 """
688 if i2 < i1 or i2 < 0 : return HistoStats.nEntries ( self , i1 )
689 return HistoStats.nEntries ( self , i1 , i2 )
690 # =============================================================================
GaudiPython.HistoUtils._nEntries_
def _nEntries_
get number of entries in histogram up to the certain bin (not-included) get number of entries in hist...
Definition: HistoUtils.py:672

def GaudiPython.HistoUtils._nEntriesFrac_ | ( |  | self,
|  |  | i1,
|  |  | i2 = `-10000000`
| ) |  |
| private

    Get the fraction of entries in histogram up to  the certain bin (not-included)

    attention: underflow bin is included!

    >>> h1
    >>> print h1.nEntriesFrac ( 10 )

    Get the fraction of entries in histogram form the certain
    minimal bin up to the certain maximal bin (not-included)

    >>> h1
    >>> print h1.nEntriesFrac ( 10 , 15 )

Definition at line 691 of file HistoUtils.py.

691 def _nEntriesFrac_ ( self , i1 , i2 = -10000000 ) :
692 """
693 Get the fraction of entries in histogram up to the certain bin (not-included)
694
695 attention: underflow bin is included!
696
697 >>> h1
698 >>> print h1.nEntriesFrac ( 10 )
699
700 Get the fraction of entries in histogram form the certain
701 minimal bin up to the certain maximal bin (not-included)
702
703 >>> h1
704 >>> print h1.nEntriesFrac ( 10 , 15 )
705
706 """
707 if i2 < i1 or i2 < 0 : return HistoStats.nEntriesFrac ( self , i1 )
708 return HistoStats.nEntriesFrac ( self , i1 , i2 )
709 # =============================================================================
GaudiPython.HistoUtils._nEntriesFrac_
def _nEntriesFrac_
Definition: HistoUtils.py:691

def GaudiPython.HistoUtils._nEntriesFracErr_ | ( |  | self,
|  |  | i1,
|  |  | i2 = `-10000000`
| ) |  |
| private

    Get error for  fraction of entries in histogram up to  the certain bin (not-included)

    attention: underflow bin is included!

    >>> h1
    >>> print h1.nEntriesFracErr( 10 )

    Get error  fraction of entries in histogram form the certain
    minimal bin up to the certain maximal bin (not-included)

    >>> h1
    >>> print h1.nEntriesFracErr ( 10 , 15 )

Definition at line 710 of file HistoUtils.py.

710 def _nEntriesFracErr_ ( self , i1 , i2 = -10000000 ) :
711 """
712 Get error for fraction of entries in histogram up to the certain bin (not-included)
713
714 attention: underflow bin is included!
715
716 >>> h1
717 >>> print h1.nEntriesFracErr( 10 )
718
719 Get error fraction of entries in histogram form the certain
720 minimal bin up to the certain maximal bin (not-included)
721
722 >>> h1
723 >>> print h1.nEntriesFracErr ( 10 , 15 )
724
725 """
726 if i2 < i1 or i2 < 0 : return HistoStats.nEntriesFracErr ( self , i1 )
727 return HistoStats.nEntriesFracErr ( self , i1 , i2 )
728
729 # =============================================================================
GaudiPython.HistoUtils._nEntriesFracErr_
def _nEntriesFracErr_
Definition: HistoUtils.py:710

def GaudiPython.HistoUtils._overflowEntriesFrac_ | ( |  | self | ) |
| private

    The fraction of overflow entries  (useful for shape comparison)

Definition at line 619 of file HistoUtils.py.

619 def _overflowEntriesFrac_ ( self ) :
620 """
621 The fraction of overflow entries (useful for shape comparison)
622 """
623 return HistoStats.overflowEntriesFrac ( self )
624 # =============================================================================
GaudiPython.HistoUtils._overflowEntriesFrac_
def _overflowEntriesFrac_(self)
Definition: HistoUtils.py:619

def GaudiPython.HistoUtils._overflowEntriesFracErr_ | ( |  | self | ) |
| private

    The error for fraction of overflow entries  (useful for shape comparison)

Definition at line 625 of file HistoUtils.py.

625 def _overflowEntriesFracErr_ ( self ) :
626 """
627 The error for fraction of overflow entries (useful for shape comparison)
628 """
629 return HistoStats.overflowEntriesFracErr ( self )
630 # =============================================================================
GaudiPython.HistoUtils._overflowEntriesFracErr_
def _overflowEntriesFracErr_(self)
Definition: HistoUtils.py:625

def GaudiPython.HistoUtils._overflowIntegralFrac_ | ( |  | self | ) |
| private

    The fraction of overflow integral  (useful for shape comparison)

Definition at line 644 of file HistoUtils.py.

644 def _overflowIntegralFrac_ ( self ) :
645 """
646 The fraction of overflow integral (useful for shape comparison)
647 """
648 return HistoStats.overflowIntegralFrac ( self )
649 # =============================================================================
GaudiPython.HistoUtils._overflowIntegralFrac_
def _overflowIntegralFrac_(self)
Definition: HistoUtils.py:644

def GaudiPython.HistoUtils._overflowIntegralFracErr_ | ( |  | self | ) |
| private

    The error for fraction of overflow integral  (useful for shape comparison)

Definition at line 650 of file HistoUtils.py.

650 def _overflowIntegralFracErr_ ( self ) :
651 """
652 The error for fraction of overflow integral (useful for shape comparison)
653 """
654 return HistoStats.overflowIntegralFracErr ( self )
655 # =============================================================================
GaudiPython.HistoUtils._overflowIntegralFracErr_
def _overflowIntegralFracErr_(self)
Definition: HistoUtils.py:650

def GaudiPython.HistoUtils._path_ | ( |  | self | ) |
| private

============================================================================

    Get the path in THS for the given AIDA object:

    >>> aida =
    >>> print aida.path()

Definition at line 761 of file HistoUtils.py.

761 def _path_ ( self ) :
762 """
763 Get the path in THS for the given AIDA object:
764
765 >>> aida =
766 >>> print aida.path()
767
768 """
769 return cpp.Gaudi.Utils.Histos.path ( self )
770
GaudiPython.HistoUtils._path_
def _path_(self)
============================================================================
Definition: HistoUtils.py:761

def GaudiPython.HistoUtils._rms_ | ( |  | self | ) |
| private

    Evaluate the RMS for AIDA histogram

Definition at line 594 of file HistoUtils.py.

594 def _rms_ ( self ) :
595 """
596 Evaluate the RMS for AIDA histogram
597 """
598 return HistoStats.rms ( self )
599 # =============================================================================
GaudiPython.HistoUtils._rms_
def _rms_(self)
Definition: HistoUtils.py:594

def GaudiPython.HistoUtils._rmsErr_ | ( |  | self | ) |
| private

    Evaluate the error for RMS estimate

Definition at line 600 of file HistoUtils.py.

600 def _rmsErr_ ( self ) :
601 """
602 Evaluate the error for RMS estimate
603 """
604 return HistoStats.rmsErr ( self )
605
606 # =============================================================================
GaudiPython.HistoUtils._rmsErr_
def _rmsErr_(self)
Definition: HistoUtils.py:600

def GaudiPython.HistoUtils._skewness_ | ( |  | self | ) |
| private

Evaluate 'bin-by-bin' skewness for 1D histogram.

    Evaluate 'bin-by-bin' skewness for 1D AIDA histogram

    >>> h1 = ...
    >>> print h1.skewness()

Definition at line 528 of file HistoUtils.py.

528 def _skewness_ ( self ) :
529 """
530 Evaluate 'bin-by-bin' skewness for 1D AIDA histogram
531
532 >>> h1 = ...
533 >>> print h1.skewness()
534
535 """
536 return HistoStats.skewness ( self )
537
538 # =============================================================================
GaudiPython.HistoUtils._skewness_
def _skewness_(self)
Evaluate 'bin-by-bin' skewness for 1D histogram.
Definition: HistoUtils.py:528

def GaudiPython.HistoUtils._skewnessErr_ | ( |  | self | ) |
| private

Evaluate error for 'bin-by-bin' skewness for 1D histogram.

    Evaluate error for 'bin-by-bin' skewness

    >>> h1 = ...
    >>> print h1.skewnessErr()

Definition at line 540 of file HistoUtils.py.

540 def _skewnessErr_ ( self ) :
541 """
542 Evaluate error for 'bin-by-bin' skewness
543
544 >>> h1 = ...
545 >>> print h1.skewnessErr()
546
547 """
548 return HistoStats.skewnessErr ( self )
549
550 # =============================================================================
GaudiPython.HistoUtils._skewnessErr_
def _skewnessErr_(self)
Evaluate error for 'bin-by-bin' skewness for 1D histogram.
Definition: HistoUtils.py:540

def GaudiPython.HistoUtils._sumAllBinHeightErr_ | ( |  | self | ) |
| private

    Get an error in the sum bin height ('in-range integral')

Definition at line 614 of file HistoUtils.py.

614 def _sumAllBinHeightErr_ ( self ) :
615 """ Get an error in the sum bin height ('in-range integral') """
616 return HistoStats.sumAllBinHeightErr ( self )
617
618 # =============================================================================
GaudiPython.HistoUtils._sumAllBinHeightErr_
def _sumAllBinHeightErr_(self)
Definition: HistoUtils.py:614

def GaudiPython.HistoUtils._sumBinHeightErr_ | ( |  | self | ) |
| private

    Get an error in the sum bin height ('in-range integral')

Definition at line 607 of file HistoUtils.py.

607 def _sumBinHeightErr_ ( self ) :
608 """
609 Get an error in the sum bin height ('in-range integral')
610 """
611 return HistoStats.sumBinHeightErr ( self )
612
613 # =============================================================================
GaudiPython.HistoUtils._sumBinHeightErr_
def _sumBinHeightErr_(self)
Definition: HistoUtils.py:607

def GaudiPython.HistoUtils._to_root_ | ( |  | self | ) |
| private

Convert AIDA to ROOT.

    Convert AIDA to ROOT

    >>> aida = ...            ## get AIDA histogram
    >>> root = aida.toROOT()  ## convert it to ROOT

Definition at line 445 of file HistoUtils.py.

445 def _to_root_ ( self ) :
446 """
447 Convert AIDA to ROOT
448
449 >>> aida = ... ## get AIDA histogram
450 >>> root = aida.toROOT() ## convert it to ROOT
451
452 """
453 return aida2root ( self )
454
GaudiPython.HistoUtils._to_root_
def _to_root_(self)
Convert AIDA to ROOT.
Definition: HistoUtils.py:445

def GaudiPython.HistoUtils._underflowEntriesFrac_ | ( |  | self | ) |
| private

    The fraction of underflow entries  (useful for shape comparison)

Definition at line 631 of file HistoUtils.py.

631 def _underflowEntriesFrac_ ( self ) :
632 """
633 The fraction of underflow entries (useful for shape comparison)
634 """
635 return HistoStats.underflowEntriesFrac ( self )
636 # =============================================================================
GaudiPython.HistoUtils._underflowEntriesFrac_
def _underflowEntriesFrac_(self)
Definition: HistoUtils.py:631

def GaudiPython.HistoUtils._underflowEntriesFracErr_ | ( |  | self | ) |
| private

    The error for fraction of underflow entries  (useful for shape comparison)

Definition at line 637 of file HistoUtils.py.

637 def _underflowEntriesFracErr_ ( self ) :
638 """
639 The error for fraction of underflow entries (useful for shape comparison)
640 """
641 return HistoStats.underflowEntriesFracErr ( self )
642
643 # =============================================================================
GaudiPython.HistoUtils._underflowEntriesFracErr_
def _underflowEntriesFracErr_(self)
Definition: HistoUtils.py:637

def GaudiPython.HistoUtils._underflowIntegralFrac_ | ( |  | self | ) |
| private

    The fraction of underflow integral  (useful for shape comparison)

Definition at line 656 of file HistoUtils.py.

656 def _underflowIntegralFrac_ ( self ) :
657 """
658 The fraction of underflow integral (useful for shape comparison)
659 """
660 return HistoStats.underflowIntegralFrac ( self )
661 # =============================================================================
GaudiPython.HistoUtils._underflowIntegralFrac_
def _underflowIntegralFrac_(self)
Definition: HistoUtils.py:656

def GaudiPython.HistoUtils._underflowIntegralFracErr_ | ( |  | self | ) |
| private

    The error for fraction of underflow integral (useful for shape comparison)

Definition at line 662 of file HistoUtils.py.

662 def _underflowIntegralFracErr_ ( self ) :
663 """
664 The error for fraction of underflow integral (useful for shape comparison)
665 """
666 return HistoStats.underflowIntegralFracErr ( self )
667
668 # =============================================================================
GaudiPython.HistoUtils._underflowIntegralFracErr_
def _underflowIntegralFracErr_(self)
Definition: HistoUtils.py:662

def GaudiPython.HistoUtils.book | ( |  | args,
|  |  | kwargs
| ) |  |

The trivial function to book the various 1D,2D&3D-histograms.

    The trivial function to book the various 1D,2D&3D-histograms

    (1) book the trivial 1D histogram with full path

    >>> h1D = book ( 'path/to/my/histo'       , ## path in Histogram Transient Store
                     'cosine of decay angle ' , ## histogram title
                      100                     , ## number of bins
                      -1                      , ## low edge
                      100                     ) ## high edge

    (2) book the trivial 1D histogram with directory path and string ID :

    >>> h1D = book ( 'path/to/directory'      , ## the path to directory in HTS
                     'H1'                     , ## string histogram identifier
                     'cosine of decay angle ' , ## histogram title
                      100                     , ## number of bins
                      -1                      , ## low edge
                      100                     ) ## high edge

    (3) book the trivial 1D histogram with directory path and integer ID :

    >>> h1D = book ( 'path/to/directory'      , ## the path to directory in HTS
                     124                      , ## integer histogram identifier
                     'cosine of decay angle ' , ## histogram title
                      100                     , ## number of bins
                      -1                      , ## low edge
                      100                     ) ## high edge

    (4) book the trivial 2D histogram with full path

    >>> h1D = book ( 'path/to/my/histo'       , ## path in Histogram Transient Store
                     'm12**2 versus m13**2'   , ## histogram title
                      50                      , ## number of X-bins
                      1.0                     , ## low X-edge
                      4.0                     , ## high X-edge
                      50                      , ## number of Y-bins
                      1                       , ## low Y-edge
                      2                       ) ## high Y-edge

    (5) book the trivial 2D histogram with directory path and literal ID

    >>> h1D = book ( 'path/to/directory'      , ## path in Histogram Transient Store
                     'Dalitz1'                , ## literal histogram identifier
                     'm12**2 versus m13**2'   , ## histogram title
                      50                      , ## number of X-bins
                      1.0                     , ## low X-edge
                      4.0                     , ## high X-edge
                      50                      , ## number of Y-bins
                      1                       , ## low Y-edge
                      2                       ) ## high Y-edge

    (6) book the trivial 2D histogram with directory path and integer ID

    >>> h1D = book ( 'path/to/directory'      , ## path in Histogram Transient Store
                     854                      , ## integer histogram identifier
                     'm12**2 versus m13**2'   , ## histogram title
                      50                      , ## number of X-bins
                      1.0                     , ## low X-edge
                      4.0                     , ## high X-edge
                      50                      , ## number of Y-bins
                      1.0                     , ## low Y-edge
                      4.0                     ) ## high Y-edge

    (7) book the trivial 3D histogram with full path

    >>> h1D = book ( 'path/to/my/histo'       , ## path in Histogram Transient Store
                     'x vs y vs z '           , ## histogram title
                      10                      , ## number of X-bins
                      -1.0                    , ## low X-edge
                      1.0                     , ## high X-edge
                      10                      , ## number of Y-bins
                      -1.0                    , ## low Y-edge
                      1.0                     , ## high Y-edge
                      10                      , ## number of Z-bins
                      -1.0                    , ## low Z-edge
                      1.0                     ) ## high Z-edge

    (8) book the trivial 3D histogram with directory path and literal ID

    >>> h1D = book ( 'path/to/directory'      , ## path in Histogram Transient Store
                     'xyz'                    , ## literal histogram identifier
                     'x vs y vs z'            , ## histogram title
                      10                      , ## number of X-bins
                      -1.0                    , ## low X-edge
                      1.0                     , ## high X-edge
                      10                      , ## number of Y-bins
                      -1.0                    , ## low Y-edge
                      1.0                     , ## high Y-edge
                      10                      , ## number of Z-bins
                      -1.0                    , ## low Z-edge
                      1.0                     ) ## high Z-edge

    (9) book the trivial 3D histogram with directory path and integer ID

    >>> h1D = book ( 'path/to/directory'      , ## path in Histogram Transient Store
                     888                      , ## integer histogram identifier
                     'x vs y vs z'            , ## histogram title
                      10                      , ## number of X-bins
                      -1.0                    , ## low X-edge
                      1.0                     , ## high X-edge
                      10                      , ## number of Y-bins
                      -1.0                    , ## low Y-edge
                      1.0                     , ## high Y-edge
                      10                      , ## number of Z-bins
                      -1.0                    , ## low Z-edge
                      1.0                     ) ## high Z-edge

    Many other booking methods are available,
    e.g. for the histograms with non-equidistant bins, see IHistogamSvc::book

Definition at line 95 of file HistoUtils.py.

95 def book ( *args , **kwargs ) :
96 """
97 The trivial function to book the various 1D,2D&3D-histograms
98
99 (1) book the trivial 1D histogram with full path
100
101 >>> h1D = book ( 'path/to/my/histo' , ## path in Histogram Transient Store
102 'cosine of decay angle ' , ## histogram title
103 100 , ## number of bins
104 -1 , ## low edge
105 100 ) ## high edge
106
107 (2) book the trivial 1D histogram with directory path and string ID :
108
109 >>> h1D = book ( 'path/to/directory' , ## the path to directory in HTS
110 'H1' , ## string histogram identifier
111 'cosine of decay angle ' , ## histogram title
112 100 , ## number of bins
113 -1 , ## low edge
114 100 ) ## high edge
115
116 (3) book the trivial 1D histogram with directory path and integer ID :
117
118 >>> h1D = book ( 'path/to/directory' , ## the path to directory in HTS
119 124 , ## integer histogram identifier
120 'cosine of decay angle ' , ## histogram title
121 100 , ## number of bins
122 -1 , ## low edge
123 100 ) ## high edge
124
125 (4) book the trivial 2D histogram with full path
126
127 >>> h1D = book ( 'path/to/my/histo' , ## path in Histogram Transient Store
128 'm12**2 versus m13**2' , ## histogram title
129 50 , ## number of X-bins
130 1.0 , ## low X-edge
131 4.0 , ## high X-edge
132 50 , ## number of Y-bins
133 1 , ## low Y-edge
134 2 ) ## high Y-edge
135
136 (5) book the trivial 2D histogram with directory path and literal ID
137
138 >>> h1D = book ( 'path/to/directory' , ## path in Histogram Transient Store
139 'Dalitz1' , ## literal histogram identifier
140 'm12**2 versus m13**2' , ## histogram title
141 50 , ## number of X-bins
142 1.0 , ## low X-edge
143 4.0 , ## high X-edge
144 50 , ## number of Y-bins
145 1 , ## low Y-edge
146 2 ) ## high Y-edge
147
148 (6) book the trivial 2D histogram with directory path and integer ID
149
150 >>> h1D = book ( 'path/to/directory' , ## path in Histogram Transient Store
151 854 , ## integer histogram identifier
152 'm12**2 versus m13**2' , ## histogram title
153 50 , ## number of X-bins
154 1.0 , ## low X-edge
155 4.0 , ## high X-edge
156 50 , ## number of Y-bins
157 1.0 , ## low Y-edge
158 4.0 ) ## high Y-edge
159
160 (7) book the trivial 3D histogram with full path
161
162 >>> h1D = book ( 'path/to/my/histo' , ## path in Histogram Transient Store
163 'x vs y vs z ' , ## histogram title
164 10 , ## number of X-bins
165 -1.0 , ## low X-edge
166 1.0 , ## high X-edge
167 10 , ## number of Y-bins
168 -1.0 , ## low Y-edge
169 1.0 , ## high Y-edge
170 10 , ## number of Z-bins
171 -1.0 , ## low Z-edge
172 1.0 ) ## high Z-edge
173
174 (8) book the trivial 3D histogram with directory path and literal ID
175
176 >>> h1D = book ( 'path/to/directory' , ## path in Histogram Transient Store
177 'xyz' , ## literal histogram identifier
178 'x vs y vs z' , ## histogram title
179 10 , ## number of X-bins
180 -1.0 , ## low X-edge
181 1.0 , ## high X-edge
182 10 , ## number of Y-bins
183 -1.0 , ## low Y-edge
184 1.0 , ## high Y-edge
185 10 , ## number of Z-bins
186 -1.0 , ## low Z-edge
187 1.0 ) ## high Z-edge
188
189 (9) book the trivial 3D histogram with directory path and integer ID
190
191 >>> h1D = book ( 'path/to/directory' , ## path in Histogram Transient Store
192 888 , ## integer histogram identifier
193 'x vs y vs z' , ## histogram title
194 10 , ## number of X-bins
195 -1.0 , ## low X-edge
196 1.0 , ## high X-edge
197 10 , ## number of Y-bins
198 -1.0 , ## low Y-edge
199 1.0 , ## high Y-edge
200 10 , ## number of Z-bins
201 -1.0 , ## low Z-edge
202 1.0 ) ## high Z-edge
203
204 Many other booking methods are available,
205 e.g. for the histograms with non-equidistant bins, see IHistogamSvc::book
206
207 """
208 if useROOT or kwargs.get( 'useROOT' , False ) or not kwargs.get('useAIDA' , True ) :
209 from ROOT import TH1D
210 a0 = args[0]
211 a1 = args[1]
212 a2 = args[2]
213 if not str is type(a1) :
214 a1 = 'h'+str(a1)
215 if str is type(a2) :
216 return TH1D ( a0+a1 , a2 , *args[3:] )
217 else :
218 return TH1D ( a0 , a1 , *args[2:] )
219
220 svc = _getHistoSvc ( **kwargs )
221 if not svc : raise RuntimeError, 'Unable to get valid HistogramService '
222 ## book the histogram using the service
223 return svc.book(*args) ## RETURN
224
225 book.__doc__ += '\n\n' + '\thelp(iHistogramSvc.book) : \n\n' \
226 + iHistogramSvc.book . __doc__
227 book.__doc__ += '\n\n' + '\thelp(IHistogramSvc::book) : \n\n' \
228 + cpp.IHistogramSvc.book . __doc__
229
230 # =============================================================================
GaudiPython.HistoUtils.book
def book(args, kwargs)
The trivial function to book the various 1D,2D&3D-histograms.
Definition: HistoUtils.py:95
gaudirun.type
string type
Definition: gaudirun.py:151

def GaudiPython.HistoUtils.bookProf | ( |  | args,
|  |  | kwargs
| ) |  |

The trivial function to book 1D&2D profile histograms:

    The trivial function to book 1D&2D profile histograms:

    (1) book 1D-profile histogram with full path in Histogram Transient Store:
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           'Energy Correction'   , ## the histogram title
                           100                   , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   ) ## high X-edge

    (2) book 1D-profile histogram with directory path and literal ID
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           'Calibration'         , ## the histogram literal identifier
                           'Energy Correction'   , ## the histogram title
                           100                   , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   ) ## high X-edge

    (3) book 1D-profile histogram with directory path and integer  ID
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           418                   , ## the histogram integer identifier
                           'Energy Correction'   , ## the histogram title
                           100                   , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   ) ## high X-edge

    (4) book 2D-profile histogram with full path in Histogram Transient Store:
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           'Energy Correction'   , ## the histogram title
                           50                    , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   , ## high X-edge
                           50                    , ## number of Y-bins
                           0.0                   , ## low Y-edge
                           100                   ) ## high Y-edge

    (5) book 2D-profile histogram with directory path and literal ID
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           'Calibration'         , ## the histogram literal identifier
                           'Energy Correction'   , ## the histogram title
                           50                    , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   , ## high X-edge
                           50                    , ## number of Y-bins
                           0.0                   , ## low Y-edge
                           100                   ) ## high Y-edge

    (6) book 2D-profile histogram with directory path and integer  ID
    >>> histo = bookProf ( 'path/to/my/profile'  , ## path in Histogram Transient Store
                           418                   , ## the histogram integer identifier
                           'Energy Correction'   , ## the histogram title
                           50                    , ## number of X-bins
                           0.0                   , ## low X-edge
                           100                   , ## high X-edge
                           50                    , ## number of Y-bins
                           0.0                   , ## low Y-edge
                           100                   ) ## high Y-edge

    Many other booking methods are available,
    e.g. for the histograms with non-equidistant bins, see IHistogamSvc::book

Definition at line 232 of file HistoUtils.py.

232 def bookProf ( *args , **kwargs ) :
233 """
234
235 The trivial function to book 1D&2D profile histograms:
236
237 (1) book 1D-profile histogram with full path in Histogram Transient Store:
238 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
239 'Energy Correction' , ## the histogram title
240 100 , ## number of X-bins
241 0.0 , ## low X-edge
242 100 ) ## high X-edge
243
244 (2) book 1D-profile histogram with directory path and literal ID
245 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
246 'Calibration' , ## the histogram literal identifier
247 'Energy Correction' , ## the histogram title
248 100 , ## number of X-bins
249 0.0 , ## low X-edge
250 100 ) ## high X-edge
251
252 (3) book 1D-profile histogram with directory path and integer ID
253 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
254 418 , ## the histogram integer identifier
255 'Energy Correction' , ## the histogram title
256 100 , ## number of X-bins
257 0.0 , ## low X-edge
258 100 ) ## high X-edge
259
260 (4) book 2D-profile histogram with full path in Histogram Transient Store:
261 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
262 'Energy Correction' , ## the histogram title
263 50 , ## number of X-bins
264 0.0 , ## low X-edge
265 100 , ## high X-edge
266 50 , ## number of Y-bins
267 0.0 , ## low Y-edge
268 100 ) ## high Y-edge
269
270 (5) book 2D-profile histogram with directory path and literal ID
271 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
272 'Calibration' , ## the histogram literal identifier
273 'Energy Correction' , ## the histogram title
274 50 , ## number of X-bins
275 0.0 , ## low X-edge
276 100 , ## high X-edge
277 50 , ## number of Y-bins
278 0.0 , ## low Y-edge
279 100 ) ## high Y-edge
280
281 (6) book 2D-profile histogram with directory path and integer ID
282 >>> histo = bookProf ( 'path/to/my/profile' , ## path in Histogram Transient Store
283 418 , ## the histogram integer identifier
284 'Energy Correction' , ## the histogram title
285 50 , ## number of X-bins
286 0.0 , ## low X-edge
287 100 , ## high X-edge
288 50 , ## number of Y-bins
289 0.0 , ## low Y-edge
290 100 ) ## high Y-edge
291
292 Many other booking methods are available,
293 e.g. for the histograms with non-equidistant bins, see IHistogamSvc::book
294
295 """
296 svc = _getHistoSvc ( **kwargs )
297 if not svc : raise RuntimeError, 'Unable to get valid HistogramService '
298 ## book the histogram using the service
299 return svc.bookProf(*args) ## RETURN
300
301
302 bookProf.__doc__ += '\n\n' + '\thelp(iHistogramSvc.bookProf) : \n\n' \
303 + iHistogramSvc.bookProf . __doc__
304 bookProf.__doc__ += '\n\n' + '\thelp(IHistogramSvc::bookProf) : \n\n' \
305 + cpp.IHistogramSvc.bookProf . __doc__
306
307 # =============================================================================
GaudiPython.HistoUtils.bookProf
def bookProf(args, kwargs)
The trivial function to book 1D&2D profile histograms:
Definition: HistoUtils.py:232

def GaudiPython.HistoUtils.fill | ( |  | histo,
|  |  | data,
|  |  | fun = `lambda x : x`,
|  |  | cut = `lambda x : True`,
|  |  | kwargs
| ) |  |

The function which allows 'the smart fill' of 1D-histogram.

    The function which allows 'the smart fill' of 1D-histogram

    >>> histo = ...

    The most trivial case, fill with the value
    >>> fill ( histo , 1.0 )

    Fill from any iterable object (sequence)
    >>> fill ( histo , [1,,2,3,4,5,10] )

    Fill from iterable object and apply the function:
    >>> fill ( histo , [1,2,3,4,5] , math.sin )

    Use lambda form:
    >>> fill ( histo , [1,2,3,4,5] , lambda x : x*x )

    The same
    >>> fill ( histo , [1,2,3,4,5] , fun = lambda x : x*x )

    Use internal attributes:
    >>> tracks = evtSvc['Rec/Track/Best']    ## iterable container of tracks
    >>> fill ( histo , tracks , lambda t : t.pt() )

    Apply the predicate: fill only even numbers:
    >>> fill ( histo , [1,2,3,4,5,6,7] , lambda x : x , lambda y : y%2 )

    The same (omit the trivial function) :
    >>> fill ( histo , [1,2,3,4,5,6,7] , cut = lambda y : y%2 )

    Apply the predicate: fill only pt for positively charged tracks:
    >>> tracks = evtSvc['Rec/Track/Best']
    >>> fill ( histo , tracks , lambda t : t.pt() , lambda t : 0<t.charge() )

    The same:
    >>> fill ( histo , tracks ,
               fun = lambda t : t.pt()       ,
               cut = lambda t : 0<t.charge() )

    Ordinary functions are also fine:
    >>> def myfun ( track ) : return sin( track.pt() + track.p() )
    >>> def mycut ( track ) : return track.p() > 100 * GeV
    >>> fill ( histo , tracks , myfun , mycut )

    The 'data' could be the address in TES, in this case the object
    is retrieved from TES and the method is applied to the objects,
    retrieved from TES:
    >>> fill (  histo             , ## the reference to the histogram
               'Rec/Track/Best'   , ## the location of objects in TES
                lambda t : t.pt() ) ## function to be used for histogram fill
    >>> fill (  histo             , ## the reference to the histogram
               'Rec/Track/Best'   , ## the address of objects in TES
                lambda t : t.pt() , ## the function to be used for histogram fill
                lambda t : t.charge()>0 ) ## the criteria to select tracks

    The arguments 'fun' and 'cut' could be strings, in this case
    they are evaluated by python before usage.
    This option could be often very useful.

Definition at line 354 of file HistoUtils.py.

354 **kwargs ) : ## optional extra arguments
355 """
356
357 The function which allows 'the smart fill' of 1D-histogram
358
359 >>> histo = ...
360
361 The most trivial case, fill with the value
362 >>> fill ( histo , 1.0 )
363
364 Fill from any iterable object (sequence)
365 >>> fill ( histo , [1,,2,3,4,5,10] )
366
367 Fill from iterable object and apply the function:
368 >>> fill ( histo , [1,2,3,4,5] , math.sin )
369
370 Use lambda form:
371 >>> fill ( histo , [1,2,3,4,5] , lambda x : x*x )
372
373 The same
374 >>> fill ( histo , [1,2,3,4,5] , fun = lambda x : x*x )
375
376 Use internal attributes:
377 >>> tracks = evtSvc['Rec/Track/Best'] ## iterable container of tracks
378 >>> fill ( histo , tracks , lambda t : t.pt() )
379
380 Apply the predicate: fill only even numbers:
381 >>> fill ( histo , [1,2,3,4,5,6,7] , lambda x : x , lambda y : y%2 )
382
383 The same (omit the trivial function) :
384 >>> fill ( histo , [1,2,3,4,5,6,7] , cut = lambda y : y%2 )
385
386 Apply the predicate: fill only pt for positively charged tracks:
387 >>> tracks = evtSvc['Rec/Track/Best']
388 >>> fill ( histo , tracks , lambda t : t.pt() , lambda t : 0<t.charge() )
389
390 The same:
391 >>> fill ( histo , tracks ,
392 fun = lambda t : t.pt() ,
393 cut = lambda t : 0<t.charge() )
394
395 Ordinary functions are also fine:
396 >>> def myfun ( track ) : return sin( track.pt() + track.p() )
397 >>> def mycut ( track ) : return track.p() > 100 * GeV
398 >>> fill ( histo , tracks , myfun , mycut )
399
400 The 'data' could be the address in TES, in this case the object
401 is retrieved from TES and the method is applied to the objects,
402 retrieved from TES:
403 >>> fill ( histo , ## the reference to the histogram
404 'Rec/Track/Best' , ## the location of objects in TES
405 lambda t : t.pt() ) ## function to be used for histogram fill
406 >>> fill ( histo , ## the reference to the histogram
407 'Rec/Track/Best' , ## the address of objects in TES
408 lambda t : t.pt() , ## the function to be used for histogram fill
409 lambda t : t.charge()>0 ) ## the criteria to select tracks
410
411 The arguments 'fun' and 'cut' could be strings, in this case
412 they are evaluated by python before usage.
413 This option could be often very useful.
414
415 """
416
417 # if value is a string, try to get the objects from TES
418 if type ( data ) == str :
419 svc = _getEvtSvc ( **kwargs )
420 data = svc[data]
421 return fill ( histo , data , fun , cut , **kwargs )
422
423 # if the function is a string: evaluate it!
424 if type ( fun ) == str : fun = eval ( fun , globals() )
425
426 # if the criterion is a string: evaluate it!
427 if type ( cut ) == str : cut = eval ( cut , globals() )
428
429 if not hasattr ( data , '__iter__' ) : data = [ data ]
430
431 if not hasattr ( histo , 'fill' ) and hasattr ( histo , 'Fill' ) :
432 setattr ( histo , 'fill' , getattr ( histo , 'Fill' ) )
433
434 for item in data :
435 if not cut ( item ) : continue ## CONTINUE
436 histo.fill ( fun ( item ) )
437
438 return histo ## RETURN
439
440 # =============================================================================

def GaudiPython.HistoUtils.getAsAIDA | ( |  | path,
|  |  | kwargs
| ) |  |

The most trivial function to retrieve the histogram from Histogram Transient Store.

    The most trivial function to retrieve the histogram from Histogram Transient Store
    The histogram is returned by reference to its AIDA-representation (if possible)

    >>> h = getAsAIDA ( 'some/path/to/my/histogram' )

Definition at line 309 of file HistoUtils.py.

309 def getAsAIDA ( path , **kwargs ) :
310 """
311
312 The most trivial function to retrieve the histogram from Histogram Transient Store
313 The histogram is returned by reference to its AIDA-representation (if possible)
314
315 >>> h = getAsAIDA ( 'some/path/to/my/histogram' )
316
317 """
318 svc = _getHistoSvc ( **kwargs )
319 if not svc : raise RuntimeError, 'Unable to get valid HistogramService '
320 ## return the histogram
321 return svc.getAsAIDA( path ) ## RETURN
322
323 getAsAIDA.__doc__ += '\n\n' + '\thelp(iHistogramSvc.getAsAIDA) : \n\n' \
324 + iHistogramSvc.getAsAIDA . __doc__
325 getAsAIDA.__doc__ += '\n\n' + '\thelp(iHistogramSvc.retrieve) : \n\n' \
326 + iHistogramSvc.retrieve . __doc__
327
328 # =============================================================================
GaudiPython.HistoUtils.getAsAIDA
def getAsAIDA(path, kwargs)
The most trivial function to retrieve the histogram from Histogram Transient Store.
Definition: HistoUtils.py:309

def GaudiPython.HistoUtils.getAsROOT | ( |  | path,
|  |  | kwargs
| ) |  |

The most trivial function to retrieve the histogram from Histogram Transient Store.

    The most trivial function to retrieve the histogram from Histogram Transient Store
    The histogram is returned by reference to its underlying native ROOT-representation (if possible)

    >>> h = getAsROOT ( 'some/path/to/my/histogram' )

Definition at line 330 of file HistoUtils.py.

330 def getAsROOT ( path , **kwargs ) :
331 """
332
333 The most trivial function to retrieve the histogram from Histogram Transient Store
334 The histogram is returned by reference to its underlying native ROOT-representation (if possible)
335
336 >>> h = getAsROOT ( 'some/path/to/my/histogram' )
337
338 """
339 svc = _getHistoSvc ( **kwargs )
340 if not svc : raise RuntimeError, 'Unable to get valid HistogramService '
341 ## return the histogram
342 return svc.getAsROOT( path ) ## RETURN
343
344 getAsROOT.__doc__ += '\n\n' + '\thelp(iHistogramSvc.getAsROOT) : \n\n' \
345 + iHistogramSvc.getAsROOT . __doc__
346
347
348 # =============================================================================
GaudiPython.HistoUtils.getAsROOT
def getAsROOT(path, kwargs)
The most trivial function to retrieve the histogram from Histogram Transient Store.
Definition: HistoUtils.py:330

## Variable Documentation

tuple GaudiPython.HistoUtils.__all__

Initial value:
1 = (
2 'book' , ## book AIDA histogram using Histogram Service
3 'bookProf' , ## book AIDA profile histogram using Histogram Service
4 'getAsAIDA' , ## get the histogram form Histogram Service as AIDA histogram
5 'getAsROOT' , ## get the histogram form Histogram Service as AIDA histogram
6 'fill' , ## "power-fill" method for filling of histograms
7 'aida2root' , ## AIDA -> ROOT converter
8 'HistoStats', ## statistical information for 1D-histograms
9 'HistoFile' , ## class for storing histograms to a file
10 'histoDump' , ## dump histogramintext format a'la HBOOK
11 'dumpHisto' ## dump histogramintext format a'la HBOOK
12 )

Definition at line 29 of file HistoUtils.py.

string GaudiPython.HistoUtils.__author__ = "Vanya BELYAEV ibelyaev@physics.syr.edu"

This module contains set of simple and useful utilities for booking and manipulations with Gaudi-AIDA histograms, inspired by Thomas' request.

Author
  Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u

  # 2007-08-03

Definition at line 27 of file HistoUtils.py.

GaudiPython.HistoUtils.aida2root = cpp.Gaudi.Utils.Aida2ROOT.aida2root

AIDA -> ROOT converter.

Definition at line 442 of file HistoUtils.py.

GaudiPython.HistoUtils.dumpHisto = __dumpHisto__

Definition at line 800 of file HistoUtils.py.

GaudiPython.HistoUtils.HID = cpp.GaudiAlg.ID

Definition at line 47 of file HistoUtils.py.

GaudiPython.HistoUtils.histoDump = __dumpHisto__

the actual function for text dump of the histogram

Definition at line 799 of file HistoUtils.py.

GaudiPython.HistoUtils.HistoStats = cpp.Gaudi.Utils.HistoStats

Definition at line 473 of file HistoUtils.py.

GaudiPython.HistoUtils.i1DH = cpp.AIDA.IHistogram1D

Definition at line 730 of file HistoUtils.py.

GaudiPython.HistoUtils.iBH = cpp.AIDA.IBaseHistogram

Definition at line 771 of file HistoUtils.py.

GaudiPython.HistoUtils.useROOT = False

global flag

Definition at line 50 of file HistoUtils.py.