Integration of histogram


I have a histogram and I wanted to do an integration of that. It will be a great help
,if you can provide me a script. I am attaching root file
output3.root (123.7 KB)

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi!

You can use TH2::Integral() for that:

void testComputeIntegral() {

    auto file = TFile::Open("output3.root", "READ");

    auto h = file->Get<TH2F>("h");

    std::cout << h->Integral() << std::endl;

    delete file;
}

Thankuu so much Jonas