LArSoft  v09_93_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 
158  void GetSimpleConeList(const unsigned int nLayersForConeFit, const unsigned int nCones, const ConeSelection coneSelection,
159  SimpleConeList &simpleConeList, const float tanHalfAngle = 0.5f, const bool legacyMode = true) const;
160 
161 private:
162  typedef std::list<pandora::TrackState> TrackStateLinkedList;
163 
165  TrackStateMap m_trackStateMap;
166 };
167 
168 typedef std::vector<ThreeDSlidingConeFitResult> ThreeDSlidingConeFitResultList;
169 typedef std::unordered_map<const pandora::Cluster *, ThreeDSlidingConeFitResult> ThreeDSlidingConeFitResultMap;
170 
171 //------------------------------------------------------------------------------------------------------------------------------------------
172 //------------------------------------------------------------------------------------------------------------------------------------------
173 
174 inline SimpleCone::SimpleCone(const pandora::CartesianVector &coneApex, const pandora::CartesianVector &coneDirection,
175  const float coneLength, const float coneTanHalfAngle) :
176  m_coneApex(coneApex),
177  m_coneDirection(coneDirection),
178  m_coneLength(coneLength),
179  m_coneTanHalfAngle(coneTanHalfAngle)
180 {
181 }
182 
183 //------------------------------------------------------------------------------------------------------------------------------------------
184 
185 inline const pandora::CartesianVector &SimpleCone::GetConeApex() const
186 {
187  return m_coneApex;
188 }
189 
190 //------------------------------------------------------------------------------------------------------------------------------------------
191 
192 inline const pandora::CartesianVector &SimpleCone::GetConeDirection() const
193 {
194  return m_coneDirection;
195 }
196 
197 //------------------------------------------------------------------------------------------------------------------------------------------
198 
199 inline float SimpleCone::GetConeLength() const
200 {
201  return m_coneLength;
202 }
203 
204 //------------------------------------------------------------------------------------------------------------------------------------------
205 
207 {
208  return m_coneTanHalfAngle;
209 }
210 
211 //------------------------------------------------------------------------------------------------------------------------------------------
212 
213 inline float SimpleCone::GetBoundedHitFraction(const pandora::Cluster *const pCluster) const
214 {
215  return this->GetBoundedHitFraction(pCluster, this->GetConeLength(), this->GetConeTanHalfAngle());
216 }
217 
218 //------------------------------------------------------------------------------------------------------------------------------------------
219 //------------------------------------------------------------------------------------------------------------------------------------------
220 
222 {
223  return m_slidingFitResult;
224 }
225 
226 //------------------------------------------------------------------------------------------------------------------------------------------
227 
228 inline const TrackStateMap &ThreeDSlidingConeFitResult::GetTrackStateMap() const
229 {
230  return m_trackStateMap;
231 }
232 
233 } // namespace lar_content
234 
235 #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.
TFile f
Definition: plotHisto.C:6
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.