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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu Jan 16 15:29:12 2014 UTC (10 years, 10 months ago) by mocchiut
Branch: MAIN
CVS Tags: v10RED, v10REDr01, HEAD
Changes since 1.4: +1 -1 lines
Compilation warnings using GCC4.7 fixed

1 SUBROUTINE CLUSTER
2 C----------------------------------------------------------------------
3 C-
4 C- Purpose and Methods : IT FINDS THE NUMBER OF
5 C- CLUSTERS PER LAYER AND PER VIEW AND THE POSITION
6 C- OF THE CENTRE OF GRAVITY OF THE DETECTED ENERGY .
7 C- IN THE MATRIX CLUS 2xNPLAxNCHA WE HAVE THE
8 C- CENTRES IN THE FIRST NCHA/2 ELEMENTS ORDERED FROM
9 C- THE HIGHEST IN ENERGY TO THE LOWEST . THE SECOND
10 C- NCHA/2 ELEMENTS ARE THE DETECTED ENERGIES IN
11 C- THESE CLUSTERS .
12 C- IN THE MATRIX NCL 2xNPLA WE HAVE THE NUMBER OF
13 C- CLUSTERS PER LAYER .
14 C-
15 C- Inputs :
16 C- Outputs :
17 C- Controls:
18 C-
19 C- Created 3-FEB-1994 MIRKO BOEZIO
20 C- Modified 21-FEB-2003 MIRKO BOEZIO . INTRODUCED
21 C- THE SHIFT IN THE SILICON DETECTORS PLACEMENT
22 C- FOR THE CALL TO MILLIM IN BARIC .
23 C-
24 C-----------------------------------------------------
25 INCLUDE 'INTEST.TXT'
26 REAL QQQ(NCHA)
27 INTEGER I
28
29 COMMON / SHIFT / SHIFT
30 SAVE / SHIFT /
31 C
32 I = 0
33 DO J = 1,NPLAV
34 DO N = 1,2
35 DO M = 1,NCHA
36 CLUS(N,J,M) = 0.
37 ENDDO
38 NCL(N,J) = 0
39 ENDDO
40 ENDDO
41 C
42 DO N = 1,2
43 DO J = 1,NPLA
44 DO M = 1,NCHA
45 QQQ(M) = 0.
46 IF (DEXY(N,J,M).GT.EMIN) THEN
47 QQQ(M) = DEXY(N,J,M)
48 c print *,' N ',N,' J ',J,' M ',M,' QQQ ',QQQ(M)
49 ENDIF
50 ENDDO
51 C
52 IGIRO = 0
53 C
54 50 CONTINUE
55 C
56 C THE FIRST CLUSTER FOR THE LAYER J IS THAT WITH THE
57 C HIGHEST DETECTED ENERGY .
58 C
59 MAX = LVMAX(QQQ,NCHA)
60 IF (QQQ(MAX).LT.EMIN) GO TO 100
61 MSTR = MAX
62 55 CONTINUE
63 MSTR = MSTR + 1
64 IF (MSTR.GT.NCHA) GO TO 56
65 IF (QQQ(MSTR).GT.EMIN) GO TO 55
66 56 CONTINUE
67 IB = MSTR - 1
68 C
69 MSTR = MAX
70 65 CONTINUE
71 MSTR = MSTR - 1
72 IF (MSTR.LT.1) GO TO 66
73 IF (QQQ(MSTR).GT.EMIN) GO TO 65
74 66 CONTINUE
75 IA = MSTR + 1
76 C
77 NN = 0
78 c IF (N.EQ.2) NN = 1
79 IF (MOD(J,2).EQ.NN) THEN
80 IF (REVERSE.EQ.0) THEN
81 SHIFT = -0.5
82 ELSE
83 SHIFT = +0.5
84 ENDIF
85 ELSE
86 IF (REVERSE.EQ.0) THEN
87 SHIFT = +0.5
88 ELSE
89 SHIFT = -0.5
90 ENDIF
91 ENDIF
92 CALL BARIC(QQQ,IA,IB,BAR,ENE,IERR1)
93 IGIRO = IGIRO + 1
94 IGI = IGIRO + NCHA / 2
95 c print *,'IGIRO ',IGIRO,' IGI ',IGI,' NCHA ',NCHA
96 c PRINT *,' ENE ',ENE,' BAR ',BAR
97 CLUS(N,J,IGIRO) = BAR
98 CLUS(N,J,IGI) = ENE
99 C
100 DO LL = IA,IB
101 QQQ(LL) = 0.
102 ENDDO
103 GO TO 50
104 C
105 100 CONTINUE
106 NCL(N,J) = IGIRO
107 ENDDO
108 ENDDO
109 C
110 RETURN
111 END
112
113

  ViewVC Help
Powered by ViewVC 1.1.23