Re: [ROOT] Problems merging ntuples with Version 3.05/07

From: Alessio Sarti (Alessio.Sarti@lnf.infn.it)
Date: Fri Sep 24 2004 - 11:55:45 MEST


Hi all,
after migrating my code to the new root version (thanks to Rene) I still
have problems with the merged file:

below run360.root is obtained with v 040102 and merged.root merging
run360,361 and 362 root files....

root [0] TFile h("run360.root");
root [1] data->Show(33);
======> EVENT:33
 evt             = 42
 nadc            = 1
 ntdc            = 1
 ntdc128         = 1
 adcM            = 974,
                  1519, 1488, 901, 1329, 0, 164, 174
 tdcM            = 1761,
                  1763, 1777, 1787, 1907, 1826, 1628, 228
 Shit            = 0

 Sch             = 0

root [2] TFile h2("merged.root");
root [3] h2.cd();
root [4] data->Show(33);

 *** Break *** segmentation violation
 Generating stack trace...
 0x40e08144 in TLeafObject::ReadBasket(TBuffer&) + 0x1b6 from
/home/Packages/root/lib/libTree.so
 0x40dec8a1 in TBranch::ReadLeaves(TBuffer&) + 0x2f from
/home/Packages/root/lib/libTree.so
 0x40debaf5 in TBranch::GetEntry(long long, int) + 0x24f from
/home/Packages/root/lib/libTree.so
 0x40df7139 in TBranchObject::GetEntry(long long, int) + 0x139 from
/home/Packages/root/lib/libTree.so
 0x40e12cf3 in TTree::GetEntry(long long, int) + 0xa7 from
/home/Packages/root/lib/libTree.so
 0x40e16208 in TTree::Show(long long, int) + 0x34 from
/home/Packages/root/lib/libTree.so
 0x40e325b3 in <unknown> from /home/Packages/root/lib/libTree.so
 0x406e60d6 in G__call_cppfunc + 0x263 from
/home/Packages/root/lib/libCint.so
 0x406d58b6 in G__interpret_func + 0x6ee from
/home/Packages/root/lib/libCint.so
 0x406bd4c1 in G__getfunction + 0x134a from
/home/Packages/root/lib/libCint.so
 0x40741a74 in G__getstructmem + 0x82a from
/home/Packages/root/lib/libCint.so
 0x4073bb8d in G__getvariable + 0x4db from
/home/Packages/root/lib/libCint.so
 0x406b4a4e in G__getitem + 0x5c1 from /home/Packages/root/lib/libCint.so
 0x406b4c44 in G__getitem + 0x7b7 from /home/Packages/root/lib/libCint.so
 0x406b3666 in G__getexpr + 0x783e from /home/Packages/root/lib/libCint.so
 0x406fb1e6 in G__exec_function + 0x1d5 from
/home/Packages/root/lib/libCint.so
 0x40701e33 in G__exec_statement + 0x23eb from
/home/Packages/root/lib/libCint.so
 0x4069c83f in G__exec_tempfile_core + 0x2ce from
/home/Packages/root/lib/libCint.so
 0x4069ca1c in G__exec_tempfile_fp + 0x22 from
/home/Packages/root/lib/libCint.so
 0x4070a0c6 in G__process_cmd + 0x45f7 from
/home/Packages/root/lib/libCint.so
 0x4019dbbd in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*)
+ 0xa9 from /home/Packages/root/lib/libCore.so
 0x40106cd6 in TApplication::ProcessLine(char const*, bool, int*) + 0x670
from /home/Packages/root/lib/libCore.so
 0x41051ee9 in TRint::HandleTermInput() + 0x1dd from
/home/Packages/root/lib/libRint.so
 0x41050d5a in TTermInputHandler::Notify() + 0x24 from
/home/Packages/root/lib/libRint.so
 0x41052818 in TTermInputHandler::ReadNotify() + 0x12 from
/home/Packages/root/lib/libRint.so
 0x402244c9 in TUnixSystem::CheckDescriptors() + 0x143 from
/home/Packages/root/lib/libCore.so
 0x40223aa3 in TUnixSystem::DispatchOneEvent(bool) + 0x161 from
/home/Packages/root/lib/libCore.so
 0x40169190 in TSystem::InnerLoop() + 0x18 from
/home/Packages/root/lib/libCore.so
 0x40169135 in TSystem::Run() + 0x6f from
/home/Packages/root/lib/libCore.so
 0x4010774a in TApplication::Run(bool) + 0x32 from
/home/Packages/root/lib/libCore.so
 0x410519e5 in TRint::Run(bool) + 0x327 from
/home/Packages/root/lib/libRint.so
 0x0804886d in main + 0x71 from /home/Packages/root/bin/root.exe
 0x42015704 in __libc_start_main + 0xe4 from /lib/tls/libc.so.6
 0x0804876d in _Unwind_Resume + 0x31 from /home/Packages/root/bin/root.exe
Root >

I've attached the routine for the file merge that I've recompiled without
problems on v 040102..

Thanks in advance for any other advice that will come,
alessio

______________________________________________________
Alessio Sarti     INFN Frascati

>>>I'm in Frascati<<<

Cell   +39-06-94038166
Office +39-06-94032776
Fax    +39-06-94032427

"... e a un Dio 'fatti il culo' non credere mai..."
(F. De Andre')

"He was turning over in his mind an intresting new concept in
Thau-dimensional physics which unified time, space, magnetism, gravity
and, for some reason, broccoli".  (T. Pratchett: "Pyramids")



On Fri, 24 Sep 2004, Rene Brun wrote:

> Hi Alessio,
> 
> Move to a more recent version, eg 4.01/02
> 
> Rene Brun
> 
> Alessio Sarti wrote:
> > 
> > Hi all,
> > I'm trying to merge some ntuples with Version 3.05/07 and I'm having
> > problems with the produced ntuple.
> > The merging of the trees shows no problem:
> > the macro runs fine and I can open the "merged" file.
> > I can even call the Draw() function on the merged TTree.
> > But when I try to use the Scan() function or the Show or the Loop one I
> > have problems.
> > 
> > The merged ntuple contains TVectors (below I show the content of my
> > ntuple...)
> > 
> > //Declaration of leaves types
> >    Int_t           evt;
> >    Int_t           nadc;
> >    Int_t           ntdc;
> >    Int_t           ntdc128;
> >    Int_t           adcM[8][1];
> >    Int_t           tdcM[8][1];
> >    TVector         *Shit;
> >    TVector         *Sch;
> > 
> > //List of branches
> >    TBranch        *b_evt;   //!
> >    TBranch        *b_nadc;   //!
> >    TBranch        *b_ntdc;   //!
> >    TBranch        *b_ntdc128;   //!
> >    TBranch        *b_adcM;   //!
> >    TBranch        *b_tdcM;   //!
> >    TBranch        *b_Shit;   //!
> >    TBranch        *b_Sch;   //!
> > 
> > Here's my problem..
> > 
> > root [1] ((TTree*)gDirectory->Get("data"))->Scan();
> > ************************************************************************************************************
> > *    Row   *       evt *      nadc *      ntdc *   ntdc128 *      adcM *
> > tdcM *      Shit *       Sch *
> > ************************************************************************************************************
> > 
> >  *** Break *** segmentation violation
> >  Generating stack trace...
> > /usr/bin/c++filt: unknown demangling style `gnu-new-abi'
> > Root >
> > 
> > I've used the merging routine to merge other root files and everything
> > works fine: am I doing something wrong or there's a problem merging
> > TVectors?
> > 
> > Thanks for any advice or help,
> > alessio
> > 
> > ______________________________________________________
> > Alessio Sarti     INFN Frascati
> > 
> > >>>I'm in Frascati<<<
> > 
> > Cell   +39-06-94038166
> > Office +39-06-94032776
> > Fax    +39-06-94032427
> > 
> > "... e a un Dio 'fatti il culo' non credere mai..."
> > (F. De Andre')
> > 
> > "He was turning over in his mind an intresting new concept in
> > Thau-dimensional physics which unified time, space, magnetism, gravity
> > and, for some reason, broccoli".  (T. Pratchett: "Pyramids")
> 


#include <iostream.h>
#include "TChain.h"
#include "TString.h"
#include <TFile.h>
#include <TTree.h>
#include "TROOT.h"

extern void InitGui();
VoidFuncPtr_t initfuncs[] = {InitGui, 0};
TROOT root("Rint","The ROOT Interactive Interface", initfuncs);


int main (int argc, char *argv[]) {

  if (argc < 3) {
    cout << "usage: merge h999 merged.root *.root" << endl;
    return 0;
  }

  const char *n1, *n2, *f;
  n1 = argv[1];
  f  = argv[2];

  cout << "   ntuple: " << n1 << endl;
  cout << "   filename: " << f << endl;
  cout << "   Files to be merged:  " << endl;

  TChain cha(n1);

  if (argc > 3) {
    for (int i = 3; i < argc; ++i) {
      cha.Add(argv[i]);   cout << "       " << argv[i] << endl;
    }
  }


  TFile *fFile = new TFile(f, "UPDATE");
  if (fFile != 0) {
    cha.Merge(fFile, 32000); 
  } else {
    cha.Merge(f);
  }
  
  return 0;
}



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