/[PAMELA software]/gpamela/gpcal/gpdcal.F
ViewVC logotype

Diff of /gpamela/gpcal/gpdcal.F

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3.2 by pamela, Wed Dec 17 11:32:48 2003 UTC revision 3.6 by cafagna, Thu May 11 00:39:39 2006 UTC
# Line 1  Line 1 
1  *  *
2  * $Id: gpdcal.F,v 3.1.1.1 2002/07/11 16:02:14 cafagna Exp $  * $Id: gpdcal.F,v 3.5 2006/05/11 00:15:34 cafagna Exp $
3  *  *
4  * $Log: gpdcal.F,v $  * $Log: gpdcal.F,v $
5    * Revision 3.5  2006/05/11 00:15:34  cafagna
6    * A bug in hits retrival for calorimeter
7    *
8    * Revision 3.4  2005/07/25 11:53:20  cafagna
9    * Several updates. See history for details
10    *
11    * Revision 3.3  2005/06/21 02:42:03  cafagna
12    * Major modification to the geometry and to the random number chain
13    *
14    * Revision 3.2  2003/12/17 11:32:48  pamela
15    * CALO SIMULATION COMPLETED: geometry and special tracking parameters updated and simulation checked by a comparison with the Trieste's standalone Monte Carlo simulation
16    *
17  * Revision 3.1.1.1  2002/07/11 16:02:14  cafagna  * Revision 3.1.1.1  2002/07/11 16:02:14  cafagna
18  * First GPAMELA release on CVS  * First GPAMELA release on CVS
19  *  *
# Line 24  Line 36 
36  *                                                                      *  *                                                                      *
37  ************************************************************************  ************************************************************************
38  #include "gcunit.inc"  #include "gcunit.inc"
39    #include "gcflag.inc"
40  #include "gpphit.inc"  #include "gpphit.inc"
41        PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2)        PARAMETER (NH1=NHCALI,NHM1=NHMCALI,NVOL1=2)
42          PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3)
43  #include "gprhit.inc"  #include "gprhit.inc"
44  #include "gpcal.inc"  #include "gpcal.inc"
45  #include "gpsed.inc"  #include "gpsed.inc"
# Line 37  Line 51 
51  *  *
52        INTEGER IS,ID,NV,NVM,NNHM        INTEGER IS,ID,NV,NVM,NNHM
53        CHARACTER*4 CSET        CHARACTER*4 CSET
54        INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM)        INTEGER ITRA1(NHM1),NUMD1(NVOL1),NUMBV1(NVOL1,NHM1)
55          REAL VHITS1(NH1,NHM1)
56  *  *
57  * Vector zeroed  * Vector zeroed
58  *  *
# Line 52  Line 67 
67        CALL VZERO(NUMD  ,NVOL)        CALL VZERO(NUMD  ,NVOL)
68        CALL VZERO(NUMD1 ,NVOL1)        CALL VZERO(NUMD1 ,NVOL1)
69  c ml:16/4/2003  c ml:16/4/2003
70        CALL VZERO(ICASTRIP,NHMCAL)        CALL VZERO(ICASTRIP,NHMCALI)
71        CALL VZERO(ICAPLANE,NHMCAL)        CALL VZERO(ICAPLANE,NHMCALI)
72        CALL VZERO(ICAMOD,NHMCAL)        CALL VZERO(ICAMOD,NHMCALI)
73        CALL VZERO(ENESTRIP,NHMCAL)        CALL VZERO(ENESTRIP,NHMCALI)
74  c end 16/4/2003  c end 16/4/2003
75  *  *
       NV = NVOL  
       NVM= NVMAX  
76  *  *
77  * The tungsten plane case  * The tungsten plane case
78  *  *
79          NV = NVOL
80          NVM= NVMAX
81        IS   = ISCAL        IS   = ISCAL
82        ID   = IDCASI        ID   = IDCAST
83        IT = -1        IT = -1
84        CSET = 'CAL '        CSET = 'CAL '
85  *  *
# Line 83  c end 16/4/2003 Line 98  c end 16/4/2003
98  * Update the max number of hits to be retrived  * Update the max number of hits to be retrived
99  *  *
100        NNHM = NHM        NNHM = NHM
101    c$$$      IF(NNHM.LE.0) THEN
102    c$$$         WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM,
103    c$$$     +                        IDRUN,IDEVT
104    c$$$         CALL GMAIL(1,0)
105    c$$$         GO TO 10
106    c$$$      ENDIF
107          CALL VZERO(NUMBV,NVOL*NHM)
108          CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1,
109         +           IT,NUMD,ITRA,NUMBV,VHITS,NHITS)
110    *
111    * If there was a problem in GPRHIT then exit
112    *
113          IF(NHITS.LT.0) THEN
114             WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM,
115         +                        IDRUN,IDEVT
116             CALL GMAIL(1,0)
117          ELSE
118    *
119    * >>>>>>>>>>>>>>>>>>>>>> DIGI action
120    *
121    *
122    * Fill the CWN common
123    *
124             NTHCAL=0
125             DO I=1,NHITS
126                NTHCAL = NTHCAL + 1
127                ICAPL(NTHCAL) = NUMBV((NVCAL-2),I)
128                ICASI(NTHCAL) = NUMBV((NVCAL-1),I)
129                ICAST(NTHCAL) = NUMBV((NVCAL),I)
130                XINCAL(NTHCAL) = VHITS(1,I)
131                YINCAL(NTHCAL) = VHITS(2,I)
132                ZINCAL(NTHCAL) = VHITS(3,I)
133                ERELCAL(NTHCAL) = VHITS(4,I)
134    c         IPARCAL(NTHCAL) = VHITS(5,I)
135    c     P0CAL(NTHCAL) = VHITS(6,I)
136             ENDDO
137          ENDIF
138    C
139    C The energy released per strip
140    C
141          NV = NVOL1
142          NVM= NVMAX
143    *
144    * The tungsten plane case
145    *
146          IS   = ISCAL
147          ID   = IDCASI
148          IT = -1
149          CSET = 'CAL '
150    *    
151    * Check on the volume level
152    *
153          IF (NV.GT.NVM) THEN
154             WRITE(CHMAIL,10000) CSET,CNSED(IS,ID),NVOL,NVMAX,
155         +                        IDRUN,IDEVT
156             CALL GMAIL(1,0)
157             GO TO 10
158          ENDIF
159          CALL VZERO(VHITS1,NH1*NHM1)
160          CALL VZERO(ITRA1 ,NHM1)
161          NHITS = -1
162    *
163    * Update the max number of hits to be retrived
164    *
165          NNHM = NHM1
166        IF(NNHM.LE.0) THEN        IF(NNHM.LE.0) THEN
167           WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM,           WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM,
168       +                        IDRUN,IDEVT       +                        IDRUN,IDEVT
169           CALL GMAIL(1,0)           CALL GMAIL(1,0)
170           GO TO 10           GO TO 10
171        ENDIF        ENDIF
172        CALL VZERO(NUMBV,NVOL*NHM)        CALL VZERO(NUMBV1,NVOL1*NHM1)
173        CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1,        CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL1,NH1,NNHM,1,
174       +           IT,NUMD,ITRA,NUMBV,VHITS,NHITS)       +           IT,NUMD1,ITRA1,NUMBV1,VHITS1,NHITS)
175  *  *
176  * If there was a problem in GPRHIT then exit  * If there was a problem in GPRHIT then exit
177  *  *
# Line 107  c end 16/4/2003 Line 187  c end 16/4/2003
187  *  *
188  * Fill the CWN common  * Fill the CWN common
189  *  *
190        NTHCAL=0  c    
191          NTHCALI=0
192        DO I=1,NHITS        DO I=1,NHITS
193           NTHCAL=NTHCAL+1           NTHCALI=NTHCALI+1
194           ICASTRIP(NTHCAL)=VHITS(2,I)           ICASTRIP(NTHCALI)=NUMBV1(NVCALI,I)
195           ICAPLANE(NTHCAL)=VHITS(1,I)           ICAPLANE(NTHCALI)=NUMBV1((NVCALI-1),I)
196           ICAMOD(NTHCAL)=VHITS(3,I)           ICAMOD(NTHCALI)=VHITS1(1,I)
197           ENESTRIP(NTHCAL)=VHITS(4,I)           ENESTRIP(NTHCALI)=VHITS1(2,I)
198        ENDDO        ENDDO
199  cl      DO I=1,NHITS  c
 cl         NTHCAL = NTHCAL + 1  
 cl         ICAPL(NTHCAL) = NUMBV((NVCAL-2),I)  
 cl         ICASI(NTHCAL) = NUMBV((NVCAL-1),I)  
 cl         ICAST(NTHCAL) = NUMBV((NVCAL),I)  
 cl         XINCAL(NTHCAL) = VHITS(1,I)  
 cl         YINCAL(NTHCAL) = VHITS(2,I)  
 cl         ZINCAL(NTHCAL) = VHITS(3,I)  
 cl         ERELCAL(NTHCAL) = VHITS(4,I)  
 c         IPARCAL(NTHCAL) = VHITS(5,I)  
 c         P0CAL(NTHCAL) = VHITS(6,I)  
 cl      ENDDO  
 c      
200  10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,',  10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,',
201       +     NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8)       +     NVOL=',I3,', NVMAX=',I3,', RUN=',I5,', EVT=',I8)
202  10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4,  10100 FORMAT(' GPDCAL: MAX number of hits retrived: SET=',A4,

Legend:
Removed from v.3.2  
changed lines
  Added in v.3.6

  ViewVC Help
Powered by ViewVC 1.1.23