+PATCH,$CORR. +DECK,CORR1. Updates version: 1.29/00 to 1.30/00 +REP,*TITLE*,TITLE,1. CBOFF 1.30/00 21/12/95 18.46.44 SE +REP,$VERSION,V1_29,1-2. *CMZ : 1.29/02 06/11/95 15.59.21 by Christian Voelcker *CMZ : 1.29/01 26/10/95 18.01.25 by Christian Voelcker *CMZ : 1.29/00 24/08/95 15.09.54 by Christian Voelcker *-- Author : Christian Voelcker 24/08/95 * *::> VERSION 1.29/02 06/11/95 15.59.09 * 'CALL ZBFORM' replaced by 'CALL TCFORM' in CBINIT, as there is a * routine ZBFORM in CERN library (M. Kunze) * *::> VERSION 1.29/01 26/10/95 18.01.25 * final version of multi-vertex fitter released. * Common /TCVTCM/ modified. See cbnote 285 +ADD,$VERSION,V1_30,*. &DECK,V1_30. *CMZ : 1.30/00 21/12/95 18.46.45 by Christian Voelcker *-- Author : Christian Voelcker 21/12/95 * *::> VERSION 1.30/00 21/12/95 18.46.44 * 20/12/95 Christian Voelcker * extract CBNFIL on all UNIX machines, as we have to deal * with the new dlt file structure not only here at CERN! * * CBRLBL: * deal with the new data format on tape. * Each run is seen as a seperate file, sandwiched between * a header ('HDR1','HDR2') and a trailer ('EOF1','EOF2') label. * We try to detect them in both EBCDIC and ASCII format * and just skip them, if found. * The first label (if any) always carries the tape volume word * ('VOL1') and the file header words ('HDR1','HDR2'). * If no label found, then we move back to the * begin of the file with 'CBTBOF'. Unfortunately, this * C routine seems only be supported by UNIX systems, so * still something needs to be written for VMS machines. * * Dec 19th 1995, Chr Voelcker * reading of DLTs with new file structure is now included * in the CBOFF, but for UNIX system only (see CBRLBL * comments). * If Zebra hits an end of file, we try to read the * trailer label (first call to CBNFIL) and the * header label (second call to CBNFIL) and land on the * first data record of the next ZEBRA file. * If we cannot find any data or labels, STOPCB is set * .TRUE. A Call to USRUN(ICODE 4 or 5) allows the user, * for example, to load another tape from a stacker. * * Writing new file structure to DLT still needs to be * realized! * * 18/12/95 Chr. Voelcker * TC_MACRO: * V3COND should be 0.0, not 0.01 and * V3MNHD should be 7, not 3 * new common TCDEDX with variable IDEDTC. * * CBDONE: * the following lines appeard twice in the log file: * Number of table events read ............. 4 * Number of slow control events read ...... 103 * * ZBINIT 12 Dec, 1995 FHH * Increase maximum of CBSAVE division for Garfield * table of new JDC. * +ADD,COMMCB,TC_MACRO,0. *CMZ : 1.30/00 19/12/95 12.02.11 by Christian Voelcker *CMZ : 1.29/01 26/10/95 18.00.21 by Christian Voelcker +ADD,COMMCB,TC_MACRO,129. * 26/10/95 M.Lakata, Chr. Voelcker * final version of multi-vertex fitter released. * Common /TCVTCM/ modified. * * 18/12/95 Chr. Voelcker * new common TCDEDY with variable IDEDTC. * * 18/12/95 Chr. Voelcker/M. Lakata * V3COND should be 0.0, not 0.01 and * V3MNHD should be 7, not 3 * +REP,COMMCB,TC_MACRO,898-908. * V3CONF - TCVER3: minimum conf. level to merge vertices * V3DIST - TCVER3: minimum distance to merge vertices * V3BACK - TCVER3: chi^2 penalty for interverted vertex momenta * V3MNHT - TCVER3: min number of hits on a track * VHMCH - TCVRHX: maximum rchi at any time during fit * VHGCH - TCVRHX: maximum rchi at end of fit * VHCFL - TCVRHX: minumum confidence level prob at end of fit * VHERC - TCVRHX: error scaling factor * VHCT - TCVRHX: rchisq threshold * * The parameters that end in D are the Defaults * INTEGER V3MNHD REAL V3COND, V3DISD, V3BACD REAL VHMCHD,VHGCHD,VHCFLD,VHERCD,VHCTD PARAMETER ( V3COND = 0.0, V3DISD=3.0, V3BACD=100.0 ) PARAMETER ( V3MNHD = 7 ) PARAMETER ( VHMCHD = 50.0, VHGCHD = 3.0, VHCFLD = 3.0 ) PARAMETER ( VHERCD = 1.0, VHCTD = 0.001 ) * INTEGER VERTVR,VFITVR,V3MNHT REAL V3CONF, V3DIST, V3BACK REAL VHMCH,VHGCH,VHCFL,VHERC, VHCT * COMMON /TCVTCM/ & VERTVR, VFITVR, & V3CONF, V3DIST, V3BACK, V3MNHT, & VHMCH, VHGCH, VHCFL, VHERC, VHCT * &KEEP,TCDEDY. * Common block TCDEDY, to select the method for dedx. * IDEDTC = 1 : OLD dedx method * IDEDTC = 2 : improved dEdx by Joern Adomeit. INTEGER IDEDTC COMMON /TCDEDY/ IDEDTC +ADD,CBPHYS,CBDONE,0. *CMZ : 1.30/00 18/12/95 19.19.32 by Christian Voelcker +ADD,CBPHYS,CBDONE,17. * Modified 18-Dec-95 Christian remove double printout of statistics +DEL,CBPHYS,CBDONE,65-66. +ADD,CBPHYS,CBINIT,0. *CMZ : 1.29/02 01/11/95 15.00.53 by Christian Voelcker +REP,CBPHYS,CBINIT,40-42. * are set up in the TCFORM routine. * * Subroutines referenced: ZBINIT,BCINIT,TCINIT,TCFORM. +ADD,CBPHYS,CBINIT,69. * Modified 1 November, 1995 Chr. Voelcker/ C.A. Meyer * rename ZBFORM to TCFORM, as there is a * routine ZBFORM in CERN library +REP,CBPHYS,CBINIT,506. CALL TCFORM +ADD,CBPHYS,CBLOOP,0. *CMZ : 1.30/00 20/12/95 21.27.03 by Christian Voelcker +ADD,CBPHYS,CBLOOP,56. * Dec 19th 1995, Chr Voelcker * reading of DLTs with new file structure is now included * in the CBOFF, but for UNIX system only (see CBRLBL * comments). * If Zebra hits an end of file, we try to read the * trailer label (first call to CBNFIL) and the * header label (second call to CBNFIL) and land on the * first data record of the next ZEBRA file. * If we cannot find any data or labels, STOPCB is set * .TRUE. A Call to USRUN(ICODE 4 or 5) allows the user, * for example, to load another tape from a stacker. * * Writing new file structure to DLT still needs to be * realized! +REP,CBPHYS,CBLOOP,81. INTEGER ICODE,IERR,ZBERR,ICHCK,ISTAT +REP,CBPHYS,CBLOOP,496-499. * &SELF,IF=ALT,DECS,SUN,UNIX. * first check if there is another data file on the same tape. * this will allow to read the new file structure on the dlt tapes. * CALL CBNFIL(ISTAT) ! look for eof marker IF(ISTAT.EQ.0) THEN ! eof found? then CALL CBNFIL(ISTAT) ! call for bof marker ENDIF STOPCB = ISTAT.NE.0 ! STOPCB=.TRUE. if no more files &SELF. CALL USRUN(4) * * IF (STOPCB) THEN WRITE(LLOG,1010) ELSE CALL FZENDO(LDST,'C') WRITE(LLOG,1030) ENDIF +REP,CBPHYS,CBLOOP,510-517. &SELF,IF=ALT,DECS,SUN,UNIX. * first check if there is another data file on the same tape. * this will allow to read the new file structure on the dlt tapes. * CALL CBNFIL(ISTAT) ! look for eof marker IF(ISTAT.EQ.0) THEN ! eof found? then CALL CBNFIL(ISTAT) ! call for bof marker ENDIF STOPCB = ISTAT.NE.0 ! STOPCB=.TRUE. if no more files &SELF. * call usrun only if no more files were found on that tape. * otherwise usrun will be called at next start of run. CALL USRUN(5) * IF (STOPCB) THEN WRITE(LLOG,1010) ELSE CALL FZENDO(LDST,'C') WRITE(LLOG,1020) ENDIF +ADD,CBPHYS,CBLOOP,566. 1030 FORMAT(' *** CBLOOP : Continue after system end of file ****') +ADD,CBPHYS,CBSRUN,0. *CMZ : 1.30/00 19/12/95 15.13.06 by Christian Voelcker *CMZ : 19/12/95 15.11.58 by Christian Voelcker * - select dEdx calibration method as specified in IDEDTC +ADD,CBPHYS,CBSRUN,169. &SEQ,TCDEDY. +ADD,CBPHYS,CBSRUN,1608. * method of dedx is taken from the dedx steering card. IF(IDEDTC.NE.0) IMJPCC = IDEDTC +ADD,CBPHYS,SUNERR,0. *CMZU: 1.30/00 28/11/95 16.36.47 by F.-H.Heinsius +REP,CBPHYS,SUNERR,43-46. INTEGER I,IERR,IPID,SUN_HAND,IEEE_HANDLER,GETPID,LENOCC EXTERNAL SUN_HAND,IEEE_HANDLER,GETPID,LENOCC * CHARACTER*256 FILENAME +REP,CBPHYS,SUNERR,66-71. * Added by Mark Lakata CALL GETENV('IEEEERROR',FILENAME) IF (FILENAME.EQ.' ') THEN IPID = GETPID( ) WRITE(FILENAME,20)IPID DO 30 I = 1,17 IF(FILENAME(I:I).EQ.' ') FILENAME(I:I)='_' 30 CONTINUE ENDIF WRITE(COMMAND,25)FILENAME(1:LENOCC(FILENAME)) +ADD,CBPHYS,ZBINIT,0. *CMZU: 1.30/00 12/12/95 18.52.10 by F.-H.Heinsius +ADD,CBPHYS,ZBINIT,52. * Modified : 12 Dec, 1995 FHH * Increase maximum of CBSAVE division for Garfield * table of new JDC. * +REP,CBPHYS,ZBINIT,182. * The following sizes are adapted to a division size (XCLENG) of 260000 +REP,CBPHYS,ZBINIT,190-192. CALL MZDIV(IXSTOR,IXHTBC,' CBTRBC ', 5000,20000,'F') * global tracking division CALL MZDIV(IXSTOR,IXHTRK,' CBTRAK ', 5000,10000,'R') +REP,CBPHYS,ZBINIT,198. CALL MZDIV(IXSTOR,IXSAVE,' CBSAVE ',100000,160000,'RLC') +REP,LABEL,CBNFIL,0. &DECK,CBNFIL,IF=ALT,DECS,SUN,UNIX. *CMZ : 1.30/00 20/12/95 21.04.29 by Christian Voelcker +ADD,LABEL,CBNFIL,8. * Modifications: * 20/12/95 Christian Voelcker * extract CBNFIL on all UNIX machines, as we have to deal * with the new dlt file structure not only here at CERN! * +DEL,LABEL,CBNFIL,15. +ADD,LABEL,CBRLBL,0. *CMZ : 1.30/00 20/12/95 21.18.11 by Christian Voelcker +REP,LABEL,CBRLBL,13. * Check if there is a standard (IBM) EBCDIC label on the tape +ADD,LABEL,CBRLBL,22. * Chr. Voelcker 20-12-95 * deal with the new data format on tape. * Each run is seen as a seperate file, sandwiched between * a header ('HDR1','HDR2') and a trailer ('EOF1','EOF2') label. * We try to detect them in both EBCDIC and ASCII format * and just skip them, if found. * The first label (if any) always carries the tape volume word * ('VOL1') and the file header words ('HDR1','HDR2'). * If no label found, then we move back to the * begin of the file with 'CBTBOF'. Unfortunately, this * C routine seems only be supported by UNIX systems, so * still something needs to be written for VMS machines. * +REP,LABEL,CBRLBL,29-35. CHARACTER*12 FNAMCB ! to be added to the label common block! LOGICAL LBLDBG INTEGER NWREC, ISTAT INTEGER ELAB1,IER001 SAVE ELAB1,IER001 DATA ELAB1,IER001 /0,0/ DATA LBLDBG /.FALSE./ * *___________________________________ * * set debug flag, if output is required. &SELF,IF=LBLDBG. LBLDBG = .TRUE. &SELF. +REP,LABEL,CBRLBL,44. IF(LBLDBG) WRITE(LTERM,*) 'buffer after read in: ',BUFF(1:NWREC) * * translate the label from EBSDIIC to ASCII, if necessary! IF( (BUFF(1:4) .NE. 'VOL1') .AND. (BUFF(1:3) .NE. 'HDR') & .AND. (BUFF(1:3) .NE. 'EOF') ) THEN CALL TRE0A0(BUFF(1:NWREC),NWREC) IF(LBLDBG) WRITE(LTERM,*) 'buffer after TRE0A0: ',BUFF(1:NWREC) ENDIF +ADD,LABEL,CBRLBL,52. * new file structure, file name in HDR1 record ELSEIF ( BUFF(1:4) .EQ. 'HDR1' ) THEN FNAMCB = BUFF(5:16) WRITE(LLOG,6001) FNAMCB SLBICB = .TRUE. * new file structure, file name in EOF1 record ELSEIF ( BUFF(1:4) .EQ. 'EOF1' ) THEN FNAMCB = BUFF(5:16) WRITE(LLOG,6002) FNAMCB SLBICB = .TRUE. * old file structure, no info from HDR record +ADD,LABEL,CBRLBL,67. * translate into ascii label, if necessary IF( (BUFF(1:4) .NE. 'VOL1') .AND. (BUFF(1:3) .NE. 'HDR') & .AND. (BUFF(1:3) .NE. 'EOF') ) & CALL TRE0A0(BUFF(1:NWREC),NWREC) IF(LBLDBG.AND.(ISTAT .EQ. 0)) & WRITE(LTERM,*) 'next record: ',BUFF(1:NWREC) IF ( BUFF(1:4) .EQ. 'HDR1' ) THEN FNAMCB = BUFF(5:16) WRITE(LLOG,6001) FNAMCB ENDIF +REP,LABEL,CBRLBL,81-83. 6000 FORMAT(/,' *********************************************',/, & ' * Reading data from tape ',A6,' *',/ & ' *********************************************') 6001 FORMAT(/,' *********************************************',/, & ' * Reading next file from tape: ',A12,' *',/ & ' *********************************************') 6002 FORMAT(/,' *********************************************',/, & ' * End of file found on tape: ',A12,' *',/ & ' *********************************************')