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

Legend:
Removed from v.3.4  
changed lines
  Added in v.3.7

  ViewVC Help
Powered by ViewVC 1.1.23