program TEST_CWN c Glen Cowan c 12 December, 1999 c Test program for using column wise ntuples. c Generates momentum vectors for 3 particles distributed uniformly c in phase space; uses the subroutine RAMBO by R. Kleiss, W.J. Stirling c and S.D. Ellis, Comp. Phys. Commun. 40 (1986) 359. implicit NONE c Constants integer num_particles parameter (num_particles = 3) real m_pi parameter (m_pi = 0.139) ! GeV double precision E_cm parameter (E_cm = 1.0) ! GeV double precision mass (num_particles) / num_particles*m_pi / c Needed for HBOOK routines integer hsize parameter (hsize = 1000000) integer hmemor (hsize) common /pawc/ hmemor c Common block for ntuple real p1, p2, p3 common /evtblk/ p1(3), p2(3), p3(3) c Local variables character*80 outfile integer i integer icycle integer id integer j integer k integer istat integer lw integer num_events double precision p (4, num_particles) double precision wt c Initialize HBOOK, open file, book ntuple. call HLIMIT (hsize) outfile = 'test_cwn.hbook' id = 1 call HROPEN (20, 'ntuple', outfile, 'N', 1024, istat) call HBNT (id, 'p1(3), p2(3), p3(3)', ' ') call HBNAME (id, 'evtblk', p1, 'p1(3), p2(3), p3(3)') c Assign pion mass to all final state particles do i = 1, num_particles mass(i) = m_pi end do lw = 1 ! requests unweighted events write (*, *) 'enter number of events to generate' read (*, *) num_events do i = 1, num_events c Generate momentum vectors uniformly distributed in phase space. call RAMBO (num_particles, E_cm, mass, p, wt, lw ) c Pack three-momenta into p1, p2, p3 and fill ntuple. do j = 1, 3 p1(j) = p(j,1) p2(j) = p(j,2) p3(j) = p(j,3) end do call HFNT (id) end do c create subroutine needed later to read in ntuple (only needed once) c open (30, file = 'read_cwn_setup.f', status = 'unknown') c call HUWFUN (30, id, 'READ_CWN_SETUP', 0, 'B') c close (30) c Store histogram and close. call HROUT (0, icycle, ' ') call HREND ('ntuple') stop END