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

Contents of /gpamela/gpnd/gpund.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Apr 9 23:29: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
Changes since 1.1: +15 -93 lines
Several new things, among this: ND and CARD

1 *CMZ : 2.01/00 05/04/2000 14.35.18 by Marialuigia Ambriola
2 *CMZ : 2.00/00 25/02/2000 19.34.00 by Francesco Cafagna
3 *CMZ : 1.02/00 06/03/97 21.46.02 by Francesco Cafagna
4 *CMZ : 1.00/02 04/04/96 16.47.15 by Francesco Cafagna
5 *-- Author : Francesco Cafagna 21/02/96
6 SUBROUTINE GPUND(IACT,IS,ID,IPA,IT,DELOSS,TIME,PATH,
7 + TRAPAR,NUMVOL,IMEC)
8 ************************************************************************
9 * *
10 * To collect and store the hit structure for TOF *
11 * *
12 * Variables definition: *
13 * IN: *
14 * IACT, integer specifing the action to be taken. It is the INWVOL *
15 * variable in GCTRAK common *
16 * IS , set number *
17 * ID , detector number *
18 * IPA , particle number *
19 * IT , track number *
20 * DELOSS, energy loss in the step *
21 * TIME , current time of flight in seconds *
22 * TRAPAR, track parameter, is the VECT vector in GCTRAK common *
23 * NUMVOL, integr array of numbers identifying the DETECTOR *
24 * IMEC , integer indicating the LOSS mecanism position inside NMEC *
25 * vector, zero if not present *
26 * *
27 * Called by: GUSTEP *
28 * Author: Francesco Cafagna, 21/02/96 16.13.51 *
29 * *
30 ************************************************************************
31 #include "gphit.inc"
32 #include "gcunit.inc"
33 #include "gpsed.inc"
34 *
35 INTEGER IACT,IS,ID,IPA,IT,NUMVOL(20),IMEC,IDHIT
36 REAL DELOSS,TIME,PATH,TRAPAR(7),VHIT(NHND)
37 LOGICAL SAVE
38 *
39 * Track is inside a volume
40 *
41 IF(IACT.EQ.0) THEN
42 IF(IMEC.GT.0) THEN
43 SAVE = .TRUE.
44 VHIT(7) = DELOSS + VHIT(7)
45 ENDIF
46 ENDIF
47 *
48 * Entering a new volume or is a new track
49 *
50 IF(IACT.EQ.1) THEN
51 SAVE = .FALSE.
52 CALL VZERO(VHIT,NHND)
53 DO I=1,3
54 VHIT(I) = TRAPAR(I)
55 ENDDO
56 IF(IMEC.GT.0) THEN
57 SAVE = .TRUE.
58 VHIT(7) = DELOSS
59 ENDIF
60 VHIT(8) = TIME
61 VHIT(9) = PATH
62 VHIT(10) = IPA
63 VHIT(11) = TRAPAR(7)
64 IDHIT = -1
65 ENDIF
66 *
67 * Track is exiting current volume
68 *
69 IF(IACT.EQ.2) THEN
70 DO I=1,3
71 VHIT(I+3) = TRAPAR(I)
72 #if defined(GPAMELA_INTER)
73 * interactive case, we need the average position
74 VHIT(I) = (VHIT(I) + VHIT(I+3) )/2.
75 #endif
76 ENDDO
77 IF(IMEC.GT.0) THEN
78 SAVE = .TRUE.
79 VHIT(7) = DELOSS + VHIT(7)
80 ENDIF
81 VHIT(8) = (TIME + VHIT(8))/2.
82 VHIT(10) = (TRAPAR(7) + VHIT(10))/2.
83 *
84 * Store the hit
85 *
86 IF(IDHIT.EQ.-1) THEN
87 IF (SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT)
88 IF (IDHIT.EQ.0) THEN
89 WRITE(CHMAIL,10000) IS,ID,IT
90 CALL GMAIL(1,0)
91 ENDIF
92 ELSE
93 WRITE(CHMAIL,10100) IS,ID,IT
94 CALL GMAIL(1,0)
95 ENDIF
96 ENDIF
97 *
98 * Track is exiting the set up
99 *
100 IF(IACT.EQ.3) THEN
101 *
102 * Check if the hit have been previously stored or not
103 *
104 IF(IDHIT.LT.0) THEN
105 DO I=1,3
106 VHIT(I+3) = TRAPAR(I)
107 #if defined(GPAMELA_INTER)
108 * interactive case, we need the average position
109 VHIT(I) = (VHIT(I) + VHIT(I+3) )/2.
110 #endif
111 ENDDO
112 IF(IMEC.GT.0) THEN
113 SAVE = .TRUE.
114 VHIT(7) = DELOSS + VHIT(7)
115 ENDIF
116 VHIT(8) = (TIME + VHIT(8))/2.
117 VHIT(10) = (TRAPAR(7) + VHIT(10))/2.
118 *
119 * Store the hit
120 *
121 IF(IDHIT.EQ.-1) THEN
122 IF (SAVE) CALL GSAHIT (IS,ID,IT,NUMVOL,VHIT,IDHIT)
123 IF (IDHIT.EQ.0) THEN
124 WRITE(CHMAIL,10200) IS,ID,IT
125 CALL GMAIL(1,0)
126 ENDIF
127 ELSE
128 WRITE(CHMAIL,10300) IS,ID,IT
129 CALL GMAIL(1,0)
130 ENDIF
131 ENDIF
132 ENDIF
133 10000 FORMAT(' GPUND error: HIT have not be stored for SET='
134 + ,I4,', DET=',I4,', TRACK=',I6)
135 10100 FORMAT(' GPUND error: HIT have not be initialized for SET='
136 + ,I4,', DET=',I4,', TRACK=',I6)
137 10200 FORMAT(' GPUND error: HIT have not be stored for SET='
138 + ,I4,', DET=',I4,', TRACK=',I6)
139 10300 FORMAT(' GPUND error: HIT have not be initialized for SET='
140 + ,I4,', DET=',I4,', TRACK=',I6)
141 RETURN
142 END

  ViewVC Help
Powered by ViewVC 1.1.23