ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CoreClass.Draw_Occupancy Class Reference
Inheritance diagram for CoreClass.Draw_Occupancy:
Collaboration diagram for CoreClass.Draw_Occupancy:

Public Member Functions

def __init__ (self, inHisto)
 
def genGraph_LB2Lumi (self, h_LB)
 
def doNEvtScale (self, h_NEvt_LB)
 
def GetGraphs_rate_perPanel (self)
 
def getObject_1panel (self, config)
 
def getObject_1SectorLayer (self, config, sec_layer, temp_dic)
 
def getHist_1Panel (self, config)
 
def initialHist_1Panel (self, name_suffix, title_suffix, titles)
 
def getContent (self, singleObj)
 
def setCutLine (self, i_histo, index=0)
 
def parseHisto_allPanels (self)
 First level: sector - layer(dbR+gasGap) More...
 
def parseHisto_allSectorAndLayers (self)
 
def GetSummary_allSectorsAndLayers (self, config)
 
def GetSummary_eachSectorsAndLayers (self, config)
 
def GetHist1D_ySectorsAndLayers (self, config)
 
def GetHist1D_yPanels (self, config)
 
def GetHist2D_EtaPhi_allLayer (self, config, doSetZRange=True)
 
def decorateAllSectorSummary (self, dic_hist)
 
def decorateSummary_perSector (self, dic_hist)
 
def modifyXlabel (self, hist)
 
def SetPanelDic (self, dic_panels)
 
def SetLumiInfoDic (self, dic_lumiInfo)
 
def setOut_Panels (self, list_panelInds=[], list_panelNames=[])
 
def GetBadPanels (self)
 
def setHistnameVariable (self, config)
 
def getHist_1SectorLayer (self, config, sec_layer, temp_dic, titles)
 

Public Attributes

 list_graphs_rate_panel
 
 doneParserPanel
 
 doneParserSectorAndLayer
 

Static Public Attributes

int T_chi2_sl = 15.
 
int T_p0_sl = 2e6
 
int Tlow_p1_sl = 5e3
 
int Tup_p1_sl = 15e6
 
int T_predRate = 30e6
 
int T_chi2_panel = 15.
 
int T_p0_panel = 2e5
 
int Tlow_p1_panel = 5e3
 
int Tup_p1_panel = 3e5
 
int T_predRate_panel = 30e6
 

Private Member Functions

def __getTimeScale (self)
 
def _post_allSectorAndLayers (self, temp_dic)
 
def _prepareHisto (self)
 

Private Attributes

 __refInstLumi
 
 _NEvtScale
 
 __h_NEvt_LB
 
 _variable
 
 _dic_sectors_layers
 
 _in_hname
 
 _full_panel
 
 _list_outPanelInds
 
 _list_outPanelNames
 
 _in_histo
 
 _dic_panels_detect
 
 _out_htitle
 
 _nbins
 
 _low
 
 _up
 
 _doSetZRange
 
 _PanelsProperties
 
 _Dic_LumiInfo
 

Static Private Attributes

dictionary _rangeOfVariables_perPanel
 
dictionary _rangeOfVariables_allPanels
 
dictionary _nbins_hist
 
dictionary _unitsOfVariables
 
dictionary _precision
 
dictionary _var_title
 
list _cut_variables = ["p0", "p1", "chi2", "predRate", "meanRate"]
 
dictionary _cuts_summaryHist_allSectorLayer
 
dictionary _cuts_summaryHist_perSectorLayer
 
string _in_hname = ''
 
bool _full_panel = True
 
list _list_outPanelInds = []
 
list _list_outPanelNames = []
 
list _hists_bad_panels = []
 

Detailed Description

Definition at line 661 of file CoreClass.py.

Constructor & Destructor Documentation

◆ __init__()

def CoreClass.Draw_Occupancy.__init__ (   self,
  inHisto 
)

Reimplemented from CoreClass.Draw_Base.

Definition at line 664 of file CoreClass.py.

664  def __init__(self, inHisto):
665  super(Draw_Occupancy, self).__init__(inHisto)
666  self.__refInstLumi = 2. # 2*10^{34} [cm^{-2}s^{-1}]
667  self.list_graphs_rate_panel = []
668 
669  self._NEvtScale = False
670 

Member Function Documentation

◆ __getTimeScale()

def CoreClass.Draw_Occupancy.__getTimeScale (   self)
private

Definition at line 672 of file CoreClass.py.

672  def __getTimeScale(self):
673  timeScale = 100e-9
674  return timeScale
675 

◆ _post_allSectorAndLayers()

def CoreClass.Draw_Occupancy._post_allSectorAndLayers (   self,
  temp_dic 
)
private

Reimplemented from CoreClass.Draw_Base.

Definition at line 847 of file CoreClass.py.

847  def _post_allSectorAndLayers(self, temp_dic):
848  self._dic_sectors_layers = {}
849 
850  for sec_layer, hist in temp_dic.items():
851  grs = self.genGraph_LB2Lumi(hist)
852  fitRe = RPCRawDataMonUtils.linearFit(grs)
853 
854  self._dic_sectors_layers[sec_layer] = fitRe[1]
855 

◆ _prepareHisto()

def CoreClass.Draw_Base._prepareHisto (   self)
privateinherited

Reimplemented in CoreClass.Draw_HitOuttimeFraction, and CoreClass.Draw_DetectEfficiency.

Definition at line 202 of file CoreClass.py.

202  def _prepareHisto(self):
203  self._out_htitle = self._var_title[self._variable]
204 
205  nbins_X = self._in_histo.GetNbinsX()
206  self._nbins = nbins_X
207  self._low = self._in_histo.GetXaxis().GetXmin()
208  self._up = self._in_histo.GetXaxis().GetXmax()
209 

◆ decorateAllSectorSummary()

def CoreClass.Draw_Base.decorateAllSectorSummary (   self,
  dic_hist 
)
inherited

Definition at line 517 of file CoreClass.py.

517  def decorateAllSectorSummary(self, dic_hist):
518  minY = 1e6
519  maxY = 0.
520  for i_layer in range(1, 9): # 1, 2, ..., 8
521  ind = i_layer-1
522  i_histo = dic_hist[i_layer]
523  i_histo.SetMarkerSize(1.0)
524  i_histo.SetMarkerStyle(markers[ind])
525  i_histo.SetMarkerColor(colors[ind])
526  i_histo.SetLineColor(colors[ind])
527  i_histo.SetLineWidth(2)
528 
529  minY = min(i_histo.GetMinimum(), minY)
530  maxY = max(i_histo.GetMaximum(), maxY)
531 
532  diffMaxMin = maxY-minY
533  list_hist = []
534  for i_layer in range(1, 9): # 1, 2, ..., 8
535  i_histo = dic_hist[i_layer]
536  i_histo.GetXaxis().SetTitleOffset(1.0)
537  i_histo.GetYaxis().SetTitleOffset(1.0)
538  i_histo.GetYaxis().SetRangeUser(minY-0.2*diffMaxMin, maxY+1.5*diffMaxMin)
539 
540  if self._variable in self._cut_variables:
541  self.setCutLine(i_histo, 0)
542 
543  list_hist.append(i_histo)
544 
545  return list_hist
546 

◆ decorateSummary_perSector()

def CoreClass.Draw_Base.decorateSummary_perSector (   self,
  dic_hist 
)
inherited

Definition at line 548 of file CoreClass.py.

548  def decorateSummary_perSector(self, dic_hist):
549  ind = 0
550  minY = 1e10
551  maxY = 0.
552  for i_dbPhi_meas, i_histo in dic_hist.items():
553  i_histo.SetMarkerSize(1.0)
554  i_histo.SetMarkerStyle(markers[ind])
555  i_histo.SetMarkerColor(colors[ind])
556  i_histo.SetLineColor(colors[ind])
557  i_histo.SetLineWidth(2)
558  i_histo.GetXaxis().SetTitleOffset(1.0)
559  i_histo.GetYaxis().SetTitleOffset(1.2)
560 
561  ind += 1
562  minY = min(i_histo.GetMinimum(), minY)
563  maxY = max(i_histo.GetMaximum(), maxY)
564 
565  diffMaxMin = maxY-minY
566 
567  ind = 0
568  list_hist = []
569  for i_dbPhi in [1,2]:
570  for i_measPhi in [0,1]:
571  try:
572  i_histo = dic_hist[(i_dbPhi, i_measPhi)]
573  except KeyError:
574  continue
575 
576  i_histo.GetYaxis().SetRangeUser(minY-0.2*diffMaxMin, maxY+1.3*diffMaxMin)
577 
578  if self._variable in self._cut_variables:
579  self.setCutLine(i_histo, 1)
580 
581  list_hist.append(i_histo)
582 
583  return list_hist
584 

◆ doNEvtScale()

def CoreClass.Draw_Occupancy.doNEvtScale (   self,
  h_NEvt_LB 
)

Definition at line 729 of file CoreClass.py.

729  def doNEvtScale(self, h_NEvt_LB):
730  self._NEvtScale = True
731  self.__h_NEvt_LB = h_NEvt_LB
732 

◆ genGraph_LB2Lumi()

def CoreClass.Draw_Occupancy.genGraph_LB2Lumi (   self,
  h_LB 
)

Definition at line 677 of file CoreClass.py.

677  def genGraph_LB2Lumi(self, h_LB):
678  h_name = h_LB.GetName()
679  h_title = h_LB.GetTitle()
680  g_name = h_name.replace('LB', 'Lumi')
681  g_title = h_title.replace('LB', 'Lumi')
682  g_Xtitle = 'Inst luminosity [10^{34} cm^{-2}s^{-1}]'
683  g_Ytitle = 'RPC hit rate[Hz]'
684 
685  if self._NEvtScale:
686  timeScale = self.__getTimeScale()
687 
688  x = []
689  y = []
690  y_err = []
691  for LB, lbInfo in self._Dic_LumiInfo.items():
692  if lbInfo['AtlasPhysics'] == 'false' or float(lbInfo['Duration'])<50.:
693  continue
694 
695  hit_content = round(h_LB.GetBinContent(LB), 2)
696  hit_err = round(h_LB.GetBinError(LB),2)
697 
698  hit_y = hit_content
699  hit_y_err = hit_err
700 
701  if hit_content < 1 :
702  continue
703 
704  if self._NEvtScale:
705  evt_content = round(self.__h_NEvt_LB.GetBinContent(LB),2)
706  evt_error = round(self.__h_NEvt_LB.GetBinError(LB),2)
707  if evt_content < 1 :
708  continue
709  hit_rate = hit_content/(evt_content*timeScale)
710 
711  err_temp1 = pow(hit_err/evt_content,2)
712  err_temp2 = pow(evt_error*hit_content/pow(evt_content,2), 2)
713  hitRate_err = math.sqrt(err_temp1+err_temp2)/timeScale
714  hit_y = hit_rate
715  hit_y_err = hitRate_err
716 
717  x.append( float(lbInfo['InstLumi']) )
718  y.append( hit_y )
719  y_err.append( hit_y_err )
720  x_err = [0]*len(x)
721 
722  if x == []:
723  null_graph = ROOT.TGraph()
724  return null_graph
725 
726  return RPCRawDataMonUtils.creatGraph(x, y, x_err, y_err, g_name, g_title, g_Xtitle, g_Ytitle)
727 

◆ GetBadPanels()

def CoreClass.Draw_Base.GetBadPanels (   self)
inherited

Definition at line 620 of file CoreClass.py.

620  def GetBadPanels(self):
621  return self._hists_bad_panels
622 

◆ getContent()

def CoreClass.Draw_Occupancy.getContent (   self,
  singleObj 
)

Reimplemented from CoreClass.Draw_Base.

Definition at line 830 of file CoreClass.py.

830  def getContent(self, singleObj):
831  if self._variable == 'predRate':
832  cont = singleObj['p0']+self.__refInstLumi*singleObj['p1']
833  error = singleObj['p0_err']+self.__refInstLumi*singleObj['p1_err']
834  elif self._variable == 'meanRate':
835  cont = singleObj['mean']
836  error = singleObj['mean_err']
837  else:
838  cont = singleObj[self._variable]
839  if self._variable == 'chi2':
840  error = 0.01 # non-sense value
841  else:
842  error = singleObj[self._variable+"_err"]
843 
844  return (cont, error)
845 

◆ GetGraphs_rate_perPanel()

def CoreClass.Draw_Occupancy.GetGraphs_rate_perPanel (   self)

Definition at line 734 of file CoreClass.py.

734  def GetGraphs_rate_perPanel(self):
735  return self.list_graphs_rate_panel
736 

◆ GetHist1D_yPanels()

def CoreClass.Draw_Base.GetHist1D_yPanels (   self,
  config 
)
inherited

Definition at line 397 of file CoreClass.py.

397  def GetHist1D_yPanels(self, config):
398  self._in_hname = config[0]
399  self._variable = config[1]
400  self._out_htitle = self._var_title[self._variable]
401 
402  out_hname = self._variable
403  out_htitle = self._out_htitle
404 
405  if not self.doneParserPanel == self._in_hname:
406  self.parseHisto_allPanels()
407 
408  x_unit = self._unitsOfVariables[self._variable]
409  x_title = self._out_htitle
410  if x_unit != '':
411  x_title = self._out_htitle+'['+x_unit+']'
412 
413  nbins = self._nbins_hist[self._variable]
414  x_min = self._rangeOfVariables_perPanel[self._variable][0]
415  x_max = self._rangeOfVariables_perPanel[self._variable][1]
416 
417  h_name = out_hname+"_per_panel"
418  h_title = out_htitle+" per panel"
419 
420  h_name_all = h_name+"_etaAndPhiView"
421  h_name_eta = h_name+"_etaView"
422  h_name_phi = h_name+"_phiView"
423  h_title_all = h_title + "(#eta & #phi view)"
424  h_title_eta = h_title + "(#eta view)"
425  h_title_phi = h_title + "(#phi view)"
426 
427  hist_allPanels = ROOT.TH1F(h_name_all, h_title_all+";"+x_title+";N_{panels}", nbins, x_min, x_max)
428  hist_allPanels_eta = ROOT.TH1F(h_name_eta, h_title_eta+";"+x_title+";N_{panels}", nbins, x_min, x_max)
429  hist_allPanels_phi = ROOT.TH1F(h_name_phi, h_title_phi+";"+x_title+";N_{panels}", nbins, x_min, x_max)
430  hist_allPanels. GetXaxis().SetRange(0, nbins+1)
431  hist_allPanels_eta.GetXaxis().SetRange(0, nbins+1)
432  hist_allPanels_phi.GetXaxis().SetRange(0, nbins+1)
433 
434  for i_sector, dic_perSecLayer in self._dic_panels_detect.items():
435  for i_dbPhi_meas, dic_dbPhi_meas in dic_perSecLayer.items():
436  for i_eta_dbZ, object_perPanel in dic_dbPhi_meas.items():
437  cont_error = self.getContent(object_perPanel)
438  hist_allPanels.Fill(cont_error[0])
439  if i_dbPhi_meas[1] == 0:
440  hist_allPanels_eta.Fill(cont_error[0])
441  else:
442  hist_allPanels_phi.Fill(cont_error[0])
443 
444  return [hist_allPanels, hist_allPanels_eta, hist_allPanels_phi]
445 

◆ GetHist1D_ySectorsAndLayers()

def CoreClass.Draw_Base.GetHist1D_ySectorsAndLayers (   self,
  config 
)
inherited

Definition at line 365 of file CoreClass.py.

365  def GetHist1D_ySectorsAndLayers(self, config):
366  self._in_hname = config[0]
367  self._variable = config[1]
368  self._out_htitle = self._var_title[self._variable]
369 
370  out_hname = self._variable
371  out_htitle = self._out_htitle
372 
373  if not self.doneParserSectorAndLayer == self._in_hname:
374  self.parseHisto_allSectorAndLayers()
375 
376  x_unit = self._unitsOfVariables[self._variable]
377  x_title = out_htitle
378  if x_unit != '':
379  x_title = out_htitle+'['+x_unit+']'
380 
381  nbins = self._nbins_hist[self._variable]
382  x_min = self._rangeOfVariables_allPanels[self._variable][0]
383  x_max = self._rangeOfVariables_allPanels[self._variable][1]
384 
385  h_name = out_hname+"_per_sectors_per_layers"
386  h_title = out_htitle+" per sectors per layers"
387 
388  all_hist = ROOT.TH1F(h_name+"_etaAndPhiPanels", h_title+"(#eta & #phi view)"+";" +x_title+";N_{sectors*layers}", nbins, x_min, x_max)
389  all_hist.GetXaxis().SetRange(0, nbins+1)
390  for sec_lay, obj_perSecLay in self._dic_sectors_layers.items():
391  contentAndErr = self.getContent(obj_perSecLay)
392  all_hist.Fill(contentAndErr[0])
393 
394  return [all_hist]
395 

◆ GetHist2D_EtaPhi_allLayer()

def CoreClass.Draw_Base.GetHist2D_EtaPhi_allLayer (   self,
  config,
  doSetZRange = True 
)
inherited

Definition at line 447 of file CoreClass.py.

447  def GetHist2D_EtaPhi_allLayer(self, config, doSetZRange = True):
448  self._in_hname = config[0]
449  self._variable = config[1]
450  self._out_htitle = self._var_title[self._variable]
451 
452  out_hname = self._variable
453  out_htitle = self._out_htitle
454 
455  if not self.doneParserPanel == self._in_hname:
456  self.parseHisto_allPanels()
457 
458  self._doSetZRange = doSetZRange
459 
460  z_unit = self._unitsOfVariables[self._variable]
461  z_title = self._out_htitle
462  if z_unit != '':
463  z_title = self._out_htitle+'['+z_unit+']'
464 
465  if self._doSetZRange:
466  z_min = self._rangeOfVariables_perPanel[self._variable][0]
467  z_max = self._rangeOfVariables_perPanel[self._variable][1]
468 
469  dic_hists = {}
470  for i_layer in range(1, 9): # 1,2,...,8
471  for i_measPhi in [0, 1]:
472  h2_name = out_hname+"_layer"+str(i_layer)+"_measPhi"+str(i_measPhi)
473  h2_title = out_htitle+"("+layerNames[i_layer]+"-"+isMeasPhiNames[i_measPhi]+")"
474  h2_temp = ROOT.TH2D(h2_name, h2_title+";#eta index;#phi sector;"+z_title, 38, -19, 19, 32, 0, 32)
475  dic_hists[(i_layer, i_measPhi)] = h2_temp
476 
477  for i_sector, dic_perSecLayer in self._dic_panels_detect.items():
478  i_layer = i_sector[1]
479 
480  for i_dbPhi_meas, dic_dbPhi_meas in dic_perSecLayer.items():
481  h2_temp = dic_hists[(i_layer, i_dbPhi_meas[1])]
482  y_bin = (abs(i_sector[0])-1)*2+i_dbPhi_meas[0]
483 
484  side = 1
485  if i_sector[0] < 0:
486  side = -1
487 
488  for i_eta_dbZ, object_perPanel in dic_dbPhi_meas.items():
489  x_bin = Bin_EtaDbZ[(i_eta_dbZ[0]*side, i_eta_dbZ[1])]
490  (content, error) = self.getContent(object_perPanel)
491 
492  h2_temp.SetBinContent(x_bin, y_bin, content)
493 
494  list_hists = []
495  for i_layer in range(1, 9): # 1,2,...,8
496  for i_measPhi in [0, 1]:
497  h2 = dic_hists[(i_layer, i_measPhi)]
498 
499  if self._doSetZRange:
500  h2.SetMinimum(z_min)
501  h2.SetMaximum(z_max)
502  h2.GetZaxis().SetRangeUser(z_min, z_max)
503 
504  # decorate histgram
505  HistDecorate.setTitleOffset(h2, "TH2")
509 
510  HistDecorate.set_blankBox(h2, i_layer)
511 
512  list_hists.append(h2)
513 
514  return list_hists
515 

◆ getHist_1Panel()

def CoreClass.Draw_Occupancy.getHist_1Panel (   self,
  config 
)

Reimplemented from CoreClass.Draw_Base.

Definition at line 812 of file CoreClass.py.

812  def getHist_1Panel(self, config):
813  panelInd = config[0]
814 
815  h_temp = ROOT.TH1F("h_temp"+str(panelInd), "h_temp"+str(panelInd), self._nbins, self._low, self._up)
816  for i_bin in range(1, self._nbins+1):
817  hit_content = self._in_histo.GetBinContent(i_bin, panelInd+1)
818  hit_err = self._in_histo.GetBinError(i_bin, panelInd+1)
819 
820  h_temp.SetBinContent(i_bin, hit_content)
821  h_temp.SetBinError(i_bin, hit_err)
822  return h_temp
823 

◆ getHist_1SectorLayer()

def CoreClass.Draw_Base.getHist_1SectorLayer (   self,
  config,
  sec_layer,
  temp_dic,
  titles 
)
inherited

Definition at line 637 of file CoreClass.py.

637  def getHist_1SectorLayer(self, config, sec_layer, temp_dic, titles):
638  h_temp = self.getHist_1Panel(config)
639 
640  if sec_layer in temp_dic:
641  temp_dic[sec_layer].Add(h_temp)
642  else:
643  all_name_suffix = ("_Sector%d_Layer%d" %(sec_layer[0], sec_layer[1]))
644  all_title_suffix = "(Sector"+str(sec_layer[0])+'-'+layerNames[sec_layer[1]]+")"
645  all_hist = self.initialHist_1Panel(all_name_suffix, all_title_suffix, titles)
646 
647  temp_dic[sec_layer] = all_hist
648  temp_dic[sec_layer].Add(h_temp)
649 
650  del h_temp
651 

◆ getObject_1panel()

def CoreClass.Draw_Occupancy.getObject_1panel (   self,
  config 
)

Reimplemented from CoreClass.Draw_Base.

Definition at line 738 of file CoreClass.py.

738  def getObject_1panel(self, config):
739  panelInd = config[0]
740  panelName= config[1]
741 
742  g_name = self._in_hname.split('Panels')[0]+panelName
743  g_title = g_name
744  g_Xtitle = 'Inst luminosity [10^{34} cm^{-2}s^{-1}]'
745  g_Ytitle = 'RPC hit rate[Hz]'
746 
747  if self._NEvtScale:
748  timeScale = self.__getTimeScale()
749 
750  x = []
751  y = []
752  y_err = []
753  for LB, lbInfo in self._Dic_LumiInfo.items():
754  if lbInfo['AtlasPhysics'] == 'false' or float(lbInfo['Duration'])<50. :
755  continue
756 
757  hit_content = self._in_histo.GetBinContent(LB, panelInd+1)
758  hit_err = self._in_histo.GetBinError(LB, panelInd+1)
759  hit_y = hit_content
760  hit_y_err = hit_err
761  if hit_content < 1 :
762  continue
763 
764  if self._NEvtScale:
765  evt_content = self.__h_NEvt_LB.GetBinContent(LB)
766  evt_error = self.__h_NEvt_LB.GetBinError(LB)
767  if evt_content < 1 :
768  continue
769  hit_rate = hit_content/(evt_content*timeScale)
770 
771  err_temp1 = pow(hit_err/evt_content,2)
772  err_temp2 = pow(evt_error*hit_content/pow(evt_content,2), 2)
773  hitRate_err = math.sqrt(err_temp1+err_temp2)/timeScale
774  hit_y = hit_rate
775  hit_y_err = hitRate_err
776 
777  x.append( float(lbInfo['InstLumi']) )
778  y.append( hit_y )
779  y_err.append( hit_y_err )
780  x_err = [0]*len(x)
781 
782  len_LB = len(y)
783  fit_able = 0
784  is_good = True
785 
786  if len_LB == 0 :
787  fit_able = 3
788  is_good = False
789  fitRe_g1 = {"p0": 0, "p0_err":0, "p1": -1, "p1_err":-1, "chi2":-1, "mean":0, "mean_err":0}
790  out_dic = {'fit_able':fit_able, 'is_good':is_good, 'hit_rate':0}
791  else:
792  gr = RPCRawDataMonUtils.creatGraph(x, y, x_err, y_err, g_name, g_title, g_Xtitle, g_Ytitle)
793  (fit_able, fitRe_g1) = RPCRawDataMonUtils.linearFit(gr)
794  out_dic = {'fit_able':fit_able, 'is_good':is_good, 'hit_rate':gr}
795  self.list_graphs_rate_panel.append(gr)
796 
797  out_dic['N_selLBs'] = len_LB
798 
799  if (not out_dic['is_good']) or (fitRe_g1["p1"] < self.Tlow_p1_panel) or (fitRe_g1["chi2"] > self.T_chi2_panel):
800  out_dic['is_good'] = False
801  self._hists_bad_panels.append(out_dic)
802 
803  return fitRe_g1
804 

◆ getObject_1SectorLayer()

def CoreClass.Draw_Occupancy.getObject_1SectorLayer (   self,
  config,
  sec_layer,
  temp_dic 
)

Reimplemented from CoreClass.Draw_Base.

Definition at line 806 of file CoreClass.py.

806  def getObject_1SectorLayer(self, config, sec_layer, temp_dic):
807  name_pre = self._in_hname.split("_")[0]
808  titles = [name_pre+"_LB", name_pre+" vs LB", "LB", "N_{hits}"]
809  self.getHist_1SectorLayer(config, sec_layer, temp_dic, titles)
810 

◆ GetSummary_allSectorsAndLayers()

def CoreClass.Draw_Base.GetSummary_allSectorsAndLayers (   self,
  config 
)
inherited

Definition at line 269 of file CoreClass.py.

269  def GetSummary_allSectorsAndLayers(self, config):
270  self._in_hname = config[0]
271  self._variable = config[1]
272  self._out_htitle = self._var_title[self._variable]
273 
274  out_hname = self._variable
275  out_htitle = self._out_htitle
276 
277  if not self.doneParserSectorAndLayer == self._in_hname:
278  self.parseHisto_allSectorAndLayers()
279 
280  y_unit = self._unitsOfVariables[self._variable]
281  y_title = out_htitle
282  if y_unit != '':
283  y_title = out_htitle+'['+y_unit+']'
284 
285  dic_hist = {}
286  for i_layer in range(1, 9): # 1, 2, ..., 8
287  h_name = "Summary_layer"+str(i_layer)+"_"+out_hname
288  h_title = "Summary of "+out_htitle.lower()+'('+layerNames[i_layer]+')'
289 
290  h1_all = ROOT.TH1F(h_name, h_title+";Sector;"+y_title, 33, -16.5, 16.5)
291  dic_hist[i_layer] = h1_all
292 
293  for sec_lay, obj_perSecLay in self._dic_sectors_layers.items():
294  contentAndErr = self.getContent(obj_perSecLay)
295  i_bin = sec_lay[0] + 17
296 
297  dic_hist[sec_lay[1]].SetBinContent(i_bin, contentAndErr[0])
298  dic_hist[sec_lay[1]].SetBinError(i_bin, contentAndErr[1])
299 
300  return self.decorateAllSectorSummary(dic_hist)
301 

◆ GetSummary_eachSectorsAndLayers()

def CoreClass.Draw_Base.GetSummary_eachSectorsAndLayers (   self,
  config 
)
inherited

Definition at line 303 of file CoreClass.py.

303  def GetSummary_eachSectorsAndLayers(self, config):
304  self._in_hname = config[0]
305  self._variable = config[1]
306  self._out_htitle = self._var_title[self._variable]
307 
308  out_hname = self._variable
309  out_htitle = self._out_htitle
310 
311  if not self.doneParserPanel == self._in_hname:
312  self.parseHisto_allPanels()
313 
314  y_unit = self._unitsOfVariables[self._variable]
315  y_title = self._out_htitle
316  if y_unit != '':
317  y_title = self._out_htitle+'['+y_unit+']'
318 
319  list_hists = []
320  sectors = list(range(-16, 0)) + list(range(1, 17)) # -16, -15, ..., 2, 1, 1, 2, ..., 15, 16
321  for i_sector in sectors:
322  for i_layer in range(1, 9): # 1, 2, ..., 8
323  if not (i_sector, i_layer) in self._dic_panels_detect:
324  continue
325 
326  dic_perSecLayer = self._dic_panels_detect[(i_sector, i_layer)]
327 
328  dic_hist = {}
329  sector_layer_name = ("Summary_Sector%d_Layer%d" %(i_sector, i_layer))
330  sector_layer_title = "Summary of "+out_htitle.lower()+" of panels in sector"+str(i_sector)+'-'+layerNames[i_layer]
331 
332  for i_dbPhi in [1,2]:
333  for i_measPhi in [0,1]:
334 
335  if not (i_dbPhi, i_measPhi) in dic_perSecLayer:
336  continue
337 
338  dic_dbPhi_meas = dic_perSecLayer[(i_dbPhi, i_measPhi)]
339 
340  h_name = sector_layer_name+("_dbPhi%d_measPhi%d" %(i_dbPhi, i_measPhi))+"_"+out_hname
341  h_title = sector_layer_title+"-dbPhi"+str(i_dbPhi)+'-'+isMeasPhiNames[i_measPhi]
342  hist = ROOT.TH1F(h_name, h_title+";(#eta station, dbZ);"+y_title, 19, 0, 19)
343 
344  for i_eta_dbZ, object_perPanel in dic_dbPhi_meas.items():
345  if i_eta_dbZ[0] > 4:
346  x_bin = (i_eta_dbZ[0]-1)*2+i_eta_dbZ[1]+3
347  elif i_eta_dbZ[0] > 2:
348  x_bin = (i_eta_dbZ[0]-1)*2+i_eta_dbZ[1]+2
349  else:
350  x_bin = (i_eta_dbZ[0]-1)*2+i_eta_dbZ[1]+1
351 
352  cont_error = self.getContent(object_perPanel)
353 
354  hist.SetBinContent(x_bin, cont_error[0])
355  hist.SetBinError(x_bin, cont_error[1])
356 
357  self.modifyXlabel(hist)
358  dic_hist[(i_dbPhi, i_measPhi)] = hist
359 
360  list_hists += self.decorateSummary_perSector(dic_hist)
361 
362  return list_hists
363 

◆ initialHist_1Panel()

def CoreClass.Draw_Occupancy.initialHist_1Panel (   self,
  name_suffix,
  title_suffix,
  titles 
)

Definition at line 825 of file CoreClass.py.

825  def initialHist_1Panel(self, name_suffix, title_suffix, titles):
826  hist = ROOT.TH1F(titles[0]+name_suffix, titles[1]+title_suffix+";"+titles[2]+";"+titles[3], self._nbins, self._low, self._up)
827  return hist
828 

◆ modifyXlabel()

def CoreClass.Draw_Base.modifyXlabel (   self,
  hist 
)
inherited

Definition at line 586 of file CoreClass.py.

586  def modifyXlabel(self, hist):
587  etaStation_dbZ = [
588  '(0,1)',
589  '(1,1)', '(1,2)',
590  '(2,1)', '(2,2)', '(2,3)',
591  '(3,1)', '(3,2)',
592  '(4,1)', '(4,2)', '(4,3)',
593  '(5,1)', '(5,2)',
594  '(6,1)', '(6,2)',
595  '(7,1)', '(7,2)',
596  '(8,1)', '(8,2)']
597 
598  for i_bin in range(1, 20): # 1, 2, ..., 18, 19
599  hist.GetXaxis().SetBinLabel(i_bin, etaStation_dbZ[i_bin-1])
600 

◆ parseHisto_allPanels()

def CoreClass.Draw_Base.parseHisto_allPanels (   self)
inherited

First level: sector - layer(dbR+gasGap)

Second level: dbPhi - meanPhi Third level: etaStation - dbZ

Definition at line 211 of file CoreClass.py.

211  def parseHisto_allPanels(self):
212  self.doneParserPanel = self._in_hname
213  self._prepareHisto()
214 
215  for p_ind, i_panel in self._PanelsProperties.items():
216  panel_name = i_panel.getPanelName()
217  panelLocalPar = i_panel.getLocalPos()
218  sec_layer = i_panel.getSector()
219  i_etaSta = panelLocalPar[0]
220  i_dbZ = panelLocalPar[1]
221  i_dbPhi = panelLocalPar[2]
222  i_measPhi = panelLocalPar[3]
223 
224 
227  try:
228  sec_layer_detect = self._dic_panels_detect[sec_layer]
229  except KeyError:
230  self._dic_panels_detect[sec_layer] = {}
231  sec_layer_detect = self._dic_panels_detect[sec_layer]
232 
233 
236  try:
237  dbPhi_meas_detect = sec_layer_detect[(i_dbPhi, i_measPhi)]
238  except KeyError:
239  sec_layer_detect[(i_dbPhi, i_measPhi)] = {}
240  dbPhi_meas_detect = sec_layer_detect[(i_dbPhi, i_measPhi)]
241 
242 
245  config = [p_ind, panel_name, sec_layer, (i_dbPhi, i_measPhi), (i_etaSta, i_dbZ)]
246  dbPhi_meas_detect[(i_etaSta, i_dbZ)] = self.getObject_1panel(config)
247 
248  del i_panel
249 

◆ parseHisto_allSectorAndLayers()

def CoreClass.Draw_Base.parseHisto_allSectorAndLayers (   self)
inherited

Definition at line 251 of file CoreClass.py.

251  def parseHisto_allSectorAndLayers(self):
252  self.doneParserSectorAndLayer = self._in_hname
253  self._prepareHisto()
254 
255  temp_dic_sectors_layers = {}
256  for p_ind, i_panel in self._PanelsProperties.items():
257  panel_name = i_panel.getPanelName()
258  sec_layer = i_panel.getSector()
259  i_measPhi = i_panel.measPhi
260 
261  self.getObject_1SectorLayer([p_ind, panel_name, i_measPhi], sec_layer, temp_dic_sectors_layers)
262  self._post_allSectorAndLayers(temp_dic_sectors_layers)
263 

◆ setCutLine()

def CoreClass.Draw_Occupancy.setCutLine (   self,
  i_histo,
  index = 0 
)

Definition at line 857 of file CoreClass.py.

857  def setCutLine(self, i_histo, index = 0):
858  if index == 0:
859  y = self._cuts_summaryHist_allSectorLayer[self._variable]
860  minX = -16.5
861  maxX = 16.5
862  else:
863  y = self._cuts_summaryHist_perSectorLayer[self._variable]
864  minX = 0.
865  maxX = 19.
866 
867  line = ROOT.TLine(minX, y, maxX, y)
868  line.SetLineStyle(2)
869  line.SetLineWidth(1)
870  line.SetLineColor(ROOT.kBlue)
871 
872  i_histo.GetListOfFunctions().Add(line)
873 

◆ setHistnameVariable()

def CoreClass.Draw_Base.setHistnameVariable (   self,
  config 
)
inherited

Definition at line 624 of file CoreClass.py.

624  def setHistnameVariable(self, config):
625  self._in_hname = config[0]
626  self._variable = config[1]
627 

◆ SetLumiInfoDic()

def CoreClass.Draw_Base.SetLumiInfoDic (   self,
  dic_lumiInfo 
)
inherited

Definition at line 606 of file CoreClass.py.

606  def SetLumiInfoDic(self, dic_lumiInfo):
607  self._Dic_LumiInfo = dic_lumiInfo
608 

◆ setOut_Panels()

def CoreClass.Draw_Base.setOut_Panels (   self,
  list_panelInds = [],
  list_panelNames = [] 
)
inherited

Definition at line 610 of file CoreClass.py.

610  def setOut_Panels(self, list_panelInds = [], list_panelNames = []):
611  self._list_outPanelInds = list_panelInds
612  self._list_outPanelNames = list_panelNames
613 
614  if len(list_panelInds) > 8000 or len(list_panelNames) > 8000 :
615  self._full_panel = True
616  else:
617  self._full_panel = False
618 

◆ SetPanelDic()

def CoreClass.Draw_Base.SetPanelDic (   self,
  dic_panels 
)
inherited

Definition at line 602 of file CoreClass.py.

602  def SetPanelDic(self, dic_panels):
603  self._PanelsProperties = dic_panels
604 

Member Data Documentation

◆ __h_NEvt_LB

CoreClass.Draw_Occupancy.__h_NEvt_LB
private

Definition at line 731 of file CoreClass.py.

◆ __refInstLumi

CoreClass.Draw_Occupancy.__refInstLumi
private

Definition at line 666 of file CoreClass.py.

◆ _cut_variables

list CoreClass.Draw_Base._cut_variables = ["p0", "p1", "chi2", "predRate", "meanRate"]
staticprivateinherited

Definition at line 155 of file CoreClass.py.

◆ _cuts_summaryHist_allSectorLayer

dictionary CoreClass.Draw_Base._cuts_summaryHist_allSectorLayer
staticprivateinherited
Initial value:
= {
"p0" : 2.e7,
"p1" : 0.,
"chi2" : 30. ,
"predRate" : 3.e7,
"meanRate" : 3.e7
}

Definition at line 157 of file CoreClass.py.

◆ _cuts_summaryHist_perSectorLayer

dictionary CoreClass.Draw_Base._cuts_summaryHist_perSectorLayer
staticprivateinherited
Initial value:
= {
"p0" : 5.e4,
"p1" : 0.,
"chi2" : 25. ,
"predRate" : 1.e6,
"meanRate" : 8.e5
}

Definition at line 165 of file CoreClass.py.

◆ _Dic_LumiInfo

CoreClass.Draw_Base._Dic_LumiInfo
privateinherited

Definition at line 607 of file CoreClass.py.

◆ _dic_panels_detect

CoreClass.Draw_Base._dic_panels_detect
privateinherited

Definition at line 197 of file CoreClass.py.

◆ _dic_sectors_layers

CoreClass.Draw_Occupancy._dic_sectors_layers
private

Definition at line 848 of file CoreClass.py.

◆ _doSetZRange

CoreClass.Draw_Base._doSetZRange
privateinherited

Definition at line 458 of file CoreClass.py.

◆ _full_panel [1/2]

bool CoreClass.Draw_Base._full_panel = True
staticprivateinherited

Definition at line 175 of file CoreClass.py.

◆ _full_panel [2/2]

CoreClass.Draw_Base._full_panel
privateinherited

Definition at line 615 of file CoreClass.py.

◆ _hists_bad_panels

list CoreClass.Draw_Base._hists_bad_panels = []
staticprivateinherited

Definition at line 178 of file CoreClass.py.

◆ _in_histo

CoreClass.Draw_Base._in_histo
privateinherited

Definition at line 196 of file CoreClass.py.

◆ _in_hname [1/2]

string CoreClass.Draw_Base._in_hname = ''
staticprivateinherited

Definition at line 173 of file CoreClass.py.

◆ _in_hname [2/2]

CoreClass.Draw_Base._in_hname
privateinherited

Definition at line 270 of file CoreClass.py.

◆ _list_outPanelInds [1/2]

list CoreClass.Draw_Base._list_outPanelInds = []
staticprivateinherited

Definition at line 176 of file CoreClass.py.

◆ _list_outPanelInds [2/2]

CoreClass.Draw_Base._list_outPanelInds
privateinherited

Definition at line 611 of file CoreClass.py.

◆ _list_outPanelNames [1/2]

list CoreClass.Draw_Base._list_outPanelNames = []
staticprivateinherited

Definition at line 177 of file CoreClass.py.

◆ _list_outPanelNames [2/2]

CoreClass.Draw_Base._list_outPanelNames
privateinherited

Definition at line 612 of file CoreClass.py.

◆ _low

CoreClass.Draw_Base._low
privateinherited

Definition at line 207 of file CoreClass.py.

◆ _nbins

CoreClass.Draw_Base._nbins
privateinherited

Definition at line 206 of file CoreClass.py.

◆ _nbins_hist

dictionary CoreClass.Draw_Base._nbins_hist
staticprivateinherited
Initial value:
= {
"p0" : 20,
"p1" : 20,
"chi2" : 20,
"predRate" : 20,
"meanRate" : 20,
"extrapMuons" : 20,
"detEff" : 20,
"detEffError" : 20,
"hitMultiplicity" : 10,
"averageClusterSize" : 30,
"outTimeHitFrac" : 20,
"outTimeHitFrac_onTrack" : 20,
"outTimeHitFracError" : 20
}

Definition at line 81 of file CoreClass.py.

◆ _NEvtScale

CoreClass.Draw_Occupancy._NEvtScale
private

Definition at line 669 of file CoreClass.py.

◆ _out_htitle

CoreClass.Draw_Base._out_htitle
privateinherited

Definition at line 203 of file CoreClass.py.

◆ _PanelsProperties

CoreClass.Draw_Base._PanelsProperties
privateinherited

Definition at line 603 of file CoreClass.py.

◆ _precision

dictionary CoreClass.Draw_Base._precision
staticprivateinherited
Initial value:
= {
"p0" : -3,
"p1" : -3,
"chi2" : 2,
"predRate" : -3,
"meanRate" : -3,
"extrapMuons" : 0,
"detEff" : 4,
"detEffError" : 4,
"hitMultiplicity" : 2,
"averageClusterSize" : 3,
"outTimeHitFrac" : 4,
"outTimeHitFrac_onTrack" : 4,
"outTimeHitFracError" : 4
}

Definition at line 118 of file CoreClass.py.

◆ _rangeOfVariables_allPanels

dictionary CoreClass.Draw_Base._rangeOfVariables_allPanels
staticprivateinherited
Initial value:
= {
"p0" : (0., 20e6),
"p1" : (0., 20e6),
"chi2" : (0., 100.),
"predRate" : (0., 30e6),
"meanRate" : (0., 30e6),
"extrapMuons" : (0., 2000),
"detEff" : (0., 1.),
"detEffError" : (0., 0.1),
"hitMultiplicity" : (-0.5, 10.5),
"averageClusterSize" : (1, 4),
"outTimeHitFrac" : (0., 1.),
"outTimeHitFrac_onTrack" : (0., 1.),
"outTimeHitFracError" : (0., 0.1)
}

Definition at line 65 of file CoreClass.py.

◆ _rangeOfVariables_perPanel

dictionary CoreClass.Draw_Base._rangeOfVariables_perPanel
staticprivateinherited
Initial value:
= {
"p0" : (0., 1e5),
"p1" : (0., 5e5),
"chi2" : (0., 100.),
"predRate" : (0., 1e6),
"meanRate" : (0., 1e6),
"extrapMuons" : (0., 2000),
"detEff" : (0., 1.),
"detEffError" : (0., 0.1),
"hitMultiplicity" : (-0.5, 10.5),
"averageClusterSize" : (1, 4),
"outTimeHitFrac" : (0., 1.),
"outTimeHitFrac_onTrack" : (0., 1.),
"outTimeHitFracError" : (0., 0.1)
}

Definition at line 49 of file CoreClass.py.

◆ _unitsOfVariables

dictionary CoreClass.Draw_Base._unitsOfVariables
staticprivateinherited
Initial value:
= {
"p0" : 'Hz',
"p1" : 'Hz/(10^{34} cm^{-2}s^{-1})',
"chi2" : '',
"prdhits" : '',
"muon_Z_num" : '',
"muon_Z_den" : '',
"muon_all_num" : '',
"muon_all_den" : '',
"predRate" : 'Hz',
"meanRate" : 'Hz',
"extrapMuons" : '',
"detEff" : '',
"detEffError" : '',
"hitMultiplicity" : '',
"averageClusterSize" : '',
"outTimeHitFrac" : '',
"outTimeHitFrac_onTrack" : '',
"outTimeHitFracError" : ''
}

Definition at line 97 of file CoreClass.py.

◆ _up

CoreClass.Draw_Base._up
privateinherited

Definition at line 208 of file CoreClass.py.

◆ _var_title

dictionary CoreClass.Draw_Base._var_title
staticprivateinherited
Initial value:
= {
"p0" : "p0" ,
"p1" : "p1" ,
"chi2" : "Chi2/ndf" ,
"prdhits" : "Hits" ,
"muon_Z_num" : "Muons(Z) extrapolated to individual RPC panels with hits",
"muon_Z_den" : "Muons(Z) extrapolated to individual RPC panels",
"muon_all_num" : "Muons(All) extrapolated to individual RPC panels with hits",
"muon_all_den" : "Muons(All) extrapolated to individual RPC panels",
"predRate" : "Predicted hit rate" ,
"meanRate" : "Mean actual hit rate" ,
"extrapMuons" : "Extrapolated muons",
"detEff" : "Muon detection efficiency",
"detEffError" : "Muon detection efficiency error",
"hitMultiplicity" : "RPC hit multiplicity",
"averageClusterSize" : "Average cluster size",
"outTimeHitFrac" : "Fraction of RPC hits with |t|>12.5 ns",
"outTimeHitFrac_onTrack" : "Fraction of RPC on-track hits with |t|>12.5 ns",
"outTimeHitFracError" : "Error of fraction of RPC hits with |t|>12.5 ns"
}

Definition at line 134 of file CoreClass.py.

◆ _variable

CoreClass.Draw_Occupancy._variable
private

Definition at line 831 of file CoreClass.py.

◆ doneParserPanel

CoreClass.Draw_Base.doneParserPanel
inherited

Definition at line 198 of file CoreClass.py.

◆ doneParserSectorAndLayer

CoreClass.Draw_Base.doneParserSectorAndLayer
inherited

Definition at line 199 of file CoreClass.py.

◆ list_graphs_rate_panel

CoreClass.Draw_Occupancy.list_graphs_rate_panel

Definition at line 667 of file CoreClass.py.

◆ T_chi2_panel

int CoreClass.Draw_Base.T_chi2_panel = 15.
staticinherited

Definition at line 188 of file CoreClass.py.

◆ T_chi2_sl

int CoreClass.Draw_Base.T_chi2_sl = 15.
staticinherited

Definition at line 181 of file CoreClass.py.

◆ T_p0_panel

int CoreClass.Draw_Base.T_p0_panel = 2e5
staticinherited

Definition at line 189 of file CoreClass.py.

◆ T_p0_sl

int CoreClass.Draw_Base.T_p0_sl = 2e6
staticinherited

Definition at line 182 of file CoreClass.py.

◆ T_predRate

int CoreClass.Draw_Base.T_predRate = 30e6
staticinherited

Definition at line 185 of file CoreClass.py.

◆ T_predRate_panel

int CoreClass.Draw_Base.T_predRate_panel = 30e6
staticinherited

Definition at line 192 of file CoreClass.py.

◆ Tlow_p1_panel

int CoreClass.Draw_Base.Tlow_p1_panel = 5e3
staticinherited

Definition at line 190 of file CoreClass.py.

◆ Tlow_p1_sl

int CoreClass.Draw_Base.Tlow_p1_sl = 5e3
staticinherited

Definition at line 183 of file CoreClass.py.

◆ Tup_p1_panel

int CoreClass.Draw_Base.Tup_p1_panel = 3e5
staticinherited

Definition at line 191 of file CoreClass.py.

◆ Tup_p1_sl

int CoreClass.Draw_Base.Tup_p1_sl = 15e6
staticinherited

Definition at line 184 of file CoreClass.py.


The documentation for this class was generated from the following file:
HistDecorate.set_verticalGrid
def set_verticalGrid(hist2d)
Definition: HistDecorate.py:188
max
#define max(a, b)
Definition: cfImp.cxx:41
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
RPCRawDataMonUtils.creatGraph
def creatGraph(xs, ys, x_errs, y_errs, g_name, g_title, g_Xtitle, g_Ytitle)
Definition: RPCRawDataMonUtils.py:8
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
HistDecorate.set_horizonGrid
def set_horizonGrid(hist2d)
Definition: HistDecorate.py:211
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
min
#define min(a, b)
Definition: cfImp.cxx:40
HistDecorate.set_blankBox
def set_blankBox(hist_2d, layer)
Definition: HistDecorate.py:228
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
RPCRawDataMonUtils.linearFit
def linearFit(h_temp, opt="QNS+")
return type values: 1 : normal 0 : fit fail or (Not exist this quantity of certain panel) -1 : number...
Definition: RPCRawDataMonUtils.py:35
HistDecorate.setTitleOffset
def setTitleOffset(hist, instance="")
Definition: HistDecorate.py:173
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
HistDecorate.setAxisLabel_EtaPhi
def setAxisLabel_EtaPhi(hist2d)
Definition: HistDecorate.py:275