Skip to content

Commit ef81ad1

Browse files
authored
Grammar and typo fixes in TH1 documentation (root-project#9129)
* Fix "an histogram" typos in TH1 documentation * Small grammar fixes in TH1 documentation
1 parent b7344a6 commit ef81ad1

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

hist/hist/src/TH1.cxx

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ will be detailed below.
8888
- [Associated functions](\ref associated-functions)
8989
- [Projections of histograms](\ref prof-hist)
9090
- [Random Numbers and histograms](\ref random-numbers)
91-
- [Making a copy of an histogram](\ref making-a-copy)
91+
- [Making a copy of a histogram](\ref making-a-copy)
9292
- [Normalizing histograms](\ref normalizing)
9393
-# [Drawing histograms](\ref drawing-histograms)
9494
- [Setting Drawing histogram contour levels (2-D hists only)](\ref cont-level)
@@ -148,7 +148,7 @@ Histograms may also be created by:
148148
149149
- calling the Clone() function, see below
150150
- making a projection from a 2-D or 3-D histogram, see below
151-
- reading an histogram from a file
151+
- reading a histogram from a file
152152
153153
When a histogram is created, a reference to it is automatically added
154154
to the list of in-memory objects for the current file or directory.
@@ -243,7 +243,7 @@ For bin labels see \ref binning.
243243
\anchor alpha
244244
### Alphanumeric Bin Labels
245245
246-
By default, an histogram axis is drawn with its numeric bin labels.
246+
By default, a histogram axis is drawn with its numeric bin labels.
247247
One can specify alphanumeric labels instead with:
248248
249249
- call TAxis::SetBinLabel(bin, label);
@@ -300,7 +300,7 @@ When using the options 2 or 3 above, the labels are automatically
300300
\anchor auto-bin
301301
### Histograms with automatic bins
302302
303-
When an histogram is created with an axis lower limit greater or equal
303+
When a histogram is created with an axis lower limit greater or equal
304304
to its upper limit, the SetBuffer is automatically called with an
305305
argument fBufferSize equal to fgBufferSize (default value=1000).
306306
fgBufferSize may be reset via the static function TH1::SetDefaultBufferSize.
@@ -310,15 +310,15 @@ When using the options 2 or 3 above, the labels are automatically
310310
\anchor rebinning
311311
### Rebinning
312312
313-
At any time, an histogram can be rebinned via TH1::Rebin. This function
313+
At any time, a histogram can be rebinned via TH1::Rebin. This function
314314
returns a new histogram with the rebinned contents.
315315
If bin errors were stored, they are recomputed during the rebinning.
316316
317317
318318
\anchor filling-histograms
319319
## Filling histograms
320320
321-
An histogram is typically filled with statements like:
321+
A histogram is typically filled with statements like:
322322
~~~ {.cpp}
323323
h1->Fill(x);
324324
h1->Fill(x, w); //fill with weight
@@ -380,7 +380,7 @@ When using the options 2 or 3 above, the labels are automatically
380380
One or more object (typically a TF1*) can be added to the list
381381
of functions (fFunctions) associated to each histogram.
382382
When TH1::Fit is invoked, the fitted function is added to this list.
383-
Given an histogram h, one can retrieve an associated function
383+
Given a histogram h, one can retrieve an associated function
384384
with:
385385
~~~ {.cpp}
386386
TF1 *myfunc = h->GetFunction("myfunc");
@@ -392,14 +392,14 @@ When using the options 2 or 3 above, the labels are automatically
392392
393393
Many types of operations are supported on histograms or between histograms
394394
395-
- Addition of an histogram to the current histogram.
395+
- Addition of a histogram to the current histogram.
396396
- Additions of two histograms with coefficients and storage into the current
397397
histogram.
398398
- Multiplications and Divisions are supported in the same way as additions.
399399
- The Add, Divide and Multiply functions also exist to add, divide or multiply
400-
an histogram by a function.
400+
a histogram by a function.
401401
402-
If an histogram has associated error bars (TH1::Sumw2 has been called),
402+
If a histogram has associated error bars (TH1::Sumw2 has been called),
403403
the resulting error bars are also computed assuming independent histograms.
404404
In case of divisions, Binomial errors are also supported.
405405
One can mark a histogram to be an "average" histogram by setting its bit kIsAverage via
@@ -410,7 +410,7 @@ When using the options 2 or 3 above, the labels are automatically
410410
### Fitting histograms
411411
412412
Histograms (1-D, 2-D, 3-D and Profiles) can be fitted with a user
413-
specified function via TH1::Fit. When an histogram is fitted, the
413+
specified function via TH1::Fit. When a histogram is fitted, the
414414
resulting function with its parameters is added to the list of functions
415415
of this histogram. If the histogram is made persistent, the list of
416416
associated functions is also persistent. Given a pointer (see above)
@@ -440,20 +440,20 @@ When using the options 2 or 3 above, the labels are automatically
440440
\anchor random-numbers
441441
### Random Numbers and histograms
442442
443-
TH1::FillRandom can be used to randomly fill an histogram using
443+
TH1::FillRandom can be used to randomly fill a histogram using
444444
the contents of an existing TF1 function or another
445445
TH1 histogram (for all dimensions).
446-
For example the following two statements create and fill an histogram
446+
For example, the following two statements create and fill a histogram
447447
10000 times with a default gaussian distribution of mean 0 and sigma 1:
448448
~~~ {.cpp}
449449
TH1F h1("h1", "histo from a gaussian", 100, -3, 3);
450450
h1.FillRandom("gaus", 10000);
451451
~~~
452452
TH1::GetRandom can be used to return a random number distributed
453-
according the contents of an histogram.
453+
according to the contents of a histogram.
454454
455455
\anchor making-a-copy
456-
### Making a copy of an histogram
456+
### Making a copy of a histogram
457457
Like for any other ROOT object derived from TObject, one can use
458458
the Clone() function. This makes an identical copy of the original
459459
histogram including all associated errors and functions, e.g.:
@@ -464,7 +464,7 @@ When using the options 2 or 3 above, the labels are automatically
464464
\anchor normalizing
465465
### Normalizing histograms
466466
467-
One can scale an histogram such that the bins integral is equal to
467+
One can scale a histogram such that the bins integral is equal to
468468
the normalization parameter via TH1::Scale(Double_t norm), where norm
469469
is the desired normalization divided by the integral of the histogram.
470470
@@ -478,12 +478,12 @@ When using the options 2 or 3 above, the labels are automatically
478478
See THistPainter::Paint() for more details.
479479
480480
The same histogram can be drawn with different options in different pads.
481-
When an histogram drawn in a pad is deleted, the histogram is
481+
When a histogram drawn in a pad is deleted, the histogram is
482482
automatically removed from the pad or pads where it was drawn.
483-
If an histogram is drawn in a pad, then filled again, the new status
483+
If a histogram is drawn in a pad, then filled again, the new status
484484
of the histogram will be automatically shown in the pad next time
485485
the pad is updated. One does not need to redraw the histogram.
486-
To draw the current version of an histogram in a pad, one can use
486+
To draw the current version of a histogram in a pad, one can use
487487
~~~ {.cpp}
488488
h->DrawCopy();
489489
~~~
@@ -531,7 +531,7 @@ When using the options 2 or 3 above, the labels are automatically
531531
\anchor saving-histograms
532532
## Saving/reading histograms to/from a ROOT file
533533
534-
The following statements create a ROOT file and store an histogram
534+
The following statements create a ROOT file and store a histogram
535535
on the file. Because TH1 derives from TNamed, the key identifier on
536536
the file is the histogram name:
537537
~~~ {.cpp}
@@ -562,7 +562,7 @@ When using the options 2 or 3 above, the labels are automatically
562562
TH1::GetMean(int axis) returns the mean value along axis
563563
TH1::GetStdDev(int axis) returns the sigma distribution along axis
564564
TH1::GetEntries() returns the number of entries
565-
TH1::Reset() resets the bin contents and errors of an histogram
565+
TH1::Reset() resets the bin contents and errors of a histogram
566566
~~~
567567
IMPORTANT NOTE: The returned values for GetMean and GetStdDev depend on how the
568568
histogram statistics are calculated. By default, if no range has been set, the
@@ -2585,7 +2585,7 @@ Double_t *TH1::GetIntegral()
25852585
}
25862586

25872587
////////////////////////////////////////////////////////////////////////////////
2588-
/// Return a pointer to an histogram containing the cumulative content.
2588+
/// Return a pointer to a histogram containing the cumulative content.
25892589
/// The cumulative can be computed both in the forward (default) or backward
25902590
/// direction; the name of the new histogram is constructed from
25912591
/// the name of this histogram with the suffix "suffix" appended provided
@@ -2657,7 +2657,7 @@ TH1 *TH1::GetCumulative(Bool_t forward, const char* suffix) const
26572657
/// Copy this histogram structure to newth1.
26582658
///
26592659
/// Note that this function does not copy the list of associated functions.
2660-
/// Use TObject::Clone to make a full copy of an histogram.
2660+
/// Use TObject::Clone to make a full copy of a histogram.
26612661
///
26622662
/// Note also that the histogram it will be created in gDirectory (if AddDirectoryStatus()=true)
26632663
/// or will not be added to any directory if AddDirectoryStatus()=false
@@ -2804,7 +2804,7 @@ void TH1::DirectoryAutoAdd(TDirectory *dir)
28042804
/// Compute distance from point px,py to a line.
28052805
///
28062806
/// Compute the closest distance of approach from point px,py to elements
2807-
/// of an histogram.
2807+
/// of a histogram.
28082808
/// The distance is computed in pixels units.
28092809
///
28102810
/// #### Algorithm:
@@ -3049,12 +3049,12 @@ Bool_t TH1::Divide(const TH1 *h1, const TH1 *h2, Double_t c1, Double_t c2, Optio
30493049
/// Histograms are drawn via the THistPainter class. Each histogram has
30503050
/// a pointer to its own painter (to be usable in a multithreaded program).
30513051
/// The same histogram can be drawn with different options in different pads.
3052-
/// When an histogram drawn in a pad is deleted, the histogram is
3052+
/// When a histogram drawn in a pad is deleted, the histogram is
30533053
/// automatically removed from the pad or pads where it was drawn.
3054-
/// If an histogram is drawn in a pad, then filled again, the new status
3054+
/// If a histogram is drawn in a pad, then filled again, the new status
30553055
/// of the histogram will be automatically shown in the pad next time
30563056
/// the pad is updated. One does not need to redraw the histogram.
3057-
/// To draw the current version of an histogram in a pad, one can use
3057+
/// To draw the current version of a histogram in a pad, one can use
30583058
/// `h->DrawCopy();`
30593059
/// This makes a clone of the histogram. Once the clone is drawn, the original
30603060
/// histogram may be modified or deleted without affecting the aspect of the
@@ -3116,7 +3116,7 @@ void TH1::Draw(Option_t *option)
31163116
/// using graphics input will be made on the copy of the histogram,
31173117
/// and not to the original object.
31183118
/// By default a postfix "_copy" is added to the histogram name. Pass an empty postfix in case
3119-
/// you want to draw an histogram with the same name
3119+
/// you want to draw a histogram with the same name
31203120
///
31213121
/// See Draw for the list of options
31223122

@@ -4061,7 +4061,7 @@ TFitResultPtr TH1::Fit(const char *fname ,Option_t *option ,Option_t *goption, D
40614061
/// bin statistics, where the chi2 method may give incorrect results, in particular when there are
40624062
/// several empty bins (see also below).
40634063
/// In case of a weighted histogram, it is possible to perform a likelihood fit by using the
4064-
/// option "WL". Note a weighted histogram is an histogram which has been filled with weights and it
4064+
/// option "WL". Note a weighted histogram is a histogram which has been filled with weights and it
40654065
/// contains the sum of the weight square ( TH1::Sumw2() has been called). The bin error for a weighted
40664066
/// histogram is the square root of the sum of the weight square.
40674067
///
@@ -4073,8 +4073,8 @@ TFitResultPtr TH1::Fit(const char *fname ,Option_t *option ,Option_t *goption, D
40734073
/// When using option "WW" these bins will be considered in the chi2 fit with an error of 1.
40744074
/// Note that if the histogram is having bins with zero content and non zero-errors they are considered as
40754075
/// any other bins in the fit. Instead bins with zero error and non-zero content are excluded in the chi2 fit.
4076-
/// A likelihood fit should also not be performed on such an histogram, since we are assuming a wrong pdf for each bin.
4077-
/// In general, one should not fit an histogram with non-empty bins and zero errors, apart if all the bins have zero
4076+
/// A likelihood fit should also not be performed on such a histogram, since we are assuming a wrong pdf for each bin.
4077+
/// In general, one should not fit a histogram with non-empty bins and zero errors, apart if all the bins have zero
40784078
/// errors. In this case one could use the option "w", which gives a weight=1 for each bin (unweighted least-square
40794079
/// fit).
40804080
/// Note that in case of histogram with no errors (chi2 fit with option W or W1) the resulting fitted parameter errors
@@ -4092,7 +4092,7 @@ TFitResultPtr TH1::Fit(const char *fname ,Option_t *option ,Option_t *goption, D
40924092
/// One or more object (typically a TF1*) can be added to the list
40934093
/// of functions (fFunctions) associated to each histogram.
40944094
/// When TH1::Fit is invoked, the fitted function is added to this list.
4095-
/// Given an histogram h, one can retrieve an associated function
4095+
/// Given a histogram h, one can retrieve an associated function
40964096
/// with:
40974097
///
40984098
/// ~~~ {.cpp}
@@ -4269,7 +4269,7 @@ void TH1::FitPanel()
42694269
}
42704270

42714271
////////////////////////////////////////////////////////////////////////////////
4272-
/// Return an histogram containing the asymmetry of this histogram with h2,
4272+
/// Return a histogram containing the asymmetry of this histogram with h2,
42734273
/// where the asymmetry is defined as:
42744274
///
42754275
/// ~~~ {.cpp}
@@ -5093,8 +5093,8 @@ Double_t TH1::Interpolate(Double_t, Double_t, Double_t) const
50935093
}
50945094

50955095
///////////////////////////////////////////////////////////////////////////////
5096-
/// Check if an histogram is empty
5097-
/// (this a protected method used mainly by TH1Merger )
5096+
/// Check if a histogram is empty
5097+
/// (this is a protected method used mainly by TH1Merger )
50985098

50995099
Bool_t TH1::IsEmpty() const
51005100
{
@@ -6558,7 +6558,7 @@ void TH1::RecursiveRemove(TObject *obj)
65586558
/// If you are not interested in the histogram statistics you can call
65596559
/// Sumw2(kFALSE) or use the option "nosw2"
65606560
///
6561-
/// One can scale an histogram such that the bins integral is equal to
6561+
/// One can scale a histogram such that the bins integral is equal to
65626562
/// the normalization parameter via TH1::Scale(Double_t norm), where norm
65636563
/// is the desired normalization divided by the integral of the histogram.
65646564
///
@@ -6650,7 +6650,7 @@ UInt_t TH1::GetAxisLabelStatus() const
66506650

66516651
////////////////////////////////////////////////////////////////////////////////
66526652
/// Static function to set the default buffer size for automatic histograms.
6653-
/// When an histogram is created with one of its axis lower limit greater
6653+
/// When a histogram is created with one of its axis lower limit greater
66546654
/// or equal to its upper limit, the function SetBuffer is automatically
66556655
/// called with the default buffer size.
66566656

@@ -7530,7 +7530,7 @@ Double_t TH1::GetStdDev(Int_t axis) const
75307530
/// Value returned is standard deviation of sample standard deviation.
75317531
/// Note that it is an approximated value which is valid only in the case that the
75327532
/// original data distribution is Normal. The correct one would require
7533-
/// the 4-th momentum value, which cannot be accurately estimated from an histogram since
7533+
/// the 4-th momentum value, which cannot be accurately estimated from a histogram since
75347534
/// the x-information for all entries is not kept.
75357535
///
75367536
/// IMPORTANT NOTE: The returned value depends on how the histogram statistics
@@ -8767,7 +8767,7 @@ void TH1::SetBins(Int_t nx, const Double_t *xBins, Int_t ny, const Double_t *yBi
87678767
}
87688768

87698769
////////////////////////////////////////////////////////////////////////////////
8770-
/// By default when an histogram is created, it is added to the list
8770+
/// By default, when a histogram is created, it is added to the list
87718771
/// of histogram objects in the current directory in memory.
87728772
/// Remove reference to this histogram from current directory and add
87738773
/// reference to new directory dir. dir can be 0 in which case the

0 commit comments

Comments
 (0)