[ROOT] Performance issue with TChain

From: Frank Winklmeier (frank.winklmeier@colostate.edu)
Date: Fri Mar 19 2004 - 19:05:27 MET


I experience some strange performance problems on using TChain. I am 
pretty sure that I am doing something wrong, but I cannot figure out what.
I use the following code generated by TChain::MakeSelector.

Bool_t analysis::Process(Int_t entry)
  // Processing function. This function is called
  // to process an event. It is the user's responsability to read
  // the corresponding entry in memory (may be just a partial read).
  // Once the entry is in memory one can apply a selection and if the
  // event is selected histograms can be filled.

  cout <<entry<<" "<<event<<":"<<runNumber<<endl;

  // ... do a bunch of other stuff

  return 1;

The output looks something like that:

0 9:2001390
2198 64121:2004222
2199 64129:2004222
2200 64153:2004222
2201 64179:2004222
2202 64182:2004222
0 5:2032850
1 6:2032850
2 47:2032850
3 122:2032851
4 149:2032851

To run over the first (here 2202) entries is really fast. But when it 
reaches the second file in the chain (where entry is resetted to 0) the 
speed goes down by a factor of 10! For me, it seems that the second file 
is not loaded into memory and thus is much slower.

Anybody an idea how I can fix that.

Thanks, Frank

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:06 MET