8#ifndef LAR_DL_VERTEXING_ALGORITHM_H
9#define LAR_DL_VERTEXING_ALGORITHM_H 1
58 typedef std::pair<int, int>
Pixel;
100 const int columnOffset,
const int rowOffset,
const pandora::HitType view,
const float xMin,
const float xMax,
const float zMin,
117 int &rowOffset,
int &width,
int &height)
const;
139 void DrawRing(
float **canvas,
const int row,
const int col,
const int inner,
const int outer,
const float weight)
const;
152 void Update(
const int radius,
int &col,
int &row)
const;
Header file for the algorithm class.
Header file for the lar deep learning helper helper class.
Header file for the lar monte carlo particle helper helper class.
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
std::string ToString() const
const pandora::CartesianVector & GetPosition() const
pandora::CartesianVector m_pos
Calculated 3D position.
float m_chi2
Chi squared of calculated position.
DeepLearningTrackShowerIdAlgorithm class.
pandora::StatusCode Run()
Run the algorithm.
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 predicte...
pandora::StatusCode PrepareTrainingSample()
bool m_trainingMode
Training mode.
int m_width
The width of the images.
pandora::StatusCode Infer()
pandora::StatusCode MakeCandidateVertexList(const pandora::CartesianPointVector &positions)
Create a vertex list from the candidate vertices.
const pandora::CartesianVector & GetTrueVertex() const
Retrieve the true neutrino vertex.
LArDLHelper::TorchModel m_modelW
The model for the W view.
bool m_visualise
Whether or not to visualise the candidate vertices.
virtual ~DlVertexingAlgorithm()
std::string m_outputVertexListName
Output vertex list name.
std::string m_rootTreeName
The ROOT tree name.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
int m_pass
The pass of the train/infer step.
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
DlVertexingAlgorithm()
Default constructor.
LArDLHelper::TorchModel m_modelV
The model for the V view.
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
int m_nClasses
The number of distance classes.
float m_driftStep
The size of a pixel in the drift direction in cm (most relevant in pass 2)
std::string m_inputVertexListName
Input vertex list name if 2nd pass.
LArDLHelper::TorchModel m_modelU
The model for the U view.
std::string m_trainingOutputFile
Output file name for training examples.
std::map< std::pair< int, int >, std::vector< const pandora::CaloHit * > > PixelToCaloHitsMap
pandora::StatusCode GetMCToHitsMap(LArMCParticleHelper::MCContributionMap &mcToHitsMap) const
bool m_writeTree
Whether or not to write validation details to a ROOT tree.
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 t...
int m_height
The height of the images.
pandora::StringVector m_caloHitListNames
Names of input calo hit lists.
std::string m_volumeType
The name of the fiducial volume type for the monitoring output.
void GetHitRegion(const pandora::CaloHitList &caloHitList, float &xMin, float &xMax, float &zMin, float &zMax) const
std::vector< Pixel > PixelVector
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 ...
void GetTrueVertexPosition(float &x, float &y, float &z) const
Retrieve the true neutrino vertex position.
std::string m_rootFileName
The ROOT file name.
std::vector< double > m_thresholds
Distance class thresholds.
int m_event
The current event number.
pandora::StatusCode CompleteMCHierarchy(const LArMCParticleHelper::MCContributionMap &mcToHitsMap, pandora::MCParticleList &mcHierarchy) const
std::pair< int, int > Pixel
std::mt19937 m_rng
The random number generator.
torch::jit::script::Module TorchModel
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
HitType
Calorimeter hit type enum.
MANAGED_CONTAINER< const MCParticle * > MCParticleList
std::vector< std::string > StringVector
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.