Skip to content
Snippets Groups Projects
Commit 65f32ac9 authored by Mario's avatar Mario
Browse files

Merge branch 'devel'

parents a1eb27e0 3fb29329
No related branches found
No related tags found
No related merge requests found
Pipeline #2446754 passed
# tl;dr
23/03/2021
Use the Scan Operator together with Yarr's devel branch.
Edit the module config in `configs/so_modules.json` and choose the scan sequence in `configs/so_yarr`.
# Introduction
The Scan Operator (SO) is an integration tool for scan data and DCS data, which is meant to be used during the QC procedure of the Rd53a modules. It uses multiple localDB scripts as well as some integrated tools to achieve these features:
- Calls Yarr repeatedly to **run a sequence of scans on Rd53a**.
......@@ -45,12 +51,12 @@ git clone --recursive https://gitlab.cern.ch/YARR/utilities/scan-operator.git
```
**Use the appropriate version of Yarr**
The latest we have tested is [954f1a25](https://gitlab.cern.ch/YARR/YARR/-/commit/5ca0199de9799695c7d5046a2bdcdff18d8e6847) on branch "`devel-localdb`", but more recent versions will most likely also work fine. We recommend starting from the latest one.
Yarr's devel is OK. Use Master if devel gives any problem.
## 3. Run the Scan Operator
The Scan Operator uses many configuration files, all of them located by default under `$SOBASE/configs`. Most of them are intuitive and the SO will tell you when you need to modify them. I recommend starting by just running the SO and refer to [the correspondent section](#the-so-configuration-files) only when it's actually needed.
The Scan Operator uses many configuration files, all of them located by default under `$SOBASE/configs`. Most of them are intuitive and the SO will tell you when you need to modify them.
```
......@@ -58,7 +64,6 @@ $ ./ScanOperator.sh
Help:
-m [str] : Serial number of the module
-W : upload Yarr's results to localDB (scanConsole's -W)
-Q : QC mode (upload / retrieve from iTk PD, etc) (scanConsole's -Q).
-o : turn on / off the output of the PS before and after all the scans
-e : Check if T and H are within a setting range before running each scan
-d : Monitor the PS and upload the DCS data to influxDB.
......
{
"YARR_directory" : "/path/to/yarr",
"scan":
"common_config":
{
"target_preamp": 10000
"max_trials_in_case_of_failure": 3,
"target_preamp": 10000,
"reset_pixel_masks": 0
},
"scan_list":
[
["std_digitalscan"],
["std_analogscan"],
["std_noisescan"],
["std_thresholdscan"],
["diff_tune_globalthreshold", 3000],
["diff_tune_pixelthreshold", 3000],
......
......@@ -93,7 +93,7 @@ if echo "${scanName}" | grep "tune_globalpreamp" >>/dev/null; then
echo "[ error ] Please specify the ToT together with the scan name"
exit 1
else
targetAmpOrCharge=$(jq -j '.YARR.scan.target_preamp' $SCANCFG)
targetAmpOrCharge=$(jq -j '.common_config.target_preamp' $SCANCFG)
targetToT=$(echo $scan | jq -r '.[1]')
fi
else
......@@ -135,23 +135,50 @@ if [[ $dcsMonitor == 1 ]] ;then
fi
targetCharge=$(jq -j '.scan.target_charge' $SCANCFG)
# Mask option (Yarr's -m)
reset_masks=$(jq -j '.common_config.reset_pixel_masks' $SCANCFG)
ctrlFile="$SOBASE/configs/rd53a/$module_id/controller.json"
cnctFile="$SOBASE/configs/rd53a/$module_id/connectivity.json"
comm="$YARRBASE/bin/scanConsole -r $ctrlFile -c $cnctFile -p -t ${targetAmpOrCharge} ${targetToT} -s ${scanPath} -m 1 $localdbOpt $qcOpt -o $SOBASE/data/$SO_RUNNUMBER" #> /dev/null 2>1
#ctrlFile="/home/mario/work/yr/configs/controller/emuCfg.json"
comm="$YARRBASE/bin/scanConsole -r $ctrlFile -c $cnctFile -p -t ${targetAmpOrCharge} ${targetToT} -s ${scanPath} -m $reset_masks $localdbOpt $qcOpt -o $SOBASE/data/$SO_RUNNUMBER" #> /dev/null 2>1
echo "[ info ][sl] Calling Yarr's scanConsole"
echo "[ info ][sl] $comm"
# If Yarr fails, try again from the same scan, a maximum of 3 times.
max_reps=$(jq -j '.common_config.max_trials_in_case_of_failure' $SCANCFG)
# run and time every scan (yarr time)
START_YR=$(date +%s.%N)
$comm
retval=$?
if [ $retval -ne 0 ]; then
exit $retval
fi
reps=0; retval=-1
while [ true ]; do
((reps++))
$comm # call Yarr
retval=$?
if [ $retval -eq 0 ]; then
break
fi
if [ $retval -ne 0 ] && [ $reps -ge $max_reps ]; then
echo "[ warn ][sl] After $max_reps attempts, couldn't succesfully finish $scanName."
exit $retval
elif [ $retval -ne 0 ]; then
echo "[ warn ][sl] Got an error from Yarr. Trying $scanName again in 3s ..."
sleep 3
fi
done
elp=$(echo "$(date +%s.%N) - $START_YR" | bc)
echo -ne "$scanName $elp\n" >> $TIMEFILE
# stop taking data
if [[ $dcsMonitor == 1 ]] ;then
echo "[ info ][sl] Stopping data taking"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment