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

Public Member Functions

def __init__ (self)
 
def beginRun (self)
 
def event (self)
 
def terminate (self)
 
def decode (self, vxdid)
 

Public Attributes

 dumpfile
 Output file object.
 
 vxdid_factors
 Factors for decoding VXDId's.
 

Detailed Description

A simple module to dump PXD digits.

Definition at line 17 of file DumpDigits.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Initialize the module

Definition at line 21 of file DumpDigits.py.

21 def __init__(self):
22 """Initialize the module"""
23
24 super().__init__()
25
26 self.dumpfile = 'PXDDigitsDump.txt'
27
28 self.vxdid_factors = (8192, 256, 32)
29

Member Function Documentation

◆ beginRun()

def beginRun (   self)
 Write legend for file columns 

Definition at line 30 of file DumpDigits.py.

30 def beginRun(self):
31 """ Write legend for file columns """
32 with open(self.dumpfile, 'w') as dumpfile:
33 dumpfile.write('vxd.id layer ladder sensor digit.u digit.v digit.charge ')
34

◆ decode()

def decode (   self,
  vxdid 
)
 Utility to decode sensor IDs 

Definition at line 56 of file DumpDigits.py.

56 def decode(self, vxdid):
57 """ Utility to decode sensor IDs """
58
59 result = []
60 for f in self.vxdid_factors:
61 result.append(vxdid // f)
62 vxdid = vxdid % f
63
64 return result

◆ event()

def event (   self)
Find clusters with a truehit and print some stats.

Definition at line 35 of file DumpDigits.py.

35 def event(self):
36 """Find clusters with a truehit and print some stats."""
37
38 digits = Belle2.PyStoreArray('PXDDigits')
39 # nDigits = digits.getEntries()
40 # Start with clusters and use the relation to get the corresponding
41 # digits and truehits.
42 with open(self.dumpfile, 'a') as dumpfile:
43 s = ''
44 for digit in digits:
45 # Sesnor identification
46 sensorID = digit.getSensorID().getID()
47 [layer, ladder, sensor] = self.decode(sensorID)
48 s += f'{sensorID} {layer:3d} {ladder:3d} {sensor:3d} {digit.getUCellID():6d} ' + \
49 f'{digit.getVCellID():6d} {digit.getCharge():8.1f}'
50 s += '\n'
51 dumpfile.write(s)
52
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ terminate()

def terminate (   self)
 Nothing.

Definition at line 53 of file DumpDigits.py.

53 def terminate(self):
54 """ Nothing."""
55

Member Data Documentation

◆ dumpfile

dumpfile

Output file object.

Definition at line 26 of file DumpDigits.py.

◆ vxdid_factors

vxdid_factors

Factors for decoding VXDId's.

Definition at line 28 of file DumpDigits.py.


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