Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArTrackTwoViewOverlapResult.cc
Go to the documentation of this file.
1
10#include "Objects/Cluster.h"
11
12using namespace pandora;
13
14namespace lar_content
15{
16
18 m_isInitialized(false),
19 m_xOverlap(TwoViewXOverlap(0.f, 0.f, 0.f, 0.f)),
20 m_commonMuonPfoList(),
21 m_pBestMatchedCluster(nullptr),
22 m_matchedClusterList(),
23 m_reducedChiSquared(std::numeric_limits<float>::max())
24{
25}
26
27//------------------------------------------------------------------------------------------------------------------------------------------
28
30 const Cluster *const pBestMatchedCluster, const ClusterList &matchedClusterList, const float reducedChiSquared) :
31 m_isInitialized(true),
32 m_xOverlap(xOverlap),
33 m_commonMuonPfoList(commonMuonPfoList),
34 m_pBestMatchedCluster(pBestMatchedCluster),
35 m_matchedClusterList(matchedClusterList),
36 m_reducedChiSquared(reducedChiSquared)
37{
38}
39
40//------------------------------------------------------------------------------------------------------------------------------------------
41
43 m_isInitialized(rhs.m_isInitialized),
44 m_xOverlap(rhs.GetXOverlap()),
45 m_commonMuonPfoList(rhs.GetCommonMuonPfoList()),
46 m_pBestMatchedCluster(rhs.GetBestMatchedCluster()),
47 m_matchedClusterList(rhs.GetMatchedClusterList()),
48 m_reducedChiSquared(rhs.GetReducedChiSquared())
49{
50}
51
52//------------------------------------------------------------------------------------------------------------------------------------------
53
57
58//------------------------------------------------------------------------------------------------------------------------------------------
59
61{
62 unsigned int highestNHits(0);
63 const Cluster *pBestMatchedCluster(nullptr);
64
65 for (const Cluster *const pMatchedCluster : m_matchedClusterList)
66 {
67 if (!pMatchedCluster->IsAvailable())
68 continue;
69
70 if (pMatchedCluster->GetNCaloHits() > highestNHits)
71 {
72 highestNHits = pMatchedCluster->GetNCaloHits();
73 pBestMatchedCluster = pMatchedCluster;
74 }
75 }
76
77 return pBestMatchedCluster;
78}
79
80//------------------------------------------------------------------------------------------------------------------------------------------
81
93
94//------------------------------------------------------------------------------------------------------------------------------------------
95
97{
98 if (this == &rhs)
99 return false;
100
101 if (!m_isInitialized && !rhs.m_isInitialized)
102 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
103
104 if (!m_isInitialized)
105 return true;
106
107 if (!rhs.m_isInitialized)
108 return false;
109
111}
112
113//------------------------------------------------------------------------------------------------------------------------------------------
114//------------------------------------------------------------------------------------------------------------------------------------------
115
116TrackTwoViewOverlapResult::TrackTwoViewOverlapResult() : m_isInitialized(false), m_matchingScore(0)
117{
118}
119
120//------------------------------------------------------------------------------------------------------------------------------------------
121
122TrackTwoViewOverlapResult::TrackTwoViewOverlapResult(const float matchingScore) : m_isInitialized(true), m_matchingScore(matchingScore)
123{
124}
125
126//------------------------------------------------------------------------------------------------------------------------------------------
127
129 m_isInitialized(rhs.m_isInitialized),
130 m_matchingScore(rhs.m_matchingScore)
131{
132}
133
134//------------------------------------------------------------------------------------------------------------------------------------------
135
139
140//------------------------------------------------------------------------------------------------------------------------------------------
141
143{
144 if (this == &rhs)
145 return false;
146
147 if (!m_isInitialized && !rhs.m_isInitialized)
148 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
149
150 if (!m_isInitialized)
151 return true;
152
153 if (!rhs.m_isInitialized)
154 return false;
155
156 return (m_matchingScore < rhs.m_matchingScore);
157}
158
159//------------------------------------------------------------------------------------------------------------------------------------------
160
162{
163 if (this == &rhs)
164 return false;
165
166 return !(*this < rhs);
167}
168
169//------------------------------------------------------------------------------------------------------------------------------------------
170
172{
173 if (this == &rhs)
174 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
175
178
179 return *this;
180}
181
182//------------------------------------------------------------------------------------------------------------------------------------------
183//------------------------------------------------------------------------------------------------------------------------------------------
184
187 m_downsamplingFactor(0.f),
188 m_nSamplingPoints(0),
189 m_nMatchedSamplingPoints(0),
190 m_correlationCoefficient(0.f),
191 m_twoViewXOverlap(TwoViewXOverlap(0.f, 0.f, 0.f, 0.f))
192{
193}
194
195//------------------------------------------------------------------------------------------------------------------------------------------
196
197TwoViewTransverseOverlapResult::TwoViewTransverseOverlapResult(const float matchingScore, const float downsamplingFactor, const unsigned int nSamplingPoints,
198 const unsigned int nMatchedSamplingPoints, const float correlationCoefficient, const TwoViewXOverlap &twoViewXOverlap) :
199 TrackTwoViewOverlapResult(matchingScore),
200 m_downsamplingFactor(downsamplingFactor),
201 m_nSamplingPoints(nSamplingPoints),
202 m_nMatchedSamplingPoints(nMatchedSamplingPoints),
203 m_correlationCoefficient(correlationCoefficient),
204 m_twoViewXOverlap(twoViewXOverlap)
205{
206}
207
208//------------------------------------------------------------------------------------------------------------------------------------------
209
212 m_downsamplingFactor(rhs.m_downsamplingFactor),
213 m_nSamplingPoints(rhs.m_nSamplingPoints),
214 m_nMatchedSamplingPoints(rhs.m_nMatchedSamplingPoints),
215 m_correlationCoefficient(rhs.m_correlationCoefficient),
216 m_twoViewXOverlap(rhs.m_isInitialized ? rhs.m_twoViewXOverlap : TwoViewXOverlap(0.f, 0.f, 0.f, 0.f))
217{
218}
219
220//------------------------------------------------------------------------------------------------------------------------------------------
221
225
226//------------------------------------------------------------------------------------------------------------------------------------------
227
229{
230 if (this == &rhs)
231 return false;
232
233 if (!m_isInitialized && !rhs.m_isInitialized)
234 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
235
236 if (!m_isInitialized)
237 return true;
238
239 if (!rhs.m_isInitialized)
240 return false;
241
242 if (std::fabs(m_matchingScore - rhs.m_matchingScore) > std::numeric_limits<float>::epsilon())
243 return (m_matchingScore < rhs.m_matchingScore);
244
245 if (std::fabs(m_correlationCoefficient - rhs.m_correlationCoefficient) > std::numeric_limits<float>::epsilon())
247
250
253
254 if (std::fabs(this->GetLocallyMatchedFraction() - rhs.GetLocallyMatchedFraction()) > std::numeric_limits<float>::epsilon())
256
257 if (std::fabs(m_twoViewXOverlap.GetTwoViewXOverlapSpan() - rhs.m_twoViewXOverlap.GetTwoViewXOverlapSpan()) > std::numeric_limits<float>::epsilon())
259
260 if (std::fabs(m_twoViewXOverlap.GetXSpan0() - rhs.m_twoViewXOverlap.GetXSpan0()) > std::numeric_limits<float>::epsilon())
262
264}
265
266//------------------------------------------------------------------------------------------------------------------------------------------
267
295
296} // namespace lar_content
Header file for the cluster class.
Header file for the lar track two view overlap result class.
bool operator>(const TrackTwoViewOverlapResult &rhs) const
Track two view overlap result greater than operator.
bool m_isInitialized
Whether the track overlap result has been initialized.
float m_matchingScore
The compatability score for the two objects associated with the overlap result.
bool operator<(const TrackTwoViewOverlapResult &rhs) const
Track two view overlap result less than operator.
TrackTwoViewOverlapResult & operator=(const TrackTwoViewOverlapResult &rhs)
Track overlap result assigment operator.
const pandora::Cluster * GetBestMatchedAvailableCluster() const
Get the best matched available cluster.
pandora::ClusterList m_matchedClusterList
The list of clusters that lie on the projected hits.
const pandora::Cluster * GetBestMatchedCluster() const
Get the best matched cluster.
const pandora::ClusterList & GetMatchedClusterList() const
Get the matched cluster list.
bool m_isInitialized
Whether the two view delta ray overlap result has been initialized.
bool operator<(const TwoViewDeltaRayOverlapResult &rhs) const
Track two view overlap result less than operator.
const pandora::Cluster * m_pBestMatchedCluster
The largest cluster that lies on the projected hits.
TwoViewDeltaRayOverlapResult & operator=(const TwoViewDeltaRayOverlapResult &rhs)
Track overlap result assigment operator.
const TwoViewXOverlap & GetXOverlap() const
Get the x overlap object.
TwoViewXOverlap m_xOverlap
The x overlap object.
pandora::PfoList m_commonMuonPfoList
The list of muon pfos whose clusters lie close to delta ray clusters in all views.
float GetReducedChiSquared() const
Get the reduced chi squared value.
float m_reducedChiSquared
The reduced chi squared of the best matched cluster.
const pandora::PfoList & GetCommonMuonPfoList() const
Get the common muon pfo list.
float m_correlationCoefficient
The correlation coefficient.
unsigned int m_nSamplingPoints
The number of sampling points.
float GetLocallyMatchedFraction() const
Get the locally matched fraction.
TwoViewXOverlap m_twoViewXOverlap
The two view x overlap object.
bool operator<(const TwoViewTransverseOverlapResult &rhs) const
Track two view overlap result less than operator.
TwoViewTransverseOverlapResult & operator=(const TwoViewTransverseOverlapResult &rhs)
Track overlap result assigment operator.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
float GetXSpan1() const
Get the x span in the view 1.
float GetXSpan0() const
Get the x span in the view 0.
float GetTwoViewXOverlapSpan() const
Get the x overlap span.
Cluster class.
Definition Cluster.h:31
StatusCodeException class.
MANAGED_CONTAINER< const Cluster * > ClusterList
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList