107 """Fill the residual and pull histograms"""
112 for truehit
in truehits:
115 clusters = truehit.getRelationsFrom(
"PXDClusters")
118 for j, cls
in enumerate(clusters):
121 if clusters.weight(j) < 100:
124 mom = truehit.getMomentum()
127 thetaU = math.atan(tu) * 180 / math.pi
128 thetaV = math.atan(tv) * 180 / math.pi
137 clusterkind = cls.getKind()
142 if clusterkind <= 3
and mom.Mag() > 0.02:
147 self.hist_map_momentum[clusterkind].Fill(mom.Mag())
148 self.hist_map_theta_u[clusterkind].Fill(thetaU)
149 self.hist_map_theta_v[clusterkind].Fill(thetaV)
150 self.hist_map_clustercharge[clusterkind].Fill(cls.getCharge())
153 self.hist_map_momentum[4].Fill(mom.Mag())
154 self.hist_map_theta_u[4].Fill(thetaU)
155 self.hist_map_theta_v[4].Fill(thetaV)
156 self.hist_map_clustercharge[4].Fill(cls.getCharge())
160 pull_u = (truehit.getU() - cls.getU()) / cls.getUSigma()
161 pull_v = (truehit.getV() - cls.getV()) / cls.getVSigma()
163 self.hist_map_residual_u[(clusterkind, mode)].Fill(truehit.getU() - cls.getU())
164 self.hist_map_residual_v[(clusterkind, mode)].Fill(truehit.getV() - cls.getV())
165 self.hist_map_residual_pull_u[(clusterkind, mode)].Fill(pull_u)
166 self.hist_map_residual_pull_v[(clusterkind, mode)].Fill(pull_v)
168 if thetaV >= self.binlimits[0][0]
and thetaV < self.binlimits[0][1]:
169 self.hist_map_residual_v_special[(clusterkind, mode, 0)].Fill(truehit.getV() - cls.getV())
170 elif thetaV >= self.binlimits[1][0]
and thetaV < self.binlimits[1][1]:
171 self.hist_map_residual_v_special[(clusterkind, mode, 1)].Fill(truehit.getV() - cls.getV())
173 self.hist_map_residual_v_special[(clusterkind, mode, 2)].Fill(truehit.getV() - cls.getV())
175 shape_likelyhood = PositionEstimator.getShapeLikelyhood(cls, tu, tv)
176 if shape_likelyhood > 0:
177 self.nfound_shapes += 1
179 offset = PositionEstimator.getClusterOffset(cls, tu, tv)
182 self.nfound_offset += 1
186 shiftU = sensor_info.getUCellPosition(cls.getUStart())
187 shiftV = sensor_info.getVCellPosition(cls.getVStart())
191 pull_u = (truehit.getU() - shiftU - offset.getU()) / (math.sqrt(offset.getUSigma2()))
192 pull_v = (truehit.getV() - shiftV - offset.getV()) / (math.sqrt(offset.getVSigma2()))
194 self.hist_map_residual_u[(clusterkind, mode)].Fill(truehit.getU() - shiftU - offset.getU())
195 self.hist_map_residual_v[(clusterkind, mode)].Fill(truehit.getV() - shiftV - offset.getV())
196 self.hist_map_residual_pull_u[(clusterkind, mode)].Fill(pull_u)
197 self.hist_map_residual_pull_v[(clusterkind, mode)].Fill(pull_v)
199 if thetaV >= self.binlimits[0][0]
and thetaV < self.binlimits[0][1]:
200 self.hist_map_residual_v_special[(clusterkind, mode, 0)].Fill(
201 truehit.getV() - shiftV - offset.getV())
202 elif thetaV >= self.binlimits[1][0]
and thetaV < self.binlimits[1][1]:
203 self.hist_map_residual_v_special[(clusterkind, mode, 1)].Fill(
204 truehit.getV() - shiftV - offset.getV())
206 self.hist_map_residual_v_special[(clusterkind, mode, 2)].Fill(
207 truehit.getV() - shiftV - offset.getV())
211 self.hist_map_residual_u[(clusterkind, mode)].Fill(truehit.getU() - shiftU - offset.getU())
212 self.hist_map_residual_v[(clusterkind, mode)].Fill(truehit.getV() - shiftV - offset.getV())
213 self.hist_map_residual_pull_u[(clusterkind, mode)].Fill(pull_u)
214 self.hist_map_residual_pull_v[(clusterkind, mode)].Fill(pull_v)
216 if thetaV >= self.binlimits[0][0]
and thetaV < self.binlimits[0][1]:
217 self.hist_map_residual_v_special[(clusterkind, mode, 0)].Fill(
218 truehit.getV() - shiftV - offset.getV())
219 elif thetaV >= self.binlimits[1][0]
and thetaV < self.binlimits[1][1]:
220 self.hist_map_residual_v_special[(clusterkind, mode, 1)].Fill(
221 truehit.getV() - shiftV - offset.getV())
223 self.hist_map_residual_v_special[(clusterkind, mode, 2)].Fill(
224 truehit.getV() - shiftV - offset.getV())
230 pull_u = (truehit.getU() - cls.getU()) / cls.getUSigma()
231 pull_v = (truehit.getV() - cls.getV()) / cls.getVSigma()
233 self.hist_map_residual_u[(clusterkind, mode)].Fill(truehit.getU() - cls.getU())
234 self.hist_map_residual_v[(clusterkind, mode)].Fill(truehit.getV() - cls.getV())
235 self.hist_map_residual_pull_u[(clusterkind, mode)].Fill(pull_u)
236 self.hist_map_residual_pull_v[(clusterkind, mode)].Fill(pull_v)
238 if thetaV >= self.binlimits[0][0]
and thetaV < self.binlimits[0][1]:
239 self.hist_map_residual_v_special[(clusterkind, mode, 0)].Fill(truehit.getV() - cls.getV())
240 elif thetaV >= self.binlimits[1][0]
and thetaV < self.binlimits[1][1]:
241 self.hist_map_residual_v_special[(clusterkind, mode, 1)].Fill(truehit.getV() - cls.getV())
243 self.hist_map_residual_v_special[(clusterkind, mode, 2)].Fill(truehit.getV() - cls.getV())
Class PXDTrueHit - Records of tracks that either enter or leave the sensitive volume.
static PXDClusterPositionEstimator & getInstance()
Main (and only) way to access the PXDClusterPositionEstimator.
A (simplified) python wrapper for StoreArray.
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.