Class CRTTrackMatch

Nested Relationships

Inheritance Relationships

Base Type

  • public larcv_base

Class Documentation

class CRTTrackMatch : public larcv_base

Match CRTTrack objects to lines of charge in the image.

The larlite::crttrack object contains the (x,y,z) positions of two CRT hits conincident at some time ‘t’. We can use the two spatial coordinates to draw a line through the TPC and look for charge along that line. The ‘t’ can be used to match with an optical flash. To match the straight-line track with an ionization track, we assume that no scattering has occured to change the path. We take into account space charge effects that will distort the path of the apparent path of the track. We also account for potential uncertainty in the CRT hit positions by varying the hit positions to make the best fit of the predicted ionization trajectory with one found in the image.

Public Functions

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

process the event data found in the larcv and larlite event data containers

What is expected in the LArCV IOManager:

  • wire images. set tree name using setADCtreename. default: ‘wire’.

What is expected in the larlite storage_manager:

  • larlite::crttrack objects. default tree name: crttrack.
  • larlite::opflash objects. default trees: simpleFlashBeam, simpleFlashCosmic.

The function will fill the following member variables.

  • _fitted_crttrack_v: result of crt track finder
  • _matched_opflash_v: opflashes matched to tracks in _fitted_crttrack_v
  • _modified_crttrack_v: the crt track after a fit has optimized the end points to better fit line of charge in TPC.
  • _cluster_v: 3D pixels

Parameters
  • iolcv: LArCV IOManager from which we get event data containers
  • ioll: larlite storage_manaer from which we get event data containers

void set_max_iters(int tries)

set the number of iterations to adjust CRT track to better match ionization in image

void set_col_neighborhood(int cols)

set pixel distance from projected track to search for nearest pixel with charge

void set_max_fit_step_size(float cm)

set maximum step length along CRT-track path while projecting path into image

void set_max_last_step_size(float cm)

set final pass maximum step length along CRT-track path while projecting path into image

void make_debug_images(bool make_debug)

set flag that determines if pngs are made for debugging purposes

void save_to_file(larlite::storage_manager &ioll, bool remove_if_no_flash = true)

save information into larlite::storage_manager

void clear_output_containers()

clear the output data containers

clears

  • _fitted_crttrack_v
  • _matched_opflash_v
  • _modified_crttrack_v
  • _cluster_v

CRTTrackMatch::crttrack_t _find_optimal_track(const larlite::crttrack &crt, const std::vector<larcv::Image2D> &adc_v)

vary CRT hit position and optimizing path in TPC to be close to charge pixels

Return
CRT track object that is a modified copy of input CRT track, where the end points are those found from the fit.
Parameters
  • crt: CRT track object giving two coincident (x,y,z) positions on CRT
  • adc_v: vector of wire plane images in which we look for matching lines of charge

CRTTrackMatch::crttrack_t _collect_chargepixels_for_track(const std::vector<double> &hit1_pos, const std::vector<double> &hit2_pos, const float t0_usec, const std::vector<larcv::Image2D> &adc_v, const float max_step_size, const int col_neighborhood)

collect pixels with above threshold values along path between crt hits

Return
instance of internal struct crttrack_t, which stores info about pixels along path
Parameters
  • hit1_pos: 3D position of the first CRT hit
  • hit2_pos: 3D position of the secoond CRT hit
  • t0_usec: time relative to the event trigger when CRT track occurred
  • adc_v: wire plane images wthin which we search for line of charge between CRT hits
  • max_step_size: Maximum step size when stepping in 3D.
  • col_neighborhood: Number of neighboring pixels around projected 3D position of track into the image which should be used to sum up charge

bool _propose_corrected_track(const CRTTrackMatch::crttrack_t &old, std::vector<double> &hit1_new, std::vector<double> &hit2_new)

propose path through image of track defined by CRT track

bool _crt_intersections(larflow::reco::cluster_t &track_cluster, const larlite::crttrack &orig_crttrack, std::vector<std::vector<double>> &panel_pos_v, std::vector<double> &dist2_original_hits)

calculate where a track intersects the CRT if continued to the CRT

The track used in this calculation is a result of 3d points generated in _propose_corrected_track based off the set of closest pixels to a crt-track path in each plane found in _collect_chargepixels_for_track.

The first principle component of the cluster is used to define a new line which we intersect with the CRT.

Return
True if good hit; else False because track was parallel to CRT
Parameters
  • track_cluster: cluster of 3d points whose pca axis we use to intersect with CRT
  • orig_crttrack: Original crt track instance used for each
  • panel_pos_v: Two intersection points with the CRT
  • dist2_original_hits: Distance of the new intersection points to the original CRT hits

std::string _str(const CRTTrackMatch::crttrack_t &data)

get string containing info about a crttrack_t instance

Return
string containing info about instance
Parameters
  • data: crttrack_t instance for which we dump out info

void _matchOpflashes(std::vector<const larlite::event_opflash *> flash_vv, const std::vector<CRTTrackMatch::crttrack_t> &tracks_v, std::vector<larlite::opflash> &matched_opflash_v)

match opflashes to crttrack_t using closest time

ties are broken based on closest centroids based on pca-center of tracks and charge-weighted mean of flashes the crttrack_t objects are assumed to have been made in _find_optimal_track(…)

larlite::larflowcluster _crttrack2larflowcluster(const CRTTrackMatch::crttrack_t &fitdata)

store spacepoint infofrom crttrack_t data in a larlite::larflowcluster object

Return
larlite::larflowcluster instance containing larlite::larflow3dhit objects
Parameters
  • fitdata: crttrack_t instance produced from the fit

void setADCtreename(std::string treename)

set image2d tree to get wire iages from

Parameters
  • treename: Name of ROOT tree

const std::vector<larlite::larflowcluster> &getClusters()

get container of matched track clusters

Public Members

larutil::SpaceChargeMicroBooNE *_sce

pointer to space charge correction class

larutil::SpaceChargeMicroBooNE *_reverse_sce

pointer to reverse space charge correction class

int _max_iters

algorithm parameters

max attempts to improve CRT track fit

int _col_neighborhood

window to search for charge around track

float _max_fit_step_size

max step size when fittering

float _max_last_step_size

max step size for final fit

float _max_dt_flash_crt

maximum time difference (usec) between opflash and crttrack

std::string _adc_producer

name of ADC image tree

std::string _crttrack_producer

name of CRT track producer

std::vector<std::string> _opflash_producer_v

names of opflash producers to search for matching flashes

bool _make_debug_images

if true, dump debugging pngs

Protected Attributes

std::vector<crttrack_t> _fitted_crttrack_v

Set Image2D tree to get wire images from.

products of algorithm result of crt track fitter

std::vector<larlite::opflash> _matched_opflash_v

opflashes matched to tracks in _fitted_crttrack_v

std::vector<larlite::crttrack> _modified_crttrack_v

crttrack object with modified end points

std::vector<larlite::larflowcluster> _cluster_v

collections of larflow3dhit close to the 3D line

struct crttrack_t

internal struct to contaning info extracted by projecting CRT track into the wire plane images

Public Functions

crttrack_t()
crttrack_t(int idx, const larlite::crttrack *ptrack)

constructor

Parameters
  • idx: Index of CRT track object in event container used
  • ptrack: Pointer to CRT track object

Public Members

int crt_track_index

index in event container of larlite::crttrack object

const larlite::crttrack *pcrttrack

pointer to original CRT track object

std::vector<std::vector<double>> hit_pos_vv

modified CRT hit positions (after fit)

std::vector<std::vector<int>> pixellist_vv[3]

(row,col) of pixel nearest SC-corrected path for each plane (3 planes total)

std::vector<float> pixelrad_vv[3]

pixel dist from nearest charge pixel to projected pixel along crt-track line for each plane (3 planes total)

std::vector<std::vector<double>> pixelpos_vv

list of 3D SC-corrected positions along the crt-track line

std::vector<std::vector<int>> pixelcoord_vv

list of pixel coordinates (U col, V col, Y col, tick)

std::vector<float> totalq_v

total charge of closest pixels around crt-track line per plane

std::vector<float> toterr_v

total pixel dist to closest pixels along crt-track line per plane

float len_intpc_sce

path length of the reconstructed path inside the TPC

float t0_usec

time relative to beam window start in microsecond of CRT track

int opflash_index

index of matched opflash in event container

const larlite::opflash *opflash

pointer to opflash object