Class ShowerRecoKeypoint

Inheritance Relationships

Base Type

  • public larcv_base

Class Documentation

class ShowerRecoKeypoint : public larcv_base

Reconstruct a shower using shower-labeled clusters.

Public Functions

ShowerRecoKeypoint()
virtual ~ShowerRecoKeypoint()
void process(larcv::IOManager &iolcv, larlite::storage_manager &ioll)

process shower clusters produced by PCA cluster algo

Steps:

  • form shower (sub)clusters using dbscan
  • identify which clusters are potentially the shower trunk using output keypoint network
  • build showers from these trunk clusters by associating the subclusters to the trunk clusters
  • for clusters assigned to two shower candidates, resolve conflicts
  • make reco shower object

Expected inputs:

  • shower-labeled larflow3dhit. The class larflow::reco::SplitHitsBySSNet produces these.
  • keypoint: container of larflow3dhit representing reconstructed keypoints. These are made by larflow::reco::KeypointReco.
    uses only the shower-labeled keypoints.

Outputs:

  • showergoodhit: collection of larflowcluster holding reconstruced shower clusters
  • showergoodhit: collection of pcaxis holding principle component info for clusters
  • showerkp: larflowcluster representing showers built using keypoint-identified trunk clusters
  • showerkp: pcaxis containing principle component info for the showerkp clusters
  • showerkp: larflow3dhit representing the shower keypoints used

To do: make assignment of shower (sub)clusters to a trunk cluster via a shower likelihood of some kind, instead of just distance and proximinty to trunk direction.

Parameters
  • iolcv: LArCV IOManager, nothing retrieved from here.
  • ioll: larlite storage_manager

void set_ssnet_lfhit_tree_name(std::string name)

set name of input larflow3dhit tree to use

void set_larmatch_score_threshold(float thresh)

set larmatch score threshold

Protected Functions

void _reconstructClusterTrunks(const std::vector<const cluster_t *> &showercluster_v, const std::vector<const larlite::larflow3dhit *> &keypoint_v)

match keypoints to shower clusters, use to define the trunk

we match keypoints to shower clusters. for each keypoint assigned to cluster, define 1,3,5 cm hit cluster around each keypoint. going from 5,3,1 cm clusters, accept pca-axis based on eigenvalue ratio between first and second principle component.

use log likelihood function to pick best key-point trunk. output is shower cluster, keypoint, and trunk cluster.

note: might want to move keypoint based on pca end near keypoint.

This method populates the _shower_cand_v data member.

Parameters
  • showercluster_v: Clusters made from shower-labeled spacepoints
  • keypoint_v: Keypoints from the keypoint network

void _buildShowers(const std::vector<const cluster_t *> &showerhit_cluster_v)

build out shower cluster from trunk candidates

for each shower cluster with trunk candidate, we absorb points clusters that are within some radius of the trunk axis.

we use the candidates held in _shower_cand_v that were made in _reconstructClusterTrunks().

first step is to associate other clusters to the shower candidates based on pc axes using _buildShowerCandidate().

for showers that try to claim the same cluster, we do some tests to resolve which is the real shower trunk using _chooseBestShowerForCluster().

the real shower trunk gets to claim the conflicted clusters.

once conflicts are resolved, the reco. showers get to claim additional unclaimed hits using _fillShowerObject().

This method fills _recod_shower_v, which contains our reconstructed showers.

Parameters
  • showerhit_cluster_v: The clusters made from shower-labeled spacepoints.

ShowerRecoKeypoint::Shower_t _buildShowerCandidate(const ShowerCandidate_t &shower_cand, const std::vector<const cluster_t *> &showerhit_cluster_v)

build out a shower starting with trunk candidates

we build a shower from a shower candidate, by building out the shower using each trunk candidate and selecting the best shower somehow

Return
A reconstructed shower candidate
Parameters
  • shower_cand: Shower trunk candidate.
  • showerhit_cluster_v: All the shower clusters

std::set<int> _buildoutShowerTrunkCandidate(const ShowerTrunk_t &trunk_cand, const std::vector<const cluster_t *> &showerhit_cluster_v)

build out the shower using the trunk candidate

we absorb shower hits within some radius of the axis. we track the shower hit indexes as well.

Parameters
  • trunk_cand: Shower trunk candidate
  • showerhit_cluster_v: all the shower clusters

ShowerRecoKeypoint::Shower_t _fillShowerObject(const ShowerCandidate_t &shower_cand, const std::set<int> &cluster_idx_set, const int trunk_idx, const std::vector<const cluster_t *> &showerhit_cluster_v)

assemble reconstructd shower from verious ingredients

Return
Reconstructed shower object
Parameters
  • shower_cand: Shower candidate
  • cluster_idx_set: Indices to showerhit_cluster_v that are assigned to this reco shower
  • trunk_idx: Shower trunk used to build this shower
  • showerhit_cluster_v: All the shower clusters in the event

void _fillShowerObject(Shower_t &shower, const std::vector<const cluster_t *> &showerhit_cluster_v)

get hits of reconstructed shower from original shower clusters

Parameters
  • shower: Reconstructed shower object
  • showerhit_cluster_v: Original shower clusters

int _chooseBestTrunk(const ShowerCandidate_t &shower_cand, const std::set<int> &cluster_idx_v, const std::vector<const cluster_t *> &showerhit_cluster_v)

Choose which trunk candidates within a shower candidate is correct.

Return
index of the best trunk candidate
Parameters
  • shower_cand: The shower candidate under consideration
  • cluster_idx_v: Indices of showerhit_cluster_v for clusters associated to the shower candidate
  • showerhit_cluster_v: all of the original shower clusters

int _chooseBestShowerForCluster(const cluster_t &cluster, const std::set<int> &shower_idx_v, const std::vector<const cluster_t *> &showerhit_cluster_v)

resolve which shower to assign cluster originally assigned to more than one

Return
index of the best shower candidate to assign cluster
Parameters
  • cluster: Shower cluster in question
  • shower_idx_v: Index of shower candidates that the cluster has been assigned to
  • showerhit_cluster_v: All the shower clusters

Protected Attributes

std::vector<ShowerCandidate_t> _shower_cand_v

collection of shower (sub)clusters+trunk forming a shower candidate

std::vector<Shower_t> _recod_shower_v

final set of reconstructed showers

std::string _ssnet_lfhit_tree_name

name of tree to get input larflow3dhit

float _larmatch_score_threshold

threshold of larmatch score to use larflow3dhit

struct Shower_t

represents final shower reconstructed object

Public Members

ShowerTrunk_t trunk

trunk info

std::set<int> cluster_idx

set of shower cluster idx

std::vector<std::vector<float>> points_v

3d points assigned to shower

std::vector<int> hitidx_v

hit idx of 3d hits corresponding to input larflow3dhit vector

struct ShowerCandidate_t

internal type representing a cluster and trunks that might be associated to it.

Public Members

int cluster_idx

index of shower cluster

const cluster_t *cluster

pointer to shower cluster

std::vector<ShowerTrunk_t> trunk_candidates_v

possible trunks that this cluster is a part of

struct ShowerTrunk_t

internal type representing a shower trunk

Public Functions

ShowerTrunk_t()

Public Members

int idx_keypoint

index of keypoint in the event container

const larlite::larflow3dhit *keypoint

pointer to keypoint object used to seed this trunk

std::vector<float> pcaxis_v

first principle component of cluster

std::vector<float> center_v

centroid of cluster

std::vector<float> start_v

start point of trunk

float pca_eigenval_ratio

ratio of second to first principle component eigenvalue

int npts

number of spacepoints in trunk cluster

float gapdist

distance from keypoint

float impact_par

distance of first principle component to keypoint