LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
DlSecondaryVertexingAlgorithm.h
Go to the documentation of this file.
1 
8 #ifndef LAR_DL_SECONDARY_VERTEXING_ALGORITHM_H
9 #define LAR_DL_SECONDARY_VERTEXING_ALGORITHM_H 1
10 
11 #include "Pandora/Algorithm.h"
12 #include "Pandora/AlgorithmHeaders.h"
13 
15 
18 
19 #include <random>
20 
21 using namespace lar_content;
22 
23 namespace lar_dl_content
24 {
29 {
30 public:
35 
37 
38 private:
39  class Canvas
40  {
41  public:
45  Canvas(const pandora::HitType view, const int width, const int height, const int colOffset, const int rowOffset, const float xMin,
46  const float xMax, const float zMin, const float zMax);
47 
48  virtual ~Canvas();
49 
51  float **m_canvas;
52  bool **m_visited;
53  const int m_width;
54  const int m_height;
55  const int m_colOffset;
56  const int m_rowOffset;
57  const float m_xMin;
58  const float m_xMax;
59  const float m_zMin;
60  const float m_zMax;
61  };
62 
63  typedef std::map<pandora::HitType, Canvas *> CanvasViewMap;
64 
65  pandora::StatusCode Run();
66  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
67  pandora::StatusCode PrepareTrainingSample();
68  pandora::StatusCode Infer();
69 
70  /*
71  * @brief Create input for the network from a calo hit list
72  *
73  * @param caloHits The CaloHitList from which the input should be made
74  * @param view The wire plane view
75  * @param xMin The minimum x coordinate for the hits
76  * @param xMax The maximum x coordinate for the hits
77  * @param zMin The minimum x coordinate for the hits
78  * @param zMax The maximum x coordinate for the hits
79  * @param networkInput The TorchInput object to populate
80  * @param pixelVector The output vector of populated pixels
81  *
82  * @return The StatusCode resulting from the function
83  **/
84  pandora::StatusCode MakeNetworkInputFromHits(const pandora::CaloHitList &caloHits, const pandora::HitType view, const float xMin,
85  const float xMax, const float zMin, const float zMax, LArDLHelper::TorchInput &networkInput, PixelVector &pixelVector) const;
86 
87  /*
88  * @brief Create a list of vertices from canvases
89  *
90  * @param canvases The input canvases
91  * @param positionVector The output vector of wire plane positions
92  *
93  * @return The StatusCode resulting from the function
94  **/
95  pandora::StatusCode GetNetworkVertices(const CanvasViewMap &canvases, pandora::CartesianPointVector &positionVector) const;
96 
97  /*
98  * @brief Create a list of vertices from a canvas
99  *
100  * @param canvases The input canvases
101  * @param positionVector The output vector of wire plane positions
102  *
103  * @return The StatusCode resulting from the function
104  **/
105  pandora::StatusCode GetVerticesFromCanvas(const Canvas &canvas, pandora::CartesianPointVector &vertices) const;
106 
118  bool GrowPeak(const Canvas &canvas, int col, int row, float intensity, std::vector<std::pair<int, int>> &peak) const;
119 
127  pandora::StatusCode MakeCandidateVertexList(const pandora::CartesianPointVector &positions);
128 
129  int m_event;
130  bool m_visualise;
131  bool m_writeTree;
132  std::string m_rootTreeName;
133  std::string m_rootFileName;
134  std::mt19937 m_rng;
135 };
136 
137 } // namespace lar_dl_content
138 
139 #endif // LAR_DL_SECONDARY_VERTEXING_ALGORITHM_H
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
DeepLearningTrackShowerIdAlgorithm class.
Header file for the lar monte carlo particle helper helper class.
std::mt19937 m_rng
The random number generator.
Int_t col[ntarg]
Definition: Style.C:29
Header file for the lar deep learning helper helper class.
bool m_visualise
Whether or not to visualise the candidate vertices.
DeepLearningTrackShowerIdAlgorithm class.
bool m_writeTree
Whether or not to write validation details to a ROOT tree.
HitType
Definition: HitType.h:12
std::map< pandora::HitType, Canvas * > CanvasViewMap