Skip to content

Commit 0348440

Browse files
klendathu2kgenevb
authored andcommitted
Protect against cos(theta)>1 and/or <1
1 parent 3bbd6a7 commit 0348440

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • asps/Simulation/geant321/gphys

asps/Simulation/geant321/gphys/grayl.F

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
*
2-
* $Id: grayl.F,v 1.1.1.1 2004/01/15 00:12:15 potekhin Exp $
2+
* $Id: grayl.F,v 1.2 2020/06/05 12:47:55 jwebb Exp $
33
*
44
* $Log: grayl.F,v $
5+
* Revision 1.2 2020/06/05 12:47:55 jwebb
6+
* Protect against cos(theta)>1 and/or <1
7+
*
58
* Revision 1.1.1.1 2004/01/15 00:12:15 potekhin
69
*
10+
*
711
* Revision 1.1.1.1 1997/11/03 15:30:43 atlascvs
812
* Importing CERNLIB version 08.21.
913
*
@@ -82,6 +86,8 @@ SUBROUTINE GRAYL
8286
C
8387
C Find out cos(theta)
8488
COSTH=1.-0.5*(QNEW*GEKIN1)**2
89+
IF (COSTH.LT.-1.) COSTH=-1.
90+
IF (COSTH.GT.1.) COSTH=1.
8591
IF(RNDM(2).GT.0.5*(1.+COSTH**2)) GO TO 5
8692
SINTH=SQRT((1.-COSTH)*(1.+COSTH))
8793
C

0 commit comments

Comments
 (0)