DeepLearningTrackShowerIdAlgorithm class. More...
#include <DlVertexingAlgorithm.h>
Classes | |
class | VertexTuple |
Public Types | |
typedef std::map< std::pair < int, int >, std::vector < const pandora::CaloHit * > > | PixelToCaloHitsMap |
Public Member Functions | |
DlVertexingAlgorithm () | |
Default constructor. More... | |
virtual | ~DlVertexingAlgorithm () |
Private Types | |
typedef std::pair< int, int > | Pixel |
typedef std::vector< Pixel > | PixelVector |
Private Member Functions | |
pandora::StatusCode | Run () |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
pandora::StatusCode | PrepareTrainingSample () |
pandora::StatusCode | Infer () |
pandora::StatusCode | MakeNetworkInputFromHits (const pandora::CaloHitList &caloHits, LArDLHelper::TorchInput &networkInput, PixelVector &pixelVector) const |
pandora::StatusCode | MakeWirePlaneCoordinatesFromPixels (const pandora::CaloHitList &caloHits, const PixelVector &pixelVector, pandora::CartesianPointVector &positionVector) const |
pandora::StatusCode | MakeWirePlaneCoordinatesFromCanvas (const pandora::CaloHitList &caloHits, float **canvas, const int canvasWidth, const int canvasHeight, const int columnOffset, const int rowOffset, pandora::CartesianPointVector &positionVector) const |
void | GetCanvasParameters (const LArDLHelper::TorchOutput &networkOutput, const PixelVector &pixelVector, int &columnOffset, int &rowOffset, int &width, int &height) const |
Determines the parameters of the canvas for extracting the vertex location. The network predicts the distance that each pixel associated with a hit is located from the vertex, but says nothing about the direction. As a result, the ring describing the potential vertices associated with that hit can extend beyond the original canvas size. This function returns the size of the required canvas and the offset for the bottom left corner. More... | |
void | DrawRing (float **canvas, const int row, const int col, const int inner, const int outer, const float weight) const |
Add a filled ring to the specified canvas. The ring has an inner radius based on the minimum predicted distance to the vertex and an outer radius based on the maximum predicted distance to the vertex. The centre of the ring is the location of the hit used to predict the distance to the vertex. Each pixel to be filled is augmented by the specified weight. In this way, once all hits have been considered, a consensus view emerges of the likely vertex location based on the overlap of various rings centred at different locations. More... | |
void | Update (const int radius, int &col, int &row) const |
Update the coordinates along the loci of a circle. When drawing the ring we need an efficient means to determine the next pixel defining the inner and outer loci of the ring. This update function uses the Bresenham midpoint circle update function to determine this location. The row position is always incremented by 1 pixel, the column position is left unchanged, or decremented by 1 pixel to best follow the arc of the true underlying circle. More... | |
pandora::StatusCode | GetMCToHitsMap (LArMCParticleHelper::MCContributionMap &mcToHitsMap) const |
pandora::StatusCode | CompleteMCHierarchy (const LArMCParticleHelper::MCContributionMap &mcToHitsMap, pandora::MCParticleList &mcHierarchy) const |
void | GetHitRegion (const pandora::CaloHitList &caloHitList, float &xMin, float &xMax, float &zMin, float &zMax) const |
pandora::StatusCode | MakeCandidateVertexList (const pandora::CartesianPointVector &positions) |
Create a vertex list from the candidate vertices. More... | |
void | GetTrueVertexPosition (float &x, float &y, float &z) const |
Retrieve the true neutrino vertex position. More... | |
void | GetTrueVertexPosition (float &x, float &u, float &v, float &w) const |
Retrieve the true neutrino vertex position. More... | |
const pandora::CartesianVector & | GetTrueVertex () const |
Retrieve the true neutrino vertex. More... | |
void | PopulateRootTree (const std::vector< VertexTuple > &vertexTuples, const pandora::CartesianPointVector &vertexCandidatesU, const pandora::CartesianPointVector &vertexCandidatesV, const pandora::CartesianPointVector &vertexCandidatesW) const |
Populate a root true with vertex information. More... | |
Private Attributes | |
bool | m_trainingMode |
Training mode. More... | |
std::string | m_trainingOutputFile |
Output file name for training examples. More... | |
std::string | m_inputVertexListName |
Input vertex list name if 2nd pass. More... | |
std::string | m_outputVertexListName |
Output vertex list name. More... | |
pandora::StringVector | m_caloHitListNames |
Names of input calo hit lists. More... | |
LArDLHelper::TorchModel | m_modelU |
The model for the U view. More... | |
LArDLHelper::TorchModel | m_modelV |
The model for the V view. More... | |
LArDLHelper::TorchModel | m_modelW |
The model for the W view. More... | |
int | m_event |
The current event number. More... | |
int | m_pass |
The pass of the train/infer step. More... | |
int | m_nClasses |
The number of distance classes. More... | |
int | m_height |
The height of the images. More... | |
int | m_width |
The width of the images. More... | |
float | m_maxHitAdc |
Maximum ADC value to allow. More... | |
float | m_regionSize |
The half width/height of the event region to consider in cm. More... | |
bool | m_visualise |
Whether or not to visualise the candidate vertices. More... | |
bool | m_writeTree |
Whether or not to write validation details to a ROOT tree. More... | |
std::string | m_rootTreeName |
The ROOT tree name. More... | |
std::string | m_rootFileName |
The ROOT file name. More... | |
std::mt19937 | m_rng |
The random number generator. More... | |
std::vector< double > | m_thresholds |
Distance class thresholds. More... | |
const double | PY_EPSILON {1.1920929e-7} |
The value of epsilon in Python. More... | |
DeepLearningTrackShowerIdAlgorithm class.
Definition at line 27 of file DlVertexingAlgorithm.h.
|
private |
Definition at line 58 of file DlVertexingAlgorithm.h.
typedef std::map<std::pair<int, int>, std::vector<const pandora::CaloHit *> > lar_dl_content::DlVertexingAlgorithm::PixelToCaloHitsMap |
Definition at line 30 of file DlVertexingAlgorithm.h.
|
private |
Definition at line 59 of file DlVertexingAlgorithm.h.
lar_dl_content::DlVertexingAlgorithm::DlVertexingAlgorithm | ( | ) |
Default constructor.
Definition at line 28 of file DlVertexingAlgorithm.cc.
|
virtual |
Definition at line 44 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 568 of file DlVertexingAlgorithm.cc.
|
private |
Add a filled ring to the specified canvas. The ring has an inner radius based on the minimum predicted distance to the vertex and an outer radius based on the maximum predicted distance to the vertex. The centre of the ring is the location of the hit used to predict the distance to the vertex. Each pixel to be filled is augmented by the specified weight. In this way, once all hits have been considered, a consensus view emerges of the likely vertex location based on the overlap of various rings centred at different locations.
The underlying implementation is a variant of the Bresenham midpoint circle algorithm and therefore only computes pixel coordinates for one octant of each circle (one of radius 'inner', one of radius 'outer') and interpolates the fill between points using integer arithmetic, guaranteeing each pixel of the ring is filled once and only once, and then mirrored to the remaining seven octants.
networkOutput | The TorchOutput object populated by the network inference step |
pixelVector | The vector of populated pixels |
thresholds | The fractional distance thresholds representing the classes predicted by the network |
columnOffset | The output column offset for the canvas |
rowOffset | The output row offset for the canvas |
width | The output width for the canvas |
height | The output height for the canvas |
Definition at line 481 of file DlVertexingAlgorithm.cc.
|
private |
Determines the parameters of the canvas for extracting the vertex location. The network predicts the distance that each pixel associated with a hit is located from the vertex, but says nothing about the direction. As a result, the ring describing the potential vertices associated with that hit can extend beyond the original canvas size. This function returns the size of the required canvas and the offset for the bottom left corner.
networkOutput | The TorchOutput object populated by the network inference step |
pixelVector | The vector of populated pixels |
columnOffset | The output column offset for the canvas |
rowOffset | The output row offset for the canvas |
width | The output width for the canvas |
height | The output height for the canvas |
Definition at line 446 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 598 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 551 of file DlVertexingAlgorithm.cc.
|
private |
Retrieve the true neutrino vertex.
Definition at line 712 of file DlVertexingAlgorithm.cc.
|
private |
Retrieve the true neutrino vertex position.
Definition at line 690 of file DlVertexingAlgorithm.cc.
|
private |
Retrieve the true neutrino vertex position.
Definition at line 700 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 157 of file DlVertexingAlgorithm.cc.
|
private |
Create a vertex list from the candidate vertices.
candidates | The candidate positions with which to create the list. |
Definition at line 666 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 322 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 409 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 380 of file DlVertexingAlgorithm.cc.
|
private |
Populate a root true with vertex information.
Definition at line 735 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 71 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 799 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 61 of file DlVertexingAlgorithm.cc.
|
private |
Update the coordinates along the loci of a circle. When drawing the ring we need an efficient means to determine the next pixel defining the inner and outer loci of the ring. This update function uses the Bresenham midpoint circle update function to determine this location. The row position is always incremented by 1 pixel, the column position is left unchanged, or decremented by 1 pixel to best follow the arc of the true underlying circle.
radius2 | The squared radius of the circle under consideration |
col | The input/output column position to (potentially) update |
row | The input/output row position to update |
Definition at line 533 of file DlVertexingAlgorithm.cc.
|
private |
Names of input calo hit lists.
Definition at line 224 of file DlVertexingAlgorithm.h.
|
private |
The current event number.
Definition at line 228 of file DlVertexingAlgorithm.h.
|
private |
The height of the images.
Definition at line 231 of file DlVertexingAlgorithm.h.
|
private |
Input vertex list name if 2nd pass.
Definition at line 222 of file DlVertexingAlgorithm.h.
|
private |
Maximum ADC value to allow.
Definition at line 233 of file DlVertexingAlgorithm.h.
|
private |
The model for the U view.
Definition at line 225 of file DlVertexingAlgorithm.h.
|
private |
The model for the V view.
Definition at line 226 of file DlVertexingAlgorithm.h.
|
private |
The model for the W view.
Definition at line 227 of file DlVertexingAlgorithm.h.
|
private |
The number of distance classes.
Definition at line 230 of file DlVertexingAlgorithm.h.
|
private |
Output vertex list name.
Definition at line 223 of file DlVertexingAlgorithm.h.
|
private |
The pass of the train/infer step.
Definition at line 229 of file DlVertexingAlgorithm.h.
|
private |
The half width/height of the event region to consider in cm.
Definition at line 234 of file DlVertexingAlgorithm.h.
|
private |
The random number generator.
Definition at line 239 of file DlVertexingAlgorithm.h.
|
private |
The ROOT file name.
Definition at line 238 of file DlVertexingAlgorithm.h.
|
private |
The ROOT tree name.
Definition at line 237 of file DlVertexingAlgorithm.h.
|
private |
Distance class thresholds.
Definition at line 240 of file DlVertexingAlgorithm.h.
|
private |
Training mode.
Definition at line 220 of file DlVertexingAlgorithm.h.
|
private |
Output file name for training examples.
Definition at line 221 of file DlVertexingAlgorithm.h.
|
private |
Whether or not to visualise the candidate vertices.
Definition at line 235 of file DlVertexingAlgorithm.h.
|
private |
The width of the images.
Definition at line 232 of file DlVertexingAlgorithm.h.
|
private |
Whether or not to write validation details to a ROOT tree.
Definition at line 236 of file DlVertexingAlgorithm.h.
|
private |
The value of epsilon in Python.
Definition at line 241 of file DlVertexingAlgorithm.h.