diff --git a/macro/PWG/common/production/config.json b/macro/PWG/common/production/config.json index 6b54e76fae86be926a7a9884d44e15cd5e187445..c2478e69a0f4eab35d0731ce22facf11a0b2ab07 100644 --- a/macro/PWG/common/production/config.json +++ b/macro/PWG/common/production/config.json @@ -15,6 +15,7 @@ "transport": { "run": true, "plutoShift": 0, + "seed": "1234 + ${taskId}", "macro": "${VMCWORKDIR}/macro/PWG/common/production/run_transport_json_config.C"}, "digitization": { "run": true, diff --git a/macro/PWG/common/production/config_ci.json.in b/macro/PWG/common/production/config_ci.json.in index ddb3d6a013a3a3d93df9a86aa2cce001f65f8bc6..277ac48392c7ae55ef717da0364667e748f54b72 100644 --- a/macro/PWG/common/production/config_ci.json.in +++ b/macro/PWG/common/production/config_ci.json.in @@ -15,6 +15,7 @@ "transport": { "run": true, "plutoShift": 0, + "seed": "1234 + ${taskId}", "macro": "@VMCWORKDIR@/macro/PWG/common/production/run_transport_json_config.C"}, "digitization": { "run": true, diff --git a/macro/PWG/common/production/run_sim_reco_json.sh b/macro/PWG/common/production/run_sim_reco_json.sh index c021763609a2ff772e36f6544cec32e16e2e9583..7760b99fd7415de77510fe2c22fba7a15e992a43 100755 --- a/macro/PWG/common/production/run_sim_reco_json.sh +++ b/macro/PWG/common/production/run_sim_reco_json.sh @@ -33,7 +33,7 @@ for step in ${steps}; do export taskId=${SLURM_ARRAY_TASK_ID} plutoShift=$(getJsonVal "['accessory']['transport']['plutoShift']") export plutoFileId=$(printf %05d $((${taskId}-${plutoShift}))) -# export plutoFileId=$(printf $((${taskId}-${plutoShift}))) + # export plutoFileId=$(printf $((${taskId}-${plutoShift}))) config=${srcDir}/${configName} macro=${srcDir}/${macroName} outFile=$(getJsonVal "['${step}']['output']['path']") @@ -53,14 +53,14 @@ for step in ${steps}; do isL1EffQA=$(getJsonVal "['reconstruction']['isL1EffQA']") echo " " echo -e "${BOLD} Run reconstruction: ${macro}(\"${rawFile}\",${nTimeSlices},${firstTimeSlice},\"${outFile}\",\ - ${overwrite},\"${sEvBuildRaw}\",\"${config}\",\"${traList}\",${isL1Matching},${isL1EffQA}) ${NC}" + ${overwrite},\"${sEvBuildRaw}\",\"${config}\",\"${traList}\",${isL1Matching},${isL1EffQA}) ${NC}" root -b -l -q "${macro}(\"${rawFile}\",${nTimeSlices},${firstTimeSlice},\"${outFile}\",\ - ${overwrite},\"${sEvBuildRaw}\",\"${config}\",\"${traList}\",${isL1Matching},${isL1EffQA})" &> ${log} + ${overwrite},\"${sEvBuildRaw}\",\"${config}\",\"${traList}\",${isL1Matching},${isL1EffQA})" &>${log} if [ $? -eq 0 ]; then echo -e "${GREEN} Reconstruction executed successfully ${NC}" else echo -e "${RED} Reconstruction failed ${NC}" - exit 1 + exit 1 fi rm -v ${traList} elif [ ${step} == AT ]; then @@ -69,66 +69,72 @@ for step in ${steps}; do recFile=$(getJsonVal "['AT']['recFile']") unigenFile=$(getJsonVal "['AT']['unigenFile']") eventMode=$(getJsonVal "['digitization']['eventMode']") - tslength=-1; + tslength=-1 if [ ${eventMode} == false ]; then - tslength=$(getJsonVal "['digitization']['timeSliceLength']") + tslength=$(getJsonVal "['digitization']['timeSliceLength']") fi echo " " echo -e "${BOLD} Run AT converter: ${macro}(\"${traList}\",\"${rawFile}\",\"${recFile}\",\ - \"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\") ${NC}" + \"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\") ${NC}" root -b -l -q "${macro}(\"${traList}\",\"${rawFile}\",\"${recFile}\",\ - \"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\")" &> ${log} + \"${unigenFile}\",\"${outFile}\",${overwrite},\"${config}\",\"${tslength}\")" &>${log} if [ $? -eq 0 ]; then echo -e "${GREEN} AnalysisTreeConverter executed successfully ${NC}" else - echo -e "${RED} AnalysisTreeConverter failed ${NC}" - exit 1 + echo -e "${RED} AnalysisTreeConverter failed ${NC}" + exit 1 fi rm -v ${traList} - else - if [ ${step} == digitization ]; then - input=$(getJsonVal "['transport']['output']['path']") - if [ ! -e ${outFile}.par.root ] || [ ${overwrite} == true ]; then - echo "Copying parameter file..." - cp -v ${input}.par.root ${outDir} - fi + elif [ ${step} == digitization ]; then + input=$(getJsonVal "['transport']['output']['path']") + if [ ! -e ${outFile}.par.root ] || [ ${overwrite} == true ]; then + echo "Copying parameter file..." + cp -v ${input}.par.root ${outDir} + fi echo " " echo -e "${BOLD} Run digitization: ${macro}(\"${config}\",${nEvents}) ${NC}" + root -b -l -q "${macro}(\"${config}\",${nEvents})" &>${log} + if [ $? -eq 0 ]; then + echo -e "${GREEN} ${step} executed successfully ${NC}" + else + echo -e "${RED} ${step} failed ${NC}" + exit 1 fi - - if [ ${step} == transport ]; then - echo " " - echo -e "${BOLD} Run transport: ${macro}(\"${config}\",${nEvents}) ${NC}" - fi - - root -b -l -q "${macro}(\"${config}\",${nEvents})" &> ${log} + elif [ ${step} == transport ]; then + seed=$(expr $(getJsonVal "['accessory']['transport']['seed']")) + echo " " + echo -e "${BOLD} Run transport: ${macro}(\"${config}\",${nEvents},${seed}) ${NC}" + + root -b -l -q "${macro}(\"${config}\",${nEvents},${seed})" &>${log} + if [ $? -eq 0 ]; then echo -e "${GREEN} ${step} executed successfully ${NC}" else echo -e "${RED} ${step} failed ${NC}" - exit 1 + exit 1 fi fi + gzip -f ${log} rm -v .rootrc if [ ${step} == reconstruction ]; then - if [ "${isL1EffQA}" == true ]; then - rm -v *{core,moni,CA,Fair}* all_*.par - else - rm -v *{core,moni,CA,L1,Edep}* all_*.par - fi + if [ "${isL1EffQA}" == true ]; then + rm -v *{core,moni,CA,Fair}* all_*.par + else + rm -v *{core,moni,CA,L1,Edep}* all_*.par + fi fi if [ ${step} == digitization ]; then - rm -v *{moni,Fair}* all_*.par + rm -v *{moni,Fair}* all_*.par fi if [ ${step} == AT ]; then - rm -v *{core,CA,L1}* + rm -v *{core,CA,L1}* fi echo " " - end=`date +%s` - runtime=$((end-start)) + end=$(date +%s) + runtime=$((end - start)) echo "Runtime : ${runtime}s" echo " "