next up previous contents index
Next: Get information about Up: Ntuples Previous: Disk resident Ntuples

Making projections of a RWN

 

CALL HPROJ1 (ID,IDN,ISEL,FUN,IFROM,ITO,IVARX)

Action: Fill an existing one-dimensional histogram with data from a RWN.

Input parameters:
ID
Identifier of 1-dimensional histogram, which must have been previously booked with HBOOK1.
IDN
Identifier of the RWN Ntuple.
ISEL
Selection flag
0
No selection criterion. All events between IFROM and ITO are histogrammed with a weight of one.
<>0
The function FUN is called for each event between IFROM and ITP, which are histogrammed with as weight the value of FUN. of one.
FUN
User function, to be declared EXTERNAL in the calling routine. It has as parameters the array of variables X and the selection flag ISEL. If FUN=0., no filling takes place for that event.
IFROM
Event number where the histogramming has to start.
ITO
Event number where the histogramming has to end.
IVARX
Sequence number in the Ntuple of the variable to be histogrammed

Example of the use of a one-dimensional Ntuple projection

     PROGRAM MAIN
     EXTERNAL WFUNC
     CALL HPROJ1(10,20,1,WFUNC,0,0,4)
     .....
     FUNCTION WFUNC(X,ISEL)
     DIMENSION X(*)
     WFUNC=0.
     IF(ISEL.EQ.1)THEN
         IF(X(2)**2 +X(3)**2.LT.0.)WFUNC=1.
     ELSEIF(ISEL.EQ.2)THEN
         IF(X(2)**2 +X(3)**2.GT.5.)WFUNC=1.
     ELSE
         WFUNC=X(5)
     ENDIF
     END

Note that in an interactive session with PAW, the user function FUN can be defined interactively using a Fortran-like syntax without recompilation and relinking.

CALL HPROJ2 (ID,IDN,ISEL,FUN,IFROM,ITO,IVARX,IVARY)

Action: Same action as HPROJ1, but filling a previously booked 2-dimensional histogram or a profile histogram. Variable X(IVARX) will be projected onto the X axis and X(IVARY) onto the Y axis for all entries in the Ntuple between IFROM and ITO inclusive.

The number of entries in an Ntuple can be obtained by HNOENT.


Last update: Tue May 16 09:09:27 METDST 1995