In the attached histogram I want find the number of evnet before 50 GeV. Here is the macro which takes histogram from the input root file:
void pt()
{
TFile *myfile_1=TFile::Open("/storage/submitDir/CxAOD.root",“READ”);
TH1F myhist_1= new TH1F(“myhist”,“h1”,100,0.0,250.);
myhist_1=(TH1F)myfile_1->Get(“muon_Pt”);
TCanvas *c1 = new TCanvas();
c1->cd();
gStyle->SetOptStat(kFALSE);
myhist_1->Integral(myhist_1->FindFixBin(0.), myhist_1->FindFixBin(50.) - 1);
myhist_1->SetLineWidth(3);
myhist_1->SetTitle("");
myhist_1->GetXaxis()->SetTitle(" Electron Pt [GeV]");
myhist_1->GetYaxis()->SetTitle(“Events”);
myhist_1->Rebin(2);
myhist_1->Draw(“l”);
}