13 from ROOT
import Belle2
24 Harvester retrieving event level information of reconstructed recorded data.
29 pxd_clusters_name='PXDClusters',
30 pxd_spacepoints_name="PXDSpacePoints",
31 svd_clusters_name="SVDClusters",
32 svd_spacepoints_name="SVDSpacePoints",
33 cdc_hits_name="CDCHits",
34 reco_tracks_name="RecoTracks",
35 cdc_reco_tracks_name="CDCRecoTracks",
36 svd_cdc_reco_tracks_name="SVDCDCRecoTracks",
37 svd_reco_tracks_name="SVDRecoTracks",
38 pxd_reco_tracks_name="PXDRecoTracks"
40 """Expecting a name for the output file"""
41 super(EventInfoHarvester, self).
__init__(foreach=
'EventMetaData',
42 output_file_name=output_file_name,
67 def peel(self, event_meta_data):
68 """Extract and store counts of *RecoTracks' and hits, clusters, spacepoints"""
70 event_crops = peelers.peel_event_info(event_meta_data)
73 event_level_tracking_info_crops = peelers.peel_event_level_tracking_info(event_level_tracking_info)
75 number_of_hits = dict(
80 **peelers.peel_store_array_size(self.
cdc_hits_namecdc_hits_name),
83 number_of_tracks = dict(
91 module_list = [
"SegmentNetworkProducer",
"TrackFinderVXDCellOMat"]
92 module_stats = peelers.peel_module_statistics(module_list)
94 return dict(**event_crops,
95 **event_level_tracking_info_crops,
102 save_tree = refiners.SaveTreeRefiner()
107 Harvester retrieving track level information of reconstructed recorded data.
111 reco_tracks_name="RecoTracks",
112 svd_cdc_reco_tracks_name="SVDCDCRecoTracks",
113 svd_reco_tracks_name="SVDRecoTracks",
114 sp_track_cands_name="SPTrackCands"
116 """Expecting a name for the output file and the name of the RecoTracks StoreArray
117 to operate on. The latter defaults to 'RecoTracks'"""
118 super(TrackInfoHarvester, self).
__init__(foreach=reco_tracks_name,
119 output_file_name=output_file_name)
129 """Extract and store information about each RecoTrack"""
132 event_crops = peelers.peel_event_info(event_meta_data)
135 store_array_info = peelers.peel_store_array_info(reco_track)
138 reco_track_hit_content = peelers.peel_reco_track_hit_content(reco_track)
139 reco_track_seed = peelers.peel_reco_track_seed(reco_track)
140 fit_status = peelers.peel_fit_status(reco_track)
143 related_belle2_track = reco_track.getRelated(
"Tracks")
144 if related_belle2_track:
145 track_fit_status = peelers.peel_track_fit_result(
146 related_belle2_track.getTrackFitResultWithClosestMass(Belle2.Const.pion))
148 track_fit_status = peelers.peel_track_fit_result(
None)
150 vxdtf2_was_involved =
False
152 if svd_cdc_reco_track:
157 vxdtf2_was_involved =
True
159 return dict(**reco_track_hit_content,
164 vxdtf2_was_involved=vxdtf2_was_involved,
169 save_tree = refiners.SaveTreeRefiner()
174 Harvester retrieving hit level information of reconstructed recorded data.
177 def __init__(self, output_file_name, reco_tracks_name="RecoTracks"):
178 """Expecting a name for the output file and the name of the RecoTracks StoreArray
179 to operate on. The latter dafaults to 'RecoTracks'"""
180 super(HitInfoHarvester, self).
__init__(foreach=reco_tracks_name,
181 output_file_name=output_file_name)
184 """Extract and store information about each RecoTrack's hits"""
188 event_crops = peelers.peel_event_info(event_meta_data)
191 store_array_info = peelers.peel_store_array_info(reco_track)
194 for hit_info
in reco_track.getRelationsWith(
"RecoHitInformations"):
195 layer = np.float(
"nan")
196 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_SVD:
197 hit = hit_info.getRelated(
"SVDClusters")
198 layer = hit.getSensorID().getLayerNumber()
199 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_PXD:
200 hit = hit_info.getRelated(
"PXDClusters")
201 layer = hit.getSensorID().getLayerNumber()
202 if hit_info.getTrackingDetector() == Belle2.RecoHitInformation.c_CDC:
203 hit = hit_info.getRelated(
"CDCHits")
204 layer = hit.getISuperLayer()
206 if hit_info.useInFit()
and reco_track.hasTrackFitStatus():
207 track_point = reco_track.getCreatedTrackPoint(hit_info)
208 fitted_state = track_point.getFitterInfo()
211 res_info = fitted_state.getResidual()
212 res = np.sqrt(res_info.getState().Norm2Sqr())
214 yield dict(**store_array_info,
217 tracking_detector=hit_info.getTrackingDetector(),
218 use_in_fit=hit_info.useInFit(),
221 except BaseException:
225 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