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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Fri Dec 12 16:18:22 2008 UTC (16 years ago) by mocchiut
Branch: MAIN
CVS Tags: v6r01, v6r00
Changes since 1.2: +3 -1 lines
Calo optimization + bug fixed, ToF errors -315/6/7 fixed

1 mocchiut 1.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 mocchiut 1.2 INTEGER IBAR(2,NPLAV)
22 mocchiut 1.3 INTEGER ITL,I,LPIANO
23 mocchiut 1.1 REAL RX(2),RY(2)
24     REAL RIL(NCHA/2)
25 mocchiut 1.2 REAL BAR(2,NPLAV)
26 mocchiut 1.1 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 mocchiut 1.3 DATA DAD / 0. /
41 mocchiut 1.1 C
42     LPIANO = NPLA / 2
43     c
44     CALL CLUSTER2
45     C
46     ITL = 0
47     IALFA = 0
48     499 CONTINUE
49     C
50     DO I = 1,NCHA/2
51     RIL(I) = 1000.
52     ENDDO
53     C
54 mocchiut 1.3 DAD = 0.
55 mocchiut 1.1 RX(1) = 0.
56     RX(2) = 0.
57     RY(1) = 0.
58     RY(2) = 0.
59     C
60     DO M = 1,2
61     DO J = 1,2
62     C
63     DO I = 1,NCHA/2
64     RIL(I) = 1000.
65     ENDDO
66     C
67     LK(J) = 0
68     C
69     IF (J.EQ.1) ITL = (LPIANO + 1) / 2
70     IF (J.EQ.2) ITL = (NPLA + LPIANO + 1) / 2
71     C
72     DAD = BAR(M,ITL)
73     C
74     C EM
75     C
76     IF (DAD.LT.-6..OR.DAD.GT.246.) GOTO 555
77     C
78     C END EM
79     C
80     NGIR = NCL2(M,J)
81     IF (NGIR.EQ.0) GO TO 555
82     DO L = 1,NGIR
83     RIL(L) = ABS(DAD - CLUS2(M,J,L))
84     ENDDO
85     MM = NCHA/2
86     LK(J) = LVMIN(RIL,MM)
87     C
88     IF (CLUS2(M,J,LK(J)+NCHA/2).GT.EMIN) THEN
89     IF (M.EQ.1) THEN
90     ENERGIAX = ENERGIAX + CLUS2(M,J,LK(J)+NCHA/2)
91     RX(J) = CLUS2(M,J,LK(J)) - DAD
92     ENDIF
93     IF (M.EQ.2) THEN
94     ENERGIAY = ENERGIAY + CLUS2(M,J,LK(J)+NCHA/2)
95     RY(J) = CLUS2(M,J,LK(J)) - DAD
96     ENDIF
97     ENDIF
98     C
99     555 CONTINUE
100     ENDDO
101     C
102     IF (M.EQ.1) RNUMX = ABS( RX(2) - RX(1) )
103     IF (M.EQ.2) RNUMY = ABS( RY(2) - RY(1) )
104     C
105     ENDDO
106     C
107     ESOGLIATOT = 50.
108     EINT = 10.
109     C
110     IF (ENERGIAX.EQ.0.OR.ENERGIAY.EQ.0) THEN
111     II = 1
112     ENDIF
113     C
114     EINF = ENERGIAX - EINT
115     ESUP = ENERGIAX + EINT
116     ETOT = ENERGIAX + ENERGIAY
117     C
118     IF (ENERGIAY.LT.EINF.OR.ENERGIAY.GT.ESUP.OR.
119     & ETOT.LT.ESOGLIATOT) GO TO 2
120     C
121     GO TO 10
122     C
123     2 IERR = 1
124     C
125     10 CONTINUE
126    
127     RETURN
128     END

  ViewVC Help
Powered by ViewVC 1.1.23