67 def event(self):
68 """Find digit with a cluster and save needed information"""
69
70
72 root = tree.getroot()
73 for sensor in root.findall('Sensor'):
74 if sensor.get('type') == 'Layer3':
75 if len(sensor.findall('Active')) == 1:
76 active = sensor.find('Active')
77 NoiseULayer3 = int(active.find('ElectronicNoiseU').text)
78 NoiseVLayer3 = int(active.find('ElectronicNoiseV').text)
79 for sensorbase in root.iter('SensorBase'):
80 if sensorbase.get('type') == 'Barrel':
81 active = sensorbase.find('Active')
82 NoiseUBarrel = int(active.find('ElectronicNoiseU').text)
83 NoiseVBarrel = int(active.find('ElectronicNoiseV').text)
84 elif sensorbase.get('type') == 'Slanted':
85 active = sensorbase.find('Active')
86 NoiseUSlanted = int(active.find('ElectronicNoiseU').text)
87 NoiseVSlanted = int(active.find('ElectronicNoiseV').text)
88
89
90
92 for cluster in clusters:
93
94 cls_strip_ids = []
95
96 cluster_truehits = cluster.getRelationsTo('SVDTrueHits')
97
98 if len(cluster_truehits) != 1:
99 continue
100 digits = cluster.getRelationsTo('SVDRecoDigits')
101
102
103 for digit in digits:
104 if digit.getCellID() not in cls_strip_ids:
105 cls_strip_ids.append(digit.getCellID())
106
107
108 for strip_id in cls_strip_ids:
109
110 strip_charge = 0
111 for digit in digits:
112 if strip_id != digit.getCellID():
113 continue
114
115
116
117 if (digit.getCharge() > strip_charge):
118 strip_charge = digit.getCharge()
119
120
121 sensorID = cluster.getSensorID()
122 self.data.sensor_id = int(sensorID)
123 sensorNum = sensorID.getSensorNumber()
124 self.data.sensor = sensorNum
125 layerNum = sensorID.getLayerNumber()
126 self.data.layer = layerNum
127 if (layerNum == 3):
128 sensorType = 1
129 else:
130 if (sensorNum == 1):
131 sensorType = 0
132 else:
133 sensorType = 1
134 self.data.sensor_type = sensorType
135 ladderNum = sensorID.getLadderNumber()
136 self.data.ladder = ladderNum
137 self.data.strip_charge = strip_charge
138
139
140 if digit.isUStrip():
141 strip_dir = 0
142 if (layerNum == 3):
143 noise = NoiseULayer3
144 else:
145 if (sensorNum == 1):
146 noise = NoiseUSlanted
147 else:
148 noise = NoiseUBarrel
149 else:
150 strip_dir = 1
151 if (layerNum == 3):
152 noise = NoiseVLayer3
153 else:
154 if (sensorNum == 1):
155 noise = NoiseVSlanted
156 else:
157 noise = NoiseVBarrel
158 self.data.strip_dir = strip_dir
159 self.data.strip_noise = noise
160
161 self.file.cd()
162 self.tree.Fill()
163
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
A (simplified) python wrapper for StoreArray.