Data Acquisition using CODA

The following instructions were prepared by Alex Somov. They explain how to get a simple data acquisition setup to collect spectra from one flash ADC being triggered by an external source and saving data to an external disk file in CODA format.

Instructions for starting the DAq
In the DAQ crate we are using an old Trigger Interface (TI) board, i.e. the triggers are distributed through front pannels. The SDC board is used for the trigger and clock distributions to fadc250.

 Boards in the crate

Front pannel connections

Setting up the setup


 * Connect keybord and monitor (if needed) to the Intel ROC.
 * Connect Ethernet cable to the upper ROC LAN connector.
 * Change ROC IP address (you will see the MAC address when you start booting the controller)
 * Login under halld

 Directories 

Most DAQ files (CODA), the Run Control and other applications have been installed locally on the ROC flash disc. You will need to mount the remote data disc to store data files.

Below is a description of some directories:


 * The home directory is /home/halld
 * /home/halld/micro/rol contains the F1TDC configuration file and the link to the DAC readout list (see descriptions below)
 * /home/halld/micro/coda contains Run Control data base
 * /home/halld/data is a directory for the DAQ data storage. The external drive has to be mounted to here
 * /home/halld/micro/coda_micro_setup is a script with configuration variables
 * you have to edit this file ad change some variables if needed
 * source coda_micro_setup to set variables up
 * Coda and Run Control files are installed at /usr/local/coda/2.6.1

 How to run DAQ  select corresponding DB RunTypes
 * 1) Launch database daemon
 * 2) * After changing the ROC hostname, the Run Control database (where the host name is used) has to be updated.
 * 3) * Login to the controller under halld and set up environmental variables ( source coda_micro_setup )
 * 4) * start mysql deamon by typing msqld ( be sure that only one msqld is running)
 * 5) * use cedit to change host names for the event builder (EB5) and coda ROC (TROC5)
 * 6) ** to do this, select File->Open Database->micro_test and  File->Open->Run Type->simple  and click on EB5 and TROC5 components
 * 7) * msqld has to be running all the time when you run DAQ
 * 8) Launch Afec-1.4 platform
 * 9) * login to the ROC  under  halld
 * 10) * type 'platform'
 * 11) Start event builder
 * 12) * login to the ROC  under  halld
 * 13) * coda_eb_rc3 -i  -s  simple  -n  EB5  -t  CDEB
 * 14) Launch coda_roc on the Linux controller
 * 15) * login to the ROC under halld
 * 16) * coda_roc_rc3 -i -s simple -n TROC5 -t  ROC
 * 17) Launch Run Control  GUI
 * 18) * login to the ROC  under  halld
 * 19) * type 'rcgui'
 * Select 'Sessions -> simple'
 * Select 'Configurations -> Cool -> simple' (see top menu)
 * Press buttons: Configure, Download, Prestart, Go (you start the run)
 * 1) * Note, every time you change the database (like a hostname) you have to import it to the Run Control. To do this, in the rcgui click Options->Coda2 Database->RunTypes and

 Change electronics boards initialization parameters 
 * The initialization of electronics modules and reading out data from FADC250 and F1TDC is handled by:
 * /usr/local/coda/2.6.1/extensions/fadcV2/v2.0/rol/fadc_list.c
 * see the code for definition of most parameters


 * If you change some parameters, you will need to recompile this program: make clean; make

 Event analizer
 * You can find an example of the simple event analyzer at JLab:
 * ifarml64:/group/halld/Subsystems/trigger/uconn


 * Copy this directory and /group/halld/Subsystems/trigger/coda (directory with evio libs) to your local place
 * Copy and modify accordingly the script file with environmental variables /group/halld/Subsystems/trigger/set_env
 * Use make to compile
 * ucon data_file will create a simple root file
 * see code for details