FairShip
Loading...
Searching...
No Matches
test_straw_reco.FakeTracker Class Reference

Public Member Functions

 __init__ (self, found=(), charges=())
 ClearEvent (self)
 AddMeasurement (self, detector_id, drift, resolution)
 FindTracks (self)
 FitCandidate (self, measurements)
 GetNTracks (self)
 GetTrack (self, index)
 GetTrackMeasurements (self, index)
 FitVertex (self, tracks, vertex)

Public Attributes

list measurements = []
list candidates = []
list tracks = []
list vertices = []

Protected Attributes

 _found = found
 _charges = charges

Detailed Description

Records what runTracking hands to SHiP::ActsStrawTracker.

FitCandidate drops the last measurement of each candidate, as the real
tracker drops measurements that do not fit the track.

Definition at line 41 of file test_straw_reco.py.

Constructor & Destructor Documentation

◆ __init__()

test_straw_reco.FakeTracker.__init__ ( self,
found = (),
charges = () )

Definition at line 48 of file test_straw_reco.py.

48 def __init__(self, found=(), charges=()):
49 self.measurements = []
50 self.candidates = []
51 self.tracks = []
52 self.vertices = []
53 self._found = found
54 self._charges = charges
55

Member Function Documentation

◆ AddMeasurement()

test_straw_reco.FakeTracker.AddMeasurement ( self,
detector_id,
drift,
resolution )

Definition at line 60 of file test_straw_reco.py.

60 def AddMeasurement(self, detector_id, drift, resolution):
61 if detector_id == UNKNOWN_STRAW:
62 return -1
63 self.measurements.append((detector_id, drift, resolution))
64 return len(self.measurements) - 1
65

◆ ClearEvent()

test_straw_reco.FakeTracker.ClearEvent ( self)

Definition at line 56 of file test_straw_reco.py.

56 def ClearEvent(self):
57 self.measurements.clear()
58 self.tracks.clear()
59

◆ FindTracks()

test_straw_reco.FakeTracker.FindTracks ( self)

Definition at line 66 of file test_straw_reco.py.

66 def FindTracks(self):
67 self.tracks = [list(t) for t in self._found]
68 return len(self.tracks)
69

◆ FitCandidate()

test_straw_reco.FakeTracker.FitCandidate ( self,
measurements )

Definition at line 70 of file test_straw_reco.py.

70 def FitCandidate(self, measurements):
71 self.candidates.append(list(measurements))
72 self.tracks.append(list(measurements)[:-1])
73 return len(self.tracks) - 1
74

◆ FitVertex()

test_straw_reco.FakeTracker.FitVertex ( self,
tracks,
vertex )

Definition at line 84 of file test_straw_reco.py.

84 def FitVertex(self, tracks, vertex):
85 self.vertices.append(list(tracks))
86 return True
87
88

◆ GetNTracks()

test_straw_reco.FakeTracker.GetNTracks ( self)

Definition at line 75 of file test_straw_reco.py.

75 def GetNTracks(self):
76 return len(self.tracks)
77

◆ GetTrack()

test_straw_reco.FakeTracker.GetTrack ( self,
index )

Definition at line 78 of file test_straw_reco.py.

78 def GetTrack(self, index):
79 return FakeTrack(self._charges[index] if self._charges else 1)
80

◆ GetTrackMeasurements()

test_straw_reco.FakeTracker.GetTrackMeasurements ( self,
index )

Definition at line 81 of file test_straw_reco.py.

81 def GetTrackMeasurements(self, index):
82 return self.tracks[index]
83

Member Data Documentation

◆ _charges

test_straw_reco.FakeTracker._charges = charges
protected

Definition at line 54 of file test_straw_reco.py.

◆ _found

test_straw_reco.FakeTracker._found = found
protected

Definition at line 53 of file test_straw_reco.py.

◆ candidates

list test_straw_reco.FakeTracker.candidates = []

Definition at line 50 of file test_straw_reco.py.

◆ measurements

test_straw_reco.FakeTracker.measurements = []

Definition at line 49 of file test_straw_reco.py.

◆ tracks

test_straw_reco.FakeTracker.tracks = []

Definition at line 51 of file test_straw_reco.py.

◆ vertices

list test_straw_reco.FakeTracker.vertices = []

Definition at line 52 of file test_straw_reco.py.


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