My root version is 6.30/04. My CERNLIB version is 2023. Both are installed using homebrew. My MacOS is Sonoma 14.2.1.
I have a very simple .hbook file created by piece of example code from the HBOOK manual.
PROGRAM TEST
PARAMETER (NWPAWC = 15000)
COMMON/PAWC/PAW(NWPAWC)
CHARACTER*8 CHTAGS(5)
DIMENSION EVENT(5)
EQUIVALENCE (EVENT(1),X),(EVENT(2),Y),(EVENT(3),Z)
EQUIVALENCE (EVENT(4),ENERGY),(EVENT(5),ELOSS)
DATA CHTAGS/'X','Y','Z','Energy','Eloss'/
C
CALL HLIMIT(NWPAWC)
CALL HROPEN(1,'EXAMPLE','EXAMPLE.hbook','N',1024,ISTAT)
IF(ISTAT.NE.0)GO TO 99
CALL HBOOKN(10,'A Row-Wise-Ntuple',5,'//EXAMPLE',5000,CHTAGS)
CALL HBOOK1(100,'Energy distribution',100,0.,100.,0.)
C
DO 10 I=1,10000
CALL RANNOR(X,Y)
Z=SQRT(X*X+Y*Y)
ENERGY=50. + 10.*X
ELOSS=10.*ABS(Y)
CALL HFN(10,EVENT)
CALL HFILL(100,ENERGY,0.,1.)
10 CONTINUE
*
CALL HROUT(0,ICYCLE,' ')
CALL HREND('EXAMPLE')
*
99 CONTINUE
END
This is compiled and linked with this line:
gfortran test.f -o test -L/opt/homebrew/lib/cernlib/2023/lib -lpacklib -lkernlib
When I run it, it produces the file example.hbook. I would like to convert it using h2root.
But this doesn’t work.
pate@SFP-MacBook-Pro-Work CERNLIB % h2root example.hbook
RZIODO. Error at record = 2 LUN = 10 IOSTAT = 5001
>>>>>> CALL RZEND(CHDIR)
Cannot open fileHROPEN 0
Error on hropen was 101
Error cannot open input file: example.hbook
It also doesn’t work to try to use the THbookFile class to Convert2root.
pate@SFP-MacBook-Pro-Work CERNLIB % root
------------------------------------------------------------------
| Welcome to ROOT 6.30/04 https://root.cern |
| (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers |
| Built for macosxarm64 on Jan 31 2024, 08:17:06 |
| From heads/master@tags/v6-30-04 |
| With Apple clang version 15.0.0 (clang-1500.1.0.2.5) |
| Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------------
root [0] THbookFile f("example.hbook");
root [1] f.Convert2root();
RZIODO. Error at record = 2 LUN = 10 IOSTAT = 5001
>>>>>> CALL RZEND(CHDIR)
Cannot open fileHROPEN 0
Error on hropen was 101
Error cannot open input file: example.hbook
Error in <TFile::TFile>: file /Users/pate/Library/CloudStorage/Dropbox/CERNLIB/example.root does not exist
So I think some sort of bug has crept in if h2root and Convert2root both do not work on this simple case. Or it could be I am doing something wrong. Any advice is appreciated.