@@ -67,6 +67,12 @@ def main(config):
6767 is_draw_title_cov = cfg .get ("is_draw_title" , {}).get ("cov" , False )
6868 is_draw_title_unc = cfg .get ("is_draw_title" , {}).get ("unc" , True )
6969
70+ is_save_canvas_as_macro_rawy = cfg .get ("is_save_canvas_as_macro" , {}).get ("rawy" , False )
71+ is_save_canvas_as_macro_eff = cfg .get ("is_save_canvas_as_macro" , {}).get ("eff" , False )
72+ is_save_canvas_as_macro_frac = cfg .get ("is_save_canvas_as_macro" , {}).get ("frac" , False )
73+ is_save_canvas_as_macro_cov = cfg .get ("is_save_canvas_as_macro" , {}).get ("cov" , False )
74+ is_save_canvas_as_macro_unc = cfg .get ("is_save_canvas_as_macro" , {}).get ("unc" , False )
75+
7076 if cfg ["central_efficiency" ]["computerawfrac" ]:
7177 infile_name = os .path .join (cfg ["central_efficiency" ]["inputdir" ], cfg ["central_efficiency" ]["inputfile" ])
7278 infile_central_eff = ROOT .TFile .Open (infile_name )
@@ -223,33 +229,43 @@ def main(config):
223229 canv_rawy .Write ()
224230 for _ , hist in histos_rawy .items ():
225231 hist .Write ()
232+ if (is_save_canvas_as_macro_rawy ):
233+ canv_rawy .SaveAs (f"canv_rawy_{ ipt + 1 } .C" )
226234
227235 hist_bin_title_unc = hist_bin_title if is_draw_title_unc else ""
228236 canv_unc , histos_unc , leg_unc = minimiser .plot_uncertainties (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_unc )
229237 output .cd ()
230238 canv_unc .Write ()
231239 for _ , hist in histos_unc .items ():
232240 hist .Write ()
241+ if (is_save_canvas_as_macro_unc ):
242+ canv_unc .SaveAs (f"canv_unc_{ ipt + 1 } .C" )
233243
234244 hist_bin_title_eff = hist_bin_title if is_draw_title_eff else ""
235245 canv_eff , histos_eff , leg_e = minimiser .plot_efficiencies (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_eff )
236246 output .cd ()
237247 canv_eff .Write ()
238248 for _ , hist in histos_eff .items ():
239249 hist .Write ()
250+ if (is_save_canvas_as_macro_eff ):
251+ canv_eff .SaveAs (f"canv_eff_{ ipt + 1 } .C" )
240252
241253 hist_bin_title_frac = hist_bin_title if is_draw_title_frac else ""
242254 canv_frac , histos_frac , leg_f = minimiser .plot_fractions (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_frac )
243255 output .cd ()
244256 canv_frac .Write ()
245257 for _ , hist in histos_frac .items ():
246258 hist .Write ()
259+ if (is_save_canvas_as_macro_frac ):
260+ canv_frac .SaveAs (f"canv_frac_{ ipt + 1 } .C" )
247261
248262 hist_bin_title_cov = hist_bin_title if is_draw_title_cov else ""
249263 canv_cov , histo_cov = minimiser .plot_cov_matrix (True , f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_cov )
250264 output .cd ()
251265 canv_cov .Write ()
252266 histo_cov .Write ()
267+ if (is_save_canvas_as_macro_cov ):
268+ canv_cov .SaveAs (f"canv_cov_{ ipt + 1 } .C" )
253269 else :
254270 print (f"Minimization for pT { pt_min } , { pt_max } not successful" )
255271 canv_rawy = ROOT .TCanvas ("c_rawy_minimization_error" , "Minimization error" , 500 , 500 )
0 commit comments