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

Public Member Functions

def __init__ (self)
 
def event (self)
 

Public Attributes

 digitParams
 ecl digit parameters
 

Detailed Description

Adds ECLDigits with very large/small time/amplitude values

Definition at line 32 of file ecl_packer_unpacker.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
constructor

Definition at line 37 of file ecl_packer_unpacker.py.

37 def __init__(self):
38 """constructor"""
39 super().__init__()
40 amps = [0, 1, 100000, 262015]
41 times = [-2048, -100, 0, 100, 2047]
42 qualitys = [0, 1, 2, 3]
43 chis = [0, 1, 254, 511]
44 paramNames = ["amp", "time", "quality", "chi"]
45
46 self.digitParams = [dict(zip(paramNames, params)) for params in itertools.product(amps, times, qualitys, chis)]
47

Member Function Documentation

◆ event()

def event (   self)
event function

Definition at line 48 of file ecl_packer_unpacker.py.

48 def event(self):
49 """
50 event function
51 """
52 eclDigitsFromSimulation = Belle2.PyStoreArray(eclDigitsDatastoreName)
53
54 # Check for used cellIds
55 usedCellIds = list(map(lambda eclDigit: eclDigit.getCellId(), eclDigitsFromSimulation))
56
57 # Create new ECLDigits and add them to datastore
58 for digitParam in self.digitParams:
59 # Skip combination of quality != 2 and chi != 0. Electronics can't output this
60 if (digitParam['quality'] != 2) and (digitParam['chi'] != 0):
61 continue
62
63 # Skip combination of quality == 2 and amp != 0. Electronics can't output this
64 if (digitParam['quality'] == 2) and (digitParam['time'] != 0):
65 continue
66
67 # Choose cellId that's not already used
68 cellId = int(gRandom.Uniform(1, 8736))
69 while cellId in usedCellIds:
70 cellId = int(gRandom.Uniform(1, 8736))
71
72 usedCellIds.append(cellId)
73 # Create new ECLDigit
74 eclDigit = Belle2.ECLDigit()
75
76 # Fill ECLDigit
77 eclDigit.setCellId(cellId)
78 eclDigit.setAmp(digitParam['amp'])
79 eclDigit.setTimeFit(digitParam['time'])
80 eclDigit.setQuality(digitParam['quality'])
81 eclDigit.setChi(digitParam['chi'])
82
83 # Add ECLDigit to datastore
84 newDigit = eclDigitsFromSimulation.appendNew()
85 newDigit.__assign__(eclDigit)
86
87
Class to store ECL digitized hits (output of ECLDigi) relation to ECLHit filled in ecl/modules/eclDig...
Definition: ECLDigit.h:24
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

Member Data Documentation

◆ digitParams

digitParams

ecl digit parameters

Definition at line 46 of file ecl_packer_unpacker.py.


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