13 print(
'*---------------------------------------*')
14 print(
'| GCP TkAlMap |')
15 print(
'*---------------------------------------*')
21 with open(args.config,
'r') as configFile: if args.config.split(
'.')[-1] ==
'json':
22 config = json.load(configFile)
24 elif args.config.split(
'.')[-1] ==
'yaml':
25 config = yaml.load(configFile, Loader=yaml.Loader)
28 raise Exception(
'Unknown config extension "{}". Please use json/yaml format!'.
format(args.config.split(
'.')[-1]))
31 var_list = [
'dr',
'dx',
'dy',
'dz',
'rdphi',
'dphi',
'dalpha',
'dbeta',
'dgamma',
'du',
'dv',
'dw',
'da',
'db',
'dg']
34 var_ranges[var] = [
None,
None]
37 al_ref = config[
'alignments'][
'ref'][
'title']
38 al_comp = config[
'alignments'][
'comp'][
'title']
39 in_file = config[
'input']
40 out_dir = config[
'output']
43 if 'detector_phase' in config[
'validation'][
'GCP']:
44 phase =
int(config[
'validation'][
'GCP'][
'detector_phase'])
47 if 'map_palette' in config[
'validation'][
'GCP']: palette =
int(config[
'validation'][
'GCP'][
'map_palette'])
49 if 'save_png' in config[
'validation'][
'GCP']: save_png = config[
'validation'][
'GCP'][
'save_png']
51 if 'save_pdf' in config[
'validation'][
'GCP']: save_pdf = config[
'validation'][
'GCP'][
'save_pdf']
53 print(
'Current setup:')
54 print(
' - reference alingment : '+al_ref)
55 print(
' - compared alingment : '+al_comp)
56 print(
' - tracker version : phase '+
str(phase))
57 print(
' - auto detect tracker version : '+
str(auto_tk))
58 print(
' - color palette : '+
str(palette))
59 print(
' - input root file : '+in_file)
60 print(
' - output directory : '+out_dir)
61 print(
' - saving as png : '+
str(save_png))
62 print(
' - saving as pdf : '+
str(save_pdf))
64 print(
'Active plots:')
65 print(
' - plot 4 sigma capped values : '+
str(do_4scap))
66 print(
' - plot default range capped values : '+
str(do_drange))
67 print(
' - plot un-capped values : '+
str(do_frange))
68 print(
' - plot full detector : '+
str(do_full))
69 print(
' - plot pixel detector : '+
str(do_pixel))
70 print(
' - plot strips detector : '+
str(do_strips))
72 print(
'Changed default ranges:')
73 for var
in var_ranges:
74 if var_ranges[var][0]
is None and var_ranges[var][1]
is None:
continue 75 prt_srt =
' - '+var+
'\t: [ ' 76 if var_ranges[var][0]
is None: prt_srt +=
'default' 77 else: prt_srt +=
str(var_ranges[var][0])
79 if var_ranges[var][1]
is None: prt_srt +=
'default' 80 else: prt_srt +=
str(var_ranges[var][1])
85 TkMap_full =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'full', palette=palette, check_tracker=auto_tk)
86 TkMap_pixel =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'pixel', palette=palette, check_tracker=auto_tk)
87 TkMap_strips =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'strips', palette=palette, check_tracker=auto_tk)
88 TkMap_cap_full =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
True, GEO_file=geometry_file, tracker=
'full', palette=palette, check_tracker=auto_tk)
89 TkMap_cap_pixel =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
True, GEO_file=geometry_file, tracker=
'pixel', palette=palette, check_tracker=auto_tk)
90 TkMap_cap_strips =
TkAlMap(
'test', title, in_file, use_default_range=
False, two_sigma_cap=
True, GEO_file=geometry_file, tracker=
'strips', palette=palette, check_tracker=auto_tk)
91 TkMap_drange_full =
TkAlMap(
'test', title, in_file, use_default_range=
True, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'full', palette=palette, check_tracker=auto_tk)
92 TkMap_drange_pixel =
TkAlMap(
'test', title, in_file, use_default_range=
True, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'pixel', palette=palette, check_tracker=auto_tk)
93 TkMap_drange_strips =
TkAlMap(
'test', title, in_file, use_default_range=
True, two_sigma_cap=
False, GEO_file=geometry_file, tracker=
'strips', palette=palette, check_tracker=auto_tk)
94
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)