The cpp function TH1D Integral computes the integral of a one-dimensional histogram within a specified range. The function takes two arguments: the lower and upper bounds of the range.
Below are some brief code examples:
```c++
// Create a 1D histogram with 10 bins from 0 to 9
TH1D* hist = new TH1D("hist", "My Histogram", 10, 0, 9);
// Fill the histogram with random values
for (int i = 0; i < 100; i++) {
hist->Fill(gRandom->Uniform(0, 9));
}
// Compute the integral of the histogram from bin 3 to bin 8
double integral = hist->Integral(3, 8);
```
This example creates a 1D histogram with 10 bins and fills it with random values between 0 and 9. It then calculates the integral of the histogram between bins 3 and 8.
The `TH1D` class is part of the ROOT package (https://root.cern/), a data analysis toolkit used in high-energy physics research.
C++ (Cpp) TH1D::Integral - 30 examples found. These are the top rated real world C++ (Cpp) examples of TH1D::Integral extracted from open source projects. You can rate examples to help us improve the quality of examples.