I wish to allocate a large number of histograms (or believe that I wish to do so…), but after the first 30 have been allocated the rest fail. There does not seem to be any shortage of memory availible. Is this a feature of some settable parameter, or a symptom of something else wrong.
The context:
I’m attempting to add a new function to a stand-alone root program called GOFAR (part of the G0 analysis suite). I need to process selected data from 64 independant detectors over a large ntuple (> 200000 events). Looping over all the events requires considerable time, and I don’t want to make any more passes than necessary.
The allocating code can be abstracted down to something like this:
//#include various root needs...
vector <Th1F> histo1dvector;
histo1dvector->resize(129);
char *name, *title;
for (Int_t i=0; i<129; i++){
// name set to unique string
// title set to another unique string
histo1dvector[i] = new TH1F(name,title,128,0,32768);
};
which compiles and runs just fine, but only the first 30 histograms are sucessfully allocated.
Searching for another way to do it: In the event that allocating 130 histogram really is hard, I need a work-around. I want the histograms to find a peak (one peak in each) using Fit(), or perhaps the TSpectrum class. I’ve considered using 1 1d histogram, and 8 2d histograms with 16 bin in y, but don’t yet know enough root to know how easily the fitting will be accomplished in this context.
Any suggestion (for allocating more histograms or proceeding another way) would be appreciated.
[quote=“ardashev”]I did not understand your reply.
is the problem solved ?[/quote]
No.
The code in my original post was not a correct representation of the actual code by exactly the error you corrected…
So I still have this problem in which only 30 TH1Fs are being allocated. i’m trying to obtain a stand-alone invocation of the problem (without the many thousands of lines already in GOFAR). Failure in this attempt may be enlightening in and of itself.