LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LArThreeDSlidingConeFitResult.h
Go to the documentation of this file.
1 
8 #ifndef LAR_THREE_D_SLIDING_CONE_FIT_RESULT_H
9 #define LAR_THREE_D_SLIDING_CONE_FIT_RESULT_H 1
10 
11 #include "Api/PandoraApi.h"
12 
14 
15 #include <list>
16 #include <unordered_map>
17 
18 namespace lar_content
19 {
20 
25 {
29 };
30 
31 //------------------------------------------------------------------------------------------------------------------------------------------
32 
37 {
38 public:
47  SimpleCone(const pandora::CartesianVector &coneApex, const pandora::CartesianVector &coneDirection, const float coneLength, const float coneTanHalfAngle);
48 
54  const pandora::CartesianVector &GetConeApex() const;
55 
61  const pandora::CartesianVector &GetConeDirection() const;
62 
68  float GetConeLength() const;
69 
75  float GetConeTanHalfAngle() const;
76 
84  float GetMeanRT(const pandora::Cluster *const pCluster) const;
85 
93  float GetBoundedHitFraction(const pandora::Cluster *const pCluster) const;
94 
104  float GetBoundedHitFraction(const pandora::Cluster *const pCluster, const float coneLength, const float coneTanHalfAngle) const;
105 
106 private:
107  pandora::CartesianVector m_coneApex;
108  pandora::CartesianVector m_coneDirection;
109  float m_coneLength;
111 };
112 
113 typedef std::vector<SimpleCone> SimpleConeList;
114 
115 //------------------------------------------------------------------------------------------------------------------------------------------
116 
117 typedef std::map<int, pandora::TrackState> TrackStateMap;
118 
123 {
124 public:
132  template <typename T>
133  ThreeDSlidingConeFitResult(const T *const pT, const unsigned int slidingFitWindow, const float slidingFitLayerPitch);
134 
140  const ThreeDSlidingFitResult &GetSlidingFitResult() const;
141 
147  const TrackStateMap &GetTrackStateMap() const;
148 
157  void GetSimpleConeList(const unsigned int nLayersForConeFit, const unsigned int nCones, const ConeSelection coneSelection,
158  SimpleConeList &simpleConeList) const;
159 
160 private:
161  typedef std::list<pandora::TrackState> TrackStateLinkedList;
162 
164  TrackStateMap m_trackStateMap;
165 };
166 
167 typedef std::vector<ThreeDSlidingConeFitResult> ThreeDSlidingConeFitResultList;
168 typedef std::unordered_map<const pandora::Cluster *, ThreeDSlidingConeFitResult> ThreeDSlidingConeFitResultMap;
169 
170 //------------------------------------------------------------------------------------------------------------------------------------------
171 //------------------------------------------------------------------------------------------------------------------------------------------
172 
173 inline SimpleCone::SimpleCone(const pandora::CartesianVector &coneApex, const pandora::CartesianVector &coneDirection,
174  const float coneLength, const float coneTanHalfAngle) :
175  m_coneApex(coneApex),
176  m_coneDirection(coneDirection),
177  m_coneLength(coneLength),
178  m_coneTanHalfAngle(coneTanHalfAngle)
179 {
180 }
181 
182 //------------------------------------------------------------------------------------------------------------------------------------------
183 
184 inline const pandora::CartesianVector &SimpleCone::GetConeApex() const
185 {
186  return m_coneApex;
187 }
188 
189 //------------------------------------------------------------------------------------------------------------------------------------------
190 
191 inline const pandora::CartesianVector &SimpleCone::GetConeDirection() const
192 {
193  return m_coneDirection;
194 }
195 
196 //------------------------------------------------------------------------------------------------------------------------------------------
197 
198 inline float SimpleCone::GetConeLength() const
199 {
200  return m_coneLength;
201 }
202 
203 //------------------------------------------------------------------------------------------------------------------------------------------
204 
206 {
207  return m_coneTanHalfAngle;
208 }
209 
210 //------------------------------------------------------------------------------------------------------------------------------------------
211 
212 inline float SimpleCone::GetBoundedHitFraction(const pandora::Cluster *const pCluster) const
213 {
214  return this->GetBoundedHitFraction(pCluster, this->GetConeLength(), this->GetConeTanHalfAngle());
215 }
216 
217 //------------------------------------------------------------------------------------------------------------------------------------------
218 //------------------------------------------------------------------------------------------------------------------------------------------
219 
221 {
222  return m_slidingFitResult;
223 }
224 
225 //------------------------------------------------------------------------------------------------------------------------------------------
226 
227 inline const TrackStateMap &ThreeDSlidingConeFitResult::GetTrackStateMap() const
228 {
229  return m_trackStateMap;
230 }
231 
232 } // namespace lar_content
233 
234 #endif // #ifndef LAR_THREE_D_SLIDING_CONE_FIT_RESULT_H
const ThreeDSlidingFitResult m_slidingFitResult
The sliding fit result for the full cluster.
std::vector< ThreeDSlidingConeFitResult > ThreeDSlidingConeFitResultList
std::vector< SimpleCone > SimpleConeList
SimpleCone(const pandora::CartesianVector &coneApex, const pandora::CartesianVector &coneDirection, const float coneLength, const float coneTanHalfAngle)
Constructor.
const ThreeDSlidingFitResult & GetSlidingFitResult() const
Get the sliding fit result for the full cluster.
std::list< pandora::TrackState > TrackStateLinkedList
The track state linked list typedef.
float GetConeTanHalfAngle() const
Get the tangent of the cone half-angle.
std::map< int, pandora::TrackState > TrackStateMap
pandora::CartesianVector m_coneDirection
The cone direction.
const pandora::CartesianVector & GetConeApex() const
Get the cone apex.
float m_coneTanHalfAngle
The tangent of the cone half-angle.
float GetBoundedHitFraction(const pandora::Cluster *const pCluster) const
Get the fraction of hits in a provided cluster that are bounded within the cone, using fitted cone an...
Header file for the lar three dimensional sliding fit result class.
pandora::CartesianVector m_coneApex
The cone apex.
float GetMeanRT(const pandora::Cluster *const pCluster) const
Get the mean transverse distance to all hits in a cluster (whether contained or not) ...
std::unordered_map< const pandora::Cluster *, ThreeDSlidingConeFitResult > ThreeDSlidingConeFitResultMap
const TrackStateMap & GetTrackStateMap() const
Get the track state map, which caches results from the sliding fit result.
ConeSelection
ConeSelection enum.
float GetConeLength() const
Get the cone length.
const pandora::CartesianVector & GetConeDirection() const
Get the cone direction.
TrackStateMap m_trackStateMap
The track state map.