LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArTwoDSlidingShowerFitResult.h
Go to the documentation of this file.
1 
8 #ifndef LAR_TWO_D_SLIDING_SHOWER_FIT_RESULT_H
9 #define LAR_TWO_D_SLIDING_SHOWER_FIT_RESULT_H 1
10 
11 #include "Api/PandoraApi.h"
12 
14 
15 #include <unordered_map>
16 
17 namespace lar_content
18 {
19 
24 {
27 };
28 
29 //------------------------------------------------------------------------------------------------------------------------------------------
30 
35 {
36 public:
45  template <typename T>
47  const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch, const float showerEdgeMultiplier = 1.f);
48 
55 
62 
69 
77  void GetShowerEdges(const float x, const bool widenIfAmbiguity, pandora::FloatVector &edgePositions) const;
78 
79 private:
90  static TwoDSlidingFitResult LArTwoDShowerEdgeFit(const pandora::Cluster *const pCluster, const TwoDSlidingFitResult &fullShowerFit,
91  const ShowerEdge showerEdge, const float showerEdgeMultiplier);
92 
103  static TwoDSlidingFitResult LArTwoDShowerEdgeFit(const pandora::CartesianPointVector *const pPointVector,
104  const TwoDSlidingFitResult &fullShowerFit, const ShowerEdge showerEdge, const float showerEdgeMultiplier);
105 
106  typedef std::pair<float, float> FitCoordinate;
107  typedef std::vector<FitCoordinate> FitCoordinateList;
108  typedef std::map<int, FitCoordinateList> FitCoordinateMap;
109 
113 };
114 
115 typedef std::vector<TwoDSlidingShowerFitResult> TwoDSlidingShowerFitResultList;
116 typedef std::unordered_map<const pandora::Cluster *, TwoDSlidingShowerFitResult> TwoDSlidingShowerFitResultMap;
117 
118 //------------------------------------------------------------------------------------------------------------------------------------------
119 
124 {
125 public:
133  ShowerExtent(const float xCoordinate, const float highEdgeZ, const float lowEdgeZ);
134 
140  float GetXCoordinate() const;
141 
147  float GetHighEdgeZ() const;
148 
154  float GetLowEdgeZ() const;
155 
156 private:
158  float m_highEdgeZ;
159  float m_lowEdgeZ;
160 };
161 
162 typedef std::map<int, ShowerExtent> ShowerPositionMap;
163 
164 //------------------------------------------------------------------------------------------------------------------------------------------
165 //------------------------------------------------------------------------------------------------------------------------------------------
166 
168 {
169  return m_showerFitResult;
170 }
171 
172 //------------------------------------------------------------------------------------------------------------------------------------------
173 
175 {
177 }
178 
179 //------------------------------------------------------------------------------------------------------------------------------------------
180 
182 {
184 }
185 
186 //------------------------------------------------------------------------------------------------------------------------------------------
187 //------------------------------------------------------------------------------------------------------------------------------------------
188 
189 inline ShowerExtent::ShowerExtent(const float xCoordinate, const float edge1, const float edge2) :
190  m_xCoordinate(xCoordinate),
191  m_highEdgeZ(std::max(edge1, edge2)),
192  m_lowEdgeZ(std::min(edge1, edge2))
193 {
194 }
195 
196 //------------------------------------------------------------------------------------------------------------------------------------------
197 
198 inline float ShowerExtent::GetXCoordinate() const
199 {
200  return m_xCoordinate;
201 }
202 
203 //------------------------------------------------------------------------------------------------------------------------------------------
204 
205 inline float ShowerExtent::GetHighEdgeZ() const
206 {
207  return m_highEdgeZ;
208 }
209 
210 //------------------------------------------------------------------------------------------------------------------------------------------
211 
212 inline float ShowerExtent::GetLowEdgeZ() const
213 {
214  return m_lowEdgeZ;
215 }
216 
217 } // namespace lar_content
218 
219 #endif // #ifndef LAR_TWO_D_SLIDING_SHOWER_FIT_RESULT_H
Float_t x
Definition: compare.C:6
ShowerEdge
ShowerEdge enum.
std::map< int, FitCoordinateList > FitCoordinateMap
const TwoDSlidingFitResult & GetShowerFitResult() const
Get the sliding fit result for the full shower cluster.
static TwoDSlidingFitResult LArTwoDShowerEdgeFit(const pandora::Cluster *const pCluster, const TwoDSlidingFitResult &fullShowerFit, const ShowerEdge showerEdge, const float showerEdgeMultiplier)
Perform two dimensional sliding fit to shower edge, using specified primary axis. ...
STL namespace.
ShowerExtent(const float xCoordinate, const float highEdgeZ, const float lowEdgeZ)
Constructor.
TFile f
Definition: plotHisto.C:6
std::map< int, ShowerExtent > ShowerPositionMap
TwoDSlidingFitResult m_showerFitResult
The sliding fit result for the full shower cluster.
TwoDSlidingFitResult m_negativeEdgeFitResult
The sliding fit result for the negative shower edge.
Header file for the lar two dimensional sliding fit result class.
const TwoDSlidingFitResult & GetPositiveEdgeFitResult() const
Get the sliding fit result for the positive shower edge.
std::vector< TwoDSlidingShowerFitResult > TwoDSlidingShowerFitResultList
TwoDSlidingFitResult m_positiveEdgeFitResult
The sliding fit result for the positive shower edge.
float m_lowEdgeZ
The shower low edge z coordinate.
const TwoDSlidingFitResult & GetNegativeEdgeFitResult() const
Get the sliding fit result for the negative shower edge.
float m_highEdgeZ
The shower high edge z coordinate.
std::unordered_map< const pandora::Cluster *, TwoDSlidingShowerFitResult > TwoDSlidingShowerFitResultMap
TwoDSlidingShowerFitResult(const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch, const float showerEdgeMultiplier=1.f)
Constructor.
void GetShowerEdges(const float x, const bool widenIfAmbiguity, pandora::FloatVector &edgePositions) const
Get the most appropriate shower edges at a given x coordinate.