Class ShowerLikelihoodBuilder

Class Documentation

class ShowerLikelihoodBuilder

Tools to build shower shape likelihood.

This class contains functions to build distibutions needed to make shower likelihood functions to be used in the larfow shower reco code

This includes:

  • shower profile likelihood in 3D. its the location of charge deposited as a function of
    the distance along the trunk line and the perpendicular dist from the trunk line
  • brem segment impact param, distance to trunk line, cosine of pca between trunk lines

We fill a tree to later use to make distributions. Can feed it, single shower MC (best) or low energy neutrino. OK.

Public Functions

ShowerLikelihoodBuilder()

default constructor

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

process data for one event, retrieving data from larcv and larlite io managers

steps:

first we need to assemble true triplet points of showers

  • we start by masking out adc images by segment image, keeping shower pixels
  • then we pass the masked image into the triplet proposal algorithm, making true pixels
  • we filter out the proposals by true match + source pixel being on an electron (true ssnet label)

after ground truth points are made, we can build the calculations we want

Parameters
  • iolcv: LArCV IO manager
  • ioll: larlite IO manager

void _fillProfileHist(const std::vector<larlite::larflow3dhit> &truehit_v, std::vector<float> &shower_dir, std::vector<float> &shower_vtx)

Build a shower profile histogram using true shower hits.

we assume all hits belong to the shower. note: this code was intended to run on single shower events, in order to build a proper profile that we can use on multi-shower events.

this method populates the member histograms, _hll_weighted and _hll. to do: create profiles for different energies

Parameters
  • truehit_v: Collection of true shower hits
  • shower_dir: Vector describing initial 3D shower direction
  • shower_vtx: Vector giving 3D shower start point/vertex

void _dist2line(const std::vector<float> &ray_start, const std::vector<float> &ray_dir, const std::vector<float> &pt, float &radial_dist, float &projection)

function that calculates shortest distance from a point to a line.

the the line is defined by a start point and a ray.

Parameters
  • ray_start: Line 3D start point
  • ray_dir: Line 3D direction
  • pt: Test 3D point
  • radial_dist: Shortest distance between pt and line.
  • projection: Distance from start point of line to the closest distance segment along line.

void _make_truehit_clusters(std::vector<larlite::larflow3dhit> &truehit_v)

Make truehit clusters.

populates the member cluster container, cluster_v.

Parameters
  • truehit_v: Collection of true shower hits

int _find_closest_cluster(std::vector<int> &claimed_cluster_v, std::vector<float> &shower_vtx, std::vector<float> &shower_dir)

Find closest cluster to given shower start an direction.

Parameters
  • claimed_cluster_v: Clusters to search
  • shower_vtx: Vector giving 3D shower start point/vertex for which we find the closest cluster
  • shower_dir: Vector describing initial 3D shower direction. Not used.

void _analyze_clusters(std::vector<larlite::larflow3dhit> &truehit_v, std::vector<float> &shower_dir, std::vector<float> &shower_vtx)

Performs cluster-based analysis of true shower.

Gathers statistics we hope to use to relate shower fragment to shower trunks. note: this code was intended to run on single shower events, in order to build a proper profile that we can use on multi-shower events.

Parameters
  • truehit_v: Collection of true shower hits
  • shower_dir: Vector describing initial 3D shower direction
  • shower_vtx: Vector giving 3D shower start point/vertex

void _impactdist(const std::vector<float> &l_start, const std::vector<float> &l_dir, const std::vector<float> &m_start, const std::vector<float> &m_dir, float &impact_dist, float &proj_l, float &proj_m)

shortest distance between lines

Calculations referenced from: https://math.stackexchange.com/questions/2213165/find-shortest-distance-between-lines-in-3d

Parameters
  • l_start: Start of one line
  • l_dir: Direction of one line
  • m_start: Start of the other line
  • m_dir: Direction of the other line
  • impact_dist: Shortest distance between the two lines
  • proj_l: Where the shortest distance line is on the l-line relative to l_start
  • proj_m: where the shortest distance line is on the m-line relative to m_start

Public Members

larflow::prep::PrepMatchTriplets tripletalgo

class that produces spacepoints from the wire plane images

std::vector<cluster_t> cluster_v

container for clusters of true shower hits

int _trunk_cluster

index of cluster that is the trunk

std::vector<float> cluster_pcacos2trunk_v

cosine between first PC of sub-cluster and trunk cluster of a true shower

std::vector<float> cluster_dist2trunk_v

distance between sub-cluster and trunk-cluster

std::vector<float> cluster_impactdist2trunk_v

impact parameter between sub-cluster and trunk-cluster

larutil::SpaceChargeMicroBooNE *_psce

pointer to a copy of the space charge offset calculating algo

TH2F *_hll

2D likelihood distribution over distance along and perpendicular to the trunk’s first principle component

TH2F *_hll_weighted

likelihood weighed by R^2, the squared-distnce perpendicular from the trunk

TTree *_tree_cluster_relationships

tree containing observables between sub-cluster and trunk-cluster. used to build selection method

float _dist2trunk

distance of true vertex to the trunk

TTree *_tree_trunk_features

tree containing features that characterize the shower-trunk cluster, to help select trunk from sub-clusters