overWrite output for converRoot.sh
This commit is contained in:
parent
e8d802a268
commit
207a44264c
|
@ -1,5 +1,5 @@
|
|||
|
||||
nCore=10;
|
||||
nCore=15;
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: "
|
||||
|
@ -8,9 +8,20 @@ if [ $# -eq 0 ]; then
|
|||
fi
|
||||
|
||||
runNum1=$1
|
||||
|
||||
runNum2=$2
|
||||
|
||||
overWrite=0
|
||||
if [[ ${runNum1} -lt 0 ]]; then
|
||||
overWrite=1
|
||||
runNum1=$(( ${runNum1} * (-1) ))
|
||||
fi
|
||||
if [[ ${runNum2} -lt 0 ]]; then
|
||||
overWrite=1
|
||||
runNum2=$(( ${runNum2} * (-1) ))
|
||||
fi
|
||||
|
||||
echo "is overWrite : ${overWrite} | ${runNum1} ${runNum2}"
|
||||
|
||||
for (( runNum=${runNum1}; runNum <=${runNum2}; runNum++)); do
|
||||
|
||||
nFile=$(ls -1 rawdata/run${runNum}/run*evt | wc -l)
|
||||
|
@ -49,22 +60,27 @@ for (( runNum=${runNum1}; runNum <=${runNum2}; runNum++)); do
|
|||
|
||||
fileName=rawdata/run${runNum}/run-${runPrefix}${runNum}-${segPrefix}${SegNum}.evt
|
||||
outFileName=root_data/run-${runPrefix}${runNum}-${segPrefix}${SegNum}.root
|
||||
if [[ ${overWrite} -gt 0 ]]; then
|
||||
echo ${fileName}
|
||||
armory/EventBuilder ${outFileName} 1 250 ${fileName} > /dev/null &
|
||||
else
|
||||
if [[ -f ${outFileName} ]]; then
|
||||
echo "${outFileName} exist. Skip."
|
||||
else
|
||||
echo ${fileName}
|
||||
armory/EventBuilder ${outFileName} 1 250 ${fileName} > /dev/null &
|
||||
fi
|
||||
fi
|
||||
((j += 1))
|
||||
done
|
||||
|
||||
sleep 2
|
||||
|
||||
SegNum0=$((${nCore}*i))
|
||||
SegNum1=$((${nCore}*i + j ))
|
||||
SegNum1=$((${nCore}*i + j - 1 ))
|
||||
|
||||
while true; do
|
||||
nthings=`ps aux | grep "[E]ventBuilder"| wc -l`
|
||||
nthings=`ps aux | grep "armory/[E]ventBuilder"| wc -l`
|
||||
echo $(date)" || "$nthings" EventBuilder are running. $runNum, ${SegNum0}-${SegNum1}"
|
||||
|
||||
if [[ $nthings > 0 ]]; then
|
||||
|
|
Loading…
Reference in New Issue
Block a user