Belle II Software light-2406-ragdoll
addECLCalDigitsModule Class Reference
Inheritance diagram for addECLCalDigitsModule:
Collaboration diagram for addECLCalDigitsModule:

Public Member Functions

def __init__ (self)
 
def initialize (self)
 
def event (self)
 

Public Attributes

 eventCounter
 count number of times event method is called (each time use different combinations of ECLCalDigits
 
 digitParams
 parameters to create custom ECLCalDigits
 
 energyThresh
 default energy threshold
 
 timeThresh
 default time threshold
 
 eclCalDigits
 ECLCalDigits datastore.
 

Detailed Description

Add combinations of ECLCalDigits above/below threshold to be counted as out of time

Definition at line 39 of file eventLevelClusteringInfo_countOutOfTime.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Prepare ECLCalDigits parameters

Definition at line 44 of file eventLevelClusteringInfo_countOutOfTime.py.

44 def __init__(self):
45 """
46 Prepare ECLCalDigits parameters
47 """
48 super().__init__()
49
50
51 self.eventCounter = 0
52
53 aboveEnergyThresh = [True, False]
54 aboveTimeThresh = [True, False]
55 thresholdNames = ["aboveEnergythresh", "aboveTimethresh"]
56
57 thresholdsPerRegion = [dict(zip(thresholdNames, thresholds))
58 for thresholds in itertools.product(aboveEnergyThresh, aboveTimeThresh)]
59
60 fwdThresholds, brlThresholds, bwdThresholds = itertools.tee(thresholdsPerRegion, 3)
61
62 regions = ["FWD", "BRL", "BWD"]
63
64
65 self.digitParams = [dict(zip(regions, thresholds))
66 for thresholds in itertools.product(fwdThresholds, brlThresholds, bwdThresholds)]
67
68
69 self.energyThresh = -1
70
71 self.timeThresh = -1
72

Member Function Documentation

◆ event()

def event (   self)
Add ECLCalDigits according to self.digitParams

Definition at line 80 of file eventLevelClusteringInfo_countOutOfTime.py.

80 def event(self):
81 """
82 Add ECLCalDigits according to self.digitParams
83 """
84 eclCalDigits = Belle2.PyStoreArray('ECLCalDigits')
85
86 # cellIds for corresponding to different regions
87 cellId = {"FWD": 1, "BRL": 1153, "BWD": 7777}
88
89 b2.B2DEBUG(37, "Event " + str(self.eventCounter))
90
91 # ECLCalDigit parameter for this event
92 digitParam = self.digitParams[self.eventCounter]
93
94 # Loop on detector regions
95 for region in cellId:
96
97 # Create new ECLCalDigit
98 eclCalDigit = Belle2.ECLCalDigit()
99
100 # Fill ECLCalDigit
101 eclCalDigit.setCellId(cellId[region])
102
103 # Increment cellId.
104 # Important if we ever expand this test to have more than 1 digit per region.
105 cellId[region] += 1
106
107 energy = digitParam[region]["aboveEnergythresh"] * (self.energyThresh + 1)
108 time = digitParam[region]["aboveTimethresh"] * (self.timeThresh + 1)
109 eclCalDigit.setEnergy(energy)
110 eclCalDigit.setTime(time)
111
112 # Add ECLDigit to datastore
113 newDigit = eclCalDigits.appendNew()
114 newDigit.__assign__(eclCalDigit)
115
116 # Set expected number of out of time calDigits per region
117 expectOutOfTime[region] = int(digitParam[region]["aboveEnergythresh"] and digitParam[region]["aboveTimethresh"])
118 b2.B2DEBUG(35, region + ": expecting " + str(expectOutOfTime[region]))
119 b2.B2DEBUG(39, "region = " + region + ", time = " + str(time) + ", energy = " + str(energy))
120
121 # Increment event counter
122 self.eventCounter += 1
123
124
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

◆ initialize()

def initialize (   self)
 module initialize - register ECLCalDigit in datastore 

Definition at line 73 of file eventLevelClusteringInfo_countOutOfTime.py.

73 def initialize(self):
74 """ module initialize - register ECLCalDigit in datastore """
75
76
77 self.eclCalDigits = Belle2.PyStoreArray(Belle2.ECLCalDigit.Class(), "ECLCalDigits")
78 self.eclCalDigits.registerInDataStore()
79

Member Data Documentation

◆ digitParams

digitParams

parameters to create custom ECLCalDigits

Definition at line 65 of file eventLevelClusteringInfo_countOutOfTime.py.

◆ eclCalDigits

eclCalDigits

ECLCalDigits datastore.

Definition at line 77 of file eventLevelClusteringInfo_countOutOfTime.py.

◆ energyThresh

energyThresh

default energy threshold

Definition at line 69 of file eventLevelClusteringInfo_countOutOfTime.py.

◆ eventCounter

eventCounter

count number of times event method is called (each time use different combinations of ECLCalDigits

Definition at line 51 of file eventLevelClusteringInfo_countOutOfTime.py.

◆ timeThresh

timeThresh

default time threshold

Definition at line 71 of file eventLevelClusteringInfo_countOutOfTime.py.


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