|
pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
|
DAQ menu (and submenus) command definitions. More...
#include "daq_run.h"#include "pflib/packing/Hex.h"#include "pflib/utility/string_format.h"#include "pftool.h"Functions | |
| ENABLE_LOGGING () | |
| static void | print_daq_status (Target *pft) |
| static void | daq_setup (const std::string &cmd, Target *pft) |
| DAQ->SETUP menu commands. | |
| static void | daq_setup_standard (Target *tgt) |
| DAQ.SETUP.STANDARD. | |
| static void | daq (const std::string &cmd, Target *pft) |
| DAQ menu commands, DOES NOT include sub-menu commands. | |
| static void | daq_debug_trigger_timein (Target *tgt) |
| DAQ.DEBUG.TRIGGER_TIMEIN. | |
DAQ menu (and submenus) command definitions.
|
static |
DAQ menu commands, DOES NOT include sub-menu commands.
| [in] | cmd | command selected from menu |
| [in] | pft | active target |
|
static |
DAQ.DEBUG.TRIGGER_TIMEIN.
This command attempts to deduce the capture delay for the trigger links by taking two runs after setting some parameters on the chip.
Assuming the pedestal values on the chip are all ~200 (as is the case at UMN), setting the CH_XX.ADC_PEDESTAL and DIGITALHALF_X.ADC_TH to their maxima (255 and 31 respectively) forces the trigger sums to be zero for pedestals. Including the 4-bit sync header, this means the trigger link zero-word is 0xa0000000.
We then enable charge injection within certain channels. Each trigger link produces a single 32-bit word cut up into a 4-bit sync header and 4 7-bit trigger sums.
0b1010 | TCX_0 | TCX_1 | TCX_2 | TCX_3
We choose channels to inject charge such that each link has a different trigger sum that should be non-zero.
The window size in the firmware is stored in 6 bits, so the maximum capture window (and therefore maximum delay) is 63 (2^6 - 1).
The pedestal run producing trigger-zero words filters out words that can be captured by this link but "belong" to a different link. We can then check which words are different between the charge and pedestal runs, printing the word indices (delays) for them. The last step is checking if the word from the charge run is zero everywhere except the expected bits.
Finally, report the delays where we found the expected bits to be non-zero
|
static |
DAQ->SETUP menu commands.
Before doing any of the commands, we retrieve a reference to the daq object via pflib::Target::daq.
| [in] | cmd | selected command from DAQ->SETUP menu |
| [in] | pft | active target |
|
static |
DAQ.SETUP.STANDARD.
Do the standard setup for the HGCROC (i.e. the setup everyone should use unless you are looking at changing L1OFFSET or fast control command timing).
This command is designed to set up this configuration on other (non software memory) places so that it does not need to be called often. Specifically, we store things in
do a standard fast control setup before tuning it below
In order to be able to shift the trigger link delay away from zero and allow us to capture a pre-sample in the trigger path, we need to bring the L1A closer in time to the injected charge pulse.
this then requires us to lower the L1OFFSET as well
DAQ link, timed in with pedestals and idles
Trigger link, timed in with DAQ.DEBUG.TRIGGER_TIMEIN
There is only one word per crossing per trigger link, but we capture four (one pre-sample and 2 following samples).