2 MECModelEnuComparisons.py: 3 Comparisons of the Enu distributions for various MEC models. 4 Origin of plots used in Fig. 14 of Doc 23264 and in the xsec tuning paper. 6 Original author: J. Wolcott <jwolcott@fnal.gov> 7 Date: April 2017 (modified for paper, Oct 2019) 17 "DefaultPlusMECWithNC_MEC": ROOT.kOrange-1,
18 "LocalFGNievesQEAndMEC_MEC": ROOT.kRed,
19 "Martini": ROOT.kBlue,
24 "DefaultPlusMECWithNC_MEC":
"Empirical MEC",
25 "LocalFGNievesQEAndMEC_MEC":
"Val#grave{e}ncia MEC",
26 "Martini":
"Lyon MEC",
30 DRAW_ORDER = [
"DefaultPlusMECWithNC_MEC",
"LocalFGNievesQEAndMEC_MEC",
"Martini",
"SuSA"]
32 OUT_DIR =
"/nova/ana/users/jwolcott/2p2h_tuning/paper" 33 OUT_TYPES = (
"png",
"pdf")
38 for out_type
in out_types:
39 c.SaveAs(
"%s.%s" % (name_stub, out_type))
44 "DefaultPlusMECWithNC_MEC":
"/cvmfs/nova.opensciencegrid.org/externals/genie_xsec/v2_12_0/NULL/DefaultPlusMECWithNC/data/xsec_graphs.root",
45 "LocalFGNievesQEAndMEC_MEC":
"/cvmfs/nova.opensciencegrid.org/externals/genie_xsec/v2_12_0/NULL/LocalFGNievesQEAndMEC/data/xsec_graphs.root",
48 "Martini":
"/nova/ana/xsec_tuning/2019_paper/Martini_MEC_sigma.root",
49 "SuSA":
"/nova/ana/xsec_tuning/2019_paper/SuSA_MEC_sigma.root" 53 for model, fname
in SPLINE_FILES.iteritems():
55 g = graphs[model] = f.Get(
"nu_mu_C12/mec_cc")
57 graphs[model] = f.Get(
"xsec_graph")
60 leg = ROOT.TLegend(0.35, 0.65, 0.85, 0.9)
64 for gname
in DRAW_ORDER:
65 if gname
not in graphs:
68 g.SetLineColor(COLORS[gname])
70 leg.AddEntry(g, NAMES[gname],
"l")
79 g = graphs[
"DefaultPlusMECWithNC_MEC"]
80 g.GetXaxis().SetRangeUser(0, 10)
81 g.GetYaxis().SetRangeUser(0, 3)
82 g.SetTitle(
";E_{#nu} (GeV);Total cross section (10^{-39} cm^{2})")
83 SaveCanvas(c, os.path.join(OUT_DIR,
"sigma_comparison"))
89 for pt_num
in range(graphs[
"DefaultPlusMECWithNC_MEC"].GetN()):
90 graphs[
"DefaultPlusMECWithNC_MEC"].GetPoint(pt_num, x, y)
94 EmpMEC3GeV = graphs[
"DefaultPlusMECWithNC_MEC"].Eval(3)
95 EmpMEC10GeV = graphs[
"DefaultPlusMECWithNC_MEC"].Eval(10)
98 for gname
in DRAW_ORDER:
99 if gname
not in graphs:
103 g.GetPoint(g.GetN() - 1, x, y)
106 norm = EmpMEC10GeV / g.Eval(10)
108 norm = EmpMEC3GeV / g.Eval(3)
111 for pt_num
in range(g.GetN()):
112 g.GetPoint(pt_num, x, y)
115 norm = EmpMECmax / maximum
116 gp = altgraphs[gname] = ROOT.TGraph()
117 for pt_num
in range(g.GetN()):
118 g.GetPoint(pt_num, x, y)
119 gp.SetPoint(pt_num, x, y * norm)
122 altmp = ROOT.TMultiGraph()
123 for gname, g
in altgraphs.iteritems():
124 g.SetLineColor(COLORS[gname])
128 altmp.GetXaxis().SetRangeUser(0, 10)
129 altmp.GetXaxis().CenterTitle()
130 altmp.GetYaxis().SetRangeUser(0, 5)
131 altmp.GetYaxis().CenterTitle()
132 altmp.GetXaxis().
SetTitle(
"E_{#nu} (GeV)")
133 altmp.GetYaxis().
SetTitle(
"Renormalized #sigma_{MEC} (10^{-39} cm^{2})")
134 altmp.GetYaxis().SetDecimals()
136 SaveCanvas(c, os.path.join(OUT_DIR,
"sigma_comparison_renormalized"))
139 for gname, g
in altgraphs.iteritems():
140 if gname ==
"DefaultPlusMECWithNC_MEC":
142 gp = rat_graphs[gname] = ROOT.TGraph()
143 for pt_num
in range(g.GetN()):
144 g.GetPoint(pt_num, x, y)
145 EmpMECVal = graphs[
"DefaultPlusMECWithNC_MEC"].Eval(x)
146 gp.SetPoint(pt_num, x, y / EmpMECVal
if EmpMECVal > 0
else 0)
149 ratmp = ROOT.TMultiGraph()
150 for gname, g
in rat_graphs.iteritems():
151 g.SetLineColor(COLORS[gname])
155 fns = {direction: ROOT.TF1(
"fn_%s" % direction,
"1 %s 1./(1.+2.5*x)" % (
"+" if direction ==
"pos" else "-"), ratmp.GetXaxis().GetXmin(), ratmp.GetXaxis().GetXmax())
for direction
in (
"pos",
"neg")}
156 for fn
in fns.itervalues():
157 fn.SetLineColor(ROOT.kGreen + 2)
160 ratmp.GetXaxis().SetRangeUser(0, 10)
161 ratmp.GetXaxis().CenterTitle()
162 ratmp.GetYaxis().SetRangeUser(0, 2.5)
163 ratmp.GetXaxis().
SetTitle(
"E_{#nu} (GeV)")
164 ratmp.GetYaxis().
SetTitle(
"Shape ratio to Empirical MEC")
165 ratmp.GetYaxis().CenterTitle()
166 ratmp.GetYaxis().SetDecimals()
167 leg.GetListOfPrimitives().RemoveFirst()
168 leg.AddEntry(fns[
"pos"],
"Uncertainty envelope",
"l")
170 SaveCanvas(c, os.path.join(OUT_DIR,
"sigma_comparison_renormalized_ratio"))
gargamelle SetTitle("Gargamelle #nu_{e} CC data")
def SaveCanvas(c, name_stub, out_types=OUT_TYPES)