13 """Digitize timing detector MC hits.
15 One hit is created per TimeDetPoint, at the same index. Per bar, the hit
16 from the point with the earliest true (unsmeared) time is marked valid,
19 The selection uses the MC time rather than the smeared TDC values:
20 points in the same bar (e.g. a muon and its delta electrons) belong to
21 the same light pulse, so comparing independently smeared TDCs would pick
22 a random point and often invalidate the primary's hit.
24 earliest_per_det_id = {}
25 points = self.
intree.TimeDetPoint
26 for index, point
in enumerate(points):
27 self.
det.push_back(ROOT.TimeDetHit(point, self.
intree.t0))
28 detector_id = point.GetDetectorID()
29 earliest = earliest_per_det_id.get(detector_id)
31 earliest_per_det_id[detector_id] = index
32 elif point.GetTime() < points[earliest].GetTime():
33 self.
det[earliest].setInvalid()
34 earliest_per_det_id[detector_id] = index
36 self.
det[index].setInvalid()