/[PAMELA software]/DarthVader/CalorimeterLevel2/src/elio.for
ViewVC logotype

Contents of /DarthVader/CalorimeterLevel2/src/elio.for

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Nov 29 16:11:55 2007 UTC (17 years ago) by mocchiut
Branch: MAIN
CVS Tags: v5r00, v6r01, v6r00
Changes since 1.5: +4 -4 lines
More bugs related to plane shifting fixed

1 SUBROUTINE ELIO(RPIANO,NPIANI,QQQQ,NTOT,INDICE)
2 C----------------------------------------------------------------------
3 C-
4 C- Purpose and Methods : IT FINDS THE NUMBER OF LAYERS (RPIANO) IN WHICH
5 C- THERE IS A DETECTED ENERGY BETWEEN EINF AND ESUP . FOR EXAMPLE IF
6 C- EINF = 2.5 mip AND ESUP = 10 mip WE INDENTIFY PARTICLE WITH A
7 C- CHARACTERISTIC AS ALPHA AT MINIMUM .
8 C- QQQQ IS THE TRUNCATED MEAN OF THE DETECTED ENERGY OF THE BARICENTRA OF THE
9 C- DEFINED LAYERS .
10 C- NTOT GIVES THE NUMBER OF LAYERS WITH DETECTED ENERGY ALONG THE TRACK
11 C- DEFINED BY THE TRACKING SYSTEM . WE SAY THAT IS ALONG THE TRACK IF THE
12 C- CLUSTER IS INSIDE A RADIUS OF 4 STRIPS BY THE POSITION DEFINED BY THE
13 C- TRACKING SYSTEM .
14 C- INDICE IS THE NUMBER OF CLUSTERS BESIDES THAT ALONG THE TRACK THAT ARE
15 C- MORE THAN 4 STRIPS FAR AWAY BY THE TRACK .
16 C-
17 C- Inputs : NPIANI
18 C- Outputs : RPIANO,QQQQ,NTOT,INDICE
19 C- Controls:
20 C-
21 C- Created 9-FEB-1994 MIRKO BOEZIO
22 C- Modified 28-APR-1994 MIRKO BOEZIO . IF ISTRISCIA IS NEGATIVE AND GREATER
23 C- THAN NX THAN NN IS EQUAL 1 .
24 C- Modified 8-JUL-1994 MIRKO BOEZIO . CORRECTED AN ERROR ON THE DEFINITION
25 C- OF ISTRISCIA .
26 C- Modified 14-DEC-1994 MIRKO BOEZIO . THE TRACK IS DEFINED BY THE
27 C- TRACKING SYSTEM THROUGH IBAR AND BAR .
28 C-
29 C----------------------------------------------------------------------
30 INCLUDE 'INTEST.TXT'
31 C
32 REAL LUNGH
33 REAL RPIANO(2)
34 REAL BAR(2,NPLAV)
35 REAL NQQ(2*NPLAV)
36 REAL RIL(NCHA/2)
37 REAL TG(2)
38 INTEGER IBAR(2,NPLAV)
39 INTEGER NTOT(2)
40 COMMON / ANGOLO / BAR, IBAR
41 SAVE / ANGOLO /
42 COMMON / DOVE / NX, NY, LUNGH
43 SAVE / DOVE /
44 COMMON / TAGLIOEN / EINF, ESUP, ENER(2)
45 SAVE / TAGLIOEN /
46 COMMON / SHIFT / SHIFT
47 SAVE / SHIFT /
48 COMMON / TANGENTI / TG
49 SAVE / TANGENTI /
50 C
51 RINDEX = 0.
52 C
53 DO K = 1,NCHA/2
54 RIL(K) = 1000.
55 ENDDO
56 C
57 ENER(1) = 0.
58 ENER(2) = 0.
59 C
60 QQQ = 0.
61 QQQQ = 0.
62 QQX = 0.
63 QQY = 0.
64 NGIR = 0
65 DO M = 1,2
66 NTOT(M) = 0
67 RPIANO(M) = 0.
68 C
69 DO J = 1,NPLA
70 IF (MOD(J,2).EQ.0) THEN
71 IF (REVERSE.EQ.0) THEN
72 SHIFT = -0.5
73 ELSE
74 SHIFT = +0.5
75 ENDIF
76 ELSE
77 IF (REVERSE.EQ.0) THEN
78 SHIFT = +0.5
79 ELSE
80 SHIFT = -0.5
81 ENDIF
82 ENDIF
83 C
84 DO K = 1,NGIR
85 RIL(K) = 1000.
86 ENDDO
87 C
88 IF (M.EQ.1) NQQ(J) = 0.
89 IF (M.EQ.2) NQQ(J+NPLA) = 0.
90 NNN = 0
91 C
92 NN = IBAR(M,J)
93 C
94 C EM
95 C
96 IF (NN.EQ.-1) GOTO 5
97 C
98 IF (NN.LE.0) NN = 1
99 NGIR = NCL(M,J) ! number of clusters in layer J of the M View
100 IF (NGIR.EQ.0) GOTO 5
101 C IF (NGIR.NE.1) GOTO 5
102 IPP = 0.
103 DO L = 1,NGIR
104 CALL LASTRISCIA(CLUS(M,J,L),IN)
105 RIL(L) = FLOAT(ABS(NN - IN))
106 IF (RIL(L).GE.5) IPP = 1
107 ENDDO
108 MM = NCHA/2
109 C
110 C WE USE THE CLUSTER NEAREST THE TRACK .
111 C
112 LK = LVMIN(RIL,MM)
113 C
114 C CHECK ON THE DISTANCE OF THE CLUSTER FROM THE TRACK .
115 C
116 IF (RIL(LK).GE.5) GOTO 5
117 IF (IPP.EQ.1) INDICE = INDICE + 1
118 IF (J.EQ.1) ENER(M) = CLUS(M,J,LK+NCHA/2) ! this is the detected
119 C energy of the cluster in the first layer
120 C
121 NTOT(M) = NTOT(M) + 1
122 C
123 C CHECK ON THE DETECTED ENERGY OF THE CLUSTER .
124 C
125 IF (CLUS(M,J,LK+NCHA/2).GT.EINF.AND.CLUS(M,J,LK+NCHA/2).
126 & LT.ESUP) THEN
127 IADD = 0
128 IF (M.EQ.2) IADD = NPLA
129 NQQ(J + IADD) = NQQ(J + IADD) + CLUS(M,J,LK+NCHA/2)
130 NNN = NNN + 1
131 ENDIF
132 C
133 5 CONTINUE
134 IADD = 0
135 IF (M.EQ.2) IADD = NPLA
136 IF (NQQ(J + IADD).LT.EMIN) NQQ(J + IADD) = 10000.
137 IF (NNN.GE.1) RPIANO(M) = RPIANO(M) + 1
138 C
139 ENDDO
140 ENDDO
141 C
142 RPIATOT = RPIANO(1) + RPIANO(2)
143 C
144 IF (RPIATOT.GE.FLOAT(NPIANI)) THEN
145 NPIA = NPIANI
146 ELSE
147 NPIA = INT(ANINT(RPIATOT))
148 ENDIF
149 C
150 QQQ = 0.
151 C
152 NDIM = 2 * NPLA
153 C
154 DO I = 1,NPIA
155 N = LVMIN(NQQ,NDIM)
156 QQQ = QQQ + NQQ(N)
157 NQQ(N) = 10000.
158 ENDDO
159 C
160 IF (NPIA.NE.0) THEN
161 QQQQ = QQQ / FLOAT(NPIA) ! Truncated mean .
162 ENDIF
163 C
164 400 CONTINUE
165
166 RETURN
167 END
168 C
169

  ViewVC Help
Powered by ViewVC 1.1.23