A second run using program HTEST1 below shows
how to add some data to the HBOOK RZ file
created in the job HTEST (Figure
).
After opening the file HTEST.DAT, created in the previous run,
in update mode ('U' option) with the
name EXAM2, a new directory NTUPLE is created,
known as //EXAM2/NTUPLE as seen in the output of
HLDIR command at the end of the output.
One-dimensional (10) and two-dimensional (20) histograms
and an Ntuple (30) are booked.
Each Ntuple element or ``event''
is characterised by three variables
(labelled 'X', 'Y' and 'Z').
The Ntuple data, when the initial size of 1000
words is exhausted, will be written to the directory on disk
specified in the
call to HBOOKN, i.e. //EXAM2/NTUPLE,
and the data in memory are replaced with those newly read.
A one- and a two-dimensional projection
of X and X/Y are then made onto histograms
10 and 20 respectively, before they are printed and written on the
HBOOK RZ file. At the end the current and parent
directories are listed.
The contents of the latter shows that the data written in
the first job (HTEST) are indeed still present in the file
under the top directory //EXAM2.
The call to RZSTAT shows usage statistics about the RZ file.
Example of adding data to a HBOOK RZ file
PROGRAM HTEST1
PARAMETER (NWPAWC=20000)
COMMON/PAWC/H(NWPAWC)
DIMENSION X(3)
CHARACTER*8 CHTAGS(3)
DATA CHTAGS/' X ',' Y ',' Z '/
*.----------------------------------------------------
CALL HLIMIT(NWPAWC)
* Reopen data base
LRECL = 0
CALL HROPEN(1,'EXAM2','HTEST.DAT','U',LRECL,ISTAT)
CALL HMDIR('NTUPLE','S')
CALL HBOOK1(10,'TEST1',100,-3.,3.,0.)
CALL HBOOK2(20,'TEST2',30,-3.,3.,30,-3.,3.,250.)
CALL HBOOKN(30,'N-TUPLE',3,'//EXAM2/NTUPLE',
+ 1000,CHTAGS)
*
DO 10 I=1,10000
CALL RANNOR(A,B)
X(1)=A
X(2)=B
X(3)=A*A+B*B
CALL HFN(30,X)
10 CONTINUE
*
CALL HPROJ1(10,30,0,0,1,999999,1)
CALL HPROJ2(20,30,0,0,1,999999,1,2)
CALL HPRINT(0)
CALL HROUT(0,ICYCLE,' ')
CALL HLDIR(' ',' ')
CALL HCDIR('\',' ')
CALL HLDIR(' ',' ')
CALL RZSTAT(' ',999,' ')
CALL HREND('EXAM2')
END
TEST1
HBOOK ID = 10 DATE 02/09/89 NO = 1
280
270 - -
260 I I -
250 - I I I
240 - I I-I- I -
230 I-I--I I I-I-
220 -I I I I-
210 I I I I-
200 I I-I I-
190 - - --I I --
180 I-I-I I-II--
170 I I
160 I I--
150 - -I I --
140 -I-I I II
130 -I I-II-
120 -I I-
110 --I I--
100 --I I
90 I I
80 I I----
70 --I I-
60 -I I--
50 ---I I--
40 -----I I--
30 I I-----
20 - ----I I---
10 --------I-I I--------
CHANNELS 100 0 1
10 0 1 2 3 4 5 6 7 8 9 0
1 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
CONTENTS 100 11111111111111122222222221222222111111111111111
10 1 1111333334446669000123434878888132522637496233109788775524421007777655443322222111
1. 1266487877127932587516069303434644322909949809367004036056844525243975324963516782565365312194856211
LOW-EDGE --------------------------------------------------
1. 3222222222222222211111111111111111 111111111111111112222222222222222
0 0988776554432211099887665543322100998776654433211000112334456677899001223345566788990112234455677889
0 0482604826048260482604826048260482604826048260482606284062840628406284062840628406284062840628406284
* ENTRIES = 10000 * ALL CHANNELS = 0.9969E+04 * UNDERFLOW = 0.1200E+02 * OVERFLOW = 0.1900E+02
* BIN WID = 0.6000E-01 * MEAN VALUE =-0.3907E-02 * R . M . S = 0.9857E+00
TEST2
HBOOK ID = 20 DATE 02/09/89 NO = 2
CHANNELS 10 U 0 1 2 3 O
1 N 123456789012345678901234567890 V
**************************************
OVE * + ++ +232++2+ +++ * OVE
2.8 * ++ 2 +2 + 2 + * 30
2.6 * 2 2+ +34+++ ++ + * 29
2.4 * 2+ 3322343+ 3++ + * 28
2.2 * + 2 247236663524+23++ + * 27
2 * + 2+23769597A75 6+2+ 2 * 26
1.8 * + 5598576EBCDAA53357 2+ + * 25
1.6 * ++3278CC9JFO8F98C86643+2+ * 24
1.4 * 344686AAGJJMEMIDFG964232+ + * 23
1.2 * ++++44BBJGMQOPWNICCGI97322++ + * 22
1 * 2+545BGOMTSX*VYTJMCFA755++2 * 21
.8 * 2+4799DHSRUX****VXRQJC57635+ * 20
.6 * + +25CBEKLZ********MXGGCI4322 3 * 19
.4 * 2 4+779BN*U*********YOIFB862 * 18
.2 * 2 ++266CCLR************OIHA464+2 4 * 17
* + 3238ECX*T***********YKPC772 + * 16
- .2 * + +423D6LDS**X********ZUMGC543+ 2 * 15
- .4 * + 2347CAHSSX*********UMK75D2 3 + * 14
- .6 * 2334AAKML*V**********IIH9773++ + * 13
- .8 * +22565CLJL*X******Z*TL9H948+ + * 12
- 1 * 2 2 32666EMLN****Q*ULLQMABB342+ 2 * 11
- 1.2 * + 22377BDIUS*P***TTUNBDA545+2 * 10
- 1.4 * + + 2 +689E7KKNWUNRIHJCEA472+++ + * 9
- 1.6 * 2+3+74BCMJIGOIKEIAAD6643++ 2 * 8
- 1.8 * + + +2222856AA8HGJACB6786+2+2++ * 7
- 2 * + 2 +273598EDC5977634++ * 6
- 2.2 * + + ++2+274977548883+++2 +++ * 5
- 2.4 * + +3367558445+442+ + * 4
- 2.6 * +2 + 2224+6++7234 + + * 3
- 2.8 * + 33+3+322++ + * 2
- 3 * ++ ++ 22 2 +4+2 2 * 1
UND * + + 23 +2+++ + * UND
**************************************
LOW-EDGE ---------------
1. 32222211111 1111122222
0 086420864208642024680246802468
* I 19 I
* ENTRIES = 10000 PLOT -------I--------I-------
* SATURATION AT= 255 12 I 9936 I 19
* SCALE .,+,2,3,.,., A,B, STATISTICS -------I--------I-------
* STEP = 1 * MINIMUM=0 I 14 I
********************************************************
* NTUPLE ID= 30 ENTRIES= 10000 N-TUPLE *
********************************************************
* Var numb * Name * Lower * Upper *
********************************************************
* 1 * X * -.422027E+01 * 0.386411E+01 *
* 2 * Y * -.411076E+01 * 0.378366E+01 *
* 3 * Z * 0.485187E-04 * 0.179518E+02 *
********************************************************
===> Directory : //EXAM2/NTUPLE
30 (N) N-TUPLE
10 (1) TEST1
20 (2) TEST2
===> Directory : //EXAM2
100 (1) Test of HRNDM1
110 (1) Filled according to HTFUN1
200 (2) Test of HRNDM2
210 (2) Fill according to HTFUN2
NREC NWORDS QUOTA(%) FILE(%) DIR. NAME
34 34066 .21 .21 //EXAM2/NTUPLE
41 40438 .26 .26 //EXAM2
Adding data to a HBOOK RZ file