12from ROOT
import Belle2
23 Harvester retrieving event level information of reconstructed recorded data.
28 pxd_clusters_name='PXDClusters',
29 pxd_spacepoints_name="PXDSpacePoints",
30 svd_clusters_name="SVDClusters",
31 svd_spacepoints_name="SVDSpacePoints",
32 cdc_hits_name="CDCHits",
33 reco_tracks_name="RecoTracks",
34 cdc_reco_tracks_name="CDCRecoTracks",
35 svd_cdc_reco_tracks_name="SVDCDCRecoTracks",
36 svd_reco_tracks_name="SVDRecoTracks",
37 pxd_reco_tracks_name="PXDRecoTracks"
39 """Expecting a name for the output file"""
40 super().
__init__(foreach=
'EventMetaData',
41 output_file_name=output_file_name,
66 def peel(self, event_meta_data):
67 """Extract and store counts of *RecoTracks' and hits, clusters, spacepoints"""
69 event_crops = peelers.peel_event_info(event_meta_data)
72 event_level_tracking_info_crops = peelers.peel_event_level_tracking_info(event_level_tracking_info)
74 number_of_hits = dict(
82 number_of_tracks = dict(
90 module_list = [
"SegmentNetworkProducer",
"TrackFinderVXDCellOMat"]
91 module_stats = peelers.peel_module_statistics(module_list)
93 return dict(**event_crops,
94 **event_level_tracking_info_crops,
101 save_tree = refiners.SaveTreeRefiner()
106 Harvester retrieving track level information of reconstructed recorded data.
110 reco_tracks_name="RecoTracks",
111 svd_cdc_reco_tracks_name="SVDCDCRecoTracks",
112 svd_reco_tracks_name="SVDRecoTracks",
113 sp_track_cands_name="SPTrackCands"
115 """Expecting a name for the output file and the name of the RecoTracks StoreArray
116 to operate on. The latter defaults to 'RecoTracks'"""
117 super().__init__(foreach=reco_tracks_name,
118 output_file_name=output_file_name)
128 """Extract and store information about each RecoTrack"""
131 event_crops = peelers.peel_event_info(event_meta_data)
134 store_array_info = peelers.peel_store_array_info(reco_track)
137 reco_track_hit_content = peelers.peel_reco_track_hit_content(reco_track)
138 reco_track_seed = peelers.peel_reco_track_seed(reco_track)
139 fit_status = peelers.peel_fit_status(reco_track)
142 related_belle2_track = reco_track.getRelated(
"Tracks")
143 if related_belle2_track:
144 track_fit_status = peelers.peel_track_fit_result(
145 related_belle2_track.getTrackFitResultWithClosestMass(Belle2.Const.pion))
147 track_fit_status = peelers.peel_track_fit_result(
None)
149 vxdtf2_was_involved =
False
151 if svd_cdc_reco_track:
156 vxdtf2_was_involved =
True
158 return dict(**reco_track_hit_content,
163 vxdtf2_was_involved=vxdtf2_was_involved,
168 save_tree = refiners.SaveTreeRefiner()
173 Harvester retrieving hit level information of reconstructed recorded data.
176 def __init__(self, output_file_name, reco_tracks_name="RecoTracks"):
177 """Expecting a name for the output file and the name of the RecoTracks StoreArray
178 to operate on. The latter defaults to 'RecoTracks'"""
179 super().__init__(foreach=reco_tracks_name,
180 output_file_name=output_file_name)
183 """Extract and store information about each RecoTrack's hits"""
187 event_crops = peelers.peel_event_info(event_meta_data)
190 store_array_info = peelers.peel_store_array_info(reco_track)
193 for hit_info
in reco_track.getRelationsWith(
"RecoHitInformations"):
195 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_SVD:
196 hit = hit_info.getRelated(
"SVDClusters")
197 layer = hit.getSensorID().getLayerNumber()
198 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_PXD:
199 hit = hit_info.getRelated(
"PXDClusters")
200 layer = hit.getSensorID().getLayerNumber()
201 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_CDC:
202 hit = hit_info.getRelated(
"CDCHits")
203 layer = hit.getISuperLayer()
205 if hit_info.useInFit()
and reco_track.hasTrackFitStatus():
206 track_point = reco_track.getCreatedTrackPoint(hit_info)
207 fitted_state = track_point.getFitterInfo()
210 res_info = fitted_state.getResidual()
211 res = np.sqrt(res_info.getState().Norm2Sqr())
213 yield dict(**store_array_info,
216 tracking_detector=hit_info.getTrackingDetector(),
217 use_in_fit=hit_info.useInFit(),
220 except BaseException:
224 save_tree = refiners.SaveTreeRefiner()
a (simplified) python wrapper for StoreObjPtr.
cdc_reco_tracks_name
cached value of the CDCRecoTracks StoreArray
cdc_hits_name
cached value of the CDCHits StoreArray
def __init__(self, output_file_name, pxd_clusters_name='PXDClusters', pxd_spacepoints_name="PXDSpacePoints", svd_clusters_name="SVDClusters", svd_spacepoints_name="SVDSpacePoints", cdc_hits_name="CDCHits", reco_tracks_name="RecoTracks", cdc_reco_tracks_name="CDCRecoTracks", svd_cdc_reco_tracks_name="SVDCDCRecoTracks", svd_reco_tracks_name="SVDRecoTracks", pxd_reco_tracks_name="PXDRecoTracks")
svd_cdc_reco_tracks_name
cached value of the SVDCDCRecoTracks StoreArray
pxd_clusters_name
cached value of the PXDClusters StoreArray
svd_clusters_name
cached value of the SVDClusters StoreArray
pxd_reco_tracks_name
cached value of the PXDRecoTracks StoreArray
pxd_spacepoints_name
cached value of the PXDSpacePoints StoreArray
reco_tracks_name
cached value of the RecoTracks StoreArray
svd_spacepoints_name
cached value of the SVDSpacePoints StoreArray
svd_reco_tracks_name
cached value of the SVDRecoTracks StoreArray
def peel(self, event_meta_data)
def __init__(self, output_file_name, reco_tracks_name="RecoTracks")
def peel(self, reco_track)
def __init__(self, output_file_name, reco_tracks_name="RecoTracks", svd_cdc_reco_tracks_name="SVDCDCRecoTracks", svd_reco_tracks_name="SVDRecoTracks", sp_track_cands_name="SPTrackCands")
sp_track_cands_name
cached value of the SPTrackCands StoreArray
svd_cdc_reco_tracks_name
cached value of the SVDCDCRecoTracks StoreArray
def peel(self, reco_track)
svd_reco_tracks_name
cached value of the SVDRecoTracks StoreArray