Class FlowTriples

Nested Relationships

Class Documentation

class FlowTriples

Generate and store (U,V,Y) wire combintations extracted from examining coincident ionization between two planes.

Revision history 2020/07/22: Added doxygen documentation.

Author
Taritree Wongjirad (taritree.wongjirad@tufts.edu)
Date
$Data 2020/07/22 17:00$

Public Functions

FlowTriples()
FlowTriples(int source_plane, int target_plane, const std::vector<larcv::Image2D> &adc_v, const std::vector<larcv::Image2D> &badch_v, float threshold, bool save_index)

generate list of possible combinations of (U,V,Y) intersections given source to target plane matching.

this version takes image2d as input

Parameters
  • source: The source plane index, where we start the match with a pixel above threshold.
  • target: The target plane index, where we match to pixels above threshold
  • adc_v: Vector of image pixel values
  • badch_v: Vector of images labeling bad channels
  • threshold: Pixels that we consider must be above this value
  • save_index: If true, we save the index of the pixel in the sparse matrix representation. If false, we save the image col posiiton. Saving the col position requires searching the sparse matrix entries, but one can append to matrix. Saving the index requires no searching, but look-up is broken if matrix is changed.

FlowTriples(int source, int target, const std::vector<larcv::Image2D> &adc_v, const std::vector<larcv::Image2D> &badch_v, const std::vector<std::vector<PixData_t>> &sparseimg_vv, float threshold, bool save_index)

generate list of possible combinations of (U,V,Y) intersections given source to target plane matching.

this version takes the sparse matrix representation of the image, skipping its generation

Parameters
  • source: The source plane index, where we start the match with a pixel above threshold.
  • target: The target plane index, where we match to pixels above threshold
  • adc_v: Vector of image pixel values
  • badch_v: Vector of images labeling bad channels
  • sparseimg_vv: Sparse representation (i.e. list of pixels) for each plane.
  • threshold: Pixels that we consider must be above this value
  • save_index: If true, we save the index of the pixel in the sparse matrix representation. If false, we save the image col posiiton. Saving the col position requires searching the sparse matrix entries, but one can append to matrix. Saving the index requires no searching, but look-up is broken if matrix is changed.

virtual ~FlowTriples()
int nsourceIndices() const

number of pixels in the source image

int get_source_plane_index()

index of the source plane considered

int get_target_plane_index()

index of the target plane considered

int get_other_plane_index()

index of the other (not source or target) plane considered

std::vector<TH2D> plot_triple_data(const std::vector<larcv::Image2D> &adc_v, const std::vector<std::vector<PixData_t>> &sparseimg_vv, std::string hist_stem_name)

use a th2d to plot the projected locations of the triplets in each of the planes

utility function to help with visual debugging

Parameters
  • adc_v: Vector of image pixel values
  • sparseimg_vv: Sparse representation (i.e. list of pixels) for each plane.
  • hist_stem_name: Stem of histogram name generated.

std::vector<TH2D> plot_sparse_data(const std::vector<larcv::Image2D> &adc_v, const std::vector<std::vector<PixData_t>> &sparseimg_vv, std::string hist_stem_name)

make a TH2D in order to visualize the sparse matrix data

utility function to help with visual debugging

Parameters
  • adc_v: Vector of image pixel values
  • sparseimg_vv: Sparse representation (i.e. list of pixels) for each plane.
  • hist_stem_name: Stem of histogram name generated.

std::vector<std::vector<PixData_t>> &getDeadChToAdd()

get pixels in each plane that are dead

std::vector<std::vector<int>> &getTriples()

get the combination of three wires with coincident charge seen

Public Static Functions

std::vector<std::vector<FlowTriples::PixData_t>> make_initial_sparse_image(const std::vector<larcv::Image2D> &adc_v, float threshold)

convert the wire image data into a sparse represntation

we convert the image into a vector of PixData_t objects.

Return
Vector of images in sparse representation (i.e. a list of pixels above threshold)
Parameters
  • adc_v: Vector of image pixel values
  • threshold: Keep only pixels with value above this threshold

Protected Functions

void _makeTriples(int source, int target, const std::vector<larcv::Image2D> &adc_v, const std::vector<larcv::Image2D> &badch_v, const std::vector<std::vector<PixData_t>> &sparseimg_vv, float threshold, bool save_index)

using the list of pixels in the sparse matrix representation, build the list of possible three-plane triplets

Parameters
  • source: The source plane index, where we start the match with a pixel above threshold.
  • target: The target plane index, where we match to pixels above threshold
  • adc_v: Vector of image pixel values
  • badch_v: Vector of images labeling bad channels
  • sparseimg_vv: Sparse representation (i.e. list of pixels) for each plane.
  • threshold: Pixels that we consider must be above this value
  • save_index: If true, we save the index of the pixel in the sparse matrix representation. If false, we save the image col posiiton. Saving the col position requires searching the sparse matrix entries, but one can append to matrix. Saving the index requires no searching, but look-up is broken if matrix is changed.

Protected Attributes

int _source_plane

index of the source plane considered

int _target_plane

index of the target plane considered

int _other_plane

index of the other (non-source, non-target) plane considered

std::vector<std::vector<PixData_t>> _sparseimg_vv

stores non-zero pixel information for each plane

std::vector<std::vector<int>> _triple_v

combination of three wire plane pixels with coincident charge

std::vector<std::vector<PixData_t>> _deadch_to_add

list of dead channels in each plane

struct PixData_t

internal struct to represent to a pixel and provide sorting method

Public Functions

PixData_t()
PixData_t(int r, int c, float v)

constructor with row, col, value

Parameters
  • r: row of pixel
  • c: col of pixel
  • v: value of pixel

bool operator<(const PixData_t &rhs) const

comparator based on row then col then value

Public Members

int row

row of pixel in image

int col

col of pixel in image

float val

value of pixel

int idx

index in container