FairShip
Loading...
Searching...
No Matches
timeDetector.timeDetector Class Reference
Inheritance diagram for timeDetector.timeDetector:
[legend]
Collaboration diagram for timeDetector.timeDetector:
[legend]

Public Member Functions

None __init__ (self, name, intree, outtree=None)
None digitize (self)
Public Member Functions inherited from BaseDetector.BaseDetector
None __init__ (self, name, intree, branchName=None, mcBranchType=None, mcBranchName=None, int splitLevel=99, outtree=None)
None delete (self)
None fill (self)
None process (self)

Additional Inherited Members

Public Attributes inherited from BaseDetector.BaseDetector
 name = name
 intree = intree
 outtree = outtree if outtree is not None else intree
 det = ROOT.std.vector(f"{name}Hit")()
 MCdet = None
 mcBranch = None
 branch = self.outtree.Branch(f"Digi_{branchName}Hits", self.det, 32000, splitLevel)

Detailed Description

Definition at line 8 of file timeDetector.py.

Constructor & Destructor Documentation

◆ __init__()

None timeDetector.timeDetector.__init__ ( self,
name,
intree,
outtree = None )

Definition at line 9 of file timeDetector.py.

9 def __init__(self, name, intree, outtree=None) -> None:
10 super().__init__(name, intree, outtree=outtree)
11

Member Function Documentation

◆ digitize()

None timeDetector.timeDetector.digitize ( self)
Digitize timing detector MC hits.

One hit is created per TimeDetPoint, at the same index. Per bar, the hit
from the point with the earliest true (unsmeared) time is marked valid,
all others invalid.

The selection uses the MC time rather than the smeared TDC values:
points in the same bar (e.g. a muon and its delta electrons) belong to
the same light pulse, so comparing independently smeared TDCs would pick
a random point and often invalidate the primary's hit.

Reimplemented from BaseDetector.BaseDetector.

Definition at line 12 of file timeDetector.py.

12 def digitize(self) -> None:
13 """Digitize timing detector MC hits.
14
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,
17 all others invalid.
18
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.
23 """
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)
30 if earliest is None:
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
35 else:
36 self.det[index].setInvalid()

The documentation for this class was generated from the following file: