7 from ROOT
import Belle2
13 A small helper module to look for double assigned hits.
14 Prints a summary after execution
18 """Initialization signal at the start of the event processing"""
27 """Event method of the module"""
30 if track_store_vector:
32 wrapped_vector = track_store_vector.obj()
33 tracks = wrapped_vector.get()
37 for recoHit3D
in track:
38 if not recoHit3D.getWireHit().getAutomatonCell().hasTakenFlag():
41 for i, track
in enumerate(tracks):
43 for j, innerTrack
in enumerate(tracks):
46 for recoHit3D
in innerTrack:
47 recoHit3D.getWireHit().getAutomatonCell().setAssignedFlag()
49 for recoHit3D
in track:
51 if recoHit3D.getWireHit().getAutomatonCell().hasAssignedFlag():
53 recoHit3D.getWireHit().getAutomatonCell().setAssignedFlag()
55 for innerTrack
in tracks:
56 for recoHit3D
in innerTrack:
57 recoHit3D.getWireHit().getAutomatonCell().unsetAssignedFlag()
60 """Termination signal at the end of the event processing"""
67 """A small hit cleaner module to set the track information according to mc information.
68 This is surely not for later usage but for testing the genfitter module
83 """Initialization signal at the start of the event processing"""
90 """Event method of the module"""
104 hitIDs = track.getHitIDs(Belle2.Const.CDC)
105 hits = [cdc_hits[i]
for i
in hitIDs]
108 relation_track_particle = [0] * mc_particles.getEntries()
112 current_mc_track = cdc_hit_lookup.getMCTrackId(cdc_hits[i])
113 if 0 <= current_mc_track:
114 relation_track_particle[current_mc_track] += 1
116 should_belong_to_track = np.argmax(relation_track_particle)
118 deleted_hits = sum(relation_track_particle) - relation_track_particle[should_belong_to_track]
120 plane_IDs_of_good_hits = []
121 for i, hitID
in enumerate(hitIDs):
122 current_mc_track = cdc_hit_lookup.getMCTrackId(cdc_hits[hitID])
123 if current_mc_track == should_belong_to_track:
124 good_hits.append(hitID)
130 mc_track = mc_matcher_lookup.getMatchedMCRecoTrack(track)
135 mc_track.getChargeSeed())
137 sStartingPosition = mc_trajectory.calcArcLength2D(startingPosition)
138 zStartingPosition = mc_trajectory.getTrajectorySZ().mapSToZ(sStartingPosition)
141 pos = ROOT.TVector3(mc_trajectory.getSupport().x(), mc_trajectory.getSupport().y(), mc_trajectory.getSupport().z())
143 mc_trajectory.getMom3DAtSupport().x(),
144 mc_trajectory.getMom3DAtSupport().y(),
145 mc_trajectory.getMom3DAtSupport().z())
148 track.setPdgCode(int(track.getChargeSeed() * 211))
152 track.setPdgCode(int(track.getChargeSeed() * 211))
155 """Termination signal at the end of the event processing"""