Histograms with non-equidistant bins
+--------------------------------------+ |CALL HBOOKB (ID,CHTITL,NCX,XBINS,VMX) | +--------------------------------------+
Action: As HBOOK1, but instead of giving the lower and upper limits, an array XBINS of NCX+1 elements is provided.
Profile histograms
+------------------------------------------------------+ | CALL HBPROF (ID,CHTITL,NCX,XLOW,XUP,YMIN,YMAX,CHOPT) | +------------------------------------------------------+Action: Create a profile histogram. Profile histograms are used to display the mean value of Y and its RMS for each bin in X. Profile histograms are in many cases an elegant replacement of two-dimensional histograms : the inter-relation of two measured quantities X and Y can always be visualized by a two-dimensional histogram or scatter-plot; its representation on the line-printer is not particularly satisfactory, except for sparse data. If Y is an unknown (but single-valued) approximate function of X, this function is displayed by a profile histogram with much better precision than by a scatter-plot.
The following formulae show the cumulated contents (capital letters) and the values displayed by the printing or plotting routines (small letters) of the elements for bin J.
2 H(J) = sum Y E(J) = sum Y l(J) = sum l L(J) = sum l h(J) = H(J)/L(J) s(J) = sqrt(E(J)/L(J)- h(J)**2) e(J) = s(J)/sqrt(L(J))
The first five parameters are similar to HBOOK1. Only the values of Y between YMIN and YMAX will be considered. To fill a profile histogram, one must use CALL HFILL (ID,X,Y,1.).
H(J) is printed as the channel contents. The errors displayed are s(J) if CHOPT='S' (spread option), or e(J) if CHOPT=' ' (error on mean).
Rounding
+--------------------------+ | CALL HBINSZ ('YES'/'NO') | +--------------------------+
Action: Round the bin size for bookings of subsequent histograms to a reasonable value, i.e.: 1.,1.5,2.,2.5,4.,5. times an integer power of 10. HBINSZ controls a switch that, when on, rounds the binsize, still respecting the number of bins. The switch is initially off.
Projections, Slices, Bands
+--------------------+ |CALL HBPRO (ID,VMX) | +--------------------+
Action: Books the projections of a 2-dimensional histogram as two 1-dimensional histograms.
Remark:
+----------------------+ | CALL HBPROX (ID,VMX) | +----------------------+ and--------------------+ | CALL HBPROY (ID,VMX) | +----------------------+
Action: Books projection onto X or Y only. See HBPRO for more details.
+------------------------------+ | CALL HBANDX (ID,YMI,YMA,VMX) | +------------------------------+
Action: Books a projection onto X, restricted to the Y interval (YMI,YMA).
The same remarks as for HBPRO apply.
+------------------------------+ | CALL HBANDY (ID,XMI,XMA,VMX) | +------------------------------+
Action: As HBANDX but the projection is onto Y.
+--------------------------+ |CALL HBSLIX (ID,NSLI,VMX) | +--------------------------+
Action: Books slices along Y of 2-dimensional histograms as NSLI 1-dimensional histograms. Each slice is a projection onto X restricted to an interval along the Y axis.
The same remarks as for HBPRO apply.
+--------------------------+ |CALL HBSLIY (ID,NSLI,VMX) | +--------------------------+
Action: As HBSLIX but slices are projected onto Y.
Statistics
Mean value and standard deviation of 1-dimensional histograms are calculated at editing time, using the channel contents. If a more accurate calculation is desired, or if more statistical information is needed, the following option will provide it : CALL HIDOPT (ID,'STAT') STAT
+----------------+ |CALL HBARX (ID) | +----------------+
Action: Store the errors for 1-dimensional histograms, X-projections, etc., in memory and superimpose them on the plot during output. This routine must be called after booking but before filling.
If ID corresponds to a 2-dimensional histogram, HBARX acts on all X projections, slices, bands.
i n 2 Error(i)= sqrt(sum W ) j=1 ji
where :
i bin number i n number of entries in bin i W weight of event j in bin i ji
It is clear that the sum of the squares of weights in each bin must also be stored to perform this calculation. However when filling with weight always equal to 1, errors can be calculated from bin contents only, and HBARX, HBARY need not be called. The superimposition of error bars can be selected at output time, using HIDOPT(ID,'ERRO') ERRO In both cases the values of errors can be printed under the contents, via the editing option HIDOPT(ID,'PERR') HPAKE permits user-defined error bar setting.
+----------------+ |CALL HBARY (ID) | +----------------+
Action: As HBARX, it is used to act on Y projections of 2-dimensional histograms.
Function Representation
+----------------------------------------+ | CALL HBFUN1 (ID,CHTITL,NX,XMI,XMA,FUN) | +----------------------------------------+
Action: Books 1-dimensional histogram and fills it with the values of the external function FUN(X) computed at the centre of each bin. One computer word per channel is used.
The first five parameters are as for HBOOK1.
+--------------------------------------------------+ |CALL HBFUN2 (ID,CHTITL,NX,XMI,XMA,NY,YMI,YMA,FUN) | +--------------------------------------------------+
Action: Books a 2-dimensional histogram and fills it with the values of the external function FUN(X,Y), computed at the centre of each bin. One computer word per channel is used.
The first eight parameters are as for HBOOK2.
+--------------------+ |CALL HFUNC (ID,FUN) | +--------------------+
Action: Samples the function FUN, which must have been declared EXTERNAL, at the centre of the bins of a histogram. The function will be superimposed onto the histogram at editing time and its values optionally printed out (see HIDOPT(ID,'PFUN') PFUN
Remark:
2 n 2 i 2 chi = sum (((C(i)- F(i)) )/(sum W )) i=1 j=1 ji
with:
n the number of channels of the histogram ch C(i) the contents of channel i F(i) the value of the function at the centre of channel i i n the number of entries in channel ii W the weight of event j in channel i ji i.e. square root of the contents C(i) or as given by HBARX/ HPAKE
+------------------------------+ | CALL HARRAY (ID,NWORDS,LOC*) | +------------------------------+
Action: Reserves an array in the memory storage area managed by HBOOK.
COMMON/PAWC/NWPAW,IXPAWC,IHDIV,IXHIGZ,IXKU,FENC(5),LMAIN,HCV(9989) DIMENSION IQ(2),Q(2),LQ(8000) EQUIVALENCE (LQ(1),LMAIN),(IQ(1),LQ(9)),(Q(1),IQ(1)) IADDR = Q(LOC+1)
Remark:
At any time the address of preudo-histogram ID can be obtained with HLOCAT(ID,LOC)
A set of routines, HLABEL, HFC1 and HFC2, allows one to associate labels with histogram channels. This association can be made before or after a histogram is filled, but it has the advantage that the label information get stored in the histogram data structure, so that it is available for all future plots in an automatic way in the HPLOT and PAW packages. Printing histograms with associated alphanumeric labels is not implemented in the line-printer oriented routines of HBOOK.
+------------------------------------+ | CALL HLABEL (ID,NLAB,*CLAB*,CHOPT) | +------------------------------------+
Action: Associates alphanumeric labels with a histogram. This routine can be called for a histogram after it has been filled, and then the labels specified will be shown on the respective axes. The routine can also be called before a histogram is filled , and in this case, when filling, a certain order can be imposed. By default the entries will be automatically ordered.
Notes: