CW-Ntuple duplicated with selection (1)

In this example the ``subset-Ntuple'' is filled with
a direct call to a COMIS function, without the command
NT/LOOP .
A sub-Ntuple with nation = 'FR'
opt stat
hi/file 1 cwn_aptuple.hbook
1 UWFUNC //LUN1/11 CWN.INC
hi/file 2 cwn_aptuple_dup.hbook ! N
nt/dupl //lun1/11 110
*
application comis quit
subroutine ntdup(id1,id2)
include 'cwn.inc'
3 CALL HNOENT(ID1,NOENT)
do ievent=1,noent
4 CALL HGNT(ID1,IEVENT,IERR)
if (ierr.ne.0) goto 20
if (nation.eq.'FR') then
5 CALL HFNT(ID2)
endif
enddo
20 continue
*
end
quit
*
2 CALL NTDUP(11,110)
2 HROUT 110
*
nt/plot //lun1/11.children
set hcol 1105
nt/plot //lun2/110.children option=s
set hwid 8
nt/plot //lun1/11.children nation='FR' option=s

- Generate the include file coresponding to the original ntuple.
Note that
UWFUNC
generate an include
file if the extension of the file name is .inc .
- Call the routine which duplicate the Ntuple, and save the
``subset-Ntuple'' on disk.
- Get the number of entries in the original ntuple in order to
loop over all the events.
- Get the event number IEVENT.
- Fill the ``subset-Ntuple'' with the selected events.

Last update: 96/05/24 17.23 Olivier.Couet@Cern.Ch