I have a (specific) problem and a question (I use ROOT v. 4.04/02):
I use TTrees in ROOT and after creating script to loop over events in tree (MakeClass()) I create my private code in tree::Loop() method in xxx.C file.
In xxx.C file I create lots of TH1F* variables, fill them, etc… . Everything works fine and looping over events is fast (key point).
As my analysis evolves I add more and more simple variables (int, float, etc) or histograms and still the ROOT seem to loop over events equally as fast as at the beginnig. Perfect.
BUT at some point, when I add only 1 more plot which I then fill, the looping over events is suddenly very_slow. Even if I fill the histogram under a condition which is actually anyway ignored for some events (if (…) histo->Fill), looping is always slow.
When I then comment another line (another histo), the looping eventually starts to be as fast as at the beginning…
I am sorry I can not explain this particular problem more precisely, because I really don’t know what’s happening. Is it some internal memory that is filled up, or something? I heard other people complaining about the same problem. The only solution known to me is to reduce the number of histograms, but I guess there is some smarter way how to avoid such a decrease in speed?
Have anyone of you experienced the same problem? Thank you very much for any information.