Class TrackOTFit¶
- Defined in File TrackOTFit.h
Class Documentation¶
-
class
TrackOTFit
¶ Least squares fit of vertex location to prong clusters.
Public Functions
-
TrackOTFit
()¶
-
virtual
~TrackOTFit
()¶
-
void
fit
(std::vector<std::vector<float>> &initial_track, std::vector<std::vector<float>> &track_pts_w_feat_v)¶ fit points [unfinished function right now]
- Parameters
initial_track
: Initial track points, consisting of a start and end pointtrack_pts_w_feat_v
: vector of space points (vector<float>) to fit to
Public Static Functions
-
float
d2_segment_point
(const std::vector<float> &seg_start, const std::vector<float> &seg_end, const std::vector<float> &testpt)¶ calculate the squared-distance from a line segment
Use line-distance formala if test point projects onto the segment. Use point-point distance if projects outside the segment
- Parameters
seg_start
: Start spacepoint defining segmentseg_end
: End spacepoint defining segmenttestpt
: Test spacepoint
-
std::vector<float>
grad_d2_wrt_segend
(const std::vector<float> &seg_start, const std::vector<float> &seg_end, const std::vector<float> &testpt)¶ calculate gradient of squared distance with respect to end-point position
- Parameters
seg_start
: Segment start pointseg_end
: Segment end pointtestpt
: Test point
-
void
getLossAndGradient
(const std::vector<std::vector<float>> &initial_track, const std::vector<std::vector<float>> &track_pts_w_feat_v, float &loss, std::vector<float> &grad)¶ calculate loss and gradient without weighting points
- Parameters
initial_track
: Initial track points, consisting of a start and end pointtrack_pts_w_feat_v
: vector of space points (vector<float>) to fit toloss
: The final total loss which is the average squared-distancegrad
: The average gradient for all points
-
void
getWeightedLossAndGradient
(const std::vector<std::vector<float>> &initial_track, const std::vector<std::vector<float>> &track_pts_w_feat_v, float &loss, float &totweight, std::vector<float> &grad)¶ calculate loss and gradient with weights
For the vectors in track_pts_w_feat_v, the first 3 entries are (x,y,z). The weight for a given spacepoint is calculated by multiplying all vector values for entries [3:] and above.
- Parameters
initial_track
: Initial track points, consisting of a start and end pointtrack_pts_w_feat_v
: vector of space points (vector<float>) to fit toloss
: The final total loss which is the average squared-distancetot_weight
: The total weightgrad
: The weighted average gradient for all points
-