21 m_minClusterLayers(4),
24 m_maxGapDistanceSquared(10.f),
25 m_minCosRelativeAngle(0.985f),
26 m_maxTransverseDisplacement(2.f),
27 m_maxLongitudinalDisplacement(2.f),
37 for (ClusterList::const_iterator iter = pClusterList->begin(), iterEnd = pClusterList->end(); iter != iterEnd; ++iter)
39 const Cluster *
const pCluster = *iter;
44 clusterVector.push_back(pCluster);
55 for (ClusterVector::const_iterator iterI = clusterVector.begin(), iterIEnd = clusterVector.end(); iterI != iterIEnd; ++iterI)
57 const Cluster *
const pInnerCluster = *iterI;
59 for (ClusterVector::const_iterator iterJ = iterI, iterJEnd = clusterVector.end(); iterJ != iterJEnd; ++iterJ)
61 const Cluster *
const pOuterCluster = *iterJ;
63 if (pInnerCluster == pOuterCluster)
69 clusterAssociationMap[pInnerCluster].m_forwardAssociations.insert(pOuterCluster);
70 clusterAssociationMap[pOuterCluster].m_backwardAssociations.insert(pInnerCluster);
82 if (isForward && ((testLayer > currentLayer) || ((testLayer == currentLayer) &&
LArClusterHelper::SortByNHits(pTestCluster, pCurrentCluster))))
85 if (!isForward && ((testLayer < currentLayer) || ((testLayer == currentLayer) &&
LArClusterHelper::SortByNHits(pTestCluster, pCurrentCluster))))
154 const CartesianVector clusterSeparation(outerClusterStart - innerClusterEnd);
166 const CartesianVector fittedInnerSeparation(innerEndFit2 - innerEndFit1);
172 const CartesianVector fittedOuterSeparation(outerStartFit2 - outerStartFit1);
Header file for the cluster helper class.
Header file for the longitudinal association algorithm class.
#define PANDORA_THROW_RESULT_IF(StatusCode1, Operator, Command)
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
std::unordered_map< const pandora::Cluster *, ClusterAssociation > ClusterAssociationMap
static bool SortByInnerLayer(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by inner layer, then position, then pulse-height.
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position,...
unsigned int m_fitLayers
number of layers to fit at start and end of cluster
unsigned int m_minClusterLayers
minimum allowed number of layers for a clean cluster
bool AreClustersAssociated(const pandora::Cluster *const pInnerCluster, const pandora::Cluster *const pOuterCluster) const
Determine whether two clusters are associated.
float m_maxGapDistanceSquared
maximum allowed distance (squared) between associated clusters
void PopulateClusterAssociationMap(const pandora::ClusterVector &clusterVector, ClusterAssociationMap &clusterAssociationMap) const
Populate the cluster association map.
float m_maxLongitudinalDisplacement
maximum allowed longitudinal displacement after extrapolation (normalised to cell size)
void GetListOfCleanClusters(const pandora::ClusterList *const pClusterList, pandora::ClusterVector &clusterVector) const
Populate cluster vector with subset of cluster list, containing clusters judged to be clean.
bool IsExtremalCluster(const bool isForward, const pandora::Cluster *const pCurrentCluster, const pandora::Cluster *const pTestCluster) const
Determine which of two clusters is extremal.
float m_minCosRelativeAngle
maximum allowed relative angle between associated clusters
float m_hitSizeX
estimated hit size in x (drift time) dimension, units cm
float m_maxTransverseDisplacement
maximum allowed transverse displacement after extrapolation (normalised to cell size)
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float m_hitSizeZ
estimated hit size in z (wire number) dimension, units cm
unsigned int m_maxGapLayers
maximum allowed number of layers between associated clusters
LongitudinalAssociationAlgorithm()
Default constructor.
float GetCosOpeningAngle(const CartesianVector &rhs) const
Get the cosine of the opening angle of the cartesian vector with respect to a second cartesian vector...
float GetX() const
Get the cartesian x coordinate.
float GetZ() const
Get the cartesian z coordinate.
float GetDotProduct(const CartesianVector &rhs) const
Get the dot product of the cartesian vector with a second cartesian vector.
static StatusCode FitStart(const Cluster *const pCluster, const unsigned int maxOccupiedLayers, ClusterFitResult &clusterFitResult)
Fit points in first n occupied pseudolayers of a cluster.
static StatusCode FitEnd(const Cluster *const pCluster, const unsigned int maxOccupiedLayers, ClusterFitResult &clusterFitResult)
Fit points in last n occupied pseudolayers of a cluster.
const CartesianVector & GetDirection() const
Get the fit direction.
bool IsFitSuccessful() const
Query whether fit was successful.
const CartesianVector & GetIntercept() const
Get the fit intercept.
unsigned int GetOuterPseudoLayer() const
Get the outermost pseudo layer in the cluster.
unsigned int GetInnerPseudoLayer() const
Get the innermost pseudo layer in the cluster.
const CartesianVector GetCentroid(const unsigned int pseudoLayer) const
Get unweighted centroid for cluster at a particular pseudo layer, calculated using cached values of h...
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.