Skip to content

Commit

Permalink
Working cross section estimators. Only multiclass optimization remains
Browse files Browse the repository at this point in the history
  • Loading branch information
saganatt committed Jan 13, 2025
1 parent a7ae86a commit cd68559
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion machine_learning_hep/analysis/analyzerdhadrons.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def makenormyields(self): # pylint: disable=import-outside-toplevel, too-many-b

yield_filename = self.make_file_path(self.d_resultsallpdata, self.yields_filename, "root",
None, [self.case, self.typean])
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"
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"
if not os.path.exists(yield_filename):
self.logger.fatal(
"Yield file %s could not be found", yield_filename)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,12 @@ LcpKpi:
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
analysis:
anahptspectrum: "LctopKpi" #D0Kpi, DplusKpipi, DstarD0pi, DsKKpi, LctopKpi, LcK0Sp
fd_method: "dd" # fc, Nb
fd_method: "dd" # fc, Nb, dd, dd_N
crosssec_prompt: True # True for prompt, False for non-prompt
cctype: "pp"
sigmamb: 59.4e+9 # 50.87e+9 pp5TeV, 57.8e+9 pp13TeV, 59.4e+9 pp Run3, pb
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
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
dir_general_plots: analysis_plots

Run3analysis:
Expand Down
2 changes: 1 addition & 1 deletion machine_learning_hep/hf_analysis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def compute_fraction_dd(
der_same_same = (acc_eff_same * (yield_times_acceff_same + yield_times_acceff_other) - \
acc_eff_same**2 * corryields_same) / denom
der_same_other = -acc_eff_same * acc_eff_other * corryields_same / denom
unc = np.sqrt(der_same_same**2 * cov_same + der_same_other * cov_other + \
unc = np.sqrt(der_same_same**2 * cov_same + der_same_other**2 * cov_other + \
2 * der_same_same * der_same_other * cov_comb)
print(f"denom {denom} der_same_same {der_same_same} der_same_other {der_same_other} " \
f"cov same {cov_same} cov other {cov_other} cov comb {cov_comb} final unc {unc}")
Expand Down
3 changes: 2 additions & 1 deletion machine_learning_hep/hf_pt_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def hf_pt_spectrum(channel, # pylint: disable=too-many-locals, too-many-argument
rawy_unc = histos["rawyields"].GetBinError(i_pt + 1)
eff_times_acc_prompt = histos["acceffp"].GetBinContent(i_pt + 1)
eff_times_acc_nonprompt = histos["acceffnp"].GetBinContent(i_pt + 1)
if frac_method != "dd":
if frac_method not in ("dd", "dd_N"):
ptmin_fonll = (
histos["FONLL"]["nonprompt"]["central"].GetXaxis().FindBin(ptmin * 1.0001)
)
Expand Down Expand Up @@ -267,6 +267,7 @@ def hf_pt_spectrum(channel, # pylint: disable=too-many-locals, too-many-argument
histos["covariances"][1 - pnp_ind].GetBinContent(i_pt + 1),
histos["covariances"][2].GetBinContent(i_pt + 1))
elif frac_method == "dd_N":
pnp_ind = 0 if crosssec_prompt else 1
frac = [histos["corryields_fdd"][pnp_ind].GetBinContent(i_pt + 1)] * 3


Expand Down

0 comments on commit cd68559

Please sign in to comment.