Skip to content

Commit

Permalink
Adding the possibility to suppress video output
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanopolitano committed Aug 7, 2024
1 parent 35f576c commit 9925058
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
3 changes: 2 additions & 1 deletion run3/flow/get_vn_vs_mass.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ def get_vn_vs_mass(fitConfigFileName, centClass, inFileName,
gvnUncSecPeak.Draw('pez same')
canvVnUnc.Modified()
canvVnUnc.Update()
input('Press Enter to continue...')
if not batch:
input('Press Enter to continue...')

#save output histos
print(f'Saving output to {outputdir}')
Expand Down
18 changes: 11 additions & 7 deletions run3/flow/run_full_flow_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def run_full_analysis(config,
skip_resolution,
skip_projection,
skip_vn,
skip_efficiency
skip_efficiency,
batch
):
"""
function for full analysis
Expand All @@ -36,6 +37,7 @@ def run_full_analysis(config,
- skip_projection (bool): skip projection extraction
- skip_vn (bool): skip raw yield extraction
- skip_efficiency (bool): skip efficiency estimation
- batch (bool): suppress video output
"""

# get all parameters needed
Expand Down Expand Up @@ -88,10 +90,6 @@ def run_full_analysis(config,
reso_file += f"reso{vn_method}{suffix}.root"
if resolution:
reso_file = resolution

#if resolution != 1.:
#elif resolution:
# reso_file = resolution
else:
reso_file = 1.
reso_file_withopt = f" -r {reso_file}"
Expand All @@ -110,7 +108,10 @@ def run_full_analysis(config,
outputdir_rawyield = f"-o {outputdir}/ry"
proj_file = f"{outputdir}/proj/"
proj_file += f"proj{suffix}.root"
command_vn = f"python3 get_vn_vs_mass.py {config} {centrality} {proj_file} {outputdir_rawyield} {suffix_withopt} {vn_method_withopt}"
if not batch:
command_vn = f"python3 get_vn_vs_mass.py {config} {centrality} {proj_file} {outputdir_rawyield} {suffix_withopt} {vn_method_withopt}"
else:
command_vn = f"python3 get_vn_vs_mass.py {config} {centrality} {proj_file} {outputdir_rawyield} {suffix_withopt} {vn_method_withopt} --batch"
print("\n\033[92m Starting vn extraction\033[0m")
print(f"\033[92m {command_vn}\033[0m")
os.system(command_vn)
Expand Down Expand Up @@ -158,6 +159,8 @@ def run_full_analysis(config,
help="skip vn estimation")
parser.add_argument("--skip_efficiency", action="store_true", default=False,
help="skip efficiency estimation")
parser.add_argument("--batch", action="store_true", default=False,
help="suppress video output")
args = parser.parse_args()

run_full_analysis(
Expand All @@ -172,5 +175,6 @@ def run_full_analysis(config,
args.skip_resolution,
args.skip_projection,
args.skip_vn,
args.skip_efficiency
args.skip_efficiency,
args.batch
)
4 changes: 2 additions & 2 deletions run3/flow/systematics/multitrial.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ parallel_func() {
if [ -n "$wagon_id" ]; then
# echo in magenta
echo -e "\e[35m python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency -w $wagon_id \e[0m"
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency -w $wagon_id -s $suffix
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency -w $wagon_id -s $suffix --batch
else
# echo in magenta
echo -e "\e[35m python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency \e[0m"
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency -s $suffix
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency -s $suffix --batch
fi
}
export -f parallel_func
Expand Down
4 changes: 2 additions & 2 deletions run3/flow/systematics/reso_syst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ parallel_func() {
# enter if wagon_id is not empty
if [ -n "$wagon_id" ]; then
echo -e "\e[35m python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent -v $vn_method -r 1 $skip_resolution $skip_efficiency -w $wagon_id \e[0m"
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent -v $vn_method -r 1 -w $wagon_id -s $suffix --skip_resolution --skip_efficiency
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent -v $vn_method -r 1 -w $wagon_id -s $suffix --skip_resolution --skip_efficiency --batch
else
echo -e "\e[35m python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent $skip_resolution -v $vn_method -r $res_file $skip_efficiency \e[0m"
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent -v $vn_method -r 1 -s $suffix --skip_resolution --skip_efficiency --skip_projection
python3 run_full_flow_analysis.py $config_file $anres_dir -o $output_dir -c $cent -v $vn_method -r 1 -s $suffix --skip_resolution --skip_efficiency --batch
fi
}
export -f parallel_func
Expand Down

0 comments on commit 9925058

Please sign in to comment.