next up previous contents index
Next: Rounding Up: Overview of booking Previous: Histograms with non-equidistant

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.

H(J) ∑ Y E(J) ∑ Y2

l(J) ∑ l L(J) ∑ l

h(J) H(J)/L(J) s(J) E(J)/L(J)-h(J)**2

e(J) s(J) / 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 \Rind{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).

Profile histograms can be filled with weights.

The computation of the errors and the text below is based on a proposal by Stephane Coutugif.

If a bin has N data points all with the same value Y (especially possible when dealing with integers), the spread in Y for that bin is zero, and the uncertainty assigned is also zero, and the bin is ignored in making subsequent fits. This is a problem. If Y was the correct error in the case above, then Y/N

would be the correct error here. In fact, any bin with non-zero number of entries N but with zero spread should have an uncertainty Y/N .

Yet, is Y/N

really the correct uncertainty? Probably it is only true in the case where the variable Y is some sort of counting statistics, following a Poisson distribution. This should probably correspond to the default case. However, Y can be any variable from an original Nntuple, not necessarily distributed according to a Poisson distribution. Therefore several settings for the option variable CHOPT are possible to determine how errors should be calculated (S stands for the spread in the formulae below):

' '
(Default)

'S'
Errors are S for S≠0. ,
&quad;""Y for S=0,N>0 ,
&quad;""0. for N=0 .

'I'
Errors are S/N for S≠0. ,
&quad;""1./12.N for S=0,N>0 ,
&quad;""0. for N=0 .

The third case above corresponds to integer Y values for which the uncertainty is ±0.5 , with the assumption that the probability that Y takes any value between Y-0.5 and Y+0.5

is uniform (the same argument goes for Y uniformly distributed between Y and Y+1 ); this could be useful, for instance, for the case where Y are ADC measurements.


next up previous contents index
Next: Rounding Up: Overview of booking Previous: Histograms with non-equidistant

Janne Saarela
Tue May 16 09:09:27 METDST 1995