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 |
#include "gpdrspe.inc" |
31 |
REAL BMAGNET(3),ANGLEX,ANGLEY,XMULT,YMULT,DXPOS,DYPOS |
32 |
PARAMETER (RADDEG=57.2957795130823209) |
33 |
REAL RVAL1(1),XRAN1 |
34 |
INTEGER IANGLEX,IANGLEY |
35 |
|
36 |
YMULT=1. |
37 |
XMULT=1. |
38 |
DXPOS=0. |
39 |
DYPOS=0. |
40 |
|
41 |
|
42 |
C |
43 |
C FIND THE X ANGULAR BIN |
44 |
C |
45 |
IANGLEX=NBINANG |
46 |
IF(VANG(12).LE.ANGLEX) GO TO 123 |
47 |
DO II=1,NBINANG |
48 |
IF((VANG(II).LE.ANGLEX).AND.(ANGLEX.LE.VANG(II+1))) THEN |
49 |
IANGLEX=II |
50 |
GO TO 123 |
51 |
ENDIF |
52 |
ENDDO |
53 |
123 CONTINUE |
54 |
c PRINT*,'IANGX ',IANGLEX |
55 |
C |
56 |
C SAMPLE THE X MULTIPLICITY |
57 |
C |
58 |
c PRINT*,'GPRSPE.F calls RNDM' |
59 |
CALL GRNDMC(RVAL1,1) |
60 |
|
61 |
XRAN1=RVAL1(1) |
62 |
IF(XRAN1.LE.XMULT1_2(IANGLEX)) THEN |
63 |
XMULT=2. |
64 |
ELSE IF((XMULT1_2(IANGLEX).LT.XRAN1). |
65 |
+ AND.(XRAN1.LE.XMULT3(IANGLEX)) ) THEN |
66 |
XMULT=3. |
67 |
ELSE |
68 |
XMULT=4. |
69 |
ENDIF |
70 |
|
71 |
|
72 |
|
73 |
IF( (ANGLEX.LE.ANGLECUT.AND.XMULT.LE.2).OR. |
74 |
+ (ANGLEX.GT.ANGLECUT.AND.XMULT.LE.3) ) THEN |
75 |
C |
76 |
C LMS CONDITION IS MET, SAMPLE THE X RESIDUALS |
77 |
C |
78 |
CALL GPRNHRAN(WX(1,IANGLEX),NDHIRES,-150.,0.3,DXPOS) |
79 |
|
80 |
C |
81 |
C TRANSFORM IN CM |
82 |
C |
83 |
DXPOS=DXPOS*1.E-4 |
84 |
|
85 |
ELSE |
86 |
C |
87 |
C HMS CONDITION IS MET, SAMPLE THE X RESIDUALS |
88 |
C |
89 |
DXPOS = GPGAUS(0.)*XRMSHMS(IANGLEX) |
90 |
DXPOS=DXPOS*1.E-4 |
91 |
ENDIF |
92 |
|
93 |
|
94 |
C |
95 |
C FIND THE Y ANGULAR BIN |
96 |
C |
97 |
IANGLEY=NBINANG |
98 |
IF(VANG(12).LE.ANGLEY) GO TO 124 |
99 |
DO II=1,NBINANG |
100 |
IF((VANG(II).LE.ANGLEY).AND.(ANGLEY.LE.VANG(II+1))) THEN |
101 |
IANGLEY=II |
102 |
GO TO 124 |
103 |
ENDIF |
104 |
ENDDO |
105 |
124 CONTINUE |
106 |
|
107 |
C |
108 |
C SAMPLE THE Y RESIDUALS |
109 |
C |
110 |
CALL GPRNHRAN(WY(1,IANGLEY),NDHIRES,-150.,0.3,DYPOS) |
111 |
C |
112 |
C TRANSFORM IN CM |
113 |
C |
114 |
|
115 |
DYPOS=DYPOS*1.E-4 |
116 |
|
117 |
|
118 |
RETURN |
119 |
END |