New   Compton   FADC   DAQ

updated Jan 4, 2007.   by R. Michaels
A new DAQ is being developed to integrate the Compton detector data. The rest is online documentation.

This file: ~apar/doc/fadc_compton.txt   (ASCII)
Update Jan 4, 2007

I. Running CODA
---------------

  1. Login to adaql6 as "apar" account.
       (ask Bob for password)

  2. May want to login to PPC (VME board)

        telnet hatsv5 2005

     If connection refused, must clear the port:
       "telnet hatsv5"   as user=root, passwd=dbps
        then "kill tty=5"
        then "ctrl-]" to get to telnet> then type "q" to quit.


  3. If starting from scratch, type (on adaql6):

             kcoda    (this clears old processes)
   
             rcServer &

             runcontrol

  4. Configs:

          CompSamp  -- accumulates samples

          CompInt   -- zero deadtime integration


  5. Data appears on /adaql6/work1/fadc
     Files are Compton_60124.dat  for run 60124.

     Data are automatically backed up to MSS.


II. Compiling the VME codes
---------------------------

  For both of these you must login to adaql4
  (it is for correct implemenation of vxWorks):

  cd  ~apar/bob/devices/fadc

  Library:   

       Type "make", this compiles sis3320Lib

  CRL code

       Type "./makelist.local vme_sis3320.crl ppc"
   
       and don't forget the dot (.) and slash (/)


III. Data Analysis
-------------------

(This file: ~apar/fadc_ana/README, subject to change !)

Analyzer for the FADC model 3320.

Data analysis for runs produced by the CODA setup.
This reads a CODA file for FADC data and fills ntuples, etc.
The data included:

  1. FADC data in either sampling or integrating mode.
  2. Scalers, including time base, MPS, L1A, and Beam current
  3. Beam Helicity bits (QRT, helicity, MPS).
  4. Real-time Laser info (on/off and polarization state).
  5. EPICS data.

The main codes :

   FA_main1.C  -->  Main code for analysis

   THaEtClient.C THaCodaFile.C THaCodaData.C --> To get raw data
   GenHelicity.C THaEpics.C  --> go get helicity and EPICS data

   libevio.a evio.o swap_util.o  --> utilities for getting data

To compile type "make".

How to analyze the data.

    ./fadcana 1  --> reads data from run.dat (a link to the
                     current datafile, which you must make)
    ./fadcana 2  --> reads data from ET online.

The script "newrun" conveniently makes the links etc.

    ./newrun 60254  --> runs fadcana on run 60254
 -- or --
    ./newrun 60254 2000  --> analyzes 2000 events from run 60254

The result is in the root file fadc_60254.root 

The content of the root file are, typically:

  KEY: TNtuple  fadc;1  FADC Data
  KEY: TH1F     h1;1    FADC event samples
  KEY: TH1F     h2;1    FADC event samples
  (and possibly other histograms).

The ntuple fadc includes the following (subject to change !):

      event    == event number
      evtype   == event type
      mps      == scaler MPS count
      u3       == scaler count of gain x3 BCM
      pulser   == high rate clock for time info
      l1a      == Level-1 accept.
      buflen   == Length of buffer of FADC samples
      na1, na2, ... na6 = number of data in accumulator 1,2,... 6.
      acc1, acc2, ... acc6 = accumulator value for accum 1,2,... 6.
      hel      == beam helicity (1 or 0).
      qrt      == QRT bit
      cavpow   == Real-time Compton cavity power.
      laspol   == Real-time Compton cavity polarization.
      hacbcm   == Beam current from EPICS
      asy      == asymmetry (this will need updating)
      hel1st   == 1st helicity in a pair
      thr1     == threshold 1 in FADC
      thr2     == threshold 2 in FADC

Note, there is a time lag between the EPICS info and the
physics triggers.  To use the EPICS data one should establish
the changes versus event number to judge what the time lag is, 
then cut on the event number.  We recently implemented 
real-time data for laser information, so we can see how this
correlates to EPICS data.


IV. Crude "How-To" about Compton Controls
------------------------------------------

  Turning on LED requires CODA for Compton.

      Login to compton@compton.jlab.org  

      Commands are "coda start"  or  "coda reboot"

      To adjust LED frequency, use "spyconf".

      To adjust LED HV use the EPICS interface

         (on compton)  type "hlamain"

         Select Lecroy HV

         Need beamline crate

            PMT = Slot 11,  chan 1   Voltage typ. 1500  (<= 1600)
            LED = Slot 15,  chan 10  Voltage between 100 & 140