13 <contact>software-tracking@belle2.org</contact>
14 <output>matching_validation.root</output>
15 <input>EvtGenSim.root</input>
16 <description>This module generates events for the validation using the full tracking with a tabular output.</description>
20 from ROOT
import Belle2
33 Harvester module to extract the information, if a MCTrack was found by the CDC
34 and/or the VXD tracking reconstruction.
41 HarvestingModule.__init__(self, foreach=
"MCRecoTracks", output_file_name=output_file_name)
54 Extract the information.
56 this_best_track_cdc = self.
mc_track_matcher_cdcmc_track_matcher_cdc.getAnyChargeMatchedPRRecoTrack(mc_track)
57 this_best_track_vxd = self.
mc_track_matcher_vxdmc_track_matcher_vxd.getAnyChargeMatchedPRRecoTrack(mc_track)
60 mc_particle = mc_track.getRelated(
"MCParticles")
63 "vxd_was_found": bool(this_best_track_vxd),
64 "cdc_was_found": bool(this_best_track_cdc),
65 "cdc_has_related":
False,
66 "vxd_has_related":
False,
67 "both_related":
False,
70 if this_best_track_vxd
and this_best_track_cdc:
71 return_dict[
"both_related"] = this_best_track_cdc.getRelated(
"VXDRecoTracks") == this_best_track_vxd
73 if this_best_track_vxd:
74 return_dict[
"vxd_has_related"] = bool(this_best_track_vxd.getRelated(
"CDCRecoTracks"))
75 if this_best_track_cdc:
76 return_dict[
"cdc_has_related"] = bool(this_best_track_cdc.getRelated(
"VXDRecoTracks"))
78 return_dict.update(peel_reco_track_hit_content(mc_track))
79 return_dict.update(peel_mc_particle(mc_particle))
81 return_dict.update(dict(
82 is_matched=self.
mc_track_matchermc_track_matcher.isAnyChargeMatchedMCRecoTrack(mc_track),
83 is_merged=self.
mc_track_matchermc_track_matcher.isAnyChargeMergedMCRecoTrack(mc_track),
84 is_missing=self.
mc_track_matchermc_track_matcher.isMissingMCRecoTrack(mc_track),
85 hit_efficiency=self.
mc_track_matchermc_track_matcher.getRelatedEfficiency(mc_track),
88 return_dict.update(dict(
99 save_tree = refiners.SaveTreeRefiner()
103 path = basf2.create_path()
106 path.add_module(
'RootInput', inputFileName=
'../EvtGenSim.root')
107 path.add_module(
"Gearbox")
110 tracking.add_tracking_reconstruction(path, prune_temporary_tracks=
False, components=[
"SVD",
"CDC"])
111 path.add_module(
"FittedTracksStorer", inputRecoTracksStoreArrayName=
"RecoTracks",
112 outputRecoTracksStoreArrayName=
"FittedRecoTracks")
116 "MCRecoTracksMatcher",
120 mcRecoTracksStoreArrayName=
"MCRecoTracks",
121 prRecoTracksStoreArrayName=
"CDCRecoTracks")
123 "MCRecoTracksMatcher",
127 mcRecoTracksStoreArrayName=
"MCRecoTracks",
128 prRecoTracksStoreArrayName=
"SVDRecoTracks")
131 "MCRecoTracksMatcher",
135 mcRecoTracksStoreArrayName=
"MCRecoTracks",
136 prRecoTracksStoreArrayName=
"FittedRecoTracks")
141 path.add_module(
"ProgressBar")
143 print(basf2.statistics)
146 if __name__ ==
"__main__":
150 print(
"This validation deactivated and thus basf2 is not executed.\n"
151 "If you want to run this validation, please set the 'ACTIVE' flag above to 'True'.\n"
Class to provide convenient methods to look up matching information between pattern recognition and M...
mc_track_matcher_vxd
matcher used for the MCTracks from the VXD
mc_track_matcher_cdc
matcher used for the MCTracks from the CDC
fitted_mc_track_matcher
matcher used for the MCTracks from fitted tracks
mc_track_matcher
matcher used for the MCTracks from both
def __init__(self, output_file_name)