@@ -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 )
@@ -212,33 +218,43 @@ def main(config):
212218 canv_rawy .Write ()
213219 for _ , hist in histos_rawy .items ():
214220 hist .Write ()
221+ if (is_save_canvas_as_macro_rawy ):
222+ canv_rawy .SaveAs (f"canv_rawy_{ ipt + 1 } .C" )
215223
216224 hist_bin_title_unc = hist_bin_title if is_draw_title_unc else ""
217225 canv_unc , histos_unc , leg_unc = minimiser .plot_uncertainties (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_unc )
218226 output .cd ()
219227 canv_unc .Write ()
220228 for _ , hist in histos_unc .items ():
221229 hist .Write ()
230+ if (is_save_canvas_as_macro_unc ):
231+ canv_unc .SaveAs (f"canv_unc_{ ipt + 1 } .C" )
222232
223233 hist_bin_title_eff = hist_bin_title if is_draw_title_eff else ""
224234 canv_eff , histos_eff , leg_e = minimiser .plot_efficiencies (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_eff )
225235 output .cd ()
226236 canv_eff .Write ()
227237 for _ , hist in histos_eff .items ():
228238 hist .Write ()
239+ if (is_save_canvas_as_macro_eff ):
240+ canv_eff .SaveAs (f"canv_eff_{ ipt + 1 } .C" )
229241
230242 hist_bin_title_frac = hist_bin_title if is_draw_title_frac else ""
231243 canv_frac , histos_frac , leg_f = minimiser .plot_fractions (f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_frac )
232244 output .cd ()
233245 canv_frac .Write ()
234246 for _ , hist in histos_frac .items ():
235247 hist .Write ()
248+ if (is_save_canvas_as_macro_frac ):
249+ canv_frac .SaveAs (f"canv_frac_{ ipt + 1 } .C" )
236250
237251 hist_bin_title_cov = hist_bin_title if is_draw_title_cov else ""
238252 canv_cov , histo_cov = minimiser .plot_cov_matrix (True , f"_pt{ pt_min } _{ pt_max } " , hist_bin_title_cov )
239253 output .cd ()
240254 canv_cov .Write ()
241255 histo_cov .Write ()
256+ if (is_save_canvas_as_macro_cov ):
257+ canv_cov .SaveAs (f"canv_cov_{ ipt + 1 } .C" )
242258
243259 canv_combined = ROOT .TCanvas (f"canv_combined_{ ipt } " , "" , 1000 , 1000 )
244260 canv_combined .Divide (2 , 2 )
0 commit comments