Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
ClusterAssociation.h
Go to the documentation of this file.
1
8#ifndef LAR_CLUSTER_ASSOCIATION_H
9#define LAR_CLUSTER_ASSOCIATION_H 1
10
12
13namespace lar_content
14{
101
102//------------------------------------------------------------------------------------------------------------------------------------------
103//------------------------------------------------------------------------------------------------------------------------------------------
104
109{
110public:
115
126 ClusterPairAssociation(const pandora::CartesianVector &upstreamMergePoint, const pandora::CartesianVector &upstreamMergeDirection,
127 const pandora::CartesianVector &downstreamMergePoint, const pandora::CartesianVector &downstreamMergeDirection,
128 const pandora::Cluster *pUpstreamCluster, const pandora::Cluster *pDownstreamCluster);
129
136
143
144private:
147};
148
149//------------------------------------------------------------------------------------------------------------------------------------------
150
152 m_upstreamMergePoint(pandora::CartesianVector(0.f, 0.f, 0.f)),
153 m_upstreamMergeDirection(pandora::CartesianVector(0.f, 0.f, 0.f)),
154 m_downstreamMergePoint(pandora::CartesianVector(0.f, 0.f, 0.f)),
155 m_downstreamMergeDirection(pandora::CartesianVector(0.f, 0.f, 0.f)),
156 m_connectingLineDirection(pandora::CartesianVector(0.f, 0.f, 0.f))
157{
158}
159
160//------------------------------------------------------------------------------------------------------------------------------------------
161
162inline ClusterAssociation::ClusterAssociation(const pandora::CartesianVector &upstreamMergePoint, const pandora::CartesianVector &upstreamMergeDirection,
163 const pandora::CartesianVector &downstreamMergePoint, const pandora::CartesianVector &downstreamMergeDirection) :
164 m_upstreamMergePoint(upstreamMergePoint),
165 m_upstreamMergeDirection(upstreamMergeDirection),
166 m_downstreamMergePoint(downstreamMergePoint),
167 m_downstreamMergeDirection(downstreamMergeDirection),
168 m_connectingLineDirection(0.f, 0.f, 0.f)
169{
170 const pandora::CartesianVector connectingLineDirection(
172 m_connectingLineDirection = connectingLineDirection.GetUnitVector();
173}
174
175//------------------------------------------------------------------------------------------------------------------------------------------
176
177inline bool ClusterAssociation::operator==(const ClusterAssociation &clusterAssociation) const
178{
179 return (m_upstreamMergePoint == clusterAssociation.GetUpstreamMergePoint() &&
180 m_upstreamMergeDirection == clusterAssociation.GetUpstreamMergeDirection() &&
181 m_downstreamMergePoint == clusterAssociation.GetDownstreamMergePoint() &&
183}
184
185//------------------------------------------------------------------------------------------------------------------------------------------
186
187inline bool ClusterAssociation::operator<(const ClusterAssociation &clusterAssociation) const
188{
190}
191
192//------------------------------------------------------------------------------------------------------------------------------------------
193
198
199//------------------------------------------------------------------------------------------------------------------------------------------
200
205
206//------------------------------------------------------------------------------------------------------------------------------------------
207
212
213//------------------------------------------------------------------------------------------------------------------------------------------
214
219
220//------------------------------------------------------------------------------------------------------------------------------------------
221
226
227//------------------------------------------------------------------------------------------------------------------------------------------
228
230{
231 m_upstreamMergePoint = upstreamMergePoint;
232 this->UpdateConnectingLine();
233}
234
235//------------------------------------------------------------------------------------------------------------------------------------------
236
238{
239 m_downstreamMergePoint = downstreamMergePoint;
240 this->UpdateConnectingLine();
241}
242
243//------------------------------------------------------------------------------------------------------------------------------------------
244
251
252//------------------------------------------------------------------------------------------------------------------------------------------
253//------------------------------------------------------------------------------------------------------------------------------------------
254
256 const pandora::CartesianVector &upstreamMergeDirection, const pandora::CartesianVector &downstreamMergePoint,
257 const pandora::CartesianVector &downstreamMergeDirection, const pandora::Cluster *pUpstreamCluster, const pandora::Cluster *pDownstreamCluster) :
258 ClusterAssociation(upstreamMergePoint, upstreamMergeDirection, downstreamMergePoint, downstreamMergeDirection),
259 m_pUpstreamCluster(pUpstreamCluster),
260 m_pDownstreamCluster(pDownstreamCluster)
261{
262}
263
264//------------------------------------------------------------------------------------------------------------------------------------------
265
266inline ClusterPairAssociation::ClusterPairAssociation() : ClusterAssociation(), m_pUpstreamCluster(nullptr), m_pDownstreamCluster(nullptr)
267{
268}
269
270//------------------------------------------------------------------------------------------------------------------------------------------
271
276
277//------------------------------------------------------------------------------------------------------------------------------------------
278
283
284} // namespace lar_content
285
286#endif // #ifndef LAR_CLUSTER_ASSOCIATION_H
Header file for the cluster helper class.
ClusterAssociation class.
const pandora::CartesianVector GetDownstreamMergeDirection() const
Returns the cluster direction at the downstream merge point.
pandora::CartesianVector m_downstreamMergeDirection
The downstream cluster direction at the downstream merge point (points in the direction of the upstre...
pandora::CartesianVector m_downstreamMergePoint
The downstream cluster point to be used in the merging process.
ClusterAssociation()
Default constructor.
const pandora::CartesianVector GetConnectingLineDirection() const
Returns the unit vector of the line connecting the upstream and downstream merge points (upstream -> ...
void SetDownstreamMergePoint(const pandora::CartesianVector &downstreamMergePoint)
Set the downstream merge point.
pandora::CartesianVector m_upstreamMergeDirection
The upstream cluster direction at the upstream merge point (points in the direction of the downstream...
void SetUpstreamMergePoint(const pandora::CartesianVector &upstreamMergePoint)
Set the upstream merge point.
bool operator==(const ClusterAssociation &clusterAssociation) const
void UpdateConnectingLine()
Update the connecting line.
pandora::CartesianVector m_connectingLineDirection
The unit vector of the line connecting the upstream and downstream merge points (upstream -> downstre...
pandora::CartesianVector m_upstreamMergePoint
The upstream cluster point to be used in the merging process.
const pandora::CartesianVector GetUpstreamMergePoint() const
Returns the upstream cluster merge point.
const pandora::CartesianVector GetDownstreamMergePoint() const
Returns the downstream cluster merge point.
bool operator<(const ClusterAssociation &clusterAssociation) const
const pandora::CartesianVector GetUpstreamMergeDirection() const
Returns the cluster direction at the upstream merge point.
ClusterPairAssociation class.
const pandora::Cluster * GetUpstreamCluster() const
Returns the address of the upstream cluster.
const pandora::Cluster * m_pUpstreamCluster
The address of the upstream cluster.
const pandora::Cluster * GetDownstreamCluster() const
Returns the address of the downstream cluster.
const pandora::Cluster * m_pDownstreamCluster
The address of the downstream cluster.
static bool SortCoordinatesByPosition(const pandora::CartesianVector &lhs, const pandora::CartesianVector &rhs)
Sort cartesian vectors by their position (use Z, followed by X, followed by Y)
CartesianVector class.
float GetX() const
Get the cartesian x coordinate.
CartesianVector GetUnitVector() const
Get a unit vector in the direction of the cartesian vector.
float GetZ() const
Get the cartesian z coordinate.
Cluster class.
Definition Cluster.h:31