![]() |
LArSoft
v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
|
DeepLearningTrackShowerIdAlgorithm class. More...
#include "DlSecondaryVertexingAlgorithm.h"
Classes | |
class | Canvas |
Public Types | |
typedef std::map< std::pair< int, int >, std::vector< const pandora::CaloHit * > > | PixelToCaloHitsMap |
Public Member Functions | |
DlSecondaryVertexingAlgorithm () | |
Default constructor. More... | |
~DlSecondaryVertexingAlgorithm () | |
Protected Types | |
typedef std::pair< int, int > | Pixel |
typedef std::vector< Pixel > | PixelVector |
Protected Member Functions | |
void | GetHitRegion (const pandora::CaloHitList &caloHitList, float &xMin, float &xMax, float &zMin, float &zMax) 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... | |
Protected 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_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_driftStep |
The size of a pixel in the drift direction in cm (most relevant in pass 2) More... | |
std::vector< double > | m_thresholds |
Distance class thresholds. More... | |
std::string | m_volumeType |
The name of the fiducial volume type for the monitoring output. More... | |
Private Types | |
typedef std::map< pandora::HitType, Canvas * > | CanvasViewMap |
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, const pandora::HitType view, const float xMin, const float xMax, const float zMin, const float zMax, LArDLHelper::TorchInput &networkInput, PixelVector &pixelVector) const |
pandora::StatusCode | GetNetworkVertices (const CanvasViewMap &canvases, pandora::CartesianPointVector &positionVector) const |
pandora::StatusCode | GetVerticesFromCanvas (const Canvas &canvas, pandora::CartesianPointVector &vertices) const |
bool | GrowPeak (const Canvas &canvas, int col, int row, float intensity, std::vector< std::pair< int, int >> &peak) const |
Determine if the pixel under consideration is part of a peak and grow that peak to include all connected pixels of equal value. More... | |
pandora::StatusCode | MakeCandidateVertexList (const pandora::CartesianPointVector &positions) |
Create a vertex list from the candidate vertices. More... | |
Private Attributes | |
int | m_event |
The current event number. 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... | |
DeepLearningTrackShowerIdAlgorithm class.
Definition at line 28 of file DlSecondaryVertexingAlgorithm.h.
|
private |
Definition at line 63 of file DlSecondaryVertexingAlgorithm.h.
|
protectedinherited |
Definition at line 41 of file DlVertexingBaseAlgorithm.h.
|
inherited |
Definition at line 31 of file DlVertexingBaseAlgorithm.h.
|
protectedinherited |
Definition at line 42 of file DlVertexingBaseAlgorithm.h.
lar_dl_content::DlSecondaryVertexingAlgorithm::DlSecondaryVertexingAlgorithm | ( | ) |
Default constructor.
Definition at line 33 of file DlSecondaryVertexingAlgorithm.cc.
References m_rng, m_visualise, and m_writeTree.
lar_dl_content::DlSecondaryVertexingAlgorithm::~DlSecondaryVertexingAlgorithm | ( | ) |
Definition at line 41 of file DlSecondaryVertexingAlgorithm.cc.
References e, m_rootFileName, m_rootTreeName, and m_writeTree.
|
protectedinherited |
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 165 of file DlVertexingBaseAlgorithm.cc.
References col, lar_dl_content::DlVertexingBaseAlgorithm::m_height, lar_dl_content::DlVertexingBaseAlgorithm::m_thresholds, and lar_dl_content::DlVertexingBaseAlgorithm::m_width.
Referenced by lar_dl_content::DlVertexingAlgorithm::Infer(), and Infer().
|
protectedinherited |
Definition at line 50 of file DlVertexingBaseAlgorithm.cc.
References util::begin(), lar_dl_content::DlVertexingBaseAlgorithm::m_caloHitListNames, lar_dl_content::DlVertexingBaseAlgorithm::m_driftStep, lar_dl_content::DlVertexingBaseAlgorithm::m_height, lar_dl_content::DlVertexingBaseAlgorithm::m_inputVertexListName, lar_dl_content::DlVertexingBaseAlgorithm::m_pass, lar_dl_content::DlVertexingBaseAlgorithm::m_width, x, and z.
Referenced by lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), lar_dl_content::DlVertexingAlgorithm::PrepareTrainingSample(), and PrepareTrainingSample().
|
private |
Definition at line 334 of file DlSecondaryVertexingAlgorithm.cc.
References lar_dl_content::VertexTuple::GetChi2(), lar_dl_content::VertexTuple::GetComponents(), and GetVerticesFromCanvas().
Referenced by Infer().
|
private |
Definition at line 462 of file DlSecondaryVertexingAlgorithm.cc.
References util::begin(), col, GrowPeak(), lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_canvas, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_colOffset, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_height, lar_dl_content::DlVertexingBaseAlgorithm::m_height, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_rowOffset, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_view, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_width, lar_dl_content::DlVertexingBaseAlgorithm::m_width, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_xMax, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_xMin, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_zMax, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_zMin, pt, r, x, and z.
Referenced by GetNetworkVertices().
|
private |
Determine if the pixel under consideration is part of a peak and grow that peak to include all connected pixels of equal value.
canvas | The canvas within which peaks are sought |
col | The column of the pixel under consideration |
row | The row of the pixel under consideration |
intensity | The target intensity of the candidate peak |
peak | The output vector of pixels constituting the peak under consideration |
Definition at line 561 of file DlSecondaryVertexingAlgorithm.cc.
References col, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_canvas, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_height, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_visited, lar_dl_content::DlSecondaryVertexingAlgorithm::Canvas::m_width, and r.
Referenced by GetVerticesFromCanvas().
|
private |
Definition at line 178 of file DlSecondaryVertexingAlgorithm.cc.
References col, lar_dl_content::LArCanvasHelper::DrawRing(), f, lar_dl_content::LArDLHelper::Forward(), lar_dl_content::DlVertexingBaseAlgorithm::GetCanvasParameters(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), GetNetworkVertices(), lar_dl_content::DlVertexingBaseAlgorithm::m_caloHitListNames, lar_dl_content::DlVertexingBaseAlgorithm::m_height, lar_dl_content::DlVertexingBaseAlgorithm::m_modelU, lar_dl_content::DlVertexingBaseAlgorithm::m_modelV, lar_dl_content::DlVertexingBaseAlgorithm::m_modelW, lar_dl_content::DlVertexingBaseAlgorithm::m_nClasses, lar_dl_content::DlVertexingBaseAlgorithm::m_thresholds, lar_dl_content::DlVertexingBaseAlgorithm::m_width, MakeCandidateVertexList(), and MakeNetworkInputFromHits().
Referenced by Run().
|
private |
Create a vertex list from the candidate vertices.
candidates | The candidate positions with which to create the list. |
Definition at line 629 of file DlSecondaryVertexingAlgorithm.cc.
References lar_dl_content::DlVertexingBaseAlgorithm::m_outputVertexListName.
Referenced by Infer().
|
private |
Definition at line 282 of file DlSecondaryVertexingAlgorithm.cc.
References util::begin(), col, lar_dl_content::LArDLHelper::InitialiseInput(), lar_dl_content::DlVertexingBaseAlgorithm::m_height, lar_dl_content::DlVertexingBaseAlgorithm::m_pass, lar_dl_content::DlVertexingBaseAlgorithm::m_width, value, x, and z.
Referenced by Infer().
|
private |
Definition at line 70 of file DlSecondaryVertexingAlgorithm.cc.
References lar_content::LArEventTopology::ConstructVisibleHierarchy(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), lar_content::LArEventTopology::GetVertices(), lar_dl_content::DlVertexingBaseAlgorithm::m_caloHitListNames, m_event, lar_dl_content::DlVertexingBaseAlgorithm::m_trainingOutputFile, lar_dl_content::DlVertexingBaseAlgorithm::m_volumeType, and lar_content::LArEventTopology::PruneHierarchy().
Referenced by Run().
|
private |
Definition at line 652 of file DlSecondaryVertexingAlgorithm.cc.
References m_rootFileName, m_rootTreeName, lar_dl_content::DlVertexingBaseAlgorithm::m_trainingMode, m_visualise, m_writeTree, and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
private |
Definition at line 58 of file DlSecondaryVertexingAlgorithm.cc.
References Infer(), m_event, lar_dl_content::DlVertexingBaseAlgorithm::m_trainingMode, and PrepareTrainingSample().
|
protectedinherited |
Names of input calo hit lists.
Definition at line 79 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), lar_dl_content::DlVertexingAlgorithm::PrepareTrainingSample(), PrepareTrainingSample(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The size of a pixel in the drift direction in cm (most relevant in pass 2)
Definition at line 87 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), lar_dl_content::DlVertexingAlgorithm::MakeNetworkInputFromHits(), lar_dl_content::DlVertexingAlgorithm::MakeWirePlaneCoordinatesFromCanvas(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
private |
The current event number.
Definition at line 129 of file DlSecondaryVertexingAlgorithm.h.
Referenced by PrepareTrainingSample(), and Run().
|
protectedinherited |
The height of the images.
Definition at line 85 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingBaseAlgorithm::GetCanvasParameters(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), GetVerticesFromCanvas(), lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), lar_dl_content::DlVertexingAlgorithm::MakeNetworkInputFromHits(), MakeNetworkInputFromHits(), lar_dl_content::DlVertexingAlgorithm::MakeWirePlaneCoordinatesFromCanvas(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
Input vertex list name if 2nd pass.
Definition at line 77 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), lar_dl_content::DlVertexingAlgorithm::Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The model for the U view.
Definition at line 80 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The model for the V view.
Definition at line 81 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The model for the W view.
Definition at line 82 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The number of distance classes.
Definition at line 84 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
Output vertex list name.
Definition at line 78 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingAlgorithm::MakeCandidateVertexList(), MakeCandidateVertexList(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The pass of the train/infer step.
Definition at line 83 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), lar_dl_content::DlVertexingAlgorithm::Infer(), lar_dl_content::DlVertexingAlgorithm::MakeCandidateVertexList(), lar_dl_content::DlVertexingAlgorithm::MakeNetworkInputFromHits(), MakeNetworkInputFromHits(), lar_dl_content::DlVertexingAlgorithm::PrepareTrainingSample(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
private |
The random number generator.
Definition at line 134 of file DlSecondaryVertexingAlgorithm.h.
Referenced by DlSecondaryVertexingAlgorithm().
|
private |
The ROOT file name.
Definition at line 133 of file DlSecondaryVertexingAlgorithm.h.
Referenced by ReadSettings(), and ~DlSecondaryVertexingAlgorithm().
|
private |
The ROOT tree name.
Definition at line 132 of file DlSecondaryVertexingAlgorithm.h.
Referenced by ReadSettings(), and ~DlSecondaryVertexingAlgorithm().
|
protectedinherited |
Distance class thresholds.
Definition at line 88 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::GetCanvasParameters(), lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
Training mode.
Definition at line 75 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingAlgorithm::ReadSettings(), lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings(), ReadSettings(), lar_dl_content::DlVertexingAlgorithm::Run(), and Run().
|
protectedinherited |
Output file name for training examples.
Definition at line 76 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingAlgorithm::PrepareTrainingSample(), PrepareTrainingSample(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
private |
Whether or not to visualise the candidate vertices.
Definition at line 130 of file DlSecondaryVertexingAlgorithm.h.
Referenced by DlSecondaryVertexingAlgorithm(), and ReadSettings().
|
protectedinherited |
The name of the fiducial volume type for the monitoring output.
Definition at line 89 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingAlgorithm::MakeCandidateVertexList(), PrepareTrainingSample(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
protectedinherited |
The width of the images.
Definition at line 86 of file DlVertexingBaseAlgorithm.h.
Referenced by lar_dl_content::DlVertexingBaseAlgorithm::DlVertexingBaseAlgorithm(), lar_dl_content::DlVertexingBaseAlgorithm::GetCanvasParameters(), lar_dl_content::DlVertexingBaseAlgorithm::GetHitRegion(), GetVerticesFromCanvas(), lar_dl_content::DlVertexingAlgorithm::Infer(), Infer(), lar_dl_content::DlVertexingAlgorithm::MakeNetworkInputFromHits(), MakeNetworkInputFromHits(), lar_dl_content::DlVertexingAlgorithm::MakeWirePlaneCoordinatesFromCanvas(), and lar_dl_content::DlVertexingBaseAlgorithm::ReadSettings().
|
private |
Whether or not to write validation details to a ROOT tree.
Definition at line 131 of file DlSecondaryVertexingAlgorithm.h.
Referenced by DlSecondaryVertexingAlgorithm(), ReadSettings(), and ~DlSecondaryVertexingAlgorithm().