Belle II Software development
SeedsAnalyser Class Reference
Inheritance diagram for SeedsAnalyser:
HarvestingModule

Public Member Functions

def __init__ (self, output_file_name, track_cands, use_vxd_hits=True)
 
def peel (self, legendre_track_cand)
 

Public Attributes

 use_vxd_hits
 cached flag to use VXD hits
 

Static Public Attributes

refiners save_tree = refiners.SaveTreeRefiner()
 Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.
 

Detailed Description

Extract the momentum seeds of the first and the last hit of the track candidates (when use_vxd_hits is true),
the helx and the mc momentum.

Definition at line 353 of file harvester.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name,
  track_cands,
  use_vxd_hits = True 
)
Init with the root output file name and the name of the store array of the track cands to use.

Reimplemented from HarvestingModule.

Definition at line 360 of file harvester.py.

360 def __init__(self, output_file_name, track_cands, use_vxd_hits=True):
361 """
362 Init with the root output file name and the name of the store array of the track cands to use.
363 """
364 HarvestingModule.__init__(self, foreach=track_cands, output_file_name=output_file_name)
365
366
367 self.use_vxd_hits = use_vxd_hits
368

Member Function Documentation

◆ peel()

def peel (   self,
  legendre_track_cand 
)
Extract the information.

Reimplemented from HarvestingModule.

Definition at line 369 of file harvester.py.

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
378 matcher = Belle2.TrackMatchLookUp("MCTrackCands", self.foreach)
379 mc_track_cand = matcher.getAnyChargeMatchedMCRecoTrack(legendre_track_cand)
380
381 pxd_clusters = Belle2.PyStoreArray("PXDClusters")
382 svd_clusters = Belle2.PyStoreArray("SVDClusters")
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()
423 sensorInfoBase = Belle2.VXD.GeoCache.getInstance().getSensorInfo(vxdID)
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()
435 sensorInfoBase = Belle2.VXD.GeoCache.getInstance().getSensorInfo(vxdID)
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
Helix parameter class.
Definition: Helix.h:48
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
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.
Definition: GeoCache.cc:214

Member Data Documentation

◆ save_tree

refiners save_tree = refiners.SaveTreeRefiner()
static

Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.

Definition at line 449 of file harvester.py.

◆ use_vxd_hits

use_vxd_hits

cached flag to use VXD hits

Definition at line 367 of file harvester.py.


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