Taking an integral of a distribution

Attached is the distribution and I want to take an integral of it. Please suggest.unnamed.pdf (13.4 KB)

You posted a pdf file … it is difficult to base some analysis on a pdf file …

Kindly suggest me what do you need?

Some data file ? some prototype of a macro you may have already ?

Here is the macro:

void integral()
{
TFile *myfile_1=TFile::Open("/storage/local/home/submitDir/hist-signa.root","READ");
TH1F *myhist_1= new TH1F("myhist","h1",100,0.0,250.);
myhist_1=(TH1F*)myfile_1->Get("XhhSM_PRE_muon_Pt");
TCanvas *c1 = new TCanvas();
c1->cd();
myhist_1->Draw("HIST");
myhist_1->SetLineWidth(3);
myhist_1->SetTitle("");
myhist_1->GetXaxis()->SetTitle("Lepton Pt [GeV]");
myhist_1->GetYaxis()->SetTitle("Events");
myhist_1->Rebin(2);
}

TH1::Integral

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.