#!/bin/bash # RUNID: 1212, 12132, 12133, 12134, 12135, ... RUNID=$1 MODE=$2 INPUT_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/list/$RUNID OUTPUT_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/OUT/200gev TMP_PATH=/mnt/pool/rhic/4/parfenovpeter/STAR/TMP/200gev MERGE_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/OUT/200gev/merge CURRENT_DIR=$PWD QUEUE=medium mkdir -p $OUTPUT_DIR/log/$RUNID mkdir -p $OUTPUT_DIR/root/$RUNID mkdir -p $OUTPUT_DIR/sge_error/$RUNID mkdir -p $OUTPUT_DIR/sge_output/$RUNID ls -1 $INPUT_DIR/* | while read line do echo "`basename $line`" if [[ "$MODE" == "0" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_recent.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_recent.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_recent.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_recent.err #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp -fu run_200gev_recentering.sh $TMP_DIR/ #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ReCentering.C $TMP_DIR/ #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ReCentering.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_recentering.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG" fi fi if [[ "$MODE" == "1" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_shift.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_shift.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_shift.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_shift.err INPUT_RECENTERING=$MERGE_DIR/Recentering.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_shift.sh $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_shift.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $OUTPUT_LOG" fi fi if [[ "$MODE" == "2" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_resolution.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_resolution.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_resolution.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_resolution.err INPUT_RECENTERING=$MERGE_DIR/Recentering.root INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_resolution.sh $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_Resolution.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_Resolution.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_resolution.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $INPUT_SHIFT $INPUT_BBC_GAIN $INPUT_BBC_REC $INPUT_BBC_SHIFT $OUTPUT_LOG" fi fi if [[ "$MODE" == "3" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_flowCH.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_flowCH.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_flowCH.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_flowCH.err INPUT_RECENTERING=$MERGE_DIR/Recentering.root INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root INPUT_RES=$MERGE_DIR/Resolution.root INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root INPUT_RES_FIT=$MERGE_DIR/Resolution_fit.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_flow_ch.sh $TMP_DIR #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_flow_ch.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $INPUT_SHIFT $INPUT_RES $INPUT_BBC_GAIN $INPUT_BBC_REC $INPUT_BBC_SHIFT $INPUT_RES_FIT $OUTPUT_LOG" fi fi if [[ "$MODE" == "4" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_pid.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_pid.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_pid.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_pid.err #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp -fu run_200gev_recentering.sh $TMP_DIR/ #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ReCentering.C $TMP_DIR/ #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ReCentering.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pid.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG" fi fi if [[ "$MODE" == "5" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_flowPID.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_flowPID.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_flowPID.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_flowPID.err INPUT_RECENTERING=$MERGE_DIR/Recentering.root INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root INPUT_RES=$MERGE_DIR/Resolution.root INPUT_PID=$MERGE_DIR/pid_fit.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_flow_ch.sh $TMP_DIR #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_flow_pid.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $INPUT_SHIFT $INPUT_RES $INPUT_PID $OUTPUT_LOG" fi fi if [[ "$MODE" == "6" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_pidQA.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_pidQA.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_pidQA.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_pidQA.err INPUT_PID=$MERGE_DIR/pid_fit.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_flow_ch.sh $TMP_DIR #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pidQA.sh -F "$line $OUTPUT_ROOT $INPUT_PID $OUTPUT_LOG" fi fi if [[ "$MODE" == "7" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_QA.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_QA.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_QA.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_QA.err INPUT_RECENTERING=$MERGE_DIR/Recentering.root INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_resolution.sh $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_Resolution.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_Resolution.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_qa.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $INPUT_SHIFT $INPUT_BBC_GAIN $INPUT_BBC_REC $INPUT_BBC_SHIFT $OUTPUT_LOG" fi fi if [[ "$MODE" == "10" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCgain.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCgain.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCgain.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCgain.err if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_bbc_gain.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG" fi fi if [[ "$MODE" == "11" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCrecent.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCrecent.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCrecent.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCrecent.err INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_shift.sh $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_bbc_recentering.sh -F "$line $OUTPUT_ROOT $INPUT_BBC_GAIN $OUTPUT_LOG" fi fi if [[ "$MODE" == "12" ]]; then OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCshift.root OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCshift.log OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCshift.out OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCshift.err INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root #TMP_DIR=$TMP_PATH/`basename ${line%.*t}` #mkdir -p $TMP_DIR #cp run_200gev_shift.sh $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/ #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/ #cd $TMP_DIR if [ ! -f $OUTPUT_ROOT ] then echo "File $OUTPUT_ROOT not found!" qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_bbc_shift.sh -F "$line $OUTPUT_ROOT $INPUT_BBC_GAIN $INPUT_BBC_REC $OUTPUT_LOG" fi fi sleep 1 done cd $CURRENT_DIR