/[PAMELA software]/gpamela/gpnd/gpdnd.F
ViewVC logotype

Annotation of /gpamela/gpnd/gpdnd.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sun Apr 9 23:38:15 2006 UTC (18 years, 7 months ago) by cafagna
Branch: MAIN
CVS Tags: v4r4, v4r5, v4r6, v4r7, v4r8, v4r9, v4r14, v4r12, v4r13, v4r10, v4r11, HEAD
ND digitization routine added: gpdnd.F

1 cafagna 1.1 SUBROUTINE GPDND
2     ************************************************************************
3     * *
4     * To perform ND digitization *
5     * *
6     * Called by: GUDIGI *
7     * Author: Francesco Cafagna, 23/02/06 12.50.38 *
8     * *
9     ************************************************************************
10     #include "gcunit.inc"
11     #include "gpphit.inc"
12     PARAMETER (NH=NHND,NHM=NHMND,NVOL=2)
13     #include "gprhit.inc"
14     #include "gpnd.inc"
15     #include "gpsed.inc"
16     *
17     INTEGER IS,ID,NV,NVM,NNHM
18     CHARACTER*4 CSET
19     DATA CSET/'ND '/
20     *
21     * Vector zeroed
22     *
23     CALL VZERO(ITUBEND,NHM)
24     CALL VZERO(IPARND,NHM)
25     CALL VZERO(XINND,NHM)
26     CALL VZERO(YINND,NHM)
27     CALL VZERO(ZINND,NHM)
28     CALL VZERO(XOUTND,NHM)
29     CALL VZERO(YOUTND,NHM)
30     CALL VZERO(ZOUTND,NHM)
31     CALL VZERO(ERELND,NHM)
32     CALL VZERO(TIMEND,NHM)
33     CALL VZERO(PATHND,NHM)
34     CALL VZERO(P0ND,NHM)
35     *
36     CALL VZERO(NUMD ,NVOL)
37     *
38     * Start with nd top
39     *
40     NV = NVOL
41     NVM= NVMAX
42     IT = -1
43     NTHND = 0
44     INDEX = 0
45     IS= ISND
46     ID= IDNDTI
47     *
48     * Check on the volume level
49     *
50     IF (NV.GT.NVM) THEN
51     WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX, IDRUN,
52     + IDEVT
53     CALL GMAIL(1,0)
54     GO TO 10
55     ENDIF
56     CALL VZERO(VHITS,NH*NHM)
57     CALL VZERO(ITRA ,NHM)
58     CALL VZERO(NUMBV,NVOL*NHM)
59     NHITS = -1
60     CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NHM,1,
61     + IT,NUMD,ITRA,NUMBV,VHITS,NHITS)
62     *
63     * If there was a problem in GPRHIT then exit
64     *
65     IF(NHITS.LT.0) THEN
66     WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM,
67     + IDRUN,IDEVT
68     CALL GMAIL(1,0)
69     GO TO 10
70     ENDIF
71     *
72     * Fill the CWN common
73     *
74     NTHND = NHITS
75     DO I=1,NHITS
76     ITUBEND(I) = NUMBV(1,I)
77     XINND(I) = VHITS(1,I)
78     YINND(I) = VHITS(2,I)
79     ZINND(I) = VHITS(3,I)
80     XOUTND(I) = VHITS(4,I)
81     YOUTND(I) = VHITS(5,I)
82     ZOUTND(I) = VHITS(6,I)
83     ERELND(I) = VHITS(7,I)
84     TIMEND(I) = VHITS(8,I)
85     PATHND(I) = VHITS(9,I)
86     IPARND(I) = VHITS(10,I)
87     P0ND (I) = VHITS(11,I)
88     *
89     ENDDO
90    
91     *
92     10000 FORMAT(' GPDND: VOLUME level too big: SET=',A4,', DET=',A4,
93     + ',NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8)
94     10100 FORMAT(' GPDND: MAX number of hits retrived: SET=',A4,
95     + ', DET=',A4,',NHREAD=',I5,', NHMAX=',I5,
96     + ', RUN=',I5,', EVT=',I8)
97     10200 FORMAT(' GPDND: Error in GPRHIT: SET=',A4,
98     + ', DET=',A4,',NHITS=',I5,', NHMAX=',I5,
99     + ', RUN=',I5,', EVT=',I8)
100     10 RETURN
101     END

  ViewVC Help
Powered by ViewVC 1.1.23