Labview

Number of packets

TODO

Chip occupancy

TODO

Raw chip data insight

TODO

EUDAQ

Runcontrol observables

TODO

AHCAL terminal output

TODO

Online display

TODO

Temperature

The temperature data is stored by the labview program to the TXT file. Example of the txt file:

# Unixtime: 1538892353
# Serial    T1    T2    T3    T4    T5    T6    DIF    PWR
# LDA: 0Port: 1    275,00E+0    270,00E+0    272,00E+0    263,00E+0    269,00E+0    258,00E+0    31,00E+0    32,00E+0    
# LDA: 0Port: 2    285,00E+0    280,00E+0    283,00E+0    271,00E+0    280,00E+0    263,00E+0    33,00E+0    34,00E+0    
# LDA: 0Port: 3    1,04E+3    289,00E+0    1,03E+3    279,00E+0    289,00E+0    271,00E+0    29,00E+0    33,00E+0    
# LDA: 0Port: 4    291,00E+0    288,00E+0    289,00E+0    280,00E+0    284,00E+0    265,00E+0    29,00E+0    32,00E+0    
# LDA: 0Port: 5    306,00E+0    303,00E+0    306,00E+0    293,00E+0    300,00E+0    279,00E+0    33,00E+0    33,00E+0    
# LDA: 0Port: 6    300,00E+0    296,00E+0    298,00E+0    287,00E+0    292,00E+0    274,00E+0    34,00E+0    33,00E+0    
# LDA: 0Port: 7    285,00E+0    281,00E+0    283,00E+0    272,00E+0    275,00E+0    257,00E+0    30,00E+0    35,00E+0    
# LDA: 0Port: 8    296,00E+0    292,00E+0    293,00E+0    283,00E+0    287,00E+0    269,00E+0    34,00E+0    35,00E+0    
# LDA: 0Port: 9    298,00E+0    293,00E+0    294,00E+0    285,00E+0    291,00E+0    272,00E+0    30,00E+0    33,00E+0    
# LDA: 0Port:10    295,00E+0    289,00E+0    293,00E+0    282,00E+0    287,00E+0    270,00E+0    31,00E+0    35,00E+0    
# LDA: 0Port:11    286,00E+0    282,00E+0    284,00E+0    274,00E+0    280,00E+0    262,00E+0    29,00E+0    34,00E+0    
# LDA: 0Port:12    283,00E+0    280,00E+0    280,00E+0    270,00E+0    277,00E+0    257,00E+0    31,00E+0    33,00E+0    
# LDA: 0Port:13    291,00E+0    287,00E+0    289,00E+0    277,00E+0    285,00E+0    267,00E+0    30,00E+0    36,00E+0    
# LDA: 0Port:15    299,00E+0    297,00E+0    298,00E+0    287,00E+0    295,00E+0    275,00E+0    30,00E+0    36,00E+0    
# LDA: 0Port:16    276,00E+0    272,00E+0    274,00E+0    266,00E+0    270,00E+0    253,00E+0    29,00E+0    36,00E+0    
# LDA: 0Port:17    298,00E+0    296,00E+0    296,00E+0    286,00E+0    294,00E+0    271,00E+0    31,00E+0    36,00E+0    
# LDA: 0Port:18    293,00E+0    291,00E+0    291,00E+0    281,00E+0    288,00E+0    270,00E+0    32,00E+0    37,00E+0    
# LDA: 0Port:19    285,00E+0    280,00E+0    281,00E+0    272,00E+0    280,00E+0    262,00E+0    30,00E+0    34,00E+0    
# LDA: 0Port:20    281,00E+0    1,03E+3    276,00E+0    1,03E+3    278,00E+0    1,03E+3    44,00E+0    43,00E+0    
# LDA: 0Port:24    301,00E+0    299,00E+0    298,00E+0    287,00E+0    294,00E+0    277,00E+0    33,00E+0    36,00E+0    
# LDA: 0Port:25    299,00E+0    296,00E+0    296,00E+0    287,00E+0    290,00E+0    273,00E+0    31,00E+0    36,00E+0    
# LDA: 0Port:26    290,00E+0    291,00E+0    289,00E+0    281,00E+0    288,00E+0    268,00E+0    30,00E+0    35,00E+0    
# LDA: 0Port:27    301,00E+0    297,00E+0    300,00E+0    289,00E+0    298,00E+0    278,00E+0    29,00E+0    33,00E+0    
# LDA: 0Port:28    291,00E+0    292,00E+0    290,00E+0    280,00E+0    286,00E+0    265,00E+0    38,00E+0    38,00E+0    
# LDA: 0Port:29    273,00E+0    274,00E+0    272,00E+0    261,00E+0    268,00E+0    249,00E+0    29,00E+0    37,00E+0    
# LDA: 0Port:30    278,00E+0    276,00E+0    276,00E+0    265,00E+0    274,00E+0    252,00E+0    29,00E+0    36,00E+0    
# LDA: 0Port:31    297,00E+0    295,00E+0    295,00E+0    283,00E+0    292,00E+0    273,00E+0    29,00E+0    36,00E+0    
# LDA: 0Port:33    295,00E+0    292,00E+0    293,00E+0    285,00E+0    294,00E+0    274,00E+0    29,00E+0    34,00E+0    
# LDA: 0Port:34    300,00E+0    295,00E+0    298,00E+0    287,00E+0    296,00E+0    276,00E+0    34,00E+0    34,00E+0    
# LDA: 0Port:35    1,04E+3    285,00E+0    1,04E+3    278,00E+0    1,04E+3    262,00E+0    29,00E+0    33,00E+0    
# LDA: 0Port:36    291,00E+0    288,00E+0    287,00E+0    280,00E+0    283,00E+0    266,00E+0    37,00E+0    37,00E+0    
# LDA: 0Port:37    279,00E+0    274,00E+0    276,00E+0    268,00E+0    271,00E+0    256,00E+0    30,00E+0    33,00E+0    
# LDA: 0Port:38    282,00E+0    279,00E+0    278,00E+0    271,00E+0    275,00E+0    259,00E+0    32,00E+0    36,00E+0    
# LDA: 0Port:39    298,00E+0    293,00E+0    296,00E+0    287,00E+0    291,00E+0    274,00E+0    29,00E+0    34,00E+0    
# LDA: 0Port:40    301,00E+0    300,00E+0    298,00E+0    289,00E+0    297,00E+0    280,00E+0    36,00E+0    36,00E+0    
# LDA: 0Port:41    290,00E+0    286,00E+0    287,00E+0    278,00E+0    282,00E+0    264,00E+0    29,00E+0    33,00E+0    
# LDA: 0Port:42    296,00E+0    292,00E+0    293,00E+0    282,00E+0    289,00E+0    270,00E+0    28,00E+0    36,00E+0    
# LDA: 0Port:43    293,00E+0    291,00E+0    292,00E+0    279,00E+0    291,00E+0    270,00E+0    32,00E+0    36,00E+0    
# LDA: 0Port:44    287,00E+0    286,00E+0    285,00E+0    274,00E+0    283,00E+0    264,00E+0    36,00E+0    34,00E+0 
...

The temperature of the temperature sensors T1-T6 are in Degrees of Celsius multiplied by 10 (stored number needs to be divided by 10 in order to obtain the temperature value), temperatures of DIF and POWER are directly in degrees of Celsius.

The txt file location is usually on the Frankenstein PC, for example in F:\CERN_2018_October\data.

The DQM PC (flchcallab6, 192.168.1.16) has scripts, that fetches the temperature files from the in the ~/TB2018/Temperature/ directory.

Setup of the scripts

 How to setup the plots

Setting up needs to be done before each testbeam. Here is the processing script:

processing shell script
#!/bin/sh
DATAPATH="/home/calice/TB2018/mount_frankenstein/F/CERN_2018_October/data"
beginning=`date -d 20181005 +%s`
now=`date +%s`
PORTS1="1 2 3 24 4 5 6 7 8 25 9 10 11 12 13 33 34 35 36 37 38 39 15 26 27 28 16 17 18 19 29 30 31 40 41 42 43 44 20"
TIMEZONE_HOURS=2 # current timezone correction 2 for CEST (central european summer time), 1 for CET (central european time)

#fetch the labview txt files
#----------------------------------------------------------------
echo -n "Copying txt files to local data directory. Script tries to copy only last 10 days"
find ${DATAPATH} -ctime -10 -type f -size -10M -exec cp -n {} ./data/ \; -exec echo -n "." \;
echo " done."

# process the data (adds timestamps to each line at the end)
#-----------------------------------------------------------------
echo -n "Extraxting temperature from txt files."
#cleaning files
echo "" >./temp.txt 
for i in `find ./data/ -type f` 
do
    sed -n '/^# Unixtime/{s/# Unixtime:\ //g;h};G;/^# LDA/{s/# LDA: 0Port: */0 /g;s/# LDA: 1Port: */1 /g;s/\r\n//g;p}' \
    <"${i}" \
    >>temp.txt
    echo -n "."
done
echo " done."

#-------------------------------------------------------------------
echo -n "Plotting Summary (takes few minutes)..."
gnuplot -e "set xdata time; set timefmt \"%s\"; set xrange[\"${beginning}\":]; set output 'temperature_overall.png'; ptsize=0.3; ports1=\"${PORTS1}\"; timecorr=${TIMEZONE_HOURS}*60*60" \
    ./plot.gp
echo "done."
echo "To display the overall temperature in terminal type : display temperature_overall.png"

midnight=$(( now - ( now % 86400 ) ))
lastMidnight=$(( midnight - 86400 ))
echo -n "Plotting last two days (takes few minutes)..."
gnuplot -e "set xdata time; set timefmt \"%s\"; set xrange['${lastMidnight}':]; hour_step=1; set output 'temperature_twodays.png'; ptsize=0.7; ports1=\"${PORTS1}\"; timecorr=${TIMEZONE_HOURS}*60*60" \
    ./plot.gp
echo "done."
echo "To display the temperature type: display temperature_twodays.png"

convert temperature_overall.png temperature_twodays.png +append temperature.png
echo "All plots combined into 1 picture are stored in the temperature.png"
#display temperature.png

What needs to be changed:

  • Mounting of the TXT files

    mounting command
    sshfs daq@svhgcal01:/disk2_2TB/ /home/calice/TB2018/data/svhgcal01_disk2/ -o ro
  • Path to the mounted location with labview txt

    DATAPATH="/home/calice/TB2018/mount_frankenstein/F/CERN_2018_October/data"
  • The starting date (YYYYMMDD) of the testbeam in beginning=`date -d 20181005 +%s`

    beginning=`date -d 20181005 +%s`
  • List of LDA ports, that are plugged into the system

    PORTS1="1 2 3 24 4 5 6 7 8 25 9 10 11 12 13 33 34 35 36 37 38 39 15 26 27 28 16 17 18 19 29 30 31 40 41 42 43 44 20"
  • Timezone adjustment might need adjustment (sommer/winter time)

    TIMEZONE_HOURS=2 # current timezone correction 2 for CEST (central european summer time), 1 for CET (central european time)

The shell script calls gnuplot script for plottin:

Gnuplot plotting script
#!/usr/bin/gnuplot
set term pngcairo size 2000,2000 enhanced
#set output "temperature.png"
set multiplot layout 4,2
set grid
#set mxtics 2

set xdata time
set timefmt "%s"


if (!exists("ports1")) ports1="1 2 3 24 4 5 6 7 8 25 9 10 11 12 13 33 34 35 36 37 38 39 15 26 27 28 16 17 18 19 29 30 31 40 41 42 43 44 20"
if (!exists("ports2")) ports2=""
if (!exists("timecorr")) timecorr=2
set key out

set yrange [20:40]
if (!exists("ptsize")) ptsize=0.6
set title "temperature sensor 1, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$3>1000?NaN:$2!=a?NaN:$3/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 1, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$3>1000?NaN:$2!=a?NaN:$3/10) w p ps ptsize title sprintf("P%s",a)

set title "temperature sensor 2, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$4>1000?NaN:$2!=a?NaN:$4/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 2, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$4>1000?NaN:$2!=a?NaN:$4/10) w p ps ptsize title sprintf("P%s",a)

set title "temperature sensor 3, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$5>1000?NaN:$2!=a?NaN:$5/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 3, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$5>1000?NaN:$2!=a?NaN:$5/10) w p ps ptsize title sprintf("P%s",a)    

set title "temperature sensor 4, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$6>1000?NaN:$2!=a?NaN:$6/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 4, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$6>1000?NaN:$2!=a?NaN:$6/10) w p ps ptsize title sprintf("P%s",a)

set title "temperature sensor 5, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$7>1000?NaN:$2!=a?NaN:$7/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 5, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$7>1000?NaN:$2!=a?NaN:$7/10) w p ps ptsize title sprintf("P%s",a)

set title "temperature sensor 6, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$8>1000?NaN:$2!=a?NaN:$8/10) w p ps ptsize title sprintf("P%s",a)
# set title "temperature sensor 6, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$8>1000?NaN:$2!=a?NaN:$8/10) w p ps ptsize title sprintf("P%s",a)

set yrange [20:*]
set title "DIF temperature, LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$9>100?NaN:$2!=a?NaN:$9) w p ps ptsize title sprintf("P%s",a)
# set title "DIF temperature, LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$9>100?NaN:$2!=a?NaN:$9) w p ps ptsize title sprintf("P%s",a)

set yrange [20:*]
set title "POWER temperature - LDA 1"
plot for [a in ports1] 'temp.txt' u ($11+timecorr):($1!=0?NaN:$10>100?NaN:$2!=a?NaN:$10) w p ps ptsize title sprintf("P%s",a)
# set title "POWER temperature - LDA 2"
# plot for [a in ports2] 'temp.txt' u ($11+timecorr):($1!=1?NaN:$10>100?NaN:$2!=a?NaN:$10) w p ps ptsize title sprintf("P%s",a)

Getting the plots

#in calice@flchcallab6:~/TB2018/Temperature$ 
./script.sh

and wait for the output (script is slow).

AHCAL raw data analysis

Git repository https://github.com/jkvas/AHCAL-RAWutils has few programs, that can quickly process AHCAL (and BIF) raw files and extract some information:

  • ahcalBifCorrelation: find of offsets, BIF vs SPIROC TDC correlation
  • AhcalNoiseAnalysis: calculates a noise frequency with subtraction of trigger
  • ahcalraw2txt: converts the raw file to the txt format, can output a histogram
  • BIFStats: extracts timing information and statistics. 

All programs provide help when executed with --help parameter

 How to get the programs. Click here to expand...

In order to obtain the program, type:

git clone https://github.com/jkvas/AHCAL-RAWutils.git

In case the AHCAL-RAWutils directory is already there, it is recommended to update:

#go to the AHCAL-RAWutil directory
git pull

Programs need to be compiled:

#In each subdirectory:
make


Noise

Noise can be extracted from the raw datausing the AhcalNoiseAnalysis program. Statistics can be even obtained from runs with the beam: triggered events can be removed from the statistics, but it won't work for events, that are not properly triggered (events outside the trigger scintillator beam area or 2 triggers close to each other).

Following script can analyze noise of all asics and channels:

#!/bin/sh

#on naf be sure to run before:
#source /cvmfs/ilc.desy.de/sw/x86_64_gcc49_sl6/v01-19-05/init_ilcsoft.sh
#gnuplotcmd=/afs/desy.de/user/k/kvas/pool/gnuplot/gnuplot-5.0.7/src/gnuplot
#analysiscmd=/afs/desy.de/user/k/kvas/pool/AhcalNoiseAnalysis/Release/AhacalNoiseAnalysis

analysiscmd=~/git/AHCAL-RAWutils/AhcalNoiseAnalysis/AhcalNoiseAnalysis
gnuplotcmd=gnuplot

layer_portorder="1 2 3 24 4 5 6 7 8 25 9 10 11 12 13 33 34 35 36 37 38 39 15 26 27 28 16 17 18 19 29 30 31 40 41 42 43 44 20" # what is the order of the layers on the output plot. Put in the LDA port number
for run in `seq 62300 -1 62000`
do
    path="/data/201810"
    #/data/201805/
    #/nfs/dust/ilc/group/flchcal/AHCAL_Commissioning_2017_2018/Cosmic/raw
    # sraw=`find $path -type f| grep -v "/PP"|grep -v "LED"| grep -i -e "ahcalraw.*${run}.*raw"`
    sraw=`find $path -type f| grep -i -e "ahcalraw.*${run}.*raw"`
    #if [ "$#" -ne 1 ] || ! [ -f "$1" ]; then
    #    sraw="$1"
    #fi
    if [ "$sraw" = "" ] ; then continue ; fi
    echo "#AHCAL spiroc file: ${sraw}"
    if [ ! -f noise${run}.txt ]
    then
        echo "analyzing noise noise data"
        $analysiscmd \
            --spiroc_raw_filename "${sraw}" \
            --correlation_shift 14102 \
            --bxid_length 160 \
            --run_number ${run} \
            --adc_cut 700 \
            --reject_validated \
            |tee noise${run}_all.txt \
            |grep -v "^#" >noise${run}.txt
    else
        continue;
    fi


    ASIC_START=1; #what is the chipid of the first asic (1 for the typical numbering. 160 planned for the big prototype
    ASIC_PATTERN="10 8 2 0 11 9 3 1 14 12 6 4 15 13 7 5"; #order of asic how they will be plot in multiplot
    #gnuplot script, that makes 1 big pdf
    $gnuplotcmd -e "
           stats 'noise${run}.txt' u 5 nooutput;
           runlength=STATS_max; print '#duration of the run: ', STATS_max;
           stats 'noise${run}.txt' u 8 nooutput;
           hitmax=STATS_max; print '#Maximum hits for whole asic: ', STATS_max;
           maxChipFreq=runlength==0?100:1.0*hitmax/runlength;
           stats 'noise${run}.txt' u 6 nooutput;
           hitmax=STATS_max; print '#Maximum hits for single channel: ', STATS_max;
           maxChannelFreq=runlength==0?100:1.0*hitmax/runlength;
           
           roughxpos = \"18 18 12 12 18 18 12 12 06 06 00 00 06 06 00 00\";
           roughypos = \"18 12 23 17 06 00 11 05 18 12 23 17 06 00 11 05\";
           ydirection = \"1  1 -1 -1  1  1 -1 -1  1  1 -1 -1  1  1 -1 -1\";
           getxpos(asic,channel)=floor(word(roughxpos,1+floor(asic+256)%16))+(floor(channel)/6);
           getypos(asic,channel)=(floor(word(roughypos,1+floor(asic+256)%16))+(floor(channel)%6)*word(ydirection,1+floor(asic+256)%16));
           set style fill solid 1.0;set palette rgbformulae 22,13,-31;
           set terminal pdfcairo size 16,9 enhanced;
           set output sprintf(\"noise%s.pdf\",\"${run}\");
           print sprintf(\"Printing asic summary frequency maps\");
           do for [ls=0:1] {
             set cbtics font \",8\"; unset xtics; unset ytics; 
             set multiplot layout 5,8 title sprintf(\"Noise frequency in chips [Hz]. Run ${run}. Maximum %f Hz\",maxChipFreq) font \", 20\";
             set boxwidth 1;
             set grid;
             set xrange [-0.5:3.5]; set yrange [-0.5:3.5];
             set lmargin 1;set rmargin 1;set tmargin 1.5;set bmargin 0.2;
             if (ls==0) { set logscale cb; set cbrange [0.1:maxChipFreq]; } else {
             unset logscale cb; set cbrange [0:maxChipFreq];}; 
             do for [p in \"${layer_portorder}\"] {
                 set title \"Port \".p offset 0,-0.8;
                 plot 'noise${run}.txt'  u (\$2!=int(p)?NaN:\$4!=0?NaN:floor(getxpos(\$3-1,\$4)/6)):(floor(getypos(\$3-1,\$4)/6)):(0.5):(0.5):(\$8<2?NaN:\$8/\$5) palette w boxxyerrorbars notitle,\
                      '' u (\$2!=int(p)?NaN:\$4!=0?NaN:floor(getxpos(\$3-1,\$4)/6)):(floor(getypos(\$3-1,\$4)/6)):(sprintf(\"%.2f\",\$8/\$5)) w labels font \",8\" notitle;
             };
             unset multiplot; 
           };

           print sprintf(\"Printing channel frequency noise frequency maps\");
           do for [ls=0:1] {
             set cbtics font \",8\";
             set multiplot layout 5,8 title sprintf(\"Noise frequency in channels [Hz]. Run ${run}. Maximum %f Hz\", maxChannelFreq) font \", 20\";
             set boxwidth 1;
             set xrange [-0.5:23.5]; set yrange [-0.5:23.5];
             set xtics format \"\"; set xtics (-0.5,5.5,11.5,17.5); set ytics format \"\"; set ytics (-0.5,5.5,11.5,17.5); 
             set grid nomxtics; set grid front;
             set lmargin 1;set rmargin 1;set tmargin 1.5;set bmargin 0.2;
             if (ls==0) { set logscale cb; set cbrange [0.001:maxChannelFreq];} 
             else { unset logscale cb; set cbrange [0:maxChannelFreq];};
             do for [p in \"${layer_portorder}\"] {
                 set title \"Port \".p offset 0,-0.8;
                 plot 'noise${run}.txt'  u (\$2!=int(p)?NaN:getxpos(\$3-1,\$4)):(getypos(\$3-1,\$4)):(0.5):(0.5):(\$6<0?NaN:\$6/\$5) palette w boxxyerrorbars notitle\
             };
             set xtics format \"% h\"; set xtics auto; set ytics format \"% h\"; set ytics auto; 
             set grid back;
             unset multiplot; 
           };
           
           print sprintf(\"Printing layer hitmaps \");
           do for [ls=0:1] {
             do for [p in \"${layer_portorder}\"] {
               unset logscale y ; stats 'noise${run}.txt' u (\$2!=int(p)?NaN:\$4) nooutput;
               if (STATS_sum != 0) {
               print sprintf(\"Printing map for port %d\",int(p));
                 set title sprintf(\"Noise frequency in channels [Hz]. Run ${run}. Port %02d\",int(p)) font \",20\";
                 set xrange [-0.5:23.5]; set yrange [-0.5:23.5];
                 set grid; set xtics 1 norotate; set ytics 1;
                 set cblabel \"pixel noise frequency [Hz]\";
                 if (ls==0) { set logscale cb; set cbrange [0.001:maxChannelFreq];} 
                 else { unset logscale cb; set cbrange [0:maxChannelFreq];};
                 set lmargin 40;set rmargin 40;set tmargin 3;set bmargin 3;
                 plot 'noise${run}.txt'  u (\$2!=int(p)?NaN:getxpos(\$3-1,\$4)):(getypos(\$3-1,\$4)):(0.5):(0.5):(\$6<0?NaN:\$6/\$5) palette w boxxyerrorbars notitle,\
                      '' u (\$2!=int(p)?NaN:getxpos(\$3-1,\$4)):(getypos(\$3-1,\$4)):(sprintf(\"%.2f\",\$6/\$5)) w labels notitle;
               } else { print sprintf(\"Skipping map for port %d\",int(p));};
             };
             set ytics auto;
           };
"
done 

following lines should be modified:

  • line  8 (where is the analysis command)
  • line 11 (list of port number as they are ordered in the testbeam)
  • line 12 (run number range)
  • line 14: where are the files located
  • line 29: actual correlation shift (LDA offset)

It produces a big txt file with noise values in tab-separated format (example with 1 line only):

LDA

portasicchanneltotal_lenth[s]hitshit_cutasicHitacqs freqavglenavAdcADCsum
11220601398.2793912891757914861950.116.22846244731

This file is read by a gnuplot script, that makes a pdf out of it:

gnuplot 5.0 works fine, but version 4.6 doesn't produce individual layer information

Time correlations

LDA time offset

described in setup guide: EUDAQ for AHCAL testbeam

LDA timestamp vs SPIROC TDC:

command to calculate the correlation
${AHCAL-RAWutils}/ahcalBifCorrelation/ahcalbifcorrelate \
	--spiroc_raw_file=SPIROC_RAW_FILE \
	--trig_data_from_spiroc_raw \
	--bxid_length=160 \
	--correlation_shift=14102 \
	--require_hitbit \
	>lda_correlation.txt


The data contain all channels of all asics (can be constraind either in the plot or in the correlation script)

gunplot command to plot
#gnuplot commands
set palette rgbformulae 22,13,-31
plot 'correlation.txt' using ($10+rand(0)):6:(int($2) %2) palette with dots

Timing statistics

Timing statistics can be obtained either from the BIF raw file, or frmo the AHCAL raw file (then it reads the timestamps from the stream)

${AHCAL-RAWutils}/BIFStats/BIFstats \
	--run_number 300 \
	--spiroc_raw_file ahcalRaw_Run000300__12p10p2018__08p18p47.raw \
	--trig_data_from_spiroc_raw \
	--correlation_shift=14102 \

The output provides information in 3 sections:

  • during reading the data: long gaps (triggers or Readout cycle can be also switched on)

    example of the gaps with temperature readong every 10000 cycles
    Long gap before start: roc=1,    time_s=80433.191583
    #Long gap before start: roc=4,    time_s=7.038049
    #Long gap before start: roc=10003,    time_s=6.838894
    #Long gap before start: roc=20002,    time_s=6.671858
    #Long gap before start: roc=30003,    time_s=6.885592
    #Long gap before start: roc=40002,    time_s=6.863500
    #Long gap before start: roc=50003,    time_s=6.871515
    #Long gap before start: roc=60003,    time_s=6.659318
    #Long gap before start: roc=70003,    time_s=7.027399
    #Long gap before start: roc=80002,    time_s=6.672173
    #Long gap before start: roc=90003,    time_s=7.027592
    #Long gap before start: roc=100002,    time_s=6.860696
    #Long gap before start: roc=110003,    time_s=7.004387
    #Long gap before start: roc=120003,    time_s=6.870270
    #Long gap before start: roc=130002,    time_s=6.856335
    #Long gap before start: roc=140003,    time_s=6.932783
    
    
  • statistics:
    • RunNr: Run number

    • ROCs[count]: number of readout cycles

    • ROC/s: number of readout cycles per second

    • Triggers[count]: number of triggers

    • Length[s]: length of the whole run

    • AvgROCLength[ms]: average length of the acquisition cycle

    • ontime[s]: accumulated active time of the SPIROC

    • ontime[%]: the average duty cycle of the ontime

    • Triggers/s: the average number of triggers per second

    • Triggers/ROC: average number of triggers in the readout cycle

    • Phase: slow clock phase

    • Start: time of the start of acquisition (relative from the power-on of the LDA/BIF)

    • ShortStats with all above number tab-separated in a single line.

      Statistics example
      #--- Statistics ---------------------------------------------
      RunNr:300
      #ROCs[count]:149168
      #ROC/s:49.3
      #Triggers[count]:10167
      #Length[s]:3025.5
      #AvgROCLength[ms]:15.52
      #ontime[s]:2314.8
      #ontime[%]:76.5
      #Triggers/s:3.36
      #Triggers/ROC:0.07
      #Phase:7
      #Start:80433.191583
      300    149168    49.3    10167    3025.5    15.52    2314.8    76.5    3.36    0.07    7    80433.2#ShortStats
      #------------------------------------------------------------
      
  • Phase detail: only 1 phase should be populated throughout the whole testbeam. Can change only when the LDA/BIF is reset / power cycled

    • Example of correctly looking plock phase stats
      #phase    counts
      0    0
      1    0
      2    0
      3    0
      4    0
      5    0
      6    0
      7    149168

Trigger printout

trigger analysis script
${AHCAL-RAWutils}/ahcalBifCorrelation/ahcalbifcorrelate \
	--spiroc_raw_file=SPIROC_RAW_FILE \
	--trig_data_from_spiroc_raw \
	--bxid_length=160 \
	--correlation_shift=14102 \
	--print_triggers \
	|grep Trig >triggers.txt

the script will generate a text file with following fields:

  • ROC  (readout cycle)
  • TriggerID: trigger number as saved in the timestamp packet: 16 bits, maximum is therefore 65535, then goes from 0 again
  • TS: timestamp of the trigger
  • inside_ROC: whether the trigger was inside readout cycle
  • ROC_increment (debug info)
  • from_start: timestamp from the start of the acquisition fast command
  • from_last: time from last trigger (trigger distance)
  • bxid: Bunch crossing ID
  • time_within_bxid: in what time with regards to the start of the acquisition the trigger cam

following observations can be made from the data:

trigger time distribution:

Gnuplot example script
#gnuplot script
set boxwidth 1
plot 'triggers_run311.txt' u 8:(1.0) smooth freq w boxes


trigger distances

gnuplot script example
#gnuplot script
bin(x,width)=width*floor(x/width)
plot 'correlate_triggers_pp.txt' u (bin(($7*25E-9),0.001)):(1.0) smooth freq w boxes notitle
set boxwidth 0.001
set xrange [0:0.2];set yrange [*:*];replot



Start command clock phase consistency

TODO

Custom histograms



DQM4HEP

prerequirement: 

#environment has to be initialized for each terminal. Now it is put by default to the .bashrc: 
export LD_LIBRARY_PATH=/home/calice/TB2018/dqm4hep/lib:/home/calice/TB2018/DQM4ILC/lib:$LD_LIBRARY_PATH 
export PATH=/home/calice/TB2018/dqm4hep/bin:$PATH 
export DIM_DNS_NODE=localhost 
export DQM4HEP_PLUGIN_DLL=/home/calice/TB2018/DQM4ILC/lib/libAHCAL_15Layers.so:/home/calice/TB2018/DQM4ILC/lib/libAHCAL_96Layers.so:/home/calice/TB2018/DQM4ILC/lib/libDQM4ILC.so:/home/calice/TB2018/DQM4ILC/lib/libAHCAL_15Channels.so 

Scripts (best executed each line individually in separate tab of a terminal → each line goes to a new terminal tab/window):

dns 
dqm4hep_start_run_control_server -v ALL -r AHCALRunControl 
dqm4hep_start_run_control_interface -v ALL -r AHCALRunControl # this opens run control
# start the run now in the window that opens after the last command (press "Start Run"). Press ok without password.
dqm4hep_start_event_collector -v ALL -c ahcal_event_collector 
dqm4hep_start_monitor_element_collector -v ALL -c ahcal_me_collector 
dqm4hep_start_analysis_module -v ALL -f /home/calice/TB2018/scripts/lcioTestbeam201806.xml 
dqm4hep_start_dqm_monitor_gui -v ALL -f  ~/TB2018/scripts/canvases.xml # this opens monitor window
dqm4hep_start_lcio_file_service  -c ahcal_event_collector -t 1 -f ~/TB2018/data/svhgcal01_disk2/October2018/ahcalSlcio/run_dc4_000304.slcio 
# last command line: Before pressing return, move cursor to run number 00304, press tab, then all available runs will be displayed. Choose the one you want to see and execute.
# In the "Monitor Window" Press "Update" and goto tab "HITs". In order to have continuous updates of current run: Press "Start Update"

Older installation and operation guides

Important files, that need edit when changing setup

 List of all files. Click here to expand...
  • /home/calice/TB2018/DQM4ILC/source/AHCAL_BIF/AHCAL/Layers/AHCAL_96Layers.cc
    (Only when the analysis needs to be changed, make install is then needed)
  • /home/calice/TB2018/DQM4ILC/source/AHCAL_BIF/scripts/lcioTestbeam201810.xml
    → Symbolic link of this file in home/calice/TB2018/scripts
  • /home/calice/TB2018/DQM4ILC/source/AHCAL_BIF/scripts/generate_geometry.sh
    this script will generate the geometry:
    • /home/calice/TB2018/scripts/Geometry_2018October.xml
      → Symbolic link of this file in home/calice/TB2018/scripts
  • /home/calice/TB2018/DQM4ILC/source/AHCAL_BIF/scripts/generate_canvases.sh
    this script generates part of the following file (only content of <canvasView>, not whole file!):
    • /home/calice/TB2018/DQM4ILC/source/AHCAL_BIF/scripts/canvases_2018October.xml
      → Symbolic link of this file in home/calice/TB2018/scripts

No recompilation is needed. It is a very good to commit and push the changes to the git repository

Quasi-online monitoring

described in separate section (TODO)

  • No labels