	function correc(eavin,iac,t1in,t2in)
c
c	returns the acceptance (lt 1) due to the geometry and the tmin cutoff
c	t1in and t2in are t range of the bin for dopp=f and -pperp2
c	range for dopp=t
c
c******for 200 gev have temporarily multiplied emin and emnnfs by 2.0
c******in the data statements
c
	include '/u1/gcf/e350/crystal/cb/pperp'
	include '/u1/gcf/e350/crystal/cb/parms'
c
	include '/u1/gcf/e350/crystal/cb/type'
c
	include '/u1/gcf/e350/crystal/cb/clouds'
c
	dimension pi(5,2),emin(5),emnnfs(8),pinfs(4),pine(5)
	double precision eav,t1,t2,am2id,am2jd,pincd,tmin
c
	data pi/1.39,1.70,2.223,2.913,3.91,1.96,2.157,2.255,2.661,4.24/
	data pinfs/2.61,4.64,3.86,3.63/
	data emin/110.,130.,150.,170.,190./
	data emnnfs/40.,60.,80.,100.,120.,140.,160.,180./
	data pine/1.40,1.67,1.93,2.54,5.86/
c
101	format(' t min correc energy',f7.2,' t bin',2f6.2,' is',f8.3)
c
	if (dopp) goto 3
	crtmin=1.
c
c	set up double precision variables
	eav=eavin
	t1=t1in
	t2=t2in
	am2id=am2i
	am2jd=am2j
	pincd=pinc
	if (dopipi) goto 2
	tmin=am2id+am2jd-2.*eav*dsqrt(pincd**2+am2jd)+2.*pincd*
     1	dsqrt(eav*eav-am2id)
	if (tmin.gt.t1) goto 20
	if (tmin.lt.t2) goto 1
	if (.not.nfs) goto 4
	if (nfs.and.ipart.eq.1) goto 10
	if (nfs.and.ipart.eq.2) goto 11
	call abort
7	continue
	crtmin=(exp(expfac*tmin)-exp(expfac*t2))/(exp(expfac*t1)-
& 		exp(expfac*t2))
	print 101,eav,t1,t2,crtmin
c
c	calculate acceptance
20	tuse=amax1(-t1in,-tmin)
	correc=crtmin*dew(eavin,iac,tuse,-t2in,1)/(t1in-t2in)
	return
c
3	correc=dew(eavin,iac,-t1in,-t2in,2)/(t1in-t2in)
	return
c
1	correc=0.
	return
c
c     tmin correction for full inclusive case
4	do 5 iu=1,5
	if (eav.lt.emin(iu)) goto 6
5	continue
6	iu=min0(4,iu)
	expfac=((eav-emin(iu))*pi(iu+1,jp)+(emin(iu+1)-eav)*pi(iu,jp))/
& 	(emin(iu+1)-emin(iu))
	goto 7
c
c     tmin correction for nfs pizeros
c****** energies scaled by 2 temporarily for 200 gev data
10	do 8 iu=1,4
	if (eav.lt.emnnfs(iu)) goto 9
8	continue
9	iu=min0(3,iu)
	expfac=((eav-emnnfs(iu))*pinfs(iu+1)+(emnnfs(iu+1)-eav)
& 	*pinfs(iu))/(emnnfs(iu+1)-emnnfs(iu))
	goto 7
c
c     tmin correction for nfs etas
11	do 12 iu=4,8
	if (eav.lt.emnnfs(iu)) goto 13
12	continue
13	iu=min0(7,iu)
	expfac=((eav-emnnfs(iu))*pine(iu-2)+(emnnfs(iu+1)-eav)*
& 	pine(iu-2)+(emnnfs(iu+1)-eav)*pine(iu-3))/(emnnfs(iu+1)-
& 	emnnfs(iu))
	goto 7
c
c     tmin correction for 2 pizero case
2	rm=sqrt(am2i)-.04
	cor=0.
	do 25 i=1,10
	am2k=rm**2
	c=1.
	tmin=am2k+am2j-2.*eav*sqrt(pinc**2+am2j)+2.*pinc*sqrt(eav*eav-
& 	am2k)
	if(tmin.gt.t1)goto 22
	if(tmin.lt.t2)goto 21
	c=(t2-tmin)*(t1-.01821)/(t2-t1)/(tmin-.01821)
	goto 22
21	c=0.
22	cor=cor+c
25	rm=rm+.01
	crtmin=cor/10.
	return
c
	end
