Skip to content
Snippets Groups Projects
Commit dbac5286 authored by Ralf Kliemt's avatar Ralf Kliemt Committed by Florian Uhlig
Browse files

json config: pass a seed to transport

parent 46886051
No related branches found
No related tags found
1 merge request!1978json config: pass a seed to transport
Pipeline #31992 passed
......@@ -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,
......
......@@ -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,
......
......@@ -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 " "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment