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

Public Member Functions

def __init__ (self)
 
def pick (self, mc_particle)
 
def peel (self, mc_particle)
 

Public Attributes

 mc_track_matcher
 matcher used for the final MCTrack list
 
 mc_track_matcher_cdc
 matcher used for the MCTracks from the CDC
 
 mc_track_matcher_vxd
 matcher used for the MCTracks from the VXD
 

Static Public Attributes

refiners save_tree = refiners.SaveTreeRefiner()
 Refiners to be executed at the end of the harvesting / termination of the module Store as a table in a ROOT file.
 

Detailed Description

Harvester module to extract useful information from VXD-CDC track merging.

Definition at line 68 of file vxdCdcMergerValidationGenerateSample.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)
Init harvester

Reimplemented from HarvestingModule.

Definition at line 73 of file vxdCdcMergerValidationGenerateSample.py.

73 def __init__(self):
74 """
75 Init harvester
76 """
77 HarvestingModule.__init__(self, foreach="MCParticles", output_file_name="../VxdCdcValidationHarvested.root")
78
79
80 self.mc_track_matcher = Belle2.TrackMatchLookUp("MCRecoTracks")
81
82 self.mc_track_matcher_cdc = Belle2.TrackMatchLookUp("MCRecoTracks", "CDCRecoTracks")
83
84 self.mc_track_matcher_vxd = Belle2.TrackMatchLookUp("MCRecoTracks", "SVDRecoTracks")
85
Class to provide convenient methods to look up matching information between pattern recognition and M...

Member Function Documentation

◆ peel()

def peel (   self,
  mc_particle 
)
Extract the information.

Reimplemented from HarvestingModule.

Definition at line 96 of file vxdCdcMergerValidationGenerateSample.py.

96 def peel(self, mc_particle):
97 """
98 Extract the information.
99 """
100
101 # mc is a genfit::TrackCand
102
103 mc_track = mc_particle.getRelatedFrom("MCRecoTracks")
104
105 mc_nhits = mc_track.getNumberOfTotalHits()
106 mc_pt = mc_particle.getMomentum().Rho()
107 mc_theta = mc_particle.getMomentum().Theta()
108
109 # reco_tracks = Belle2.PyStoreArray('RecoTracks')
110
111 this_best_track_cdc = self.mc_track_matcher_cdc.getRelatedPRRecoTrack(mc_track)
112 this_best_track_vxd = self.mc_track_matcher_vxd.getRelatedPRRecoTrack(mc_track)
113
114 # here we know, the above tracks should have been merged because they stem
115 # from the same MC Track. Have they?
116
117 this_best_track_merged = self.mc_track_matcher.getRelatedPRRecoTrack(mc_track)
118
119 good_merge = False
120 vxd_hits = 0
121 cdc_hits = 0
122
123 merged_hits = 0
124
125 if this_best_track_merged:
126 if this_best_track_cdc:
127 cdc_hits = this_best_track_cdc.getNumberOfTotalHits()
128 if this_best_track_vxd:
129 vxd_hits = this_best_track_vxd.getNumberOfTotalHits()
130
131 merged_hits = vxd_hits + cdc_hits
132 good_merge = merged_hits == this_best_track_merged.getNumberOfTotalHits()
133
134 return {
135 "MC_PT": mc_pt,
136 "MC_THETA": mc_theta,
137 "MC_NHITS": mc_nhits,
138 "PR_NHITS": merged_hits,
139 "PR_CDC_NHITS": cdc_hits,
140 "PR_VXD_NHITS": vxd_hits,
141 "GOOD_MERGE": good_merge
142 }
143

◆ pick()

def pick (   self,
  mc_particle 
)
Select the MCParticle if it is related to an MCRecoTrack

Reimplemented from HarvestingModule.

Definition at line 86 of file vxdCdcMergerValidationGenerateSample.py.

86 def pick(self, mc_particle):
87 """Select the MCParticle if it is related to an MCRecoTrack"""
88 # mc_track = mc_particle.getRelated("MCRecoTracks")
89 # return mc_track is not None
90 mc_track = mc_particle.getRelatedFrom("MCRecoTracks")
91 if mc_track:
92 return True
93 else:
94 return False
95

Member Data Documentation

◆ mc_track_matcher

mc_track_matcher

matcher used for the final MCTrack list

Definition at line 80 of file vxdCdcMergerValidationGenerateSample.py.

◆ mc_track_matcher_cdc

mc_track_matcher_cdc

matcher used for the MCTracks from the CDC

Definition at line 82 of file vxdCdcMergerValidationGenerateSample.py.

◆ mc_track_matcher_vxd

mc_track_matcher_vxd

matcher used for the MCTracks from the VXD

Definition at line 84 of file vxdCdcMergerValidationGenerateSample.py.

◆ save_tree

refiners save_tree = refiners.SaveTreeRefiner()
static

Refiners to be executed at the end of the harvesting / termination of the module Store as a table in a ROOT file.

Definition at line 146 of file vxdCdcMergerValidationGenerateSample.py.


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