Class ProjectionDefectSplitter¶
- Defined in File ProjectionDefectSplitter.h
Class Documentation¶
-
class
ProjectionDefectSplitter
: public larcv_base¶ Splits 3D clusters by projecting into 2D and breaking cluster based on cluster defect points.
This is a way to try and produce very straight clusters, which we can then piece back together to make tracks.
Public Functions
-
ProjectionDefectSplitter
()¶ default construct
-
virtual
~ProjectionDefectSplitter
()¶
-
void
process
(larcv::IOManager &iolc, larlite::storage_manager &ioll)¶ run algorithm on LArCV/larlite data products for current event
Expects the following input data products:
- larflow3dhits in ioll from tree name stored in _input_lfhit_tree_name: These are the hits we will cluster
- wire images from larcv tree named “wire”: will use these images to do 2D contour analysis
Produces the following output products:
- larflowcluster stored in tree _output_cluster_tree_name: the clusters formed by dbscan and split with contour defect analysis
- pcaxis stored in tree named _output_cluster_tree_name: the principle components of the clusters made
- larflow3dhit container named “projsplitnoise”: all the hits that were not clustered.
- Parameters
iolcv
: LArCV IO managerioll
: larlite IO manager
-
int
split_clusters
(std::vector<cluster_t> &cluster_v, const std::vector<larcv::Image2D> &adc_v, const float min_second_pca_len)¶ split clusters using 2D contours.
Is a static function, allowing other routines to use this algorithm.
- Return
- The number of times a cluster was split
- Parameters
cluster_v
: Vector of space point clustersadc_v
: Wire plane images we will project space points into. Will do defect analysis on these 2D images.min_second_pca_len
: Minimum second PC axis eigenvalue to perform split. Else returns cluster as is.
-
void
set_input_larmatchhit_tree_name
(std::string name)¶ set name of tree with larflow3dhit instnces to cluster
-
void
set_output_tree_name
(std::string name)¶ set name of the tree to write output clusters
-
void
set_min_larmatch_score
(float min_score)¶ set minimum larmatch score must have to be included in clusters
-
void
set_dbscan_pars
(float maxdist, int minsize, int maxkd)¶ set the dbscan parameters for clustering
- Parameters
maxdist
: maximum distance two spacepoints can be connected for dbscanminsize
: minimum cluster size for dbscanmaxkd
: max number of neighbors per spaecepoint for dbscan
Protected Functions
-
larlite::larflowcluster
_makeLArFlowCluster
(cluster_t &cluster, const larlite::event_larflow3dhit &source_lfhit_v)¶ convert cluster_t instance into a larflowcluster instance
-
cluster_t
_absorb_nearby_hits
(const cluster_t &cluster, const std::vector<larlite::larflow3dhit> &hit_v, std::vector<int> &used_hits_v, float max_dist2line)¶ Because cluster is down on downsampled points at times, we absorb hits close to the cluster from the original set of hits.
- Return
- A new cluster with additional hits added to the given cluster
- Parameters
cluster
: Cluster made with downsampled hitshit_v
: The original (not-downsaampled) set of hits used to make the given clusterused_hits_v
: Vector same size as hit_v where value is 1 if hit is already assigned to cluster. Hits assigned by this call of the function to the cluster will have their flags set to 1.max_dist2line
: Maximum distance from a point to the first principle component axis of the given cluster.
-
void
_runSplitter
(const larlite::event_larflow3dhit &inputhits, const std::vector<larcv::Image2D> &adc_v, std::vector<int> &used_hits_v, std::vector<cluster_t> &output_cluster_v)¶ run 2d contour defect analysis
Our aim is to produce straight clusters that we can later piece together into tracks.
Given a set of hits, we first downsample (if needed). The downsampled hits are clustered. Hits for the clusters are projected into the 2D images. Those 2D pixels are used to make 2d contours. The 2D contours are split using defect analysis. Based on which space points are in which contours, the 3D cluster is split if the first second principle component is smaller.
- Parameters
inputhits
: The input spacepoints in the form or larflow3dhit instancesadc_v
: The wire plane imagesused_hits_v
: Vector same length as inputs which indicates if the hit has been assigned to a cluster. This function updates this vector.output_cluster_v
: Vector of output clusters
-
void
_defragment_clusters
(std::vector<cluster_t> &cluster_v, const float max_2nd_pca_eigenvalue)¶ recluster clusters with large 2nd pca eigenvalues
this is meant to clean up clusters that have been split into many pieces which sometimes leaves weird clusters behind.
- Parameters
cluster_v
: All the current clustersmax_2nd_pca_eigenvalue
: The maximum length of the second largest principle component
Protected Attributes
-
std::string
_input_lfhit_tree_name
¶ name of tree to get larflow hits to cluster
-
std::string
_output_cluster_tree_name
¶ name of tree to store output clusters
-
float
_min_larmatch_score
¶ minimum larmatch score spacepoint must have to be included
-
float
_maxdist
¶ maximum distance two spacepoints can be connected for dbscan
-
int
_minsize
¶ minimum cluster size for dbscan
-
int
_maxkd
¶ max number of neighbors per spaecepoint for dbscan
-