15<output>validationTestColorScheme.root</output>
16<contact>Kilian Lieret, Kilian.Lieret@campus.lmu.de</contact>
20To test the color scheme.
21Set generate_reference = True to generate the reference files.
28from validationtest
import add_properties
29from ROOT
import TFile, TH1F, TNamed
32def generate_gaus(title, options, distort=0.0):
33 """ Generate trivial gaus filled histogram.
34 Use the distort parameter (0<=distort<=1) for distortion to get histograms
35 with failing comparisons.
39 assert 0 <= distort <= 1
41 basf2.set_random_seed(10)
45 name = title.lower().replace(
" ",
"_")
47 gaus = TH1F(name, title, 100, -3, 3)
49 gaus.FillRandom(
"gaus", int((1 - distort) * norm))
51 basf2.set_random_seed(100)
52 distortion = TH1F(name, title, 100, -3, 3)
53 distortion.FillRandom(
"gaus", int(distort * norm))
56 add_properties(gaus, options)
60if __name__ ==
"__main__":
61 tfile = TFile(
"validationTestColorScheme.root",
"RECREATE")
65 "These plots test the color scheme. Make sure to also check the 'expert' "
66 "plot checkbox to see the color scheme for expert plots.",
70 "Description":
"Test color scheme",
71 "Check":
"Check color",
72 "Contact":
"Kilian Lieret, Kilian.Lieret@campus.lmu.de",
73 "MetaOptions":
"pvalue-error=0.6",
75 mop_shifter = mop_expert.copy()
76 mop_shifter[
"MetaOptions"] +=
", shifter"
78 generate_reference =
False
80 if not generate_reference:
82 generate_gaus(
"manual", mop_shifter)
83 generate_gaus(
"manual expert", mop_expert)
85 if generate_reference:
88 generate_gaus(
"pass", mop_shifter)
89 generate_gaus(
"pass expert", mop_expert)
90 generate_gaus(
"warn", mop_shifter)
91 generate_gaus(
"fail", mop_shifter)
92 generate_gaus(
"warn expert", mop_expert)
93 generate_gaus(
"fail expert", mop_expert)
95 generate_gaus(
"pass", mop_shifter, distort=0.1)
96 generate_gaus(
"pass expert", mop_expert, distort=0.1)
97 generate_gaus(
"warn", mop_shifter, distort=0.5)
98 generate_gaus(
"fail", mop_shifter, distort=1)
99 generate_gaus(
"warn expert", mop_expert, distort=0.5)
100 generate_gaus(
"fail expert", mop_expert, distort=1)