Class KeypointReco¶
- Defined in File KeypointReco.h
Class Documentation¶
-
class
KeypointReco
: public larcv_base¶ Produce keypoints from scores made by larmatch keypoint network.
Public Functions
-
KeypointReco
()¶ default constructor
-
virtual
~KeypointReco
()¶
-
void
set_param_defaults
()¶ set default parameter values
-
void
set_keypoint_threshold
(float threshold, int pass = 0)¶ set keypoint threshold score for a given pass
-
void
set_larmatch_threshold
(float threshold)¶ set larmatch threshol score
-
void
set_sigma
(float sigma)¶ set sigma dictating how fast score drops off
-
void
set_min_cluster_size
(int minsize, int pass = 0)¶ set minimum cluster size when clustering around keypoint
-
void
set_num_passes
(int npasses)¶ set number of passes
-
void
set_max_dbscan_dist
(float dist)¶ set maximum distance two spacepoints can be before not being connected
-
void
set_max_clustering_points
(int maxpts)¶ set maximum nunmber of clustering points
-
void
set_keypoint_type
(int kptype)¶ set keypoint type we are reconstucting with this class
-
void
set_input_larmatch_tree_name
(std::string name)¶ set name of tree with larmatch larflow3dhits
-
void
set_output_tree_name
(std::string name)¶ set output tree name with keypoints stored as larflow3dhits
-
void
set_lfhit_score_index
(int idx)¶ set index of feature vector of larflow3dhit where larmatch score is stored
-
void
process
(larlite::storage_manager &io_ll)¶ take in storage manager, get larflow3dhits, which stores keypoint scores, make candidate KPCluster, and store them as larflow3dhit
-
void
process
(const std::vector<larlite::larflow3dhit> &input_lfhits)¶ take in larflow3dhits, which stores keypoint scores, and make candidate KPCluster
- Parameters
input_lfhits
: Vector of larflow3dhit with larmatch and keypoint scores
-
void
dump2json
(std::string outfilename = "dump_keypointreco.json")¶ dump output to json for development
- Parameters
outfilename
: Path of json file to write output to
-
void
_make_initial_pt_data
(const std::vector<larlite::larflow3dhit> &lfhits, const float keypoint_score_threshold, const float larmatch_score_threshold)¶ scan larflow3dhit input and assemble 3D keypoint data we will work on.
we select points by filttering based on the score_threshold. clears and fills:
- _initial_pt_pos_v;
- _initial_pt_used_v;
- Parameters
lfhits
: LArFlow hits with keypoint network infokeypoint_score_threshold
: Only cluster hits with keypoint score above this thresholdlarmatch_score_threshold
: Only cluster hits with larmatch score above this threshold
-
void
_make_kpclusters
(float round_score_threshold, int min_cluster_size)¶ Make clusters with remaining points.
fills member cluster container, output_pt_v. internal data members used:
- _initial_pt_pos_v: the list of points (x,y,z,current score)
- _initial_pt_used_v: ==1 if the point has been claimed
- Parameters
keypoint_score_threshold
: Keypoint score thresholdmin_cluster_size
: Minimum size of keypoint hit cluster
-
void
_skim_remaining_points
(float score_threshold, std::vector<std::vector<float>> &skimmed_pt_v, std::vector<int> &skimmed_index_v)¶ get list of points to cluster above threshold
- Parameters
keypoint_score_threshold
: Keep points above threshold.skimmed_pt_v
: Returned 3D points.skimmed_index_v
: Index of point in the Original Point list, _initial_pt_pos_v.
-
KPCluster
_characterize_cluster
(cluster_t &cluster, std::vector<std::vector<float>> &skimmed_pt_v, std::vector<int> &skimmed_index_v)¶ Characterize the keypoint cluster.
we take the cluster we’ve made using dbscan and make a KPCluster object we define the centroid using a weighted score we define the pca as well, to help us absorb points
- Return
- Keypoint cluster represented as KPCluster object
- Parameters
cluster
: Cluster to characterizeskimmed_pt_v
: Points used to clusterskimmed_index_v
: Index of point in the Original Point list, _initial_pt_pos_v.
-
void
_expand_kpcluster
(KPCluster &kp)¶ we absorb points to clusters, using pca-line, proximity, and confidence score
unwritten
- Parameters
kp
: KPCluster object to expand
-
void
printAllKPClusterInfo
()¶ Dump all cluster info to standard out.
prints info for clusters in output_pt_v. calls KPCluster::printInfo()
-
void
bindKPClusterContainerToTree
(TTree *out)¶ make branch with pointer to output cluster container
Adds a single branch,
kpcluster_v
, to the given ROOT TTree. The branch will hold a vector of KPCluster objects. The branch is given a pointer to the member container output_pt_v.- Parameters
out
: ROOT TTree to add branch to
-
void
setupOwnTree
()¶ create TTree instance in class and use it to store output container contents
Creates tree named
larflow_keypointreco
and adds branch with KPCluster objects via bindKPClusterContainerToTree().
-
void
writeTree
()¶ write _output_tree to ROOT file if defined
-
void
fillTree
()¶ fill entry data in _output_tree
Public Members
-
std::vector<std::vector<float>>
_initial_pt_pos_v
¶ initial points we are searching (x,y,z,score)
-
std::vector<int>
_initial_pt_used_v
¶ flag indicating point is used
Protected Attributes
-
float
_sigma
¶ width of keypoint. used to supress neighbor keypoints
-
float
_larmatch_score_threshold
¶ ignore spacepoints with larmatch score below this values
-
int
_num_passes
¶ number of passes to perform
-
std::vector<float>
_keypoint_score_threshold_v
¶ ignore spacepoints with keypoint score below this values, threshold for each pass
-
std::vector<int>
_min_cluster_size_v
¶ minimum cluster size to be a vertex (cluster of hits above threshold)
-
float
_max_dbscan_dist
¶ max distance parameter in DBscan used
-
int
_max_clustering_points
¶ maximum number of points to use when clustering. if have more, sampled randomly.
-
std::string
_input_larflowhit_tree_name
¶ name of the input container tree with larflow hits to use
-
std::string
_output_tree_name
¶ name of the output container tree to put keypoints in
-
int
_keypoint_type
¶ label of keypoint type we’re making
-
int
_lfhit_score_index
¶ index of column in larflow3d hit info vector with keypoint score
-
TTree *
_output_tree
¶ point to tree where output is saved. optional.
-