Belle II Software development
PXDDeadPixelsChecker Class Reference
Inheritance diagram for PXDDeadPixelsChecker:
ConditionCheckerBase

Public Member Functions

def __init__ (self, name, tfile, rundir="maps", use_hist=True)
 
def define_graphs (self)
 
def define_hists (self)
 
def get_db_content (self)
 
def get_graph_value (self, sensor_db_content)
 
def get_graph_value_from_hist (self, h2)
 
def set_hist_content (self, h2, sensor_db_content)
 
def draw_plots (self, canvas=None, cname="PXDDeadPixel", ymin=0., ymax=plot_type_dict["dead"]["max"], **kwargs)
 

Public Attributes

 hist_title_suffix
 Hist title suffix.
 

Detailed Description

Checker for PXDDeadPixelPar

Definition at line 356 of file condition_checker.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  tfile,
  rundir = "maps",
  use_hist = True 
)
 

Reimplemented from ConditionCheckerBase.

Definition at line 361 of file condition_checker.py.

361 def __init__(self, name, tfile, rundir="maps", use_hist=True):
362 """
363 """
364 super().__init__(name, Belle2.PXDDeadPixelPar, tfile, rundir)
365
The payload telling which PXD pixel is dead (=Readout system does not receive signals)

Member Function Documentation

◆ define_graphs()

def define_graphs (   self)
Method to define TGraph

Reimplemented from ConditionCheckerBase.

Definition at line 366 of file condition_checker.py.

366 def define_graphs(self):
367 """
368 Method to define TGraph
369 """
370 super().define_graphs(ytitle="Dead pixels [%]")
371

◆ define_hists()

def define_hists (   self)
Method to define TH2

Reimplemented from ConditionCheckerBase.

Definition at line 372 of file condition_checker.py.

372 def define_hists(self):
373 """
374 Method to define TH2
375 """
376 super().define_hists(name="DeadPixels", title="Dead Pixels", ztitle="isDead")
377

◆ draw_plots()

def draw_plots (   self,
  canvas = None,
  cname = "PXDDeadPixel",
  ymin = 0.,
  ymax = plot_type_dict["dead"]["max"],
**  kwargs 
)
Method to draw plots on a TCanvas

Reimplemented from ConditionCheckerBase.

Definition at line 446 of file condition_checker.py.

446 def draw_plots(self, canvas=None, cname="PXDDeadPixel", ymin=0., ymax=plot_type_dict["dead"]["max"], **kwargs):
447 """
448 Method to draw plots on a TCanvas
449 """
450 super().draw_plots(canvas=canvas, cname=cname, ymin=ymin, ymax=ymax, **kwargs)
451
452

◆ get_db_content()

def get_db_content (   self)
Abstract method to get content of a payload
Should return a Dictionary with sensorID.getID() as key and relaated calibration results as value

Reimplemented from ConditionCheckerBase.

Definition at line 378 of file condition_checker.py.

378 def get_db_content(self):
379 deadsensormap = self.dbObj.getDeadSensorMap()
380 deaddrainmap = self.dbObj.getDeadDrainMap()
381 deadrowmap = self.dbObj.getDeadRowMap()
382 deadsinglesmap = self.dbObj.getDeadSinglePixelMap()
383
384 content_dic = {}
385 for sensorID in sensorID_list:
386 numID = sensorID.getID()
387 content_dic[numID] = {}
388 if numID in deadsensormap:
389 content_dic[numID]["deadsensor"] = True
390 else:
391 content_dic[numID]["deadsensor"] = False
392 content_dic[numID]["deaddrains"] = deaddrainmap[numID]
393 content_dic[numID]["deadrows"] = deadrowmap[numID]
394 content_dic[numID]["deadsingles"] = deadsinglesmap[numID]
395 return content_dic
396

◆ get_graph_value()

def get_graph_value (   self,
  sensor_db_content 
)
Abstract method to get a value for each TGraph
Parameters:
  sensor_db_content (Any): Calibration results of a module

Reimplemented from ConditionCheckerBase.

Definition at line 397 of file condition_checker.py.

397 def get_graph_value(self, sensor_db_content):
398 deadcount = 0
399 if sensor_db_content["deadsensor"]:
400 deadcount = nPixels
401 else:
402 n_deaddrains = len(sensor_db_content["deaddrains"])
403 n_deadrows = len(sensor_db_content["deadrows"])
404 if n_deaddrains == 0 or n_deadrows == 0:
405 # Every dead drain counts for 192 dead pixels
406 deadcount = n_deaddrains * 192
407 # Every dead row counts for 250 dead pixels
408 # This can lead to double counting of dead pixel from dead drains
409 # The double counting can be avoided by using TH2.Integral().
410 deadcount += n_deadrows * 250
411 # Every dead single pixels
412 deadcount += len(sensor_db_content["deadsingles"])
413 else: # Using a histogram to avoid double counting
414 # Just create a temporary TH2
415 h2 = list(get_sensor_maps(sensorID_list=sensorID_list[0:1]).values())[0]
416 self.set_hist_content(h2, sensor_db_content)
417 deadcount = h2.Integral()
418
419 self.hist_title_suffix = f" ({deadcount} pixels)"
420 return min(deadcount, nPixels) * 100. / nPixels
421

◆ get_graph_value_from_hist()

def get_graph_value_from_hist (   self,
  h2 
)
Method to get a value for each TGraph
Parameters:
  h2 (TH2): If not none, get value from h2

Reimplemented from ConditionCheckerBase.

Definition at line 422 of file condition_checker.py.

422 def get_graph_value_from_hist(self, h2):
423 return h2.Integral() * 100. / nPixels
424

◆ set_hist_content()

def set_hist_content (   self,
  h2,
  sensor_db_content 
)
Method to set TH2 bins
Parameters:
  h2 (TH2): TH2F object for handling values of a pixel matrix
  sensor_db_content (Any): Calibration results of a module

Reimplemented from ConditionCheckerBase.

Definition at line 425 of file condition_checker.py.

425 def set_hist_content(self, h2, sensor_db_content):
426 # loop over all dead pixels
427 if sensor_db_content["deadsensor"]:
428 ones = np.ones(nPixels)
429 h2.SetContent(ones)
430 else:
431 for drainID in sensor_db_content["deaddrains"]:
432 for iGate in range(192):
433 uCell = drainID / 4
434 vCell = drainID % 4 + iGate * 4
435 h2.SetBinContent(int(uCell + 1), int(vCell + 1), 1)
436
437 for vCell in sensor_db_content["deadrows"]:
438 for uCell in range(nUCells):
439 h2.SetBinContent(int(uCell + 1), int(vCell + 1), 1)
440
441 for pixelID in sensor_db_content["deadsingles"]:
442 uCell = int(pixelID / nVCells)
443 vCell = pixelID % nVCells
444 h2.SetBinContent(int(uCell + 1), int(vCell + 1), 1)
445

Member Data Documentation

◆ hist_title_suffix

hist_title_suffix

Hist title suffix.

Definition at line 419 of file condition_checker.py.


The documentation for this class was generated from the following file: