if [[ -z $1 ]]; then
echo "Usage: "
echo " ${0##*/} option=value [option=value]"
- echo " at least one option, either inputFile or configFile should be specified,"
+ echo " at least one option, either inputList or configFile should be specified,"
echo " options override config file (if any), e.g.:"
echo " ${0##*/} configFile=runQA.config inputList=file.list outputDirectory=%det"
return 1
logSummary=${logDirectory}/summary-${detector}-${dateString}.log
outputDir=$(substituteDetectorName ${detector} ${outputDirectory})
- tmpRunDir=${workingDirectory}/tmpQArunDir${detector}
+ tmpRunDir=${workingDirectory}/tmpQAtmpRunDir${detector}
if ! mkdir -p ${tmpRunDir}; then
echo "cannot create the temp dir $tmpRunDir"
continue
#################################################################
#produce the QA and trending tree for each file (run)
+ unset arrOfTouchedProductions
+ declare -A arrOfTouchedProductions
while read qaFile; do
echo
continue
fi
- runDir=${tmpPrefix}/${dataType}/${year}/${period}/${pass}/000${runNumber}
- mkdir -p ${runDir}
- cd ${runDir}
+ tmpProductionDir=${tmpPrefix}/${dataType}/${year}/${period}/${pass}
+ arrOfTouchedProductions[${tmpProductionDir}]=1
+ tmpRunDir=${tmpProductionDir}/000${runNumber}
+ mkdir -p ${tmpRunDir}
+ cd ${tmpRunDir}
#handle the case of a zip archive
[[ "$qaFile" =~ .*.zip$ ]] && qaFile="${qaFile}#QAresults.root"
#################################################################
#cache which productions were (re)done
- arrOfTouchedProductions=( $(/bin/ls -d ${tmpPrefix}/*/*/*/*) )
echo "list of processed productions:"
- echo " ${arrOfTouchedProductions[@]}"
+ echo " ${!arrOfTouchedProductions[@]}"
echo
+
#################################################################
#(re)do the merging/trending in the final destination
- for tmpProductionDir in ${arrOfTouchedProductions[@]}; do
+ for tmpProductionDir in ${!arrOfTouchedProductions[@]}; do
echo
echo "running period level stuff in ${tmpProductionDir}"
#before moving - VALIDATE!!!
if ! validate ${dir}; then continue; fi
- #summarizeLogs ${dir} >> ${logSummary}
- #logStatus=$?
- #if [[ ${logStatus} -ne 0 ]]; then
- # echo "WARNING: run not validated: ${dir}"
- # planB=1
- # continue
- #fi
-
if [[ -d ${oldRunDir} ]]; then
echo "removing old ${period}/${pass}/${runNumber}"
rm -rf ${oldRunDir}
periodLevelQA trending.root &>> periodLevelQA.log
if ! validate ${PWD}; then continue; fi
- #summarizeLogs ${PWD} >> ${logSummary}
- #logStatus=$?
- #if [[ ${logStatus} -ne 0 ]]; then
- # echo "WARNING: period ${period} not validated: ${dir}"
- # planB=1
- # continue
- #fi
cd ${tmpRunDir}
summarizeLogs()
{
local dir=$1
- [[ -z ${dir} ]] && dir=${PWD}
+ [[ ! -d ${dir} ]] && dir=${PWD}
#print a summary of logs
logFiles=(
[[ -z ${legoTrainRunNumber} ]] && pass=${path[$((dirDepth-1))]}
[[ "${dataType}" =~ ^sim$ ]] && pass="passMC" && runNumber=${shortRunNumber}
- if [[ -z ${dataType} || -z ${year} || -z ${period} || -z ${runNumber}} || -z ${pass} ]];
+ #if [[ -z ${dataType} || -z ${year} || -z ${period} || -z ${runNumber}} || -z ${pass} ]];
+ if [[ -z ${runNumber}} ]];
then
#error condition
return 1