We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3bbd6a7 commit 0348440Copy full SHA for 0348440
1 file changed
asps/Simulation/geant321/gphys/grayl.F
@@ -1,9 +1,13 @@
1
*
2
-* $Id: grayl.F,v 1.1.1.1 2004/01/15 00:12:15 potekhin Exp $
+* $Id: grayl.F,v 1.2 2020/06/05 12:47:55 jwebb Exp $
3
4
* $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
+*
8
* Revision 1.1.1.1 2004/01/15 00:12:15 potekhin
9
10
11
* Revision 1.1.1.1 1997/11/03 15:30:43 atlascvs
12
* Importing CERNLIB version 08.21.
13
@@ -82,6 +86,8 @@ SUBROUTINE GRAYL
82
86
C
83
87
C Find out cos(theta)
84
88
COSTH=1.-0.5*(QNEW*GEKIN1)**2
89
+ IF (COSTH.LT.-1.) COSTH=-1.
90
+ IF (COSTH.GT.1.) COSTH=1.
85
91
IF(RNDM(2).GT.0.5*(1.+COSTH**2)) GO TO 5
92
SINTH=SQRT((1.-COSTH)*(1.+COSTH))
93
0 commit comments