*file member=su_call library=snoman language=inc DATE=17:Dec:2003 * SNOMAN: Software Unit Control: Dispatch to SU. * Contact: N. West, Oxford. * Program Notes:- * ============= * This routine employs the following EXTRACT switches, that control * the automatic disconnection of non-mainstream SUs:- * * NO_DISCON_ECA * NO_DISCON_OCA * NO_DISCON_PCA * * See User Manual, Chapter Adding Code to SNOMAN, subsection Disconnecting * an SU. * * It also contains the EXTRACT switch ANALYSIS_ONLY to exclude any pure * Monte Carlo SU. * * IMPORTANT: When revising the calls to SU xxx in this file, please * ********* create/update xxx_DUMMY.INC (see e.g. FTT_DUMMY.INC). * As a modest concession to efficiency calls to processors come * before (and hence are executed faster than) support systems as * the latter are only called at initialisation and termination phases. * Revision History:- * ================ * 3.00 N. West First version. Factored out of su_call.for. * Rename CNM -> MTT. Add termination call to RAN. * Add MODE to init calls of EIO,FLT,FTT,MCO. Add USR. * Add INP,OUT initialisation routines. Reinstate SDB. * Add ECA, OCA with *IF NO_DISCON_. Add ANALYSIS_ONLY. * Add NTP. * 3.01 N. West Add TCA, PCA, RDV. Add FLT termination. * Don't call USER for SHL calls (see INMAIN, TMMAIN). * S. Biller Removed iproc variable from oca_optical_calib * 3.01 N. Tagg Add FTM. * 3.02 S. Brice Add SML * M. Thorman Add RLG, RLR, RLO. * N. West Add RAA, DMM. Remove *IF XSNOMAN. * N. Tagg Add XED * J. Klein Add TRF * 4.01 G. McGregor Add termination call to PHI. * M. Neubauer Add FTP: Path fitter * J. Klein Add TSP. * M. Boulay Add RSP. Add FTU. * 4.02 N. McCauley Add LSP, FPS * 4.02 A. Hallin Uncomment FTU lines * A. Hallin Add QIO * J. Wilson Add SPS * J. Wilson Add MXF * N. West UPK now has a termination routine. * C. Kyba Add MPC * 5.00 S. Peeters Add NHP ** Call user except for SHL. if ( isu_id .ne. KSU_SHL ) then iuser_mode = mode iuser_retc = iretc call user( isu_id , ioper , KSU_BEFORE_CALL , skip_call ) iretc = iuser_retc if (skip_call ) return endif iretc = 0 * Monte Carlo. if (isu_id .eq. KSU_MCO) then *IF ANALYSIS_ONLY THEN *$ continue *ELSE if (ioper .eq. KSU_INITIALISE) then call inmco(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call mcmain(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmmco(iretc) endif *ENDIF * Event Input. elseif (isu_id .eq. KSU_INP) then if (ioper .eq. KSU_INITIALISE) then call inp_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call eio_evread(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then continue endif * Event Output. elseif (isu_id .eq. KSU_OUT) then if (ioper .eq. KSU_INITIALISE) then call out_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call eio_evwrite(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then continue endif * Energy calibration (RSP) elseif ( isu_id .eq. KSU_RSP ) then if (ioper .eq. KSU_INITIALISE .or. ioper .eq. + KSU_REINITIALISE ) then call rsp_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call rsp_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call rsp_trm(iretc) endif * Event Fitters. elseif (isu_id .eq. KSU_FT1) then if (ioper .eq. KSU_INITIALISE) then call ft1_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ft1_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ft1_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ft1_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FT2) then if (ioper .eq. KSU_INITIALISE) then call ft2_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ft2_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ft2_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ft2_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FT3) then if (ioper .eq. KSU_INITIALISE) then call ft3_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ft3_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ft3_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ft3_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTE) then if (ioper .eq. KSU_INITIALISE) then call fte_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call fte_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call fte_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call fte_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTT) then if (ioper .eq. KSU_INITIALISE) then call ftt_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftt_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftt_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftt_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTQ) then if (ioper .eq. KSU_INITIALISE) then call ftq_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftq_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftq_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftq_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTG) then if (ioper .eq. KSU_INITIALISE) then call ftg_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftg_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftg_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftg_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTM) then if (ioper .eq. KSU_INITIALISE) then call ftm_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftm_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftm_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftm_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTP) then if (ioper .eq. KSU_INITIALISE) then call ftp_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftp_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftp_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftp_fitter_trm(iretc) endif elseif (isu_id .eq. KSU_FTU) then if (ioper .eq. KSU_INITIALISE) then call ftu_fitter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ftu_fitter(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call ftu_fitter_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call ftu_fitter_trm(iretc) endif * Event Classifier elseif (isu_id .eq. KSU_CLN) then if (ioper .eq. KSU_INITIALISE) then call cln_classifier_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call cln_classifier(mode,iretc) elseif (ioper .eq. KSU_DELETE) then call cln_classifier_del(iretc) elseif (ioper .eq. KSU_TERMINATE) then call cln_classifier_trm(iretc) endif * Event Viewer. elseif (isu_id .eq. KSU_VIW) then if (ioper .eq. KSU_INITIALISE) then call inviw(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call evview(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmviw(iretc) endif * XSNOED Event Viewer elseif (isu_id .eq. KSU_XED) then if (ioper .eq. KSU_INITIALISE) then call xed_xsnoman_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call xed_xsnoman_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call xed_xsnoman_trm(iretc) endif * Event Analyser. elseif (isu_id .eq. KSU_ANL) then if (ioper .eq. KSU_INITIALISE) then call inanl(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call evanal(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmanl(iretc) endif * Time Correlation Analyser elseif (isu_id .eq. KSU_TCA) then if (ioper .eq. KSU_INITIALISE) then call tca_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call tca_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tca_trm(iretc) endif * Random Access Analyser elseif (isu_id .eq. KSU_RAA) then if (ioper .eq. KSU_INITIALISE) then call raa_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call raa_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call raa_trm(iretc) endif * Event Histogrammer. elseif (isu_id .eq. KSU_HST) then if (ioper .eq. KSU_INITIALISE) then call inhst(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call evhist(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmhst(iretc) endif * Event Unpacker. elseif(isu_id .eq. KSU_UPK) then if (ioper .eq. KSU_INITIALISE) then call upk_unpacker_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call upk_unpacker(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call upk_unpacker_trm(iretc) endif * Event Packer. elseif(isu_id .eq. KSU_PCK) then if (ioper .eq. KSU_INITIALISE) then call pck_packer_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call pck_packer(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call pck_packer_trm(iretc) endif * Event Filter. elseif(isu_id .eq. KSU_FLT) then if (ioper .eq. KSU_INITIALISE) then call flt_filter_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call flt_filter(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call flt_filter_trm(iretc) endif * Event Calibration. elseif(isu_id .eq. KSU_CAL) then if (ioper .eq. KSU_INITIALISE) then call cal_calibration_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call cal_calibration(mode,iretc) endif * Event Uncalibration. elseif(isu_id .eq. ksu_ucl) then if (ioper .eq. KSU_INITIALISE) then call ucl_uncalibration_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call ucl_uncalibration(mode,iretc) endif * * Event Pruner. elseif(isu_id .eq. KSU_PRU) then if (ioper .eq. KSU_INITIALISE) then call pru_pruner_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call pru_pruner(mode,iretc) endif * First Pass Run Selection. elseif(isu_id .eq. KSU_FPS) then if (ioper .eq. KSU_INITIALISE) then call fps_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call fps_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call fps_trm(iretc) endif * Second Pass Run Selection. elseif(isu_id .eq. KSU_SPS) then if (ioper .eq. KSU_INITIALISE) then call sps_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call sps_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call sps_trm(iretc) endif * MXF - maximum likelihood fitter elseif (isu_id .eq. KSU_MXF) then if (ioper .eq .KSU_INITIALISE) then call mxf_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call mxf_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call mxf_trm(iretc) endif * SNOMAN Live. elseif(isu_id .eq. KSU_SML) then if (ioper .eq. KSU_INITIALISE) then call sml_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call sml_update(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call sml_trm(iretc) endif * Runlog generator elseif(isu_id .eq. KSU_RLG) then if (ioper .eq. KSU_INITIALISE) then call rlg_runlog_gen_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call rlg_runlog_gen_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call rlg_runlog_gen_trm(iretc) endif * Runlog reader elseif(isu_id .eq. KSU_RLR) then if (ioper .eq. KSU_INITIALISE) then call rlr_runlog_read_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call rlr_runlog_read_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call rlr_runlog_read_trm(iretc) endif * Runlog output elseif(isu_id .eq. KSU_RLO) then if (ioper .eq. KSU_INITIALISE) then call rlo_runlog_out_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call rlo_runlog_out_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call rlo_runlog_out_trm(iretc) endif * Livetime Summary elseif(isu_id .eq. KSU_LSP) then if (ioper .eq. KSU_INITIALISE) then call lsp_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call lsp_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call lsp_trm(iretc) endif * QIO processor. elseif(isu_id .eq. KSU_QIO) then if (ioper .eq. KSU_INITIALISE) then call qio_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call qio_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call qio_trm(iretc) endif * User processor. elseif(isu_id .eq. KSU_USR) then if (ioper .eq. KSU_INITIALISE) then call usr_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call usr_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call usr_trm(iretc) endif * NCD Histogram Producer elseif(isu_id .eq. KSU_NHP) then if (ioper .eq. KSU_INITIALISE) then call nhp_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call nhp_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call nhp_trm(iretc) endif * Raw Data Validation. elseif(isu_id .eq. KSU_RDV) then if (ioper .eq. KSU_INITIALISE) then call rdv_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call rdv_raw_data_validation(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call rdv_trm(iretc) endif * Data Mask Manager. elseif(isu_id .eq. KSU_DMM) then if (ioper .eq. KSU_INITIALISE) then call dmm_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call dmm_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call dmm_trm(iretc) endif * Electronics Calibration. *IF NO_DISCON_ECA THEN elseif(isu_id .eq. KSU_ECA) then if (ioper .eq. KSU_INITIALISE) then call eca_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call eca_electronics_calib(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call eca_trm(iretc) endif *ENDIF * PMT Calibration. *IF NO_DISCON_PCA THEN elseif(isu_id .eq. KSU_PCA) then if (ioper .eq. KSU_INITIALISE) then call pca_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call pca_pmt_calibration(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call pca_trm(iretc) endif *ENDIF * Optical Calibration. *IF NO_DISCON_OCA THEN elseif(isu_id .eq. KSU_OCA) then if (ioper .eq. KSU_INITIALISE) then call oca_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call oca_optical_calib(iretc) elseif (ioper .eq. KSU_TERMINATE) then call oca_trm(iretc) endif *ENDIF elseif(isu_id .eq. KSU_TRF) then if (ioper .eq. KSU_INITIALISE) then call trf_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call trf_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call trf_trm(iretc) endif elseif(isu_id .eq. KSU_TSP) then if (ioper .eq. KSU_INITIALISE) then call tsp_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call tsp_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tsp_trm(iretc) endif * Multiphoton PCA elseif(isu_id .eq. KSU_MPC) then if (ioper .eq. KSU_INITIALISE) then call mpc_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then call mpc_exe(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call mpc_trm(iretc) endif * PMT Calibration. * ZEBRA Memory Manager. elseif (isu_id .eq. KSU_ZBR) then if (ioper .eq. KSU_INITIALISE) then call inzebr(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmzebr(iretc) endif * Management of Titles. elseif (isu_id .eq. KSU_MTT) then if (ioper .eq. KSU_INITIALISE) then call mt_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call mt_trm(iretc) endif * Generic FZ Input Output. elseif (isu_id .eq. KSU_SIO) then if (ioper .eq. KSU_INITIALISE) then call sio_ini(mode,iretc) elseif (ioper .eq. KSU_PROCESS) then continue elseif (ioper .eq. KSU_TERMINATE) then continue endif * File Input Output Support. elseif (isu_id .eq. KSU_FIO) then if (ioper .eq. KSU_INITIALISE) then call fio_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then continue endif * Event Input Output Support. elseif (isu_id .eq. KSU_EIO) then if (ioper .eq. KSU_INITIALISE) then call eio_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call eio_trm(iretc) endif * Detector Geometry. elseif (isu_id .eq. KSU_GEO) then if (ioper .eq. KSU_INITIALISE) then call ingeo(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then continue endif * Physics Interactions. elseif (isu_id .eq. KSU_PHI) then if (ioper .eq. KSU_INITIALISE) then call inphi(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmphi(iretc) endif * PMT Simulation. elseif (isu_id .eq. KSU_PMT) then if (ioper .eq. KSU_INITIALISE) then call inpmt(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call tmpmt(iretc) endif * HBOOK Support elseif (isu_id .eq. KSU_HBK) then if (ioper .eq. KSU_INITIALISE) then call hbk_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call hbk_trm(iretc) endif * Data Structure Manager. elseif (isu_id .eq. KSU_DSM) then if (ioper .eq. KSU_INITIALISE) then call dsm_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call dsm_trm(iretc) endif * Random Number Generator. elseif (isu_id .eq. KSU_RAN) then if (ioper .eq. KSU_INITIALISE) then call snoran_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call snoran_trm(iretc) endif * SNOMAN Database Interface. elseif (isu_id .eq. KSU_SDB) then if (ioper .eq. KSU_INITIALISE) then call sdb_ini(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call sdb_trm(iretc) endif * N-tuple Generator. elseif (isu_id .eq. KSU_NTP) then if (ioper .eq. KSU_INITIALISE) then call ntp_init(mode,iretc) elseif (ioper .eq. KSU_TERMINATE) then call ntp_term(iretc) endif * Shell - dummy, needed only for consistency of SU definition. elseif (isu_id .eq. KSU_SHL) then continue * None of the above! else call su_disconnected_called(isu_id,ioper,mode,iretc) endif ** Call user except for SHL. if ( isu_id .ne. KSU_SHL ) then iuser_mode = mode iuser_retc = iretc call user( isu_id , ioper , KSU_AFTER_CALL , skip_call ) iretc = iuser_retc endif *endfile member=su_call