+DECK,TCAVT0V. SUBROUTINE TCAVT0V (AvT0_FADC, AvT0_ZbyT, DriVel, iErr) * * Get CTD global T0s from CTD calibration GAF. (JBL et al 23Apr96) * And CTD drift velocity. (JBL 9Sep99) * Initialisation routine e.g. to be called at event initialisation. * * Note: global T0s and drift velocity for real data are stored in * the VCTRAK calibration GAF, so this routine is mainly useful for * Monte-Carlo data. * * AvT0_FADC : average FADC T0 in nsec * AvT0_ZbyT : average ZbyT T0 in nsec (all wires the same value) * DriVel : Drift Velocity in cm/ns * IMPLICIT NONE REAL AvT0_FADC, AvT0_ZbyT, DriVel INTEGER iErr, jCali, I * +SEQ,TCCWIR. +SEQ,TCTTOD. +SEQ,PARTAP. * AvT0_FADC = 0. AvT0_ZbyT = 0. DriVel = 0. * * Load into memory the Dataflow for TCCWIR from GAF * Call TCGAFCATa ('CTDCalibrationA01', jCali, iErr) If (iErr.NE.0) RETURN * * Copy of some code from TCVCAL in VCTRAK... C ZbyT T0 comes from the first TCCWIR row as a global T0... C CALL FETTAB(TCCWIR,ID,1) AvT0_ZbyT = TCCWIR_T0Z * 48.0 C C Loop over TCCWIR table to get global FADC T0... C AvT0_FADC = 0. if(COUTAB(TCCWIR).gt.0)then DO 50 I=1,COUTAB(TCCWIR) CALL FETTAB(TCCWIR,ID,I) AvT0_FADC = AvT0_FADC + TCCWIR_T0RP 50 CONTINUE AvT0_FADC = AvT0_FADC * 2.4 / FLOAT(COUTAB(TCCWIR)) endif C C Nominal drift velocity (hi- & lo-phi of sense wire are same value) C Call TCGAFCATa ('CTDCalibrationA04', jCali, iErr) If (iErr.NE.0) RETURN CALL FETTAB(TCTTOD,ID,1) DriVel = TCTTOD_TtoDHiFi(1) * 0.0001 RETURN END +DECK,TCGAFCATa. TCGAFCAT 1995 version Subroutine TCGAFCATa (Name, Number, iCode) * *----------------------------------------------------------------------- * * Load a Dataflow into memory from a GAF via the Catalogue. * * J.B.Lane 10Nov95 First version: reshuffle Julian's code. * * Get the GAF valid for the event's date and time. * ZDCHEK and ZDFET take care of MozForce. * In Mozart this gets called before the first event... * we may use Target_DateTime (also some ZDIS files have INULL). * * Name : input Name of Dataflow to be loaded * Number : output Version number of Dataflow loaded * iCode : output ZDFET error code (OK = 0) * *----------------------------------------------------------------------- * Implicit NONE Character*(*) Name Integer Number, iCode Integer DateTime(2) * +SEQ, ZREVT. +SEQ, ZGEDAT. +SEQ, ZDLOAD. +SEQ, PARTAP. * If (ZREVT_Time(1).EQ.0 .OR. ZREVT_Time(1).EQ.INULL) Then DateTime(1) = Target_DateTime(1) DateTime(2) = Target_DateTime(2) Else DateTime(1) = ZREVT_Time(1) DateTime(2) = ZREVT_Time(2) EndIf * Call ZDCHEK (Name, DateTime, iCode) If (iCode.EQ.1) Call ZDFET (Name, DateTime, iCode) Number = ZDLOAD_DflinC Return End