Hi, I have a number of histograms that I manually extract from a .root file using
TFile *file = TFile::Open("myfile.root");
TH1F *h1 = (TH1F*)file->Get("FirstHistogram");
TH1F *h2 = (TH1F*)file->Get("SecondHistogram");
...
and so on for n histograms. Now, I want to manipulate them all in the same way (using basic operations on histograms and saving to png format). How can I loop over the histograms?
Ideally, I’d like something like this
for ( ??? ) { // Increment the integer j in the name of the histogram
hj->DoStuff(); // Act on histogram j
}
How do I set up the for loop?