      REAL FUNCTION getmax(idchannel)
*
      include 'getmax.inc'
      integer idchannel
      common /marcel/im,xmin,xmax,ymin,ymax,smin,smax,rmin,rmax
      getmax=1.

      if (idnevt.eq.1) then
	call hnoent(20,in)
	xmax=-100.
	xmin=100.
	ymax=-100.
	ymin=100.
	rmax=-100.
	rmin=100.
	smax=-100.
	smin=100.
      endif	
      

      if (idch.eq.idchannel) then
	if (x.gt.xmax) xmax=x
	if (x.lt.xmin) xmin=x
        if (x.gt.xmax) xmax=x
        if (x.lt.xmin) xmin=x
      endif


      endif

 
      END
