6 <contact>software-tracking@belle2.org</contact>
7 <output>matching_validation.root</output>
8 <input>EvtGenSim.root</input>
9 <description>This module generates events for the validation using the full tracking with a tabular output.</description>
13 from ROOT
import Belle2
24 Harvester module to extract the information, if a MCTrack was found by the CDC
25 and/or the VXD tracking reconstruction.
32 HarvestingModule.__init__(self, foreach=
"MCRecoTracks", output_file_name=output_file_name)
45 Extract the information.
51 mc_particle = mc_track.getRelated(
"MCParticles")
54 "vxd_was_found": bool(this_best_track_vxd),
55 "cdc_was_found": bool(this_best_track_cdc),
56 "cdc_has_related":
False,
57 "vxd_has_related":
False,
58 "both_related":
False,
61 if this_best_track_vxd
and this_best_track_cdc:
62 return_dict[
"both_related"] = this_best_track_cdc.getRelated(
"VXDRecoTracks") == this_best_track_vxd
64 if this_best_track_vxd:
65 return_dict[
"vxd_has_related"] = bool(this_best_track_vxd.getRelated(
"CDCRecoTracks"))
66 if this_best_track_cdc:
67 return_dict[
"cdc_has_related"] = bool(this_best_track_cdc.getRelated(
"VXDRecoTracks"))
69 return_dict.update(peel_reco_track_hit_content(mc_track))
70 return_dict.update(peel_mc_particle(mc_particle))
72 return_dict.update(dict(
79 return_dict.update(dict(
90 save_tree = refiners.SaveTreeRefiner()
94 path = basf2.create_path()
97 path.add_module(
'RootInput', inputFileName=
'../EvtGenSim.root')
98 path.add_module(
"Gearbox")
102 path.add_module(
"FittedTracksStorer", inputRecoTracksStoreArrayName=
"RecoTracks",
103 outputRecoTracksStoreArrayName=
"FittedRecoTracks")
107 "MCRecoTracksMatcher",
111 mcRecoTracksStoreArrayName=
"MCRecoTracks",
112 prRecoTracksStoreArrayName=
"CDCRecoTracks")
114 "MCRecoTracksMatcher",
118 mcRecoTracksStoreArrayName=
"MCRecoTracks",
119 prRecoTracksStoreArrayName=
"SVDRecoTracks")
122 "MCRecoTracksMatcher",
126 mcRecoTracksStoreArrayName=
"MCRecoTracks",
127 prRecoTracksStoreArrayName=
"FittedRecoTracks")
132 path.add_module(
"ProgressBar")
134 print(basf2.statistics)
137 if __name__ ==
"__main__":