Commit 294c376f authored by Daniel Hynds's avatar Daniel Hynds
Browse files

add database search if alignment file not given


Former-commit-id: 2c40b52a1bc9fdf39c737323f7a845a248045bda
parent 4e18fb3d
#!/bin/bash
# Where the code is and which run to analyse
TBCODE=..
RUN=1100
RUN=${1}
DATADIR=${TBCODE}/example/Run${RUN}
CONDFILE=${TBCODE}/cond/alignmentRun${RUN}.dat
# Set up the arguments to be passed to the testbeam code
CONDFILE=${TBCODE}/cond/Alignment${RUN}.dat
HISTOFILE=${TBCODE}/histos/histogramsRun${RUN}.root
INPUTFILE=${TBCODE}/pixels/pixelsRun${RUN}.root
NEVENTS=-1
EVENTTIME=0.00005
STARTTIME=0
${TBCODE}/bin/tbAnalysis -d ${DATADIR} -c ${CONDFILE} -n ${NEVENTS} -h ${HISTOFILE} -t ${EVENTTIME} -o ${STARTTIME}
# If the alignment file for this run does not exist, get it from the DB
if [ ! -f ${CONDFILE} ]
then
while read run align dut thl angle
do
if [ "$run" == "$RUN" ]
then
CONDFILE=${TBCODE}/cond/Alignment${align}.dat
echo New cond file is ${CONDFILE}
fi
done <<< "$(grep ${RUN} runListAngledHVCMOS.dat)"
fi
# Launch the testbeam analysis and replace the original alignment file with the new one
${TBCODE}/bin/tbAnalysis -c ${CONDFILE} -n ${NEVENTS} -h ${HISTOFILE} -t ${INPUTFILE}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment