TH1F* hist = new TH1F("hist", "histogram", 10, 0, 100);
hist->Fill(10); hist->Fill(20); hist->Fill(30);
hist->Draw();In this example, we plot the histogram using the Draw() function. Overall, the TH1F class is a useful tool for creating and manipulating one-dimensional histograms in C++. It is a part of the ROOT package library, a widely used software for data analysis.