Profile Histogram.
Profile histograms are used to display the mean value of Y and its error for each bin in X. The displayed error is by default the standard error on the mean (i.e. the standard deviation divided by the sqrt(n) ). Profile histograms are in many cases an elegant replacement of two-dimensional histograms. The inter-relation of two measured quantities X and Y can always be visualized by a two-dimensional histogram or scatter plot, but if Y is an unknown (but single-valued) approximate function of X, this function is displayed by a profile histogram with much better precision than by a scatter plot.
The following formulae show the cumulated contents (capital letters) and the values displayed by the printing or plotting routines (small letters) of the elements for bin j.
\[ \begin{align} H(j) &= \sum w \cdot Y \\ E(j) &= \sum w \cdot Y^2 \\ W(j) &= \sum w & &\text{if weights different from 1, the number of bin effective entries is used} \\ h(j) &= H(j) / W(j) & &\text{mean of Y,} \\ s(j) &= \sqrt{E(j)/W(j)- h(j)^2} & &\text{standard deviation of Y} \\ e(j) &= s(j)/\sqrt{W(j)} & &\text{standard error on the mean} \\ \end{align} \]
The bin content is always the mean of the Y values, but errors change depending on options:
\[ \begin{align} \text{GetBinContent}(j) &= h(j) \\ \text{GetBinError}(j) &= \begin{cases} e(j) &\text{if option="" (default). Error of the mean of all y values.} \\ s(j) &\text{if option="s". Standard deviation of all y values.} \\ \begin{cases} e(j) &\text{if } h(j) \ne 0 \\ 1/\sqrt{12 N} &\text{if } h(j)=0 \end{cases} &\text{if option="i". This is useful for storing integers such as ADC counts.} \\ 1/\sqrt{W(j)} &\text{if option="g". Error of a weighted mean for combining measurements with variances of } w. \\ \end{cases} \end{align} \]
In the special case where s(j) is zero (eg, case of 1 entry only in one bin) the bin error e(j) is computed from the average of the s(j) for all bins if the static function TProfile::Approximate() has been called. This simple/crude approximation was suggested in order to keep the bin during a fit operation. But note that this approximation is not the default behaviour. See also TProfile::BuildOptions for more on error options.
Definition at line 32 of file TProfile.h.
Public Types | |
| enum | { kNoAxis = 0 , kXaxis = (1ULL << (0)) , kYaxis = (1ULL << (1)) , kZaxis = (1ULL << (2)) , kAllAxes = kXaxis | kYaxis | kZaxis } |
| Enumeration specifying which axes can be extended. More... | |
| enum | { kSingleKey = (1ULL << (0)) , kOverwrite = (1ULL << (1)) , kWriteDelete = (1ULL << (2)) } |
| enum | { kNstat = 13 } |
| Size of statistics data (size of array used in GetStats()/ PutStats ). More... | |
| enum | { kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 , kBitMask = 0x00ffffff } |
| enum | EBinErrorOpt { kNormal = 0 , kPoisson = 1 , kPoisson2 = 2 } |
| Enumeration specifying type of statistics for bin errors. More... | |
| enum | EDeprecatedStatusBits { kObjInCanvas = (1ULL << (3)) } |
| enum | EInconsistencyBits { kFullyConsistent = 0 , kDifferentLabels = (1ULL << (0)) , kDifferentBinLimits = (1ULL << (1)) , kDifferentAxisLimits = (1ULL << (2)) , kDifferentNumberOfBins = (1ULL << (3)) , kDifferentDimensions = (1ULL << (4)) } |
| Enumeration specifying inconsistencies between two histograms, in increasing severity. More... | |
| enum | EStatOverflows { kIgnore = 0 , kConsider = 1 , kNeutral = 2 } |
| Enumeration specifying the way to treat statoverflow. More... | |
| enum | EStatusBits { kNoStats = (1ULL << (9)) , kUserContour = (1ULL << (10)) , kLogX = (1ULL << (15)) , kIsZoomed = (1ULL << (16)) , kNoTitle = (1ULL << (17)) , kIsAverage = (1ULL << (18)) , kIsNotW = (1ULL << (19)) , kAutoBinPTwo = (1ULL << (20)) , kIsHighlight = (1ULL << (21)) } |
| TH1 status bits. More... | |
Public Member Functions | |
| TProfile () | |
| Default constructor for Profile histograms. | |
| TProfile (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Double_t ylow, Double_t yup, Option_t *option="") | |
| Constructor for Profile histograms with variable bin size. | |
| TProfile (const char *name, const char *title, Int_t nbinsx, const Double_t *xbins, Option_t *option="") | |
| Constructor for Profile histograms with variable bin size. | |
| TProfile (const char *name, const char *title, Int_t nbinsx, const Float_t *xbins, Option_t *option="") | |
| Constructor for Profile histograms with variable bin size. | |
| TProfile (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Double_t ylow, Double_t yup, Option_t *option="") | |
| Constructor for Profile histograms with range in y. | |
| TProfile (const char *name, const char *title, Int_t nbinsx, Double_t xlow, Double_t xup, Option_t *option="") | |
| Normal Constructor for Profile histograms. | |
| TProfile (const TProfile &profile) | |
| Copy constructor. | |
| ~TProfile () override | |
| Default destructor for Profile histograms. | |
| void | AbstractMethod (const char *method) const |
| Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it. | |
| Bool_t | Add (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1) override |
| Replace contents of this profile by the addition of h1 and h2. | |
| Bool_t | Add (const TH1 *h1, Double_t c1=1) override |
| Performs the operation: this = this + c1*h1. | |
| Bool_t | Add (TF1 *h1, Double_t c1=1, Option_t *option="") override |
| Performs the operation: this = this + c1*f1. | |
| void | AddAt (Double_t c, Int_t i) |
| Set the double c value at position i in the array. | |
| void | AddBinContent (Int_t bin) override |
| Increment bin content by 1. | |
| void | AddBinContent (Int_t bin, Double_t w) override |
| Increment bin content by a weight w Passing an out-of-range bin leads to undefined behavior. | |
| void | Adopt (Int_t n, Double_t *array) |
| Adopt array arr into TArrayD, i.e. | |
| virtual Double_t | AndersonDarlingTest (const TH1 *h2, Double_t &advalue) const |
| Same function as above but returning also the test statistic value. | |
| virtual Double_t | AndersonDarlingTest (const TH1 *h2, Option_t *option="") const |
| Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling 2 sample test. | |
| virtual void | AppendPad (Option_t *option="") |
| Append graphics object to current pad. | |
| Double_t | At (Int_t i) const |
| void | Browse (TBrowser *b) override |
| Browse the Histogram object. | |
| Int_t | BufferEmpty (Int_t action=0) override |
| Fill histogram with all entries in the buffer. | |
| void | BuildOptions (Double_t ymin, Double_t ymax, Option_t *option) |
| Set Profile histogram structure and options. | |
| virtual Bool_t | CanExtendAllAxes () const |
| Returns true if all axes are extendable. | |
| ULong_t | CheckedHash () |
| Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object. | |
| Double_t | Chi2Test (const TH1 *h2, Option_t *option="WW", Double_t *res=nullptr) const override |
| Run a Chi2Test between a TProfileD and another histogram. | |
| virtual Double_t | Chi2TestX (const TH1 *h2, Double_t &chi2, Int_t &ndf, Int_t &igood, Option_t *option="UU", Double_t *res=nullptr) const |
| The computation routine of the Chisquare test. | |
| virtual Double_t | Chisquare (TF1 *f1, Option_t *option="") const |
| Compute and return the chisquare of this histogram with respect to a function The chisquare is computed by weighting each histogram point by the bin error By default the full range of the histogram is used, unless TAxis::SetRange or TAxis::SetRangeUser was called before. | |
| virtual const char * | ClassName () const |
| Returns name of class to which the object belongs. | |
| void | Clear (Option_t *option="") override |
| Set name and title to empty strings (""). | |
| virtual void | ClearUnderflowAndOverflow () |
| Remove all the content from the underflow and overflow bins, without changing the number of entries After calling this method, every undeflow and overflow bins will have content 0.0 The Sumw2 is also cleared, since there is no more content in the bins. | |
| TObject * | Clone (const char *newname="") const override |
| Make a complete copy of the underlying object. | |
| Int_t | Compare (const TObject *obj) const override |
| Compare two TNamed objects. | |
| virtual Double_t | ComputeIntegral (Bool_t onlyPositive=false, Option_t *option="") |
| Compute integral (normalized cumulative sum of bins) w/o under/overflows The result is stored in fIntegral and used by the GetRandom functions. | |
| void | Copy (TArrayD &array) const |
| void | Copy (TAttFill &attfill) const |
| void | Copy (TAttLine &attline) const |
| void | Copy (TAttMarker &attmarker) const |
| void | Copy (TObject &hnew) const override |
| Copy a Profile histogram to a new profile histogram. | |
| virtual void | Delete (Option_t *option="") |
| Delete this object. | |
| virtual void | DirectoryAutoAdd (TDirectory *) |
| Callback to perform the automatic addition of the histogram to the given directory. | |
| Int_t | DistancetoLine (Int_t px, Int_t py, Double_t xp1, Double_t yp1, Double_t xp2, Double_t yp2) |
| Int_t | DistancetoPrimitive (Int_t px, Int_t py) override |
| Compute distance from point px,py to a line. | |
| Bool_t | Divide (const TH1 *h1) override |
| Divide this profile by h1. | |
| Bool_t | Divide (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="") override |
| Replace contents of this profile by the division of h1 by h2. | |
| Bool_t | Divide (TF1 *h1, Double_t c1=1) override |
| Performs the operation: this = this/(c1*f1). | |
| void | Draw (Option_t *option="") override |
| Draw this histogram with options. | |
| virtual void | DrawClass () const |
| Draw class inheritance tree of the class to which this object belongs. | |
| virtual TObject * | DrawClone (Option_t *option="") const |
| Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1). | |
| virtual TH1 * | DrawCopy (Option_t *option="", const char *name_postfix="_copy") const |
| Copy this histogram and Draw in the current pad. | |
| virtual TH1 * | DrawNormalized (Option_t *option="", Double_t norm=1) const |
| Draw a normalized copy of this histogram. | |
| virtual void | DrawPanel () |
| Display a panel with all histogram drawing options. | |
| virtual void | Dump () const |
| Dump contents of object on stdout. | |
| virtual void | Error (const char *method, const char *msgfmt,...) const |
| Issue error message. | |
| virtual void | Eval (TF1 *f1, Option_t *option="") |
| Evaluate function f1 at the center of bins of this histogram. | |
| virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
| Execute method on this object with the given parameter string, e.g. | |
| virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
| Execute method on this object with parameters stored in the TObjArray. | |
| void | ExecuteEvent (Int_t event, Int_t px, Int_t py) override |
| Execute action corresponding to one event. | |
| void | ExtendAxis (Double_t x, TAxis *axis) override |
| Profile histogram is resized along x axis such that x is in the axis range. | |
| virtual void | Fatal (const char *method, const char *msgfmt,...) const |
| Issue fatal error message. | |
| virtual TH1 * | FFT (TH1 *h_output, Option_t *option) |
| This function allows to do discrete Fourier transforms of TH1 and TH2. | |
| Int_t | Fill (const char *namex, Double_t y) override |
| Fill a Profile histogram (no weights). | |
| virtual Int_t | Fill (const char *namex, Double_t y, Double_t w) |
| Fill a Profile histogram with weights. | |
| Int_t | Fill (Double_t x, Double_t y) override |
| Fill a Profile histogram (no weights). | |
| virtual Int_t | Fill (Double_t x, Double_t y, Double_t w) |
| Fill a Profile histogram with weights. | |
| virtual void | FillBuffer (char *&buffer) |
| Encode TNamed into output buffer. | |
| void | FillN (Int_t ntimes, const Double_t *x, const Double_t *y, const Double_t *w, Int_t stride=1) override |
| Fill a Profile histogram with weights. | |
| void | FillRandom (const char *fname, Int_t ntimes=5000, TRandom *rng=nullptr) |
| Fill histogram following distribution in function fname. | |
| virtual void | FillRandom (TF1 *f1, Int_t ntimes=5000, TRandom *rng=nullptr) |
| virtual void | FillRandom (TH1 *h, Int_t ntimes=5000, TRandom *rng=nullptr) |
| Fill histogram following distribution in histogram h. | |
| virtual Int_t | FindBin (Double_t x, Double_t y=0, Double_t z=0) |
| Return Global bin number corresponding to x,y,z. | |
| virtual Int_t | FindFirstBinAbove (Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const |
| Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1. | |
| virtual Int_t | FindFixBin (Double_t x, Double_t y=0, Double_t z=0) const |
| Return Global bin number corresponding to x,y,z. | |
| virtual Int_t | FindLastBinAbove (Double_t threshold=0, Int_t axis=1, Int_t firstBin=1, Int_t lastBin=-1) const |
| Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1. | |
| TObject * | FindObject (const char *name) const override |
| Search object named name in the list of functions. | |
| TObject * | FindObject (const TObject *obj) const override |
| Search object obj in the list of functions. | |
| virtual TFitResultPtr | Fit (const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0) |
| Fit histogram with function fname. | |
| virtual TFitResultPtr | Fit (TF1 *f1, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0) |
| Fit histogram with the function pointer f1. | |
| virtual void | FitPanel () |
| Display a panel with all histogram fit options. | |
| Double_t * | GetArray () |
| const Double_t * | GetArray () const |
| TH1 * | GetAsymmetry (TH1 *h2, Double_t c2=1, Double_t dc2=0) |
| Return a histogram containing the asymmetry of this histogram with h2, where the asymmetry is defined as: | |
| Double_t | GetAt (Int_t i) const override |
| virtual Color_t | GetAxisColor (Option_t *axis="X") const |
| Return the number of divisions for "axis". | |
| virtual Float_t | GetBarOffset () const |
| virtual Float_t | GetBarWidth () const |
| virtual Int_t | GetBin (Int_t binx, Int_t biny=0, Int_t binz=0) const |
| Return Global bin number corresponding to binx,y,z. | |
| virtual Double_t | GetBinCenter (Int_t bin) const |
| Return bin center for 1D histogram. | |
| Double_t | GetBinContent (Int_t bin) const override |
| Return bin content of a Profile histogram. | |
| Double_t | GetBinContent (Int_t bin, Int_t) const override |
| Double_t | GetBinContent (Int_t bin, Int_t, Int_t) const override |
| virtual Double_t | GetBinEffectiveEntries (Int_t bin) const |
| Return bin effective entries for a weighted filled Profile histogram. | |
| virtual Double_t | GetBinEntries (Int_t bin) const |
| Return bin entries of a Profile histogram. | |
| Double_t | GetBinError (Int_t bin) const override |
| Return bin error of a Profile histogram. | |
| Double_t | GetBinError (Int_t bin, Int_t) const override |
| Double_t | GetBinError (Int_t bin, Int_t, Int_t) const override |
| virtual Double_t | GetBinErrorLow (Int_t bin) const |
| Return lower error associated to bin number bin. | |
| virtual EBinErrorOpt | GetBinErrorOption () const |
| virtual Double_t | GetBinErrorUp (Int_t bin) const |
| Return upper error associated to bin number bin. | |
| virtual Double_t | GetBinLowEdge (Int_t bin) const |
| Return bin lower edge for 1D histogram. | |
| virtual TArrayD * | GetBinSumw2 () |
| virtual const TArrayD * | GetBinSumw2 () const |
| virtual Double_t | GetBinWidth (Int_t bin) const |
| Return bin width for 1D histogram. | |
| virtual Double_t | GetBinWithContent (Double_t c, Int_t &binx, Int_t firstx=0, Int_t lastx=0, Double_t maxdiff=0) const |
| Compute first binx in the range [firstx,lastx] for which diff = abs(bin_content-c) <= maxdiff. | |
| virtual void | GetBinXYZ (Int_t binglobal, Int_t &binx, Int_t &biny, Int_t &binz) const |
| Return binx, biny, binz corresponding to the global bin number globalbin see TH1::GetBin function above. | |
| const Double_t * | GetBuffer () const |
| Int_t | GetBufferLength () const |
| Int_t | GetBufferSize () const |
| virtual Double_t | GetCellContent (Int_t binx, Int_t biny) const |
| virtual Double_t | GetCellError (Int_t binx, Int_t biny) const |
| virtual void | GetCenter (Double_t *center) const |
| Fill array with center of bins for 1D histogram Better to use h1.GetXaxis()->GetCenter(center). | |
| virtual Int_t | GetContour (Double_t *levels=nullptr) |
| Return contour values into array levels if pointer levels is non zero. | |
| virtual Double_t | GetContourLevel (Int_t level) const |
| Return value of contour number level. | |
| virtual Double_t | GetContourLevelPad (Int_t level) const |
| Return the value of contour number "level" in Pad coordinates. | |
| TH1 * | GetCumulative (Bool_t forward=kTRUE, const char *suffix="_cumulative") const |
| Return a pointer to a histogram containing the cumulative content. | |
| virtual Int_t | GetDimension () const |
| TDirectory * | GetDirectory () const |
| virtual Option_t * | GetDrawOption () const |
| Get option used by the graphics system to draw this object. | |
| virtual Double_t | GetEffectiveEntries () const |
| Number of effective entries of the histogram. | |
| virtual Double_t | GetEntries () const |
| Return the current number of entries. | |
| Option_t * | GetErrorOption () const |
| Return option to compute profile errors. | |
| virtual Color_t | GetFillColor () const |
| Return the fill area color. | |
| virtual Style_t | GetFillStyle () const |
| Return the fill area style. | |
| virtual TF1 * | GetFunction (const char *name) const |
| Return pointer to function with name. | |
| virtual const char * | GetIconName () const |
| Returns mime type name of object. | |
| virtual Double_t * | GetIntegral () |
| Return a pointer to the array of bins integral. | |
| virtual Double_t | GetKurtosis (Int_t axis=1) const |
| virtual Color_t | GetLabelColor (Option_t *axis="X") const |
| Return the "axis" label color. | |
| virtual Style_t | GetLabelFont (Option_t *axis="X") const |
| Return the "axis" label font. | |
| virtual Float_t | GetLabelOffset (Option_t *axis="X") const |
| Return the "axis" label offset. | |
| virtual Float_t | GetLabelSize (Option_t *axis="X") const |
| Return the "axis" label size. | |
| virtual Color_t | GetLineColor () const |
| Return the line color. | |
| virtual Style_t | GetLineStyle () const |
| Return the line style. | |
| virtual Width_t | GetLineWidth () const |
| Return the line width. | |
| TList * | GetListOfFunctions () const |
| virtual void | GetLowEdge (Double_t *edge) const |
| Fill array with low edge of bins for 1D histogram Better to use h1.GetXaxis()->GetLowEdge(edge). | |
| virtual Color_t | GetMarkerColor () const |
| Return the marker color. | |
| virtual Size_t | GetMarkerSize () const |
| Return the marker size. | |
| virtual Style_t | GetMarkerStyle () const |
| Return the marker style. | |
| virtual Double_t | GetMaximum (Double_t maxval=FLT_MAX) const |
| Return maximum value smaller than maxval of bins in the range, unless the value has been overridden by TH1::SetMaximum, in which case it returns that value. | |
| virtual Int_t | GetMaximumBin () const |
| Return location of bin with maximum value in the range. | |
| virtual Int_t | GetMaximumBin (Int_t &locmax, Int_t &locmay, Int_t &locmaz) const |
| Return location of bin with maximum value in the range. | |
| virtual Double_t | GetMaximumStored () const |
| virtual Double_t | GetMean (Int_t axis=1) const |
| For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis. | |
| virtual Double_t | GetMeanError (Int_t axis=1) const |
| Return standard error of mean of this histogram along the X axis. | |
| virtual Double_t | GetMinimum (Double_t minval=-FLT_MAX) const |
| Return minimum value larger than minval of bins in the range, unless the value has been overridden by TH1::SetMinimum, in which case it returns that value. | |
| virtual void | GetMinimumAndMaximum (Double_t &min, Double_t &max) const |
| Retrieve the minimum and maximum values in the histogram. | |
| virtual Int_t | GetMinimumBin () const |
| Return location of bin with minimum value in the range. | |
| virtual Int_t | GetMinimumBin (Int_t &locmix, Int_t &locmiy, Int_t &locmiz) const |
| Return location of bin with minimum value in the range. | |
| virtual Double_t | GetMinimumStored () const |
| const char * | GetName () const override |
| Returns name of object. | |
| virtual Int_t | GetNbinsX () const |
| virtual Int_t | GetNbinsY () const |
| virtual Int_t | GetNbinsZ () const |
| virtual Int_t | GetNcells () const |
| virtual Int_t | GetNdivisions (Option_t *axis="X") const |
| Return the number of divisions for "axis". | |
| virtual Double_t | GetNormFactor () const |
| char * | GetObjectInfo (Int_t px, Int_t py) const override |
| Redefines TObject::GetObjectInfo. | |
| Option_t * | GetOption () const override |
| TVirtualHistPainter * | GetPainter (Option_t *option="") |
| Return pointer to painter. | |
| virtual Int_t | GetQuantiles (Int_t n, Double_t *xp, const Double_t *p=nullptr) |
| Compute Quantiles for this histogram. | |
| virtual Double_t | GetRandom (TRandom *rng=nullptr, Option_t *option="") const |
| Return a random number distributed according the histogram bin contents. | |
| Double_t | GetRMS (Int_t axis=1) const |
| This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RMS). | |
| Double_t | GetRMSError (Int_t axis=1) const |
| Int_t | GetSize () const |
| virtual Double_t | GetSkewness (Int_t axis=1) const |
| EStatOverflows | GetStatOverflows () const |
| Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more information. | |
| void | GetStats (Double_t *stats) const override |
| fill the array stats from the contents of this profile. | |
| virtual Double_t | GetStdDev (Int_t axis=1) const |
| Returns the Standard Deviation (Sigma). | |
| virtual Double_t | GetStdDevError (Int_t axis=1) const |
| Return error of standard deviation estimation for Normal distribution. | |
| Stat_t | GetSum () const |
| Double_t | GetSumOfAllWeights (const bool includeOverflow, Double_t *sumWeightSquare=nullptr) const |
| Return the sum of all weights and optionally also the sum of weight squares. | |
| virtual Double_t | GetSumOfWeights () const |
| Return the sum of weights across all bins excluding under/overflows. | |
| virtual TArrayD * | GetSumw2 () |
| virtual const TArrayD * | GetSumw2 () const |
| virtual Int_t | GetSumw2N () const |
| virtual Float_t | GetTickLength (Option_t *axis="X") const |
| Return the "axis" tick length. | |
| const char * | GetTitle () const override |
| Returns title of object. | |
| virtual Style_t | GetTitleFont (Option_t *axis="X") const |
| Return the "axis" title font. | |
| virtual Float_t | GetTitleOffset (Option_t *axis="X") const |
| Return the "axis" title offset. | |
| virtual Float_t | GetTitleSize (Option_t *axis="X") const |
| Return the "axis" title size. | |
| virtual UInt_t | GetUniqueID () const |
| Return the unique object id. | |
| TAxis * | GetXaxis () |
| const TAxis * | GetXaxis () const |
| TAxis * | GetYaxis () |
| const TAxis * | GetYaxis () const |
| virtual Double_t | GetYmax () const |
| virtual Double_t | GetYmin () const |
| TAxis * | GetZaxis () |
| const TAxis * | GetZaxis () const |
| virtual Bool_t | HandleTimer (TTimer *timer) |
| Execute action in response of a timer timing out. | |
| ULong_t | Hash () const override |
| Return hash value for this object. | |
| Bool_t | HasInconsistentHash () const |
| Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e. | |
| virtual void | Info (const char *method, const char *msgfmt,...) const |
| Issue info message. | |
| virtual Bool_t | InheritsFrom (const char *classname) const |
| Returns kTRUE if object inherits from class "classname". | |
| virtual Bool_t | InheritsFrom (const TClass *cl) const |
| Returns kTRUE if object inherits from TClass cl. | |
| virtual void | Inspect () const |
| Dump contents of this object in a graphics canvas. | |
| virtual Double_t | Integral (Int_t binx1, Int_t binx2, Option_t *option="") const |
| Return integral of bin contents in range [binx1,binx2]. | |
| virtual Double_t | Integral (Option_t *option="") const |
| Return integral of bin contents. | |
| virtual Double_t | IntegralAndError (Int_t binx1, Int_t binx2, Double_t &err, Option_t *option="") const |
| Return integral of bin contents in range [binx1,binx2] and its error. | |
| virtual Double_t | Interpolate (Double_t x) const |
| Given a point x, approximates the value via linear interpolation based on the two nearest bin centers. | |
| virtual Double_t | Interpolate (Double_t x, Double_t y) const |
| 2d Interpolation. Not yet implemented. | |
| virtual Double_t | Interpolate (Double_t x, Double_t y, Double_t z) const |
| 3d Interpolation. Not yet implemented. | |
| void | InvertBit (UInt_t f) |
| TClass * | IsA () const override |
| Bool_t | IsBinOverflow (Int_t bin, Int_t axis=0) const |
| Return true if the bin is overflow. | |
| Bool_t | IsBinUnderflow (Int_t bin, Int_t axis=0) const |
| Return true if the bin is underflow. | |
| Bool_t | IsDestructed () const |
| IsDestructed. | |
| virtual Bool_t | IsEqual (const TObject *obj) const |
| Default equal comparison (objects are equal if they have the same address in memory). | |
| virtual Bool_t | IsFolder () const |
| Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). | |
| virtual Bool_t | IsHighlight () const |
| Bool_t | IsOnHeap () const |
| Bool_t | IsSortable () const override |
| virtual Bool_t | IsTransparent () const |
| Bool_t | IsZombie () const |
| virtual Double_t | KolmogorovTest (const TH1 *h2, Option_t *option="") const |
| Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test. | |
| void | LabelsDeflate (Option_t *axis="X") override |
| Reduce the number of bins for this axis to the number of bins having a label. | |
| void | LabelsInflate (Option_t *axis="X") override |
| Double the number of bins for axis. | |
| void | LabelsOption (Option_t *option="h", Option_t *axis="X") override |
| Set option(s) to draw axis with labels. | |
| void | ls (Option_t *option="") const override |
| List TNamed name and title. | |
| void | MayNotUse (const char *method) const |
| Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). | |
| Long64_t | Merge (TCollection *list, Option_t *option) |
| Add all histograms in the collection to this histogram. | |
| Long64_t | Merge (TCollection *list) override |
| Merge all histograms in the collection in this histogram. | |
| virtual void | Modify () |
| virtual void | Modify () |
| virtual void | Modify () |
| virtual void | ModifyOn (TVirtualPad &pad) |
| virtual void | ModifyOn (TVirtualPad &pad) |
| virtual void | ModifyOn (TVirtualPad &pad) |
| Bool_t | Multiply (const TH1 *h1) override |
| Multiply this profile by h1. | |
| Bool_t | Multiply (const TH1 *h1, const TH1 *h2, Double_t c1=1, Double_t c2=1, Option_t *option="") override |
| Replace contents of this profile by multiplication of h1 by h2. | |
| Bool_t | Multiply (TF1 *h1, Double_t c1=1) override |
| Performs the operation: this = this*c1*f1. | |
| virtual void | Normalize (Option_t *option="") |
| Normalize a histogram to its integral or to its maximum. | |
| virtual Bool_t | Notify () |
| This method must be overridden to handle object notification (the base implementation is no-op). | |
| void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
| Use this method to declare a method obsolete. | |
| void | operator delete (void *, size_t) |
| Operator delete for sized deallocation. | |
| void | operator delete (void *ptr) |
| Operator delete. | |
| void | operator delete (void *ptr, void *vp) |
| Only called by placement new when throwing an exception. | |
| void | operator delete[] (void *, size_t) |
| Operator delete [] for sized deallocation. | |
| void | operator delete[] (void *ptr) |
| Operator delete []. | |
| void | operator delete[] (void *ptr, void *vp) |
| Only called by placement new[] when throwing an exception. | |
| void * | operator new (size_t sz) |
| void * | operator new (size_t sz, void *vp) |
| void * | operator new[] (size_t sz) |
| void * | operator new[] (size_t sz, void *vp) |
| TProfile & | operator= (const TProfile &profile) |
| Double_t & | operator[] (Int_t i) |
| Double_t | operator[] (Int_t i) const |
| void | Paint (Option_t *option="") override |
| Control routine to paint any kind of histograms. | |
| virtual void | Pop () |
| Pop on object drawn in a pad to the top of the display list. | |
| void | Print (Option_t *option="") const override |
| Print some global quantities for this histogram. | |
| TH1D * | ProjectionX (const char *name="_px", Option_t *option="e") const |
| Project this profile into a 1-D histogram along X. | |
| void | PutStats (Double_t *stats) override |
| Replace current statistics with the values in array stats. | |
| virtual Int_t | Read (const char *name) |
| Read contents of object with specified name from the current directory. | |
| TH1 * | Rebin (Int_t ngroup=2, const char *newname="", const Double_t *xbins=nullptr) override |
| Rebin this profile grouping ngroup bins together. | |
| virtual void | RebinAxis (Double_t x, TAxis *axis) |
| virtual TH1 * | RebinX (Int_t ngroup=2, const char *newname="") |
| virtual void | Rebuild (Option_t *option="") |
| Using the current bin info, recompute the arrays for contents and errors. | |
| void | RecursiveRemove (TObject *obj) override |
| Recursively remove object from the list of functions. | |
| void | Reset () |
| void | Reset (Double_t val) |
| void | Reset (Option_t *option="") override |
| Reset contents of a Profile histogram. | |
| virtual void | ResetAttFill (Option_t *option="") |
| virtual void | ResetAttLine (Option_t *option="") |
| virtual void | ResetAttMarker (Option_t *toption="") |
| void | ResetBit (UInt_t f) |
| virtual void | ResetStats () |
| Reset the statistics including the number of entries and replace with values calculated from bin content. | |
| void | SaveAs (const char *filename="hist", Option_t *option="") const override |
| Save the histogram as .csv, .tsv or .txt. | |
| virtual void | SaveFillAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1001) |
| virtual void | SaveLineAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t widdef=1) |
| virtual void | SaveMarkerAttributes (std::ostream &out, const char *name, Int_t coldef=1, Int_t stydef=1, Int_t sizdef=1) |
| void | SavePrimitive (std::ostream &out, Option_t *option="") override |
| Save primitive as a C++ statement(s) on output stream out. | |
| void | Scale (Double_t c1=1, Option_t *option="") override |
| Multiply this profile by a constant c1. | |
| void | Set (Int_t n) override |
| Set size of this array to n doubles. | |
| void | Set (Int_t n, const Double_t *array) |
| Set size of this array to n doubles and set the contents This function should not be called if the array was declared via Adopt. | |
| void | SetAt (Double_t v, Int_t i) override |
| virtual void | SetAxisColor (Color_t color=1, Option_t *axis="X") |
| Set color to draw the axis line and tick marks. | |
| virtual void | SetAxisRange (Double_t xmin, Double_t xmax, Option_t *axis="X") |
| Set the "axis" range. | |
| virtual void | SetBarOffset (Float_t offset=0.25) |
| Set the bar offset as fraction of the bin width for drawing mode "B". | |
| virtual void | SetBarWidth (Float_t width=0.5) |
| Set the width of bars as fraction of the bin width for drawing mode "B". | |
| virtual void | SetBinContent (Int_t bin, Double_t content) |
| Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater than the number of bins and the timedisplay option is set or CanExtendAllAxes(), the number of bins is automatically doubled to accommodate the new bin. | |
| virtual void | SetBinContent (Int_t bin, Int_t, Double_t content) |
| virtual void | SetBinContent (Int_t bin, Int_t, Int_t, Double_t content) |
| virtual void | SetBinEntries (Int_t bin, Double_t w) |
| Set the number of entries in bin. | |
| virtual void | SetBinError (Int_t bin, Double_t error) |
| Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empty bin the bin error is set by default to the square root of their content. | |
| virtual void | SetBinError (Int_t binx, Int_t biny, Double_t error) |
| See convention for numbering bins in TH1::GetBin. | |
| virtual void | SetBinError (Int_t binx, Int_t biny, Int_t binz, Double_t error) |
| See convention for numbering bins in TH1::GetBin. | |
| virtual void | SetBinErrorOption (EBinErrorOpt type) |
| void | SetBins (Int_t nbins, Double_t xmin, Double_t xmax) override |
| Redefine x axis parameters. | |
| void | SetBins (Int_t nx, const Double_t *xbins) override |
| Redefine x axis parameters. | |
| void | SetBinsLength (Int_t n=-1) override |
| Set total number of bins including under/overflow. | |
| void | SetBit (UInt_t f) |
| void | SetBit (UInt_t f, Bool_t set) |
| Set or unset the user status bits as specified in f. | |
| void | SetBuffer (Int_t bufsize, Option_t *option="") override |
| Set the buffer size in units of 8 bytes (double). | |
| virtual UInt_t | SetCanExtend (UInt_t extendBitMask) |
| Make the histogram axes extendable / not extendable according to the bit mask returns the previous bit mask specifying which axes are extendable. | |
| virtual void | SetCellContent (Int_t binx, Int_t biny, Double_t content) |
| virtual void | SetCellError (Int_t binx, Int_t biny, Double_t content) |
| virtual void | SetColors (Color_t linecolor=-1, Color_t markercolor=-1, Color_t fillcolor=-1) |
| Shortcut to set the three histogram colors with a single call. | |
| virtual void | SetContent (const Double_t *content) |
| Replace bin contents by the contents of array content. | |
| virtual void | SetContour (Int_t nlevels, const Double_t *levels=nullptr) |
| Set the number and values of contour levels. | |
| virtual void | SetContourLevel (Int_t level, Double_t value) |
| Set value for one contour level. | |
| virtual void | SetDirectory (TDirectory *dir) |
| By default, when a histogram is created, it is added to the list of histogram objects in the current directory in memory. | |
| virtual void | SetDrawOption (Option_t *option="") |
| Set drawing option for object. | |
| virtual void | SetEntries (Double_t n) |
| virtual void | SetError (const Double_t *error) |
| Replace bin errors by values in array error. | |
| virtual void | SetErrorOption (Option_t *option="") |
| Set option to compute profile errors. | |
| virtual void | SetFillAttributes () |
| virtual void | SetFillColor (Color_t fcolor) |
| Set the fill area color. | |
| void | SetFillColor (TColorNumber) |
| virtual void | SetFillColorAlpha (Color_t fcolor, Float_t falpha) |
| virtual void | SetFillStyle (Style_t fstyle) |
| Set the fill area style. | |
| virtual void | SetHighlight (Bool_t set=kTRUE) |
| Set highlight (enable/disable) mode for the histogram by default highlight mode is disable. | |
| virtual void | SetLabelColor (Color_t color=1, Option_t *axis="X") |
| Set axis labels color. | |
| virtual void | SetLabelFont (Style_t font=62, Option_t *axis="X") |
| Set font number used to draw axis labels. | |
| virtual void | SetLabelOffset (Float_t offset=0.005, Option_t *axis="X") |
| Set offset between axis and axis' labels. | |
| virtual void | SetLabelSize (Float_t size=0.02, Option_t *axis="X") |
| Set size of axis' labels. | |
| virtual void | SetLineAttributes () |
| virtual void | SetLineColor (Color_t lcolor) |
| Set the line color. | |
| void | SetLineColor (TColorNumber lcolor) |
| virtual void | SetLineColorAlpha (Color_t lcolor, Float_t lalpha) |
| virtual void | SetLineStyle (Style_t lstyle) |
| Set the line style. | |
| virtual void | SetLineWidth (Width_t lwidth) |
| Set the line width. | |
| virtual void | SetMarkerAttributes () |
| virtual void | SetMarkerColor (Color_t mcolor=1) |
| Set the marker color. | |
| void | SetMarkerColor (TColorNumber lcolor) |
| virtual void | SetMarkerColorAlpha (Color_t mcolor, Float_t malpha) |
| virtual void | SetMarkerSize (Size_t msize=1) |
| Set the marker size. | |
| virtual void | SetMarkerStyle (Style_t mstyle=1) |
| Set the marker style. | |
| virtual void | SetMaximum (Double_t maximum=-1111) |
| virtual void | SetMinimum (Double_t minimum=-1111) |
| void | SetName (const char *name) override |
| Change the name of this histogram. | |
| void | SetNameTitle (const char *name, const char *title) override |
| Change the name and title of this histogram. | |
| virtual void | SetNdivisions (Int_t n=510, Option_t *axis="X") |
| Set the number of divisions to draw an axis. | |
| virtual void | SetNormFactor (Double_t factor=1) |
| virtual void | SetOption (Option_t *option=" ") |
| void | SetStatOverflows (EStatOverflows statOverflows) |
| See GetStatOverflows for more information. | |
| virtual void | SetStats (Bool_t stats=kTRUE) |
| Set statistics option on/off. | |
| virtual void | SetTickLength (Float_t length=0.02, Option_t *axis="X") |
| Set the axis' tick marks length. | |
| void | SetTitle (const char *title) override |
| Change/set the title. | |
| virtual void | SetTitleFont (Style_t font=62, Option_t *axis="X") |
| Set the axis' title font. | |
| virtual void | SetTitleOffset (Float_t offset=1, Option_t *axis="X") |
| Specify a parameter offset to control the distance between the axis and the axis' title. | |
| virtual void | SetTitleSize (Float_t size=0.02, Option_t *axis="X") |
| Set the axis' title size. | |
| virtual void | SetUniqueID (UInt_t uid) |
| Set the unique object id. | |
| virtual void | SetXTitle (const char *title) |
| virtual void | SetYTitle (const char *title) |
| virtual void | SetZTitle (const char *title) |
| virtual TH1 * | ShowBackground (Int_t niter=20, Option_t *option="same") |
| This function calculates the background spectrum in this histogram. | |
| virtual Int_t | ShowPeaks (Double_t sigma=2, Option_t *option="", Double_t threshold=0.05) |
| Interface to TSpectrum::Search. | |
| std::size_t | size () const |
| virtual Int_t | Sizeof () const |
| Return size of the TNamed part of the TObject. | |
| virtual void | Smooth (Int_t ntimes=1, Option_t *option="") |
| Smooth bin contents of this histogram. | |
| void | Streamer (TBuffer &) override |
| Stream an object of class TProfile. | |
| void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
| void | Sumw2 (Bool_t flag=kTRUE) override |
| Create/delete structure to store sum of squares of weights per bin. | |
| virtual void | SysError (const char *method, const char *msgfmt,...) const |
| Issue system error message. | |
| Bool_t | TestBit (UInt_t f) const |
| Int_t | TestBits (UInt_t f) const |
| void | UseCurrentStyle () override |
| Copy current attributes from/to current style. | |
| virtual void | Warning (const char *method, const char *msgfmt,...) const |
| Issue warning message. | |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
| Write this object to the current directory. | |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
| Write this object to the current directory. | |
Static Public Member Functions | |
| static void | AddDirectory (Bool_t add=kTRUE) |
| Sets the flag controlling the automatic add of histograms in memory. | |
| static Bool_t | AddDirectoryStatus () |
| Check whether TH1-derived classes should register themselves to the current gDirectory. | |
| static void | Approximate (Bool_t approx=kTRUE) |
| Static function to set the fgApproximate flag. | |
| static Int_t | CheckConsistency (const TH1 *h1, const TH1 *h2) |
| Check histogram compatibility. | |
| static TClass * | Class () |
| static const char * | Class_Name () |
| static constexpr Version_t | Class_Version () |
| static const char * | DeclFileName () |
| static Int_t | FitOptionsMake (Option_t *option, Foption_t &Foption) |
| Decode string choptin and fill fitOption structure. | |
| static Int_t | GetDefaultBufferSize () |
| Static function return the default buffer size for automatic histograms the parameter fgBufferSize may be changed via SetDefaultBufferSize. | |
| static Bool_t | GetDefaultSumw2 () |
| Return kTRUE if TH1::Sumw2 must be called when creating new histograms. | |
| static Longptr_t | GetDtorOnly () |
| Return destructor only flag. | |
| static Width_t | GetMarkerLineWidth (Style_t style) |
| static Style_t | GetMarkerStyleBase (Style_t style) |
| static Bool_t | GetObjectStat () |
| Get status of object stat flag. | |
| static TArray * | ReadArray (TBuffer &b, const TClass *clReq) |
| Read TArray object from buffer. | |
| static void | SavePrimitiveFunctions (std::ostream &out, const char *varname, TList *lst) |
| Save list of functions Also can be used by TGraph classes. | |
| static void | SetDefaultBufferSize (Int_t bufsize=1000) |
| Static function to set the default buffer size for automatic histograms. | |
| static void | SetDefaultSumw2 (Bool_t sumw2=kTRUE) |
| When this static function is called with sumw2=kTRUE, all new histograms will automatically activate the storage of the sum of squares of errors, ie TH1::Sumw2 is automatically called. | |
| static void | SetDtorOnly (void *obj) |
| Set destructor only flag. | |
| static void | SetObjectStat (Bool_t stat) |
| Turn on/off tracking of objects in the TObjectTable. | |
| static void | SmoothArray (Int_t NN, Double_t *XX, Int_t ntimes=1) |
| Smooth array xx, translation of Hbook routine hsmoof.F. | |
| static void | StatOverflows (Bool_t flag=kTRUE) |
| if flag=kTRUE, underflows and overflows are used by the Fill functions in the computation of statistics (mean value, StdDev). | |
| static TH1 * | TransformHisto (TVirtualFFT *fft, TH1 *h_output, Option_t *option) |
| For a given transform (first parameter), fills the histogram (second parameter) with the transform output data, specified in the third parameter If the 2nd parameter h_output is empty, a new histogram (TH1D or TH2D) is created and the user is responsible for deleting it. | |
| static void | WriteArray (TBuffer &b, const TArray *a) |
| Write TArray object to buffer. | |
Public Attributes | |
| Double_t * | fArray |
| Int_t | fN |
Protected Types | |
| enum | { kOnlyPrepStep = (1ULL << (3)) } |
Protected Member Functions | |
| virtual Int_t | AutoP2FindLimits (Double_t min, Double_t max) |
| Buffer-based estimate of the histogram range using the power of 2 algorithm. | |
| Int_t | AxisChoice (Option_t *axis) const |
| Choose an axis according to "axis". | |
| Bool_t | BoundsOk (const char *where, Int_t at) const |
| virtual Int_t | BufferFill (Double_t x, Double_t y, Double_t w) |
| accumulate arguments in buffer. | |
| Int_t | BufferFill (Double_t, Double_t) override |
| accumulate arguments in buffer. | |
| virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
| Interface to ErrorHandler (protected). | |
| virtual void | DoFillN (Int_t ntimes, const Double_t *x, const Double_t *w, Int_t stride=1) |
| Internal method to fill histogram content from a vector called directly by TH1::BufferEmpty. | |
| virtual Double_t | DoIntegral (Int_t ix1, Int_t ix2, Int_t iy1, Int_t iy2, Int_t iz1, Int_t iz2, Double_t &err, Option_t *opt, Bool_t doerr=kFALSE) const |
| Internal function compute integral and optionally the error between the limits specified by the bin number values working for all histograms (1D, 2D and 3D). | |
| Int_t | Fill (const Double_t *v) |
| virtual Bool_t | FindNewAxisLimits (const TAxis *axis, const Double_t point, Double_t &newMin, Double_t &newMax) |
| finds new limits for the axis so that point is within the range and the limits are compatible with the previous ones (see TH1::Merge). | |
| UInt_t | GetAxisLabelStatus () const |
| Internal function used in TH1::Fill to see which axis is full alphanumeric, i.e. | |
| Double_t | GetBinErrorSqUnchecked (Int_t bin) const override |
| Bool_t | GetStatOverflowsBehaviour () const |
| Bool_t | IsEmpty () const |
| Check if a histogram is empty (this is a protected method used mainly by TH1Merger ). | |
| int | LoggedInconsistency (const char *name, const TH1 *h1, const TH1 *h2, bool useMerge=false) const |
| void | MakeZombie () |
| Bool_t | OutOfBoundsError (const char *where, Int_t i) const |
| Generate an out-of-bounds error. Always returns false. | |
| TString | ProvideSaveName (Option_t *option, Bool_t testfdir=kFALSE) |
| Provide variable name for histogram for saving as primitive Histogram pointer has by default the histogram name with an incremental suffix. | |
| Double_t | RetrieveBinContent (Int_t bin) const override |
| Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::GetBin. | |
| virtual void | SavePrimitiveHelp (std::ostream &out, const char *hname, Option_t *option="") |
| Helper function for the SavePrimitive functions from TH1 or classes derived from TH1, eg TProfile, TProfile2D. | |
| void | SavePrimitiveNameTitle (std::ostream &out, const char *variable_name) |
| Save object name and title into the output stream "out". | |
| void | SetBins (const Int_t *nbins, const Double_t *range) |
| void | UpdateBinContent (Int_t bin, Double_t content) override |
| Raw update of bin content on internal data structure see convention for numbering bins in TH1::GetBin. | |
Static Protected Member Functions | |
| static Int_t | AutoP2GetBins (Int_t n) |
| Auxiliary function to get the next power of 2 integer value larger then n. | |
| static Double_t | AutoP2GetPower2 (Double_t x, Bool_t next=kTRUE) |
| Auxiliary function to get the power of 2 next (larger) or previous (smaller) a given x. | |
| static bool | CheckAxisLimits (const TAxis *a1, const TAxis *a2) |
| Check that the axis limits of the histograms are the same. | |
| static bool | CheckBinLabels (const TAxis *a1, const TAxis *a2) |
| Check that axis have same labels. | |
| static bool | CheckBinLimits (const TAxis *a1, const TAxis *a2) |
| Check bin limits. | |
| static bool | CheckConsistentSubAxes (const TAxis *a1, Int_t firstBin1, Int_t lastBin1, const TAxis *a2, Int_t firstBin2=0, Int_t lastBin2=0) |
| Check that two sub axis are the same. | |
| static bool | CheckEqualAxes (const TAxis *a1, const TAxis *a2) |
| Check that the axis are the same. | |
| static Bool_t | RecomputeAxisLimits (TAxis &destAxis, const TAxis &anAxis) |
| Finds new limits for the axis for the Merge function. | |
| static Bool_t | SameLimitsAndNBins (const TAxis &axis1, const TAxis &axis2) |
| Same limits and bins. | |
| static void | SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE) |
| Save object constructor in the output stream "out". | |
| static void | SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr) |
| Save invocation of primitive Draw() method Skipped if option contains "nodraw" string. | |
| static TString | SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0) |
| Save array in the output stream "out" as vector. | |
Protected Attributes | |
| Short_t | fBarOffset |
| (1000*offset) for bar charts or legos | |
| Short_t | fBarWidth |
| (1000*width) for bar charts or legos | |
| TArrayD | fBinEntries |
| number of entries per bin | |
| EBinErrorOpt | fBinStatErrOpt |
| Option for bin statistical errors. | |
| TArrayD | fBinSumw2 |
| Array of sum of squares of weights per bin. | |
| Double_t * | fBuffer |
| [fBufferSize] entry buffer | |
| Int_t | fBufferSize |
| fBuffer size | |
| TArrayD | fContour |
| Array to display contour levels. | |
| Int_t | fDimension |
| ! Histogram dimension (1, 2 or 3 dim) | |
| TDirectory * | fDirectory |
| ! Pointer to directory holding this histogram | |
| Double_t | fEntries |
| Number of entries. | |
| EErrorType | fErrorMode |
| Option to compute errors. | |
| Color_t | fFillColor |
| Fill area color. | |
| Style_t | fFillStyle |
| Fill area style. | |
| TList * | fFunctions |
| ->Pointer to list of functions (fits and user) | |
| Double_t * | fIntegral |
| ! Integral of bins used by GetRandom | |
| Color_t | fLineColor |
| Line color. | |
| Style_t | fLineStyle |
| Line style. | |
| Width_t | fLineWidth |
| Line width. | |
| Color_t | fMarkerColor |
| Marker color. | |
| Size_t | fMarkerSize |
| Marker size. | |
| Style_t | fMarkerStyle |
| Marker style. | |
| Double_t | fMaximum |
| Maximum value for plotting. | |
| Double_t | fMinimum |
| Minimum value for plotting. | |
| TString | fName |
| Int_t | fNcells |
| Number of bins(1D), cells (2D) +U/Overflows. | |
| Double_t | fNormFactor |
| Normalization factor. | |
| TString | fOption |
| Histogram options. | |
| TVirtualHistPainter * | fPainter |
| ! Pointer to histogram painter | |
| Bool_t | fScaling |
| ! True when TProfile::Scale is called | |
| EStatOverflows | fStatOverflows |
| Per object flag to use under/overflows in statistics. | |
| TArrayD | fSumw2 |
| Array of sum of squares of weights. | |
| TString | fTitle |
| Double_t | fTsumw |
| Total Sum of weights. | |
| Double_t | fTsumw2 |
| Total Sum of squares of weights. | |
| Double_t | fTsumwx |
| Total Sum of weight*X. | |
| Double_t | fTsumwx2 |
| Total Sum of weight*X*X. | |
| Double_t | fTsumwy |
| Total Sum of weight*Y. | |
| Double_t | fTsumwy2 |
| Total Sum of weight*Y*Y. | |
| TAxis | fXaxis |
| X axis descriptor. | |
| TAxis | fYaxis |
| Y axis descriptor. | |
| Double_t | fYmax |
| Upper limit in Y (if set). | |
| Double_t | fYmin |
| Lower limit in Y (if set). | |
| TAxis | fZaxis |
| Z axis descriptor. | |
Static Protected Attributes | |
| static Bool_t | fgAddDirectory = kTRUE |
| ! Flag to add histograms to the directory | |
| static Bool_t | fgApproximate = kFALSE |
| bin error approximation option | |
| static Int_t | fgBufferSize = 1000 |
| ! Default buffer size for automatic histograms | |
| static Bool_t | fgDefaultSumw2 = kFALSE |
| ! Flag to call TH1::Sumw2 automatically at histogram creation time | |
| static Bool_t | fgStatOverflows = kFALSE |
| ! Flag to use under/overflows in statistics | |
Private Member Functions | |
| void | Build () |
| Creates histogram basic data structure. | |
| Int_t | Fill (Double_t) override |
| Increment bin with abscissa X by 1. | |
| void | FillN (Int_t, const Double_t *, const Double_t *, Int_t) override |
| Fill this histogram with an array x and weights w. | |
| Double_t * | GetB () |
| Double_t * | GetB2 () |
| Double_t * | GetW () |
| Double_t * | GetW2 () |
| void | SetBins (Int_t, const Double_t *, Int_t, const Double_t *) override |
| Redefine x and y axis parameters with variable bin sizes. | |
| void | SetBins (Int_t, const Double_t *, Int_t, const Double_t *, Int_t, const Double_t *) override |
| Redefine x, y and z axis parameters with variable bin sizes. | |
| void | SetBins (Int_t, Double_t, Double_t, Int_t, Double_t, Double_t) override |
| Redefine x and y axis parameters. | |
| void | SetBins (Int_t, Double_t, Double_t, Int_t, Double_t, Double_t, Int_t, Double_t, Double_t) override |
| Redefine x, y and z axis parameters. | |
| template<typename ValueType> | |
| void | SetSliceContent (const std::vector< Double_t > &values, const std::vector< std::pair< Int_t, Int_t > > &sliceEdges, ValueType *dataArray) |
| Sets the content of a slice of bins in a histogram. | |
| template<typename ValueType> | |
| void | SliceHistoInPlace (std::vector< Int_t > &args, ValueType *&dataArray, Int_t &fN) |
| Slices a histogram in place based on the specified bin ranges for each dimension. | |
Static Private Member Functions | |
| static void | AddToTObjectTable (TObject *) |
| Private helper function which will dispatch to TObjectTable::AddObj. | |
Private Attributes | |
| UInt_t | fBits |
| bit field status word | |
| UInt_t | fUniqueID |
| object unique identifier | |
Static Private Attributes | |
| static Longptr_t | fgDtorOnly = 0 |
| object for which to call dtor only (i.e. no delete) | |
| static Bool_t | fgObjectStat = kTRUE |
| if true keep track of objects in TObjectTable | |
Friends | |
| class | TH1Merger |
| class | TProfileHelper |
#include <TProfile.h>
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
Size of statistics data (size of array used in GetStats()/ PutStats ).
| Enumerator | |
|---|---|
| kNstat | Size of statistics data (up to TProfile3D). |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
TH1 status bits.
| TProfile::TProfile | ( | ) |
Default constructor for Profile histograms.
Definition at line 91 of file TProfile.cxx.
| TProfile::TProfile | ( | const char * | name, |
| const char * | title, | ||
| Int_t | nbins, | ||
| Double_t | xlow, | ||
| Double_t | xup, | ||
| Option_t * | option = "" ) |
Normal Constructor for Profile histograms.
The first five parameters are similar to TH1D::TH1D. All values of y are accepted at filling time. To fill a profile histogram, one must use TProfile::Fill function.
Note that when filling the profile histogram the function Fill checks if the variable y is between fYmin and fYmax. If a minimum or maximum value is set for the Y scale before filling, then all values below ymin or above ymax will be discarded. Setting the minimum or maximum value for the Y scale before filling has the same effect as calling the special TProfile constructor below where ymin and ymax are specified.
H(j) is printed as the channel contents. The errors displayed are s(j) if option='S' (spread option), or e(j) if CHOPT='' (error on mean).
See TProfile::BuildOptions() for explanation of parameters
see also comments in the TH1 base class constructors
Definition at line 125 of file TProfile.cxx.
| TProfile::TProfile | ( | const char * | name, |
| const char * | title, | ||
| Int_t | nbins, | ||
| Double_t | xlow, | ||
| Double_t | xup, | ||
| Double_t | ylow, | ||
| Double_t | yup, | ||
| Option_t * | option = "" ) |
Constructor for Profile histograms with range in y.
The first five parameters are similar to TH1D::TH1D. Only the values of Y between ylow and yup will be considered at filling time. ylow and yup will also be the maximum and minimum values on the y scale when drawing the profile.
See TProfile::BuildOptions for more explanations on errors
see also comments in the TH1 base class constructors
Definition at line 179 of file TProfile.cxx.
| TProfile::TProfile | ( | const char * | name, |
| const char * | title, | ||
| Int_t | nbins, | ||
| const Float_t * | xbins, | ||
| Option_t * | option = "" ) |
Constructor for Profile histograms with variable bin size.
See TProfile::BuildOptions() for more explanations on errors see also comments in the TH1 base class constructors
Definition at line 137 of file TProfile.cxx.
| TProfile::TProfile | ( | const char * | name, |
| const char * | title, | ||
| Int_t | nbins, | ||
| const Double_t * | xbins, | ||
| Option_t * | option = "" ) |
Constructor for Profile histograms with variable bin size.
See TProfile::BuildOptions for more explanations on errors see also comments in the TH1 base class constructors
Definition at line 149 of file TProfile.cxx.
| TProfile::TProfile | ( | const char * | name, |
| const char * | title, | ||
| Int_t | nbins, | ||
| const Double_t * | xbins, | ||
| Double_t | ylow, | ||
| Double_t | yup, | ||
| Option_t * | option = "" ) |
Constructor for Profile histograms with variable bin size.
See TProfile::BuildOptions for more explanations on errors
see also comments in the TH1 base class constructors
Definition at line 161 of file TProfile.cxx.
| TProfile::TProfile | ( | const TProfile & | profile | ) |
Copy constructor.
Definition at line 243 of file TProfile.cxx.
|
override |
Default destructor for Profile histograms.
Definition at line 99 of file TProfile.cxx.
|
inherited |
Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.
Definition at line 1149 of file TObject.cxx.
|
overridevirtual |
Replace contents of this profile by the addition of h1 and h2.
this = c1*h1 + c2*h2
c1 and c2 are considered as weights applied to the two summed profiles. The operation acts therefore like merging the two profiles with a weight c1 and c2
Reimplemented from TH1.
Definition at line 290 of file TProfile.cxx.
Performs the operation: this = this + c1*h1.
Reimplemented from TH1.
Definition at line 268 of file TProfile.cxx.
Performs the operation: this = this + c1*f1.
Reimplemented from TH1.
Definition at line 258 of file TProfile.cxx.
Set the double c value at position i in the array.
Check for out of bounds. Warning: the name of the method is misleading, it actually overwrites the position i.
Definition at line 93 of file TArrayD.cxx.
|
inlineoverridevirtualinherited |
Sets the flag controlling the automatic add of histograms in memory.
By default (fAddDirectory = kTRUE), histograms are automatically added to the current directory (gDirectory). Note that one histogram can be removed from its support directory by calling h->SetDirectory(nullptr) or h->SetDirectory(dir) to add it to the list of objects in the directory dir.
This is a static function. To call it, use TH1::AddDirectory
|
staticinherited |
Check whether TH1-derived classes should register themselves to the current gDirectory.
|
staticprivateinherited |
Private helper function which will dispatch to TObjectTable::AddObj.
Included here to avoid circular dependency between header files.
Definition at line 195 of file TObject.cxx.
Adopt array arr into TArrayD, i.e.
don't copy arr but use it directly in TArrayD. User may not delete arr, TArrayD dtor will do it.
Definition at line 80 of file TArrayD.cxx.
Statistical test of compatibility in shape between this histogram and h2, using the Anderson-Darling 2 sample test.
The AD 2 sample test formula are derived from the paper F.W Scholz, M.A. Stephens "k-Sample Anderson-Darling Test".
The test is implemented in root in the ROOT::Math::GoFTest class It is the same formula ( (6) in the paper), and also shown in this preprint
Binned data are considered as un-binned data with identical observation happening in the bin center.
| [in] | h2 | Pointer to 1D histogram |
| [in] | option | is a character string to specify options
|
|
virtualinherited |
Append graphics object to current pad.
In case no current pad is set yet, create a default canvas with the name "c1".
Definition at line 204 of file TObject.cxx.
Static function to set the fgApproximate flag.
When the flag is true, the function GetBinError will approximate the bin error with the average profile error on all bins in the following situation only
Definition at line 323 of file TProfile.cxx.
Buffer-based estimate of the histogram range using the power of 2 algorithm.
Used by the autobin power of 2 algorithm.
Works on arguments (min and max from fBuffer) and internal inputs: fXmin, fXmax, NBinsX (from fXaxis), ... Result save internally in fXaxis.
Overloaded by TH2 and TH3.
Return -1 if internal inputs are inconsistent, 0 otherwise.
|
overridevirtualinherited |
Fill histogram with all entries in the buffer.
Reimplemented from TH1.
Definition at line 337 of file TProfile.cxx.
accumulate arguments in buffer.
When buffer is full, empty the buffer.
Definition at line 395 of file TProfile.cxx.
accumulate arguments in buffer.
When buffer is full, empty the buffer
Reimplemented from TH1.
Definition at line 50 of file TProfile.h.
|
privateinherited |
Set Profile histogram structure and options.
| [in] | ymin | minimum value allowed for y |
| [in] | ymax | maximum value allowed for y if (ymin = ymax = 0) there are no limits on the allowed y values (ymin = -inf, ymax = +inf) |
| [in] | option | this is the option for the computation of the y error of the profile ( TProfile::GetBinError ) possible values for the options are:
|
In the case of Profile filled weights and with TProfile::Sumw2() called, STD(Y) is the standard deviation of the weighted sample Y and N is in this case the number of effective entries (TProfile::GetBinEffectiveEntries(ibin) )
If a bin has N data points all with the same value Y (especially possible when dealing with integers), the spread in Y for that bin is zero, and the uncertainty assigned is also zero, and the bin is ignored in making subsequent fits. To avoid this problem one can use an approximation for the standard deviation S(Y), by using the average of all the S(Y) of the other Profile bins. To use this approximation one must call before TProfile::Approximate This approximation applies only for the default and the 's' options
Definition at line 226 of file TProfile.cxx.
|
virtualinherited |
|
inlineinherited |
Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();
(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.
|
overridevirtual |
Run a Chi2Test between a TProfileD and another histogram.
If the argument is also a TProfileD, this calls TH1::Chi2Test() with the option "WW".
Reimplemented from TH1.
Definition at line 424 of file TProfile.cxx.
|
virtualinherited |
The computation routine of the Chisquare test.
For the method description, see Chi2Test() function.
| [in] | h2 | the second histogram |
| [in] | option |
|
| [out] | igood | test output
|
| [out] | chi2 | chisquare of the test |
| [out] | ndf | number of degrees of freedom (important, when both histograms have the same empty bins) |
| [out] | res | normalized residuals for further analysis |
Compute and return the chisquare of this histogram with respect to a function The chisquare is computed by weighting each histogram point by the bin error By default the full range of the histogram is used, unless TAxis::SetRange or TAxis::SetRangeUser was called before.
Use option "R" for restricting the chisquare calculation to the given range of the function Use option "L" for using the chisquare based on the poisson likelihood (Baker-Cousins Chisquare) Use option "P" for using the Pearson chisquare based on the expected bin errors Use option "I" for using the integral of the function in each bin instead of the value at the bin center
|
static |
|
static |
|
inlinestaticconstexpr |
Definition at line 139 of file TProfile.h.
|
virtualinherited |
Returns name of class to which the object belongs.
Definition at line 227 of file TObject.cxx.
|
overridevirtualinherited |
Set name and title to empty strings ("").
Reimplemented from TObject.
Reimplemented in TPrincipal, TProcessID, TStreamerInfo, TTask, TVirtualFitter, and TVirtualStreamerInfo.
Definition at line 63 of file TNamed.cxx.
|
virtualinherited |
|
overridevirtualinherited |
Compare two TNamed objects.
Returns 0 when equal, -1 when this is smaller and +1 when bigger (like strcmp).
Reimplemented from TObject.
Reimplemented in TStructNodeProperty.
Definition at line 84 of file TNamed.cxx.
|
virtualinherited |
Compute integral (normalized cumulative sum of bins) w/o under/overflows The result is stored in fIntegral and used by the GetRandom functions.
This function is automatically called by GetRandom when the fIntegral array does not exist or when the number of entries in the histogram has changed since the previous call to GetRandom. The resulting integral is normalized to 1. If the routine is called with the onlyPositive flag set an error will be produced in case of negative bin content and a NaN value returned
| onlyPositive | If set to true, an error will be produced and NaN will be returned when a bin with negative number of entries is encountered. |
| option |
|
Reimplemented in TH2Poly.
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
overridevirtual |
Copy a Profile histogram to a new profile histogram.
Reimplemented from TH1D.
Definition at line 450 of file TProfile.cxx.
|
inlinestatic |
Definition at line 139 of file TProfile.h.
|
virtualinherited |
Delete this object.
Typically called as a command via the interpreter. Normally use "delete" operator when object has been allocated on the heap.
Reimplemented in RooLinkedList, TAxis, TBtree, TCanvas, TClonesArray, TCollection, TDirectory, TDirectoryFile, TExMap, TFile, TGFrame, TGItemContext, TGTextEdit, THashList, THashTable, TKey, TKeySQL, TKeyXML, TList, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TMap, TMVA::Results, TObjArray, TObjectTable, TOrdCollection, TProtoClass, TQCommand, TRefArray, TSystemDirectory, TSystemFile, TThread, TTree, TTreeViewer, TViewPubDataMembers, and TViewPubFunctions.
Definition at line 268 of file TObject.cxx.
|
virtualinherited |
|
inherited |
Compute distance from point px,py to a line.
Compute the closest distance of approach from point px,py to elements of a histogram. The distance is computed in pixels units.
Currently, this simple model computes the distance from the mouse to the histogram contour only.
Reimplemented from TObject.
Divide this profile by h1.
this = this/h1
This function accepts to divide a TProfile by a histogram
The function return kFALSE if the divide operation failed
Reimplemented from TH1.
Definition at line 495 of file TProfile.cxx.
|
overridevirtual |
Replace contents of this profile by the division of h1 by h2.
this = c1*h1/(c2*h2)
The function return kFALSE if the divide operation failed
Reimplemented from TH1.
Definition at line 574 of file TProfile.cxx.
Performs the operation: this = this/(c1*f1).
This function is not implemented for the TProfile
Reimplemented from TH1.
Definition at line 480 of file TProfile.cxx.
|
protectedvirtualinherited |
Interface to ErrorHandler (protected).
Reimplemented in TThread, and TTreeViewer.
Definition at line 1059 of file TObject.cxx.
|
overridevirtualinherited |
Draw this histogram with options.
Histograms are drawn via the THistPainter class. Each histogram has a pointer to its own painter (to be usable in a multithreaded program). The same histogram can be drawn with different options in different pads. If a histogram is updated after it has been drawn, the updated data will be shown the next time the pad is updated. One does not need to redraw the histogram.
When a histogram is deleted, the histogram is automatically removed from all pads where it was drawn. If a histogram should be modified or deleted without affecting what is drawn, it should be drawn using DrawCopy().
By default, TH1::Draw clears the current pad. Passing the option "SAME", the histogram will be drawn on top of what's in the pad. One can use TH1::SetMaximum and TH1::SetMinimum to force a particular value for the maximum or the minimum scale on the plot.
TH1::UseCurrentStyle can be used to change all histogram graphics attributes to correspond to the current selected style. This function must be called for each histogram. In case one reads and draws many histograms from a file, one can force the histograms to inherit automatically the current graphics style by calling before gROOT->ForceStyle();
See the THistPainter class for a description of all the drawing options.
Reimplemented from TObject.
|
virtualinherited |
Draw class inheritance tree of the class to which this object belongs.
If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:
Reimplemented in TGFrame, TSystemDirectory, and TSystemFile.
Definition at line 308 of file TObject.cxx.
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
If pad was not selected - gPad will be used.
Reimplemented in TAxis, TCanvas, TGFrame, TSystemDirectory, and TSystemFile.
Definition at line 319 of file TObject.cxx.
|
virtualinherited |
Copy this histogram and Draw in the current pad.
Once the histogram is drawn into the pad, the original and its drawn copy can be modified or deleted without affecting each other. The copied histogram will be owned by the pad, and is deleted when the pad is cleared.
DrawCopy() is useful if the original histogram is a temporary, e.g. from code such as
If Draw() has been used, the histograms would disappear from the canvas at the end of this function.
By default a postfix "_copy" is added to the histogram name. Pass an empty postfix in case you want to draw a histogram with the same name.
See Draw() for the list of options.
In contrast to TObject::DrawClone(), DrawCopy
Draw a normalized copy of this histogram.
A clone of this histogram is normalized to norm and drawn with option. A pointer to the normalized histogram is returned. The contents of the histogram copy are scaled such that the new sum of weights (excluding under and overflow) is equal to norm. Note that the returned normalized histogram is not added to the list of histograms in the current directory in memory. It is the user's responsibility to delete this histogram. The kCanDelete bit is set for the returned object. If a pad containing this copy is cleared, the histogram will be automatically deleted.
See Draw for the list of options
|
virtualinherited |
|
virtualinherited |
Dump contents of object on stdout.
Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed
The following output is the Dump of a TArrow object:
Reimplemented in TClass, TCollection, TGFrame, TGPack, and TSystemFile.
Definition at line 367 of file TObject.cxx.
|
virtualinherited |
Issue error message.
Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.
Reimplemented in TFitResult.
Definition at line 1098 of file TObject.cxx.
Evaluate function f1 at the center of bins of this histogram.
|
virtualinherited |
Execute method on this object with the given parameter string, e.g.
"3.14,1,\"text\"".
Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.
Definition at line 378 of file TObject.cxx.
|
virtualinherited |
Execute method on this object with parameters stored in the TObjArray.
The TObjArray should contain an argv vector like:
Reimplemented in ROOT::R::TRInterface, TCling, TContextMenu, TInterpreter, and TMethodCall.
Definition at line 398 of file TObject.cxx.
Execute action corresponding to one event.
This member function is called when a histogram is clicked with the locator
If Left button clicked on the bin top value, then the content of this bin is modified according to the new position of the mouse when it is released.
Reimplemented from TObject.
Profile histogram is resized along x axis such that x is in the axis range.
The new axis limits are recomputed by doubling iteratively the current axis range until the specified value x is within the limits. The algorithm makes a copy of the histogram, then loops on all bins of the old histogram to fill the extended histogram. Takes into account errors (Sumw2) if any. The axis must be extendable before invoking this function.
Ex: h->GetXaxis()->SetCanExtend(kTRUE)
Reimplemented from TH1.
Definition at line 1611 of file TProfile.cxx.
|
virtualinherited |
Issue fatal error message.
Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.
Definition at line 1126 of file TObject.cxx.
This function allows to do discrete Fourier transforms of TH1 and TH2.
Available transform types and flags are described below.
To extract more information about the transform, use the function TVirtualFFT::GetCurrentTransform() to get a pointer to the current transform object.
| [out] | h_output | histogram for the output. If a null pointer is passed, a new histogram is created and returned, otherwise, the provided histogram is used and should be big enough |
| [in] | option | option parameters consists of 3 parts:
|
Examples of valid options: "Mag R2C M" "Re R2R_11" "Im R2C ES" "PH R2HC EX"
Reimplemented in TH2Poly.
Fill a Profile histogram (no weights).
Reimplemented from TH1.
Definition at line 707 of file TProfile.cxx.
Fill a Profile histogram with weights.
Definition at line 769 of file TProfile.cxx.
Definition at line 55 of file TProfile.h.
Fill a Profile histogram (no weights).
Reimplemented from TH1.
Definition at line 677 of file TProfile.cxx.
Fill a Profile histogram with weights.
Definition at line 737 of file TProfile.cxx.
Increment bin with abscissa X by 1.
if x is less than the low-edge of the first bin, the Underflow bin is incremented if x is equal to or greater than the upper edge of last bin, the Overflow bin is incremented
If the storage of the sum of squares of weights has been triggered, via the function Sumw2, then the sum of the squares of weights is incremented by 1 in the bin corresponding to x.
The function returns the corresponding bin number which has its content incremented by 1
Reimplemented from TH1.
Definition at line 62 of file TProfile.h.
|
virtualinherited |
Encode TNamed into output buffer.
Reimplemented in TDirectoryFile, TFile, TKey, TKeySQL, TKeyXML, TSQLFile, and TXMLFile.
Definition at line 103 of file TNamed.cxx.
|
overridevirtual |
Fill a Profile histogram with weights.
Reimplemented from TH1.
Definition at line 803 of file TProfile.cxx.
|
inlineoverrideprivatevirtual |
Fill this histogram with an array x and weights w.
| [in] | ntimes | number of entries in arrays x and w (array size must be ntimes*stride) |
| [in] | x | array of values to be histogrammed |
| [in] | w | array of weighs |
| [in] | stride | step size through arrays x and w |
If the weight is not equal to 1, the storage of the sum of squares of weights is automatically triggered and the sum of the squares of weights is incremented by \( w^2 \) in the bin corresponding to x. if w is NULL each entry is assumed a weight=1
Reimplemented from TH1.
Definition at line 63 of file TProfile.h.
Fill histogram following distribution in function fname.
| fname | : Function name used for filling the histogram |
| ntimes | : number of times the histogram is filled |
| rng | : (optional) Random number generator used to sample |
The distribution contained in the function fname (TF1) is integrated over the channel contents for the bin range of this histogram. It is normalized to 1.
Getting one random number implies:
One can also call TF1::GetRandom to get a random variate from a function.
Fill histogram following distribution in histogram h.
| h | : Histogram pointer used for sampling random number |
| ntimes | : number of times the histogram is filled |
| rng | : (optional) Random number generator used for sampling |
The distribution contained in the histogram h (TH1) is integrated over the channel contents for the bin range of this histogram. It is normalized to 1.
Getting one random number implies:
SPECIAL CASE when the target histogram has the same binning as the source. in this case we simply use a poisson distribution where the mean value per bin = bincontent/integral.
Return Global bin number corresponding to x,y,z.
2-D and 3-D histograms are represented with a one dimensional structure. This has the advantage that all existing functions, such as GetBinContent, GetBinError, GetBinFunction work for all dimensions. This function tries to extend the axis if the given point belongs to an under-/overflow bin AND if CanExtendAllAxes() is true.
See also TH1::GetBin, TAxis::FindBin and TAxis::FindFixBin
Reimplemented in TH2Poly.
|
virtualinherited |
Find first bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1.
The search will occur between the specified first and last bin. Specifying the value of the last bin to search to less than zero will search until the last defined bin.
Return Global bin number corresponding to x,y,z.
2-D and 3-D histograms are represented with a one dimensional structure. This has the advantage that all existing functions, such as GetBinContent, GetBinError, GetBinFunction work for all dimensions. This function DOES NOT try to extend the axis if the given point belongs to an under-/overflow bin.
See also TH1::GetBin, TAxis::FindBin and TAxis::FindFixBin
|
virtualinherited |
Find last bin with content > threshold for axis (1=x, 2=y, 3=z) if no bins with content > threshold is found the function returns -1.
The search will occur between the specified first and last bin. Specifying the value of the last bin to search to less than zero will search until the last defined bin.
|
protectedvirtualinherited |
finds new limits for the axis so that point is within the range and the limits are compatible with the previous ones (see TH1::Merge).
new limits are put into newMin and newMax variables. axis - axis whose limits are to be recomputed point - point that should fit within the new axis limits newMin - new minimum will be stored here newMax - new maximum will be stored here. false if failed (e.g. if the initial axis limits are wrong or the new range is more than \( 2^{64} \) times the old one).
|
overridevirtualinherited |
|
virtualinherited |
Fit histogram with function fname.
fname is the name of a function available in the global ROOT list of functions gROOT->GetListOfFunctions. Note that this is not thread safe. The list include any TF1 object created by the user plus some pre-defined functions which are automatically created by ROOT the first time a pre-defined function is requested from gROOT (i.e. when calling gROOT->GetFunction(const char *name)). These pre-defined functions are:
For printing the list of all available functions do:
TF1::InitStandardFunctions(); // not needed if `gROOT->GetFunction` is called before TF2::InitStandardFunctions(); TF3::InitStandardFunctions(); // For 2D or 3D gROOT->GetListOfFunctions()->ls()
fname can also be a formula that is accepted by the linear fitter containing the special operator ++, representing linear components separated by ++ sign, for example x++sin(x) for fitting [0]*x+[1]*sin(x)
This function finds a pointer to the TF1 object with name fname and calls TH1::Fit(TF1 *, Option_t *, Option_t *, Double_t, Double_t). See there for the fitting options and the details about fitting histograms
|
virtualinherited |
Fit histogram with the function pointer f1.
| [in] | f1 | pointer to the function object |
| [in] | option | string defining the fit options (see table below). |
| [in] | goption | specify a list of graphics options. See TH1::Draw for a complete list of these options. |
| [in] | xxmin | lower fitting range |
| [in] | xxmax | upper fitting range |
Here is the full list of fit options that can be given in the parameter option. Several options can be used together by concatanating the strings without the need of any delimiters.
| option | description |
|---|---|
| "L" | Uses a log likelihood method (default is chi-square method). To be used when the histogram represents counts. |
| "WL" | Weighted log likelihood method. To be used when the histogram has been filled with weights different than 1. This is needed for getting correct parameter uncertainties for weighted fits. |
| "P" | Uses Pearson chi-square method. Uses expected errors instead of the observed one (default case). The expected error is instead estimated from the square-root of the bin function value. |
| "MULTI" | Uses Loglikelihood method based on multi-nomial distribution. In this case the function must be normalized and one fits only the function shape. |
| "W" | Fit using the chi-square method and ignoring the bin uncertainties and skip empty bins. |
| "WW" | Fit using the chi-square method and ignoring the bin uncertainties and include the empty bins. |
| "I" | Uses the integral of function in the bin instead of the default bin center value. |
| "F" | Uses the default minimizer (e.g. Minuit) when fitting a linear function (e.g. polN) instead of the linear fitter. |
| "U" | Uses a user specified objective function (e.g. user providedlikelihood function) defined using TVirtualFitter::SetFCN |
| "E" | Performs a better parameter errors estimation using the Minos technique for all fit parameters. |
| "M" | Uses the IMPROVE algorithm (available only in TMinuit). This algorithm attempts improve the found local minimum by searching for a better one. |
| "S" | The full result of the fit is returned in the TFitResultPtr. This is needed to get the covariance matrix of the fit. See TFitResult and the base class ROOT::Math::FitResult. |
| "Q" | Quiet mode (minimum printing) |
| "V" | Verbose mode (default is between Q and V) |
| "+" | Adds this new fitted function to the list of fitted functions. By default, the previous function is deleted and only the last one is kept. |
| "N" | Does not store the graphics function, does not draw the histogram with the function after fitting. |
| "0" | Does not draw the histogram and the fitted function after fitting, but in contrast to option "N", it stores the fitted function in the histogram list of functions. |
| "R" | Fit using a fitting range specified in the function range with TF1::SetRange. |
| "B" | Use this option when you want to fix or set limits on one or more parameters and the fitting function is a predefined one (e.g gaus, expo,..), otherwise in case of pre-defined functions, some default initial values and limits will be used. |
| "C" | In case of linear fitting, do no calculate the chisquare (saves CPU time). |
| "G" | Uses the gradient implemented in TF1::GradientPar for the minimization. This allows to use Automatic Differentiation when it is supported by the provided TF1 function. |
| "WIDTH" | Scales the histogran bin content by the bin width (useful for variable bins histograms) |
| "SERIAL" | Runs in serial mode. By default if ROOT is built with MT support and MT is enables, the fit is perfomed in multi-thread - "E" Perform better Errors estimation using Minos technique |
| "MULTITHREAD" | Forces usage of multi-thread execution whenever possible |
The default fitting of an histogram (when no option is given) is perfomed as following:
The Fit is perfomed using the default Minimizer, defined in the ROOT::Math::MinimizerOptions class. It is possible to change the default minimizer and its configuration parameters by calling these static functions before fitting (before calling TH1::Fit):
Other options are possible depending on the Minimizer used, see the corresponding documentation. The default minimizer can be also set in the resource file in etc/system.rootrc. For example
By default a chi-square (least-square) fit is performed on the histogram. The so-called modified least-square method is used where the residual for each bin is computed using as error the observed value (the bin error) returned by TH1::GetBinError
\[ Chi2 = \sum_{i}{ \left(\frac{y(i) - f(x(i) | p )}{e(i)} \right)^2 } \]
where y(i) is the bin content for each bin i, x(i) is the bin center and e(i) is the bin error (sqrt(y(i) for an un-weighted histogram). Bins with zero errors are excluded from the fit. See also later the note on the treatment of empty bins. When using option "I" the residual is computed not using the function value at the bin center, f(x(i)|p), but the integral of the function in the bin, Integral{ f(x|p)dx }, divided by the bin volume. When using option P (Pearson chi2), the expected error computed as e(i) = sqrt(f(x(i)|p)) is used. In this case empty bins are considered in the fit. Both chi-square methods should not be used when the bin content represent counts, especially in case of low bin statistics, because they could return a biased result.
When using option "L" a likelihood fit is used instead of the default chi-square fit. The likelihood is built assuming a Poisson probability density function for each bin. The negative log-likelihood to be minimized is
\[ NLL = - \sum_{i}{ \log {\mathrm P} ( y(i) | f(x(i) | p ) ) } \]
where P(y|f) is the Poisson distribution of observing a count y(i) in the bin when the expected count is f(x(i)|p). The exact likelihood used is the Poisson likelihood described in this paper: S. Baker and R. D. Cousins, “Clarification of the use of chi-square and likelihood functions in fits to histograms,” Nucl. Instrum. Meth. 221 (1984) 437.
\[ NLL = \sum_{i}{( f(x(i) | p ) + y(i)\log(y(i)/ f(x(i) | p )) - y(i)) } \]
By using this formulation, 2*NLL can be interpreted as the chi-square resulting from the fit.
This method should be always used when the bin content represents counts (i.e. errors are sqrt(N) ). The likelihood method has the advantage of treating correctly bins with low statistics. In case of high statistics/bin the distribution of the bin content becomes a normal distribution and the likelihood and the chi2 fit give the same result.
The likelihood method, although a bit slower, it is therefore the recommended method, when the histogram represent counts (Poisson statistics), where the chi-square methods may give incorrect results, especially in case of low statistics. In case of a weighted histogram, it is possible to perform also a likelihood fit by using the option "WL". Note a weighted histogram is a histogram which has been filled with weights and it has the information on the sum of the weight square for each bin ( TH1::Sumw2() has been called). The bin error for a weighted histogram is the square root of the sum of the weight square.
The function returns a TFitResultPtr which can hold a pointer to a TFitResult object. By default the TFitResultPtr contains only the status of the fit which is return by an automatic conversion of the TFitResultPtr to an integer. One can write in this case directly:
If the option "S" is instead used, TFitResultPtr behaves as a smart pointer to the TFitResult object. This is useful for retrieving the full result information from the fit, such as the covariance matrix, as shown in this example code:
The fit parameters, error and chi-square (but not covariance matrix) can be retrieved also directly from the fitted function that is passed to this call. Given a pointer to an associated fitted function myfunc, one can retrieve the function/fit parameters with calls such as:
One or more objects (typically a TF1*) can be added to the list of functions (fFunctions) associated to each histogram. When TH1::Fit is invoked, the fitted function is added to the histogram list of functions (fFunctions). If the histogram is made persistent, the list of associated functions is also persistent. Given a histogram h, one can retrieve an associated function with:
or by quering directly the list obtained by calling TH1::GetListOfFunctions.
The status of the fit is obtained converting the TFitResultPtr to an integer independently if the fit option "S" is used or not:
In order to fit in a sub-range of the histogram you have two options:
The fitting range is also limited by the histogram range defined using TAxis::SetRange or TAxis::SetRangeUser. Therefore the fitting range is the smallest range between the histogram one and the one defined by one of the two previous options described above.
Parameters must be initialized before invoking the Fit function. The setting of the parameter initial values is automatic for the predefined functions such as poln, expo, gaus, landau. One can however disable this automatic computation by using the option "B". Note that if a predefined function is defined with an argument, eg, gaus(0), expo(1), you must specify the initial values for the parameters. You can specify boundary limits for some or all parameters via
if parmin >= parmax, the parameter is fixed Note that you are not forced to fix the limits for all parameters. For example, if you fit a function with 6 parameters, you can do:
With this setup, parameters 0->2 can vary freely Parameter 3 has boundaries [-10,-4] with initial value -8 Parameter 4 is fixed to 0 Parameter 5 is fixed to 100. When the lower limit and upper limit are equal, the parameter is fixed. However to fix a parameter to 0, one must call the FixParameter function.
The statistics box can display the result of the fit. You can change the statistics box to display the fit parameters with the TStyle::SetOptFit(mode) method. This mode has four digits. mode = pcev (default = 0111)
v = 1; print name/values of parameters e = 1; print errors (if e=1, v must be 1) c = 1; print Chisquare/Number of degrees of freedom p = 1; print Probability
For example: gStyle->SetOptFit(1011); prints the fit probability, parameter names/values, and errors. You can change the position of the statistics box with these lines (where g is a pointer to the TGraph):
TPaveStats *st = (TPaveStats*)g->GetListOfFunctions()->FindObject("stats");
st->SetX1NDC(newx1); //new x start position
st->SetX2NDC(newx2); //new x end position
It is possible to fit a TH2 with a TF1 or a TH3 with a TF2. In this case the chi-square is computed from the squared error distance between the function values and the bin centers weighted by the bin content. For correct error scaling, the obtained parameter error are corrected as in the case when the option "W" is used.
By default when fitting a chi square function is used for fitting. When option "L" is used a Poisson likelihood function is used. Using option "MULTI" a multinomial likelihood fit is used. Thes functions are defined in the header Fit/Chi2Func.h or Fit/PoissonLikelihoodFCN and they are implemented using the routines FitUtil::EvaluateChi2 or FitUtil::EvaluatePoissonLogL in the file math/mathcore/src/FitUtil.cxx. It is possible to specify a user defined fitting function, using option "U" and calling the following functions:
where MyFittingFunction is of type:
Empty bins, which have the content equal to zero AND error equal to zero, are excluded by default from the chi-square fit, but they are considered in the likelihood fit. since they affect the likelihood if the function value in these bins is not negligible. Note that if the histogram is having bins with zero content and non zero-errors they are considered as any other bins in the fit. Instead bins with zero error and non-zero content are by default excluded in the chi-squared fit. In general, one should not fit a histogram with non-empty bins and zero errors.
If the bin errors are not known, one should use the fit option "W", which gives a weight=1 for each bin (it is an unweighted least-square fit). When using option "WW" the empty bins will be also considered in the chi-square fit with an error of 1. Note that in this fitting case (option "W" or "WW") the resulting fitted parameter errors are corrected by the obtained chi2 value using this scaling expression: errorp *= sqrt(chisquare/(ndf-1)) as it is done when fitting a TGraph with no point errors.
You can use TF1::RejectPoint inside your fitting function to exclude some points within a certain range from the fit. See the tutorial fit/fitExclude.C.
When selecting the option "0", the fitted function is added to the list of functions of the histogram, but it is not drawn when the histogram is drawn. You can undo this behaviour resetting its corresponding bit in the TF1 object as following:
|
virtualinherited |
|
inlineinherited |
Return a histogram containing the asymmetry of this histogram with h2, where the asymmetry is defined as:
works for 1D, 2D, etc. histograms c2 is an optional argument that gives a relative weight between the two histograms, and dc2 is the error on this weight. This is useful, for example, when forming an asymmetry between two histograms from 2 different data sets that need to be normalized to each other in some way. The function calculates the errors assuming Poisson statistics on h1 and h2 (that is, dh = sqrt(h)).
example: assuming 'h1' and 'h2' are already filled
then 'h3' is created and filled with the asymmetry between 'h1' and 'h2'; h1 and h2 are left intact.
Note that it is the user's responsibility to manage the created histogram. The name of the returned histogram will be Asymmetry_nameOfh1-nameOfh2
code proposed by Jason Seely (seely.nosp@m.@mit.nosp@m..edu) and adapted by R.Brun
clone the histograms so top and bottom will have the correct dimensions: Sumw2 just makes sure the errors will be computed properly when we form sums and ratios below.
|
protectedinherited |
|
inlineprivate |
Definition at line 64 of file TProfile.h.
|
inlineprivate |
Definition at line 65 of file TProfile.h.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Return Global bin number corresponding to binx,y,z.
2-D and 3-D histograms are represented with a one dimensional structure. This has the advantage that all existing functions, such as GetBinContent, GetBinError, GetBinFunction work for all dimensions.
In case of a TH1x, returns binx directly. see TH1::GetBinXYZ for the inverse transformation.
Convention for numbering bins
For all histogram types: nbins, xlow, xup
In case of 2-D or 3-D histograms, a "global bin" number is defined. For example, assuming a 3-D histogram with binx,biny,binz, the function
returns a global/linearized bin number. This global bin is useful to access the bin information independently of the dimension.
Return bin content of a Profile histogram.
Reimplemented from TH1.
Definition at line 851 of file TProfile.cxx.
Reimplemented from TH1.
Definition at line 105 of file TProfile.h.
Reimplemented from TH1.
Definition at line 106 of file TProfile.h.
Return bin effective entries for a weighted filled Profile histogram.
In case of an unweighted profile, it is equivalent to the number of entries per bin The effective entries is defined as the square of the sum of the weights divided by the sum of the weights square. TProfile::Sumw2() must be called before filling the profile with weights. Only by calling this method the sum of the square of the weights per bin is stored.
Definition at line 880 of file TProfile.cxx.
Return bin entries of a Profile histogram.
Definition at line 864 of file TProfile.cxx.
Return bin error of a Profile histogram.
Computing errors: A moving field
The computation of errors for a TProfile has evolved with the versions of ROOT. The difficulty is in computing errors for bins with low statistics.
Ideas for improvements of this algorithm are welcome. No suggestions received since our call for advice to roottalk in Jul 2002. see for instance: http://root.cern/root/roottalk/roottalk02/2916.html
Reimplemented from TH1.
Definition at line 915 of file TProfile.cxx.
Reimplemented from TH1.
Definition at line 108 of file TProfile.h.
Reimplemented from TH1.
Definition at line 109 of file TProfile.h.
|
inlinevirtualinherited |
Reimplemented from TH1.
Definition at line 59 of file TProfile.h.
|
inlinevirtual |
Definition at line 112 of file TProfile.h.
|
inlinevirtual |
Definition at line 113 of file TProfile.h.
|
virtualinherited |
Compute first binx in the range [firstx,lastx] for which diff = abs(bin_content-c) <= maxdiff.
In case several bins in the specified range with diff=0 are found the first bin found is returned in binx. In case several bins in the specified range satisfy diff <=maxdiff the bin with the smallest difference is returned in binx. In all cases the function returns the smallest difference.
NOTE1: if firstx <= 0, firstx is set to bin 1 if (lastx < firstx then firstx is set to the number of bins ie if firstx=0 and lastx=0 (default) the search is on all bins.
NOTE2: if maxdiff=0 (default), the first bin with content=c is returned.
|
virtualinherited |
|
inherited |
Return a pointer to a histogram containing the cumulative content.
The cumulative can be computed both in the forward (default) or backward direction; the name of the new histogram is constructed from the name of this histogram with the suffix "suffix" appended provided by the user. If not provided a default suffix="_cumulative" is used.
The cumulative distribution is formed by filling each bin of the resulting histogram with the sum of that bin and all previous (forward == kTRUE) or following (forward = kFALSE) bins.
Note: while cumulative distributions make sense in one dimension, you may not be getting what you expect in more than 1D because the concept of a cumulative distribution is much trickier to define; make sure you understand the order of summation before you use this method with histograms of dimension >= 2.
Note 2: By default the cumulative is computed from bin 1 to Nbins If an axis range is set, values between the minimum and maximum of the range are set. Setting an axis range can also be used for including underflow and overflow in the cumulative (e.g. by setting h->GetXaxis()->SetRange(0, h->GetNbinsX()+1); )
|
staticinherited |
|
staticinherited |
|
inlinevirtualinherited |
|
inlineinherited |
|
virtualinherited |
Get option used by the graphics system to draw this object.
Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.
Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.
Definition at line 445 of file TObject.cxx.
|
staticinherited |
Return destructor only flag.
Definition at line 1196 of file TObject.cxx.
|
virtualinherited |
Number of effective entries of the histogram.
\[neff = \frac{(\sum Weights )^2}{(\sum Weight^2 )} \]
In case of an unweighted histogram this number is equivalent to the number of entries of the histogram. For a weighted histogram, this number corresponds to the hypothetical number of unweighted entries a histogram would need to have the same statistical power as this weighted histogram. Note: The underflow/overflow are included if one has set the TH1::StatOverFlows flag and if the statistics has been computed at filling time. If a range is set in the histogram the number is computed from the given range.
|
virtualinherited |
| Option_t * TProfile::GetErrorOption | ( | ) | const |
Return option to compute profile errors.
Definition at line 923 of file TProfile.cxx.
|
inlinevirtualinherited |
Return the fill area color.
Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.
Definition at line 32 of file TAttFill.h.
|
inlinevirtualinherited |
Return the fill area style.
Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.
Definition at line 33 of file TAttFill.h.
|
virtualinherited |
|
virtualinherited |
Returns mime type name of object.
Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TASImage, TBranch, TBranchElement, TGeoVolume, TGMainFrame, TKey, TMethodBrowsable, TSystemFile, and TVirtualBranchBrowsable.
Definition at line 472 of file TObject.cxx.
|
virtualinherited |
Return a pointer to the array of bins integral.
if the pointer fIntegral is null, TH1::ComputeIntegral is called The array dimension is the number of bins in the histograms including underflow and overflow (fNCells) the last value integral[fNCells] is set to the number of entries of the histogram
Note, that since third and fourth moment are not calculated at the fill time, kurtosis and its standard error are computed bin by bin
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. See TH1::GetMean and TH1::GetStdDev.
|
inlinevirtualinherited |
Return the line color.
Reimplemented in TGraphMultiErrors, and TGWin32VirtualXProxy.
Definition at line 36 of file TAttLine.h.
|
inlinevirtualinherited |
Return the line style.
Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.
Definition at line 37 of file TAttLine.h.
|
inlinevirtualinherited |
Return the line width.
Reimplemented in TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, and TGX11.
Definition at line 38 of file TAttLine.h.
|
virtualinherited |
|
inlinevirtualinherited |
Return the marker color.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 33 of file TAttMarker.h.
|
inlinevirtualinherited |
Return the marker size.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 35 of file TAttMarker.h.
|
inlinevirtualinherited |
Return the marker style.
Reimplemented in TGWin32VirtualXProxy.
Definition at line 34 of file TAttMarker.h.
Return maximum value smaller than maxval of bins in the range, unless the value has been overridden by TH1::SetMaximum, in which case it returns that value.
This happens, for example, when the histogram is drawn and the y or z axis limits are changed
To get the maximum value of bins in the histogram regardless of whether the value has been overridden (using TH1::SetMaximum), use
TH1::GetMaximumBin can be used to get the location of the maximum value.
Reimplemented in TH2Poly.
|
virtualinherited |
|
inlinevirtualinherited |
For axis = 1,2 or 3 returns the mean value of the histogram along X,Y or Z axis.
For axis = 11, 12, 13 returns the standard error of the mean value of the histogram along X, Y or Z axis
Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes 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.
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned mean is the (unbinned) one calculated at fill time. If a range has been set, however, the mean is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned mean (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.
Return mean value of this histogram along the X axis.
Return standard error of mean of this histogram along the X axis.
Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes 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.
Also note, that although the definition of standard error doesn't include the assumption of normality, many uses of this feature implicitly assume it.
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned value is the (unbinned) one calculated at fill time. If a range has been set, however, the value is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned value (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.
Return minimum value larger than minval of bins in the range, unless the value has been overridden by TH1::SetMinimum, in which case it returns that value.
This happens, for example, when the histogram is drawn and the y or z axis limits are changed
To get the minimum value of bins in the histogram regardless of whether the value has been overridden (using TH1::SetMinimum), use
TH1::GetMinimumBin can be used to get the location of the minimum value.
Reimplemented in TH2Poly.
Retrieve the minimum and maximum values in the histogram.
This will not return a cached value and will always search the histogram for the min and max values. The user can condition whether or not to call this with the GetMinimumStored() and GetMaximumStored() methods. If the cache is empty, then the value will be -1111. Users can then use the SetMinimum() or SetMaximum() methods to cache the results. For example, the following recipe will make efficient use of this method and the cached minimum and maximum values.
| min | reference to variable that will hold found minimum value |
| max | reference to variable that will hold found maximum value |
|
virtualinherited |
|
inlinevirtualinherited |
|
inlineoverridevirtualinherited |
|
inlinevirtualinherited |
|
staticinherited |
Get status of object stat flag.
Definition at line 1181 of file TObject.cxx.
|
inlineoverridevirtualinherited |
|
inherited |
Compute Quantiles for this histogram.
A quantile x_p := Q(p) is defined as the value x_p such that the cumulative probability distribution Function F of variable X yields:
For instance the median x_0.5 of a distribution is defined as that value of the random variable X for which the distribution function equals 0.5:
| [in] | n | maximum size of the arrays xp and p (if given) |
| [out] | xp | array to be filled with nq quantiles evaluated at (p). Memory has to be preallocated by caller.
|
| [in] | p | array of cumulative probabilities where quantiles should be evaluated.
|
Note that the Integral of the histogram is automatically recomputed if the number of entries is different of the number of entries when the integral was computed last time. In case you do not use the Fill functions to fill your histogram, but SetBinContent, you must call TH1::ComputeIntegral before calling this function.
Getting quantiles xp from two histograms and storing results in a TGraph, a so-called QQ-plot
Example:
Return a random number distributed according the histogram bin contents.
This function checks if the bins integral exists. If not, the integral is evaluated, normalized to one.
| rng | (optional) Random number generator pointer used (default is gRandom) |
| option | (optional) Set it to "width" if your non-uniform bin contents represent a density rather than counts |
The integral is automatically recomputed if the number of entries is not the same then when the integral was computed.
This function returns the Standard Deviation (Sigma) of the distribution not the Root Mean Square (RMS).
The name "RMS" is been often used as a synonym for the Standard Deviation and it was introduced many years ago (Hbook/PAW times). We keep the name GetRMS for continuity as an alias to GetStdDev. GetStdDev() should be used instead.
Note, that since third and fourth moment are not calculated at the fill time, skewness and its standard error are computed bin by bin
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. See TH1::GetMean and TH1::GetStdDev.
|
inlineinherited |
|
inlineprotectedinherited |
|
overridevirtual |
fill the array stats from the contents of this profile.
The array stats must be correctly dimensioned in the calling program.
If no axis-subrange is specified (via TAxis::SetRange), the array stats is simply a copy of the statistics quantities computed at filling time. If a sub-range is specified, the function recomputes these quantities from the bin contents in the current axis range.
Reimplemented from TH1.
Definition at line 948 of file TProfile.cxx.
Returns the Standard Deviation (Sigma).
The Sigma estimate is computed as
\[\sqrt{\frac{1}{N}(\sum(x_i-x_{mean})^2)} \]
For axis = 1,2 or 3 returns the Sigma value of the histogram along X, Y or Z axis For axis = 11, 12 or 13 returns the error of StdDev estimation along X, Y or Z axis for Normal distribution
Note that the mean value/sigma is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes 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.
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned standard deviation is the (unbinned) one calculated at fill time. If a range has been set, however, the standard deviation is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned standard deviation (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.
Return error of standard deviation estimation for Normal distribution.
Note that the mean value/StdDev is computed using the bins in the currently defined range (see TAxis::SetRange). By default the range includes 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.
Value returned is standard deviation of sample standard deviation. Note that it is an approximated value which is valid only in the case that the original data distribution is Normal. The correct one would require the 4-th momentum value, which cannot be accurately estimated from a histogram since the x-information for all entries is not kept.
IMPORTANT NOTE: The returned value depends on how the histogram statistics are calculated. By default, if no range has been set, the returned value is the (unbinned) one calculated at fill time. If a range has been set, however, the value is calculated using the bins in range, as described above; THIS IS TRUE EVEN IF THE RANGE INCLUDES ALL BINS–use TAxis::SetRange(0, 0) to unset the range. To ensure that the returned value (and all other statistics) is always that of the binned data stored in the histogram, call TH1::ResetStats. See TH1::GetStats.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlineoverridevirtualinherited |
|
virtualinherited |
Return the unique object id.
Definition at line 480 of file TObject.cxx.
|
inlineprivate |
Definition at line 66 of file TProfile.h.
|
inlineprivate |
Definition at line 67 of file TProfile.h.
|
inlinevirtual |
Definition at line 117 of file TProfile.h.
|
inlinevirtual |
Definition at line 116 of file TProfile.h.
Execute action in response of a timer timing out.
This method must be overridden if an object has to react to timers.
Reimplemented in TGCommandPlugin, TGDNDManager, TGFileContainer, TGHtml, TGLEventHandler, TGPopupMenu, TGraphTime, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGuiBldDragManager, TGWindow, and TTreeViewer.
Definition at line 516 of file TObject.cxx.
|
inlineoverridevirtualinherited |
Return hash value for this object.
Note: If this routine is overloaded in a derived class, this derived class should also add
Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like
Reimplemented from TObject.
|
inlineinherited |
Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
missing call to RecursiveRemove in destructor).
Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)
|
virtualinherited |
Issue info message.
Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.
Definition at line 1072 of file TObject.cxx.
|
virtualinherited |
Returns kTRUE if object inherits from class "classname".
Reimplemented in TClass.
Definition at line 549 of file TObject.cxx.
Returns kTRUE if object inherits from TClass cl.
Reimplemented in TClass.
Definition at line 557 of file TObject.cxx.
|
virtualinherited |
Dump contents of this object in a graphics canvas.
Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.
The following picture is the Inspect of a histogram object:
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, TGFrame, TInspectorObject, and TSystemFile.
Definition at line 570 of file TObject.cxx.
Return integral of bin contents.
Only bins in the bins range are considered.
By default the integral is computed as the sum of bin contents in the range. if option "width" is specified, the integral is the sum of the bin contents multiplied by the bin width in x.
|
virtualinherited |
Return integral of bin contents in range [binx1,binx2] and its error.
By default the integral is computed as the sum of bin contents in the range. if option "width" is specified, the integral is the sum of the bin contents multiplied by the bin width in x. the error is computed using error propagation from the bin errors assuming that all the bins are uncorrelated
|
inlineoverridevirtual |
Reimplemented from TH1D.
Definition at line 139 of file TProfile.h.
|
inlineinherited |
IsDestructed.
|
protectedinherited |
Default equal comparison (objects are equal if they have the same address in memory).
More complicated classes might want to override this function.
Reimplemented in TGObject, TObjString, TPair, and TQCommand.
Definition at line 589 of file TObject.cxx.
|
virtualinherited |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Reimplemented in ROOT::Experimental::XRooFit::xRooNode, ROOT::Internal::THnBaseBrowsable, TApplicationRemote, TAxis3D, TBaseClass, TBranch, TBranchClones, TBranchElement, TBranchObject, TBranchSTL, TBrowserObject, TCanvas, TClass, TCollection, TDatabasePDG, TDirectory, TFolder, TGeoManager, TGeometry, TGeoNode, TGeoNodeMatrix, TGeoOverlap, TGeoTrack, TGeoVolume, THbookFile, THbookKey, THnBase, TKey, TMapFile, TMultiDimFit, TNode, TPad, TPair, TParticleClassPDG, TPrincipal, TRemoteObject, TROOT, TRootIconList, TSPlot, TSystemDirectory, TTask, TTree, and TVirtualBranchBrowsable.
Definition at line 579 of file TObject.cxx.
|
inlinevirtualinherited |
|
inlineoverridevirtualinherited |
Reimplemented from TObject.
Reimplemented in TStructNodeProperty.
|
inlinevirtualinherited |
Reimplemented in TGWin32VirtualXProxy.
Definition at line 49 of file TAttFill.h.
Statistical test of compatibility in shape between this histogram and h2, using Kolmogorov test.
Note that the KolmogorovTest (KS) test should in theory be used only for unbinned data and not for binned data as in the case of the histogram (see NOTE 3 below). So, before using this method blindly, read the NOTE 3.
Default: Ignore under- and overflow bins in comparison
| [in] | h2 | histogram |
| [in] | option | is a character string to specify options
|
The returned function value is the probability of test (much less than one means NOT compatible)
Code adapted by Rene Brun from original HBOOK routine HDIFF
NOTE1 A good description of the Kolmogorov test can be seen at: http://www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm
NOTE2 see also alternative function TH1::Chi2Test The Kolmogorov test is assumed to give better results than Chi2Test in case of histograms with low statistics.
NOTE3 (Jan Conrad, Fred James) "The returned value PROB is calculated such that it will be uniformly distributed between zero and one for compatible histograms, provided the data are not binned (or the number of bins is very large compared with the number of events). Users who have access to unbinned data and wish exact confidence levels should therefore not put their data into histograms, but should call directly TMath::KolmogorovTest. On the other hand, since TH1 is a convenient way of collecting data and saving space, this function has been provided. However, the values of PROB for binned data will be shifted slightly higher than expected, depending on the effects of the binning. For example, when comparing two uniform distributions of 500 events in 100 bins, the values of PROB, instead of being exactly uniformly distributed between zero and one, have a mean value of about 0.56. We can apply a useful rule: As long as the bin width is small compared with any significant physical effect (for example the experimental resolution) then the binning cannot have an important effect. Therefore, we believe that for all practical purposes, the probability value PROB is calculated correctly provided the user is aware that: 1. The value of PROB should not be expected to have exactly the correct distribution for binned data. 2. The user is responsible for seeing to it that the bin widths are small compared with any physical phenomena of interest. 3. The effect of binning (if any) is always to make the value of PROB slightly too big. That is, setting an acceptance criterion of (PROB>0.05 will assure that at most 5% of truly compatible histograms are rejected, and usually somewhat less."
Note also that for GoF test of unbinned data ROOT provides also the class ROOT::Math::GoFTest. The class has also method for doing one sample tests (i.e. comparing the data with a given distribution).
|
overridevirtual |
Reduce the number of bins for this axis to the number of bins having a label.
Reimplemented from TH1.
Definition at line 1000 of file TProfile.cxx.
|
overridevirtual |
Double the number of bins for axis.
Refill histogram This function is called by TAxis::FindBin(const char *label)
Reimplemented from TH1.
Definition at line 1010 of file TProfile.cxx.
Set option(s) to draw axis with labels.
option might have the following values:
Reimplemented from TH1.
Definition at line 1028 of file TProfile.cxx.
|
overridevirtualinherited |
List TNamed name and title.
Reimplemented from TObject.
Reimplemented in ROOT::Experimental::XRooFit::xRooBrowser, TNode, TROOT, TStreamerBase, TStreamerElement, TStreamerInfo, TStreamerSTL, TTask, TText, and TVirtualStreamerInfo.
Definition at line 112 of file TNamed.cxx.
|
inherited |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
Definition at line 1160 of file TObject.cxx.
|
inherited |
Add all histograms in the collection to this histogram.
This function computes the min/max for the x axis, compute a new number of bins, if necessary, add bin contents, errors and statistics. If all histograms have bin labels, bins with identical labels will be merged, no matter what their order is. 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 successful, -1 otherwise.
Possible option: -NOL : the merger will ignore the labels and merge the histograms bin by bin using bin center values to match bins -NOCHECK: the histogram will not perform a check for duplicate labels in case of axes with labels. The check (enabled by default) slows down the merging
IMPORTANT remark. The axis x 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. Example:
|
overridevirtual |
Merge all histograms in the collection in this histogram.
This function computes the min/max for the x axis, 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 successful, -1 otherwise.
IMPORTANT remark. The axis x 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.
Reimplemented from TH1.
Definition at line 1219 of file TProfile.cxx.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Multiply this profile by h1.
this = this*h1
Reimplemented from TH1.
Definition at line 1271 of file TProfile.cxx.
|
overridevirtual |
Replace contents of this profile by multiplication of h1 by h2.
this = (c1*h1)*(c2*h2)
Reimplemented from TH1.
Definition at line 1283 of file TProfile.cxx.
Performs the operation: this = this*c1*f1.
The function return kFALSE if the Multiply operation failed
Reimplemented from TH1.
Definition at line 1229 of file TProfile.cxx.
|
virtualinherited |
Normalize a histogram to its integral or to its maximum.
| option | normalization strategy ("", "max" or "sum")
|
In case the norm is zero, it raises an error.
|
virtualinherited |
This method must be overridden to handle object notification (the base implementation is no-op).
Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.
For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.
Reimplemented in h1analysis, h1analysisTreeReader, TARInterruptHandler, TASInputHandler, TASInterruptHandler, TASLogHandler, TASSigPipeHandler, TBlinkTimer, TBranchElement, TBranchRef, TBreakLineCom, TBrowserTimer, TCollection, TDelCharCom, TDelTextCom, TFileHandler, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TGLRedrawTimer, TGTextEditHist, TGuiBldDragManagerRepeatTimer, TIdleTimer, TInsCharCom, TInsTextCom, TInterruptHandler, TLeafObject, TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TPopupDelayTimer, TProcessEventTimer, TRefTable, TRepeatTimer, TSBRepeatTimer, TSelector, TSelectorDraw, TSelectorEntries, TSignalHandler, TSingleShotCleaner, TSocketHandler, TStdExceptionHandler, TSysEvtHandler, TTermInputHandler, TThreadTimer, TTimeOutTimer, TTimer, TTipDelayTimer, TTree, TTreeFormula, TTreeFormulaManager, TTreeReader, TViewTimer, and TViewUpdateTimer.
Definition at line 618 of file TObject.cxx.
|
inherited |
Use this method to declare a method obsolete.
Specify as of which version the method is obsolete and as from which version it will be removed.
Definition at line 1169 of file TObject.cxx.
|
inherited |
Operator delete for sized deallocation.
Definition at line 1234 of file TObject.cxx.
|
inherited |
Operator delete.
Definition at line 1212 of file TObject.cxx.
|
inherited |
Only called by placement new when throwing an exception.
Definition at line 1266 of file TObject.cxx.
|
inherited |
Operator delete [] for sized deallocation.
Definition at line 1245 of file TObject.cxx.
|
inherited |
Operator delete [].
Definition at line 1223 of file TObject.cxx.
|
inherited |
Only called by placement new[] when throwing an exception.
Definition at line 1274 of file TObject.cxx.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 248 of file TProfile.cxx.
Generate an out-of-bounds error. Always returns false.
Definition at line 29 of file TArray.cxx.
|
overridevirtualinherited |
|
virtualinherited |
Pop on object drawn in a pad to the top of the display list.
I.e. it will be drawn last and on top of all other primitives.
Reimplemented in TFrame, TPad, and TVirtualPad.
Definition at line 640 of file TObject.cxx.
|
overridevirtualinherited |
Print some global quantities for this histogram.
| [in] | option |
|
Reimplemented from TObject.
Project this profile into a 1-D histogram along X.
The projection is always of the type TH1D.
Definition at line 1311 of file TProfile.cxx.
Provide variable name for histogram for saving as primitive Histogram pointer has by default the histogram name with an incremental suffix.
If the histogram belongs to a graph or a stack the suffix is not added because the graph and stack objects are not aware of this new name. Same thing if the histogram is drawn with the option COLZ because the TPaletteAxis drawn when this option is selected, does not know this new name either.
|
overridevirtual |
Replace current statistics with the values in array stats.
Reimplemented from TH1.
Definition at line 1386 of file TProfile.cxx.
|
virtualinherited |
Read contents of object with specified name from the current directory.
First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().
Reimplemented in TBuffer, TKey, TKeySQL, and TKeyXML.
Definition at line 673 of file TObject.cxx.
Read TArray object from buffer.
Simplified version of TBuffer::ReadObject (does not keep track of multiple references to same array).
Definition at line 40 of file TArray.cxx.
|
overridevirtual |
Rebin this profile grouping ngroup bins together.
if newname is not blank a new temporary profile hnew is created. else the current profile is modified (default) The parameter ngroup indicates how many bins of this have to me merged into one bin of hnew If the original profile has errors stored (via Sumw2), the resulting profile has new errors correctly calculated.
examples: if hp is an existing TProfile histogram with 100 bins
NOTE: If ngroup is not an exact divider of the number of bins, the top limit of the rebinned profile 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.
a new profile is created (you should specify newname). The parameter ngroup is the number of variable size bins in the created profile The array xbins must contain ngroup+1 elements that represent the low-edge of the bins. The data of the old bins are added to the new bin which contains the bin center of the old bins. It is possible that information from the old binning are attached to the under-/overflow bins of the new binning.
examples: if hp is an existing TProfile with 100 bins
Reimplemented from TH1.
Definition at line 1438 of file TProfile.cxx.
Reimplemented in TH2, TH3, and TProfile2D.
|
virtualinherited |
|
overridevirtualinherited |
|
overridevirtual |
Reset contents of a Profile histogram.
Reimplemented from TH1D.
Definition at line 1625 of file TProfile.cxx.
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
virtualinherited |
Reset the statistics including the number of entries and replace with values calculated from bin content.
The number of entries is set to the total bin content or (in case of weighted histogram) to number of effective entries
Raw retrieval of bin content on internal data structure see convention for numbering bins in TH1::GetBin.
Reimplemented from TH1D.
Definition at line 57 of file TProfile.h.
|
overridevirtualinherited |
Save the histogram as .csv, .tsv or .txt.
In case of any other extension, fall back to TObject::SaveAs, which saves as a .C macro (but with the file name extension specified by the user)
The Under/Overflow bins are also exported (as first and last lines) The fist 2 columns are the lower and upper edges of the bins Column 3 contains the bin contents The last column contains the error in y. If errors are not present, the column is left empty
The result can be immediately imported into Excel, gnuplot, Python or whatever, without the needing to install pyroot, etc.
| filename | the name of the file where to store the histogram |
| option | some tuning options |
The file extension defines the delimiter used:
If option = "title" a title line is generated. If the y-axis has a title, this title is displayed as column 3 name, otherwise, it shows "BinContent"
Reimplemented from TObject.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
overridevirtual |
Save primitive as a C++ statement(s) on output stream out.
Reimplemented from TH1.
Definition at line 1640 of file TProfile.cxx.
|
staticprotectedinherited |
Save object constructor in the output stream "out".
Can be used as first statement when implementing SavePrimitive() method for the object
Definition at line 777 of file TObject.cxx.
|
staticprotectedinherited |
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition at line 845 of file TObject.cxx.
|
staticinherited |
|
protectedvirtualinherited |
|
protectedinherited |
Save object name and title into the output stream "out".
Definition at line 135 of file TNamed.cxx.
|
staticprotectedinherited |
Save array in the output stream "out" as vector.
Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()
Definition at line 796 of file TObject.cxx.
Multiply this profile by a constant c1.
this = c1*this
This function uses the services of TProfile::Add
Reimplemented from TH1.
Definition at line 1727 of file TProfile.cxx.
|
overridevirtualinherited |
Set size of this array to n doubles.
A new array is created, the old contents copied to the new array, then the old array is deleted. This function should not be called if the array was declared via Adopt.
Implements TArray.
Definition at line 105 of file TArrayD.cxx.
Set size of this array to n doubles and set the contents This function should not be called if the array was declared via Adopt.
Definition at line 132 of file TArrayD.cxx.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
Set the number of entries in bin.
Definition at line 1735 of file TProfile.cxx.
Set the bin Error Note that this resets the bin eror option to be of Normal Type and for the non-empty bin the bin error is set by default to the square root of their content.
Note that in case the user sets after calling SetBinError explicitly a new bin content (e.g. using SetBinContent) he needs then to provide also the corresponding bin error (using SetBinError) since the bin error will not be recalculated after setting the content and a default error = 0 will be used for those bins.
See convention for numbering bins in TH1::GetBin
Reimplemented in TH2Poly.
|
inlinevirtualinherited |
Definition at line 54 of file TProfile.h.
|
inlineoverrideprivatevirtual |
Redefine x and y axis parameters with variable bin sizes.
The X and Y axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange xBins is supposed to be of length nx+1, yBins is supposed to be of length ny+1
Reimplemented from TH1.
Definition at line 70 of file TProfile.h.
|
inlineoverrideprivatevirtual |
Redefine x, y and z axis parameters with variable bin sizes.
The X, Y and Z axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange xBins is supposed to be of length nx+1, yBins is supposed to be of length ny+1, zBins is supposed to be of length nz+1
Reimplemented from TH1.
Definition at line 74 of file TProfile.h.
|
inlineoverrideprivatevirtual |
Redefine x and y axis parameters.
The X and Y axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange
Reimplemented from TH1.
Definition at line 68 of file TProfile.h.
|
inlineoverrideprivatevirtual |
Redefine x, y and z axis parameters.
The X, Y and Z axis parameters are modified. The bins content array is resized if errors (Sumw2) the errors array is resized The previous bin contents are lost To change only the axis limits, see TAxis::SetRange
Reimplemented from TH1.
Definition at line 72 of file TProfile.h.
|
overridevirtual |
Set total number of bins including under/overflow.
Reallocate bin contents array
Reimplemented from TH1D.
Definition at line 1764 of file TProfile.cxx.
Set or unset the user status bits as specified in f.
Definition at line 888 of file TObject.cxx.
Set the buffer size in units of 8 bytes (double).
Reimplemented from TH1.
Definition at line 1773 of file TProfile.cxx.
|
virtualinherited |
Shortcut to set the three histogram colors with a single call.
By default: linecolor = markercolor = fillcolor = -1 If a color is < 0 this method does not change the corresponding color if positive or null it set the color.
For instance:
will set the line color and the marker color to red.
|
virtualinherited |
Set the number and values of contour levels.
By default the number of contour levels is set to 20. The contours values in the array "levels" should be specified in increasing order.
if argument levels = 0 or missing, nlevels equidistant contours are computed between zmin and zmax - dz, both included, with step dz = (zmax - zmin)/nlevels. Note that contour lines are not centered, but contour surfaces (when drawing with COLZ) will be, since contour color i covers the region of values between contour line i and i+1.
|
staticinherited |
|
virtualinherited |
By default, when a histogram is created, it is added to the list of histogram objects in the current directory in memory.
Remove reference to this histogram from current directory and add reference to new directory dir. dir can be 0 in which case the histogram does not belong to any directory.
Note that the directory is not a real property of the histogram and it will not be copied when the histogram is copied or cloned. If the user wants to have the copied (cloned) histogram in the same directory, he needs to set again the directory using SetDirectory to the copied histograms
|
virtualinherited |
Set drawing option for object.
This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().
Reimplemented in RooPlot, TAxis, TBrowser, TGedFrame, TGFrame, TPad, TPaveStats, TRootBrowserLite, TSystemDirectory, and TSystemFile.
Definition at line 871 of file TObject.cxx.
|
staticinherited |
Set destructor only flag.
Definition at line 1204 of file TObject.cxx.
|
inlinevirtualinherited |
|
virtualinherited |
|
virtual |
Set option to compute profile errors.
The computation of the bin errors is based on the parameter option:
-' ' (Default) The bin errors are the standard error on the mean of the bin profiled values (Y), i.e. the standard error of the bin contents. Note that if TProfile::Approximate() is called, an approximation is used when the spread in Y is 0 and the number of bin entries is > 0 -'s' The bin errors are the standard deviations of the Y bin values Note that if TProfile::Approximate() is called, an approximation is used when the spread in Y is 0 and the number of bin entries is > 0 -'i' Errors are as in default case (standard errors of the bin contents) The only difference is for the case when the spread in Y is zero. In this case for N > 0 the error is 1./SQRT(12.*N) -'g' Errors are 1./SQRT(W) for W not equal to 0 and 0 for W = 0. W is the sum in the bin of the weights of the profile. This option is for combining measurements y +/- dy, and the profile is filled with values y and weights w = 1/dy**2
See TProfile::BuildOptions for a detailed explanation of all options
Definition at line 1812 of file TProfile.cxx.
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
inlinevirtualinherited |
Set the fill area color.
Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.
Definition at line 40 of file TAttFill.h.
|
inherited |
Reimplemented in TGraphMultiErrors.
|
inlinevirtualinherited |
Set the fill area style.
Reimplemented in TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPad, TSpider, and TVirtualX.
Definition at line 42 of file TAttFill.h.
Set font number used to draw axis labels.
font : Text font code = 10*fontnumber + precision Font numbers must be between 1 and 14 precision = 1 fast hardware fonts (steps in the size) precision = 2 scalable and rotatable hardware fonts
The default font number is 62. axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
inlinevirtualinherited |
Set the line color.
Reimplemented in ROOT::Experimental::REveLine, ROOT::Experimental::REveStraightLineSet, ROOT::Experimental::REveTrackList, TEveLine, TEveStraightLineSet, TEveTrackList, TGeoVolume, TGeoVolumeMulti, TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TParallelCoordRange, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.
Definition at line 44 of file TAttLine.h.
|
inherited |
Reimplemented in TGraphMultiErrors.
|
inlinevirtualinherited |
Set the line style.
Reimplemented in ROOT::Experimental::REveLine, ROOT::Experimental::REveTrackList, TEveLine, TEveTrackList, TGeoVolume, TGeoVolumeMulti, TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.
Definition at line 46 of file TAttLine.h.
|
inlinevirtualinherited |
Set the line width.
Reimplemented in ROOT::Experimental::REveLine, ROOT::Experimental::REveTrackList, TEveLine, TEveTrackList, TGeoVolume, TGeoVolumeMulti, TGQuartz, TGraphMultiErrors, TGWin32, TGWin32VirtualXProxy, TGX11, TPaletteAxis, TParallelCoordRange, TPDF, TPostScript, TSpider, TSVG, TTeXDump, and TVirtualX.
Definition at line 47 of file TAttLine.h.
|
virtualinherited |
Reimplemented in TGWin32VirtualXProxy.
|
inlinevirtualinherited |
Set the marker color.
Reimplemented in ROOT::Experimental::REveLine, ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, ROOT::Experimental::REveTrackList, TEveLine, TEvePointSet, TEvePointSetArray, TEveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TPDF, TPostScript, TSVG, TTeXDump, and TVirtualX.
Definition at line 41 of file TAttMarker.h.
|
inherited |
|
inlinevirtualinherited |
Set the marker size.
Note that the marker styles number 1 6 and 7 (the dots), cannot be scaled. They are meant to be very fast to draw and are always drawn with the same number of pixels; therefore this method does not apply on them.
Reimplemented in ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, ROOT::Experimental::REveTrackList, TEvePointSet, TEvePointSetArray, TEveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, TTeXDump, and TVirtualX.
Definition at line 48 of file TAttMarker.h.
|
inlinevirtualinherited |
Set the marker style.
Reimplemented in ROOT::Experimental::REvePointSet, ROOT::Experimental::REvePointSetArray, ROOT::Experimental::REveTrackList, TEvePointSet, TEvePointSetArray, TEveTrackList, TGQuartz, TGWin32, TGWin32VirtualXProxy, TGX11, and TVirtualX.
Definition at line 43 of file TAttMarker.h.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
overridevirtualinherited |
|
overridevirtualinherited |
Set the number of divisions to draw an axis.
ndiv : Number of divisions.
n = N1 + 100*N2 + 10000*N3
N1=number of primary divisions.
N2=number of secondary divisions.
N3=number of 3rd divisions.
e.g.:
nndi=0 --> no tick marks.
nndi=2 --> 2 divisions, one tick mark in the middle
of the axis.
axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes
|
inlinevirtualinherited |
|
staticinherited |
Turn on/off tracking of objects in the TObjectTable.
Definition at line 1188 of file TObject.cxx.
|
inlinevirtualinherited |
|
inlineprivateinherited |
Sets the content of a slice of bins in a histogram.
This function allows setting the content of a slice of bins in a histogram by specifying the edges of the slice and the corresponding values to assign.
| ValueType | The type of the histogram's data. |
| values | A vector of values to assign to the bins in the specified slice. |
| sliceEdges | A vector of pairs specifying the low and upper edges of the slice for each dimension. |
| dataArray | A pointer to the histogram's data array. |
|
inlineinherited |
|
overridevirtualinherited |
Change/set the title.
If title is in the form stringt;stringx;stringy;stringz;stringc the histogram title is set to stringt, the x axis title to stringx, the y axis title to stringy, the z axis title to stringz, and the c axis title for the palette is ignored at this stage. Note that you can use e.g. stringt;stringx if you only want to specify title and x axis title.
To insert the character ; in one of the titles, one should use #; or #semicolon.
Reimplemented from TNamed.
Specify a parameter offset to control the distance between the axis and the axis' title.
axis specifies which axis ("x","y","z"), default = "x" if axis="xyz" set all 3 axes
|
virtualinherited |
Set the unique object id.
Definition at line 899 of file TObject.cxx.
|
inlinevirtualinherited |
|
inlinevirtualinherited |
|
inlinevirtualinherited |
This function calculates the background spectrum in this histogram.
The background is returned as a histogram.
| [in] | niter | number of iterations (default value = 2) Increasing niter make the result smoother and lower. |
| [in] | option | may contain one of the following options
|
NOTE that the background is only evaluated in the current range of this histogram. i.e., if this has a bin range (set via h->GetXaxis()->SetRange(binmin, binmax), the returned histogram will be created with the same number of bins as this input histogram, but only bins from binmin to binmax will be filled with the estimated background.
|
virtualinherited |
Interface to TSpectrum::Search.
The function finds peaks in this histogram where the width is > sigma and the peak maximum greater than threshold*maximum bin content of this. For more details see TSpectrum::Search. Note the difference in the default value for option compared to TSpectrum::Search option="" by default (instead of "goff").
Reimplemented in TH2.
|
virtualinherited |
Return size of the TNamed part of the TObject.
Reimplemented in TDirectory, TDirectoryFile, TFile, TKey, TSQLFile, and TXMLFile.
Definition at line 182 of file TNamed.cxx.
|
inlineprivateinherited |
Slices a histogram in place based on the specified bin ranges for each dimension.
This function modifies the histogram by extracting a sub-region defined by the provided bin ranges for each dimension. The resulting histogram will have updated bin counts, edges, and contents. Bin contents outside the range fall into the flow bins. The histogram's internal data array is freed and reallocated by this function. This function is used by the python implementation of the Unified Histogram Interface (UHI) for slicing.
| ValueType | The type of the histogram's data. |
| args | A vector of integers specifying the low and upper edges of the slice for each dimension. |
| dataArray | A pointer to the histogram's data array. |
| fN | The size of dataArray. |
Smooth bin contents of this histogram.
if option contains "R" smoothing is applied only to the bins defined in the X axis range (default is to smooth all bins) Bin contents are replaced by their smooth values. Errors (if any) are not modified. the smoothing procedure is repeated ntimes (default=1)
Reimplemented in TH2.
Smooth array xx, translation of Hbook routine hsmoof.F.
Based on algorithm 353QH twice presented by J. Friedman in Proc. of the 1974 CERN School of Computing, Norway, 11-24 August, 1974. See also Section 4.2 in J. Friedman, Data Analysis Techniques for High Energy Physics.
|
overridevirtual |
Stream an object of class TProfile.
Reimplemented from TH1D.
Definition at line 1820 of file TProfile.cxx.
|
inline |
Definition at line 139 of file TProfile.h.
Create/delete structure to store sum of squares of weights per bin.
This is needed to compute the correct statistical quantities of a profile filled with weights
This function is automatically called when the histogram is created if the static function TH1::SetDefaultSumw2 has been called before. If flag is false the structure is deleted
Reimplemented from TH1.
Definition at line 1860 of file TProfile.cxx.
|
virtualinherited |
Issue system error message.
Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.
Definition at line 1112 of file TObject.cxx.
|
staticinherited |
For a given transform (first parameter), fills the histogram (second parameter) with the transform output data, specified in the third parameter If the 2nd parameter h_output is empty, a new histogram (TH1D or TH2D) is created and the user is responsible for deleting it.
Available options:
|
overridevirtualinherited |
|
virtualinherited |
Issue warning message.
Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.
Definition at line 1084 of file TObject.cxx.
|
virtualinherited |
Write this object to the current directory.
For more see the const version of this method.
Reimplemented in ROOT::TBufferMergerFile, TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.
Definition at line 989 of file TObject.cxx.
|
virtualinherited |
Write this object to the current directory.
The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".
Writing an object to a file involves the following steps:
Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.
If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().
The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.
An object is read from the file into memory via TKey::Read() or via TObject::Read().
The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.
Reimplemented in TBuffer, TCollection, TDirectory, TDirectoryFile, TFile, TMap, TParallelMergingFile, TSQLFile, TTree, and TXMLFile.
Definition at line 964 of file TObject.cxx.
Write TArray object to buffer.
Simplified version of TBuffer::WriteObject (does not keep track of multiple references to the same array).
Definition at line 81 of file TArray.cxx.
|
friend |
Definition at line 36 of file TProfile.h.
|
friend |
Definition at line 35 of file TProfile.h.
|
protectedinherited |
|
protectedinherited |
|
protected |
number of entries per bin
Definition at line 39 of file TProfile.h.
|
protectedinherited |
|
protected |
Array of sum of squares of weights per bin.
Definition at line 46 of file TProfile.h.
|
privateinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
Option to compute errors.
Definition at line 40 of file TProfile.h.
|
protectedinherited |
Fill area color.
Definition at line 24 of file TAttFill.h.
|
protectedinherited |
Fill area style.
Definition at line 25 of file TAttFill.h.
|
protectedinherited |
bin error approximation option
Definition at line 48 of file TProfile.h.
|
staticprotectedinherited |
|
staticprivateinherited |
|
protectedinherited |
|
protectedinherited |
Line color.
Definition at line 24 of file TAttLine.h.
|
protectedinherited |
Line style.
Definition at line 25 of file TAttLine.h.
|
protectedinherited |
Line width.
Definition at line 26 of file TAttLine.h.
|
protectedinherited |
Marker color.
Definition at line 24 of file TAttMarker.h.
|
protectedinherited |
Marker size.
Definition at line 26 of file TAttMarker.h.
|
protectedinherited |
Marker style.
Definition at line 25 of file TAttMarker.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
! True when TProfile::Scale is called
Definition at line 43 of file TProfile.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |
Total Sum of weight*Y.
Definition at line 44 of file TProfile.h.
|
protected |
Total Sum of weight*Y*Y.
Definition at line 45 of file TProfile.h.
|
privateinherited |
|
protected |
Upper limit in Y (if set).
Definition at line 42 of file TProfile.h.
|
protected |
Lower limit in Y (if set).
Definition at line 41 of file TProfile.h.