start_qnanalysis.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/bin/bash
  2. #
  3. #$ -wd /scratch2/$USER/TMP
  4. #$ -cwd
  5. #$ -N run_QnAnalysis
  6. #$ -q all.q
  7. #$ -l h_rt=0:45:00
  8. #$ -l s_rt=0:45:00
  9. #$ -t 1-100
  10. #
  11. #$ -o /scratch2/$USER/TMP
  12. #$ -e /scratch2/$USER/TMP
  13. #
  14. export ecm=7.7
  15. export sys=AuAu
  16. export model=UrQMD
  17. export datatype=reco #mc or reco
  18. export correction=twist # plain, recentered, twist, rescaled
  19. #export correction_in_file=/scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter/OUT_QNANALYSIS/UrQMD_AuAu_7.7gev_reco_correction_ga/3766895/correction_in.root
  20. export correction_in_file=/scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter/OUT_QNANALYSIS/UrQMD_AuAu_7.7gev_reco_correction_ba/3767201/correction_in.root
  21. source /scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter/external_soft_installation_scripts/SetEnv_cxx17.sh
  22. export tree_name=aTree
  23. export n_events=10000
  24. #export config_file=$QNANALYSIS_DIR/setups/mpd/mpd-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=$QNANALYSIS_DIR/setups/mpd/CutsMC.C
  28. export cuts_setup=mpd/auau/7gev/mc
  29. export correlate_config_file=$QNANALYSIS_DIR/setups/mpd/mpd-correlation-${correction}.yml
  30. export correlate_config_name=_tasks_$datatype
  31. export correlate_tree_name=tree
  32. export START_POSITION=$PWD
  33. export MAIN_DIR=/scratch2/parfenov/Soft/SoftQnTest/testQn/MpdAnalysisTreeConverter
  34. export INPUT_FILELISTS=$MAIN_DIR/batch/at_filelists.list
  35. export INPUT_FILELIST=`sed "${SGE_TASK_ID}q;d" $INPUT_FILELISTS`
  36. export COMMIT=${model}_${sys}_${ecm}gev_${datatype}_badacc_${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}_${SGE_TASK_ID}.log
  44. export OUTPUT_CORRECT=${OUT_CORRECT}/correction_out_${datatype}_${JOB_ID}_${SGE_TASK_ID}.root
  45. export OUTPUT_CORRELATE=${OUT_CORRELATE}/correlation_out_${datatype}_${JOB_ID}_${SGE_TASK_ID}.root
  46. export QA_FILE=${QA_FILE}/qa_${datatype}_${JOB_ID}_${SGE_TASK_ID}.root
  47. export TMPALL=$MAIN_DIR/TMP
  48. export TMPDIR=$TMPALL/TMP_${JOB_ID}_${SGE_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. echo "Binary file: $BIN_CORRELATE" &>> $LOG
  73. echo "QnAnalysisCorrelate options:" &>> $LOG
  74. echo " --input-file $OUTPUT_CORRECT" &>> $LOG
  75. echo " --input-tree $correlate_tree_name" &>> $LOG
  76. echo " --configuration-file $correlate_config_file" &>> $LOG
  77. echo " --configuration-name $correlate_config_name" &>> $LOG
  78. echo " --output-file $OUTPUT_CORRELATE" &>> $LOG
  79. echo "" &>>$LOG
  80. cd $TMPDIR
  81. if [ -f "$correction_in_file" ]; then
  82. rsync -vuzP $correction_in_file ${TMPDIR}/correction_in.root &>> $LOG
  83. fi
  84. $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
  85. mv -v ./correction_out.root $OUTPUT_CORRECT &>> $LOG
  86. $BIN_CORRELATE --input-file $OUTPUT_CORRECT --input-tree $correlate_tree_name --configuration-file $correlate_config_file --configuration-name $correlate_config_name --output-file $OUTPUT_CORRELATE &>> $LOG
  87. cd $START_POSITION
  88. rm -rfv $TMPDIR &>> $LOG
  89. echo "Job is done!" &>> $LOG