6 <output>validationTestPlots.root, validationTestPlotsExpertOnly.root</output>
7 <contact>Kilian Lieret, Kilian.Lieret@campus.lmu.de</contact>
12 This file will generate various output into a root-file to have
13 a fast turn-around during development
16 from validationtest
import add_properties
21 from datetime
import datetime
25 basf2.set_random_seed(1337)
27 tfile = ROOT.TFile(
"validationTestPlots.root",
"RECREATE")
33 tntuple = ROOT.TNtuple(
"ntuple_test",
"ntuple test",
"x:y:z:k")
35 array_of_values = array.array(
'f', [23.4, 4.4, 5.12, -23.0])
36 tntuple.Fill(array_of_values)
38 tntuple.SetAlias(
'Description',
"This is a description test. "
39 "Lorem ipsum sit dolor amet. We also support $\LaTeX$! "
40 "\n <br> \n For example, here is the infamous "
41 "Einstein-Pythagoras-theorem: \n "
42 "$$a^2 + b^2 = \\frac{E}{m}$$ \n Of course, you can also"
43 "do other things, like $\\theta = 90^\circ$ or $D^- "
44 "\\rightarrow D^0 \pi^- \pi^+$. \n Sometimes it is "
45 "necessary to escape commands with a double backslash, "
46 "because e.g. \\theta will be interpreted as [tab]heta.")
47 tntuple.SetAlias(
'Check',
"This is the check text.")
48 tntuple.SetAlias(
'Contact',
"Name of the contact person.")
49 tntuple.SetAlias(
'MetaOptions',
"shifter, some_meta_options")
57 gaus_h = ROOT.TH1F(
"gaus_histogram",
" Gaus Histogram", 100, -3, 3)
58 gaus_h.FillRandom(
"gaus", 500)
63 'Description':
"xlog",
64 'Check':
"Gaus Histogram Check",
65 'Contact':
"Gaus Histogram Contact",
66 'MetaOptions':
"shifter, logx, nostats"
75 warnings_h = ROOT.TH1F(
77 "Histogram with missing check and description",
80 warnings_h.FillRandom(
"gaus", 500)
87 'Contact':
"Kilian Lieret, Kilian.Lieret@campus.lmu.de",
88 'MetaOptions':
"shifter, logx, nostats"
97 exp_h = ROOT.TH1F(
"exp_histogram",
" Expert Histogram", 100, 0, 10)
99 exp_fn = ROOT.TF1(
"exp_fn",
"exp(-x)", 0, 10)
100 exp_h.FillRandom(
"exp_fn", 500)
105 'Description':
"Expert Validation Plot",
106 'Check':
"Expert Histogram Check. Should only appear if expert button"
108 'Contact':
"Expert Histogram Contact",
109 'MetaOptions':
"logy, nostats, C"
121 basf2.set_random_seed(datetime.now().microsecond)
123 gaus_changing = ROOT.TH1F(
124 "gaus_changing_histogram",
125 "Gaus Changing Histogram",
128 mean = ROOT.gRandom.Uniform(-1.0, 1.0)
131 v = ROOT.gRandom.Gaus(mean, 1.0)
132 gaus_changing.Fill(v)
137 'Description':
"xlog ylog with stats. I can haz $\LaTeX$?",
138 'Check':
"Gaus Changing Histogram Check",
139 'Contact':
"Gaus Changing Histogram Contact",
140 'MetaOptions':
"shifter, logx, logy"
144 gaus_changing.Write()
148 hist2d = ROOT.TH2F(
"example_2d_histogram",
"example_2d_title",
149 60, -3, 3, 60, -3, 3)
152 cov = [[1, 0], [0, 1]]
154 x, y = np.random.multivariate_normal(mean, cov)
161 'Description':
"Some 2D Histogram",
162 'Check':
"Check For Something",
163 'Contact':
"Contact Someone",
164 'MetaOptions':
"shifter, contz"
173 gaus_passed = ROOT.TH1F(
"gaus_passed",
"gaus_passed", 50, -0.5, 49.5)
174 gaus_total = ROOT.TH1F(
"gaus_total",
"gaus_total", 50, -0.5, 49.5)
178 ratio = float(i) / 500.0
179 passed = ROOT.gRandom.Uniform(ratio * 0.45, 1.0)
180 pos = ROOT.gRandom.Uniform(ratio * 30.0, 49.5)
184 gaus_passed.Fill(pos)
186 teff = ROOT.TEfficiency(gaus_passed, gaus_total)
187 teff.SetName(
"TEfficiency")
188 teff.SetTitle(
"Tefficiency")
193 'Description':
"Efficiency plot of something",
194 'Check':
"Check For Something",
195 'Contact':
"Contact Someone",
196 'MetaOptions':
"shifter"
205 graph_err = ROOT.TGraphErrors()
210 ratio = float(i) / 50.0
211 passed = ROOT.gRandom.Uniform(ratio * 0.45, 1.0)
213 graph_err.SetPoint(i, i + 1.0, passed)
215 graph_err.SetName(
"TGraphErrors")
216 graph_err.SetTitle(
"TGraphErrors")
220 'Description':
"TGraphErrors plot of something",
221 'Check':
"Check For Something",
222 'Contact':
"Contact Someone",
223 'MetaOptions':
"shifter"
233 html_content = ROOT.TNamed(
"This is a bold HTML tag",
"<p><b>THIS IS USER'S HTML</b></p>")
242 tfile = ROOT.TFile(
"validationTestPlotsExpertOnly.root",
"RECREATE")
243 gaus_h = ROOT.TH1F(
"gaus_histogram_exprt",
" Gaus Histogram Expert", 100, -3, 3)
244 gaus_h.FillRandom(
"gaus", 500)