if something goes wrong in the configuration, files can be reprocessed.

Necessary informations

  • list of runnumbers. BIFStats utility can be useful:

    #!/bin/sh
    DATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalOctober2018/AhcalRaw
    for i in `seq 1 1168` 
    do
        AFILE=`find ${DATADIR}|grep -i "run0*${i}\_"`
        if [ -f "${AFILE}" ] ; then
    	echo "#$i: ${AFILE}"
    	/afs/desy.de/user/k/kvas/pool/AHCAL-RAWutils/BIFStats/BIFstats \
    	    --spiroc_raw_file=${AFILE} \
    	    --trig_data_from_spiroc_raw \
    	    --run_number=${i} \
    	    --correlation_shift=14102 \
    	    --bxid_length=160 
        else
    	echo "#$i: Not found"
        fi;
    done | tee --append LDAstats_201810.txt
    
    #!/bin/sh
    DATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalMay2018/BifRaw/
    for i in `seq 60000 61000` 
    do
        BFILE=`find ${DATADIR}|grep -i "run0$i"`
        if [ -f "${BFILE}" ] ; then
    	echo "#$i: ${BFILE}"
    	~/git/AHCAL-RAWutils/BIFStats/BIFstats \
    	    --bif_raw_file=${BFILE} \
    	    --run_number=${i} \
    	    --correlation_shift=67685 \
    	    --bxid_length=5120
        else
    	echo "#$i: Not found"
        fi;
    done | tee --append BIFstats_201805.txt
    
    
  • LDA offsets. ahcalbifcorrelate utility can be useful

    #!/bin/sh
    ADATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalMay2018/AhcalRaw/
    BDATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalMay2018/BifRaw/
    for i in `seq 60000 61000` 
    do
        AFILE=`find ${ADATADIR}|grep -i "run0$i"|grep -v "LED"`
    #    BFILE=`find ${BDATADIR}|grep -i "run0$i"`
        if [ -f "${AFILE}" ] ; then
    	#echo "#$i: ${AFILE}"
    	for scan in 2
    	do
    	    ~/git/AHCAL-RAWutils/ahcalBifCorrelation/ahcalbifcorrelate \
    		--spiroc_raw_file=${AFILE} \
    		--trig_data_from_spiroc_raw \
    		--shift_scan_method=${scan} \
    		--shift_scan_max=15000 \
    		--run_number=${i} \
    		--require_hitbit \
    		--correlation_shift=2106 \
    		--bxid_length=160 \
    		--print_maxoffset \
    		--report_gaps_ms=60000
    	    #	    | grep -i -e "Run number" -e "maximum correlation"
    	done;
        else
    	echo "#Run $i: Not found"
        fi;
    done |tee --append LdaOffsets_201805.txt 
  • BIF offset (if applicable). Very similar procedure to LDA offset

    #!/bin/sh
    ADATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalMay2018/AhcalRaw/
    BDATADIR=/pnfs/desy.de/calice/tb-cern/native/cernAhcalMay2018/BifRaw/
    for i in `seq 60000 61000` 
    do
        AFILE=`find ${ADATADIR}|grep -i "run0$i"|grep -v "LED"`
        BFILE=`find ${BDATADIR}|grep -i "run0$i"`
        if [ -f "${AFILE}" ] ; then
    	if [ -f "${BFILE}" ] ; then
    	    #echo "#$i: ${AFILE}"
    	    for scan in 2
    	    do
    		~/git/AHCAL-RAWutils/ahcalBifCorrelation/ahcalbifcorrelate \
    		    --spiroc_raw_file=${AFILE} \
    		    --bif_raw_file=${BFILE} \
    		    --shift_scan_method=${scan} \
    		    --shift_scan_max=500000 \
    		    --run_number=${i} \
    		    --require_hitbit \
    		    --correlation_shift=451680 \
    		    --start_position=-1 \
    		    --bxid_length=5120 \
    		    --print_maxoffset \
    		    --report_gaps_ms=60000
    		#	    | grep -i -e "Run number" -e "maximum correlation"
    	    done;
    	else
    	    echo "#Run $i: Matching BIF file not found"
    	fi;
        else
    	echo "#Run $i: Not found"
        fi;
    done |tee --append BifOffsets_201805.txt 

Files need to be antidated to the original time of the test. Without a proper time, the database might have a problem with constants. AHCAL raw files contain a time records in the file names. 

The LDA (and BIF) have a huge counter (overflows only after 2 months), which can be used to find the time when the device was switched on. This is a value, that is the same for all runs until the device is power cycled or reset. When a run is started, the first timestamp can be plotted:

The time of the LDA/BIF switchon can be calculated as unix_timestamp_of_any_run - first_LDA_timestamp_in_this_run.

The LDA / BIF offset time also varies during the time (when the powerpulsing startup delay is played with):

EUDAQ

currently a dedicated branch is used: "reprocessing". 

startup script:

EUDAQ startup script
#!/bin/bash

if [ -f KILLRUN.local ]
then
    sh KILLRUN.local
else
    sh KILLRUN.sh
fi

currentdate=`date +"%Y%m%d"`
echo "date=(${currentdate})"
export RCPORT=44000
export HOSTIP=127.0.0.1
#################  Run control ###################
#xterm -sb -sl 1000000 -T "Runcontrol" -e "bin/euRun -n RunControl -a tcp://$RCPORT ; read "&
xterm -r -sb -sl 100000 -T "Runcontrol" -e "bin/euRun -n AhcalRunControl |tee -a /media/sf_virtual/data/logs/runcontrol_${currentdate}.log; read "&
sleep 1

#################  Log collector #################
xterm -r -sb -sl 1000 -geometry 160x24 -T "Logger" -e "bin/euLog |tee -a /media/sf_virtual/data/logs/euLogl_${currentdate}.log; read" &
#sleep 1

#################  Data collector #################
#collector 1: event monitor. Only ahcal
xterm -r -sb -sl 100000 -geometry 80x4 -T "Collector 1" -e "bin/euCliCollector -n DirectSaveDataCollector -t dc1 | tee -a  /media/sf_virtual/data/logs/DataCollectorEudaq_${currentdate}.log; read" &
#collector 3: slcio file writer. for reprocessing used in a same way as bxid collected
xterm -r -sb -sl 100000 -geometry 80x4 -T "Collector 3" -e "bin/euCliCollector -n DirectSaveDataCollector -t bxidColl1  | tee -a  /media/sf_virtual/data/logs/DataCollectorDirectSaveSlcio_${currentdate}.log; read" &
#calice data collector
#xterm -r -sb -sl 100000 -geometry 160x24 -T "BXID collector ahcalbif" -e "bin/euCliCollector -n CaliceAhcalBifBxidDataCollector -t bxidColl1 | tee -a  /media/sf_virtual/data/logs/DataCollectorBxid_${currentdate}.log ; read" &
#xterm -sb -sl 100000 -geometry 160x30 -T "Hodoscope Data collector" -e "bin/euCliCollector -n AhcalHodoscopeDataCollector -t dc2 | tee -a data/logs/dc2.log; read" &
#xterm -sb -sl 100000 -geometry 160x30 -T "slcio Hodoscope Data collector" -e "bin/euCliCollector -n AhcalHodoscopeDataCollector -t dc3 | tee -a data/logs/dc3.log; read" &
#xterm -sb -sl 100000  -T "Data collector2" -e "bin/euCliCollector -n DirectSaveDataCollector -t dc2 ; read" &
#sleep 1

#################  Producer #################
#xterm -r -sb -sl 100000 -geometry 160x5 -T "Hodoscope 1" -e "bin/euCliProducer -n CaliceEasirocProducer -t Hodoscope1 |tee -a data/logs/hodoscope1.log ; read"&
#xterm -r -sb -sl 100000 -geometry 160x5 -T "Hodoscope 2" -e "bin/euCliProducer -n CaliceEasirocProducer -t Hodoscope2 |tee -a data/logs/hodoscope2.log ; read"&
# sleep 1
xterm -r -sb -sl 100000 -geometry 160x24 -T "AHCAL" -e "bin/euCliProducer -n AHCALProducer -t AHCAL1 |tee -a  /media/sf_virtual/data/logs/ahcal_${currentdate}.log ; read"&
#xterm -r -sb -sl 100000 -geometry 160x24 -T "BIF" -e "bin/euCliProducer -n caliceahcalbifProducer -t BIF1 |tee -a  /media/sf_virtual/data/logs/bif_${currentdate}.log ; read"&
#xterm -r -sb -sl 10000 -geometry 160x24 -T "Table DESY" -e "bin/euCliProducer -n DesyTableProducer -t desytable1 |tee -a data/logs/desytable.log ;read"& 
#################  Online Monitor #################
echo "starting online monitor"
xterm -r -sb -sl 100000  -T "Online monitor" -e "bin/StdEventMonitor -c conf/onlinemonitor.conf --monitor_name StdEventMonitor --root --reset -r tcp://$HOSTIP:$RCPORT ; read" &
echo "online monitor started"
exit


Ini file doesnt need any modifications:

[RunControl]
# The Ex0RunControl does not need any paramters.

[LogCollector.log]
EULOG_GUI_LOG_FILE_PATTERN = data/logs/$12D.log

Configuration files

files can be automatically generated using simple bash script: reprocessing_201810_batch1.sh. Values in this scrript need to be adjusted to the PC and run number

and the configuration template run_template.conf

Reprocessing campaign

Details under specific testbeam page: 

  • No labels