123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- #!/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
- #rm -rf $OUTPUT_DIR/
- 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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_recentering.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
- 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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_shift.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $OUTPUT_LOG"
- 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
- INPUT_ZDC_REC=$MERGE_DIR/RecenteringZDC.root
- INPUT_ZDC_SHIFT=$MERGE_DIR/ShiftCorrZDC.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
- rm -f $OUTPUT_ROOT
- fi
- 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 $INPUT_ZDC_REC $INPUT_ZDC_SHIFT $OUTPUT_LOG"
- 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
- INPUT_ZDC_REC=$MERGE_DIR/RecenteringZDC.root
- INPUT_ZDC_SHIFT=$MERGE_DIR/ShiftCorrZDC.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
- rm -f $OUTPUT_ROOT
- fi
- 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_ZDC_REC $INPUT_ZDC_SHIFT $INPUT_RES_FIT $OUTPUT_LOG"
- 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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pid.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
- 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
- rm -f $OUTPUT_ROOT
- fi
- 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
- 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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pidQA.sh -F "$line $OUTPUT_ROOT $INPUT_PID $OUTPUT_LOG"
- 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
- rm -f $OUTPUT_ROOT
- fi
- 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
- 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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_bbc_gain.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
- 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
- rm -f $OUTPUT_ROOT
- fi
- 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
- 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
- rm -f $OUTPUT_ROOT
- fi
- 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
- if [[ "$MODE" == "20" ]]; then
- OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_ZDCrecent.root
- OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_ZDCrecent.log
- OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_ZDCrecent.out
- OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_ZDCrecent.err
- #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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_zdc_recentering.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
- fi
- if [[ "$MODE" == "21" ]]; then
- OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_ZDCshift.root
- OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_ZDCshift.log
- OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_ZDCshift.out
- OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_ZDCshift.err
- INPUT_ZDC_REC=$MERGE_DIR/RecenteringZDC.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
- rm -f $OUTPUT_ROOT
- fi
- qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_zdc_shift.sh -F "$line $OUTPUT_ROOT $INPUT_ZDC_REC $OUTPUT_LOG"
- fi
- sleep 1
- done
- cd $CURRENT_DIR
|