4 truth_colours= [ROOT.kRed, ROOT.kMagenta+2,ROOT.kBlue+2,ROOT.kCyan+2, ROOT.kGreen+2, ROOT.kGray, ROOT.kOrange]
5 data_colours = [ROOT.kBlack, ROOT.kBlue, ROOT.kGreen, ROOT.kRed]
6 lines = [0,1,2,3,0,1,2,3]
7 markers = [20,21,22,23,24,25,26]
12 suffixes = naming_schema.standard_truth_components[1:]
15 draw_config = type(
'draw_config', (object,), {})()
16 draw_config.labels = []
18 draw_config.colours = []
19 draw_config.lines = []
20 draw_config.markers = []
21 draw_config.draw_options = []
22 for i,component
in enumerate(components):
23 if hasattr(component,
"label"):
27 if (
"-truth_components" in plot_name)
and (label
in draw_config.labels):
28 label = suffixes[i_truth]
30 if i_truth >= len(suffixes): i_truth = 0
31 draw_config.labels.append(label)
32 draw_config.lines.append(lines[i])
33 draw_config.markers.append(markers[i])
35 if (
"data" in draw_config.labels[-1]):
36 if (
"surface" in plot_name)
or (
"_vs_" in plot_name):
37 if len(components) == 1:
38 draw_config.draw_options.append(
"COLZ")
40 draw_config.draw_options.append(
"BOX")
41 elif (
"contour" in plot_name):
42 draw_config.draw_options.append(
"L")
43 elif (
"sensitivity_bestfit" in plot_name):
44 draw_config.draw_options.append(
"P")
46 draw_config.draw_options.append(
"EX09")
47 draw_config.colours.append(data_colours[i])
50 if (
"surface" in plot_name)
or (
"_vs_" in plot_name):
51 if len(components) == 1:
52 draw_config.draw_options.append(
"COLZ")
54 draw_config.draw_options.append(
"BOX")
55 elif (
"contour" in plot_name):
56 draw_config.draw_options.append(
"L")
57 elif (
"sensitivity_bestfit" in plot_name):
58 draw_config.draw_options.append(
"P")
60 draw_config.draw_options.append(
"hist9")
61 draw_config.colours.append(truth_colours[i])
68 import common_tools
as tools
72 if (
not tools.isLogicalHistogramName(name)):
73 print "style: Histogram name: %s does not follow expected naming conventions"%name
76 tokens = tools.getHistogramObservable(name).
split(
"_vs_")
void split(double tt, double *fr)
def parseDrawingConfig(plot_name, components, verbose=False)
parse drawing configuration options from the name of a histogram and a list of components ...
def datasetToLabel(name)
convert the dataset name to a label
def observableName(name)
get a histogram observable name
def parseAxisLabels(name)
parse the axis labels from a plot name