This example is similar to the first, except that you will now create, fill, and output histograms, and use the PAW program to view them. You may want to have a look at the PAW tutorial first. This example will focus on histograms, but take a look at the ntuple section, too: "ntuples" are a very powerful feature of PAW.
Copy the following files from
/var/phy/project/hep/neutrino/work/schol/superk/examplesinto your working directory:
Take a look at the differences between example1.F and example2.F. You will see that several lines having to do with histograms have been added, which call HBOOK routines. HBOOK is a CERN library histogramming package, and the histograms it creates can be read by PAW.
call hbook1(100,'Example 2 charge',100,0., 100., 0.)creates in memory histogram no. 100 (the first argument), with 50 bins going from 0 to 100.
call hf1(100, qisk(ihcab(ihit)), 1.)"fills" the histogram with that hit's charge value. In other words, it increments the bin of the histogram corresponding to qisk for tube ihcab(ihit) by 1.
Compile and run this program in the same way as for example 1. You should get less output to the screen (because the print statements have been commented out), but you should get a file called example2.hbk created. This contains the histogram created and filled by the program.
h/file 1 example2.hbk h/list h/plot 100The first line opens the file; the next lists the histograms in the file (there should be just one, no. 100); the last plots histogram 100. These commands are also written in example2.kumac, which is a PAW macro file. If you type exec example2 in the PAW command line, they will all be executed.
After you've gotten this working and viewed the charge histogram, try some of the following. In the source code, change the histogram creation calls to:
Also, inside PAW, try: