Public Member Functions | |
GCube () | |
GCube (const char *name, const char *title, Int_t nbins, Double_t low, Double_t up) | |
GCube (const char *name, const char *title, Int_t nbins, const Double_t *bins) | |
GCube (const char *name, const char *title, Int_t nbins, const Float_t *bins) | |
~GCube () override | |
Int_t | BufferEmpty (Int_t action=0) override |
Int_t | BufferFill (Double_t, Double_t) override |
virtual Int_t | BufferFill (Double_t x, Double_t y, Double_t z, Double_t w) |
void | Copy (TObject &obj) const override |
Int_t | Fill (Double_t) override |
Int_t | Fill (Double_t, Double_t) override |
Int_t | Fill (const char *, Double_t) override |
virtual Int_t | Fill (Double_t, const char *, Double_t) |
virtual Int_t | Fill (const char *, Double_t, Double_t) |
virtual Int_t | Fill (const char *, const char *, Double_t) |
virtual Int_t | Fill (Double_t x, Double_t y, Double_t z) |
virtual Int_t | Fill (Double_t x, Double_t y, Double_t z, Double_t w) |
virtual Int_t | Fill (const char *namex, const char *namey, const char *namez, Double_t w) |
void | FillRandom (const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr) override |
void | FillRandom (TH1 *h, Int_t ntimes=5000, TRandom *rng=nullptr) override |
Int_t | FindFirstBinAbove (Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const override |
Int_t | FindLastBinAbove (Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const override |
virtual void | FitSlicesZ (TF1 *f1=nullptr, Int_t binminx=0, Int_t binmaxx=-1, Int_t binminy=0, Int_t binmaxy=-1, Int_t cut=0, Option_t *option="QNR") |
Int_t | GetBin (Int_t binx, Int_t biny=0, Int_t binz=0) const override |
virtual Double_t | GetBinWithContent2 (Double_t c, Int_t &binx, Int_t &biny, Int_t &binz, Int_t firstxbin=1, Int_t lastxbin=-1, Int_t firstybin=1, Int_t lastybin=-1, Int_t firstzbin=1, Int_t lastzbin=-1, Double_t maxdiff=0) const |
virtual Double_t | GetCorrelationFactor (Int_t axis1=1, Int_t axis2=2) const |
virtual Double_t | GetCovariance (Int_t axis1=1, Int_t axis2=2) const |
virtual void | GetRandom3 (Double_t &x, Double_t &y, Double_t &z) |
void | GetStats (Double_t *stats) const override |
Double_t | Integral (Option_t *option="") const override |
virtual Double_t | Integral (Int_t firstxbin, Int_t lastxbin, Int_t firstybin, Int_t lastybin, Int_t firstzbin, Int_t lastzbin, Option_t *option="") const |
virtual Double_t | IntegralAndError (Int_t firstxbin, Int_t lastxbin, Int_t firstybin, Int_t lastybin, Int_t firstzbin, Int_t lastzbin, Double_t &error, Option_t *option="") const |
Double_t | Interpolate (Double_t) const override |
Double_t | Interpolate (Double_t, Double_t) const override |
Double_t | Interpolate (Double_t, Double_t, Double_t) const override |
Double_t | KolmogorovTest (const TH1 *h2, Option_t *option="") const override |
Long64_t | Merge (TCollection *list) override |
virtual TH1D * | Projection (const char *name="_pr", Int_t firstBiny=0, Int_t lastBiny=-1, Int_t firstBinz=0, Int_t lastBinz=-1, Option_t *option="") const |
void | PutStats (Double_t *stats) override |
virtual GCube * | Rebin3D (Int_t ngroup=2, const char *newname="") |
void | Reset (Option_t *option="") override |
virtual void | SetShowProjection (const char *option="xy", Int_t nbins=1) |
TH1 * | ShowBackground (Int_t niter=20, Option_t *option="same") override |
Int_t | ShowPeaks (Double_t sigma=2, Option_t *option="", Double_t threshold=0.05) override |
void | Smooth (Int_t ntimes=1, Option_t *option="") override |
Protected Member Functions | |
Double_t | DoIntegral (Int_t binx1, Int_t binx2, Int_t biny1, Int_t biny2, Int_t binz1, Int_t binz2, Double_t &error, Option_t *option, Bool_t doError=kFALSE) const override |
Protected Attributes | |
TH2 * | fMatrix {0} |
Double_t | fTsumwxy {0} |
Double_t | fTsumwxz {0} |
Double_t | fTsumwy {0} |
Double_t | fTsumwy2 {0} |
Double_t | fTsumwyz {0} |
Double_t | fTsumwz {0} |
Double_t | fTsumwz2 {0} |
Private Member Functions | |
GCube (const GCube &) | |
ClassDefOverride (GCube, 1) | |
GCube & | operator= (const GCube &) |
#include <GCube.h>
GCube::GCube | ( | ) |
GCube::GCube | ( | const char * | name, |
const char * | title, | ||
Int_t | nbins, | ||
Double_t | low, | ||
Double_t | up | ||
) |
GCube::GCube | ( | const char * | name, |
const char * | title, | ||
Int_t | nbins, | ||
const Double_t * | bins | ||
) |
GCube::GCube | ( | const char * | name, |
const char * | title, | ||
Int_t | nbins, | ||
const Float_t * | bins | ||
) |
|
overridedefault |
|
private |
|
override |
Fill histogram with all entries in the buffer. action = -1 histogram is reset and refilled from the buffer (called by THistPainter::Paint) action = 0 histogram is filled from the buffer action = 1 histogram is filled and buffer is deleted The buffer is automatically deleted when the number of entries in the buffer is greater than the number of entries in the histogram
Definition at line 91 of file GCube.cxx.
References pygui.grut-view::action, Fill(), and Reset().
Referenced by BufferFill(), GCubeF::GetBinContent(), GCubeD::GetBinContent(), GetStats(), and Merge().
|
inlineoverride |
|
virtual |
Definition at line 203 of file GCube.cxx.
References BufferEmpty(), Fill(), and Reset().
|
private |
|
override |
Definition at line 233 of file GCube.cxx.
References fMatrix, fTsumwxy, fTsumwy, and fTsumwy2.
Referenced by GCubeF::Copy(), GCubeD::Copy(), GCube(), and Merge().
|
overrideprotected |
Definition at line 244 of file GCube.cxx.
References GetBin().
Referenced by Integral(), and IntegralAndError().
|
override |
Definition at line 330 of file GCube.cxx.
Referenced by BufferEmpty(), BufferFill(), FillRandom(), and Merge().
|
inlineoverride |
|
inlineoverride |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
|
virtual |
|
virtual |
|
override |
|
override |
|
override |
|
override |
|
virtual |
Project slices along Z in case of a 3-D histogram, then fit each slice with function f1 and make a 2-d histogram for each fit parameter Only cells in the bin range [binminx,binmaxx] and [binminy,binmaxy] are considered. if f1=0, a gaussian is assumed Before invoking this function, one can set a subrange to be fitted along Z via f1->SetRange(zmin,zmax) The argument option (default="QNR") can be used to change the fit options. "Q" means Quiet mode "N" means do not show the result of the fit "R" means fit the function in the specified function range
Note that the generated histograms are added to the list of objects in the current directory. It is the user's responsability to delete these histograms.
Example: Assume a 3-d histogram h3 Root > h3->FitSlicesZ(); produces 4 TH2D histograms with h3_0 containing parameter 0(Constant) for a Gaus fit of each cell in X,Y projected along Z with h3_1 containing parameter 1(Mean) for a gaus fit with h3_2 containing parameter 2(StdDev) for a gaus fit with h3_chi2 containing the chisquare/number of degrees of freedom for a gaus fit
Root > h3->Fit(0,15,22,0,0,10); same as above, but only for bins 15 to 22 along X and only for cells in X,Y for which the corresponding projection along Z has more than cut bins filled.
NOTE: To access the generated histograms in the current directory, do eg: TH2D h3_1 = (TH2D)gDirectory->Get("h3_1");
Definition at line 828 of file GCube.cxx.
References GetBin().
|
override |
Definition at line 928 of file GCube.cxx.
Referenced by DoIntegral(), FitSlicesZ(), GCubeF::GetBinContent(), GCubeD::GetBinContent(), GetStats(), Merge(), Rebin3D(), GCubeF::SetBinContent(), GCubeD::SetBinContent(), and Smooth().
|
virtual |
|
virtual |
Definition at line 1039 of file GCube.cxx.
References GetCovariance().
|
virtual |
Definition at line 1061 of file GCube.cxx.
References GetStats().
Referenced by GetCorrelationFactor().
|
virtual |
|
override |
fill the array stats from the contents of this histogram The array stats must be correctly dimensionned in the calling program. stats[0] = sumw stats[1] = sumw2 stats[2] = sumwx stats[3] = sumwx2 stats[4] = sumwy stats[5] = sumwy2 stats[6] = sumwxy stats[7] = sumwz stats[8] = sumwz2 stats[9] = sumwxz stats[10] = sumwyz
If no axis-subranges are specified (via TAxis::SetRange), the array stats is simply a copy of the statistics quantities computed at filling time. If sub-ranges are specified, the function recomputes these quantities from the bin contents in the current axis ranges.
Note that the mean value/RMS is computed using the bins in the currently defined ranges (see TAxis::SetRange). By default the ranges include all bins from 1 to nbins included, excluding underflows and overflows. To force the underflows and overflows in the computation, one must call the static function TH1::StatOverflows(kTRUE) before filling the histogram.
Definition at line 1157 of file GCube.cxx.
References BufferEmpty(), fTsumwxy, fTsumwxz, fTsumwy, fTsumwy2, fTsumwyz, fTsumwz, fTsumwz2, and GetBin().
Referenced by GetCovariance(), Merge(), Projection(), and Rebin3D().
|
override |
|
virtual |
Definition at line 1280 of file GCube.cxx.
References DoIntegral().
|
virtual |
Definition at line 1292 of file GCube.cxx.
References DoIntegral().
|
override |
|
override |
Given a point P(x,y,z), Interpolate approximates the value via trilinear interpolation based on the 8 nearest bin center points ( corner of the cube surronding the points) The Algorithm is described in http://en.wikipedia.org/wiki/Trilinear_interpolation The given values (x,y,z) must be between first bin center and last bin center for each coordinate:
fXAxis.GetBinCenter(1) < x < fXaxis.GetBinCenter(nbinX) AND fYAxis.GetBinCenter(1) < y < fYaxis.GetBinCenter(nbinY) AND fZAxis.GetBinCenter(1) < z < fZaxis.GetBinCenter(nbinZ)
|
override |
Statistical test of compatibility in shape between THIS histogram and h3, using Kolmogorov test. Default: Ignore under- and overflow bins in comparison
option is a character string to specify options "U" include Underflows in test "O" include Overflows "N" include comparison of normalizations "D" Put out a line of "Debug" printout "M" Return the Maximum Kolmogorov distance instead of prob
The returned function value is the probability of test (much less than one means NOT compatible)
The KS test uses the distance between the pseudo-CDF's obtained from the histogram. Since in more than 1D the order for generating the pseudo-CDF is arbitrary, we use the pseudo-CDF's obtained from all the possible 6 combinatons of the 3 axis. The average of all the maximum distances obtained is used in the tests.
Code adapted by Rene Brun from original HBOOK routine HDIFF
|
override |
Add all histograms in the collection to this histogram. This function computes the min/max for the axes, compute a new number of bins, if necessary, add bin contents, errors and statistics. If overflows are present and limits are different the function will fail. The function returns the total number of entries in the result histogram if the merge is successfull, -1 otherwise.
IMPORTANT remark. The 2 axis x and y may have different number of bins and different limits, BUT the largest bin width must be a multiple of the smallest bin width and the upper limit must also be a multiple of the bin width.
Definition at line 1602 of file GCube.cxx.
References BufferEmpty(), Copy(), Fill(), GetBin(), GetStats(), PutStats(), and Reset().
|
virtual |
|
override |
|
virtual |
if newname is not blank a new temporary histogram hnew is created. else the current histogram is modified (default) The parameter ngroup indicates how many bins along the xaxis/yaxis/zaxis of this have to me merged into one bin of hnew If the original histogram has errors stored (via Sumw2), the resulting histograms has new errors correctly calculated.
examples: if hpxpy is an existing GCube histogram with 40 x 40 x 40 bins hpxpy->Rebin3D(); // merges two bins along the xaxis, yaxis, and zaxis in one in hpxpy // Carefull: previous contents of hpxpy are lost hpxpy->Rebin3D(5); //merges five bins along the xaxis, yaxis, and zaxis in one in hpxpy GCube* hnew = hpxpy->Rebin3D(5,"hnew"); // creates a new histogram hnew // merging 5 bins of h1 along the xaxis, yaxis, and zaxis in one bin
NOTE : If ngroup is not an exact divider of the number of bins, along the xaxis/yaxis/zaxis the top limit(s) of the rebinned histogram is changed to the upper edge of the bin=newbins*ngroup and the corresponding bins are added to the overflow bin. Statistics will be recomputed from the new bin contents.
Definition at line 2118 of file GCube.cxx.
References GetBin(), GetStats(), and PutStats().
|
override |
Definition at line 2459 of file GCube.cxx.
References fMatrix, fTsumwxy, fTsumwy, and fTsumwy2.
Referenced by BufferEmpty(), BufferFill(), Merge(), GCubeF::Reset(), and GCubeD::Reset().
|
virtual |
When the mouse is moved in a pad containing a 3-d view of this histogram a second canvas shows a projection type given as option. To stop the generation of the projections, delete the canvas containing the projection. option may contain a combination of the characters x,y,z,e option = "x" return the x projection into a TH1D histogram option = "y" return the y projection into a TH1D histogram option = "z" return the z projection into a TH1D histogram option = "xy" return the x versus y projection into a TH2D histogram option = "yx" return the y versus x projection into a TH2D histogram option = "xz" return the x versus z projection into a TH2D histogram option = "zx" return the z versus x projection into a TH2D histogram option = "yz" return the y versus z projection into a TH2D histogram option = "zy" return the z versus y projection into a TH2D histogram option can also include the drawing option for the projection, eg to draw the xy projection using the draw option "box" do myhist.SetShowProjection("xy box"); This function is typically called from the context menu. NB: the notation "a vs b" means "a" vertical and "b" horizontal
|
override |
|
override |
|
override |
|
protected |
! Transient pointer to the 2D-Matrix used in Draw() or GetMatrix()
Definition at line 101 of file GCube.h.
Referenced by ClassImp(), Copy(), GCube(), GCubeF::GetMatrix(), GCubeD::GetMatrix(), and Reset().
|
protected |
Definition at line 96 of file GCube.h.
Referenced by ClassImp(), Copy(), Fill(), GCube(), GetStats(), PutStats(), and Reset().
|
protected |
Definition at line 99 of file GCube.h.
Referenced by Fill(), GetStats(), and PutStats().
|
protected |
Definition at line 94 of file GCube.h.
Referenced by ClassImp(), Copy(), Fill(), GCube(), GetStats(), PutStats(), and Reset().
|
protected |
Definition at line 95 of file GCube.h.
Referenced by ClassImp(), Copy(), Fill(), GCube(), GetStats(), PutStats(), and Reset().
|
protected |
Definition at line 100 of file GCube.h.
Referenced by Fill(), GetStats(), and PutStats().
|
protected |
Definition at line 97 of file GCube.h.
Referenced by Fill(), GetStats(), and PutStats().
|
protected |
Definition at line 98 of file GCube.h.
Referenced by Fill(), GetStats(), and PutStats().