![]() |
The Gaudi Framework
v32r2 (46d42edc)
|
Classes | |
class | HistoFile |
Functions | |
def | _getAppMgr (**kwargs) |
def | _getHistoSvc (**kwargs) |
def | _getEvtSvc (**kwargs) |
def | book (*args, **kwargs) |
def | bookProf (*args, **kwargs) |
def | getAsAIDA (path, **kwargs) |
def | getAsROOT (path, **kwargs) |
def | fill (histo, data, fun=lambda x:x, cut=lambda x:True, **kwargs) |
def | _to_root_ (self) |
def | _moment_ (self, order, value=0) |
def | _momentErr_ (self, order) |
def | _centralMoment_ (self, order) |
def | _centralMomentErr_ (self, order) |
def | _skewness_ (self) |
def | _skewnessErr_ (self) |
def | _kurtosis_ (self) |
def | _kurtosisErr_ (self) |
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_ (self, i1, i2=-10000000) |
def | _nEntriesFrac_ (self, i1, i2=-10000000) |
def | _nEntriesFracErr_ (self, i1, i2=-10000000) |
def | _path_ (self) |
def | __dumpHisto__ (histo, *args) |
Variables | |
string | __author__ = "Vanya BELYAEV ibelyaev@physics.syr.edu" |
tuple | __all__ |
HID = cpp.GaudiAlg.ID | |
bool | useROOT = False |
global flag More... | |
aida2root = cpp.Gaudi.Utils.Aida2ROOT.aida2root | |
__repr__ | |
__str__ | |
HistoStats = cpp.Gaudi.Utils.HistoStats | |
i1DH = cpp.AIDA.IHistogram1D | |
moment | |
momentErr | |
centralMoment | |
centralMomentErr | |
nEff | |
mean | |
meanErr | |
rms | |
rmsErr | |
skewness | |
skewnessErr | |
kurtosis | |
kurtosisErr | |
overflowEntriesFrac | |
overflowEntriesFracErr | |
underflowEntriesFrac | |
underflowEntriesFracErr | |
overflowIntegralFrac | |
overflowIntegralFracErr | |
underflowIntegralFrac | |
underflowIntegralFracErr | |
nEntries | |
nEntriesFrac | |
nEntriesFracErr | |
iBH = cpp.AIDA.IBaseHistogram | |
path | |
TESpath | |
location | |
def | histoDump = __dumpHisto__ |
def | dumpHisto = __dumpHisto__ |
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 941 of file HistoUtils.py.
|
private |
Evaluate 'bin-by-bin' central momentum (around mean value) for 1D histogram >>> h1 = ... >>> print h1.centralMoment ( 5 )
Definition at line 551 of file HistoUtils.py.
|
private |
Evaluate error for 'bin-by-bin' central momentum (around mean value) for 1D histogram >>> h1 = ... >>> print h1.centralMomentErr ( 5 )
Definition at line 567 of file HistoUtils.py.
|
private |
Helper private auxiliary function to get Application Manager
Definition at line 57 of file HistoUtils.py.
|
private |
|
private |
|
private |
Evaluate 'bin-by-bin' kurtosis >>> h1 = ... >>> print h1.kurtosis ()
Definition at line 613 of file HistoUtils.py.
|
private |
Evaluate error for 'bin-by-bin' kurtotis for 1D AIDA histogram >>> h1 = ... >>> print h1.kurtotisErr()
Definition at line 628 of file HistoUtils.py.
|
private |
|
private |
|
private |
Evaluate 'bin-by-bin' momentum of order 'order' around the value 'value' for 1D histogram >>> h1 = ... >>> print h1.moment ( 5 )
Definition at line 519 of file HistoUtils.py.
|
private |
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 535 of file HistoUtils.py.
|
private |
|
private |
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 793 of file HistoUtils.py.
|
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 817 of file HistoUtils.py.
|
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 841 of file HistoUtils.py.
|
private |
The fraction of overflow entries (useful for shape comparison)
Definition at line 710 of file HistoUtils.py.
|
private |
The error for fraction of overflow entries (useful for shape comparison)
Definition at line 720 of file HistoUtils.py.
|
private |
The fraction of overflow integral (useful for shape comparison)
Definition at line 750 of file HistoUtils.py.
|
private |
The error for fraction of overflow integral (useful for shape comparison)
Definition at line 760 of file HistoUtils.py.
|
private |
Get the path in THS for the given AIDA object: >>> aida = >>> print aida.path()
Definition at line 920 of file HistoUtils.py.
|
private |
|
private |
|
private |
Evaluate 'bin-by-bin' skewness for 1D AIDA histogram >>> h1 = ... >>> print h1.skewness()
Definition at line 583 of file HistoUtils.py.
|
private |
Evaluate error for 'bin-by-bin' skewness >>> h1 = ... >>> print h1.skewnessErr()
Definition at line 598 of file HistoUtils.py.
|
private |
Get an error in the sum bin height ('in-range integral')
Definition at line 702 of file HistoUtils.py.
|
private |
Get an error in the sum bin height ('in-range integral')
Definition at line 692 of file HistoUtils.py.
|
private |
Convert AIDA to ROOT >>> aida = ... ## get AIDA histogram >>> root = aida.toROOT() ## convert it to ROOT
Definition at line 488 of file HistoUtils.py.
|
private |
The fraction of underflow entries (useful for shape comparison)
Definition at line 730 of file HistoUtils.py.
|
private |
The error for fraction of underflow entries (useful for shape comparison)
Definition at line 740 of file HistoUtils.py.
|
private |
The fraction of underflow integral (useful for shape comparison)
Definition at line 770 of file HistoUtils.py.
|
private |
The error for fraction of underflow integral (useful for shape comparison)
Definition at line 780 of file HistoUtils.py.
def GaudiPython.HistoUtils.book | ( | * | args, |
** | kwargs | ||
) |
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 115 of file HistoUtils.py.
def GaudiPython.HistoUtils.bookProf | ( | * | args, |
** | kwargs | ||
) |
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 257 of file HistoUtils.py.
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 >>> 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 384 of file HistoUtils.py.
def GaudiPython.HistoUtils.getAsAIDA | ( | path, | |
** | kwargs | ||
) |
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 337 of file HistoUtils.py.
def GaudiPython.HistoUtils.getAsROOT | ( | path, | |
** | kwargs | ||
) |
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 362 of file HistoUtils.py.
|
private |
Definition at line 30 of file HistoUtils.py.
|
private |
Definition at line 28 of file HistoUtils.py.
|
private |
Definition at line 509 of file HistoUtils.py.
|
private |
Definition at line 511 of file HistoUtils.py.
GaudiPython.HistoUtils.aida2root = cpp.Gaudi.Utils.Aida2ROOT.aida2root |
Definition at line 482 of file HistoUtils.py.
GaudiPython.HistoUtils.centralMoment |
Definition at line 870 of file HistoUtils.py.
GaudiPython.HistoUtils.centralMomentErr |
Definition at line 872 of file HistoUtils.py.
def GaudiPython.HistoUtils.dumpHisto = __dumpHisto__ |
Definition at line 964 of file HistoUtils.py.
GaudiPython.HistoUtils.HID = cpp.GaudiAlg.ID |
Definition at line 48 of file HistoUtils.py.
def GaudiPython.HistoUtils.histoDump = __dumpHisto__ |
Definition at line 963 of file HistoUtils.py.
GaudiPython.HistoUtils.HistoStats = cpp.Gaudi.Utils.HistoStats |
Definition at line 513 of file HistoUtils.py.
GaudiPython.HistoUtils.i1DH = cpp.AIDA.IHistogram1D |
Definition at line 863 of file HistoUtils.py.
GaudiPython.HistoUtils.iBH = cpp.AIDA.IBaseHistogram |
Definition at line 931 of file HistoUtils.py.
GaudiPython.HistoUtils.kurtosis |
Definition at line 888 of file HistoUtils.py.
GaudiPython.HistoUtils.kurtosisErr |
Definition at line 890 of file HistoUtils.py.
GaudiPython.HistoUtils.location |
Definition at line 937 of file HistoUtils.py.
GaudiPython.HistoUtils.mean |
Definition at line 876 of file HistoUtils.py.
GaudiPython.HistoUtils.meanErr |
Definition at line 878 of file HistoUtils.py.
GaudiPython.HistoUtils.moment |
Definition at line 866 of file HistoUtils.py.
GaudiPython.HistoUtils.momentErr |
Definition at line 868 of file HistoUtils.py.
GaudiPython.HistoUtils.nEff |
Definition at line 874 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntries |
Definition at line 911 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntriesFrac |
Definition at line 913 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntriesFracErr |
Definition at line 915 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowEntriesFrac |
Definition at line 893 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowEntriesFracErr |
Definition at line 895 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowIntegralFrac |
Definition at line 902 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowIntegralFracErr |
Definition at line 904 of file HistoUtils.py.
GaudiPython.HistoUtils.path |
Definition at line 933 of file HistoUtils.py.
GaudiPython.HistoUtils.rms |
Definition at line 880 of file HistoUtils.py.
GaudiPython.HistoUtils.rmsErr |
Definition at line 882 of file HistoUtils.py.
GaudiPython.HistoUtils.skewness |
Definition at line 884 of file HistoUtils.py.
GaudiPython.HistoUtils.skewnessErr |
Definition at line 886 of file HistoUtils.py.
GaudiPython.HistoUtils.TESpath |
Definition at line 935 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowEntriesFrac |
Definition at line 897 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowEntriesFracErr |
Definition at line 899 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowIntegralFrac |
Definition at line 906 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowIntegralFracErr |
Definition at line 908 of file HistoUtils.py.
bool GaudiPython.HistoUtils.useROOT = False |
global flag
Definition at line 51 of file HistoUtils.py.