problem on hadd

From: Hajime Nanjo <nanjo_at_scphys.kyoto-u.ac.jp>
Date: Wed, 28 Jun 2006 00:26:27 +0900


Dear ROOT developers,

I have a trouble in TTree::Draw() for a root file created wiht hadd, when maximum size of variable length array is different between two input files of hadd.
The number of events drawn is less than that actually filled. An error message, "ERROR leaf:a, len=2 and max=1", indicates excess of leaf length beyond the maximum leaf length.

When "fast" option in TChain::Merge is deleted at the line 248 in hadd.cxx, the problem is vanished.

Please fix this problem.
(I use ROOT 5.10/00 in scientific linux 4)

Best regards,
Hajime

A script creating two input files, "sub1.root", sub2.root", is as follows.

////////////////////////////////////////////////////////
{
  int n;
  double a[100];
  TFile* tf = new TFile("sub1.root","RECREATE");
  TTree* tr = new TTree("tr","tr");
  tr->Branch("n",&n,"n/I");

  tr->Branch("a",a,"a[n]/D");
  {
    n=1;
    a[0]=1;
    tr->Fill();
  }
  tr->Write();
  tf->Close();

  tf = new TFile("sub2.root","RECREATE");   tr = new TTree("tr","tr");
  tr->Branch("n",&n,"n/I");
  tr->Branch("a",a,"a[n]/D");
  {
    n=2;
    a[0]=1;
    a[1]=2;
    tr->Fill();
  }
  tr->Write();
  tf->Close();
}

////////////////////////////////////////////////////////
A file, "all.root", is created as follows. hadd all.root sub1.root sub2.root
////////////////////////////////////////////////////////
TTree::Draw() is called as follows.
root [0] TFile* tf = new TFile("all.root") root [1] tr->Print()

*Tree :tr : tr *
*Entries : 2 : Total = 1698 bytes File Size = 668 *
Received on Tue Jun 27 2006 - 17:26:37 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:59 MET