Project

General

Profile

Wiki » History » Version 14

« Previous - Version 14/16 (diff) - Next » - Current version
Vivian O'Dell, 10/22/2019 02:30 PM


Mu2e otsdaq Tracker

Quickstart instructions:

This code is an extension of the OTS-DAQ project and requires it to function. To setup OTS-DAQ use the instructions listed here for installing the core OTS-DAQ packages. This must be done first! Once the OTSDAQ core dependencies are set up, the mu2e otsdaq Tracker interface code can be included.

If you are one of the project managers and plan on making modifications to the code, you can checkout the repository doing the following assuming you have valid kerberos credentials,

cd $MRB_SOURCE # this is the 'srcs' directory that will be set in the course of setting up OTS-DAQ
mrb gitCheckout -d otsdaq_mu2e ssh://p-mu2e-otsdaq@cdcvs.fnal.gov/cvs/projects/mu2e-otsdaq
mrb gitCheckout -d pcie_linux_kernel_module ssh://p-pcie_linux_kernel_module@cdcvs.fnal.gov/cvs/projects/pcie_linux_kernel_module
mrb gitCheckout -d otsdaq_mu2e_tracker ssh://p-mu2e-otsdaq-tracker@cdcvs.fnal.gov/cvs/projects/mu2e-otsdaq-tracker

Otherwise, you can just clone the directory using the http sever,

cd $MRB_SOURCE # this is the srcs directory that will be set in the course of setting up OTS-DAQ
mrb gitCheckout -d otsdaq_mu2e_tracker http://cdcvs.fnal.gov/projects/mu2e-otsdaq-tracker

Alternatively, if you do not have mrb set up, you can check out the code using git directly,

git clone http://cdcvs.fnal.gov/projects/otsdaq_mu2e otsdaq_mu2e
git clone http://cdcvs.fnal.gov/projects/pcie_linux_kernel_module pcie_linux_kernel_module

#write access
git clone ssh://p-mu2e-otsdaq-tracker@cdcvs.fnal.gov/cvs/projects/mu2e-otsdaq-tracker otsdaq_mu2e_tracker 

#read only
git clone http://cdcvs.fnal.gov/projects/mu2e-otsdaq-tracker otsdaq_mu2e_tracker

If you don't checkout using ssh, you will not be able to push your changes to redmine.

Once the package is checked out or if you are starting a new session, source the environment,

source /path/to/products/area/setup # e.g. /data/ups/setup
cd my/mrb/working/directory # this is where localProducts_otsdaq_* and srcs resides
setup mrb
setup git
source local*/setup
source mrbSetEnv

Structure

Ideally, everything that is needed for a user to run OTSDAQ will be contained in the otsdaq_mu2e_calorimeter directory and the code in otsdaq, otsdaq_utilities, and otsdaq_components will not need to be touched. If there is a situation where you wish to modify part of the core code, it is advised to put in a request with one of the maintainers (Lorenzo, Ryan, or Eric).

Below is a summary of some of the parts that will need to be modified in order to set up communication with the experimental device.

Interface

The FEInterface class tells OTSDAQ how to communicate with front end electronics and is found in

otsdaq_mu2e_tracker/otsdaq-mu2e-tracker/FEInterfaces/
. All of the methods defined in the interface source can be called from the OTSDAQ web interface...

Test Stand at FCC

The DRAC (Tracker ROC) is connected to ROC1 of DTC1 (of course, this could change). The ROC firmware can load patterns into the DAQFIFO for testing the DAQ chain. To start up the ROC data handling, you have to run scripts that tell the ROC firmware what to do. These scripts use a serial port on the DRAC board and can be run from any computer that has python installed (i.e. laptop, etc.) Below is the prescription for installing and running the scripts.

Installing the tracker ROC scripts

The tracker scripts are in git.

mkdir TestStand        
cd TestStand
git clone https://github.com/bonventre/trackerScripts
cd trackerScripts
git branch -a
* ROCCALHV_1FIFO
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/ROCCALHV_1FIFO
  remotes/origin/ROCHVCAL
  remotes/origin/ROC_only
  remotes/origin/bus32bit
  remotes/origin/master

git checkout ROCCALHV_1FIFO
Branch 'ROCCALHV_1FIFO' set up to track remote branch 'ROCCALHV_1FIFO' from 'origin'.
Switched to a new branch 'ROCCALHV_1FIFO'

Serial Support:
You may have to download a driver for usb – serial support on your machine. You can find it here:
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
Follow the directions on the web page for your machine.

Running the tracker scripts

Connect your usb port to the serial port on the DRAC board (the one labeled "debug ports"). Then:

cd ~/TestStand/trackerScripts
python control_ROC.py
reading
Waiting for ARM to connect
==========================
Connected to ARM on /dev/tty.SLAB_USBtoUART

Now you are ready to talk to the firmware. There are a bunch of ADCs on the board. The first step is to align them. To align e.g. ADC 1 type:

find_alignment -ch 1
103 902
902
DOPHASE 1
Ch       NumEnofTrgr  BestClock    Results0(0x) Results3(0x) Results6(0x)
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
31       12           3            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
0        0            0            0x0          0x0          0x0         
FindAlignmentSuccess
Ch[00:07] 0b0
Ch[08:15] 0b0
Ch[16:23] 0b0
Ch[24:31] 0b10000000
Ch[32:39] 0b0
Ch[40:47] 0b0
Ch[48:55] 0b0
Ch[56:63] 0b0
Ch[64:71] 0b0
Ch[72:79] 0b0
Ch[80:87] 0b0
Ch[88:95] 0b0
MixedFreqAdcCheck
Ch[00:07] 0b0
Ch[08:15] 0b0
Ch[16:23] 0b0
Ch[24:31] 0b10000000
Ch[32:39] 0b0
Ch[40:47] 0b0
Ch[48:55] 0b0
Ch[56:63] 0b0
Ch[64:71] 0b0
Ch[72:79] 0b0
Ch[80:87] 0b0
Ch[88:95] 0b0
ChannelsW/EnoughTriggers 96
ErrorMask[00:31] 0x0
ErrorMask[32:63] 0x0
ErrorMask[64:95] 0x0

Don’t ask me what it means. The key phrase is “FindAlignmentSuccess”

To start up the event running type:

read -t 0 -p 1 -T 10 -s 20 -l 10 -a 1 -ch 1
OPENING FILE run_2.txt
105 35
{'AdcMode': 1,
 'Ch_mask1': '0b10',
 'Clock': 99,
 'EnablePulser': 1,
 'Mode': 0,
 'NumLookback': 10,
 'NumSamples': 20,
 'NumTriggers': 10,
 'TdcMode': 0,
 'TdcString': 'PULSER\x00\x00',
 'digi_read(0xb)': '0b0',
 'digi_read(0xc)': '0b1',
 'digi_read(0xd)': '0b0',
 'digi_read(0xe)': '0b1000000000000000'}
5
{'DelayCount': 0, 'TriggerCountMatchNumTriggers': 1}

This reads only channel 1. -T 10 means to dump the first 10 triggers into a text file (i.e. run_2.txt) in ~/TestStand/trackerScripts/runs . The ROC will continue generating events forever, or until powered off, but only the first 10 triggers are written into the log file. -a controls the test pattern (1 to 0xC). -s controls the number of payload words in 32 bits, on top of 4x32-bit header words.

The contents of the date file (run_xx.txt, where xx is the “run number”) looks like:

You get the same repeating pattern for the date. At the end of the trigger you will see:

Next you may need to toggle on using the DDR memory on the DRAC. (This may be obsolete in some latest versions of the firmware).
The command is:

ddr_toggle -d 1 -p 4

where -p sets the number of 1kb blocks you want to write to DDR memory.

Using chants

Chants is a command line interface that allows you to talk directly to the DTC. To configure the ROC/DTC:

cd ~/test_stand/ots
source chantsDataTest.sh

To e.g. start collecting data from ROC->DTC->host computer:
 
 DTCLIB_SIM_ENABLE=N mu2eUtil -q 10 -N buffer_test -n 1 -f junkdata.bin

where -q says how many output lines to display, -N turns off the debug flag, -n says how many times
to run the test, "buffer_test" reads data from the DTC buffer, -f <filename> writes the data into <filename>.
Each buffer_test sends a heartbeat and then a data request. For more information on other tests that can
be run, see mu2eUtil --help.

Data format

You can look at the data written by buffer test by typing:

hexdump -v junkdata.bin | more

The data format is evolving, but the current format is linked as a file to this page
(see DataFormat.pdf).

Updating DTC firmware

To update the DTC firmware, log into the server node that the DTC is plugged into.
You will have to ksu root. Then:

source /mu2e/ups/setup
setup pcie_linux_kernel_module v2_02_04 -q e17:prof:s67
mcs.sh 0 ~kwar/dtc/<MCS FILE>

Afterwards you have to shutdown and restart the PC hosting the DTC. In principle
you can use ipmitool to bring the PC back up. Or just push the power button, which seems
to be more reliable.

ipmitool -Ilanplus -Hmu2edaq07-ipmi -UADMIN -PADMIN chassis power on
Chassis Power Control: Up/On
ipmitool -Ilanplus -Hmu2edaq07-ipmi -UADMIN -PADMIN chassis power status
Chassis Power is on

Useful links

Wiki syntax Here

Instructions for setting up main version of OTSDAQ using MRB: Off-the-Shelf DAQ