I’m trying to automatically fill a large number of histograms. I have a set of histograms named { I1, I2, I3 , … }. I loop over a a large number of events, and for each event:
You could also use a 2-dimensional histogram, pt vs mass. This would simplify the filling. In case you need the 1-dimensional pt distributions, you can easily get them by doing a projection.
[quote]char histname[50];
…
histname->Fill(mass);[/quote]
You are getting confused by the CINT extension that allow him to parse a variable name and automatic defined and load it if is find it in a file.
Instead you should have
[quote]char histname[50];
TH1F * hist = new TH1F(histname,“generic title”,nbins,min,max);
hist->Fill(mass);[/quote]
(Or some other way to declare and define the histogram).