Pandora
Pandora source code navigator
|
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. | |
virtual | ~DlVertexingAlgorithm () |
const std::string & | GetType () const |
Get the type. | |
const std::string & | GetInstanceName () const |
Get the instance name. | |
const Pandora & | GetPandora () const |
Get the associated pandora instance. | |
Protected Member Functions | |
virtual StatusCode | Initialize () |
Perform any operations that must occur after reading settings, but before running the process. | |
virtual StatusCode | Reset () |
Perform any operations when pandora is reset, typically at the end of each event. | |
StatusCode | RegisterDetails (const Pandora *const pPandora, const std::string &type, const std::string &instanceName) |
Register i) the pandora instance that will run the process and ii) the process type. | |
Protected Attributes | |
const Pandora * | m_pPandora |
The pandora object that will run the process. | |
std::string | m_type |
The process type. | |
std::string | m_instanceName |
The process instance name. | |
Private Types | |
typedef std::pair< int, int > | Pixel |
typedef std::vector< Pixel > | PixelVector |
Private Member Functions | |
pandora::StatusCode | Run () |
Run the algorithm. | |
pandora::StatusCode | ReadSettings (const pandora::TiXmlHandle xmlHandle) |
Read the algorithm settings. | |
pandora::StatusCode | PrepareTrainingSample () |
pandora::StatusCode | Infer () |
pandora::StatusCode | MakeNetworkInputFromHits (const pandora::CaloHitList &caloHits, const pandora::HitType view, const float xMin, const float xMax, const float zMin, const float zMax, LArDLHelper::TorchInput &networkInput, PixelVector &pixelVector) const |
pandora::StatusCode | MakeWirePlaneCoordinatesFromCanvas (float **canvas, const int canvasWidth, const int canvasHeight, const int columnOffset, const int rowOffset, const pandora::HitType view, const float xMin, const float xMax, const float zMin, const float zMax, 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. | |
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. | |
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. | |
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. | |
void | GetTrueVertexPosition (float &x, float &y, float &z) const |
Retrieve the true neutrino vertex position. | |
void | GetTrueVertexPosition (float &x, float &u, float &v, float &w) const |
Retrieve the true neutrino vertex position. | |
const pandora::CartesianVector & | GetTrueVertex () const |
Retrieve the true neutrino vertex. | |
Private Attributes | |
bool | m_trainingMode |
Training mode. | |
std::string | m_trainingOutputFile |
Output file name for training examples. | |
std::string | m_inputVertexListName |
Input vertex list name if 2nd pass. | |
std::string | m_outputVertexListName |
Output vertex list name. | |
pandora::StringVector | m_caloHitListNames |
Names of input calo hit lists. | |
LArDLHelper::TorchModel | m_modelU |
The model for the U view. | |
LArDLHelper::TorchModel | m_modelV |
The model for the V view. | |
LArDLHelper::TorchModel | m_modelW |
The model for the W view. | |
int | m_event |
The current event number. | |
int | m_pass |
The pass of the train/infer step. | |
int | m_nClasses |
The number of distance classes. | |
int | m_height |
The height of the images. | |
int | m_width |
The width of the images. | |
float | m_driftStep |
The size of a pixel in the drift direction in cm (most relevant in pass 2) | |
bool | m_visualise |
Whether or not to visualise the candidate vertices. | |
bool | m_writeTree |
Whether or not to write validation details to a ROOT tree. | |
std::string | m_rootTreeName |
The ROOT tree name. | |
std::string | m_rootFileName |
The ROOT file name. | |
std::mt19937 | m_rng |
The random number generator. | |
std::vector< double > | m_thresholds |
Distance class thresholds. | |
std::string | m_volumeType |
The name of the fiducial volume type for the monitoring output. | |
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 |
|
private |
Definition at line 562 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 475 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 440 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 592 of file DlVertexingAlgorithm.cc.
|
inlineinherited |
|
private |
Definition at line 545 of file DlVertexingAlgorithm.cc.
|
inlineinherited |
|
private |
Retrieve the true neutrino vertex.
Definition at line 753 of file DlVertexingAlgorithm.cc.
|
private |
Retrieve the true neutrino vertex position.
Definition at line 741 of file DlVertexingAlgorithm.cc.
|
private |
Retrieve the true neutrino vertex position.
Definition at line 731 of file DlVertexingAlgorithm.cc.
|
inlineinherited |
|
private |
Definition at line 171 of file DlVertexingAlgorithm.cc.
|
inlineprotectedvirtualinherited |
Perform any operations that must occur after reading settings, but before running the process.
Reimplemented in lar_content::BdtBeamParticleIdTool, lar_content::BeamParticleIdTool, lar_content::CosmicRayTaggingTool, lar_content::EventReadingAlgorithm, lar_content::EventWritingAlgorithm, lar_content::LArPseudoLayerPlugin, lar_content::LArRotationalTransformationPlugin, EventReadingAlgorithm, and EventWritingAlgorithm.
Definition at line 126 of file Process.h.
|
private |
Create a vertex list from the candidate vertices.
candidates | The candidate positions with which to create the list. |
Definition at line 707 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 356 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 407 of file DlVertexingAlgorithm.cc.
|
private |
Definition at line 71 of file DlVertexingAlgorithm.cc.
|
privatevirtual |
Read the algorithm settings.
xmlHandle | the relevant xml handle |
Implements pandora::Process.
Definition at line 842 of file DlVertexingAlgorithm.cc.
|
inlineprotectedinherited |
Register i) the pandora instance that will run the process and ii) the process type.
pPandora | address of the pandora object that will run the process |
type | the process type |
instanceName | the process instance name |
Definition at line 146 of file Process.h.
|
inlineprotectedvirtualinherited |
Perform any operations when pandora is reset, typically at the end of each event.
Reimplemented in lar_content::MasterAlgorithm, lar_content::PostProcessingAlgorithm, and lar_content::PreProcessingAlgorithm.
Definition at line 133 of file Process.h.
|
privatevirtual |
Run the algorithm.
Implements pandora::Algorithm.
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 527 of file DlVertexingAlgorithm.cc.
|
private |
Names of input calo hit lists.
Definition at line 223 of file DlVertexingAlgorithm.h.
|
private |
The size of a pixel in the drift direction in cm (most relevant in pass 2)
Definition at line 232 of file DlVertexingAlgorithm.h.
|
private |
The current event number.
Definition at line 227 of file DlVertexingAlgorithm.h.
|
private |
The height of the images.
Definition at line 230 of file DlVertexingAlgorithm.h.
|
private |
Input vertex list name if 2nd pass.
Definition at line 221 of file DlVertexingAlgorithm.h.
|
protectedinherited |
|
private |
The model for the U view.
Definition at line 224 of file DlVertexingAlgorithm.h.
|
private |
The model for the V view.
Definition at line 225 of file DlVertexingAlgorithm.h.
|
private |
The model for the W view.
Definition at line 226 of file DlVertexingAlgorithm.h.
|
private |
The number of distance classes.
Definition at line 229 of file DlVertexingAlgorithm.h.
|
private |
Output vertex list name.
Definition at line 222 of file DlVertexingAlgorithm.h.
|
private |
The pass of the train/infer step.
Definition at line 228 of file DlVertexingAlgorithm.h.
|
protectedinherited |
|
private |
The random number generator.
Definition at line 237 of file DlVertexingAlgorithm.h.
|
private |
The ROOT file name.
Definition at line 236 of file DlVertexingAlgorithm.h.
|
private |
The ROOT tree name.
Definition at line 235 of file DlVertexingAlgorithm.h.
|
private |
Distance class thresholds.
Definition at line 238 of file DlVertexingAlgorithm.h.
|
private |
Training mode.
Definition at line 219 of file DlVertexingAlgorithm.h.
|
private |
Output file name for training examples.
Definition at line 220 of file DlVertexingAlgorithm.h.
|
protectedinherited |
|
private |
Whether or not to visualise the candidate vertices.
Definition at line 233 of file DlVertexingAlgorithm.h.
|
private |
The name of the fiducial volume type for the monitoring output.
Definition at line 239 of file DlVertexingAlgorithm.h.
|
private |
The width of the images.
Definition at line 231 of file DlVertexingAlgorithm.h.
|
private |
Whether or not to write validation details to a ROOT tree.
Definition at line 234 of file DlVertexingAlgorithm.h.