43 def peel(self, mc_particle):
44 """Collect information related to the MCParticle into a dictionary"""
45 mc_track = mc_particle.getRelatedFrom("MCRecoTracks")
46
48
49 result = peelers.peel_mc_particle(mc_particle)
50 result.update(peelers.peel_reco_track_hit_content(mc_track))
51 result.update(peelers.peel_event_info(event_info))
52
53 result["mc_store_array_number"] = mc_track.getArrayIndex()
54
55 this_best_track_cdc = self.mc_track_matcher_cdc.getAnyChargeMatchedPRRecoTrack(mc_track)
56 this_best_track_vxd = self.mc_track_matcher_vxd.getAnyChargeMatchedPRRecoTrack(mc_track)
57
58 result.update(peelers.peel_reco_track_hit_content(this_best_track_cdc, key="cdc_{part_name}"))
59 result.update(peelers.peel_reco_track_seed(this_best_track_cdc, key="cdc_{part_name}"))
60 if this_best_track_cdc:
61 result["cdc_store_array_number"] = this_best_track_cdc.getArrayIndex()
62 result["cdc_was_fitted"] = this_best_track_cdc.wasFitSuccessful()
63 else:
64 result["cdc_store_array_number"] = -1
65 result["cdc_was_fitted"] = -1
66
67 result.update(peelers.peel_reco_track_hit_content(this_best_track_vxd, key="vxd_{part_name}"))
68 result.update(peelers.peel_reco_track_seed(this_best_track_vxd, key="vxd_{part_name}"))
69 if this_best_track_vxd:
70 result["vxd_store_array_number"] = this_best_track_vxd.getArrayIndex()
71 result["vxd_was_fitted"] = this_best_track_vxd.wasFitSuccessful()
72 else:
73 result["vxd_store_array_number"] = -1
74 result["vxd_was_fitted"] = -1
75
76 if this_best_track_cdc:
77 merged_vxd_track = this_best_track_cdc.getRelated("SVDRecoTracks")
78 else:
79 merged_vxd_track = None
80 if this_best_track_vxd:
81 merged_cdc_track = this_best_track_vxd.getRelated("CDCRecoTracks")
82 else:
83 merged_cdc_track = None
84
85 flag_incorrect_not_merged = False
86 flag_correct_merged = False
87 flag_not_found = False
88 flag_correct_not_merged_cdcmissing = False
89 flag_incorrect_merged_cdcwrong_although_not_there = False
90 flag_correct_not_merged_vxdmissing = False
91 flag_incorrect_merged_vxdwrong_although_not_there = False
92
93 flag_incorrect_merged = False
94
95
96
97
98 if not this_best_track_cdc and not this_best_track_vxd:
99
100 flag_not_found = True
101
102
103 elif not this_best_track_cdc:
104
105 if not merged_cdc_track:
106
107 flag_correct_not_merged_cdcmissing = True
108
109 else:
110
111 flag_incorrect_merged_cdcwrong_although_not_there = True
112
113
114 elif not this_best_track_vxd:
115
116 if not merged_vxd_track:
117
118 flag_correct_not_merged_vxdmissing = True
119
120 else:
121
122 flag_incorrect_merged_vxdwrong_although_not_there = True
123
124
125 elif not merged_vxd_track and not merged_cdc_track:
126
127 flag_incorrect_not_merged = True
128
129
130 elif this_best_track_cdc == merged_cdc_track and this_best_track_vxd == merged_vxd_track:
131
132 flag_correct_merged = True
133
134
135 else:
136
137 if merged_cdc_track != this_best_track_cdc:
138 flag_incorrect_merged = True
139
140
141
142
143 result.update({
144 "flag_correct_not_merged_cdcmissing": flag_correct_not_merged_cdcmissing,
145 "flag_correct_not_merged_vxdmissing": flag_correct_not_merged_vxdmissing,
146 "flag_correct_merged": flag_correct_merged,
147 "flag_incorrect_not_merged": flag_incorrect_not_merged,
148 "flag_incorrect_merged": flag_incorrect_merged,
149 "flag_incorrect_merged_cdcwrong_although_not_there": flag_incorrect_merged_cdcwrong_although_not_there,
150 "flag_incorrect_merged_vxdwrong_although_not_there": flag_incorrect_merged_vxdwrong_although_not_there,
151 "flag_not_found": flag_not_found,
152 })
153
154 return result
155
a (simplified) python wrapper for StoreObjPtr.