Skip to content

Commit

Permalink
Merge pull request cms-sw#40 from hatakeyamak/pfvalidation-10_5_0_pre…
Browse files Browse the repository at this point in the history
…1-master

Pfvalidation 10 5 0 pre1 master
  • Loading branch information
juska committed Mar 14, 2019
2 parents 5728894 + dff8ea3 commit 224d111
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Validation/RecoParticleFlow/test/addResponse.py
Expand Up @@ -83,15 +83,15 @@ def pf_resolution(sforig, treepath):
err = std/mean * math.sqrt(std_error**2 / std**2 + mean_error**2 / mean**2)

#fill the pt-dependent resolution plot
preso.SetBinContent(idx, std/mean)
preso.SetBinError(idx, err)
preso.SetBinContent(idx+1, std/mean)
preso.SetBinError(idx+1, err)

#fill the pt-dependent response plot with the mean of the response.
response_pt.SetBinContent(idx, mean)
response_pt.SetBinContent(idx+1, mean)
err2 = 0.0
if std > 0.0 and mean > 0.0:
err2 = mean * math.sqrt(std_error**2 / std**2 + mean_error**2 / mean**2)
response_pt.SetBinError(idx, err2)
response_pt.SetBinError(idx+1, err2)

fout.Write()
fout.Close()
Expand Down
17 changes: 9 additions & 8 deletions Validation/RecoParticleFlow/test/addResponseAndResolution.py
Expand Up @@ -102,11 +102,12 @@ def add_response_and_resolution(sforig, treepath):
response, response_unc, resolution, resolution_unc = \
help.fit_response(h,ngenjet,elow,recoptcut)

preso.SetBinContent(idx,resolution)
preso.SetBinError(idx,resolution_unc)
if (idx>0): ## skip the lowest pt bin for now, as the fit needs to be carefully validated
preso.SetBinContent(idx+1,resolution)
preso.SetBinError(idx+1,resolution_unc)

response_pt.SetBinContent(idx,response)
response_pt.SetBinError(idx,response_unc)
response_pt.SetBinContent(idx+1,response)
response_pt.SetBinError(idx+1,response_unc)

fout.Write()

Expand Down Expand Up @@ -143,15 +144,15 @@ def add_response_and_resolution(sforig, treepath):
err = std/mean * math.sqrt(std_error**2 / std**2 + mean_error**2 / mean**2)

#fill the pt-dependent resolution plot
preso_rms.SetBinContent(idx, std/mean)
preso_rms.SetBinError(idx, err)
preso_rms.SetBinContent(idx+1, std/mean)
preso_rms.SetBinError(idx+1, err)

#fill the pt-dependent response plot with the mean of the response.
response_pt_rms.SetBinContent(idx, mean)
response_pt_rms.SetBinContent(idx+1, mean)
err2 = 0.0
if std > 0.0 and mean > 0.0:
err2 = mean * math.sqrt(std_error**2 / std**2 + mean_error**2 / mean**2)
response_pt_rms.SetBinError(idx, err2)
response_pt_rms.SetBinError(idx+1, err2)

fout.Write()
fout.Close()
Expand Down
2 changes: 2 additions & 0 deletions Validation/RecoParticleFlow/test/compare.py
Expand Up @@ -98,6 +98,7 @@ def parse_args():

if args.doResponsePlots:
plots += [("JetResponse", "reso_pt", ["preso_eta05", "preso_eta13","preso_eta21","preso_eta25","preso_eta30"])]
plots += [("JetResponse", "reso_pt_rms", ["preso_eta05_rms", "preso_eta13_rms","preso_eta21_rms","preso_eta25_rms","preso_eta30_rms"])]
plots += [("JetResponse", "response_pt", ["presponse_eta05", "presponse_eta13", "presponse_eta21", "presponse_eta25", "presponse_eta30"])]
for iptbin in range(len(ptbins)-1):
pthistograms = []
Expand Down Expand Up @@ -133,6 +134,7 @@ def main():
#plot-dependent style options
plot_opts = {
"reso_pt": {"xlog": True},
"reso_pt_rms": {"xlog": True},
"response_pt": {"xlog": True},
}
for iptbin in range(len(ptbins)-1):
Expand Down

0 comments on commit 224d111

Please sign in to comment.