![]() |
The Gaudi Framework
v36r1 (3e2fb5a8)
|
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__ |
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 951 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 561 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 577 of file HistoUtils.py.
|
private |
Helper private auxiliary function to get Application Manager
Definition at line 67 of file HistoUtils.py.
|
private |
|
private |
|
private |
Evaluate 'bin-by-bin' kurtosis >>> h1 = ... >>> print(h1.kurtosis ())
Definition at line 623 of file HistoUtils.py.
|
private |
Evaluate error for 'bin-by-bin' kurtotis for 1D AIDA histogram >>> h1 = ... >>> print(h1.kurtotisErr())
Definition at line 638 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 529 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 545 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 803 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 827 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 851 of file HistoUtils.py.
|
private |
The fraction of overflow entries (useful for shape comparison)
Definition at line 720 of file HistoUtils.py.
|
private |
The error for fraction of overflow entries (useful for shape comparison)
Definition at line 730 of file HistoUtils.py.
|
private |
The fraction of overflow integral (useful for shape comparison)
Definition at line 760 of file HistoUtils.py.
|
private |
The error for fraction of overflow integral (useful for shape comparison)
Definition at line 770 of file HistoUtils.py.
|
private |
Get the path in THS for the given AIDA object: >>> aida = >>> print(aida.path())
Definition at line 930 of file HistoUtils.py.
|
private |
|
private |
|
private |
Evaluate 'bin-by-bin' skewness for 1D AIDA histogram >>> h1 = ... >>> print(h1.skewness())
Definition at line 593 of file HistoUtils.py.
|
private |
Evaluate error for 'bin-by-bin' skewness >>> h1 = ... >>> print(h1.skewnessErr())
Definition at line 608 of file HistoUtils.py.
|
private |
Get an error in the sum bin height ('in-range integral')
Definition at line 712 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 |
Convert AIDA to ROOT >>> aida = ... ## get AIDA histogram >>> root = aida.toROOT() ## convert it to ROOT
Definition at line 498 of file HistoUtils.py.
|
private |
The fraction of underflow entries (useful for shape comparison)
Definition at line 740 of file HistoUtils.py.
|
private |
The error for fraction of underflow entries (useful for shape comparison)
Definition at line 750 of file HistoUtils.py.
|
private |
The fraction of underflow integral (useful for shape comparison)
Definition at line 780 of file HistoUtils.py.
|
private |
The error for fraction of underflow integral (useful for shape comparison)
Definition at line 790 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 125 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 267 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 394 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 347 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 372 of file HistoUtils.py.
|
private |
Definition at line 40 of file HistoUtils.py.
|
private |
Definition at line 38 of file HistoUtils.py.
|
private |
Definition at line 519 of file HistoUtils.py.
|
private |
Definition at line 521 of file HistoUtils.py.
GaudiPython.HistoUtils.aida2root = cpp.Gaudi.Utils.Aida2ROOT.aida2root |
Definition at line 492 of file HistoUtils.py.
GaudiPython.HistoUtils.centralMoment |
Definition at line 880 of file HistoUtils.py.
GaudiPython.HistoUtils.centralMomentErr |
Definition at line 882 of file HistoUtils.py.
def GaudiPython.HistoUtils.dumpHisto = __dumpHisto__ |
Definition at line 974 of file HistoUtils.py.
def GaudiPython.HistoUtils.histoDump = __dumpHisto__ |
Definition at line 973 of file HistoUtils.py.
GaudiPython.HistoUtils.HistoStats = cpp.Gaudi.Utils.HistoStats |
Definition at line 523 of file HistoUtils.py.
GaudiPython.HistoUtils.i1DH = cpp.AIDA.IHistogram1D |
Definition at line 873 of file HistoUtils.py.
GaudiPython.HistoUtils.iBH = cpp.AIDA.IBaseHistogram |
Definition at line 941 of file HistoUtils.py.
GaudiPython.HistoUtils.kurtosis |
Definition at line 898 of file HistoUtils.py.
GaudiPython.HistoUtils.kurtosisErr |
Definition at line 900 of file HistoUtils.py.
GaudiPython.HistoUtils.location |
Definition at line 947 of file HistoUtils.py.
GaudiPython.HistoUtils.mean |
Definition at line 886 of file HistoUtils.py.
GaudiPython.HistoUtils.meanErr |
Definition at line 888 of file HistoUtils.py.
GaudiPython.HistoUtils.moment |
Definition at line 876 of file HistoUtils.py.
GaudiPython.HistoUtils.momentErr |
Definition at line 878 of file HistoUtils.py.
GaudiPython.HistoUtils.nEff |
Definition at line 884 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntries |
Definition at line 921 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntriesFrac |
Definition at line 923 of file HistoUtils.py.
GaudiPython.HistoUtils.nEntriesFracErr |
Definition at line 925 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowEntriesFrac |
Definition at line 903 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowEntriesFracErr |
Definition at line 905 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowIntegralFrac |
Definition at line 912 of file HistoUtils.py.
GaudiPython.HistoUtils.overflowIntegralFracErr |
Definition at line 914 of file HistoUtils.py.
GaudiPython.HistoUtils.path |
Definition at line 943 of file HistoUtils.py.
GaudiPython.HistoUtils.rms |
Definition at line 890 of file HistoUtils.py.
GaudiPython.HistoUtils.rmsErr |
Definition at line 892 of file HistoUtils.py.
GaudiPython.HistoUtils.skewness |
Definition at line 894 of file HistoUtils.py.
GaudiPython.HistoUtils.skewnessErr |
Definition at line 896 of file HistoUtils.py.
GaudiPython.HistoUtils.TESpath |
Definition at line 945 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowEntriesFrac |
Definition at line 907 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowEntriesFracErr |
Definition at line 909 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowIntegralFrac |
Definition at line 916 of file HistoUtils.py.
GaudiPython.HistoUtils.underflowIntegralFracErr |
Definition at line 918 of file HistoUtils.py.
bool GaudiPython.HistoUtils.useROOT = False |
global flag
Definition at line 61 of file HistoUtils.py.