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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Wed Dec 13 13:42:45 2006 UTC (17 years, 11 months ago) by mocchiut
Branch: MAIN
Changes since 1.1: +2 -1 lines
qmean variable is now calculated only using planes with one cluster not all planes

1 mocchiut 1.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,NPLA)
35     REAL NQQ(2*NPLA)
36     REAL RIL(NCHA/2)
37     REAL TG(2)
38     INTEGER IBAR(2,NPLA)
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     SHIFT = -0.5
72     ELSE
73     SHIFT = 0.5
74     ENDIF
75     C
76     DO K = 1,NGIR
77     RIL(K) = 1000.
78     ENDDO
79     C
80     IF (M.EQ.1) NQQ(J) = 0.
81     IF (M.EQ.2) NQQ(J+NPLA) = 0.
82     NNN = 0
83     C
84     NN = IBAR(M,J)
85     C
86     C EM
87     C
88     IF (NN.EQ.-1) GOTO 5
89     C
90     IF (NN.LE.0) NN = 1
91     NGIR = NCL(M,J) ! number of clusters in layer J of the M View
92 mocchiut 1.2 C IF (NGIR.EQ.0) GOTO 5
93     IF (NGIR.NE.1) GOTO 5
94 mocchiut 1.1 IPP = 0.
95     DO L = 1,NGIR
96     CALL LASTRISCIA(CLUS(M,J,L),IN)
97     RIL(L) = FLOAT(ABS(NN - IN))
98     IF (RIL(L).GE.5) IPP = 1
99     ENDDO
100     MM = NCHA/2
101     C
102     C WE USE THE CLUSTER NEAREST THE TRACK .
103     C
104     LK = LVMIN(RIL,MM)
105     C
106     C CHECK ON THE DISTANCE OF THE CLUSTER FROM THE TRACK .
107     C
108     IF (RIL(LK).GE.5) GOTO 5
109     IF (IPP.EQ.1) INDICE = INDICE + 1
110     IF (J.EQ.1) ENER(M) = CLUS(M,J,LK+NCHA/2) ! this is the detected
111     C energy of the cluster in the first layer
112     C
113     NTOT(M) = NTOT(M) + 1
114     C
115     C CHECK ON THE DETECTED ENERGY OF THE CLUSTER .
116     C
117     IF (CLUS(M,J,LK+NCHA/2).GT.EINF.AND.CLUS(M,J,LK+NCHA/2).
118     & LT.ESUP) THEN
119     IADD = 0
120     IF (M.EQ.2) IADD = NPLA
121     NQQ(J + IADD) = NQQ(J + IADD) + CLUS(M,J,LK+NCHA/2)
122     NNN = NNN + 1
123     ENDIF
124     C
125     5 CONTINUE
126     IADD = 0
127     IF (M.EQ.2) IADD = NPLA
128     IF (NQQ(J + IADD).LT.EMIN) NQQ(J + IADD) = 10000.
129     IF (NNN.GE.1) RPIANO(M) = RPIANO(M) + 1
130     C
131     ENDDO
132     ENDDO
133     C
134     RPIATOT = RPIANO(1) + RPIANO(2)
135     C
136     IF (RPIATOT.GE.FLOAT(NPIANI)) THEN
137     NPIA = NPIANI
138     ELSE
139     NPIA = INT(ANINT(RPIATOT))
140     ENDIF
141     C
142     QQQ = 0.
143     C
144     NDIM = 2 * NPLA
145     C
146     DO I = 1,NPIA
147     N = LVMIN(NQQ,NDIM)
148     QQQ = QQQ + NQQ(N)
149     NQQ(N) = 10000.
150     ENDDO
151     C
152     IF (NPIA.NE.0) THEN
153     QQQQ = QQQ / FLOAT(NPIA) ! Truncated mean .
154     ENDIF
155     C
156     400 CONTINUE
157    
158     RETURN
159     END
160     C
161    

  ViewVC Help
Powered by ViewVC 1.1.23