369 def peel(self, legendre_track_cand):
370 """
371 Extract the information.
372 """
373 if legendre_track_cand.getChargeSeed() > 0:
374 helix =
Belle2.Helix(legendre_track_cand.getPosSeed(), legendre_track_cand.getMomSeed(), 1, 1.5)
375 if legendre_track_cand.getChargeSeed() < 0:
376 helix =
Belle2.Helix(legendre_track_cand.getPosSeed(), legendre_track_cand.getMomSeed(), -1, 1.5)
377
379 mc_track_cand = matcher.getAnyChargeMatchedMCRecoTrack(legendre_track_cand)
380
383
384 if mc_track_cand:
385 mc_x = mc_track_cand.getPosSeed().X()
386 mc_y = mc_track_cand.getPosSeed().Y()
387 mc_z = mc_track_cand.getPosSeed().Z()
388 mc_mom_x = mc_track_cand.getMomSeed().X()
389 mc_mom_y = mc_track_cand.getMomSeed().Y()
390 mc_mom_z = mc_track_cand.getMomSeed().Z()
391 else:
392 mc_x = np.NaN
393 mc_y = np.NaN
394 mc_z = np.NaN
395 mc_mom_x = np.NaN
396 mc_mom_y = np.NaN
397 mc_mom_z = np.NaN
398
399 return_dict = dict(
400 helix_z=helix.getZ0(),
401 helix_x=helix.getPerigeeX(),
402 helix_y=helix.getPerigeeY(),
403 helix_mom_z=helix.getMomentumZ(1.5),
404 helix_mom_x=helix.getMomentumX(1.5),
405 helix_mom_y=helix.getMomentumY(1.5),
406 mc_x=mc_x,
407 mc_y=mc_y,
408 mc_z=mc_z,
409 mc_mom_x=mc_mom_x,
410 mc_mom_y=mc_mom_y,
411 mc_mom_z=mc_mom_z)
412
413 if self.use_vxd_hits:
414 first_hit = legendre_track_cand.getHit(0)
415 if first_hit.getDetId() == Belle2.Const.PXD:
416 first_cluster = pxd_clusters[first_hit.getHitId()]
417 first_true_hit = first_cluster.getRelated("PXDTrueHits")
418 elif first_hit.getDetId() == Belle2.Const.SVD:
419 first_cluster = svd_clusters[first_hit.getHitId()]
420 first_true_hit = first_cluster.getRelated("SVDTrueHits")
421
422 vxdID = first_cluster.getSensorID()
424 first_momentum = sensorInfoBase.vectorToGlobal(first_true_hit.getMomentum(), True)
425
426 last_hit = legendre_track_cand.getHit(-1)
427 if last_hit.getDetId() == Belle2.Const.PXD:
428 last_cluster = pxd_clusters[last_hit.getHitId()]
429 last_true_hit = last_cluster.getRelated("PXDTrueHits")
430 elif last_hit.getDetId() == Belle2.Const.SVD:
431 last_cluster = svd_clusters[last_hit.getHitId()]
432 last_true_hit = last_cluster.getRelated("SVDTrueHits")
433
434 vxdID = first_cluster.getSensorID()
436 last_momentum = sensorInfoBase.vectorToGlobal(last_true_hit.getMomentum(), True)
437
438 return_dict.update(dict(first_hit_mom_x=first_momentum.X(),
439 first_hit_mom_y=first_momentum.Y(),
440 first_hit_mom_z=first_momentum.Z(),
441 last_hit_mom_x=last_momentum.X(),
442 last_hit_mom_y=last_momentum.Y(),
443 last_hit_mom_z=last_momentum.Z()))
444
445 return return_dict
446
A (simplified) python wrapper for StoreArray.
Class to provide convenient methods to look up matching information between pattern recognition and M...
static GeoCache & getInstance()
Return a reference to the singleton instance.