|
FairShip
|
Functions | |
| None | initialize (fgeo) |
| def | execute (smeared_hits, ship_geo, str method="") |
| None | finalize () |
| def | template_matching_pattern_recognition (SmearedHits, ShipGeo) |
| Template Matching. | |
| def | pat_rec_view (SmearedHits, int min_hits) |
| def | fast_hough_transform_pattern_recognition (SmearedHits, ShipGeo) |
| Fast Hough Transform. | |
| def | fast_hough_pat_rec_y_view (SmearedHits, int min_hits) |
| def | fast_hough_pat_rec_stereo_views (SmearedHits_stereo, recognized_tracks_y, int min_hits) |
| def | hit_in_bin (x, y, k_bin, b_bin, k_size, b_size) |
| def | artificial_retina_pattern_recognition (SmearedHits, ShipGeo) |
| def | artificial_retina_pat_rec_y_view (SmearedHits, int min_hits) |
| def | artificial_retina_pat_rec_stereo_views (SmearedHits_stereo, recognized_tracks_y, int min_hits) |
| def | get_best_seed (x, y, float sigma, sample_weight=None) |
| def | retina_func (track_prams, x, y, sigma, sample_weight=None) |
| def | retina_grad (track_prams, x, y, sigma, sample_weight=None) |
| def | hits_split (smeared_hits) |
| The End of the PatRec Methods. | |
| def | reduce_clones_using_one_track_per_hit (recognized_tracks, int min_hits=3) |
| def | tracks_combination_using_extrapolation (recognized_tracks_12, recognized_tracks_34, z_magnet) |
| def | _prepare_output (recognized_tracks_combo, min_hits) |
| bool | hit_in_window (x, y, k_bin, b_bin, window_width=1.0) |
| def | get_zy_projection (z, xtop, ytop, xbot, ybot, k_y, b_y) |
| def | pat_rec_stereo_views (SmearedHits_stereo, recognized_tracks_y, int min_hits) |
Variables | |
| str | __author__ = "Mikhail Hushchyn" |
| logging | logger = logging.getLogger(__name__) |
| list | ReconstructibleMCTracks = [] |
| list | theTracks = [] |
| float | r_scale = 1.0 |
| global_variables | max_x = global_variables.ShipGeo.strawtubes_geo.width |
|
protected |
Prepare PatRec output, filtering tracks with too few hits and preserving track parameters.
Definition at line 956 of file shipPatRec.py.
| def shipPatRec.artificial_retina_pat_rec_stereo_views | ( | SmearedHits_stereo, | |
| recognized_tracks_y, | |||
| int | min_hits | ||
| ) |
Definition at line 599 of file shipPatRec.py.
| def shipPatRec.artificial_retina_pat_rec_y_view | ( | SmearedHits, | |
| int | min_hits | ||
| ) |
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 517 of file shipPatRec.py.
| def shipPatRec.artificial_retina_pattern_recognition | ( | SmearedHits, | |
| ShipGeo | |||
| ) |
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 470 of file shipPatRec.py.
| def shipPatRec.execute | ( | smeared_hits, | |
| ship_geo, | |||
| str | method = "" |
||
| ) |
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 25 of file shipPatRec.py.
| def shipPatRec.fast_hough_pat_rec_stereo_views | ( | SmearedHits_stereo, | |
| recognized_tracks_y, | |||
| int | min_hits | ||
| ) |
Definition at line 331 of file shipPatRec.py.
| def shipPatRec.fast_hough_pat_rec_y_view | ( | SmearedHits, | |
| int | min_hits | ||
| ) |
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 249 of file shipPatRec.py.
| def shipPatRec.fast_hough_transform_pattern_recognition | ( | SmearedHits, | |
| ShipGeo | |||
| ) |
Fast Hough Transform.
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 202 of file shipPatRec.py.
| None shipPatRec.finalize | ( | ) |
Definition at line 58 of file shipPatRec.py.
| def shipPatRec.get_best_seed | ( | x, | |
| y, | |||
| float | sigma, | ||
sample_weight = None |
|||
| ) |
Definition at line 699 of file shipPatRec.py.
| def shipPatRec.get_zy_projection | ( | z, | |
| xtop, | |||
| ytop, | |||
| xbot, | |||
| ybot, | |||
| k_y, | |||
| b_y | |||
| ) |
Project a stereo straw hit onto the ZX plane using the Y-view track parameters.
A stereo straw is tilted: its top-end is at (xtop, ytop) and bottom-end at
(xbot, ybot), both at the same z. The Y-view track gives the y position at
this z as y_track = k_y * z + b_y. This function finds the x coordinate
where the straw wire crosses y_track by parameterising the wire as a line
in the XY plane and evaluating it at y = y_track.
Note: the caller passes (ytop, xtop, ybot, xbot) — the argument names here
are swapped relative to the geometric meaning because the call sites swap
the x/y coordinates. This is intentional: the straw wire is parameterised
as x(y), not y(x), because the stereo straws are nearly vertical.
Parameters
----------
z : float
Z coordinate of the hit.
xtop : float
First coordinate of wire top-end (actually ytop at call site).
ytop : float
Second coordinate of wire top-end (actually xtop at call site).
xbot : float
First coordinate of wire bottom-end (actually ybot at call site).
ybot : float
Second coordinate of wire bottom-end (actually xbot at call site).
k_y : float
Slope of the Y-view track: y = k_y * z + b_y.
b_y : float
Intercept of the Y-view track.
Returns
-------
y : float
The projected x coordinate of the hit in the ZX plane.
Definition at line 1030 of file shipPatRec.py.
| def shipPatRec.hit_in_bin | ( | x, | |
| y, | |||
| k_bin, | |||
| b_bin, | |||
| k_size, | |||
| b_size | |||
| ) |
Counts hits in a bin of track parameter space (b, k).
Parameters
---------
x : array-like
Array of x coordinates of hits.
y : array-like
Array of x coordinates of hits.
k_bin : float
Track parameter: y = k_bin * x + b_bin
b_bin : float
Track parameter: y = k_bin * x + b_bin
Return
------
track_inds : array-like
Hit indexes of a track: [ind1, ind2, ...]
Definition at line 430 of file shipPatRec.py.
| bool shipPatRec.hit_in_window | ( | x, | |
| y, | |||
| k_bin, | |||
| b_bin, | |||
window_width = 1.0 |
|||
| ) |
Check whether a hit falls within a window around a straight-line track.
Parameters
---------
x : float
Z coordinate of the hit.
y : float
Y (or projected X) coordinate of the hit.
k_bin : float
Track slope: y = k_bin * x + b_bin
b_bin : float
Track intercept: y = k_bin * x + b_bin
window_width : float
Half-width of the acceptance window in the y direction.
Return
------
flag : bool
True if the hit is within the window.
Definition at line 998 of file shipPatRec.py.
| def shipPatRec.hits_split | ( | smeared_hits | ) |
The End of the PatRec Methods.
Split hits into groups of station views.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 794 of file shipPatRec.py.
| None shipPatRec.initialize | ( | fgeo | ) |
Definition at line 21 of file shipPatRec.py.
| def shipPatRec.pat_rec_stereo_views | ( | SmearedHits_stereo, | |
| recognized_tracks_y, | |||
| int | min_hits | ||
| ) |
Definition at line 1075 of file shipPatRec.py.
| def shipPatRec.pat_rec_view | ( | SmearedHits, | |
| int | min_hits | ||
| ) |
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 120 of file shipPatRec.py.
| def shipPatRec.reduce_clones_using_one_track_per_hit | ( | recognized_tracks, | |
| int | min_hits = 3 |
||
| ) |
Split hits into groups of station views.
Parameters:
-----------
recognized_tracks : list
Track hits. Tracks = [{'hits_y': [hit1, hit2, hit3, ...]}, {...}, ...]
min_hits : int
Minimal number of hits per track.
Definition at line 843 of file shipPatRec.py.
| def shipPatRec.retina_func | ( | track_prams, | |
| x, | |||
| y, | |||
| sigma, | |||
sample_weight = None |
|||
| ) |
Calculates the artificial retina function value.
Parameters
----------
track_prams : array-like
Track parameters [k, b].
x : array-like
Array of x coordinates of hits.
y : array-like
Array of x coordinates of hits.
sigma : float
Standard deviation of hit form a track.
sample_weight : array-like
Hit weights used during the track fit.
Returns
-------
retina : float
Negative value of the artificial retina function.
Definition at line 720 of file shipPatRec.py.
| def shipPatRec.retina_grad | ( | track_prams, | |
| x, | |||
| y, | |||
| sigma, | |||
sample_weight = None |
|||
| ) |
Calculates the artificial retina gradient.
Parameters
----------
track_prams : array-like
Track parameters [k, b].
x : array-like
Array of x coordinates of hits.
y : array-like
Array of x coordinates of hits.
sigma : float
Standard deviation of hit form a track.
sample_weight : array-like
Hit weights used during the track fit.
Returns
-------
retina : float
Negative value of the artificial retina gradient.
Definition at line 753 of file shipPatRec.py.
| def shipPatRec.template_matching_pattern_recognition | ( | SmearedHits, | |
| ShipGeo | |||
| ) |
Template Matching.
Main function of track pattern recognition.
Parameters:
-----------
SmearedHits : list
Smeared hits. SmearedHits = [{'digiHit': key,
'xtop': xtop, 'ytop': ytop, 'z': ztop,
'xbot': xbot, 'ybot': ybot,
'dist': dist2wire, 'detID': detID}, {...}, ...]
Definition at line 69 of file shipPatRec.py.
| def shipPatRec.tracks_combination_using_extrapolation | ( | recognized_tracks_12, | |
| recognized_tracks_34, | |||
| z_magnet | |||
| ) |
Definition at line 877 of file shipPatRec.py.
|
private |
Definition at line 4 of file shipPatRec.py.
| logging shipPatRec.logger = logging.getLogger(__name__) |
Definition at line 11 of file shipPatRec.py.
| global_variables shipPatRec.max_x = global_variables.ShipGeo.strawtubes_geo.width |
Definition at line 18 of file shipPatRec.py.
| float shipPatRec.r_scale = 1.0 |
Definition at line 17 of file shipPatRec.py.
| list shipPatRec.ReconstructibleMCTracks = [] |
Definition at line 14 of file shipPatRec.py.
| list shipPatRec.theTracks = [] |
Definition at line 15 of file shipPatRec.py.