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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri Jul 20 08:24:55 2007 UTC (17 years, 4 months ago) by mocchiut
Branch: MAIN
CVS Tags: v4r00
Changes since 1.1: +13 -5 lines
Formal changes to use fortran routines in the presampler analysis

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

  ViewVC Help
Powered by ViewVC 1.1.23