subroutine hec_online c c This is the routine which controls the online running mode c of hec_adc. The purpose of this mode is to use hec_adc standard c routines for signal reconstruction, pedestal evaluation, etc. c to fill several histograms which are useful to the testbeam shift c crew. It does this as quickly as possible by fast filling histograms c and using only one loop over the data. It can be run on existing c data files or files which are in the process of being written by the c testbeam DAQ. c c Online mode is designed to either be entered from the command c line (by typing hec_adc) or from a script as determined by the c "autorun" datacard. This allows scripts to be written which control c system-dependent things (eg. printer commands) allowing the fortran c code in hec_adc to remain completely f77-compliant. c implicit none c c user datacard values common c include'hec_par.inc' !shared parameters include'hec_datacard.inc' ! datacard values include'hec_online.inc' ! online common c c enter online mode if requested c if (run_mode .ne. 2) return c print *, ' *** starting online analysis' c c initialize for online running c call hec_online_ini c c start main menu (prompt user for run number to analyze) c irun = -1 c do while (irun .ne. 0) c c get file name to analyze and check for its existence c call hec_online_getfile c c if file found, start hec_adc analysis c if (runfile .and. irun .ne. 0) then c print *, ' *** Found data file ',infname, + ' starting analysis' c c initialize arrays for this run c call hec_online_run_ini c c get the maximum number of events to process c call hec_online_getnevt c c get trigger request from user (what do they want to see) c call hec_online_gettrig c c in order to book histograms run header info is needed c make a quick pass to get it c call hec_runh_pass c c quick pass on data to get slow control infos if requested c call hec_slow_pass c c book online histograms that are filled event by event c call hec_his_ini c c pass over data c call hec_online_pass1 c c open online histogram file and allow viewing of histos c call hec_online_ter c endif c c if program is in "autorun" mode, do not request more than one consecutive c run, the controlling script will do that for you c if (auto_run .ge. 1) then irun = 0 endif c enddo end