I have a 2D correlation matrix between nuisance parameters that are used in a likelihood fit. I would like to translate this to NumPy to use with other vis libraries.
The problem is TH2D.edges
returns the bin index and I need the bin label, i.e. which bin is which nuisance parameter. The TH2D
object has the following members:
['fName',
'fTitle',
'fLineColor',
'fLineStyle',
'fLineWidth',
'fFillColor',
'fFillStyle',
'fMarkerColor',
'fMarkerStyle',
'fMarkerSize',
'fNcells',
'fXaxis',
'fYaxis',
'fZaxis',
'fBarOffset',
'fBarWidth',
'fEntries',
'fTsumw',
'fTsumw2',
'fTsumwx',
'fTsumwx2',
'fMaximum',
'fMinimum',
'fNormFactor',
'fContour',
'fSumw2',
'fOption',
'fFunctions',
'fBufferSize',
'fBuffer',
'fBinStatErrOpt',
'fStatOverflows',
'fScalefactor',
'fTsumwy',
'fTsumwy2',
'fTsumwxy']
Is it possible to extract the bin label for each index?
TH2 has an axes tuple and an axis method for getting each of its two TAxis objects.
From there, TAxis has a labels method to extract the labels.
You didn't see it in the list of
TH2D
data members because it's in thefXaxis
andfYaxis
.