Random Number Generation

[HRANDOMN]

                            +----------------+
                            | R=  HRNDM1 (ID) |
                            +----------------+
                                  

Action: Returns a random number distributed according to the contents of 1-dimensional histogram.

Input parameter:
ID
Identifier of an existing 1-dimensional histogram according to whose distribution random numbers have to be generated.

Remark:

  1. The first time HRNDM1 is called on a given histogram with identifier ID, the channel contents of the original histogram are replaced by the integrated channel contents, normalized to 1.
  2. The histogram ID must be booked with 1 bin/word (VMX=0)
  3. If the histogram ID does not exist, zero is returned
  4. If the histogram ID is empty, or if the sum of its channel contents is not positive, a message is printed and a flat distribution is assumed.

                           +--------------------------+
                           | CALL  HRNDM2 (ID,RX*,RY*) |
                           +--------------------------+
                                      

    Action: Returns a random point (RX, RY) distributed according to the contents of a 2-dimensional histogram.

    Input parameter:
    ID
    Identifier of a 2-dimensional histogram
    Output parameters
    RX,RY
    Random numbers.

    Remark:

    1. Same as HRNDM1
    2. These 2 entries can be used in conjunction with HBFUN1 and HBFUN2 respectively.