restart_200gev.sh 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. #!/bin/bash
  2. # RUNID: 1212, 12132, 12133, 12134, 12135, ...
  3. RUNID=$1
  4. MODE=$2
  5. INPUT_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/list/$RUNID
  6. OUTPUT_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/OUT/200gev
  7. TMP_PATH=/mnt/pool/rhic/4/parfenovpeter/STAR/TMP/200gev
  8. MERGE_DIR=/mnt/pool/rhic/4/parfenovpeter/STAR/OUT/200gev/merge
  9. CURRENT_DIR=$PWD
  10. QUEUE=medium
  11. mkdir -p $OUTPUT_DIR/log/$RUNID
  12. mkdir -p $OUTPUT_DIR/root/$RUNID
  13. mkdir -p $OUTPUT_DIR/sge_error/$RUNID
  14. mkdir -p $OUTPUT_DIR/sge_output/$RUNID
  15. ls -1 $INPUT_DIR/* | while read line
  16. do
  17. echo "`basename $line`"
  18. if [[ "$MODE" == "0" ]]; then
  19. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_recent.root
  20. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_recent.log
  21. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_recent.out
  22. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_recent.err
  23. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  24. #mkdir -p $TMP_DIR
  25. #cp -fu run_200gev_recentering.sh $TMP_DIR/
  26. #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ReCentering.C $TMP_DIR/
  27. #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ReCentering.C $TMP_DIR/
  28. #cd $TMP_DIR
  29. if [ ! -f $OUTPUT_ROOT ]
  30. then
  31. echo "File $OUTPUT_ROOT not found!"
  32. qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_recentering.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
  33. fi
  34. fi
  35. if [[ "$MODE" == "1" ]]; then
  36. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_shift.root
  37. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_shift.log
  38. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_shift.out
  39. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_shift.err
  40. INPUT_RECENTERING=$MERGE_DIR/Recentering.root
  41. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  42. #mkdir -p $TMP_DIR
  43. #cp run_200gev_shift.sh $TMP_DIR/
  44. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/
  45. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/
  46. #cd $TMP_DIR
  47. if [ ! -f $OUTPUT_ROOT ]
  48. then
  49. echo "File $OUTPUT_ROOT not found!"
  50. qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_shift.sh -F "$line $OUTPUT_ROOT $INPUT_RECENTERING $OUTPUT_LOG"
  51. fi
  52. fi
  53. if [[ "$MODE" == "2" ]]; then
  54. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_resolution.root
  55. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_resolution.log
  56. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_resolution.out
  57. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_resolution.err
  58. INPUT_RECENTERING=$MERGE_DIR/Recentering.root
  59. INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root
  60. INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root
  61. INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root
  62. INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root
  63. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  64. #mkdir -p $TMP_DIR
  65. #cp run_200gev_resolution.sh $TMP_DIR/
  66. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_Resolution.C $TMP_DIR/
  67. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_Resolution.C $TMP_DIR/
  68. #cd $TMP_DIR
  69. if [ ! -f $OUTPUT_ROOT ]
  70. then
  71. echo "File $OUTPUT_ROOT not found!"
  72. 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"
  73. fi
  74. fi
  75. if [[ "$MODE" == "3" ]]; then
  76. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_flowCH.root
  77. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_flowCH.log
  78. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_flowCH.out
  79. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_flowCH.err
  80. INPUT_RECENTERING=$MERGE_DIR/Recentering.root
  81. INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root
  82. INPUT_RES=$MERGE_DIR/Resolution.root
  83. INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root
  84. INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root
  85. INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root
  86. INPUT_RES_FIT=$MERGE_DIR/Resolution_fit.root
  87. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  88. #mkdir -p $TMP_DIR
  89. #cp run_200gev_flow_ch.sh $TMP_DIR
  90. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  91. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  92. #cd $TMP_DIR
  93. if [ ! -f $OUTPUT_ROOT ]
  94. then
  95. echo "File $OUTPUT_ROOT not found!"
  96. 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"
  97. fi
  98. fi
  99. if [[ "$MODE" == "4" ]]; then
  100. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_pid.root
  101. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_pid.log
  102. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_pid.out
  103. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_pid.err
  104. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  105. #mkdir -p $TMP_DIR
  106. #cp -fu run_200gev_recentering.sh $TMP_DIR/
  107. #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ReCentering.C $TMP_DIR/
  108. #cp -fu /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ReCentering.C $TMP_DIR/
  109. #cd $TMP_DIR
  110. if [ ! -f $OUTPUT_ROOT ]
  111. then
  112. echo "File $OUTPUT_ROOT not found!"
  113. qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pid.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
  114. fi
  115. fi
  116. if [[ "$MODE" == "5" ]]; then
  117. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_flowPID.root
  118. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_flowPID.log
  119. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_flowPID.out
  120. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_flowPID.err
  121. INPUT_RECENTERING=$MERGE_DIR/Recentering.root
  122. INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root
  123. INPUT_RES=$MERGE_DIR/Resolution.root
  124. INPUT_PID=$MERGE_DIR/pid_fit.root
  125. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  126. #mkdir -p $TMP_DIR
  127. #cp run_200gev_flow_ch.sh $TMP_DIR
  128. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  129. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  130. #cd $TMP_DIR
  131. if [ ! -f $OUTPUT_ROOT ]
  132. then
  133. echo "File $OUTPUT_ROOT not found!"
  134. 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"
  135. fi
  136. fi
  137. if [[ "$MODE" == "6" ]]; then
  138. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_pidQA.root
  139. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_pidQA.log
  140. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_pidQA.out
  141. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_pidQA.err
  142. INPUT_PID=$MERGE_DIR/pid_fit.root
  143. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  144. #mkdir -p $TMP_DIR
  145. #cp run_200gev_flow_ch.sh $TMP_DIR
  146. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  147. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_FlowChargedHadrons.C $TMP_DIR/
  148. #cd $TMP_DIR
  149. if [ ! -f $OUTPUT_ROOT ]
  150. then
  151. echo "File $OUTPUT_ROOT not found!"
  152. qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_pidQA.sh -F "$line $OUTPUT_ROOT $INPUT_PID $OUTPUT_LOG"
  153. fi
  154. fi
  155. if [[ "$MODE" == "7" ]]; then
  156. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_QA.root
  157. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_QA.log
  158. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_QA.out
  159. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_QA.err
  160. INPUT_RECENTERING=$MERGE_DIR/Recentering.root
  161. INPUT_SHIFT=$MERGE_DIR/ShiftCorr.root
  162. INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root
  163. INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root
  164. INPUT_BBC_SHIFT=$MERGE_DIR/ShiftCorrBBC.root
  165. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  166. #mkdir -p $TMP_DIR
  167. #cp run_200gev_resolution.sh $TMP_DIR/
  168. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_Resolution.C $TMP_DIR/
  169. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_Resolution.C $TMP_DIR/
  170. #cd $TMP_DIR
  171. if [ ! -f $OUTPUT_ROOT ]
  172. then
  173. echo "File $OUTPUT_ROOT not found!"
  174. 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"
  175. fi
  176. fi
  177. if [[ "$MODE" == "10" ]]; then
  178. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCgain.root
  179. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCgain.log
  180. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCgain.out
  181. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCgain.err
  182. if [ ! -f $OUTPUT_ROOT ]
  183. then
  184. echo "File $OUTPUT_ROOT not found!"
  185. qsub -q $QUEUE -o $OUTPUT_O_SGE -e $OUTPUT_E_SGE run_200gev_bbc_gain.sh -F "$line $OUTPUT_ROOT $OUTPUT_LOG"
  186. fi
  187. fi
  188. if [[ "$MODE" == "11" ]]; then
  189. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCrecent.root
  190. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCrecent.log
  191. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCrecent.out
  192. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCrecent.err
  193. INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root
  194. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  195. #mkdir -p $TMP_DIR
  196. #cp run_200gev_shift.sh $TMP_DIR/
  197. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/
  198. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/
  199. #cd $TMP_DIR
  200. if [ ! -f $OUTPUT_ROOT ]
  201. then
  202. echo "File $OUTPUT_ROOT not found!"
  203. 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"
  204. fi
  205. fi
  206. if [[ "$MODE" == "12" ]]; then
  207. OUTPUT_ROOT=$OUTPUT_DIR/root/$RUNID/`basename ${line%.*t}`_BBCshift.root
  208. OUTPUT_LOG=$OUTPUT_DIR/log/$RUNID/`basename ${line%.*t}`_BBCshift.log
  209. OUTPUT_O_SGE=$OUTPUT_DIR/sge_output/$RUNID/`basename ${line%.*t}`_BBCshift.out
  210. OUTPUT_E_SGE=$OUTPUT_DIR/sge_error/$RUNID/`basename ${line%.*t}`_BBCshift.err
  211. INPUT_BBC_REC=$MERGE_DIR/RecenteringBBC.root
  212. INPUT_BBC_GAIN=$MERGE_DIR/GainBBC.root
  213. #TMP_DIR=$TMP_PATH/`basename ${line%.*t}`
  214. #mkdir -p $TMP_DIR
  215. #cp run_200gev_shift.sh $TMP_DIR/
  216. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/RunAnalyzer_ShiftCorr.C $TMP_DIR/
  217. #cp /mnt/pool/rhic/4/parfenovpeter/STAR/Analysis/macro/Flow/FemtoDstAnalyzer_ShiftCorr.C $TMP_DIR/
  218. #cd $TMP_DIR
  219. if [ ! -f $OUTPUT_ROOT ]
  220. then
  221. echo "File $OUTPUT_ROOT not found!"
  222. 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"
  223. fi
  224. fi
  225. sleep 1
  226. done
  227. cd $CURRENT_DIR