CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
TkAlMap.TkAlMap Class Reference

Public Member Functions

def __del__
 
def __init__
 
def analyse
 Do all. More...
 
def clean_up
 Clean up. More...
 
def detect_tracker_version
 
def draw_cms_prelim
 
def draw_color_bar
 
def draw_event_info
 
def draw_text
 Draw functions. More...
 
def draw_title
 Titles and info. More...
 
def draw_TPL
 
def fill_colors
 
def get_color_rgb
 
def get_color_rgb_idx
 
def load_geometry
 
def load_tree
 Load functions. More...
 
def load_var
 
def plot_variable_distribution
 Test functions. More...
 
def prepare_map_colors
 
def save
 
def set_canvas
 
def set_colorbar_axis
 
def set_colorbar_colors
 
def set_palette
 
def set_var
 
def setup_colors
 Color setup. More...
 

Public Attributes

 canvas
 
 cfg_path
 
 col_dic
 
 color_bar
 
 color_bar_axis
 
 color_bar_colors
 
 colors
 
 data_path
 
 default_range
 
 do_tanh
 
 GEO_file
 tree = r_file.Get(tree_name) tree_tmp = r_file.Get(tree_name) tree = copy.deepcopy(tree_tmp) r_file.Close() More...
 
 height
 
 image_x1
 
 image_x2
 
 image_y1
 
 image_y2
 
 is_cleaned
 
 max_val
 
 mean_val
 
 min_val
 
 mod_val_dict
 
 n_color_color_bar
 
 palette
 
 rgb_map
 
 root_file
 
 start_color_idx
 
 std_val
 
 title
 
 TkAlMap_text_dict
 
 TkAlMap_TPL_dict
 
 tmp_file
 
 tmp_file_name
 
 tracker
 
 tree
 
 two_sigma_cap
 
 val_list
 else: if 'full' in self.tracker: print('Warning: Unknown module '+str(module)) r_file.Close() More...
 
 var
 
 var_max
 
 var_min
 
 var_name
 
 var_scale
 
 var_units
 
 width
 
 x_scale
 
 y_scale
 

Detailed Description

Definition at line 151 of file TkAlMap.py.

Constructor & Destructor Documentation

def TkAlMap.TkAlMap.__init__ (   self,
  variable,
  title,
  root_file,
  use_default_range = False,
  two_sigma_cap = False,
  height = 1400,
  GEO_file = 'TkAlMapDesign_phase1_cfg.py',
  tracker = 'full',
  palette = 2,
  do_tanh = False,
  check_tracker = True 
)

Definition at line 154 of file TkAlMap.py.

155  def __init__(self, variable, title, root_file, use_default_range=False, two_sigma_cap=False, height=1400, GEO_file='TkAlMapDesign_phase1_cfg.py', tracker='full', palette=2, do_tanh=False, check_tracker=True):
156  ROOT.gStyle.SetLineScalePS(1)
157 
158  # Configuration parameters
159  self.GEO_file = GEO_file
160  self.tracker = tracker
161  self.width = height
162  self.height = height
163  self.title = title
164  self.default_range = use_default_range
165  self.two_sigma_cap = two_sigma_cap
166  self.root_file = root_file
167  self.do_tanh = do_tanh
168 
169  # Value Initialization
170  self.max_val = None
171  self.min_val = None
173  self.tree = None
174  self.is_cleaned = False
175 
176  # Internal parameters
177  #self.data_path = 'Alignment-OfflineValidation/TkAlMap/'
178  self.data_path = 'Alignment/OfflineValidation/data/TkAlMap/'
179  self.cfg_path = 'Alignment/OfflineValidation/python/TkAlMap_cfg/'
180 
181  # Colorbar stuff
182  self.start_color_idx = 1200
183  self.n_color_color_bar = 1000
184 
185  # Initialization functions
186  self.set_palette(palette)
187  self.set_var(variable)
188  self.load_tree()
189  if check_tracker: self.detect_tracker_version()
190  self.load_geometry()
191  self.set_colorbar_colors()
def load_geometry
Definition: TkAlMap.py:507
def detect_tracker_version
Definition: TkAlMap.py:475
def load_tree
Load functions.
Definition: TkAlMap.py:395
def set_colorbar_colors
Definition: TkAlMap.py:348
GEO_file
tree = r_file.Get(tree_name) tree_tmp = r_file.Get(tree_name) tree = copy.deepcopy(tree_tmp) r_file...
Definition: TkAlMap.py:158
def TkAlMap.TkAlMap.__del__ (   self)

Definition at line 750 of file TkAlMap.py.

References TkAlMap.TkAlMap.clean_up().

751  def __del__(self):
752  self.clean_up()
753 
def clean_up
Clean up.
Definition: TkAlMap.py:743

Member Function Documentation

def TkAlMap.TkAlMap.analyse (   self)

Do all.

Definition at line 699 of file TkAlMap.py.

References TkAlMap.TkAlMap.do_tanh, TkAlMap.TkAlMap.draw_color_bar(), TkAlMap.TkAlMap.draw_text(), TkAlMap.TkAlMap.draw_TPL(), TkAlMap.TkAlMap.set_colorbar_axis(), TkAlMap.TkAlMap.set_colorbar_colors(), and TkAlMap.TkAlMap.setup_colors().

700  def analyse(self):
701  self.setup_colors()
702  self.set_colorbar_axis()
703  if self.do_tanh: self.set_colorbar_colors()
704  self.draw_TPL()
705  self.draw_text()
706  self.draw_color_bar()
def setup_colors
Color setup.
Definition: TkAlMap.py:215
def set_colorbar_axis
Definition: TkAlMap.py:332
def draw_text
Draw functions.
Definition: TkAlMap.py:658
def analyse
Do all.
Definition: TkAlMap.py:699
def set_colorbar_colors
Definition: TkAlMap.py:348
def draw_color_bar
Definition: TkAlMap.py:678
def TkAlMap.TkAlMap.clean_up (   self)

Clean up.

Definition at line 743 of file TkAlMap.py.

References TkAlMap.TkAlMap.is_cleaned, print(), and TkAlMap.TkAlMap.tmp_file_name.

Referenced by TkAlMap.TkAlMap.__del__().

744  def clean_up(self):
745  if not self.is_cleaned:
746  print('TkAlMap: deleting temporary file "'+self.tmp_file_name+'"')
747  self.tmp_file.Close()
748  os.remove(self.tmp_file_name)
749  self.is_cleaned = True
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def clean_up
Clean up.
Definition: TkAlMap.py:743
def TkAlMap.TkAlMap.detect_tracker_version (   self)

Definition at line 475 of file TkAlMap.py.

References TkAlMap.TkAlMap.GEO_file, print(), str, HIPMonitorVariables.tree, AlignmentIORootBase.tree, TkOfflineVariables.tree, HIPTwoBodyDecayAnalyzer.tree, and TkAlMap.TkAlMap.tree.

476  def detect_tracker_version(self):
477  print('TkAlMap: detecting Tk version')
478  #tree_name = 'alignTree'
479  #r_file = ROOT.TFile(self.root_file)
480  #if r_file is None: raise ValueError('The file "'+self.root_file+'" could not be opened')
481 
482  ##tree = r_file.Get(tree_name)
483  #tree_tmp = r_file.Get(tree_name)
484  #tree = copy.deepcopy(tree_tmp)
485  #r_file.Close()
486 
487  #if tree is None: raise ValueError('The tree "'+tree_name+'" was not found in file "'+self.root_file+'"')
488  phase = None
489  for event in self.tree:
490  module = event.id
491  if module > 303040000 and module < 306450000:
492  phase = 1
493  break
494  elif module > 302055000 and module < 302198000:
495  phase = 0
496  break
497  #r_file.Close()
498 
499  if phase is None: raise ValueError('TkAlMap: unknown tracker detected, is this phase2?')
500 
501  pahse_str = 'phase'+str(phase)
502  print('TkAlMap: '+pahse_str+' tracker detected')
503  if not pahse_str in self.GEO_file:
504  print('TkAlMap: changing tracker to '+pahse_str+ ', if this is unwanted set "check_tracker" to False')
505  self.GEO_file = 'TkAlMapDesign_'+pahse_str+'_cfg.py'
506  #self.load_geometry()
def detect_tracker_version
Definition: TkAlMap.py:475
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
GEO_file
tree = r_file.Get(tree_name) tree_tmp = r_file.Get(tree_name) tree = copy.deepcopy(tree_tmp) r_file...
Definition: TkAlMap.py:158
#define str(s)
def TkAlMap.TkAlMap.draw_cms_prelim (   self)

Definition at line 623 of file TkAlMap.py.

References TkAlMap.TkAlMap.draw_event_info(), presentation.PageLayout.height, TkAlMap.TkAlMap.height, svgfig.Plot.height, svgfig.Frame.height, svgfig.Dots.height, TkAlMap.TkAlMap.image_x1, presentation.PageLayout.width, TkAlMap.TkAlMap.width, svgfig.Plot.width, svgfig.Frame.width, svgfig.Dots.width, and TkAlMap.TkAlMap.y_scale.

Referenced by TkAlMap.TkAlMap.draw_text().

624  def draw_cms_prelim(self):
625  TL = ROOT.TLatex()
626  factor = 1. / 0.82
627  TL.SetTextSize(0.035*factor)
628  TL.SetTextAlign(11)
629  TL.SetTextFont(61)
630 
631  w_cms = ctypes.c_uint(0)
632  h_cms = ctypes.c_uint(0)
633  TL.GetTextExtent(w_cms, h_cms, 'CMS')
634  x1 = self.image_x1
635  y1 = 1. - (h_cms.value+0.)/(self.height+0.) - (1./(self.y_scale+0.))
636  self.canvas.cd()
637  TL.DrawLatex(x1, y1, 'CMS')
638 
639  TL.SetTextSize(0.035)
640  TL.SetTextFont(42)
641  x1_prel = x1 + 1.1*(w_cms.value+0.)/(self.width+0.)
642  TL.DrawLatex(x1_prel, y1, '#it{Preliminary}')
643 
644  self.draw_event_info(y1)
def draw_event_info
Definition: TkAlMap.py:645
def draw_cms_prelim
Definition: TkAlMap.py:623
def TkAlMap.TkAlMap.draw_color_bar (   self)

Definition at line 678 of file TkAlMap.py.

References TkAlMap.TkAlMap.color_bar, and print().

Referenced by TkAlMap.TkAlMap.analyse().

679  def draw_color_bar(self):
680  print('TkAlMap: drawing color bar')
681  self.canvas.cd()
682  for box in self.color_bar:
683  self.color_bar[box].Draw('f')
684  #self.color_bar[box].Draw()
685  self.color_bar_axis.Draw()
686  self.canvas.Update()
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def draw_color_bar
Definition: TkAlMap.py:678
def TkAlMap.TkAlMap.draw_event_info (   self,
  y 
)

Definition at line 645 of file TkAlMap.py.

References TkAlMap.TkAlMap.image_x2.

Referenced by TkAlMap.TkAlMap.draw_cms_prelim().

646  def draw_event_info(self, y):
647  TL = ROOT.TLatex()
648  TL.SetTextSize(0.035)
649  TL.SetTextFont(42)
650  TL.SetTextAlign(31)
651 
652  x1 = self.image_x2
653  y1 = y
654  self.canvas.cd()
655  TL.DrawLatex(x1, y1, 'pp collisions 13TeV')
656 
def draw_event_info
Definition: TkAlMap.py:645
def TkAlMap.TkAlMap.draw_text (   self)

Draw functions.

Definition at line 658 of file TkAlMap.py.

References TkAlMap.TkAlMap.draw_cms_prelim(), TkAlMap.TkAlMap.draw_title(), print(), and TkAlMap.TkAlMap.TkAlMap_text_dict.

Referenced by TkAlMap.TkAlMap.analyse().

659  def draw_text(self):
660  print('TkAlMap: drawing text')
661  self.canvas.cd()
662  TL = ROOT.TLatex()
663  TL.SetTextSize(0.025)
664  for key in self.TkAlMap_text_dict:
665  TL.SetTextAlign(self.TkAlMap_text_dict[key]['alignment'])
666  TL.DrawLatex(self.TkAlMap_text_dict[key]['x'], self.TkAlMap_text_dict[key]['y'], self.TkAlMap_text_dict[key]['text'])
667  self.draw_cms_prelim()
668  self.draw_title()
669  self.canvas.Update()
def draw_title
Titles and info.
Definition: TkAlMap.py:613
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def draw_text
Draw functions.
Definition: TkAlMap.py:658
def draw_cms_prelim
Definition: TkAlMap.py:623
def TkAlMap.TkAlMap.draw_title (   self)

Titles and info.

Definition at line 613 of file TkAlMap.py.

References TkAlMap.TkAlMap.image_x1, classes.PlotData.title, preexistingValidation.PreexistingValidation.title, alignment.Alignment.title, presentation.SubsectionBase.title, TkAlMap.TkAlMap.title, Geometry.title, and TkAlMap.TkAlMap.y_scale.

Referenced by TkAlMap.TkAlMap.draw_text().

614  def draw_title(self):
615  TL = ROOT.TLatex()
616  TL.SetTextSize(0.035)
617  TL.SetTextFont(42)
618  TL.SetTextAlign(13)
619  x1 = self.image_x1
620  y1 = 1-(5./(self.y_scale+0.))
621  self.canvas.cd()
622  TL.DrawLatex(x1, y1, self.title)
def draw_title
Titles and info.
Definition: TkAlMap.py:613
def TkAlMap.TkAlMap.draw_TPL (   self)

Definition at line 670 of file TkAlMap.py.

References print(), and TkAlMap.TkAlMap.TkAlMap_TPL_dict.

Referenced by TkAlMap.TkAlMap.analyse().

671  def draw_TPL(self):
672  print('TkAlMap: drawing PolyLines')
673  self.canvas.cd()
674  for module in self.TkAlMap_TPL_dict:
675  self.TkAlMap_TPL_dict[module].Draw('f')
676  self.TkAlMap_TPL_dict[module].Draw()
677  self.canvas.Update()
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def TkAlMap.TkAlMap.fill_colors (   self)

Definition at line 314 of file TkAlMap.py.

References TkAlMap.TkAlMap.get_color_rgb_idx(), TkAlMap.TkAlMap.max_val, TkAlMap.TkAlMap.min_val, TkAlMap.TkAlMap.mod_val_dict, print(), TkAlMap.TkAlMap.rgb_map, and TkAlMap.TkAlMap.TkAlMap_TPL_dict.

Referenced by TkAlMap.TkAlMap.setup_colors().

315  def fill_colors(self):
316  print('TkAlMap: filling the colors')
317  #self.set_palette()
318  for module in self.mod_val_dict:
319  if module in self.TkAlMap_TPL_dict:
320  val = self.mod_val_dict[module]
321  cap_val = val
322  if cap_val > self.max_val: cap_val = self.max_val
323  if cap_val < self.min_val: cap_val = self.min_val
324  rgb = self.get_color_rgb_idx(cap_val)
325  col = self.rgb_map[rgb]
326  #col = self.pal_map[rgb]
327  #col = self.col_dic[rgb]
328  #print(val, rgb, col)
329  self.TkAlMap_TPL_dict[module].SetFillColor(col)
330  #self.TkAlMap_TPL_dict[module].SetFillColor(TEST_COLOR_IDX)
331  ####else: print('Warning: Unknown module '+str(module))
def get_color_rgb_idx
Definition: TkAlMap.py:308
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def TkAlMap.TkAlMap.get_color_rgb (   self,
  val 
)

Definition at line 264 of file TkAlMap.py.

References TkAlMap.TkAlMap.do_tanh, TkAlMap.TkAlMap.max_val, TkAlMap.TkAlMap.mean_val, TkAlMap.TkAlMap.min_val, TkAlMap.TkAlMap.palette, TkAlMap.TkAlMap.std_val, and str.

Referenced by TkAlMap.TkAlMap.get_color_rgb_idx().

265  def get_color_rgb(self, val):
266  if self.max_val is None or self.min_val is None:
267  value_frac = val
268  else:
269  if self.do_tanh:
270  val_th = math.tanh((val - self.mean_val)/(self.std_val))
271  max_th = math.tanh((self.max_val - self.mean_val)/(self.std_val))
272  min_th = math.tanh((self.min_val - self.mean_val)/(self.std_val))
273  value_frac = (val_th - min_th + 0.)/(max_th - min_th)
274  else:
275  value_range = self.max_val - self.min_val
276  if value_range == 0.: value_frac = 0.5
277  else: value_frac = (val - self.min_val + 0.)/(value_range + 0.)
278 
279  if self.palette == 1:
280  r = 255
281  g = 255
282  b = 255
283 
284  if value_frac < 0.25:
285  r = 0
286  g = int(255.*((value_frac/0.25)))
287  b = 255
288  elif value_frac < 0.5:
289  r = 0
290  g = 255
291  b = int(255.*(1. -(value_frac - 0.25)/0.25))
292  elif value_frac < 0.75:
293  r = int(255.*((value_frac - 0.5)/0.25))
294  g = 255
295  b = 0
296  else:
297  r = 255
298  g = int(255.*(1. -(value_frac - 0.75)/0.25))
299  b = 0
300  return r, g, b
301  elif self.palette == 2:
302  red = [59, 76, 192]
303  blue = [180, 4, 38]
304  white = [255, 255, 255]
305  r, g, b = DivergingColor(red, blue, white, value_frac)
306  return r, g, b
307  else: raise ValueError('TkAlMap: unkown palette value '+str(palette)+', allowed values are 1 and 2')
def get_color_rgb
Definition: TkAlMap.py:264
#define str(s)
def TkAlMap.TkAlMap.get_color_rgb_idx (   self,
  val 
)

Definition at line 308 of file TkAlMap.py.

References TkAlMap.TkAlMap.get_color_rgb().

Referenced by TkAlMap.TkAlMap.fill_colors().

309  def get_color_rgb_idx(self, val):
310  r, g, b = self.get_color_rgb(val)
311  #return r*1000000+g*1000+b+1000000000
312  offset = 100
313  return int(r*255*255 + g*255 + r + g + b + offset)
def get_color_rgb_idx
Definition: TkAlMap.py:308
def get_color_rgb
Definition: TkAlMap.py:264
def TkAlMap.TkAlMap.load_geometry (   self)

Definition at line 507 of file TkAlMap.py.

References TkAlMap.TkAlMap.cfg_path, TkAlMap.TkAlMap.data_path, TkAlMap.TkAlMap.GEO_file, presentation.PageLayout.height, TkAlMap.TkAlMap.height, svgfig.Plot.height, svgfig.Frame.height, svgfig.Dots.height, SiStripPI.max, min(), sistrip::SpyUtilities.range(), TkAlMap.read_TPLfile(), TkAlMap.TkAlMap.tracker, presentation.PageLayout.width, TkAlMap.TkAlMap.width, svgfig.Plot.width, svgfig.Frame.width, and svgfig.Dots.width.

508  def load_geometry(self):
509  source_path = os.getenv('CMSSW_BASE') + '/src/'
510  var = {}
511  execfile(source_path + self.cfg_path + self.GEO_file, var)
512 
513  MapStructure = var['TkMap_GEO']
514 
515  all_modules = {}
516  all_text = {}
517  x_max = -9999.
518  y_max = -9999.
519  x_min = 9999.
520  y_min = 9999.
521  for det in MapStructure:
522  if 'pixel' in self.tracker:
523  if not 'pixel' in det: continue
524  elif 'strips' in self.tracker:
525  if not 'strips' in det: continue
526  for sub in MapStructure[det]:
527  for part in MapStructure[det][sub]:
528  if part == 'latex':
529  all_text[det+'_'+sub] = MapStructure[det][sub][part]
530  continue
531  if 'latex' in MapStructure[det][sub][part]:
532  all_text[det+'_'+sub+'_'+part] = MapStructure[det][sub][part]['latex']
533  #TPL_file = source_path + self.data_path +MapStructure[det][sub][part]['file']
534  TPL_file = cms.FileInPath(self.data_path +MapStructure[det][sub][part]['file'])
535  TPL_dict = read_TPLfile(TPL_file)
536  for module in TPL_dict:
537  x_canv = []
538  y_canv = []
539  for idx in range(len(TPL_dict[module]['x'])):
540  x_canv.append(TPL_dict[module]['x'][idx]*MapStructure[det][sub][part]['x_scale'] + MapStructure[det][sub][part]['x_off'])
541  y_canv.append(TPL_dict[module]['y'][idx]*MapStructure[det][sub][part]['y_scale'] + MapStructure[det][sub][part]['y_off'])
542  if max(x_canv) > x_max: x_max = max(x_canv)
543  if max(y_canv) > y_max: y_max = max(y_canv)
544  if min(x_canv) < x_min: x_min = min(x_canv)
545  if min(y_canv) < y_min: y_min = min(y_canv)
546  TPL_dict[module]['x'] = x_canv
547  TPL_dict[module]['y'] = y_canv
548  all_modules.update(TPL_dict)
549 
550  r_margin = 3
551  l_margin = 3
552  #t_margin = 15
553  t_margin = 11
554  b_margin = 8
555 
556  x_max += r_margin
557  x_min -= l_margin
558  y_max += t_margin
559  y_min -= b_margin
560 
561  x_range = x_max - x_min
562  y_range = y_max - y_min
563 
564  self.width = int(self.height*(x_range + 0.)/(y_range + 0.))
565  self.canvas.SetWindowSize(self.width, self.height)
566 
567  if (x_range + 0.)/(self.width + 0.) > (y_range + 0.)/(self.height + 0.):
568  x_scale = x_range
569  y_scale = (self.height + 0.)/(self.width + 0.)*x_range
570  else:
571  y_scale = y_range
572  x_scale = (self.width + 0.)/(self.height + 0.)*y_range
573  self.TkAlMap_TPL_dict = {}
574  for module in all_modules:
575  x = array('d', [])
576  y = array('d', [])
577  for idx in range(len(all_modules[module]['x'])):
578  x.append((all_modules[module]['x'][idx] - x_min + 0.)/(x_scale + 0.))
579  y.append((all_modules[module]['y'][idx] - y_min + 0.)/(y_scale + 0.))
580  # Begin point is end point
581  x.append((all_modules[module]['x'][0] - x_min + 0.)/(x_scale + 0.))
582  y.append((all_modules[module]['y'][0] - y_min + 0.)/(y_scale + 0.))
583  #print(x, y)
584  self.TkAlMap_TPL_dict[module] = ROOT.TPolyLine(len(x), x, y)
585  #self.TkAlMap_TPL_dict[module].SetFillColor(1)
586  self.TkAlMap_TPL_dict[module].SetLineColor(1)
587  #print('lineW', self.TkAlMap_TPL_dict[module].GetLineWidth())
588  #self.TkAlMap_TPL_dict[module].Draw('f')
589  #self.TkAlMap_TPL_dict[module].Draw()
591  self.image_x1 = (l_margin + 0.)/(x_scale + 0.)
592  self.image_x2 = (x_max - r_margin - x_min + 0.)/(x_scale + 0.)
593  self.image_y1 = (b_margin + 0.)/(y_scale + 0.)
594  self.image_y2 = (y_max - t_margin - y_min + 0.)/(y_scale + 0.)
596  self.x_scale = x_scale
597  self.y_scale = y_scale
598 
599  #TL = ROOT.TLatex()
600  #TL.SetTextSize(0.025)
601  self.TkAlMap_text_dict = {}
602  for key in all_text:
603  x = (all_text[key]['x'] - x_min + 0.)/(x_scale + 0.)
604  y = (all_text[key]['y'] - y_min + 0.)/(y_scale + 0.)
605  self.TkAlMap_text_dict[key] = {}
606  self.TkAlMap_text_dict[key]['x'] = x
607  self.TkAlMap_text_dict[key]['y'] = y
608  self.TkAlMap_text_dict[key]['alignment'] = all_text[key]['alignment']
609  self.TkAlMap_text_dict[key]['text'] = all_text[key]['text']
610  #TL.SetTextAlign(all_text[key]['alignment'])
611  #TL.DrawLatex(x, y, all_text[key]['text'])
def read_TPLfile
Definition: TkAlMap.py:124
tuple array
Definition: mps_check.py:216
const uint16_t range(const Frame &aFrame)
def load_geometry
Definition: TkAlMap.py:507
T min(T a, T b)
Definition: MathUtil.h:58
GEO_file
tree = r_file.Get(tree_name) tree_tmp = r_file.Get(tree_name) tree = copy.deepcopy(tree_tmp) r_file...
Definition: TkAlMap.py:158
def TkAlMap.TkAlMap.load_tree (   self)

Load functions.

Definition at line 395 of file TkAlMap.py.

References print(), and TkAlMap.TkAlMap.root_file.

396  def load_tree(self):
397  print('TkAlMap: loading tree ')
398  tree_name = 'alignTree'
399  r_file = ROOT.TFile(self.root_file)
400  if r_file is None: raise ValueError('The file "'+self.root_file+'" could not be opened')
401 
402  tree_tmp = r_file.Get(tree_name)
403  #self.tree = copy.deepcopy(tree_tmp)
404  self.tmp_file_name = str(time.time()).replace('.', '_')+'_TkAlMapTempFile.root'
405  self.tmp_file = ROOT.TFile(self.tmp_file_name, 'recreate')
406  self.tree = tree_tmp.CloneTree()
407  r_file.Close()
408  self.is_cleaned = False
409 
410  if self.tree is None: raise ValueError('The tree "'+tree_name+'" was not found in file "'+self.root_file+'"')
411 
412 
def load_tree
Load functions.
Definition: TkAlMap.py:395
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def TkAlMap.TkAlMap.load_var (   self)

Definition at line 413 of file TkAlMap.py.

References print().

Referenced by TkAlMap.TkAlMap.setup_colors().

414  def load_var(self):
415  print('TkAlMap: loading variable values ')
416  #tree_name = 'alignTree'
417  #r_file = ROOT.TFile(self.root_file)
418  #if r_file is None: raise ValueError('The file "'+self.root_file+'" could not be opened')
419 
420  #tree_tmp = r_file.Get(tree_name)
421  #tree = copy.deepcopy(tree_tmp)
422  #r_file.Close()
423 
424  #if tree is None: raise ValueError('The tree "'+tree_name+'" was not found in file "'+self.root_file+'"')
426  self.mod_val_dict = {}
427  self.val_list = []
428  for event in self.tree:
429  module = event.id
430  var = self.var
431  if var == 'rdphi':
432  val = getattr(event, 'r')*getattr(event, 'dphi')
433  else:
434  val = getattr(event, var)
435  val *= self.var_scale
436  self.mod_val_dict[module] = val
437  #if val not in self.val_list: self.val_list.append(val)
438  if module in self.TkAlMap_TPL_dict: self.val_list.append(val)
439  ####else:
440  #### if 'full' in self.tracker:
441  #### print('Warning: Unknown module '+str(module))
442  #r_file.Close()
443  if len(self.val_list) == 0:
444  print('Warning: no values filled, 0 moduleId\'s matched')
445  self.val_list = [-10+idx*0.5 for idx in range(41)]
446  self.val_list.sort()
447  self.mean_val = mean(self.val_list)
448  self.std_val = StdDev(self.val_list)
449  self.min_val = min(self.val_list)
450  self.max_val = max(self.val_list)
451 
452  if self.two_sigma_cap and not self.default_range:
453  print('-- Capping max and min: ')
454  print('---- True values : '+str(self.max_val)+', '+str(self.min_val))
455  self.min_val = max(min(self.val_list), self.mean_val - 2*self.std_val)
456  self.max_val = min(max(self.val_list), self.mean_val + 2*self.std_val)
457  print('---- Capped values : '+str(self.max_val)+', '+str(self.min_val))
458 
459  if self.default_range:
460  #if not self.var in KNOWN_VARIABLES: print('Warning: capping to default range not possible for unknown variable "'+self.var+'"')
461  if self.var_min is None or self.var_max is None: print('Warning: capping to default range for unknown variable "'+self.var+'" while range was not set is not possible')
462  else:
463  print('-- Capping max and min to default ranges: ')
464  print('---- True values : '+str(self.max_val)+', '+str(self.min_val))
465  self.min_val = self.var_min
466  self.max_val = self.var_max
467  print('---- Capped values : '+str(self.max_val)+', '+str(self.min_val))
468 
469  if self.min_val == self.max_val:
470  print('Warning: minimum value was equal to maximum value, '+str(self.max_val))
471  self.min_val = self.mean_val - 1.
472  self.max_val = self.mean_val + 1.
473 
474  #print(self.val_list)
const uint16_t range(const Frame &aFrame)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
T min(T a, T b)
Definition: MathUtil.h:58
def mean
Definition: TkAlMap.py:114
def StdDev
Definition: TkAlMap.py:117
#define str(s)
val_list
else: if &#39;full&#39; in self.tracker: print(&#39;Warning: Unknown module &#39;+str(module)) r_file.Close()
Definition: TkAlMap.py:426
def TkAlMap.TkAlMap.plot_variable_distribution (   self,
  nbins = 200,
  out_dir = '.' 
)

Test functions.

Definition at line 708 of file TkAlMap.py.

References join(), SiStripPI.max, TkAlMap.TkAlMap.mean_val, min(), print(), TkAlMap.TkAlMap.std_val, TkAlMap.TkAlMap.tracker, TkAlMap.TkAlMap.two_sigma_cap, TkAlMap.TkAlMap.val_list, TkAlMap.TkAlMap.var, TkAlMap.TkAlMap.var_name, and TkAlMap.TkAlMap.var_units.

709  def plot_variable_distribution(self, nbins=200, out_dir='.'):
710  print('TkAlMap: drawing variable distribution')
711  canv_name = 'histogram_canvas_'+self.tracker+'_'+self.var
712  if self.two_sigma_cap: canv_name += '_cap'
713  canvas = ROOT.TCanvas(canv_name, 'TkAlMap '+self.var+' histogram canvas', 800, 800)
714 
715  h_min = min(min(self.val_list), self.mean_val - 2*self.std_val) - self.std_val
716  h_max = max(max(self.val_list), self.mean_val + 2*self.std_val) + self.std_val
717  hist = ROOT.TH1F(self.var+'_hist', 'Variable distribution', nbins, h_min, h_max)
718  for val in self.val_list:
719  hist.Fill(val)
720  hist.GetXaxis().SetTitle(self.var_name+' ['+self.var_units+']')
721  hist.GetYaxis().SetTitle('modules')
722  ROOT.gStyle.SetOptStat(0)
723  hist.Draw('e1')
724  canvas.Update()
725  left = ROOT.TLine(self.mean_val - 2*self.std_val, canvas.GetUymin(), self.mean_val - 2*self.std_val, canvas.GetUymax())
726  left.SetLineColor(2)
727  left.SetLineStyle(9)
728  left.Draw()
729  right = ROOT.TLine(self.mean_val + 2*self.std_val, canvas.GetUymin(), self.mean_val + 2*self.std_val, canvas.GetUymax())
730  right.SetLineColor(2)
731  right.SetLineStyle(9)
732  right.Draw()
733  mid = ROOT.TLine(self.mean_val, canvas.GetUymin(), self.mean_val, canvas.GetUymax())
734  mid.SetLineColor(1)
735  mid.SetLineStyle(9)
736  mid.Draw()
737  canvas.Update()
738  name = '_'.join(['VariableDistribution', self.var, self.tracker])
739  path = out_dir + '/' + name + '.png'
740  canvas.SaveAs(path)
741 
def plot_variable_distribution
Test functions.
Definition: TkAlMap.py:708
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
T min(T a, T b)
Definition: MathUtil.h:58
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
val_list
else: if &#39;full&#39; in self.tracker: print(&#39;Warning: Unknown module &#39;+str(module)) r_file.Close()
Definition: TkAlMap.py:426
def TkAlMap.TkAlMap.prepare_map_colors (   self)

Definition at line 220 of file TkAlMap.py.

References print().

Referenced by TkAlMap.TkAlMap.setup_colors().

221  def prepare_map_colors(self):
222  print('TkAlMap: preparing map colors')
223 
224  self.colors = []
225  #self.palette = array('i', [])
226  col_idx = self.start_color_idx + self.n_color_color_bar + 10
227  self.col_dic = {}
228  self.rgb_map = {}
229  #pal_idx = 0
230  #self.pal_map = {}
231  for val in self.val_list:
232  cap_val = val
233  if cap_val > self.max_val: cap_val = self.max_val
234  if cap_val < self.min_val: cap_val = self.min_val
235  r, g, b = self.get_color_rgb(cap_val)
236  idx = self.get_color_rgb_idx(cap_val)
237  if idx in self.colors: continue
238  self.colors.append(idx)
239  col_idx +=1
240  self.rgb_map[idx] = col_idx
241  #print( idx, (r+0.)/255., (g+0.)/255., (b+0.)/255.)
242  #color = ROOT.TColor(col_idx, (r+0.)/255., (g+0.)/255., (b+0.)/255.)
243 
244  #self.col_dic[idx] = ROOT.TColor(col_idx, (r+0.)/255., (g+0.)/255., (b+0.)/255.)
245  try:
246  col = ROOT.gROOT.GetColor(col_idx)
247  col.SetRGB((r+0.)/255., (g+0.)/255., (b+0.)/255.)
248  self.col_dic[idx] = col
249  except:
250  self.col_dic[idx] = ROOT.TColor(col_idx, (r+0.)/255., (g+0.)/255., (b+0.)/255.)
251  #self.palette.append(col_idx)
252  print('TkAlMap: map contains '+str(len(self.colors))+' colors')
def get_color_rgb_idx
Definition: TkAlMap.py:308
def get_color_rgb
Definition: TkAlMap.py:264
def prepare_map_colors
Definition: TkAlMap.py:220
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
val_list
else: if &#39;full&#39; in self.tracker: print(&#39;Warning: Unknown module &#39;+str(module)) r_file.Close()
Definition: TkAlMap.py:426
def TkAlMap.TkAlMap.save (   self,
  out_dir = '.',
  extension = 'pdf' 
)

Definition at line 687 of file TkAlMap.py.

References TkAlMap.TkAlMap.default_range, join(), print(), TkAlMap.TkAlMap.tracker, TkAlMap.TkAlMap.two_sigma_cap, and TkAlMap.TkAlMap.var.

Referenced by SpecificationBuilder_cfi.Specification.saveAll().

688  def save(self, out_dir='.', extension='pdf'):
689  name = '_'.join(['TkAlMap', self.tracker, self.var])
690  if self.two_sigma_cap and not self.default_range:
691  name += '_4sig'
692  elif self.default_range:
693  name += '_drange'
694  path = out_dir + '/' + name + '.' + extension
695  print('TkAlMap: saving canvas in "'+path+'"')
696  self.canvas.SaveAs(path)
697 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
static std::string join(char **cmd)
Definition: RemoteFile.cc:19
def TkAlMap.TkAlMap.set_canvas (   self)

Definition at line 208 of file TkAlMap.py.

References TkAlMap.TkAlMap.tracker, TkAlMap.TkAlMap.two_sigma_cap, and TkAlMap.TkAlMap.var.

209  def set_canvas(self):
210  canv_name = 'canvas_'+self.tracker+'_'+self.var
211  if self.two_sigma_cap: canv_name += '_cap'
212  self.canvas = ROOT.TCanvas(canv_name, 'TkAlMap '+self.var+' canvas', self.width, self.height)
213  print('Actual w: '+str(self.canvas.GetWw())+', Actual h: '+str(self.canvas.GetWh()))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def TkAlMap.TkAlMap.set_colorbar_axis (   self)

Definition at line 332 of file TkAlMap.py.

References TkAlMap.TkAlMap.image_x1, TkAlMap.TkAlMap.image_x2, and print().

Referenced by TkAlMap.TkAlMap.analyse().

333  def set_colorbar_axis(self):
334  print('TkAlMap: setting color bar axis')
335  b_x1 = self.image_x1
336  b_x2 = self.image_x2
337  b_y1 = 0.06
338  b_y2 = 0.06
339  b_width = 0.01
340  self.color_bar_axis = ROOT.TGaxis(b_x1, b_y1, b_x2, b_y2, self.min_val, self.max_val, 50510, '+S')
341  self.color_bar_axis.SetName('color_bar_axis')
342  self.color_bar_axis.SetLabelSize(0.02)
343  self.color_bar_axis.SetTickSize(0.01)
344  if self.two_sigma_cap and not self.default_range: self.color_bar_axis.SetTitle('{#mu - 2#sigma #leq '+self.var_name+' #leq #mu + 2#sigma} ['+self.var_units+']')
345  elif self.default_range: self.color_bar_axis.SetTitle('{'+str(self.min_val)+' #leq '+self.var_name+' #leq '+str(self.max_val)+'} ['+self.var_units+']')
346  else: self.color_bar_axis.SetTitle(self.var_name+' ['+self.var_units+']')
347  self.color_bar_axis.SetTitleSize(0.025)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def set_colorbar_axis
Definition: TkAlMap.py:332
#define str(s)
def TkAlMap.TkAlMap.set_colorbar_colors (   self)

Definition at line 348 of file TkAlMap.py.

References TkAlMap.TkAlMap.image_x1, TkAlMap.TkAlMap.image_x2, TkAlMap.TkAlMap.max_val, TkAlMap.TkAlMap.min_val, TkAlMap.TkAlMap.n_color_color_bar, and print().

Referenced by TkAlMap.TkAlMap.analyse().

349  def set_colorbar_colors(self):
350  print('TkAlMap: initialize color bar colors')
351  if self.max_val is None or self.min_val is None:
352  col_step = 1./(self.n_color_color_bar + 0.)
353  val = col_step/2.
354  else:
355  b_range = self.max_val - self.min_val
356  col_step = (b_range + 0.)/(self.n_color_color_bar + 0.)
357  val = self.min_val + col_step/2.
358 
359  b_x1 = self.image_x1
360  b_x2 = self.image_x2
361  b_y1 = 0.06
362  b_y2 = 0.06
363  b_width = 0.01
364  b_xrange = b_x2 - b_x1
365  b_yrange = b_y2 - b_y1
366  b_dx = (b_xrange + 0.)/(self.n_color_color_bar + 0.)
367  b_dy = (b_yrange + 0.)/(self.n_color_color_bar + 0.)
369  self.color_bar = {}
370  x1 = b_x1
371  y1 = b_y1
372 
373  col_idx = self.start_color_idx
374  for i_c in range(self.n_color_color_bar):
375  col_idx += 1
376  r, g, b = self.get_color_rgb(val)
377  try:
378  col = ROOT.gROOT.GetColor(col_idx)
379  col.SetRGB((r+0.)/255., (g+0.)/255., (b+0.)/255.)
380  self.color_bar_colors[col_idx] = col
381  except:
382  self.color_bar_colors[col_idx] = ROOT.TColor(col_idx, (r+0.)/255., (g+0.)/255., (b+0.)/255.)
383  x2 = x1 + b_dx
384  y2 = y1 + b_dy + b_width
385  x = array('d', [x1, x1, x2, x2])
386  y = array('d', [y1, y2, y2, y1])
387  self.color_bar[col_idx] = ROOT.TPolyLine(len(x), x, y)
388  self.color_bar[col_idx].SetFillColor(col_idx)
389  self.color_bar[col_idx].SetLineColor(col_idx)
390 
391  x1 += b_dx
392  y1 += b_dy
393  val += col_step
tuple array
Definition: mps_check.py:216
const uint16_t range(const Frame &aFrame)
def get_color_rgb
Definition: TkAlMap.py:264
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def set_colorbar_colors
Definition: TkAlMap.py:348
def TkAlMap.TkAlMap.set_palette (   self,
  palette 
)

Definition at line 253 of file TkAlMap.py.

254  def set_palette(self, palette):
255  self.palette = palette
256  pal_str = 'TkAlMap: setting the palette to '+str(palette)
257  if palette == 1: pal_str += ' (rainbow)'
258  elif palette == 2: pal_str += ' (B->R diverging)'
259  else: raise ValueError('TkAlMap: unkown palette value '+str(palette)+', allowed values are 1 and 2')
260  print(pal_str)
261  #ROOT.gstyle.SetPalette(len(self.colors), self.colors)
262  #ROOT.gStyle.SetPalette(len(self.palette), self.palette)
263  pass
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def TkAlMap.TkAlMap.set_var (   self,
  var,
  var_range = [None,
  None 
)

Definition at line 192 of file TkAlMap.py.

References print().

193  def set_var(self, var, var_range=[None, None]):
194  print('TkAlMap: setting variable to '+var)
195  self.var = var
196  self.var_name = var
197  self.var_units = 'cm'
198  self.var_scale = 1.
199  self.var_min = var_range[0]
200  self.var_max = var_range[1]
201  if var in KNOWN_VARIABLES:
202  self.var_name = KNOWN_VARIABLES[var]['name']
203  self.var_units = KNOWN_VARIABLES[var]['units']
204  self.var_scale = KNOWN_VARIABLES[var]['scale']
205  if self.var_min is None: self.var_min = KNOWN_VARIABLES[var]['range'][0]
206  if self.var_max is None: self.var_max = KNOWN_VARIABLES[var]['range'][1]
207  self.set_canvas()
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def TkAlMap.TkAlMap.setup_colors (   self)

Color setup.

Definition at line 215 of file TkAlMap.py.

References TkAlMap.TkAlMap.fill_colors(), TkAlMap.TkAlMap.load_var(), and TkAlMap.TkAlMap.prepare_map_colors().

Referenced by TkAlMap.TkAlMap.analyse().

216  def setup_colors(self):
217  self.load_var()
218  self.prepare_map_colors()
219  self.fill_colors()
def setup_colors
Color setup.
Definition: TkAlMap.py:215
def prepare_map_colors
Definition: TkAlMap.py:220

Member Data Documentation

TkAlMap.TkAlMap.canvas

Definition at line 211 of file TkAlMap.py.

TkAlMap.TkAlMap.cfg_path

Definition at line 178 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.load_geometry().

TkAlMap.TkAlMap.col_dic

Definition at line 226 of file TkAlMap.py.

TkAlMap.TkAlMap.color_bar

Definition at line 368 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_color_bar().

TkAlMap.TkAlMap.color_bar_axis

Definition at line 339 of file TkAlMap.py.

TkAlMap.TkAlMap.color_bar_colors

Definition at line 171 of file TkAlMap.py.

TkAlMap.TkAlMap.colors

Definition at line 223 of file TkAlMap.py.

TkAlMap.TkAlMap.data_path

Definition at line 177 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.load_geometry().

TkAlMap.TkAlMap.default_range

Definition at line 163 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.save().

TkAlMap.TkAlMap.do_tanh

Definition at line 166 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.analyse(), and TkAlMap.TkAlMap.get_color_rgb().

TkAlMap.TkAlMap.GEO_file

tree = r_file.Get(tree_name) tree_tmp = r_file.Get(tree_name) tree = copy.deepcopy(tree_tmp) r_file.Close()

Definition at line 158 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.detect_tracker_version(), and TkAlMap.TkAlMap.load_geometry().

TkAlMap.TkAlMap.height

Definition at line 161 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_cms_prelim(), and TkAlMap.TkAlMap.load_geometry().

TkAlMap.TkAlMap.image_x1

Definition at line 590 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_cms_prelim(), TkAlMap.TkAlMap.draw_title(), TkAlMap.TkAlMap.set_colorbar_axis(), and TkAlMap.TkAlMap.set_colorbar_colors().

TkAlMap.TkAlMap.image_x2

Definition at line 591 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_event_info(), TkAlMap.TkAlMap.set_colorbar_axis(), and TkAlMap.TkAlMap.set_colorbar_colors().

TkAlMap.TkAlMap.image_y1

Definition at line 592 of file TkAlMap.py.

TkAlMap.TkAlMap.image_y2

Definition at line 593 of file TkAlMap.py.

TkAlMap.TkAlMap.is_cleaned

Definition at line 173 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.clean_up().

TkAlMap.TkAlMap.max_val

Definition at line 169 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.fill_colors(), TkAlMap.TkAlMap.get_color_rgb(), and TkAlMap.TkAlMap.set_colorbar_colors().

TkAlMap.TkAlMap.mean_val

Definition at line 446 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.get_color_rgb(), and TkAlMap.TkAlMap.plot_variable_distribution().

TkAlMap.TkAlMap.min_val

Definition at line 170 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.fill_colors(), TkAlMap.TkAlMap.get_color_rgb(), and TkAlMap.TkAlMap.set_colorbar_colors().

TkAlMap.TkAlMap.mod_val_dict

Definition at line 425 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.fill_colors().

TkAlMap.TkAlMap.n_color_color_bar

Definition at line 182 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.set_colorbar_colors().

TkAlMap.TkAlMap.palette

Definition at line 254 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.get_color_rgb().

TkAlMap.TkAlMap.rgb_map

Definition at line 227 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.fill_colors().

TkAlMap.TkAlMap.root_file

Definition at line 165 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.load_tree().

TkAlMap.TkAlMap.start_color_idx

Definition at line 181 of file TkAlMap.py.

TkAlMap.TkAlMap.std_val

Definition at line 447 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.get_color_rgb(), and TkAlMap.TkAlMap.plot_variable_distribution().

TkAlMap.TkAlMap.title

Definition at line 162 of file TkAlMap.py.

Referenced by python.rootplot.root2matplotlib.HistStack.bar(), python.rootplot.root2matplotlib.HistStack.bar3d(), python.rootplot.root2matplotlib.HistStack.barcluster(), python.rootplot.root2matplotlib.HistStack.barh(), python.rootplot.root2matplotlib.HistStack.barstack(), TkAlMap.TkAlMap.draw_title(), python.rootplot.root2matplotlib.HistStack.errorbar(), python.rootplot.root2matplotlib.HistStack.errorbarh(), Formatter.SimpleHTMLFormatter.headers(), python.rootplot.root2matplotlib.HistStack.histstack(), python.rootplot.root2matplotlib.Hist.show_titles(), python.rootplot.utilities.Hist.TGraph(), python.rootplot.utilities.Hist.TH1F(), python.rootplot.utilities.Hist2D.TH2F(), and python.rootplot.root2matplotlib.Hist2D.TH2F().

TkAlMap.TkAlMap.TkAlMap_text_dict

Definition at line 600 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_text().

TkAlMap.TkAlMap.TkAlMap_TPL_dict

Definition at line 572 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_TPL(), and TkAlMap.TkAlMap.fill_colors().

TkAlMap.TkAlMap.tmp_file

Definition at line 404 of file TkAlMap.py.

TkAlMap.TkAlMap.tmp_file_name

Definition at line 403 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.clean_up().

TkAlMap.TkAlMap.tracker

Definition at line 159 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.load_geometry(), TkAlMap.TkAlMap.plot_variable_distribution(), TkAlMap.TkAlMap.save(), and TkAlMap.TkAlMap.set_canvas().

TkAlMap.TkAlMap.tree

Definition at line 172 of file TkAlMap.py.

Referenced by eventstfile.Events.__iter__(), svgfig.SVG.__str__(), ZJetsTreeAnalyzer.ZJetsTreeAnalyzer.beginLoop(), MetTreeProducer.MetTreeProducer.declareVariables(), core.AutoFillTreeProducer.AutoFillTreeProducer.declareVariables(), TkAlMap.TkAlMap.detect_tracker_version(), core.AutoFillTreeProducer.AutoFillTreeProducer.fillTree(), ZJetsTreeAnalyzer.ZJetsTreeAnalyzer.process(), MetTreeProducer.MetTreeProducer.process(), python.cmstools.EventTree.SetAlias(), and eventstfile.Events.to().

TkAlMap.TkAlMap.two_sigma_cap

Definition at line 164 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.plot_variable_distribution(), TkAlMap.TkAlMap.save(), and TkAlMap.TkAlMap.set_canvas().

TkAlMap.TkAlMap.val_list

else: if 'full' in self.tracker: print('Warning: Unknown module '+str(module)) r_file.Close()

Definition at line 426 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.plot_variable_distribution().

TkAlMap.TkAlMap.var

Definition at line 194 of file TkAlMap.py.

Referenced by tree.Tree.copyStructure(), TkAlMap.TkAlMap.plot_variable_distribution(), TkAlMap.TkAlMap.save(), and TkAlMap.TkAlMap.set_canvas().

TkAlMap.TkAlMap.var_max

Definition at line 199 of file TkAlMap.py.

TkAlMap.TkAlMap.var_min

Definition at line 198 of file TkAlMap.py.

TkAlMap.TkAlMap.var_name

Definition at line 195 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.plot_variable_distribution().

TkAlMap.TkAlMap.var_scale

Definition at line 197 of file TkAlMap.py.

TkAlMap.TkAlMap.var_units

Definition at line 196 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.plot_variable_distribution().

TkAlMap.TkAlMap.width

Definition at line 160 of file TkAlMap.py.

Referenced by python.rootplot.utilities.Hist.__init_TGraph(), python.rootplot.root2matplotlib.Hist.bar(), python.rootplot.root2matplotlib.Hist.barh(), TkAlMap.TkAlMap.draw_cms_prelim(), and TkAlMap.TkAlMap.load_geometry().

TkAlMap.TkAlMap.x_scale

Definition at line 595 of file TkAlMap.py.

TkAlMap.TkAlMap.y_scale

Definition at line 596 of file TkAlMap.py.

Referenced by TkAlMap.TkAlMap.draw_cms_prelim(), and TkAlMap.TkAlMap.draw_title().