/[PAMELA software]/gpamela/gptrd/gpdtrd.F
ViewVC logotype

Annotation of /gpamela/gptrd/gpdtrd.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3.1 - (hide annotations) (download)
Thu Jul 11 16:02:01 2002 UTC (22 years, 5 months ago) by cafagna
Branch: MAIN
Branch point for: v3r0
Initial revision

1 cafagna 3.1 *
2     * $Id$
3     *
4     * $Log$
5     *
6     *CMZ : 3.00/00 08/02/2002 17.36.53 by Unknown
7     *CMZ : 2.01/00 08/03/2000 18.34.57 by Unknown
8     *CMZ : 2.00/00 25/02/2000 15.46.40 by Francesco Cafagna
9     *CMZ : 1.02/00 22/10/99 16.17.58 by Francesco Cafagna
10     *CMZ : 1.01/00 21/05/96 17.33.37 by Francesco Cafagna
11     *CMZ : 1.00/02 04/04/96 16.08.24 by Francesco Cafagna
12     *-- Author : Francesco Cafagna 23/02/96
13     SUBROUTINE GPDTRD
14     ************************************************************************
15     * *
16     * To perform TRD digitization *
17     * *
18     * Called by: GUDIGI *
19     * Author: Francesco Cafagna, 23/02/96 12.50.38 *
20     * *
21     ************************************************************************
22     #include "gcunit.inc"
23     #include "gpphit.inc"
24     PARAMETER (NH=NHTRD,NHM=NHMTRD,NVOL=5)
25     #include "gprhit.inc"
26     #include "gptrd.inc"
27     #include "gpsed.inc"
28     *
29     INTEGER IS,ID,NV,NVM,NNHM
30     CHARACTER*4 CSET
31     *
32     *
33     * Vector zeroed
34     *
35     CALL VZERO(ITRBS,NHMTRD)
36     *ML:
37     * CALL VZERO(ITRSO,NHMTRD)
38     CALL VZERO(ITRSI,NHMTRD)
39     *END ML.
40     #if defined(GPAMELA_INTER)
41     CALL VZERO(XAVTRD,NHMTRD)
42     CALL VZERO(YAVTRD,NHMTRD)
43     CALL VZERO(ZAVTRD,NHMTRD)
44     #endif
45     #if !defined(GPAMELA_INTER)
46     CALL VZERO(XINTRD,NHMTRD)
47     CALL VZERO(YINTRD,NHMTRD)
48     CALL VZERO(ZINTRD,NHMTRD)
49     #endif
50     CALL VZERO(XOUTTRD,NHMTRD)
51     CALL VZERO(YOUTTRD,NHMTRD)
52     CALL VZERO(ZOUTTRD,NHMTRD)
53     CALL VZERO(ERELTRD,NHMTRD)
54     CALL VZERO(PATHTRD,NHMTRD)
55     CALL VZERO(P0TRD,NHMTRD)
56     CALL VZERO(IPARTRD,NHMTRD)
57     CALL VZERO(ETRTRD,NHMTRD)
58     CALL VZERO(NTRTRD,NHMTRD)
59     CALL VZERO(ELOSTRD,NHMTRD)
60     CALL VZERO(NUMD ,NVOL)
61     C ML:
62     #if defined(GPAMELA_GARFIELD)
63     CALL VZERO(EGARTRD,NHMTRD)
64     CALL VZERO(NGARTRD,NHMTRD)
65     #endif
66     C END ML.
67     *
68     * Starting from the TOP
69     *
70     NV = NVOL
71     NVM= NVMAX
72     IS = ISTRD
73     ID = IDTRSI
74     CSET = 'TRD '
75     IT = -1
76     *
77     * Check on the volume level
78     *
79     IF (NV.GT.NVM) THEN
80     WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX,
81     + IDRUN,IDEVT
82     CALL GMAIL(1,0)
83     GO TO 10
84     ENDIF
85     CALL VZERO(VHITS,NH*NHM)
86     CALL VZERO(ITRA ,NHM)
87     CALL VZERO(NUMBV,NVOL*NHM)
88     NHITS = -1
89     CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1,
90     + IT,NUMD,ITRA,NUMBV,VHITS,NHITS)
91     *
92     * If there was a problem in GPRHIT then exit
93     *
94     IF(NHITS.LT.0) THEN
95     WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM,
96     + IDRUN,IDEVT
97     CALL GMAIL(1,0)
98     NTHTRD = -NHITS
99     GO TO 10
100     ENDIF
101     *
102     * >>>>>>>>>>>>>>>>>>>>>> DIGI action
103     *
104     *
105     * Fill the CWN common
106     *
107     NTHTRD = NHITS
108     DO I=1,NHITS
109     ITRBS(I) = NUMBV((NVTRD-1),I)
110     *ML:
111     * ITRBS(I) = NUMBV((NVTRD-2),I)
112     * ITRSO(I) = NUMBV((NVTRD-1),I)
113     ITRSI(I) = NUMBV(NVTRD,I)
114     *END ML.
115     #if defined(GPAMELA_INTER)
116     XAVTRD(I) = VHITS(1,I)
117     YAVTRD(I) = VHITS(2,I)
118     ZAVTRD(I) = VHITS(3,I)
119     XOUTTRD(I) = VHITS(4,I)
120     YOUTTRD(I) = VHITS(5,I)
121     ZOUTTRD(I) = VHITS(6,I)
122     XINTRD(I) = 2*XAVTRD(I) - XOUTTRD(I)
123     YINTRD(I) = 2*YAVTRD(I) - YOUTTRD(I)
124     ZINTRD(I) = 2*ZAVTRD(I) - ZOUTTRD(I)
125     #endif
126     #if !defined(GPAMELA_INTER)
127     XINTRD(I) = VHITS(1,I)
128     YINTRD(I) = VHITS(2,I)
129     ZINTRD(I) = VHITS(3,I)
130     XOUTTRD(I) = VHITS(4,I)
131     YOUTTRD(I) = VHITS(5,I)
132     ZOUTTRD(I) = VHITS(6,I)
133     XAVTRD(I) = (XINTRD(I)+XOUTTRD(I))/2.
134     YAVTRD(I) = (YINTRD(I)+YOUTTRD(I))/2.
135     ZAVTRD(I) = (ZINTRD(I)+ZOUTTRD(I))/2.
136     #endif
137     C ERELTRD(I) = VHITS(7,I)
138     ELOSTRD(I) = VHITS(7,I)
139     PATHTRD(I) = VHITS(8,I)
140     IPARTRD(I) = VHITS(9,I)
141     P0TRD(I) = VHITS(10,I)
142     ETRTRD(I) = VHITS(11,I)
143     NTRTRD(I) = VHITS(12,I)
144     C ML:
145     #if defined(GPAMELA_GARFIELD)
146     ERELTRD(I) = VHITS(11,I)+VHITS(13,I)
147     C EGARTRD(I) = VHITS(11,I)
148     C NGARTRD(I) = VHITS(12,I)
149     EGARTRD(I) = VHITS(13,I)
150     NGARTRD(I) = VHITS(14,I)
151     C PRINT*,'EGARTRD,NGARTRD=',EGARTRD(I),NGARTRD(I),I
152     C PRINT*,'PATHTRD=',VHITS(8,I)
153     #endif
154     C END ML.
155     ENDDO
156     *
157     10000 FORMAT(' GPDTRD: VOLUME level too big: SET=',A4,', DET=',A4,
158     + ',NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8)
159     10100 FORMAT(' GPDTRD: MAX number of hits retrived: SET=',A4,
160     + ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5,
161     + ', RUN=',I5,', EVT=',I8)
162     10200 FORMAT(' GPDTRD: Error in GPRHIT: SET=',A4,
163     + ', DET=',A4,',NHITS=',I5,', NHMAX=',I5,
164     + ', RUN=',I5,', EVT=',I8)
165     10 RETURN
166     END

  ViewVC Help
Powered by ViewVC 1.1.23