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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Thu Nov 29 16:11:53 2007 UTC (17 years ago) by mocchiut
Branch: MAIN
CVS Tags: v5r00, v9r00, v9r01, v6r01, v6r00
Changes since 1.3: +4 -4 lines
More bugs related to plane shifting fixed

1 mocchiut 1.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 mocchiut 1.2 DO J = 1,NPLAV
34 mocchiut 1.1 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 mocchiut 1.2 c print *,' N ',N,' J ',J,' M ',M,' QQQ ',QQQ(M)
49 mocchiut 1.1 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 mocchiut 1.3 c IF (N.EQ.2) NN = 1
79     IF (MOD(J,2).EQ.NN) THEN
80 mocchiut 1.2 IF (REVERSE.EQ.0) THEN
81 mocchiut 1.4 SHIFT = -0.5
82     ELSE
83 mocchiut 1.2 SHIFT = +0.5
84     ENDIF
85 mocchiut 1.1 ELSE
86 mocchiut 1.2 IF (REVERSE.EQ.0) THEN
87 mocchiut 1.4 SHIFT = +0.5
88     ELSE
89 mocchiut 1.2 SHIFT = -0.5
90     ENDIF
91 mocchiut 1.1 ENDIF
92     CALL BARIC(QQQ,IA,IB,BAR,ENE,IERR1)
93     IGIRO = IGIRO + 1
94     IGI = IGIRO + NCHA / 2
95 mocchiut 1.2 c print *,'IGIRO ',IGIRO,' IGI ',IGI,' NCHA ',NCHA
96     c PRINT *,' ENE ',ENE,' BAR ',BAR
97 mocchiut 1.1 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