1 |
cafagna |
3.1 |
SUBROUTINE GPRSPE(ANGLEX,ANGLEY,BMAGNET,XMULT,YMULT,DXPOS,DYPOS) |
2 |
|
|
************************************************************************** |
3 |
|
|
* * |
4 |
|
|
* Perform SPE resolution simulation for one hit * |
5 |
|
|
* * |
6 |
|
|
* * |
7 |
|
|
* ANGLEX , angle between the X projected track and the axis * |
8 |
|
|
* normal to silicon surface * |
9 |
|
|
* * |
10 |
|
|
* ANGLEY , angle between the Y projected track and the axis * |
11 |
|
|
* normal to silicon surface * * |
12 |
|
|
* * |
13 |
|
|
* BMAGNET , value of magnetic field to be considered * |
14 |
|
|
* * |
15 |
|
|
* * |
16 |
|
|
* SMULT , on exit is the strip multiplicity * |
17 |
|
|
* * |
18 |
|
|
* * |
19 |
|
|
* DXPOS , on exit is the shift in X determination * |
20 |
|
|
* * |
21 |
|
|
* * |
22 |
|
|
* DYPOS , on exit is the shift in Y determination * |
23 |
|
|
* * |
24 |
|
|
* * |
25 |
|
|
* Called by: gpdspe * |
26 |
|
|
* Author: Sergio Bottai, 25/05/05 4.40.38 * |
27 |
|
|
* * |
28 |
|
|
************************************************************************** |
29 |
|
|
#include "gprspe.inc" |
30 |
|
|
REAL BMAGNET(3),ANGLEX,ANGLEY,XMULT,YMULT,DXPOS,DYPOS |
31 |
|
|
PARAMETER (RADDEG=57.2957795130823209) |
32 |
|
|
REAL RVAL1(1),XRAN1 |
33 |
|
|
INTEGER IANGLEX,IANGLEY |
34 |
|
|
|
35 |
|
|
YMULT=1. |
36 |
|
|
XMULT=1. |
37 |
|
|
DXPOS=0. |
38 |
|
|
DYPOS=0. |
39 |
|
|
|
40 |
|
|
|
41 |
|
|
C |
42 |
|
|
C FIND THE X ANGULAR BIN |
43 |
|
|
C |
44 |
|
|
IANGLEX=NBINANG |
45 |
|
|
IF(VANG(12).LE.ANGLEX) GO TO 123 |
46 |
|
|
DO II=1,NBINANG |
47 |
|
|
IF((VANG(II).LE.ANGLEX).AND.(ANGLEX.LE.VANG(II+1))) THEN |
48 |
|
|
IANGLEX=II |
49 |
|
|
GO TO 123 |
50 |
|
|
ENDIF |
51 |
|
|
ENDDO |
52 |
|
|
123 CONTINUE |
53 |
|
|
|
54 |
|
|
C |
55 |
|
|
C SAMPLE THE X MULTIPLICITY |
56 |
|
|
C |
57 |
|
|
CALL GRNDM(RVAL1,1) |
58 |
|
|
XRAN1=RVAL1(1) |
59 |
|
|
IF(XRAN1.LE.XMULT1_2(IANGLEX)) THEN |
60 |
|
|
XMULT=2. |
61 |
|
|
ELSE IF((XMULT1_2(IANGLEX).LT.XRAN1). |
62 |
|
|
+ AND.(XRAN1.LE.XMULT3(IANGLEX)) ) THEN |
63 |
|
|
XMULT=3. |
64 |
|
|
ELSE |
65 |
|
|
XMULT=4. |
66 |
|
|
ENDIF |
67 |
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
|
|
IF( (ANGLEX.LE.ANGLECUT.AND.XMULT.LE.2).OR. |
71 |
|
|
+ (ANGLEX.GT.ANGLECUT.AND.XMULT.LE.3) ) THEN |
72 |
|
|
C |
73 |
|
|
C LMS CONDITION IS MET, SAMPLE THE X RESIDUALS |
74 |
|
|
C |
75 |
|
|
CALL GPRNHRAN(WX(1,IANGLEX),NDHIRES,-150.,0.3,DXPOS) |
76 |
|
|
|
77 |
|
|
C |
78 |
|
|
C TRANSFORM IN CM |
79 |
|
|
C |
80 |
|
|
DXPOS=DXPOS*1.E-4 |
81 |
|
|
|
82 |
|
|
ELSE |
83 |
|
|
C |
84 |
|
|
C HMS CONDITION IS MET, SAMPLE THE X RESIDUALS |
85 |
|
|
C |
86 |
|
|
DXPOS = GPGAUS(0.)*XRMSHMS(IANGLEX) |
87 |
|
|
DXPOS=DXPOS*1.E-4 |
88 |
|
|
ENDIF |
89 |
|
|
|
90 |
|
|
|
91 |
|
|
C |
92 |
|
|
C FIND THE Y ANGULAR BIN |
93 |
|
|
C |
94 |
|
|
IANGLEY=NBINANG |
95 |
|
|
IF(VANG(12).LE.ANGLEY) GO TO 124 |
96 |
|
|
DO II=1,NBINANG |
97 |
|
|
IF((VANG(II).LE.ANGLEY).AND.(ANGLEY.LE.VANG(II+1))) THEN |
98 |
|
|
IANGLEY=II |
99 |
|
|
GO TO 124 |
100 |
|
|
ENDIF |
101 |
|
|
ENDDO |
102 |
|
|
124 CONTINUE |
103 |
|
|
|
104 |
|
|
C |
105 |
|
|
C SAMPLE THE Y RESIDUALS |
106 |
|
|
C |
107 |
|
|
CALL GPRNHRAN(WY(1,IANGLEY),NDHIRES,-150.,0.3,DYPOS) |
108 |
|
|
C |
109 |
|
|
C TRANSFORM IN CM |
110 |
|
|
C |
111 |
|
|
|
112 |
|
|
DYPOS=DYPOS*1.E-4 |
113 |
|
|
|
114 |
|
|
|
115 |
|
|
RETURN |
116 |
|
|
END |