Belle II Software development
SetVXDSensitiveThreshold Class Reference
Inheritance diagram for SetVXDSensitiveThreshold:

Public Member Functions

def __init__ (self, threshold)
 
def set_threshold (self, component, value)
 
def initialize (self)
 
def beginRun (self)
 
def event (self)
 
def terminate (self)
 

Public Attributes

 threshold
 The threshold value to be set.
 
 old_pxd_threshold
 The current pxd threshold value.
 
 old_svd_threshold
 The current svd threshold value.
 
 path
 Filesystem path to the .xml file.
 
 xmlpath
 XML path to the threshold setting.
 

Detailed Description

A utility module to manipulate the threshold on deposited energy
 in PXD and SVD SensitiveDetector.

Definition at line 21 of file SetSensitiveThreshold.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  threshold 
)
Initialize the module

Definition at line 27 of file SetSensitiveThreshold.py.

27 def __init__(self, threshold):
28 """Initialize the module"""
29
30 super().__init__()
31
32 self.threshold = threshold
33
34 self.old_pxd_threshold = 0.0
35
36 self.old_svd_threshold = 0.0
37
38 self.path = 'data/{comp}/{COMP}.xml'
39
40 self.xmlpath = 'Content/SensitiveThreshold'
41

Member Function Documentation

◆ beginRun()

def beginRun (   self)
 Do nothing. 

Definition at line 65 of file SetSensitiveThreshold.py.

65 def beginRun(self):
66 """ Do nothing. """
67

◆ event()

def event (   self)
Do nothing.

Definition at line 68 of file SetSensitiveThreshold.py.

68 def event(self):
69 """Do nothing."""
70

◆ initialize()

def initialize (   self)
 Set the required threshold value 

Definition at line 59 of file SetSensitiveThreshold.py.

59 def initialize(self):
60 """ Set the required threshold value """
61
62 self.set_threshold('PXD', self.threshold)
63 self.set_threshold('SVD', self.threshold)
64

◆ set_threshold()

def set_threshold (   self,
  component,
  value 
)
 Set the threshold value in PXD or SVD file.

Definition at line 42 of file SetSensitiveThreshold.py.

42 def set_threshold(self, component, value):
43 """ Set the threshold value in PXD or SVD file."""
44
45 filename = self.path.format(comp=component.lower(),
46 COMP=component.upper())
47 tree = xml.parse(filename)
48 for node in tree.getroot().findall(self.xmlpath):
49 if component.lower() == 'pxd':
50 self.old_pxd_threshold = float(node.text)
51 else:
52 self.old_svd_threshold = float(node.text)
53 node.text = f'{value}'
54
55 file = open(filename, 'w')
56 tree.write(file, encoding='UTF-8', xml_declaration=True)
57 file.close()
58

◆ terminate()

def terminate (   self)
 Set the previuos threshold value 

Definition at line 71 of file SetSensitiveThreshold.py.

71 def terminate(self):
72 """ Set the previuos threshold value """
73
74 self.set_threshold('PXD', self.old_pxd_threshold)
75 self.set_threshold('SVD', self.old_svd_threshold)
76
77
78# Particle gun module

Member Data Documentation

◆ old_pxd_threshold

old_pxd_threshold

The current pxd threshold value.

Definition at line 34 of file SetSensitiveThreshold.py.

◆ old_svd_threshold

old_svd_threshold

The current svd threshold value.

Definition at line 36 of file SetSensitiveThreshold.py.

◆ path

path

Filesystem path to the .xml file.

Definition at line 38 of file SetSensitiveThreshold.py.

◆ threshold

threshold

The threshold value to be set.

Definition at line 32 of file SetSensitiveThreshold.py.

◆ xmlpath

xmlpath

XML path to the threshold setting.

Definition at line 40 of file SetSensitiveThreshold.py.


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