next up previous contents index
Next: Limitations to the ALPHA Up: Booking and Filling Histograms/Ntuples Previous: Fill Ntuple with many   Contents   Index


Sample ALPHA program to book and fill histogram, Ntuple

The following example books and fills a histogram and Ntuple. See Chapters 7 and 8 for explanations of the ALPHA variables used.


      SUBROUTINE QUINIT
      CHARACTER*4 TAGS(2)
      DATA TAGS/'ECHG','NTRK'/
C--- Book histogram to store momentum distribution for all charged
C--- tracks.
      CALL QBOOK1(1,'Momentum',100,0.,50.,0.)
C--- Book Ntuple to store charged energy and number of charged tracks
C--- per event.
      CALL QBOOKN(1000,'Event parameters',2,TAGS)
      END
      SUBROUTINE QUEVNT (QT,KT,QV,KV)
C-----------------------------------------------------------------------
      INCLUDE 'PHYINC:QCDE.INC'              !VAX
      DIMENSION QT(KCQVEC,1), KT(KCQVEC,1), QV(KCQVRT,1), KV(KCQVRT,1)
      INCLUDE 'PHYINC:QMACRO.INC'            !VAX
C-----------------------------------------------------------------------
      IF(KNCHT.EQ.0)RETURN
      ECHRG=0.
C
C--- sum energy; histogram track momentum
C
      DO 20 IT=KFCHT,KLCHT
        ECHRG=ECHRG+QE(IT)
        CALL HF1(1,QP(IT),1.)
   20 CONTINUE
      CALL QHFN(1000,ECHRG,FLOAT(KNCHT))
      END



Joel Closier
2000-02-07