Read histograms from file and plot

Read histograms from file and plot

1 HISTOGRAM/FILE 1 PAWHISTS.HBOOK 2 HRIN * 3 LDIR 3 HI/LIST 5 ZON 2 2 hi/pl 100 set htyp 244 hi/pl 110 5 ZONE 1 2 2 'S' hi/plot 200 4 CLOSE 1 6 HI/DEL 100,200

  1. In this example the existing file PAWHISTS.HBOOK is attached in READ-ONLY mode.
  2. The command HRIN * (or HRIN 0 ) gets all the histograms from the file PAWHISTS.HBOOK into the memory. Note that commands like HIST/PLOT take automatically the histogram from the file if it is not already in memory.
  3. Both LDIR and HI/LIST give the list of the histograms. LDIR is the generic command to list the content of a ZEBRA file. It has no knowledge about the objects stored in the file that's why it cannot retrieve the histogram names. The HBOOK specific command HIST/LIST is able to find informations on the histogram like the histogram title and the histogram type. On the next page is given the output of these two commands.
  4. To release an histogram file it is enough to do CLOSE n where `` n '' is the logical unit number used by the command HIST/FILE .

    Note also:

  5. The usage of the command ZONE . It is used two times to define zones with different sizes.
  6. In some commands, some parameters have the attributes Loop . This is visible in the help:

    HELP of HISTOGRAM/DELETE

    * HISTOGRAM/DELETE ID ID C 'Histogram Identifier' Loop Delete histogram/Ntuple ID in Current Directory (memory). If ID=0 delete all histograms and Ntuples. To delete histograms in disk files use command HIO/HSCRATCH.
    When a list of parameters (separated by ``,'') is given PAW execute the invoked command for each parameter in the list.


Output of LDIR

************** Directory ===> //LUN1 <=== Created 941121/1116 Modified 941208/1413 ===> List of objects HBOOK-ID VARIABLE CYCLE DATE/TIME NDATA 100 0 2 941121/1116 151 110 0 2 941121/1116 85 200 0 2 941121/1116 780 Number of records = 5 Number of megawords = 0 + 4250 words Per cent of directory quota used = .016 Per cent of file used = .016 Blocking factor = 23.164

Output of HIST/LIST before HISTOGRAM/DELETE

===> Directory : 100 (1) HTFUN1.F 110 (1) Test 1-dim Histo 200 (2) HTFUN2

Output of HIST/LIST after HISTOGRAM/DELETE

===> Directory : 110 (1) Test 1-dim Histo


Last update: 96/05/24 17.20
Olivier.Couet@Cern.Ch