2 import ROOT, glob, sys, os, re
3 from array
import array
4 import Optimizations, OptimizationUtils
7 convert =
lambda text:
int(text)
if text.isdigit()
else text.lower()
8 alphanum_key =
lambda key: [ convert(c)
for c
in re.split(
'([0-9]+)', key) ]
9 return sorted(l, key = alphanum_key)
13 if not len(sys.argv) > 1:
14 print "Please specify an optimization name" 17 optimization_name = sys.argv[1]
19 max_configurations = 1000
22 max_configurations =
int(sys.argv[2])
31 fhcnumubarfitnesses = []
33 rhcnumubarfitnesses = []
34 fhcnuenuebarfitnesses = []
35 rhcnuenuebarfitnesses = []
40 fhcnumufitness_errors = []
41 rhcnumufitness_errors = []
42 fhcnumubarfitness_errors = []
43 rhcnumubarfitness_errors = []
44 fhcnuenuebarfitness_errors = []
45 rhcnuenuebarfitness_errors = []
54 fluxpath = optimization.output_location+
"users/ljf26/fluxfiles/g4lbne/"+optimization.g4lbne_version+
"/"+optimization.physics_list+
"/" 56 fluxdirs = glob.glob(fluxpath+
"*")
57 if optimization.rhc_parameters_float_separate:
58 fluxdirs = glob.glob(fluxpath+
"*FHC*")
62 if os.path.basename(dir).startswith(
"Optimizations-"+optimization_name):
63 configuration = dir.split(
"/")[9].
split(
"-")[2]
65 if "Scan" in configuration:
continue 67 if float(configuration) < max_configurations:
69 [tfitness_names,tfitnesses,tfiterrors] = optimization.getFitness(float(configuration))
71 if tfitnesses[0]==-1:
continue 72 print configuration,tfitnesses[0]
73 [fitness,fitness_error] = [tfitnesses[0],tfiterrors[0]]
74 if optimization_name.startswith(
"CP"):
76 [fhcnumufitness,fhcnumufitness_error] = [tfitnesses[1],tfiterrors[1]]
77 [fhcnumubarfitness,fhcnumubarfitness_error] = [tfitnesses[2],tfiterrors[2]]
78 [fhcnuenuebarfitness,fhcnuenuebarfitness_error] = [tfitnesses[3],tfiterrors[3]]
79 [rhcnumufitness,rhcnumufitness_error] = [tfitnesses[4],tfiterrors[4]]
80 [rhcnumubarfitness,rhcnumubarfitness_error] = [tfitnesses[5],tfiterrors[5]]
81 [rhcnuenuebarfitness,rhcnuenuebarfitness_error] = [tfitnesses[6],tfiterrors[6]]
82 [nhfitness,nhfitness_error] = [tfitnesses[7],tfiterrors[7]]
83 [ihfitness,ihfitness_error] = [tfitnesses[8],tfiterrors[8]]
84 [tfitness_names,tfitnesses,tfiterrors] = optimization.getFitness(float(configuration),
"mh")
85 [mhfitness,mhfitness_error] = [tfitnesses[0],tfiterrors[0]]
89 if(float(fitness)>0
and float(fitness_error) < 5):
91 configurations.append(float(configuration))
92 fitnesses.append(fitness)
93 fitness_errors.append(fitness_error)
94 if(optimization_name.startswith(
"CP_")):
96 fhcnumufitnesses.append(fhcnumufitness)
97 fhcnumufitness_errors.append(fhcnumufitness_error)
98 rhcnumufitnesses.append(rhcnumufitness)
99 rhcnumufitness_errors.append(rhcnumufitness_error)
100 fhcnumubarfitnesses.append(fhcnumubarfitness)
101 fhcnumubarfitness_errors.append(fhcnumubarfitness_error)
102 rhcnumubarfitnesses.append(rhcnumubarfitness)
103 rhcnumubarfitness_errors.append(rhcnumubarfitness_error)
104 fhcnuenuebarfitnesses.append(fhcnuenuebarfitness)
105 fhcnuenuebarfitness_errors.append(fhcnuenuebarfitness_error)
106 rhcnuenuebarfitnesses.append(rhcnuenuebarfitness)
107 rhcnuenuebarfitness_errors.append(rhcnuenuebarfitness_error)
108 ihfitnesses.append(ihfitness)
109 ihfitness_errors.append(ihfitness_error)
110 nhfitnesses.append(nhfitness)
111 nhfitness_errors.append(nhfitness_error)
112 mhfitnesses.append(mhfitness)
113 mhfitness_errors.append(mhfitness_error)
115 fhcnumufitnesses.append(0)
116 fhcnumufitness_errors.append(0)
117 rhcnumufitnesses.append(0)
118 rhcnumufitness_errors.append(0)
119 fhcnumubarfitnesses.append(0)
120 fhcnumubarfitness_errors.append(0)
121 rhcnumubarfitnesses.append(0)
122 rhcnumubarfitness_errors.append(0)
123 fhcnuenuebarfitnesses.append(0)
124 fhcnuenuebarfitness_errors.append(0)
125 rhcnuenuebarfitnesses.append(0)
126 rhcnuenuebarfitness_errors.append(0)
127 ihfitnesses.append(0)
128 ihfitness_errors.append(0)
129 nhfitnesses.append(0)
130 nhfitness_errors.append(0)
131 mhfitnesses.append(0)
132 mhfitness_errors.append(0)
133 zero_errors.append(0.0)
136 nominal_fitnesses = []
137 nominal_fitness_error = 0
138 [nominal_fitness,nominal_fitness_error] = optimization.getNominalFitness(
"cp")
139 nominal_fitnesses.append(nominal_fitness[0]);
140 nominal_fitnesses.append(0);
141 nominal_fitnesses.append(0);
142 nominal_fitnesses.append(0);
143 nominal_fitnesses.append(0);
144 nominal_fitnesses.append(0);
145 nominal_fitnesses.append(0);
146 if optimization_name.startswith(
"CP_"):
147 nominal_fitnesses.append(nominal_fitness[1])
148 nominal_fitnesses.append(nominal_fitness[2])
149 print "NOMINAL STANDARD FITNESS: ",nominal_fitness[0]
151 [nominal_fitness,nominal_fitness_error] = optimization.getNominalFitness(
"mh")
152 nominal_fitnesses.append(nominal_fitness[0]);
157 parameter_values = []
159 parameter_histos = []
161 n_parameters = len(optimization.parameter_names);
162 for i
in range(0,n_parameters):
163 parameter_name = optimization.parameter_names[i]
164 parameter_values.append([])
165 parameter_histos.append(ROOT.TH1F(
"h_parameters_"+
str(i),parameter_name,10,optimization.parameter_lower_limits[i],optimization.parameter_upper_limits[i]));
167 knobturns = optimization.getKnobturns()
169 for configuration
in configurations:
170 if float(configuration)>max_configurations:
continue 171 configuration_found =
False 172 for j
in range(0,len(knobturns)):
173 if knobturns[j][0]==configuration:
174 configuration_found =
True 175 configurations2.append(knobturns[j][0])
176 for i
in range(0,n_parameters):
177 parameter_histos[i].Fill(knobturns[j][1][i])
178 parameter_values[i].append(float(knobturns[j][1][i]))
179 if not configuration_found:
180 print "ERROR: configuration:",configuration,
" found in flux directories but can't find macros to look up knobturns... quitting." 183 if configurations != configurations2:
184 print "WARNING: vector of configurations matched to fitness and vector of configurations matched to knobturns is different. This will likely cause plots to be incorrect" 188 canv = ROOT.TCanvas(
"MyCanvas",
"MyCanvas")
190 split_configurations = [[]]
191 split_fitnesses = [[]]
192 split_fhcnumufitnesses = [[]]
193 split_rhcnumufitnesses = [[]]
194 split_fhcnumubarfitnesses = [[]]
195 split_rhcnumubarfitnesses = [[]]
196 split_fhcnuenuebarfitnesses = [[]]
197 split_rhcnuenuebarfitnesses = [[]]
198 split_ihfitnesses = [[]]
199 split_nhfitnesses = [[]]
200 split_mhfitnesses = [[]]
201 split_zero_errors = [[]]
202 split_fitness_errors = [[]]
203 split_fhcnumufitness_errors = [[]]
204 split_rhcnumufitness_errors = [[]]
205 split_fhcnumubarfitness_errors = [[]]
206 split_rhcnumubarfitness_errors = [[]]
207 split_fhcnuenuebarfitness_errors = [[]]
208 split_rhcnuenuebarfitness_errors = [[]]
209 split_ihfitness_errors = [[]]
210 split_nhfitness_errors = [[]]
211 split_mhfitness_errors = [[]]
212 split_parameter_values = []
213 for j
in range(0,n_parameters):
214 split_parameter_values.append([[]])
215 gen_end = optimization.generation_size
217 for i
in range(0,len(configurations)):
218 if(configurations[i]>gen_end):
219 gen_end = gen_end+optimization.generation_size
220 gen_number = gen_number+1
221 split_configurations.append([])
222 split_fitnesses.append([])
223 split_fhcnumufitnesses.append([])
224 split_rhcnumufitnesses.append([])
225 split_fhcnumubarfitnesses.append([])
226 split_rhcnumubarfitnesses.append([])
227 split_fhcnuenuebarfitnesses.append([])
228 split_rhcnuenuebarfitnesses.append([])
229 split_ihfitnesses.append([])
230 split_nhfitnesses.append([])
231 split_mhfitnesses.append([])
232 split_zero_errors.append([])
233 split_fitness_errors.append([])
234 split_fhcnumufitness_errors.append([])
235 split_rhcnumufitness_errors.append([])
236 split_fhcnumubarfitness_errors.append([])
237 split_rhcnumubarfitness_errors.append([])
238 split_fhcnuenuebarfitness_errors.append([])
239 split_rhcnuenuebarfitness_errors.append([])
240 split_ihfitness_errors.append([])
241 split_nhfitness_errors.append([])
242 split_mhfitness_errors.append([])
243 for j
in range(0,n_parameters):
244 split_parameter_values[j].append([])
245 split_configurations[gen_number].append(float(configurations[i]))
247 split_fitnesses[gen_number].append(float(fitnesses[i]))
248 split_fhcnumufitnesses[gen_number].append(float(fhcnumufitnesses[i]))
249 split_rhcnumufitnesses[gen_number].append(float(rhcnumufitnesses[i]))
250 split_fhcnumubarfitnesses[gen_number].append(float(fhcnumubarfitnesses[i]))
251 split_rhcnumubarfitnesses[gen_number].append(float(rhcnumubarfitnesses[i]))
252 split_fhcnuenuebarfitnesses[gen_number].append(float(fhcnuenuebarfitnesses[i]))
253 split_rhcnuenuebarfitnesses[gen_number].append(float(rhcnuenuebarfitnesses[i]))
254 split_ihfitnesses[gen_number].append(float(ihfitnesses[i]))
255 split_nhfitnesses[gen_number].append(float(nhfitnesses[i]))
256 split_mhfitnesses[gen_number].append(float(mhfitnesses[i]))
258 split_zero_errors[gen_number].append(float(zero_errors[i]))
259 split_fitness_errors[gen_number].append(float(fitness_errors[i]))
260 split_fhcnumufitness_errors[gen_number].append(float(fhcnumufitness_errors[i]))
261 split_rhcnumufitness_errors[gen_number].append(float(rhcnumufitness_errors[i]))
262 split_fhcnumubarfitness_errors[gen_number].append(float(fhcnumubarfitness_errors[i]))
263 split_rhcnumubarfitness_errors[gen_number].append(float(rhcnumubarfitness_errors[i]))
264 split_fhcnuenuebarfitness_errors[gen_number].append(float(fhcnuenuebarfitness_errors[i]))
265 split_rhcnuenuebarfitness_errors[gen_number].append(float(rhcnuenuebarfitness_errors[i]))
266 split_ihfitness_errors[gen_number].append(float(ihfitness_errors[i]))
267 split_nhfitness_errors[gen_number].append(float(nhfitness_errors[i]))
268 split_mhfitness_errors[gen_number].append(float(mhfitness_errors[i]))
269 for j
in range(0,n_parameters):
270 split_parameter_values[j][gen_number].append(float(parameter_values[j][i]))
274 print split_configurations
278 fitness_types = [
"Nu_mu Flux"]
279 if optimization_name.startswith(
"CP"):
280 fitness_types = [
"CP",
"fhcnumu",
"fhcnumubar",
"fhcnuenuebar",
"rhcnumu",
"rhcnumubar",
"rhcnuenuebar",
"ih",
"nh",
"mh"]
281 for type_iter
in range(len(fitness_types)):
282 fitness_vs_configurations = []
284 for i
in range(0,len(split_configurations)):
286 if fitness_types[type_iter]==
"CP" or fitness_types[type_iter]==
"Nu_mu Flux":
287 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_fitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_fitness_errors[i])));
289 if fitness_types[type_iter]==
"fhcnumu":
290 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_fhcnumufitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_fhcnumufitness_errors[i])));
291 if fitness_types[type_iter]==
"fhcnumubar":
292 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_fhcnumubarfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_fhcnumubarfitness_errors[i])));
293 if fitness_types[type_iter]==
"fhcnuenuebar":
294 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_fhcnuenuebarfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_fhcnuenuebarfitness_errors[i])));
295 if fitness_types[type_iter]==
"rhcnumu":
296 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_rhcnumufitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_rhcnumufitness_errors[i])));
297 if fitness_types[type_iter]==
"rhcnumubar":
298 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_rhcnumubarfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_rhcnumubarfitness_errors[i])));
299 if fitness_types[type_iter]==
"rhcnuenuebar":
300 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_rhcnuenuebarfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_rhcnuenuebarfitness_errors[i])));
301 if fitness_types[type_iter]==
"ih":
302 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_ihfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_ihfitness_errors[i])));
303 if fitness_types[type_iter]==
"nh":
304 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_nhfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_nhfitness_errors[i])));
305 if fitness_types[type_iter]==
"mh":
306 fitness_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[i]),
array(
'd',split_configurations[i]),
array(
'd',split_mhfitnesses[i]),
array(
'd',split_zero_errors[i]),
array(
'd',split_mhfitness_errors[i])));
308 x_max = max_configurations + 100
310 fitness_vs_configurations[i].GetXaxis().SetLimits(0.0,x_max)
311 fitness_vs_configurations[i].GetXaxis().SetTitle(
"Configuration")
312 fitness_vs_configurations[i].GetYaxis().SetTitle(fitness_types[type_iter]+
" Fitness")
313 fitness_vs_configurations[i].GetXaxis().CenterTitle()
314 fitness_vs_configurations[i].GetYaxis().CenterTitle()
315 fitness_vs_configurations[i].SetMarkerColor(colors[i%len(colors)]);
316 fitness_vs_configurations[i].SetLineColor(colors[i%len(colors)]);
319 fitness_vs_configurations[i].SetTitle(
"");
320 fitness_vs_configurations[i].Draw(
"ap");
321 a_line = ROOT.TLine(0,nominal_fitnesses[type_iter],x_max,nominal_fitnesses[type_iter])
322 a_line.SetLineWidth(2)
324 if(fitness_types[type_iter]==
"CP" or fitness_types[type_iter]==
"Nu_mu Flux"):
325 fitness_vs_configurations[i].SetMaximum(
max(fitnesses)*1.1)
326 fitness_vs_configurations[i].SetMinimum(
min(fitnesses)*0.8)
327 if(fitness_types[type_iter]==
"fhcnumu"):
328 fitness_vs_configurations[i].SetMaximum(
max(fhcnumufitnesses)*1.1)
329 fitness_vs_configurations[i].SetMinimum(
min(fhcnumufitnesses))
330 if(fitness_types[type_iter]==
"fhcnumubar"):
331 fitness_vs_configurations[i].SetMaximum(
max(fhcnumubarfitnesses)*1.1)
332 fitness_vs_configurations[i].SetMinimum(
min(fhcnumubarfitnesses))
333 if(fitness_types[type_iter]==
"fhcnuenuebar"):
334 fitness_vs_configurations[i].SetMaximum(
max(fhcnuenuebarfitnesses)*1.1)
335 fitness_vs_configurations[i].SetMinimum(
min(fhcnuenuebarfitnesses))
336 if(fitness_types[type_iter]==
"rhcnumu"):
337 fitness_vs_configurations[i].SetMaximum(
max(rhcnumufitnesses)*1.1)
338 fitness_vs_configurations[i].SetMinimum(
min(rhcnumufitnesses))
339 if(fitness_types[type_iter]==
"rhcnumubar"):
340 fitness_vs_configurations[i].SetMaximum(
max(rhcnumubarfitnesses)*1.1)
341 fitness_vs_configurations[i].SetMinimum(
min(rhcnumubarfitnesses))
342 if(fitness_types[type_iter]==
"rhcnuenuebar"):
343 fitness_vs_configurations[i].SetMaximum(
max(rhcnuenuebarfitnesses)*1.1)
344 fitness_vs_configurations[i].SetMinimum(
min(rhcnuenuebarfitnesses))
345 if(fitness_types[type_iter]==
"ih"):
346 fitness_vs_configurations[i].SetMaximum(
max(ihfitnesses)*1.1)
347 fitness_vs_configurations[i].SetMinimum(0)
348 if(fitness_types[type_iter]==
"nh"):
349 fitness_vs_configurations[i].SetMaximum(
max(nhfitnesses)*1.1)
350 fitness_vs_configurations[i].SetMinimum(0)
351 if(fitness_types[type_iter]==
"mh"):
352 fitness_vs_configurations[i].SetMaximum(
max(mhfitnesses)*1.1)
353 fitness_vs_configurations[i].SetMinimum(3)
355 a_line.SetLineStyle(2);
357 fitness_vs_configurations[i].Draw(
"psame");
360 fitness_vs_configurations[i].Draw(
"psame");
366 canv.Print(
"plots/"+optimization_name+
"_"+fitness_types[type_iter]+
"_fitness_vs_configuration.eps");
367 canv.Print(
"plots/"+optimization_name+
"_"+fitness_types[type_iter]+
"_fitness_vs_configuration.png");
370 ROOT.gStyle.SetMarkerStyle(2);
372 best_parameter_values = []
373 best_parameter_errors = []
374 for i
in range(0,n_parameters):
375 best_parameter_values.append([])
376 best_parameter_errors.append([])
378 for j
in range(0,len(fitnesses)):
381 for i
in range(0,n_parameters):
382 best_parameter_values[i].append(parameter_values[i][j])
383 best_parameter_errors[i].append(0)
386 for i
in range(0,n_parameters):
388 parameter_vs_configurations = []
389 y_low = optimization.parameter_lower_limits[i]-(optimization.parameter_upper_limits[i]-optimization.parameter_lower_limits[i])*0.05;
390 y_low = optimization.parameter_upper_limits[i]+(optimization.parameter_upper_limits[i]-optimization.parameter_lower_limits[i])*0.05;
391 frame = ROOT.TH2D(
"frame",
"frame",100,0,max_configurations+100,100,optimization.parameter_lower_limits[i],optimization.parameter_upper_limits[i]);
392 frame.SetTitle(optimization.parameter_names[i]);
395 title = ROOT.gPad.GetPrimitive(
"title");
396 title.SetBorderSize(0);
398 for j
in range(0,len(split_configurations)):
400 parameter_vs_configurations.append(ROOT.TGraphErrors(len(split_configurations[j]),
array(
'd',split_configurations[j]),
array(
'd',split_parameter_values[i][j]),
array(
'd',split_zero_errors[j]),
array(
'd',split_zero_errors[j])));
401 parameter_vs_configurations[j].GetXaxis().SetLimits(0.0,max_configurations+100)
403 y_axis_title = optimization.parameter_names[i]
404 if(optimization.parameter_units[i]!=
""):
405 y_axis_title = y_axis_title+
" ("+optimization.parameter_units[i]+
")" 406 frame.GetXaxis().SetTitle(
"Configuration")
407 frame.GetYaxis().SetTitle(y_axis_title)
408 frame.GetXaxis().CenterTitle()
409 frame.GetYaxis().CenterTitle()
410 parameter_vs_configurations[j].SetMarkerColor(colors[j%len(colors)]);
411 parameter_vs_configurations[j].SetLineColor(colors[j%len(colors)]);
412 parameter_vs_configurations[j].Draw(
"psame");
414 parameter_name = optimization.parameter_names[i]
415 canv.Print(
"plots/"+optimization_name+
"_"+parameter_name+
"_vs_configuration.eps");
416 canv.Print(
"plots/"+optimization_name+
"_"+parameter_name+
"_vs_configuration.png");
418 fitness_types = [
"Nu_mu Flux"]
419 if optimization_name.startswith(
"CP_"):
420 fitness_types = [
"CP",
"fhcnumu",
"fhcnumubar",
"fhcnuenuebar",
"rhcnumu",
"rhcnumubar",
"rhcnuenuebar",
"nh",
"ih",
"mh"]
421 for fitness_type
in fitness_types:
422 if fitness_type==
"CP" or fitness_type==
"Nu_mu Flux":
423 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',fitnesses),
array(
'd',zero_errors),
array(
'd',fitness_errors))
424 if fitness_type==
"fhcnumu":
425 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',fhcnumufitnesses),
array(
'd',zero_errors),
array(
'd',fhcnumufitness_errors))
426 if fitness_type==
"fhcnumubar":
427 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',fhcnumubarfitnesses),
array(
'd',zero_errors),
array(
'd',fhcnumubarfitness_errors))
428 if fitness_type==
"fhcnuenuebar":
429 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',fhcnuenuebarfitnesses),
array(
'd',zero_errors),
array(
'd',fhcnuenuebarfitness_errors))
430 if fitness_type==
"rhcnumu":
431 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',rhcnumufitnesses),
array(
'd',zero_errors),
array(
'd',rhcnumufitness_errors))
432 if fitness_type==
"rhcnumubar":
433 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',rhcnumubarfitnesses),
array(
'd',zero_errors),
array(
'd',rhcnumubarfitness_errors))
434 if fitness_type==
"rhcnuenuebar":
435 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',rhcnuenuebarfitnesses),
array(
'd',zero_errors),
array(
'd',rhcnuenuebarfitness_errors))
436 if fitness_type==
"mh":
437 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',mhfitnesses),
array(
'd',zero_errors),
array(
'd',mhfitness_errors))
438 if fitness_type==
"ih":
439 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',ihfitnesses),
array(
'd',zero_errors),
array(
'd',ihfitness_errors))
440 if fitness_type==
"nh":
441 fitness_vs_parameter = ROOT.TGraphErrors(len(configurations),
array(
'd',parameter_values[i]),
array(
'd',nhfitnesses),
array(
'd',zero_errors),
array(
'd',nhfitness_errors))
442 fitness_vs_parameter.GetYaxis().SetTitle(fitness_type+
" Fitness")
443 x_axis_title = optimization.parameter_names[i]
444 if(optimization.parameter_units[i]!=
""):
445 x_axis_title = x_axis_title+
" ("+optimization.parameter_units[i]+
")" 446 fitness_vs_parameter.GetXaxis().SetTitle(x_axis_title);
447 fitness_vs_parameter.GetXaxis().CenterTitle()
448 fitness_vs_parameter.GetYaxis().CenterTitle()
449 fitness_vs_parameter.Draw(
"AP");
450 canv.Print(
"plots/"+optimization_name+
"_"+fitness_type+
"_fitness_vs_"+parameter_name+
".eps")
451 canv.Print(
"plots/"+optimization_name+
"_"+fitness_type+
"_fitness_vs_"+parameter_name+
".png")
454 for j in range(i+1,n_parameters): 455 parameter_vs_parameter = ROOT.TGraphErrors(len(best_parameter_values[i]),array('d',best_parameter_values[i]),array('d',best_parameter_values[j]),array('d',best_parameter_errors[i]),array('d',best_parameter_errors[j])) 456 x_axis_title = optimization.parameter_names[i] 457 y_axis_title = optimization.parameter_names[j] 458 if(optimization.parameter_units[i]!=""): 459 x_axis_title = x_axis_title+" ("+optimization.parameter_units[i]+")" 460 if(optimization.parameter_units[j]!=""): 461 y_axis_title = y_axis_title+" ("+optimization.parameter_units[j]+")" 462 parameter_vs_parameter.GetXaxis().SetTitle(x_axis_title); 463 parameter_vs_parameter.GetYaxis().SetTitle(y_axis_title); 464 parameter_vs_parameter.GetXaxis().CenterTitle() 465 parameter_vs_parameter.GetYaxis().CenterTitle() 466 parameter_vs_parameter.Draw("AP"); 467 canv.Print("plots/"+optimization_name+"_"+parameter_name+"_vs_"+optimization.parameter_names[j]+".eps") 468 canv.Print("plots/"+optimization_name+"_"+parameter_name+"_vs_"+optimization.parameter_names[j]+".png")
auto array(Array const &a)
Returns a manipulator which will print the specified array.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
void split(std::string const &s, char c, OutIter dest)