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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri May 19 13:15:51 2006 UTC (18 years, 6 months ago) by mocchiut
Branch: MAIN
Branch point for: DarthVader
Initial revision

1 SUBROUTINE NSHOWER(IERR,RNUMX,RNUMY,ENERGIAX,ENERGIAY)
2 C----------------------------------------------------------------------
3 C-
4 C- Purpose and Methods : IT IDENTIFIES ELECTROMAGNETIC SHOWERS USING :
5 C- CENTER OF GRAVITY IN THE FIRST HALF - SECOND HALF OF THE CALORIMETER .
6 C- RNUMX AND RNUMY (X AND Y VIEW) ARE THE DISTANCES IN mm OF THE CLUSTERS
7 C- CLOSEST TO THE TRACK NORMALIZED TO THE TRACK .
8 C- ENERGIAX AND ENERGIAY ARE THE ENERGY OF THESE CLUSTERS .
9 C- THE CENTERS OF GRAVITY AND THE CLUSTERS COME FROM THE ROUTINE CLUSTER2 .
10 C-
11 C- Inputs :
12 C- Outputs :
13 C- Controls:
14 C-
15 C- Created 3-NOV-1993 MIRKO BOEZIO
16 C-
17 C----------------------------------------------------------------------
18 INCLUDE 'INTEST.TXT'
19 C
20 INTEGER LK(2)
21 INTEGER IBAR(2,NPLA)
22 INTEGER ITL
23 REAL RX(2),RY(2)
24 REAL RIL(NCHA/2)
25 REAL BAR(2,NPLA)
26 REAL TG(2)
27 REAL DAD
28 COMMON / VARIE / MAX
29 SAVE / VARIE /
30 COMMON / INIZIO / INPIA
31 SAVE / INIZIO /
32 COMMON / IMPULSO / QUAMOT
33 SAVE / IMPULSO /
34 COMMON / DOVE / NX, NY, LUNGH
35 SAVE / DOVE /
36 COMMON / TANGENTI / TG
37 SAVE / TANGENTI /
38 COMMON / ANGOLO / BAR, IBAR
39 SAVE / ANGOLO /
40 C
41 LPIANO = NPLA / 2
42 c
43 CALL CLUSTER2
44 C
45 ITL = 0
46 IALFA = 0
47 499 CONTINUE
48 C
49 DO I = 1,NCHA/2
50 RIL(I) = 1000.
51 ENDDO
52 C
53 RX(1) = 0.
54 RX(2) = 0.
55 RY(1) = 0.
56 RY(2) = 0.
57 C
58 DO M = 1,2
59 DO J = 1,2
60 C
61 DO I = 1,NCHA/2
62 RIL(I) = 1000.
63 ENDDO
64 C
65 LK(J) = 0
66 C
67 IF (J.EQ.1) ITL = (LPIANO + 1) / 2
68 IF (J.EQ.2) ITL = (NPLA + LPIANO + 1) / 2
69 C
70 DAD = BAR(M,ITL)
71 C
72 C EM
73 C
74 IF (DAD.LT.-6..OR.DAD.GT.246.) GOTO 555
75 C
76 C END EM
77 C
78 NGIR = NCL2(M,J)
79 IF (NGIR.EQ.0) GO TO 555
80 DO L = 1,NGIR
81 RIL(L) = ABS(DAD - CLUS2(M,J,L))
82 ENDDO
83 MM = NCHA/2
84 LK(J) = LVMIN(RIL,MM)
85 C
86 IF (CLUS2(M,J,LK(J)+NCHA/2).GT.EMIN) THEN
87 IF (M.EQ.1) THEN
88 ENERGIAX = ENERGIAX + CLUS2(M,J,LK(J)+NCHA/2)
89 RX(J) = CLUS2(M,J,LK(J)) - DAD
90 ENDIF
91 IF (M.EQ.2) THEN
92 ENERGIAY = ENERGIAY + CLUS2(M,J,LK(J)+NCHA/2)
93 RY(J) = CLUS2(M,J,LK(J)) - DAD
94 ENDIF
95 ENDIF
96 C
97 555 CONTINUE
98 ENDDO
99 C
100 IF (M.EQ.1) RNUMX = ABS( RX(2) - RX(1) )
101 IF (M.EQ.2) RNUMY = ABS( RY(2) - RY(1) )
102 C
103 ENDDO
104 C
105 ESOGLIATOT = 50.
106 EINT = 10.
107 C
108 IF (ENERGIAX.EQ.0.OR.ENERGIAY.EQ.0) THEN
109 II = 1
110 ENDIF
111 C
112 EINF = ENERGIAX - EINT
113 ESUP = ENERGIAX + EINT
114 ETOT = ENERGIAX + ENERGIAY
115 C
116 IF (ENERGIAY.LT.EINF.OR.ENERGIAY.GT.ESUP.OR.
117 & ETOT.LT.ESOGLIATOT) GO TO 2
118 C
119 GO TO 10
120 C
121 2 IERR = 1
122 C
123 10 CONTINUE
124
125 RETURN
126 END

  ViewVC Help
Powered by ViewVC 1.1.23