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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (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.3: +4 -4 lines
More bugs related to plane shifting fixed

1 SUBROUTINE NUCLEI(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 REL(NCHA/2)
38 REAL TG(2)
39 INTEGER IBAR(2,NPLAV)
40 INTEGER NTOT(2),LH
41 COMMON / ANGOLO / BAR, IBAR
42 SAVE / ANGOLO /
43 COMMON / DOVE / NX, NY, LUNGH
44 SAVE / DOVE /
45 COMMON / TAGLIOEN / EINF, ESUP, ENER(2)
46 SAVE / TAGLIOEN /
47 COMMON / SHIFT / SHIFT
48 SAVE / SHIFT /
49 COMMON / TANGENTI / TG
50 SAVE / TANGENTI /
51 C
52 RINDEX = 0.
53 C
54 DO K = 1,NCHA/2
55 RIL(K) = 1000.
56 ENDDO
57 C
58 ENER(1) = 0.
59 ENER(2) = 0.
60 C
61 QQQ = 0.
62 QQQQ = 0.
63 QQX = 0.
64 QQY = 0.
65 NGIR = 0
66 DO M = 1,2
67 NTOT(M) = 0
68 RPIANO(M) = 0.
69 C
70 DO J = 1,NPLA
71 C
72 IF (MOD(J,2).EQ.0) THEN
73 IF (REVERSE.EQ.0) THEN
74 SHIFT = -0.5
75 ELSE
76 SHIFT = +0.5
77 ENDIF
78 ELSE
79 IF (REVERSE.EQ.0) THEN
80 SHIFT = +0.5
81 ELSE
82 SHIFT = -0.5
83 ENDIF
84 ENDIF
85 C
86 DO K = 1,NGIR
87 RIL(K) = 1000.
88 ENDDO
89 C
90 IF (M.EQ.1) NQQ(J) = 0.
91 IF (M.EQ.2) NQQ(J+NPLA) = 0.
92 NNN = 0
93 C
94 NN = IBAR(M,J)
95 C
96 C EM
97 C
98 IF (NN.EQ.-1) GOTO 5
99 C
100 IF (NN.LE.0) NN = 1
101 NGIR = NCL(M,J) ! number of clusters in layer J of the M View
102 IF (NGIR.EQ.0) GOTO 5
103 C IF (NGIR.NE.1) GOTO 5
104 IPP = 0.
105 DO L = 1,NGIR
106 CALL LASTRISCIA(CLUS(M,J,L),IN)
107 RIL(L) = FLOAT(ABS(NN - IN))
108 REL(L) = CLUS(M,J,L+NCHA/2)
109 IF (RIL(L).GE.5) IPP = 1
110 ENDDO
111 MM = NCHA/2
112 C
113 C WE USE THE CLUSTER NEAREST THE TRACK .
114 C
115 c LK = LVMIN(RIL,MM)
116 LH = LVMAX(REL,MM)
117 C
118 C CHECK ON THE DISTANCE OF THE CLUSTER FROM THE TRACK .
119 C
120 C IF (RIL(LK).GE.5) GOTO 5
121 IF (RIL(LH).GE.10) GOTO 5
122 IF (IPP.EQ.1) INDICE = INDICE + 1
123 IF (J.EQ.1) ENER(M) = CLUS(M,J,LH+NCHA/2) ! this is the detected
124 C energy of the cluster in the first layer
125 C
126 NTOT(M) = NTOT(M) + 1
127 C
128 C CHECK ON THE DETECTED ENERGY OF THE CLUSTER .
129 C
130 IF (CLUS(M,J,LH+NCHA/2).GT.EINF.AND.CLUS(M,J,LH+NCHA/2).
131 & LT.ESUP) THEN
132 IADD = 0
133 IF (M.EQ.2) IADD = NPLA
134 NQQ(J + IADD) = NQQ(J + IADD) + CLUS(M,J,LH+NCHA/2)
135 NNN = NNN + 1
136 ENDIF
137 C
138 5 CONTINUE
139 IADD = 0
140 IF (M.EQ.2) IADD = NPLA
141 IF (NQQ(J + IADD).LT.EMIN) NQQ(J + IADD) = 10000.
142 IF (NNN.GE.1) RPIANO(M) = RPIANO(M) + 1
143 C
144 ENDDO
145 ENDDO
146 C
147 RPIATOT = RPIANO(1) + RPIANO(2)
148 C
149 IF (RPIATOT.GE.FLOAT(NPIANI)) THEN
150 NPIA = NPIANI
151 ELSE
152 NPIA = INT(ANINT(RPIATOT))
153 ENDIF
154 C
155 QQQ = 0.
156 C
157 NDIM = 2 * NPLA
158 C
159 DO I = 1,NPIA
160 N = LVMIN(NQQ,NDIM)
161 QQQ = QQQ + NQQ(N)
162 NQQ(N) = 10000.
163 ENDDO
164 C
165 IF (NPIA.NE.0) THEN
166 QQQQ = QQQ / FLOAT(NPIA) ! Truncated mean .
167 ENDIF
168 C
169 400 CONTINUE
170
171 RETURN
172 END
173 C
174

  ViewVC Help
Powered by ViewVC 1.1.23