File tree Expand file tree Collapse file tree 4 files changed +5
-8
lines changed
machine_learning_hep/scripts-dhadrons Expand file tree Collapse file tree 4 files changed +5
-8
lines changed Original file line number Diff line number Diff 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)} " \
Original file line number Diff line number Diff 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 )} " \
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change 55import pandas as pd
66
77"""
8-
98file: check_parquet.py
109brief: Examples of different checks on any parquet file produced by the MLHEP preprocessing steps.
1110usage: python check_parquet.py AnalysisResultsReco_fPt1_2.parquet
You can’t perform that action at this time.
0 commit comments