5 histogram=[
"h_aveint_vs_enu_tot",
"h_aveint_vs_enu_thin_pCpion",
"h_aveint_vs_enu_thin_pCkaon",
"h_aveint_vs_enu_thin_nCpion",
"h_aveint_vs_enu_thin_pCnucleon",
"h_aveint_vs_enu_thin_mesoninc",
"h_aveint_vs_enu_thin_nucleona",
"h_aveint_vs_enu_others"]
6 legends=[
"Total HP",
"pC-->#pi X",
"pC-->KX",
"nC-->#pi X",
"pC-->nucleonX",
"meson inc.",
"nucloen-A",
"others"]
7 color=[1,4,4,42,42,28,28,39]
8 style=[1,1,2,1,2,1,2,1]
10 for j
in range(0,len(histogram)):
11 in_dir = directory+
"/"+histogram[j]
12 histo_universe.append(rootfile.Get(
str(in_dir)))
13 c1 = ROOT.TCanvas(
"c1",
"c1",750,750)
15 leg = ROOT.TLegend(0.3,0.3,0.5,0.9)
16 histo_universe[0].SetLineWidth(3)
17 histo_universe[0].SetLineColor(color[0])
18 histo_universe[0].SetLineStyle(style[0])
19 leg.AddEntry(histo_universe[0],
str(legends[0]),
"lp")
22 (histo_universe[0].GetXaxis()).SetRangeUser(0,20)
23 histo_universe[0].SetMinimum(0)
24 histo_universe[0].SetMaximum(220)
25 histo_universe[0].Draw(
"hist")
26 for i
in range(1,len(histo_universe)):
27 histo_universe[i].SetLineWidth(3)
28 histo_universe[i].SetLineColor(color[i])
29 histo_universe[i].SetLineStyle(style[i])
30 leg.AddEntry(histo_universe[i],
str(legends[i]),
"lp")
32 histo_universe[i].Draw(
"Same")
def DrawTogether(rootfile, directory, urange)