loading all chain to the memory

From: <bandurin_at_fnal.gov>
Date: Thu, 11 Aug 2005 13:50:14 -0500


I am using the following code to create the chain of two files:

  TChain * chain = new TChain("TMBTree",""); // do not modify this line   // Point here your root-tuples. Wildcards are allowded:   TString FilesToRead1 = "./1_new.root";   TString FilesToRead2 = "./2_new.root";
  Int_t fnum1 = chain->Add(FilesToRead1);
  Int_t fnum2 = chain->Add(FilesToRead2);
  int nb_read = chain->GetEntry(0);

  cout << endl << nb_read <<" bytes read" << endl;   TTree *tree = (TTree*)chain->GetTree()->CloneTree(0);

But I have faced with the following problem. When I do a cycle over all entries (250+250 in my case) the program works fast just for 250 entries from the first file. Starting from the second (Event number 251), it seems to load to the memory entry by entry and execution becomes much slower.

How to speed up the execution ? Perhaps one needs to load a larger portion of entries (may be equal to the number of entries in each file)?

Dmitry   Received on Thu Aug 11 2005 - 20:50:21 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:11 MET