Skip to content

Commit

Permalink
HF jets: Hard Probes 2024 Preliminaries (alisw#957)
Browse files Browse the repository at this point in the history
* Print database path when starting the analysis

* Improve parallelisation control of running variations

* D0 jets: Update variations

* Plotting: Add support for calculating y range within the plotting x range

* Systematics: Do not crop histograms and graphs along x

* Plotting: Plot all jet pt bins together. Crop along x.

* Plotting: Fix logger

* Fix plotting axes

* Show systematics box and the marker in the same entry of the legend.

* Do not plot horizontal error bars. Shrink syst. boxes horizontaly for nSD.

* Plotting: Sync style with Run 2 papers. Improve scaling, fix margins. Add function set_pad_heights.

* More scaling fixes for multiple panels

* Add ratio high/low pt jet

* Adjust zpar range

* Adjust legend position

* Plot Lc FF PYTHIA

* Add species. Process only real data.

* Add protection against division by zero

* Change plotted D0 pt jet bins

* Load all external objects

* Improve plotting options and counters

* Plot Run 2 D0 PYTHIA

* Take some functions out from make_plot

* Plot Run 3 D0 PYTHIA. Increase flexibility in selection of plotted objects.

* Plot Run 2 Lc data FF

* Disable pathological variations

* Enable simulation plotting

* Implement horizontal legend

* Implement arbitrary plotting order

* Adjust legend width

* Fix missing eta jet text

* Fix bin width for nsd

* Plot Run 2 D0 FF (Jakub)

* Adjust for new Nima's simulations. Fix marker for simulations.

* Add switches for figure blocks

* Plot Lc vs D0

* Add Lc/D0 panel

* Plot Lc/D0 FF sim

* Fix coordinate calculations

* Small adjustments

* Db changes for train 266172

* Revert "Db changes for train 266172"

This reverts commit d6a3464.

* Fix re-drawing of axes

* Plot Run 2 data together with Run 3 all jet pt. Decrease height of bottom panel.

* Start plot file name with the species.

* Add more switches and exceptions

* Add option to rebin Run 3 MC for Run 2 binning

* Adjust plotting order for Lc FF vs Run 2

* Use fixed Run 3 MC. Rebin it only for inclusive. Fix nSD bin width.

* Plot Run 3 D0 MC for all pt jet bins

* Local paths

* Update Run 3 MC

* Use dictionaries for names, colours, line styles of Run 3 MC.

* Rearrange lists of colours and markers. Move black/grey circles to the end.

* Introduce a scheme of colours and markers.

* Fix plotting of Lc FF MC

* Adjust legend positions

* Adjust Mode 2 line style.

* Adjust legends

* Add leading-track pT cut for inclusive jets

* Define variable for Run 2/3

* Add + in Lc symbol

* Do not plot run2_d0_sd_incl_data

* Lc preliminary

* Adjust margins

* D0 per pt jet preliminary

* D0 prelim

* Add marker in the ratio title

* Lc with Run 2 without MC

* Plot zg only with Run 2

* Plot Rg, nSD only with Run 2

* Adjust

* Fix comment

* Fixes

* Fixes

* Format

* Fix

* Fixes
  • Loading branch information
vkucera authored Oct 17, 2024
1 parent 0ca8a9f commit 87ee464
Show file tree
Hide file tree
Showing 7 changed files with 1,312 additions and 311 deletions.
26 changes: 13 additions & 13 deletions machine_learning_hep/analysis/do_systematics.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def do_jet_systematics(self, var: str):
input_histograms_default.append(input_file_default.Get(name_his))
if not input_histograms_default[iptjet]:
self.logger.critical(make_message_notfound(name_his, path_def))
self.crop_histogram(input_histograms_default[iptjet], var)
# self.crop_histogram(input_histograms_default[iptjet], var)
print(f"Default histogram ({range_ptjet[0]} to {range_ptjet[1]})")
print_histogram(input_histograms_default[iptjet], self.verbose)
# name_eff = f"h_ptjet-pthf_effnew_pr_{string_range_ptjet(range_ptjet)}"
Expand Down Expand Up @@ -411,7 +411,7 @@ def do_jet_systematics(self, var: str):
path_eff_file = path_eff.replace(self.string_default, string_catvar)
if not sys_var_histo_eff:
self.logger.critical(make_message_notfound(name_eff, path_eff_file))
self.crop_histogram(sys_var_histo, var)
# self.crop_histogram(sys_var_histo, var)
input_histograms_syscatvar.append(sys_var_histo)
input_histograms_eff.append(sys_var_histo_eff)
print_histogram(sys_var_histo_eff, self.verbose)
Expand Down Expand Up @@ -1017,8 +1017,8 @@ def do_jet_systematics(self, var: str):
leg_finalwsys = TLegend(0.7, 0.78, 0.85, 0.88)
setup_legend(leg_finalwsys)
leg_finalwsys.AddEntry(input_histograms_default[iptjet], "data", "P")
self.crop_histogram(input_histograms_default[iptjet], var)
self.crop_graph(tgsys[iptjet], var)
# self.crop_histogram(input_histograms_default[iptjet], var)
# self.crop_graph(tgsys[iptjet], var)
setup_histogram(input_histograms_default[iptjet], get_colour(0, 0))
y_min_g, y_max_g = get_y_window_gr([tgsys[iptjet]])
y_min_h, y_max_h = get_y_window_his([input_histograms_default[iptjet]])
Expand All @@ -1032,9 +1032,9 @@ def do_jet_systematics(self, var: str):
# input_histograms_default[iptjet].GetXaxis().SetRangeUser(
# round(obs_gen_min, 2), round(obs_gen_max, 2)
# )
input_histograms_default[iptjet].GetXaxis().SetRangeUser(
round(x_range[var][0], 2), round(x_range[var][1], 2)
)
# input_histograms_default[iptjet].GetXaxis().SetRangeUser(
# round(x_range[var][0], 2), round(x_range[var][1], 2)
# )
input_histograms_default[iptjet].SetTitle("")
input_histograms_default[iptjet].SetXTitle(latex_obs)
input_histograms_default[iptjet].SetYTitle(latex_y)
Expand Down Expand Up @@ -1091,9 +1091,9 @@ def do_jet_systematics(self, var: str):
crelativesys.SetRightMargin(0.25)
leg_relativesys = TLegend(0.77, 0.2, 0.95, 0.85)
setup_legend(leg_relativesys, textsize=self.fontsize)
for g in tgsys_cat[iptjet]:
self.crop_graph(g, var)
self.crop_histogram(h_default_stat_err[iptjet], var)
# for g in tgsys_cat[iptjet]:
# self.crop_graph(g, var)
# self.crop_histogram(h_default_stat_err[iptjet], var)
y_min_g, y_max_g = get_y_window_gr(tgsys_cat[iptjet])
y_min_h, y_max_h = get_y_window_his([h_default_stat_err[iptjet]])
y_min = min(y_min_g, y_min_h)
Expand Down Expand Up @@ -1198,9 +1198,9 @@ def do_jet_systematics(self, var: str):
# leg_relativesys_gr = TLegend(.77, .2, 0.95, .85)
leg_relativesys_gr = TLegend(0.77 * 9 / 10, 0.5, 0.95, 0.85) # scale for width 900 -> 1000
setup_legend(leg_relativesys_gr, textsize=self.fontsize)
for g in tgsys_gr[iptjet]:
self.crop_graph(g, var)
self.crop_histogram(h_default_stat_err[iptjet], var)
# for g in tgsys_gr[iptjet]:
# self.crop_graph(g, var)
# self.crop_histogram(h_default_stat_err[iptjet], var)
y_min_g, y_max_g = get_y_window_gr(tgsys_gr[iptjet])
y_min_h, y_max_h = get_y_window_his([h_default_stat_err[iptjet]])
y_min = min(y_min_g, y_min_h)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ LcJet_pp:
usejetptbinned_deff: false
doeff_resp: true #efficiency correction for the response matrix
unmatched_gen: true
latexnamehadron: "#Lambda_{c}"
latexnamehadron: "#Lambda_{c}^{#plus}"
latexnamedecay: "pK#pi"
var_binning2: pt_jet
var_binning2_gen: pt_gen_jet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ categories:
rms_both_sides: true
variations:
bkgfunc:
activate: [yes]
activate: [no]
label: ["bkg. func."]
diffs:
analysis:
Expand Down Expand Up @@ -119,7 +119,7 @@ categories:
model:
fn: 'SUM::refl(frac_l[0.,1.]*refl_l, refl_r)'
- level: mcrefl
ptrange: [12., 36.]
ptrange: [12., 48.]
datasel: mcrefl
range: [1.40, 2.4]
components:
Expand Down Expand Up @@ -172,7 +172,7 @@ categories:
model:
fn: 'SUM::sigrefl(frac_refl[0.,1.]*refl, sig)'
- level: mc
ptrange: [12., 36.]
ptrange: [12., 48.]
range: [1.40, 2.40]
fix_params: ['frac_l', 'mean_l', 'mean_r', 'sigma_l', 'sigma_r', 'frac_wide', 'sigma_g1', 'sigma_wide']
components:
Expand Down Expand Up @@ -262,7 +262,7 @@ categories:
jet_obs:
todo: [0]
massmin:
activate: [yes]
activate: [no]
label:
- "#it{m} min. 1.75"
diffs:
Expand Down Expand Up @@ -346,7 +346,7 @@ categories:
model:
fn: 'SUM::refl(frac_l[0.,1.]*refl_l, refl_r)'
- level: mcrefl
ptrange: [12., 36.]
ptrange: [12., 48.]
datasel: mcrefl
range: [1.40, 2.4]
components:
Expand Down Expand Up @@ -399,7 +399,7 @@ categories:
model:
fn: 'SUM::sigrefl(frac_refl[0.,1.]*refl, sig)'
- level: mc
ptrange: [12., 36.]
ptrange: [12., 48.]
range: [1.40, 2.40]
fix_params: ['frac_l', 'mean_l', 'mean_r', 'sigma_l', 'sigma_r', 'frac_wide', 'sigma_g1', 'sigma_wide']
components:
Expand Down Expand Up @@ -678,7 +678,7 @@ categories:
signal: [-2.5, 2.5] # variation
right: [3., 5.5]
ranges:
activate: [yes, yes, yes, yes, yes, yes, yes, yes]
activate: [yes, yes, yes, yes, no, no, no, no]
label:
- "SB 3#minus6#it{#sigma}"
- "SB 3#minus5#it{#sigma}"
Expand Down Expand Up @@ -866,7 +866,7 @@ categories:
rms_both_sides: true
variations:
flatness:
activate: [yes, yes, yes, yes, yes, yes, yes, yes, yes, yes]
activate: [yes, yes, yes, yes, yes, yes, yes, yes, yes, no]
label: ["flat 0.1", "flat 0.2", "flat 0.3", "flat 0.4", "flat 0.5", "flat 0.6", "flat 0.7", "flat 0.8", "flat 0.9", "flat 1.0"]
diffs:
analysis:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ categories:
rms_both_sides: true
variations:
flatness:
activate: [yes, yes, yes, yes, yes, yes, yes, yes, yes, yes]
activate: [yes, yes, yes, yes, yes, yes, yes, yes, yes, no]
label: ["flat 0.1", "flat 0.2", "flat 0.3", "flat 0.4", "flat 0.5", "flat 0.6", "flat 0.7", "flat 0.8", "flat 0.9", "flat 1.0"]
diffs:
analysis:
Expand Down Expand Up @@ -559,7 +559,7 @@ categories:
rms_both_sides: true
variations:
ml:
activate: [no, no, no, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes]
activate: [no, no, no, yes, yes, yes, yes, no, yes, yes, yes, yes, yes]
label:
# default: working point (for tests, should be same as the default result)
# null: no cuts (for tests, whatever was applied on Hyperloop)
Expand Down
Loading

0 comments on commit 87ee464

Please sign in to comment.