/[PAMELA software]/calo/flight/CaloDoubleShower/src/getdblsh.for
ViewVC logotype

Annotation of /calo/flight/CaloDoubleShower/src/getdblsh.for

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Tue Aug 4 13:59:10 2009 UTC (15 years, 5 months ago) by mocchiut
Branch: MAIN
Changes since 1.1: +2 -0 lines
Changed to work with GCC 4.x (gfortran) + ROOT >= 5.24

1 mocchiut 1.1 ***********************************************************************
2     *
3     C
4     C DBLSC AND DUBSC (LOOK AT THE ROUTINES FOR MORE EXPLANATIONS) , ROUTINES TO
5     C CHECK FOR DOUBLE SHOWER . DBLS IS THE CONTROL FLAG . MEANING :
6     C 0 : NO DOUBLE SHOWER
7     C 1 : DOUBLE SHOWER ONLY ACCORDING TO DBLSC
8     C 3 : TOO LITTLE BENDING FOR THE CHARGED PARTICLE AND SO NO DOUBLE SHOWER
9     C ACCORDING TO DBLSC
10     C 10 : DOUBLE SHOWER ONLY ACCORDING TO DUBSC
11     C 11 : DOUBLE SHOWER ACCORDING TO DBLSC AND TO DUBSC
12     C 13 : CASE 3 + CASE 10
13     C
14     *
15     *****************************************************************************
16     INTEGER FUNCTION GETDBLSH()
17     c
18     IMPLICIT NONE
19     C
20     INCLUDE 'INTEST.TXT'
21     C
22     C Normal variables definition
23     C
24     C
25     DOUBLE PRECISION al_p(5),
26     & xout(nplav),yout(nplav),zin(nplav)
27     C
28     REAL POS, ANGOL, DEVT
29     REAL DIFX, EQQ,DBLS
30     REAL DBLSQ,RIMP
31     REAL CX,CY, PIANO(NPLAV)
32     REAL BAR(2,NPLAV),DISTX,SHIFT
33     C
34     INTEGER IBAR(2,NPLAV)
35     INTEGER I,J,M,IFAIL,NN
36     INTEGER INDIC
37 mocchiut 1.2 integer getdblsh
38 mocchiut 1.1 C
39     COMMON /SDOUBLE/ POS,ANGOL,DBLSQ,DBLS
40     SAVE /SDOUBLE/
41     C
42     COMMON / WHERE / CX, CY, PIANO
43     SAVE / WHERE /
44     C
45     COMMON / ANGOLO / BAR, IBAR
46     SAVE / ANGOLO /
47     C
48     C
49     C Begin !
50     C
51 mocchiut 1.2 getdblsh = 0
52 mocchiut 1.1 PIANO(1) = 0.
53     DO I = 2, NPLA
54     IF ( MOD(I,2).EQ.0 ) THEN
55     PIANO(I) = PIANO(I-1) - 8.09
56     ELSE
57     PIANO(I) = PIANO(I-1) - 10.09
58     ENDIF
59     ENDDO
60     C
61     CALL VZERO(BAR,2*NPLAV)
62     CALL VZERO(IBAR,2*NPLAV)
63     CALL VZERO(XOUT,NPLAV)
64     CALL VZERO(YOUT,NPLAV)
65     CALL VZERO(DEXY,2*LENSEV)
66     C
67     C FILL THE DEXY MATRIX
68     C
69     DO I = 1,NPLA
70     DO J = 1,96
71     IF ( MOD(I,2).NE.0 ) THEN
72     IF ( ESTRIP(2,I,J).GT.EMIN ) THEN
73     DEXY(2,I,J) = ESTRIP(2,I,J)
74     ENDIF
75     IF ( ESTRIP(1,I,J).GT.EMIN ) THEN
76     DEXY(1,I,J) = ESTRIP(1,I,J)
77     ENDIF
78     ENDIF
79     IF ( MOD(I,2).EQ.0 ) THEN
80     IF (ESTRIP(2,I,J).GT.EMIN) THEN
81     DEXY(2,I,J) = ESTRIP(2,I,J)
82     ENDIF
83     IF (ESTRIP(1,I,J).GT.EMIN) THEN
84     DEXY(1,I,J) = ESTRIP(1,I,J)
85     ENDIF
86     ENDIF
87     ENDDO
88     ENDDO
89     C
90     C PROJECT TRACK INSIDE THE CALORIMETER
91     C
92     do M = 1, 5
93     al_p(M) = al_pp(1,M)
94     enddo
95     if (al_p(5).eq.0.) THEN
96     PRINT *,' WARNING: track with R = 0, discarded'
97     GOTO 50
98     ENDIF
99     C
100     RIMP = ABS(1./AL_P(5))
101     C
102     DO M = 1,2
103     DO I = 1,NPLA
104     XOUT(I) = 0.
105     YOUT(I) = 0.
106     IF (MOD(M,2).EQ.0) THEN
107     DISTX = PIANO(I) + ZALIG
108     ELSE
109     DISTX = PIANO(I) - 5.81 + ZALIG
110     ENDIF
111     ZIN(I) = distx / 10.
112     enddo
113     IFAIL = 0
114     call DOTRACK(NPLA,ZIN,XOUT,YOUT,AL_P,IFAIL)
115     if(IFAIL.ne.0)then
116     goto 50
117     endif
118     DO I = 1, NPLA
119     NN = 0
120     IF (M.EQ.2) NN = 1
121     IF (MOD(I,2).EQ.NN) THEN
122     SHIFT = +0.5
123     ELSE
124     SHIFT = -0.5
125     ENDIF
126     C
127     C CHECK IF XOUT OR YOUT ARE NaN
128     C
129     IF (XOUT(I).NE.XOUT(I).OR.YOUT(I).NE.YOUT(I)) THEN
130     GOTO 50
131     ENDIF
132     C
133     IF (M.EQ.1) THEN
134     BAR(M,I) = XOUT(I)*10. + XALIG
135     ELSE
136     BAR(M,I) = YOUT(I)*10. + YALIG
137     ENDIF
138     C
139     CALL LASTRISCIA(BAR(M,I),IBAR(M,I))
140     C
141     ENDDO
142     ENDDO
143     C
144     C CALL CLUSTER4 ROUTINE
145     C
146     CALL CLUSTER4
147     C
148     C CALL DOUBLE SHOWER FINDING ALGORITMHS
149     C
150     DBLSQ = 0.
151     EQQ = 0.
152     INDIC = 0
153    
154     C DISTD = -870.06 - 0.68 - 5.81
155     C POS(1) = -DISTD * TAN(THETA) * COS(PHI) + X0 * 10.
156     C & + 122.3 - 1.19
157     C ANGOL(1) = -TAN(THETA) * COS(PHI)
158    
159     C
160     C POS IS THE PROJECTION OF THE STRAIGHT TRACK FROM S1 TO THE FIRST PLANE OF THE CALO
161     C ANGOL IS THE PROJECTION OF THE ANGLE ON THE X VIEW
162     C BOTH THESE COME FROM THE C++ CODE
163     C
164     C
165     DIFX = ABS(BAR(1,1) - POS)
166     C
167     C
168     C
169     IF (DIFX.LE.10.OR.RIMP.GT.5) THEN
170     INDIC = 3
171     GO TO 125
172     ENDIF
173     C
174     DEVT = 0.
175     CALL DBLSC(INDIC,EQQ,DEVT)
176     125 CONTINUE
177     DBLS = FLOAT(INDIC)
178     IF (DBLS.EQ.1.) THEN
179     DBLSQ = EQQ
180     ENDIF
181     C
182     INDIC = 0
183     EQQ = 0.
184     CALL DUBSC(INDIC,EQQ)
185     IF (INDIC.EQ.1.AND.DBLS.NE.1) DBLSQ = EQQ
186     DBLS = DBLS + 10. * FLOAT(INDIC)
187     C
188     50 CONTINUE
189     RETURN
190     END
191    

  ViewVC Help
Powered by ViewVC 1.1.23