SOLARIS_Analysis/armory/Process_Run

94 lines
2.6 KiB
Plaintext
Raw Permalink Normal View History

2023-03-28 17:09:58 -04:00
#!/bin/bash
2023-04-04 14:47:44 -04:00
######## default time window = 100 tick
timeWin=100
2023-03-31 16:08:06 -04:00
if [ -z $SOLARISANADIR ]; then
echo "###### env variable SOLARISANADIR not defined. Abort. Please run the SOLARIS.sh."
echo "better add \"source <path_to_SOLARIS.sh>\" into .bashrc"
exit
fi
2023-03-28 17:09:58 -04:00
if [ $# -eq 0 ] || [ $1 == "-help" ]; then
echo "$ Process_Run [RunNum] [EventBuild] [GeneralSort] [TraceMethod] [Monitor]"
2023-03-31 16:08:06 -04:00
echo " RunNum = run number / \"lastRun\" "
echo " EventBld = 2/1/0/-1/-2 || 2 = with Trace"
echo " GeneralSort = n/0/-n || n = number of worker"
2023-04-04 18:41:28 -04:00
echo " TraceMethod = -1/0/1/2 || -1 no trace, 0 save trace, 1 fit, 2 trapezoid(not implemented)"
echo " Monitor = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C"
2023-03-28 17:09:58 -04:00
echo ""
2023-04-07 18:37:40 -04:00
echo " * negative option = force (except for TraceMethod and Monitor)."
echo " * Defult timeWindow for Event builder is 100 tick = 800 ns."
2023-03-28 17:09:58 -04:00
echo ""
exit 1
fi;
RUN=$1
2023-03-31 16:08:06 -04:00
runNum=$1
EventBld=2
2023-03-31 16:08:06 -04:00
nWorker=1
TraceMethod=-1
2023-04-07 18:37:40 -04:00
isMonitor=1
2023-03-31 16:08:06 -04:00
if [ $# -ge 2 ]; then EventBld=$2; fi
if [ $# -ge 3 ]; then nWorker=$3; fi
2023-04-04 18:09:04 -04:00
if [ $# -ge 4 ]; then TraceMethod=$4; fi
2023-04-04 14:47:44 -04:00
if [ $# -ge 5 ]; then isMonitor=$5; fi
2023-03-31 16:08:06 -04:00
if [ "$RUN" == "lastRun" ]; then
RUN=$runID
fi
2023-03-28 17:09:58 -04:00
RUN=${RUN##*(0)} #remove zero
2023-04-04 14:47:44 -04:00
RUN=$(printf '%03d' $RUN) ##add back the zero
2023-03-28 17:09:58 -04:00
################################### Setting display
echo "#################################################"
echo "### Process_Run #####"
echo "#################################################"
echo "### RunID : ${RUN}"
echo "### Event Builder : $EventBld"
echo "### General Sort : $nWorker worker(s)"
echo "### Trace Method : $TraceMethod"
echo "### Monitor : $isMonitor"
echo "#################################################"
source ${SOLARISANADIR}/armory/Process_BasicConfig
source ${SOLARISANADIR}/working/expName.sh
2023-03-31 16:08:06 -04:00
if [ "$PWD" != "${SOLARISANADIR}/working" ]; then
echo "============= go to the Working directory"
cd "${SOLARISANADIR}/working"
fi
#################################### CHECK IS RUN DATA EXIST
isRunDataExist=true
#################################### EVENT BUILDER
source Process_Download $RUN
2023-04-04 14:47:44 -04:00
if [ $isRunDataExist ]; then
2023-04-04 17:19:20 -04:00
source Process_EventBuilder $RUN $EventBld $timeWin
2023-04-04 14:47:44 -04:00
fi
2023-03-28 17:09:58 -04:00
2023-04-04 14:47:44 -04:00
#################################### GeneralSort
2023-03-28 17:09:58 -04:00
if [ $isRunDataExist ]; then
source Process_Sort $RUN $nWorker $TraceMethod
fi
2023-03-31 16:08:06 -04:00
#################################### Monitor
2023-04-07 18:37:40 -04:00
if [ $isMonitor -eq 0 ]; then
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> Monitor Skipped by user. ${NC}"
elif [ $isMonitor -eq 1 ]; then
root -l "ChainMonitors.C($RUN)"
elif [ $isMonitor -eq 2 ]; then
root -l "ChainMonitors.C"
fi
2023-03-31 16:08:06 -04:00