LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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, const float coneLength, const float coneTanHalfAngle) :
174  m_coneApex(coneApex),
175  m_coneDirection(coneDirection),
176  m_coneLength(coneLength),
177  m_coneTanHalfAngle(coneTanHalfAngle)
178 {
179 }
180 
181 //------------------------------------------------------------------------------------------------------------------------------------------
182 
183 inline const pandora::CartesianVector &SimpleCone::GetConeApex() const
184 {
185  return m_coneApex;
186 }
187 
188 //------------------------------------------------------------------------------------------------------------------------------------------
189 
190 inline const pandora::CartesianVector &SimpleCone::GetConeDirection() const
191 {
192  return m_coneDirection;
193 }
194 
195 //------------------------------------------------------------------------------------------------------------------------------------------
196 
197 inline float SimpleCone::GetConeLength() const
198 {
199  return m_coneLength;
200 }
201 
202 //------------------------------------------------------------------------------------------------------------------------------------------
203 
205 {
206  return m_coneTanHalfAngle;
207 }
208 
209 //------------------------------------------------------------------------------------------------------------------------------------------
210 
211 inline float SimpleCone::GetBoundedHitFraction(const pandora::Cluster *const pCluster) const
212 {
213  return this->GetBoundedHitFraction(pCluster, this->GetConeLength(), this->GetConeTanHalfAngle());
214 }
215 
216 //------------------------------------------------------------------------------------------------------------------------------------------
217 //------------------------------------------------------------------------------------------------------------------------------------------
218 
220 {
221  return m_slidingFitResult;
222 }
223 
224 //------------------------------------------------------------------------------------------------------------------------------------------
225 
226 inline const TrackStateMap &ThreeDSlidingConeFitResult::GetTrackStateMap() const
227 {
228  return m_trackStateMap;
229 }
230 
231 } // namespace lar_content
232 
233 #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::unordered_map< const pandora::Cluster *, ThreeDSlidingConeFitResult > ThreeDSlidingConeFitResultMap
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) ...
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.