--- gpamela/gpcal/gpdcal.F 2005/07/25 11:53:20 3.4 +++ gpamela/gpcal/gpdcal.F 2006/05/11 00:39:39 3.6 @@ -1,7 +1,13 @@ * -* $Id: gpdcal.F,v 3.3 2005/06/21 02:42:03 cafagna Exp $ +* $Id: gpdcal.F,v 3.5 2006/05/11 00:15:34 cafagna Exp $ * * $Log: gpdcal.F,v $ +* Revision 3.5 2006/05/11 00:15:34 cafagna +* A bug in hits retrival for calorimeter +* +* Revision 3.4 2005/07/25 11:53:20 cafagna +* Several updates. See history for details +* * Revision 3.3 2005/06/21 02:42:03 cafagna * Major modification to the geometry and to the random number chain * @@ -30,8 +36,10 @@ * * ************************************************************************ #include "gcunit.inc" +#include "gcflag.inc" #include "gpphit.inc" - PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3,NVOL1=2) + PARAMETER (NH1=NHCALI,NHM1=NHMCALI,NVOL1=2) + PARAMETER (NH=NHCAL,NHM=NHMCAL,NVOL=3) #include "gprhit.inc" #include "gpcal.inc" #include "gpsed.inc" @@ -43,7 +51,8 @@ * INTEGER IS,ID,NV,NVM,NNHM CHARACTER*4 CSET - INTEGER NUMD1(NVOL1),NUMBV1(NVOL1,NHM) + INTEGER ITRA1(NHM1),NUMD1(NVOL1),NUMBV1(NVOL1,NHM1) + REAL VHITS1(NH1,NHM1) * * Vector zeroed * @@ -58,17 +67,17 @@ CALL VZERO(NUMD ,NVOL) CALL VZERO(NUMD1 ,NVOL1) c ml:16/4/2003 - CALL VZERO(ICASTRIP,NHMCAL) - CALL VZERO(ICAPLANE,NHMCAL) - CALL VZERO(ICAMOD,NHMCAL) - CALL VZERO(ENESTRIP,NHMCAL) + CALL VZERO(ICASTRIP,NHMCALI) + CALL VZERO(ICAPLANE,NHMCALI) + CALL VZERO(ICAMOD,NHMCALI) + CALL VZERO(ENESTRIP,NHMCALI) c end 16/4/2003 * - NV = NVOL - NVM= NVMAX * * The tungsten plane case * + NV = NVOL + NVM= NVMAX IS = ISCAL ID = IDCAST IT = -1 @@ -89,12 +98,12 @@ * Update the max number of hits to be retrived * NNHM = NHM - IF(NNHM.LE.0) THEN - WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, - + IDRUN,IDEVT - CALL GMAIL(1,0) - GO TO 10 - ENDIF +c$$$ IF(NNHM.LE.0) THEN +c$$$ WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCAL,NHM, +c$$$ + IDRUN,IDEVT +c$$$ CALL GMAIL(1,0) +c$$$ GO TO 10 +c$$$ ENDIF CALL VZERO(NUMBV,NVOL*NHM) CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, + IT,NUMD,ITRA,NUMBV,VHITS,NHITS) @@ -105,27 +114,27 @@ WRITE(CHMAIL,10200) CSET,CNSED(IS,ID),NHITS,NHM, + IDRUN,IDEVT CALL GMAIL(1,0) - GO TO 10 - ENDIF + ELSE * * >>>>>>>>>>>>>>>>>>>>>> DIGI action * * * Fill the CWN common * - NTHCAL=0 - DO I=1,NHITS - NTHCAL = NTHCAL + 1 - ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) - ICASI(NTHCAL) = NUMBV((NVCAL-1),I) - ICAST(NTHCAL) = NUMBV((NVCAL),I) - XINCAL(NTHCAL) = VHITS(1,I) - YINCAL(NTHCAL) = VHITS(2,I) - ZINCAL(NTHCAL) = VHITS(3,I) - ERELCAL(NTHCAL) = VHITS(4,I) + NTHCAL=0 + DO I=1,NHITS + NTHCAL = NTHCAL + 1 + ICAPL(NTHCAL) = NUMBV((NVCAL-2),I) + ICASI(NTHCAL) = NUMBV((NVCAL-1),I) + ICAST(NTHCAL) = NUMBV((NVCAL),I) + XINCAL(NTHCAL) = VHITS(1,I) + YINCAL(NTHCAL) = VHITS(2,I) + ZINCAL(NTHCAL) = VHITS(3,I) + ERELCAL(NTHCAL) = VHITS(4,I) c IPARCAL(NTHCAL) = VHITS(5,I) -c P0CAL(NTHCAL) = VHITS(6,I) - ENDDO +c P0CAL(NTHCAL) = VHITS(6,I) + ENDDO + ENDIF C C The energy released per strip C @@ -138,7 +147,7 @@ ID = IDCASI IT = -1 CSET = 'CAL ' -* +* * Check on the volume level * IF (NV.GT.NVM) THEN @@ -147,22 +156,22 @@ CALL GMAIL(1,0) GO TO 10 ENDIF - CALL VZERO(VHITS,NH*NHM) - CALL VZERO(ITRA ,NHM) + CALL VZERO(VHITS1,NH1*NHM1) + CALL VZERO(ITRA1 ,NHM1) NHITS = -1 * * Update the max number of hits to be retrived * - NNHM = NHM + NNHM = NHM1 IF(NNHM.LE.0) THEN WRITE(CHMAIL,10100) CSET,CNSED(IS,ID),NTHCALI,NHM, + IDRUN,IDEVT CALL GMAIL(1,0) GO TO 10 ENDIF - CALL VZERO(NUMBV,NVOL*NHM) - CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL,NH,NNHM,1, - + IT,NUMD,ITRA,NUMBV,VHITS,NHITS) + CALL VZERO(NUMBV1,NVOL1*NHM1) + CALL GPRHIT(CSET,CNSED(IS,ID),IS,ID,NVOL1,NH1,NNHM,1, + + IT,NUMD1,ITRA1,NUMBV1,VHITS1,NHITS) * * If there was a problem in GPRHIT then exit * @@ -182,10 +191,10 @@ NTHCALI=0 DO I=1,NHITS NTHCALI=NTHCALI+1 - ICASTRIP(NTHCALI)=NUMBV(NVCALI,I) - ICAPLANE(NTHCALI)=NUMBV((NVCALI-1),I) - ICAMOD(NTHCALI)=VHITS(1,I) - ENESTRIP(NTHCALI)=VHITS(2,I) + ICASTRIP(NTHCALI)=NUMBV1(NVCALI,I) + ICAPLANE(NTHCALI)=NUMBV1((NVCALI-1),I) + ICAMOD(NTHCALI)=VHITS1(1,I) + ENESTRIP(NTHCALI)=VHITS1(2,I) ENDDO c 10000 FORMAT(' GPDCAL: VOLUME level too big: SET=',A4,', DET=',A4,',