#### DAQ for muTr ( MJL -- 4/8/01)

-   Rack power that needs to be on is :

-   Rack 1 - ARCNet & Ethernet hubs (turn this rack on first)

-   Rack 2 - LV power-supply crates. Should determine which crate
    contains Glink/Clink channels that you need and which one provides
    FEM LV and have them on.

-   Rack 3 - Slow-Controls crate needs to be on and Calibration/T+FC
    fanout crate needs to be on. If you want fans on Glink/Clink crates
    on, this power comes from here too.

-   Turn on LV to Glink/Clink crate and FEM's:

-   Rack Monitoring System in Control room is used to turn on individual
    power supplies on the rack. The different power supplies in this
    interface have been labeled as to which FEM's and which Glink/Clink
    crates they are connected to.

-   Here is a synopsis of Steve Pate\'s LV turn-on instructions that you
    need to follow next to turn on particular LV channels (from
    [http://www.phenix.bnl.gov/WWW/publish/pate/muon/lvd/epics_lvd.html](http://www.phenix.bnl.gov/WWW/publish/pate/muon/lvd/epics_lvd.htm:)

-   ssh into the phnxmutr account on one of the Solaris machines in 1008
    (e.g. phoncs0)

-   in \~phnxmutr/epics do a "source setup_epics"

-   Make sure no one else is running the control software:

-   ps --uphnxmutr \| grep medm

-   cd muon_anc/app/lvd/medm/adl

-   medm -x lvd.adl &

-   either turn on individual channels by clicking on the \"Channel
    States\" button or turn on all channels in a group by clicking on
    the Enable button and selecting Enable All

-   Turn on the Glink/Clink crate LV first as this seems to avoid
    problems with unlocked glink's bringing down power regulator
    channels

-   Octant 7 & 8 FEE LV can only be turned off using the LV distribution
    control since there is currently a bug in the power supply control
    for these power supplies.

-   Log on to phoncs0 under the phoncs account

-   Type \"setuponcs\" to set up your environment properly

-   Start the ARCNet download program by typing \"feed.pl\" (one button
    for all South arm) or "mutr.pl" (separate buttons for station-1, 2
    and 3) and click button(s) to send ARCNet initialization commands
    for the whole arm or for each station.

-   Make sure you get no errors (warning, it seems that if the program
    is already running when you power-up, the first time you click this
    button you may get some errors, but the second time you click it you
    will get no errors if your ARCNet chain is set up properly). If you
    get no errors the second time, all is well.

-   Log file is \$ONLINE_LOG/arcnet/\*.log.

-   The actual control files activated by the buttons are in
    \$ARCNET_DATA/mutr/acf and are smt_123_init.acf, smt_1_init.acf,
    smt_2_init.acf and smt_3_init.acf; and these reference hex files in
    \$ARCNET_DATA/mutr/hex.

+---------+----------------+---------------------------+--------------+
| ##      | ##### GTM      | ##### DCM                 | ##### Busy   |
| ### Sta |                |                           |              |
+---------+----------------+---------------------------+--------------+
| 1       | MUTR           | 2b (shared with MUID)     | 18           |
+---------+----------------+---------------------------+--------------+
| 2       | MUTR           | 2c                        | 18           |
+---------+----------------+---------------------------+--------------+
| 3       | MUTR           | 2d                        | 18,18        |
+---------+----------------+---------------------------+--------------+

-   Start the GTM control program by typing \"gtm GTM.MUTR.S". Usually
    at beginning of data collection issue a Scheduler Reset, START,
    Glink Reset.

-   We are using one GTM for muTr (#18).

-   The busy's for the GTM must be connected to the 4 DCM busy outputs
    in the DCM crates.

-   Clock source should be "internal", and "local forced accept",
    "level-1 block" should be on (yellow) and to take events "VME busy"
    should be green.

-   The first time you try to start the gtm you may have to try twice
    before it works.

-   To start DCM data collection program:

-   log onto phnxmutr account on phoncs0

-   type \"setuponcs\"

-   prepare the DCM configuration:

-   cd to /export/software/oncs/online_configuration/rc/hw

-   ./process_pcf_file mutr.s.pcf.BASE.norm.all (for old
    non-zero-suppressed mode)

-   the configuration files w/o "norm" in the name are for Jamie's new
    zero-suppressed format.

-   cd /export/software/oncs/online_configuration/rc/hw (?)

-   start a terminal window with "ts iocondev2b" for each of
    iocondev2b,c,d so you can see what each is doing and see any errors.

-   type \"dcm MUTR.S\" and DCM program should start.

-   If necessary you can check whether iocondev2b,c,d are alive by
    pinging from phoncs11.

-   Answer questions 0 (interactive).

-   Set configuration file by typing \"301\".

-   Load configuration file by typing \"303\"

-   Type \"25\" to verify all DCM's locked (if all is ok you will get no
    error).

-   Type \"305\" to collect data. Data file should go into
    /export/scratch0/mutr directory.

-   Data is written to four files, e.g. if you give the name "junk1.dat"
    then data will be written to the files junk1.dat.0, junk1.dat.1,
    junk1.dat.2 and junk1.dat.3 (for stations-1, 2, 3a & 3b respectively
    -- station-3 is split into two parts).

-   These files can be combined after the run is over using
    evencombiner, e.g. "eventcombiner junk1.prdf junk1.dat.0 junk1.dat.1
    junk1.dat.2 junk1.dat.3" will combine these three files into one
    prdf file.

-   If you are using the calibration system to pulse the chambers you
    can control the amplitude and which gaps are pulsed through ARCNet.

```{=html}
<!-- -->
```
-   See
    [http://www.phenix.bnl.gov/WWW/publish/leitch/mutrfee/calib_arcnet.txt](http://www.phenix.bnl.gov/WWW/publish/leitch/mutrfee/)
    where use of a program (phoncs0:/home/phoncs/mutr/mjl/calib) which
    sets the configuration is described. This program sets the
    calibration configuration and does serial string downloads of this
    configuration to the FEM's so this information will be included in
    the user words in the datastream.

```{=html}
<!-- -->
```
-   Only pulse up to 8 gaps simultaneously because of a limit on total
    output pulse power; however if you are not concerned about ultimate
    accuracy of the pulse amplitude you can pulse a whole station at
    once.

-   For checking whether all strips are working and looking for dead
    channels it is easiest to pulse all gaps at once; so give an
    amplitude of 0x40 and station, octant, gap of "0 0 0".

-   A GTM file that includes the calibration mode bits must be use, e.g.
    GTM.MUTR_10HZ_CALI.gtm

-   An automatic calibration procedure has recently been worked out that
    takes a series of runs with different calibration settings. It uses
    Steve Adler's command line interface for run control.

-   Log into <phoncs@phoncs0> and find /home/phoncs/mutr/mjl/calib.csh.

-   calib.csh is a script that loops over a set of stations, octants &
    gaps; configures the calibration system & downloads the
    configuration to the FEM's via arcnet for each setting, takes a run
    for a certain amount of time and cycles.

-   The DCM configuration is currently prepared as outlined above, i.e.
    in the same way as for normal data taking.

-   Output goes to /export/bigdisk/calibdata/rc-00nnnnn-MUTR.S-x.prdf
    where nnnnn is a series of run numbers & x is 0, 1, 2, 3 for
    stations 1, 2, 3a, 3b.

-   Presently this takes about 3 minutes per cycle.

-   Recently a new JAVA interface is available (thanks to Andrew) to
    control the calibration system:

-   Log in to phnxmutr on phoncs0 and cd to
    /home/phnxmutr/ANDREW/CORBA/JAVA/PROD and source setup.com

-   Cd src and type "runclient.csh MUTRarcnetApplication"

-   Enter the device "CAL.MUTR.S.0" and type return.

-   Click on the calibration (for non-experts) button on the main
    control panel to start the calibration control panel

-   Then enter the station, octant and gap as well as DAC amplitude (in
    decimal) to pulse with and then "send". The standard DAC value has
    been decimal 64 (or 0x40).

-   If data collection is successful, ddump data to verify header words
    and data look correct, master and slave data are coming out... If
    data collection is not successful, need to determine which FEM is
    not reading out, check T+FC going in to chassis, check DCM light
    coming out into counting house, make sure power to FEM, make sure
    you did the ARCNet download on power-up, make sure you have properly
    set the DCM configuration file for master chassis or master+slave
    chassis, ...

-   e.g. ddump --f mjl.dat.3

-   To take calibration data:

-   To analyze the data you have taken in order to see noise levels,
    etc:

-   Log onto phoncs11 (or ?) and setuponcs

-   cd /home/phnxmutr/mutr_test

-   start root

-   .L mutr_pros_allchn.C

-   mutr_pros_all("scr/name-of-your-data-file.dat",11011,80,10)

-   scr presently points to /export/scratch0/mutr

-   where 11011 is the packet ID for a certain (half) chassis (see
    <https://www.phenix.bnl.gov:8080/phenix/WWW/muon/mutr_fee/status.txt>

-   80 is the number of events to analyze

-   and 10 is the vertical scale for the histogram.

-   If you give an incorrect filename root will not work properly until
    you exit and restart root.

-   If the data is good you should see peaks at 6, 9 & 11 in the
    histogram of the "cell differences".

-   Other histograms show the rms and avg values versus channel number.

```{=html}
<!-- -->
```
-   or to see a whole station or whole octant at once

-   .x check_station.C("scr/s2-calib-9dec.dat",2,80,20)

-   .x plot_station.C("s2 calib",2)

-   .x check_octant.C("scr/s2-calib-9dec.dat",2,4,80,20)

-   .x plot_octant.C("s2 o4 calib",2)

-   if you want to see rms noise and adc counts versus strip number use
    the check_octant and plot_octant in the \~phnxmutr/mjl/root
    directory

-   A small macro strip2chan.C can be used to determine for a certain
    range of strips what chassis and backplane channels these correspond
    to; e.g. this is helpful when you want to find the analog cable in
    question and check for a loose connection. E.g.

-   .x strip2chan.C(3,1,0,0,15)

> finds the chassis ID and backplane channels associated with station-3
> octant-1 plane-0 strips 0 -- 15.