TChain Process slows down for second file

Dear ROOTers,

I am running a compiled root code using ROOT version 5.30.00 (64-bit). The code is based on a TSelector, from which an EvtBuilder class inherits to initialize the tree, and an analysis class inheriting from the EvtBuilder class to do the actual work. In summary, this is how it works:

int main(int argc, char *argv[]) {
[...]
DGSignal* dgSignal //This is my analysis TSelector class
[...]
dgSignal = new DGSignal;
[...]
char* filelist = Form("%s.txt",outfilename.c_str()); //Reading input files from a txt file
fl->AddFromFile(filelist);
chain.AddFileInfoList((TCollection*)fl->GetList());
[...]
nevents = chain.GetEntries();
[...]
chain.Process(dgSignal,"",nevents,0);
[...]
}

When Process is called, the dgSignal also runs the Init method from EvtBuilder to setup the tree cache

void EvtBuilder::Init(TTree * tree){
  // call the base classes Init, to get all the normal TSelector functionality
  // note that this sets fChain to the current tree

  Info("Init","init...");

  if (!tree) return;

#if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)    
   // setup TTreeCache
   Int_t cachesize = 100000000;   //Unit Bytes   
   tree->SetCacheSize(cachesize); 
   Info("Init","TTreeCache size set to %10d bytes.",cachesize);
#endif

  fChain = tree;
  fChain->SetMakeClass(1);
  
  EvtReader::Init(tree);

#if ROOT_VERSION_CODE >= ROOT_VERSION(5,26,0)    
   tree->StopCacheLearningPhase();     

#endif

  Info("Init","init done ...");
}

Now, this all runs marvelously when a single input file is used. But when 2 or more files are used, the first file proceeds normally, and the execution slows down to an excruciatingly low pace right as the second file is starting to be processed. Could it be that the cache size is only set for the first tree? What could be wrong?

Many thanks in advance,

Andrée

Hi Andre,

Do you still see this problem with v5.34/10?

Philippe.