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

Public Member Functions

None __init__ (self, name, intree, branchName=None, 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 10 of file SiliconTargetDetector.py.

Constructor & Destructor Documentation

◆ __init__()

None SiliconTargetDetector.SiliconTargetDetector.__init__ ( self,
name,
intree,
branchName = None,
outtree = None )

Definition at line 11 of file SiliconTargetDetector.py.

11 def __init__(self, name, intree, branchName=None, outtree=None) -> None:
12 super().__init__(name, intree, branchName, outtree=outtree)
13

Member Function Documentation

◆ digitize()

None SiliconTargetDetector.SiliconTargetDetector.digitize ( self)
Group SiliconTargetPoints by detector ID and build one SiliconTargetHit per ID.

Reimplemented from BaseDetector.BaseDetector.

Definition at line 14 of file SiliconTargetDetector.py.

14 def digitize(self) -> None:
15 """Group SiliconTargetPoints by detector ID and build one SiliconTargetHit per ID."""
16 pointsByDetID = defaultdict(list)
17 for point in self.intree.SiliconTargetPoint:
18 pointsByDetID[point.GetDetectorID()].append(point)
19
20 for detID, pts in pointsByDetID.items():
21 allPoints = ROOT.std.vector("SiliconTargetPoint*")()
22 for p in pts:
23 allPoints.push_back(p)
24 det_hit = ROOT.SiliconTargetHit(detID, allPoints)
25 self.det.push_back(det_hit)

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