+PATCH,$CORR. +DECK,CORR3. Updates version: 5.05/00 to 5.05/03 +REP,*TITLE*,TITLE,1. CBGEANT 5.05/03 11/04/96 07.43.47 +REP,$VERSION,V5_05,1-2. *CMZ : 5.05/03 11/04/96 07.43.47 by Curtis A. Meyer *CMZ : 5.05/02 19/03/96 16.29.56 by Curtis A. Meyer *CMZ : 5.05/01 16/12/95 17.56.05 by Curtis A. Meyer *CMZ : 5.05/00 29/08/95 10.42.10 by Curtis A. Meyer *-- Author : Curtis A. Meyer 29/08/95 * *::> VERSION 5.05/03 11/04/96 07.43.47 * *> CBgeant was storing Hours:Minutes as Minutes:Seconds. * FHH implemented small corrections to GUOUT and UGZRUN * to fix this. * *::> VERSION 5.05/02 19/03/96 16.29.56 * *> Disabled a number of debug print lines in the vertex * chamber Monte Carlo code. * *::> VERSION 5.05/01 16/12/95 17.56.05 * *> Modified the code to allow Breit-Wigner masses to fall * anywhere, rather than the +/- 3 gamma as before. +REP,$HISTORY,CARDS,1. *CMZ : 5.05/01 16/12/95 17.00.14 by Curtis A. Meyer * Add the BRTW card. *CMZ : 5.05/00 29/08/95 10.41.42 by Curtis A. Meyer +ADD,$HISTORY,CARDS,49. BRTW l1 LGBWWD = .true. If set false, then Masses of Breit-Wigner resonances are limited to be within 3 Gamma of the nominal mass. The default is .true., which has no such limit. +REP,COMMCB,CB_MACRO,1-12. *CMZ : 5.05/01 16/12/95 16.48.08 by Curtis A. Meyer * Added new common block /BREITW/ to control Breit-Wigner Widths. *CMZU: 5.04/00 27/06/95 12.51.16 by RAFIK OUARED * NEW VARIABLES TO INCLUDE SVTX TABLE * IN /CBLINK/ : LRTVX * IN /CBXDIV/ : IXRTVX * IN /CCFLAG/ : KRTVX=20 *CMZ : 5.00/02 22/11/94 22.38.23 by Curtis A. Meyer * Added the /GESEED/ to retain seeds at the start of events. +REP,COMMCB,CB_MACRO,27-42. *CMZ : 5.00/00 05/07/94 18.09.17 by CBGEANT HACKERS * Added relevent bits for new coding of lookup tables for 2282 and FERA * Include number of wires (NWIR1,NWIR2) in CBPWJD sequence. * Type untyped variables in CCDRIF, CENOIS. * I am creating a new common block to pass the variable NY from * subroutine dchget to jdcin. * I am adding arrays PWIR1 and PWIR2 to common block CBPWJD * I am adding arrays SINJD2 and COSJD2 to common block CCJDCD +REP,COMMCB,CB_MACRO,76-78. * /CBKILL/ - created to hold particle types to reject (i.e. neutrinos) +REP,COMMCB,CB_MACRO,91. *-- Author : Curtis A. Meyer +ADD,COMMCB,CB_MACRO,1225. * &KEEP,BREITW. * * LGBWWD: Control width of breitwigners. .true. leads * to full width possible, .false. is cut at 3 * gamma. * LOGICAL LGBWWD COMMON /BREITW/ LGBWWD SAVE /BREITW/ +REP,CBBASE,GUOUT,1-11. *CMZU: 5.05/03 10/04/96 15.47.32 by F.-H.Heinsius *CMZU: 5.03/02 11/05/95 16.12.24 by F.-H.Heinsius *CMZ : 5.02/01 14/03/95 08.48.47 by Curtis A. Meyer *CMZ : 5.02/00 13/03/95 15.24.15 by Curtis A. Meyer *CMZ : 5.00/02 19/11/94 13.53.50 by Curtis A. Meyer *CMZU: 5.00/01 03/08/94 14.27.05 by CBGEANT HACKERS *CMZ : 11/09/94 18.41.19 by RAFIK OUARED * Add SVTX part code. *CMZ : 11/09/94 18.40.18 by RAFIK OUARED *CMZ : 03/08/94 14.03.51 by CBGEANT HACKERS * Add the eencoded hardware bit in IEHDCB(8) AJN *CMZ : 4.05/00 20/11/91 21.38.24 by R.BOSSINGHAM +REP,CBBASE,GUOUT,19-28. *CMZ : 4.04/02 10/10/91 12.39.07 by R.BOSSINGHAM *CMZ : 4.03/02 10/09/91 13.25.44 by R.BOSSINGHAM * Initialize and save ITIME,IDATE,ICBTIM,ICBDAT * Replace LJDF with LRJDF in call to MZDROP. *CMZ : 4.03/01 02/07/91 13.08.46 by R.BOSSINGHAM * Save IEHDCB between calls. *CMZU: 4.02/10 26/01/91 17.05.10 by Curtis A. Meyer *CMZ : 4.02/07 04/11/90 10.35.40 by Curtis A. Meyer *CMZ : 4.02/05 28/08/90 10.20.57 by Curtis A. Meyer *-- Author : M.Guckes +REP,CBBASE,GUOUT,83-87. C Call the users event routine MYEVNT C CALL MYEVNT C C Get the seeds at the end of this run: +REP,CBBASE,GUOUT,96. C Let the user know from time to time that events are still coming: +REP,CBBASE,GUOUT,108-113. C MTL addition begin CALL GETENVF('GEANTEVENTSOUT',CFILE) if (CFILE.EQ.' ') THEN CFILE = 'geant_events.out' ENDIF C MTL addition end +REP,CBBASE,GUOUT,120. 5959 FORMAT(' ',I2,':',I2, 3X, I2,'/',I2,'/',I4, 3X, +REP,CBBASE,GUOUT,127. C Save banks on tape +REP,CBBASE,GUOUT,134. C Prints vertices, kinematics, hits and tracks in the debuging mode. +REP,CBBASE,GUOUT,148-153. C Output raw data format, either all data or several digitisation banks. C ALL banks are shunted into the header bank at various offsets. C IF (NRAWD.LE.0) GOTO 999 * * Fill event header words +REP,CBBASE,GUOUT,183-192. CALL SBYT(ITIM,ICBTIM,9,8) CALL SBYT(IH, ICBTIM,17,8) ENDIF IEHDCB(6) = ICBTIM IEHDCB(7) = ICBDAT * setup version -1 : MC C NEW HARWARE ENCODING STARTS HERE. C IEHDCB(8) = -1 IEHDCB(8) = IHWBIT C End of modifications to header word: +REP,CBBASE,GUOUT,200-203. *-------------- * C C PWC +REP,CBBASE,GUOUT,209. C SVTX +REP,CBBASE,GUOUT,215. C Fera +REP,CBBASE,GUOUT,221. C LeCroy 2280 +REP,CBBASE,GUOUT,227. C JDC processed data +REP,CBBASE,GUOUT,233. C JDC unprocessed RAW data +REP,CBBASE,GUOUT,239. C GHT processed data +REP,CBBASE,GUOUT,245. C GHT unprocessed RAW data +REP,CBBASE,GUOUT,251-260. * Now drop the EVHD bank * LLAST=LQ(LEVHD) CALL MZDROP(IXSTOR,LEVHD,' ') C C Output and wiping of structures C CALL FZOUT(IORAWD,IXEVHD,LLAST,1,'D',2,NEHDCB,IEHDCB) C 999 CONTINUE +ADD,CBBASE,UGFFGO,0. *CMZ : 5.05/01 16/12/95 16.51.46 by Curtis A. Meyer * Include new common /BREITW/ to control Breit-Wigner widths. * Add new logical card BRTW which defaults .true., which * will lead to no 3*gamma cut on the width of a resonance. * .false. will lead to the "old" configuration. +ADD,CBBASE,UGFFGO,151. &SEQ,BREITW. +ADD,CBBASE,UGFFGO,532. C-- Steer the width's of the Breit-Wigner functions: C LGBWWD = .TRUE. CALL FFKEY('BRTW',LGBWWD,1,'LOGI') C +REP,CBBASE,UGZRUN,1-43. *CMZU: 5.05/03 10/04/96 15.47.31 by F.-H.Heinsius *CMZU: 5.02/00 13/03/95 15.36.05 by Curtis A. Meyer * Flags added for IBM Risc, Hpunix, SGI,... *CMZ : 5.01/01 13/12/94 15.15.06 by RAFIK OUARED * NEW BITS ENCODED FOR HARDWARE SETUP & READOUT : * HARDWARE SETUP : SILICON VERTEX USED AS INNER DETECTOR * WHILE OUTER DETECTOR SET TO 'NONE'. * READOUT : BIT 7 SET IF SVTX USED. *CMZ : 5.01/00 17/09/94 17.43.58 by RAFIK OUARED *CMZ : 15/09/94 12.09.37 by RAFIK OUARED * ADDED CODE FOR SVTX PART. *CMZ : 03/08/94 14.28.40 by CBGEANT HACKERS *CMZ : 03/08/94 13.56.51 by CBGEANT HACKERS * Encode the hardware configuration and store it in the * run header. Save it as IHWBIT. AJN *CMZ : 5.00/00 11/11/93 16.25.44 by CBGEANT HACKERS' *CMZ : 15/01/93 14.21.11 by Y.Dardenne * I changed iq(lgeom+15)=1 to iq(lgeom+15)=jdcd * *CMZU: 4.06/06 11/06/92 20.33.05 by Michael Kobel * FHH wants me to fix IOWDS in the CALL MZBOOK for the GEOM bank *CMZU: 4.06/05 05/05/92 11.03.24 by Michael Kobel *CMZ : Use the version number from CMZ *CMZ : 4.06/03 26/02/92 16.51.53 by R.BOSSINGHAM *CMZ : 4.06/00 07/02/92 13.13.14 by R.BOSSINGHAM * Fix bug making CBGEANT version,update=0 in MCIN bank. * Put more data into informational banks; update. * Create DIST information bank. *CMZ : 4.05/00 13/11/91 11.42.05 by R.BOSSINGHAM * Exchange XDC for GHT. * Initialize the variable LEVHD. *CMZ : 4.03/02 10/09/91 14.43.25 by R.BOSSINGHAM * Force initialization of variables IUPD, VERSN. * Make a few minor aesthetic changes. *CMZ : 4.03/01 08/07/91 12.57.31 by R.BOSSINGHAM * Remove obsolete ACP reference. *CMZ : 4.02/08 15/11/90 18.05.51 by Curtis A. Meyer *CMZ : 4.02/07 04/11/90 10.41.57 by Curtis A. Meyer *CMZ : 4.02/06 28/08/90 10.31.15 by Curtis A. Meyer *CMZ : 4.02/05 28/08/90 10.20.59 by Curtis A. Meyer *-- Author : SUBROUTINE UGZRUN * ****************************************************************** +REP,CBBASE,UGZRUN,53. ****************************************************************** +REP,CBBASE,UGZRUN,81-83. * Zebra beginning-of-run * * Contents of user buffer needs to be defined! +REP,CBBASE,UGZRUN,99. * Identify machine we are running on +REP,CBBASE,UGZRUN,126. * Identify the JDC algorithm chosen +REP,CBBASE,UGZRUN,135-141. * Return, if not writing a raw data tape: * IF (NRAWD.LE.0) RETURN * * Write ZEBRA start-of-run * * Fill event header words +REP,CBBASE,UGZRUN,167-176. CALL SBYT(ITIM,ICBTIM,9,8) CALL SBYT(IH, ICBTIM,17,8) RUNHDR(6) = ICBTIM RUNHDR(7) = ICBDAT C Set the hardware flag here: C NEW HARWARE ENCODING STARTS HERE. C We now want to encode this word with bits which describe C the hardware setup.: IHRDW=0 *Field: +REP,CBBASE,UGZRUN,183-185. *Momentum of Pbar: IHARD=6 * This is well defined for generators 3 and 31 +REP,CBBASE,UGZRUN,194-198. * The 2-body generator only works at rest at the moment: so IF(IKINE.EQ.99) IHARD=5 CALL SBYT(IHARD,IHRDW,3,4) *Fill type: +REP,CBBASE,UGZRUN,204. *Target design: +REP,CBBASE,UGZRUN,210-216. *Inner 'vertex' detector. 0=pwc1,1=strip,2=cerenkov,3=none * 1 and 2 remain to be implemented in the code as of 02/08/94 IHARD=0 IF(NDSVX.NE.1) THEN IF(NDPWC(1).EQ.0) IHARD=3 *** IF(NDPWC(1).EQ.1) IHARD=0 *** IF(NDPWC(1).EQ.2) IHARD=0 +REP,CBBASE,UGZRUN,222-228. *outer 'vertex' detector. 0=pwc1,1=strip,2=cerenkov,3=none * 1 and 2 remain to be implemented in the code as of 02/08/94 IHARD=0 IF(NDSVX.NE.1) THEN IF(NDPWC(2).EQ.0) IHARD=3 *** IF(NDPWC(2).EQ.1) IHARD=0 *** IF(NDPWC(2).EQ.2) IHARD=0 +REP,CBBASE,UGZRUN,234. *JDC type: 0=old, 1=new, 2=none +REP,CBBASE,UGZRUN,241-278. *BGO endcaps: Not implemented in official Monte Carlo. IHARD=0 CALL SBYT(IHARD,IHRDW,15,1) CALL SBYT(IHARD,IHRDW,16,1) *Kens counter: Not implemented in official Monte Carlo. IHARD=2 CALL SBYT(IHARD,IHRDW,17,2) *Silicon counters: Not implemented in official Monte Carlo. IHARD=2 CALL SBYT(IHARD,IHRDW,19,2) CALL SBYT(IHARD,IHRDW,21,2) *reserved bit IHARD=0 CALL SBYT(IHARD,IHRDW,23,1) *set bit to indicate Monte Carlo: IHARD=1 CALL SBYT(IHARD,IHRDW,24,1) C Now the hardwhere setup should be in IHRDW C Store the read-out information: Based on what was read out, not what C was digitized. IRDOU=0 *set bit to indicate readout of PWC : IHARD=0 IF (QRAWD(KRPWC)) IHARD=1 CALL SBYT(IHARD,IRDOU,1,1) *set bit to indicate readout of JDC: IHARD=0 IF (QRAWD(KRJDC)) IHARD=1 CALL SBYT(IHARD,IRDOU,2,1) *set bit to indicate readout of BC: +REP,CBBASE,UGZRUN,284-291. *set bit to indicate readout of SVTX: IHARD=0 IF (QRAWD(KRVTX)) IHARD=1 CALL SBYT(IHARD,IRDOU,7,1) *all other bits are 0, ie software trigger out, lightpulser, slow-control * Now just combine these two words into the event header: +REP,CBBASE,UGZRUN,297-301. C End of modifications to header word: * CALL FZRUN(IORAWD,IABS(IDRUN),NRUNHD,RUNHDR) * * Prepare first event (type 2) with information on data cards etc.. +REP,CBBASE,UGZRUN,307-324. * Fill bank * CPU identification * Q(LEVHD+1) = HCPU * * Random number seeds * IQ(LEVHD+2) = NRNDM(1) IQ(LEVHD+3) = NRNDM(2) * * Get the version/ update for current Version * WRITE (TITLE,1000) 1000 FORMAT( &SEQ,QFTITLE,N=60. &) * *---Use the version number from CMZ. +REP,CBBASE,UGZRUN,339. * Physics flags and cuts +REP,CBBASE,UGZRUN,357. * ...... cuts +REP,CBBASE,UGZRUN,387-391. 5 CONTINUE * IQ(LPHYS+43) = IVXRAY * * kine card +REP,CBBASE,UGZRUN,398-400. 10 CONTINUE * * vert card +REP,CBBASE,UGZRUN,407-415. 20 CONTINUE DO 22 I=1,3 Q(LVERT+4+I) = WIDIN(I) 22 CONTINUE Q(LVERT+ 8) = RTARG2 Q(LVERT+ 9) = ZTARG1 Q(LVERT+10) = ZTARG2 * * GEOM, DIGI, SETS, PREC, RAWD data cards and other geometry information +REP,CBBASE,UGZRUN,462. * Magnetic field +REP,CBBASE,UGZRUN,489-494. * GHT design number set to 1 at present: * IQ(LGEOM+13) = 1 Q (LGEOM+14) = ANGGHT * * JDC design number set to JDCD at present: +REP,CBBASE,UGZRUN,500. * JDC gas file information: +REP,CBBASE,UGZRUN,516-525. * Switches * CALL MZBOOK(IXEVHD,LSWIT,LGEOM,0,'SWIT',0,0,10,2,0) DO 30 I=1,10 IQ(LSWIT+I) = ISWIT(I) 30 CONTINUE * * Experimental corrections applied * C Update the bank length by two words AJN. (for LUT info) +REP,CBBASE,UGZRUN,544. * Check for xtal calib. variation option (-1:table, 0:none, +1:constant): +REP,CBBASE,UGZRUN,555. * Check for FERA noise options (-1:table, 0:none, +1:constant): +REP,CBBASE,UGZRUN,571. * Check for 2282 noise options (-1:table, 0:none, +1:constant): +REP,CBBASE,UGZRUN,625-631. * Fill banks with lookup tables * CALL UGZTAB * * Write to tape/disk and wipe out our division * * This is a start-of-run event, mark it as such (runhdr(1)=2) +REP,CBKINE,BIBRWI,1-2. *CMZ : 5.05/01 16/12/95 16.57.26 by Curtis A. Meyer *CMZ : 5.00/04 23/11/94 20.39.54 by Curtis A. Meyer +REP,CBKINE,BIBRWI,23-26. C. * ==> Modified: 23 November 1994 C.A.Meyer * C. * Replace RNDM() with GRNDM(). * C. * ==> Modified: 16 December 1995 C.A.Meyer * C. * Modify the width of the Breit Wigners. The * C. * old configuration limited things to 3 gamma. * C. * This can still be obtained using the BRTW F * C. * Steering card. The default will be no such * C. * limit. * C. ********************************************************* C. &SEQ,GCONST. &SEQ,BREITW. +REP,CBKINE,BIBRWI,35-42. 100 CALL GRNDM(ATEST,1) * ATEST = TAN(PI*(ATEST-0.5)) AMASSN = ATEST*AWIDTH * *---Check on physical limits on the mass, zero to 2*mass. * IF ( (AMASSN.LT.-AMASS) .OR. (AMASSN.GT. AMASS) ) GOTO 100 * *---Check to see if the 3*gamma limit is in place? * IF ((.NOT.LGBWWD).AND.(ABS(ATEST).GT.3.)) GOTO 100 +REP,SV,SVDIGI,1-2. *CMZU: 5.05/02 19/03/96 10.55.55 by F.-H.Heinsius *CMZU: 5.04/00 30/06/95 20.07.51 by RAFIK OUARED *-- Author : R.Ouared +REP,SV,SVDIGI,14. *. * new RVTX filling and new display of hits. * *. * modified March 19, 1996 F.H.Heinsius * *. * put calls to GPDIGI/GPHITS inside IF=SVDIGI * *. * produced *lots* of output. * +REP,SV,SVDIGI,30. * Zebra raw data bank size IZBSIZ +REP,SV,SVDIGI,55-61. * Array of hit wire addresses IADD (),JADD() * INTEGER IADD (NICEL),JADD(NICEL) * * Number of wires which fired in one event NWIRES * * Zero the array of "added" wires, and set number of wires to zero. +REP,SV,SVDIGI,71-94. * Return hits for a given STRIP ISTR if SVTX exists: * IF (NDSVX.NE.0) THEN * * get minimum volume descriptors to identify uniquely ISTR. * DO 122 II=1,NVDIM DO 123 IV=1,NHMAX NUMB(II,IV)=0 123 CONTINUE 122 CONTINUE CALL VZERO(NUMV,NVDIM) CALL GFHITS('SV ','ISTR',NVDIM,NHDIM,NHMAX,0,NUMV, & ITRA,NUMB,HITS,NHITS) * * Was there a hit in this cell? * IF(NHITS.LE.0) GOTO 100 * * * PRINT HITS IN GEANT FORMAT. * &SELF,IF=SVDIGI. CALL GPHITS('SV ','ISTR') +REP,SV,SVDIGI,102-106. 150 CONTINUE &SELF. * * * COMPUTE ISTR NUMBERS TO GET EFFECTIVE NUMBER OF HITS . +REP,SV,SVDIGI,139-141. * COMPUTE DIGITIZATION HERE * 13 KDIGI(JNUM)=10000 !10000 PER CM +REP,SV,SVDIGI,153. 14 CONTINUE +REP,SV,SVDIGI,162. * STORE ISTR DIGITISATION. +REP,SV,SVDIGI,173-211. 126 CONTINUE * DO 19 II=1,NTRA MTRA(II)=ITRS(JI) 19 CONTINUE * DO 22 IC=1,NVDIM NUMV(IC)=NUMB(IC,INUV(JI)) 22 CONTINUE * * STORE DIGITIZATION HERE * CALL GSDIGI(ISET,IDET,MTRA,NTRA,NUMV,IDIGI,IDIG) * 18 CONTINUE * DO 142 II=1,NVDIM DO 143 IV=1,NDMAX NUBV(II,IV)=0 143 CONTINUE 142 CONTINUE * * FIND OUT DIGITIZATON VALUES * **** CALL VZERO(NUMV,NVDIM) CALL GFDIGI('SV ','ISTR',NTDIM,NVDIM,NDDIM,NDMAX,NUMV, + LTRA,HTRA,NUBV,MDIGI,NDIGI) &SELF,IF=SVDIGI. WRITE(6,*) 'SVDIGI:ITRA= ',(ITRA(K),K=1,NHITS) CALL GPDIGI('SV ','ISTR') &SELF. * * * 100 CONTINUE * ENDIF * * Also order the array, as it would appear in real data +REP,SV,SVDIGI,223-226. * PREPARE THE FILLING OF THE RAW BANK RVTX * * WORK OUT NUMBER OF CLUSTERS AND NUMBER OF HITS PER CLUSTER * NCLUS,NH(NCLUS) +REP,SV,SVDIGI,238. 220 CONTINUE +REP,SV,SVDIGI,256. 201 J=NH(NCLUS) +REP,SV,SVDIGI,264. 205 IFIRST(NCLUS)=IADD(I) +REP,SV,SVDIGI,271-274. 207 IMOD(I) =2*IPAD(NCLUS)+(ISUBM(NCLUS)+1) GOTO 206 ENDIF 206 CONTINUE +REP,SV,SVDIGI,284-286. 200 CONTINUE * * FLL UP BACKPLANE AMPLITUDES ARRAY IADC +REP,SV,SVDIGI,296-297. 211 CONTINUE 210 CONTINUE +REP,SV,SVDIGI,319. * STARTS FILLING UP RVTX BANK +REP,SV,SVDIGI,413. 900 RETURN