/[PAMELA software]/PamVMC/trk/src/f77/gprspe.F
ViewVC logotype

Annotation of /PamVMC/trk/src/f77/gprspe.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Feb 19 17:46:26 2009 UTC (15 years, 11 months ago) by nikolas
Branch: MAIN
Cleaning up before releasing

1 nikolas 1.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     CALL GRNDM(RVAL1,1)
59    
60     XRAN1=RVAL1(1)
61     IF(XRAN1.LE.XMULT1_2(IANGLEX)) THEN
62     XMULT=2.
63     ELSE IF((XMULT1_2(IANGLEX).LT.XRAN1).
64     + AND.(XRAN1.LE.XMULT3(IANGLEX)) ) THEN
65     XMULT=3.
66     ELSE
67     XMULT=4.
68     ENDIF
69    
70    
71    
72     IF( (ANGLEX.LE.ANGLECUT.AND.XMULT.LE.2).OR.
73     + (ANGLEX.GT.ANGLECUT.AND.XMULT.LE.3) ) THEN
74     C
75     C LMS CONDITION IS MET, SAMPLE THE X RESIDUALS
76     C
77     CALL GPRNHRAN(WX(1,IANGLEX),NDHIRES,-150.,0.3,DXPOS)
78    
79     C
80     C TRANSFORM IN CM
81     C
82     DXPOS=DXPOS*1.E-4
83    
84     ELSE
85     C
86     C HMS CONDITION IS MET, SAMPLE THE X RESIDUALS
87     C
88     DXPOS = GPGAUS(0.)*XRMSHMS(IANGLEX)
89     DXPOS=DXPOS*1.E-4
90     ENDIF
91    
92    
93     C
94     C FIND THE Y ANGULAR BIN
95     C
96     IANGLEY=NBINANG
97     IF(VANG(12).LE.ANGLEY) GO TO 124
98     DO II=1,NBINANG
99     IF((VANG(II).LE.ANGLEY).AND.(ANGLEY.LE.VANG(II+1))) THEN
100     IANGLEY=II
101     GO TO 124
102     ENDIF
103     ENDDO
104     124 CONTINUE
105    
106     C
107     C SAMPLE THE Y RESIDUALS
108     C
109     CALL GPRNHRAN(WY(1,IANGLEY),NDHIRES,-150.,0.3,DYPOS)
110     C
111     C TRANSFORM IN CM
112     C
113    
114     DYPOS=DYPOS*1.E-4
115    
116    
117     RETURN
118     END

  ViewVC Help
Powered by ViewVC 1.1.23