Skip to content

Commit cd68559

Browse files
committed
Working cross section estimators. Only multiclass optimization remains
1 parent a7ae86a commit cd68559

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

machine_learning_hep/analysis/analyzerdhadrons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def makenormyields(self): # pylint: disable=import-outside-toplevel, too-many-b
293293

294294
yield_filename = self.make_file_path(self.d_resultsallpdata, self.yields_filename, "root",
295295
None, [self.case, self.typean])
296-
fileouteff = "/data8/majak/crosssec/merged_yields_fdd_approvals_fd_0.00_0.00_0.00_0.00_0.00_0.00_0.00_0.00_0.00.root"
296+
yield_filename = "/data8/majak/crosssec/merged_yields_fdd_approvals_fd_0.00_0.00_0.00_0.00_0.00_0.00_0.00_0.00_0.00.root"
297297
if not os.path.exists(yield_filename):
298298
self.logger.fatal(
299299
"Yield file %s could not be found", yield_filename)

machine_learning_hep/data/data_run3/database_ml_parameters_LcToPKPi_multiclass.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,11 +380,12 @@ LcpKpi:
380380
probcutoptimal: [[0.02, 0.0, %fd12%], [0.02, 0.0, %fd23%], [0.02, 0.0, %fd34%], [0.06, 0.0, %fd45%], [0.06, 0.0, %fd56%], [0.10, 0.0, %fd68%], [0.20, 0.0, %fd812%], [%bkg1216%, 0.0, %fd1216%], [%bkg1624%, 0.0, %fd1624%]] #list of nbins
381381
analysis:
382382
anahptspectrum: "LctopKpi" #D0Kpi, DplusKpipi, DstarD0pi, DsKKpi, LctopKpi, LcK0Sp
383-
fd_method: "dd" # fc, Nb
383+
fd_method: "dd" # fc, Nb, dd, dd_N
384384
crosssec_prompt: True # True for prompt, False for non-prompt
385385
cctype: "pp"
386386
sigmamb: 59.4e+9 # 50.87e+9 pp5TeV, 57.8e+9 pp13TeV, 59.4e+9 pp Run3, pb
387-
inputfonllpred: /data8/majak/fdd-results/07112024-check-approvals/fdd-results-merged-sept-yields-eff/CutVarLc_pp13TeV_LHC24d3.root #inputfonllpred: data/fonll/DmesonLcPredictions_13TeV_y05_FFptDepLHCb_BRpythia8_PDG2020.root
387+
inputfonllpred: /data8/majak/fdd-results/07112024-check-approvals/fdd-results-merged-sept-yields-eff/CutVarLc_pp13TeV_LHC24d3.root
388+
#inputfonllpred: data/fonll/DmesonLcPredictions_13TeV_y05_FFptDepLHCb_BRpythia8_PDG2020.root
388389
dir_general_plots: analysis_plots
389390

390391
Run3analysis:

machine_learning_hep/hf_analysis_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def compute_fraction_dd(
377377
der_same_same = (acc_eff_same * (yield_times_acceff_same + yield_times_acceff_other) - \
378378
acc_eff_same**2 * corryields_same) / denom
379379
der_same_other = -acc_eff_same * acc_eff_other * corryields_same / denom
380-
unc = np.sqrt(der_same_same**2 * cov_same + der_same_other * cov_other + \
380+
unc = np.sqrt(der_same_same**2 * cov_same + der_same_other**2 * cov_other + \
381381
2 * der_same_same * der_same_other * cov_comb)
382382
print(f"denom {denom} der_same_same {der_same_same} der_same_other {der_same_other} " \
383383
f"cov same {cov_same} cov other {cov_other} cov comb {cov_comb} final unc {unc}")

machine_learning_hep/hf_pt_spectrum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def hf_pt_spectrum(channel, # pylint: disable=too-many-locals, too-many-argument
206206
rawy_unc = histos["rawyields"].GetBinError(i_pt + 1)
207207
eff_times_acc_prompt = histos["acceffp"].GetBinContent(i_pt + 1)
208208
eff_times_acc_nonprompt = histos["acceffnp"].GetBinContent(i_pt + 1)
209-
if frac_method != "dd":
209+
if frac_method not in ("dd", "dd_N"):
210210
ptmin_fonll = (
211211
histos["FONLL"]["nonprompt"]["central"].GetXaxis().FindBin(ptmin * 1.0001)
212212
)
@@ -267,6 +267,7 @@ def hf_pt_spectrum(channel, # pylint: disable=too-many-locals, too-many-argument
267267
histos["covariances"][1 - pnp_ind].GetBinContent(i_pt + 1),
268268
histos["covariances"][2].GetBinContent(i_pt + 1))
269269
elif frac_method == "dd_N":
270+
pnp_ind = 0 if crosssec_prompt else 1
270271
frac = [histos["corryields_fdd"][pnp_ind].GetBinContent(i_pt + 1)] * 3
271272

272273

0 commit comments

Comments
 (0)