Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
LArHitWidthHelper.h
Go to the documentation of this file.
1
8#ifndef LAR_HIT_WIDTH_HELPER_H
9#define LAR_HIT_WIDTH_HELPER_H 1
10
11#include "Objects/Cluster.h"
12
13namespace lar_content
14{
15
20{
21public:
26 {
27 public:
35 ConstituentHit(const pandora::CartesianVector &positionVector, const float hitWidth, const pandora::Cluster *const pParentClusterAddress);
36
41
45 float GetHitWidth() const;
46
51
56 {
57 public:
63 SortByDistanceToPoint(const pandora::CartesianVector referencePoint) : m_referencePoint(referencePoint)
64 {
65 }
66
75 bool operator()(const ConstituentHit &lhs, const ConstituentHit &rhs);
76
77 private:
79 };
80
81 private:
83 float m_hitWidth;
85 };
86
87 typedef std::vector<ConstituentHit> ConstituentHitVector;
88
93 {
94 public:
104 ClusterParameters(const pandora::Cluster *const pCluster, const float maxConsituentHitWidth, const bool isUniformHits,
105 const float hitWidthScalingFactor);
106
117 ClusterParameters(const pandora::Cluster *const pCluster, const unsigned int numCaloHits, const float totalWeight,
118 const ConstituentHitVector &constituentHitVector, const pandora::CartesianVector &lowerXExtrema,
119 const pandora::CartesianVector &higherXExtrema);
120
124 const pandora::Cluster *GetClusterAddress() const;
125
129 unsigned int GetNumCaloHits() const;
130
134 float GetTotalWeight() const;
135
140
145
150
151 private:
153 const unsigned int m_numCaloHits;
155 const float m_totalWeight;
158 };
159
160 typedef std::unordered_map<const pandora::Cluster *, const ClusterParameters> ClusterToParametersMap;
161
166 {
167 public:
173 SortByHigherXExtrema(const ClusterToParametersMap &clusterToParametersMap);
174
183 bool operator()(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs);
184
185 private:
187 };
188
197 static const ClusterParameters &GetClusterParameters(const pandora::Cluster *const pCluster, const ClusterToParametersMap &clusterToParametersMap);
198
208 static unsigned int GetNProposedConstituentHits(
209 const pandora::Cluster *const pCluster, const float maxConstituentHitWidth, const float hitWidthScalingFactor);
210
223 const pandora::Cluster *const pCluster, const float maxConstituentHitWidth, const float hitWidthScalingFactor, const bool isUniform);
224
235 static void SplitHitIntoConstituents(const pandora::CaloHit *const pCaloHit, const pandora::Cluster *const pCluster,
236 const unsigned int numberOfConstituentHits, const float constituentHitWidth, ConstituentHitVector &constituentHitVector);
237
246
254 static float GetTotalClusterWeight(const ConstituentHitVector &constituentHitVector);
255
263 static float GetOriginalTotalClusterWeight(const pandora::Cluster *const pCluster);
264
273
282
290 static void GetExtremalCoordinatesX(const ConstituentHitVector &constituentHitVector, pandora::CartesianVector &lowerXCoordinate,
291 pandora::CartesianVector &higherXCoordinate);
292
303 const pandora::CartesianVector &lineStart, const pandora::CartesianVector &lineDirection, const pandora::CaloHit *const pCaloHit);
304
313 static float GetClosestDistanceToPoint2D(const pandora::CaloHit *const pCaloHit, const pandora::CartesianVector &point2D);
314
323 static float GetClosestDistance(const pandora::CaloHit *const pThisCaloHit, const pandora::CaloHitList &caloHitList);
324
333 static float GetClosestDistance(const pandora::CaloHit *const pCaloHit1, const pandora::CaloHit *const pCaloHit2);
334};
335
336//------------------------------------------------------------------------------------------------------------------------------------------
337
342
343//------------------------------------------------------------------------------------------------------------------------------------------
344
346{
347 return m_hitWidth;
348}
349
350//------------------------------------------------------------------------------------------------------------------------------------------
351
353{
354 return m_pParentClusterAddress;
355}
356
357//------------------------------------------------------------------------------------------------------------------------------------------
358//------------------------------------------------------------------------------------------------------------------------------------------
359
361{
362 return m_pCluster;
363}
364
365//------------------------------------------------------------------------------------------------------------------------------------------
366
368{
369 return m_numCaloHits;
370}
371
372//------------------------------------------------------------------------------------------------------------------------------------------
373
375{
376 return m_totalWeight;
377}
378
379//------------------------------------------------------------------------------------------------------------------------------------------
380
385
386//------------------------------------------------------------------------------------------------------------------------------------------
387
389{
390 return m_lowerXExtrema;
391}
392
393//------------------------------------------------------------------------------------------------------------------------------------------
394
396{
397 return m_higherXExtrema;
398}
399
400//------------------------------------------------------------------------------------------------------------------------------------------
401//------------------------------------------------------------------------------------------------------------------------------------------
402
404 m_clusterToParametersMap(clusterToParametersMap)
405{
406}
407
408} // namespace lar_content
409
410#endif // #ifndef LAR_HIT_WIDTH_HELPER_H
Header file for the cluster class.
const pandora::CartesianVector m_lowerXExtrema
The lower x extremal point of the constituent hits.
const pandora::CartesianVector m_higherXExtrema
The higher x extremal point of the constituent hits.
const pandora::CartesianVector & GetHigherXExtrema() const
Returns the higher x extremal point of the constituent hits.
float GetTotalWeight() const
Returns the total weight of the constituent hits.
const ConstituentHitVector m_constituentHitVector
The vector of constituent hits.
const float m_totalWeight
The total hit weight of the contituent hits.
const unsigned int m_numCaloHits
The number of calo hits within the cluster.
unsigned int GetNumCaloHits() const
Returns the number of calo hits within the cluster.
const pandora::CartesianVector & GetLowerXExtrema() const
Returns the lower x extremal point of the constituent hits.
const ConstituentHitVector & GetConstituentHitVector() const
Returns the vector of constituent hits.
const pandora::Cluster * GetClusterAddress() const
Returns the address of the cluster.
const pandora::Cluster * m_pCluster
The address of the cluster.
SortByDistanceToPoint(const pandora::CartesianVector referencePoint)
Constructor.
bool operator()(const ConstituentHit &lhs, const ConstituentHit &rhs)
Sort constituent hits by their position relative to a referencePoint.
const pandora::CartesianVector m_referencePoint
The point relative to which constituent hits are ordered.
float GetHitWidth() const
Returns the constituent hit width.
float m_hitWidth
The width of the constituent hit.
const pandora::Cluster * GetParentClusterAddress() const
Returns the address of the parent cluster.
const pandora::Cluster * m_pParentClusterAddress
The address of the cluster the constituent hit belongs to.
pandora::CartesianVector m_positionVector
The central position of the consituent hit.
const pandora::CartesianVector & GetPositionVector() const
Returns the constituent hit central position.
bool operator()(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by the higher x extremal point of their constituent hits.
const ClusterToParametersMap & m_clusterToParametersMap
The map [cluster -> cluster parameters].
SortByHigherXExtrema(const ClusterToParametersMap &clusterToParametersMap)
Constructor.
LArHitWidthHelper class.
static void GetExtremalCoordinatesX(const ConstituentHitVector &constituentHitVector, pandora::CartesianVector &lowerXCoordinate, pandora::CartesianVector &higherXCoordinate)
Calculate the higher and lower x extremal points of the constituent hits.
static unsigned int GetNProposedConstituentHits(const pandora::Cluster *const pCluster, const float maxConstituentHitWidth, const float hitWidthScalingFactor)
Return the number of constituent hits that a given cluster would be broken into.
std::vector< ConstituentHit > ConstituentHitVector
static void SplitHitIntoConstituents(const pandora::CaloHit *const pCaloHit, const pandora::Cluster *const pCluster, const unsigned int numberOfConstituentHits, const float constituentHitWidth, ConstituentHitVector &constituentHitVector)
Break up the calo hit into constituent hits.
std::unordered_map< const pandora::Cluster *, const ClusterParameters > ClusterToParametersMap
static pandora::CartesianPointVector GetConstituentHitPositionVector(const ConstituentHitVector &constituentHitVector)
Obtain a vector of the contituent hit central positions.
static pandora::CartesianVector GetExtremalCoordinatesHigherX(const ConstituentHitVector &constituentHitVector)
Return the higher x extremal point of the constituent hits.
static const ClusterParameters & GetClusterParameters(const pandora::Cluster *const pCluster, const ClusterToParametersMap &clusterToParametersMap)
Return the cluster parameters of a given cluster, exception thrown if not found in map [cluster -> cl...
static float GetOriginalTotalClusterWeight(const pandora::Cluster *const pCluster)
Sum the widths of the original, unscaled hits contained within a cluster.
static pandora::CartesianVector GetClosestPointToLine2D(const pandora::CartesianVector &lineStart, const pandora::CartesianVector &lineDirection, const pandora::CaloHit *const pCaloHit)
Consider the hit width to find the closest position of a calo hit to a specified line.
static ConstituentHitVector GetConstituentHits(const pandora::Cluster *const pCluster, const float maxConstituentHitWidth, const float hitWidthScalingFactor, const bool isUniform)
Break up the cluster hits into constituent hits.
static float GetClosestDistance(const pandora::CaloHit *const pThisCaloHit, const pandora::CaloHitList &caloHitList)
Find the smallest separation between a hit and a list of hits, with the consideration of their hit wi...
static float GetTotalClusterWeight(const ConstituentHitVector &constituentHitVector)
Sum the widths of constituent hits.
static float GetClosestDistanceToPoint2D(const pandora::CaloHit *const pCaloHit, const pandora::CartesianVector &point2D)
Consider the hit width to find the smallest distance between a calo hit and a given point.
static pandora::CartesianVector GetExtremalCoordinatesLowerX(const ConstituentHitVector &constituentHitVector)
Return the lower x extremal point of the constituent hits.
CaloHit class.
Definition CaloHit.h:26
CartesianVector class.
Cluster class.
Definition Cluster.h:31
std::vector< CartesianVector > CartesianPointVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList