The `gem_reg.py` tool is a command line interface which allows you to perform several actions on GEM hardware:
...
...
@@ -1488,113 +1465,3 @@ With these settings a call of `confChamber.py` will overwrite the values of:
-`CFG_CAP_PRE`
registers in the [Configuration File on CTP7](#configuration-file-on-ctp7) for all VFATs for optohybrids 0 through 2.
## Taking Calibration & Commissioning Data
Calibration and commissioning scans can be taken with the `run_scans.py` interface. Unlike the v2b case the OH FPGA is no longer controlling the taking of calibration scans, nor is it generating a TTC stream. The CTP7 generates the TTC stream or forwards a TTC stream from the AMC13. This means that all optohybrids on a given CTP7 receive a common TTC stream. This means you cannot be taking data with routine A with OHX and simultaneously take data with routine B with OHY.
Additionally the scan routines rely on several blocks of the CTP7 FW:
-`SBIT_MONITOR`
-`VFAT_DAQ_MONITOR`,
- etc...
These blocks can only receive information from one optohybrid at a time and thus almost all scans presently have to be run in series; they *cannot* be run in parallel. This will change as the SW tools develop.
### Getting the VFAT Mask: `getVFATMask.py`
In some cases you may not have a fully instrumented setup (e.g. less than 24 VFATs) or you may not be able to communicate with all 24 VFATs for one reason or another. In this case you will need to mask either the non-responsive VFATs or those that are not physically present (otherwise scan applications will crash). "Newer" scan applications will automatically determine which VFATs are good or bad for you; however older scans will require you to provide a VFAT mask, a 24 bit number where the N^th bit corresponds to the N^th VFAT and a value of 1 indicates the VFAT should be skipped.
However to make things simplier, especially for newer users a tool has been provided to determine the VFAT mask for you:
```bash
getVFATMask.py -c eagleXX -gY
Open pickled address table if available /opt/cmsgemos/etc/maps/amc_address_table_top.pickle...
Initializing AMC eagleXX
The VFAT Mask you should use for OHY is: <some hex number>
```
Here the `getVFATMask.py` tool was given `eagleXX``OHY` and returns `some hex number` that is the VFAT mask for this optohybrid.
### The Mapping File: `chamberInfo.py`
The `chamberInfo.py` file is either a system installed file or installed under your python `virtualenv` which loads the required python dictionaries from your setup's `system_specific_constants.py` file (found under `$PYTHONPATH`) at runtime. You never have to change the `chamberInfo.py` file and you should only ever edit the `system_specific_constants.py` file via the `editConfig` alias on the user account, e.g. call:
```bash
$ editConfig
```
Once the `chamberInfo.py` file has loaded the information from `system_specific_constants.py` at runtime the python API will have a set of dictionaries:
1.`chamber_config`,
2.`GEBtype`, and
1.`chamber_vfatDACSettings` dictionary (see [Using `chamber_vfatDACSettings` to write common register values](#using-chamber_vfatdacsettings-to-write-common-register-values)),
These dictionaries will:
- define which detectors are connected,
- provide the mapping between detector serial numbers and geographic addresses,
- possible DAC values to use to overwrite values stored in the [VFAT3 configuration files on the CTP7](https://github.com/cms-gem-daq-project/sw_utils/blob/develop/v3ElectronicsUserGuide.md#configuration-file-on-ctp7),
- the appropriate data paths to write output data too, and
- the chamber type.
The key values of the `chamber_config` and `GEBtype` are the geographic address (e.g. `ohKey`)-a tuple `(shelf,slot,link)` which specifices uTCA shelf number, AMC slot number, and optohybrid number-and enable you to define your test stand by specifying which detector is on which geographic address and what its detector type is, i.e. "long", "short", "m1", etc...
### Taking Data: `run_scans.py`
Once the dictionaries in `chamberInfo.py` are correctly configured, see:
-[Using `chamber_vfatDACSettings` to write common register values](#using-chamber_vfatdacsettings-to-write-common-register-values), and
You're now able to use the command line interface tool `run_scans.py` for automatically launching scan applications for your test stand. The `run_scan.py` will for each uncommented link (optohybrid number) in `chamber_config` dictionary:
- Create a scandate directory in the correct data path under: `$DATA_PATH/chamber_config[ohN]`,
- Set the permissions on this directory so anyone in the `gemuser` group can `write` or `read`,
- Call the scan application and configure it with the correct inputs,
- Create a log file of the scan, and
- Set the permissions on the output files so anyone in the `gemuser` group can read them.
The `run_scans.py` tool accepts different commands, each command represents a different scan application and has it's own positional (mandatory) and optional arguments. You can calling the help menu of `run_scans.py` via:
```bash
run_scans.py -h
```
Will display each of the possible input commands and provide a brief description of them. You can call the help menu of each of the commands in `run_scans.py` by calling:
```bash
run_scans.py COMMAND -h
```
For example calling the help menu for the scurve command would look like: