Skip to content

Commit 36a966f

Browse files
committed
More manual fixes in py files
1 parent 9a84e1a commit 36a966f

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

machine_learning_hep/scripts-dhadrons/adjusting-run2-run3/add_pt_bins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ def main():
5454
# hist.GetBinContent(hist.GetNbinsX()) * hist.GetBinWidth(hist.GetNbinsX())) /\
5555
# width_combined))
5656
# hist2.SetBinError(last_bin,
57-
# math.sqrt((hist.GetBinError(hist.GetNbinsX() - 1) * hist.GetBinWidth(hist.GetNbinsX() - 1) /\
58-
# width_combined) **2 +\
57+
# math.sqrt((hist.GetBinError(hist.GetNbinsX() - 1) * hist.GetBinWidth(hist.GetNbinsX() - 1) \
58+
# / width_combined) **2 +\
5959
# (hist.GetBinError(hist.GetNbinsX()) * hist.GetBinWidth(hist.GetNbinsX()) /\
6060
# width_combined) ** 2))
6161
# print(f"Setting bin {last_bin} low edge {hist2.GetBinLowEdge(last_bin)} " \

machine_learning_hep/scripts-dhadrons/adjusting-run2-run3/modify_crosssec_run2.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ def main():
5252
bin1 = merge_bins[ind]
5353
bin2 = merge_bins[ind] + 1
5454
weight_sum = hist.GetBinWidth(bin1) + hist.GetBinWidth(bin2)
55-
average = hist.GetBinContent(bin1) * hist.GetBinWidth(bin1) +\
56-
hist.GetBinContent(bin2) * hist.GetBinWidth(bin2)
5755
hist2.SetBinContent(binn,
5856
(hist.GetBinContent(bin1) * hist.GetBinWidth(bin1) +\
5957
hist.GetBinContent(bin2) * hist.GetBinWidth(bin2)) /\
6058
weight_sum)
61-
hist2.SetBinError(binn, math.sqrt(((hist.GetBinWidth(bin1) * hist.GetBinError(bin1)) / weight_sum) ** 2. +\
62-
((hist.GetBinWidth(bin2) * hist.GetBinError(bin2)) / weight_sum) ** 2.))
59+
hist2.SetBinError(binn,
60+
math.sqrt(((hist.GetBinWidth(bin1) * hist.GetBinError(bin1)) / weight_sum) ** 2. +\
61+
((hist.GetBinWidth(bin2) * hist.GetBinError(bin2)) / weight_sum) ** 2.))
6362
ind += 1
6463
print(f"New bin {binn} low edge {hist2.GetBinLowEdge(binn)} "\
6564
f"up edge {hist2.GetXaxis().GetBinUpEdge(binn)} "\

machine_learning_hep/scripts-dhadrons/adjusting-run2-run3/remove_high_pt.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def main():
2626
args = parser.parse_args()
2727

2828
with TFile(args.filename) as fin, TFile(args.outname, "recreate") as fout:
29-
objnames = fin.GetListOfKeys()
3029
histnames = [key.GetName() for key in fin.GetListOfKeys() if args.histname in key.GetName()]
3130
for histname in histnames:
3231
hist = fin.Get(histname)

machine_learning_hep/scripts-dhadrons/debugging/check_parquet.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import pandas as pd
66

77
"""
8-
98
file: check_parquet.py
109
brief: Examples of different checks on any parquet file produced by the MLHEP preprocessing steps.
1110
usage: python check_parquet.py AnalysisResultsReco_fPt1_2.parquet

0 commit comments

Comments
 (0)