start_qncorrection.sh 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. #
  3. #SBATCH -D /mnt/pool/nica/8/parfenovpeter/TMP
  4. #SBATCH -J run_qncorrection
  5. #SBATCH -p fast
  6. #SBATCH -a 1-100
  7. #
  8. #SBATCH -o /mnt/pool/nica/7/parfenovpeter/TMP/slurm_%A_%a.out
  9. #SBATCH -e /mnt/pool/nica/7/parfenovpeter/TMP/slurm_%A_%a.err
  10. #
  11. export ecm=7.7
  12. export sys=AuAu
  13. export model=STAR
  14. export datatype=star #mc or reco
  15. export JOB_ID=${SLURM_ARRAY_JOB_ID}
  16. export TASK_ID=${SLURM_ARRAY_TASK_ID}
  17. #export correction_in_file=/scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter/OUT_QNANALYSIS/UrQMD_AuAu_7.7gev_reco_correction_ga/3766895/correction_in.root
  18. # export correction_in_file=/scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter/OUT_QNANALYSIS/UrQMD_AuAu_7.7gev_reco_correction_ba/3767179/correction_in.root
  19. source /mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/ROOT/build-cxx17/bin/thisroot.sh
  20. export QNANALYSIS_DIR=/mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/QnAnalysis/
  21. export LD_LIBRARY_PATH=${QNANALYSIS_DIR}/install/lib:${LD_LIBRARY_PATH}
  22. export tree_name=aTree
  23. export n_events=-1
  24. export config_file=/mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/StAtConverter/qnanalysis-setups/star-analysis-config.yml
  25. # export config_file=$QNANALYSIS_DIR/setups/mpd/mpd-analysis-config-bad-acc.yml
  26. export config_name=test_$datatype
  27. export cuts_macro=/mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/StAtConverter/qnanalysis-setups/CutsEvent.C
  28. export cuts_setup=star/auau/27gev
  29. export correlate_config_file=/mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/StAtConverter/qnanalysis-setups/star-correlation.yml
  30. export correlate_config_name=_tasks_$datatype
  31. export correlate_tree_name=tree
  32. export START_POSITION=$PWD
  33. export MAIN_DIR=/mnt/pool/nica/8/parfenovpeter/Soft/Unicluster/StAtConverter/
  34. export INPUT_FILELISTS=$MAIN_DIR/batch/at_filelists.list
  35. export INPUT_FILELIST=`sed "${TASK_ID}q;d" $INPUT_FILELISTS`
  36. export COMMIT=${model}_${sys}_${ecm}gev_${datatype}_correction
  37. export JOBID=${JOB_ID}
  38. export OUT=$MAIN_DIR/OUT_QNANALYSIS/$COMMIT/$JOBID
  39. export OUT_LOG=$OUT/log
  40. export OUT_CORRECT=$OUT/correct
  41. export OUT_CORRELATE=$OUT/correlate
  42. export QA_FILE=$OUT/qa
  43. export LOG=${OUT_LOG}/JOB_${JOB_ID}_${TASK_ID}.log
  44. export OUTPUT_CORRECT=${OUT_CORRECT}/correction_out_${datatype}_${JOB_ID}_${TASK_ID}.root
  45. export OUTPUT_CORRELATE=${OUT_CORRELATE}/correlation_out_${datatype}_${JOB_ID}_${TASK_ID}.root
  46. export QA_FILE=${QA_FILE}/qa_${datatype}_${JOB_ID}_${TASK_ID}.root
  47. export TMPALL=$MAIN_DIR/TMP
  48. export TMPDIR=$TMPALL/TMP_${JOB_ID}_${TASK_ID}
  49. mkdir -p $TMPDIR
  50. mkdir -p $OUT
  51. mkdir -p $OUT_LOG
  52. mkdir -p $OUT_CORRECT
  53. #mkdir -p $OUT_CORRELATE
  54. mkdir -p $QA_FILE
  55. export BIN_CORRECT=$QNANALYSIS_DIR/build/src/QnAnalysisCorrect/QnAnalysisCorrect
  56. export BIN_CORRELATE=$QNANALYSIS_DIR/build/src/QnAnalysisCorrelate/QnAnalysisCorrelate
  57. export correlate_tree_name=tree
  58. echo "Node host name: $HOSTNAME" &>> $LOG
  59. echo "Node architecture name: $ARC" &>> $LOG
  60. echo "Binary file: $BIN_CORRECT" &>> $LOG
  61. echo "QnAnalysisCorrect options:" &>> $LOG
  62. echo " -i $INPUT_FILELIST" &>> $LOG
  63. echo " -t $tree_name" &>> $LOG
  64. echo " -n $n_events" &>> $LOG
  65. echo " --yaml-config-file $config_file" &>> $LOG
  66. echo " --yaml-config-name $config_name" &>> $LOG
  67. echo " --cuts-macro $cuts_macro" &>> $LOG
  68. echo " --event-cuts $cuts_setup" &>> $LOG
  69. echo " --qa-file $QA_FILE" &>> $LOG
  70. echo "Output file will be stored here: $OUTPUT_CORRECT" &>> $LOG
  71. echo "" &>>$LOG
  72. cd $TMPDIR
  73. if [ -f "$correction_in_file" ]; then
  74. rsync -vuzP $correction_in_file ${TMPDIR}/correction_in.root &>> $LOG
  75. fi
  76. $BIN_CORRECT -i $INPUT_FILELIST -t $tree_name -n $n_events --yaml-config-file $config_file --yaml-config-name $config_name --cuts-macro $cuts_macro --event-cuts $cuts_setup --qa-file $QA_FILE &>> $LOG
  77. mv -v ./correction_out.root $OUTPUT_CORRECT &>> $LOG
  78. cd $START_POSITION
  79. rm -rfv $TMPDIR &>> $LOG
  80. echo "Job is done!" &>> $LOG