Skip to content

Commit 304cd20

Browse files
committed
Config for MLHEP fitter multitrial. Plot yields as points. Small adjustment in code for MLHEP file paths.
1 parent 5f71525 commit 304cd20

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"file_pattern": "/data8/majak/d2h-fitter/0325/results_prompt*/fits.root",
3-
"dir_pattern": "results_prompt-",
4-
"histoname": "hRawYields",
5-
"sel_histoname": "hRawYieldsChiSquare",
2+
"file_pattern": "/data8/majak/MLHEP/results-24022025-newtrain-multitrial-prompt*/LHC23pp_pass4/Results/resultsdatatot/yields_LcpKpi_Run3analysis.root",
3+
"dir_pattern": "results-24022025-newtrain-multitrial-prompt",
4+
"histoname": "hyields0",
5+
"sel_histoname": "hchi0",
66
"selection": "lambda x : x < 7.0",
7-
"pt_bins_min": [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16],
8-
"pt_bins_max": [1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 24],
7+
"pt_bins_min": [1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16],
8+
"pt_bins_max": [2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 24],
99
"x_axis": "Trial #",
1010
"y_axis": "Raw yield",
11-
"central_trial": "cheb",
12-
"outdir": "/data8/majak/multitrial",
11+
"central_trial": "",
12+
"outdir": "/data8/majak/multitrial/roofit",
1313
"outfile": "result-prompt"
1414
}

PWGHF/D2H/Macros/multitrial.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ def get_yields(cfg):
4141
with TFile.Open(filename) as fin:
4242
hist = fin.Get(cfg["histoname"])
4343
hist_sel = fin.Get(cfg["sel_histoname"])
44-
dirname = re.split("/", filename)[-2]
44+
if hist is None:
45+
print(f"No hist in {filename}")
46+
dirname = re.split("/", filename)[4] # [-2] for D2H fitter
4547
trial_name = dirname.replace(cfg["dir_pattern"], "")
4648
for ind, (pt_bin_min, pt_bin_max) in enumerate(zip(cfg["pt_bins_min"],
4749
cfg["pt_bins_max"])):
@@ -70,7 +72,7 @@ def plot_yields_trials(yields, yields_err, trials, cfg, pt_string, plot_pt_strin
7072
#plt.grid(linestyle="-", linewidth=2)
7173
x_axis = range(len(trials[pt_string]))
7274
ax.errorbar(x_axis, yields[pt_string], yerr=yields_err[pt_string],
73-
c="b", elinewidth=2.5, linewidth=4.0)
75+
fmt="o", c="b", elinewidth=2.5, linewidth=4.0)
7476
central_trial_ind = trials[pt_string].index(cfg["central_trial"])
7577
central_yield = yields[pt_string][central_trial_ind]
7678
ax.plot(x_axis, [central_yield] * len(x_axis), c="orange", linewidth=6.0)

0 commit comments

Comments
 (0)