Re: [ROOT] h2root and root v04/008 problem (?)

From: Reinhardt Chamonal (chamonal@ph.ed.ac.uk)
Date: Fri Nov 12 2004 - 14:36:49 MET


Ok, works fine thanks for the details.


On Fri, 12 Nov 2004, Rene Brun wrote:

> Reinhardt,
> 
> Instead of
>     h2root r222.rz h2root.root 0
> could you do
>     h2root r222.rz h2root.root 0 1 0 8000 0
> 
> the parameters are explained when executing h2root with no arguments
>   h2root
> ===>  h2root file.hbook  file.root [compress] [tolower] [lrecl] [bufsize]
> [optcwn]
>       if file.root is not given  it will be = file.root
>       compress = 1 by default (use 0 for no compression)
>       tolower  = 1 by default (use 0 to keep case of column names)
>       lrecl =0 by default (must be specified if >8092)
>       bufsize = 8000 by default (branch buffer size)
>       for cwn ntuple only: optcwn  = 1 (default)  1-byte int -> char, 2-byte int
> -> short, (use 0 to keep 4-byte int)
> 
> It is likewly that your original PAW ntuple had a bit compression specified.
> The new h2root converts short integers from PAW to a char or short C++ type
> if possible. If this is the case, you should change the definition
> of your C++ variables from int to short or char.
> 
> Rene Brun
> 
> Reinhardt Chamonal wrote:
> > 
> > Hi,
> > Since we installed the new version of root v4/08 (an update from v4/01)
> > h2root doesn't seem to  convert my .rz ntuples properly.
> > here is what I do:
> > 
> > h2root r222.rz h2root.root 0
> > 
> > Now, on an old converted file (with version 4/01) my program runs fine. I
> > however noticed that the program was failling to properly read the
> > branches on newly converted files. So I deleted the old converted file and
> > replaced it with a new to check it wasn't jsut this file.
> > I have now the same problem with my new converted file:
> > it does the conversion but when I run my program
> > it dosen't seem to be able to read the entries properly anymore. (I have
> > been stupid as I should had renamed my old version as a reference)
> > Here is the code.. he doesn't seem to be able to fullfil my if statement.
> > where I have a cout command.. (which worked on the old converted
> > file before)
> > 
> >  const long cc=40000;
> >   float norm[cc];
> > 
> >   int pixid[cc];
> >   int pdid[cc];
> >   int dc;
> >   TBranch* b_nch=t->GetBranch("nch");
> >   TBranch* b_norm=t->GetBranch("norm");
> >   TBranch* b_pdid=t->GetBranch("pdid");
> >   TBranch* b_pixid=t->GetBranch("pixid");
> > 
> >   b_nch->SetAddress(&dc);
> >   b_norm->SetAddress(norm);
> >   b_pixid->SetAddress(pixid);
> >   b_pdid->SetAddress(pdid);
> > 
> >   for(int i=0;i<ne;i++){
> >     if (((i+1) % 1000) == 0) cout<<i+1<<endl;
> >     t->LoadTree(i);
> >     b_nch->GetEntry(i);
> >     b_norm->GetEntry(i);
> >     b_pixid->GetEntry(i);
> >     b_pdid->GetEntry(i);
> >     for(int j=0;j<dc;j++) {
> >       for(int k=1;k<=64;k++){
> > 
> >         if (pixid[j]==k &&pdid[j]==3){
> > 
> >         MaPMT3[k-1][i]=norm[j];
> >         cout<<"MaPMT["<<k-1<<"]["<<i<<"]:"<<norm[j]<<endl;
> > 
> >        }
> >       }
> >     }
> >   }
> > 
> > I know it's a bit vague but could it be that there is a conflict with the
> > new version of root ? Or am I being stupid somewhere. I tought I ask you
> > before annoying my sys-admin with a request to go back to the old version of root.
> > 
> > Cheers
> > 
> > --
> > ------------------------------------------------------------
> >  Reinhardt CHAMONAL            The University of Edinburgh
> >                                School of Physics
> >  email: chamonal@ph.ed.ac.uk   King's Buildings, JCMB, 5301
> >                                Mayfield Road
> >  phone: +44-131-650 5307       Edinburgh, EH9 3JZ
> > 
> >  web: http://www.ph.ed.ac.uk/~chamonal/
> >       http://www.reuh.ovh.org
> > ------------------------------------------------------------
> 

-- 
------------------------------------------------------------
 Reinhardt CHAMONAL            The University of Edinburgh  
                               School of Physics 
 email: chamonal@ph.ed.ac.uk   King's Buildings, JCMB, 5301 
                               Mayfield Road                
 phone: +44-131-650 5307       Edinburgh, EH9 3JZ           
 
 web: http://www.ph.ed.ac.uk/~chamonal/
      http://www.reuh.ovh.org
------------------------------------------------------------



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