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>
20from ROOT import Belle2
23from tracking.harvest.peelers import peel_mc_particle, peel_reco_track_hit_content
25from tracking.harvest.harvesting import HarvestingModule
26from tracking.harvest import refiners
31class VxdCdcPartFinderHarvester(HarvestingModule):
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.
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(
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(
"Progress")
143 print(basf2.statistics)
146if __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)