SUBROUTINE: QHDTRK PURPOSE: Copy all track specified by the pointer list ILST and the length NE into the common block which fills the track part of the BDC ntuple. in addition the residuals and charge per layer are calculated. The common block seq is +SEQ,BDTRKC. The seq BDTRKB activates the booking. INPUT: NE : number of tracks in list ILST ILST : list of BDC tracks in HDTF RCUT : width for summing charge in R OUTPUT: IERR : error conditions = 1 list larger than length of HDTF SUBROUTINE: QLBDSP PURPOSE: Find all BDC tracks within a radius of DCUT around a line from the vertex to the point ELCOG (COG of the SPACAL e Cluster). All candidates are are sorted with increasing values of the distance. A list ILST of length NTRK is produced which points to the HDTF bank. An ntuple is filled with the resulting Information. The common block seq is called SPBDLC. The seq SPBDLB activates the booking. INPUT: VTX : vertex ELCOG : CoG DCUT : distance OUTPUT: NTRK : number of tracks within DCUT ILST : pointer list to HDTF sorted in distance SPBDLK : coordinates of the closest track DBDSP : distance for the closest track IERR : error flag 0 no error 1 BDC bank not available SUBROUTINE: QLCTBD PURPOSE: Find all BDC tracks within a radius of DCUT around an extrapolated track from the central tracker specified by the DTRA track pointer IVBCK. The distance is calculated at the z value of the BDC track given by the bank HDTF. All candidates are sorted with increasing values of the distance. A list ILST of length NTRK is produced which points to the HDTF bank. An ntuple is filled with the resulting Information. The common block seq is called CTBDLC. The seq CTBDLB activates the booking. INPUT: IVBCK : DTRA track pointer to be extrapolated DCUT : distance OUTPUT: NTRK : number of tracks within DCUT ILST : pointer list to HDTF sorted in distance CTBDLK : coordinates of the closest track DCTBD : distance of the closest track IERR : error flag 0 no error 1 BDC bank not available SUBROUTINE: QLCTBD PURPOSE: Find all BDC tracks within a radius of DCUT around an extrapolated track from the BST specified by the BJKT track pointer ITBJKT. The distance is calculated at the z value of the BDC track given by the bank HDTF. All candidates are sorted with increasing values of the distance. A list ILST of length NTRK is produced which points to the HDTF bank. An ntuple is filled with the resulting Information INPUT: VTX(3) : 3 components of the vertex ITBJKT : BJKT track pointer to be extrapolated DCUT : distance OUTPUT: NTRK : number of tracks within DCUT ILST : pointer list to HDTF sorted in distance BSBDLK : coordinates of the closest track DBSBD : distance of the closest track IERR : error 0 no error 1 BDC bank not available SUBROUTINE QDXBST PURPOSE: Extrapolate BJKT pointer ITRK of the track to the calorimeter octagon and return coordinate, theta and phi. The z position of the backward plane is input variable. INPUT: VTX(3) : vertex ITRK : pointer to the BJKT track ZBCK : Z in backward area OUTPUT: XOUT(3) : coordinates at the plane PHIOUT : phi THEOUT : theta IFLAG : Error flag = 0 without problem = 1 no valid track y SUBROUTINE QHDALR PURPOSE: Get Residuals of the track IRHDTF in HDTF sorted according to layer numbers. The values of the array IVALID are 0 if the hit exists for the track number INPUT: IRHDTF : Pointer to row in HDTF OUTPUT: RESIDU(0:7) : Residuals of layers from 0:7 IVALID(0:7) : = 0 if result is valid for the corresponding layer FUNCTION: QHDSLR PURPOSE: Get Residuals of the track IRHDTF in HDTF of hit in layer ILAYER The value of IVALID is 0 if the hit exists for the track number. INPUT: IRHDTF : Pointer to row in HDTF ILAYER : Layer Number (0:7) OUTPUT: IVALID : = 0 if result is valid for ILAYER QHDARL : Residual of layer ILAYER SUBROUTINE: QHDQTK PURPOSE: Get charge quantities for a given HDTF track. The charge is taken from the bank HEHH of the electron method. The tube in r to sum the charge is the input variable RCUT. In phi PI/4 is used. The total charge and the charge per layer is returned. A validity flag being 0 show if the result in the corresponding layer is ok. INPUT: IRHDTF : Pointer to row in HDTF RCUT : distance in r to sum up the charge OUTPUT: QTOT : total charge QLAY : charge in each layer starting from 0 IVALID : result in QLAY ok, if IVALID = 0 SUBROUTINE QDISTZ PURPOSE: Intercept P1 of a line from XA to XB with a plane at P1(3) = Z0. SUBROUTINE QDXTKZ PURPOSE: Extrapolate DTRA pointer ITRK of the track to the calorimeter octagon and return coordinate, theta and phi. The z position of the backward plane is input variable. INPUT: ITRK : pointer to the DTRA track ZBCK : Z in backward area OUTPUT: XOUT(3) : coordinates at the octagon surface PHIOUT : phi THEOUT : theta IFLAG : Error flag = 0 without problem = 1 extrapolation calculation failed = 2 pt is 0.0 SUBROUTINE: HBDC PURPOSE: H1PHAN example routine. - get vertex - find scattered electron - fill general information into ntuple - find all BDC tracks within a radius of 10 cm fill ntuple with track parameter (ordered in distance) - link BST track with SPACAL cluster - link BST track all BDC tracks within a radius of 5 cm fill ntuple with track parameter (ordered in distance) - fill ntuple with track block from list above SUBROUTINE TSTATC PURPOSE: Get statistical information on data in DATA of length N INPUT N = number of data points DATA = data array of length N OUTPUT INDX= sorted indices of the array DATA AVE = mean AMED= median ADEV= average deviation SDEV= standard deviation SKEW= 3. moment CURT= 4. moment