CMS 3D CMS Logo

Functions | Variables
GCPpyPlots Namespace Reference

Functions

def parser ()
 
def TkAlMap_plots (config)
 

Variables

 args
 
 argv
 
 config
 
 configFile
 
 Loader
 

Function Documentation

◆ parser()

def GCPpyPlots.parser ( )

Definition at line 15 of file GCPpyPlots.py.

15 def parser():
16  sys.argv = argv
17  parser = argparse.ArgumentParser(description = "run the python plots for the AllInOneTool validations", formatter_class=argparse.RawTextHelpFormatter)
18  parser.add_argument("config", metavar='config', type=str, action="store", help="GCP AllInOneTool config (json/yaml format)")
19  parser.add_argument("-b", "--batch", action = "store_true", help ="Batch mode")
20 
21  sys.argv.append( '-b' )
22  ROOT.gROOT.SetBatch()
23  return parser.parse_args()
24 
def parser()
Definition: GCPpyPlots.py:15

◆ TkAlMap_plots()

def GCPpyPlots.TkAlMap_plots (   config)

Definition at line 25 of file GCPpyPlots.py.

References nano_mu_digi_cff.float, print(), and str.

25 def TkAlMap_plots(config):
26  root_file = str(config['output']) + '/GCPtree.root'
27  destination = str(config['output'])
28  plot_dir = destination + '/TkAlMaps'
29 
30  com_vs_ref = config['alignments']['comp']['title'] + ' vs ' + config['alignments']['ref']['title']
31  iov_vs_iov = str(config['validation']['IOVcomp']) + ' - ' + str(config['validation']['IOVref'])
32  title = '#splitline{'+com_vs_ref+'}{'+iov_vs_iov+'}'
33 
34  if not os.path.isdir(plot_dir): os.mkdir(plot_dir)
35 
36  plot_png = False
37  if 'plotPng' in config['validation']['GCP']:
38  plot_png = config['validation']['GCP']['plotPng']
39 
40  palette = 2 #1 is rainbow palette, 2 is diverging color palette (blue to red)
41 
42  var_list = ['dr', 'dx', 'dy', 'dz', 'rdphi', 'dphi'] #, 'dalpha', 'dbeta', 'dgamma', 'du', 'dv', 'dw', 'da', 'db', 'dg']
43  TkMap_pixel = TkAlMap(
44  'dummy_var', title, root_file,
45  use_default_range=True, two_sigma_cap=False,
46  tracker='pixel',
47  palette=palette, check_tracker=True
48  )
49  TkMap_strips = TkAlMap(
50  'dummy_var', title, root_file,
51  use_default_range=True, two_sigma_cap=False,
52  tracker='strips',
53  palette=palette, check_tracker=True
54  )
55 
56  for var in var_list:
57  print(' --- Creating maps for variable: '+var)
58  var_range = [None, None]
59  if var+'_min' in config['validation']['GCP']: var_range[0] = float(config['validation']['GCP'][var+'_min'])
60  if var+'_max' in config['validation']['GCP']: var_range[1] = float(config['validation']['GCP'][var+'_max'])
61 
62  TkMap_pixel.set_var(var, var_range=var_range)
63  TkMap_pixel.analyse()
64  TkMap_pixel.save(out_dir=plot_dir)
65  if plot_png: TkMap_pixel.save(out_dir=plot_dir, extension='png')
66  TkMap_pixel.plot_variable_distribution(out_dir=plot_dir)
67 
68  TkMap_strips.set_var(var)
69  TkMap_strips.analyse()
70  TkMap_strips.save(out_dir=plot_dir)
71  if plot_png: TkMap_strips.save(out_dir=plot_dir, extension='png')
72  TkMap_strips.plot_variable_distribution(out_dir=plot_dir)
73 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def TkAlMap_plots(config)
Definition: GCPpyPlots.py:25
#define str(s)

Variable Documentation

◆ args

GCPpyPlots.args

Definition at line 76 of file GCPpyPlots.py.

◆ argv

GCPpyPlots.argv

◆ config

GCPpyPlots.config

Definition at line 80 of file GCPpyPlots.py.

◆ configFile

GCPpyPlots.configFile

◆ Loader

GCPpyPlots.Loader