void pedestalhistest() { TH1F *hist = new TH1F("hist","Histogram",15000,0,300); fstream file; file.open("Pedestal_0_2_5_2023_002.ascii", ios::in); Double_t n; Int_t i; while(1) { double x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11; file >> x1 >> x2 >> x3 >> x4 >> x5 >> x6 >> x7 >> x8 >> x9 >> x10 >> x11; hist->Fill(x4); if(file.eof()) break; } for (i=1; i<= hist->GetNbinsX();i++){ n = hist->GetBinContent(i); } file.close(); hist->Scale(1); hist->GetXaxis()->SetTitle("Channels"); hist->GetYaxis()->SetTitle("Particle counts"); TCanvas *c1 = new TCanvas(); hist->Draw(); cout << "Bin counts: "<< n << endl; }