19 m_maxTransverseDisplacement(1.f),
20 m_minAssociatedSpan(1.f),
21 m_minAssociatedFraction(0.5f)
32 const Cluster *
const pClusterI = slidingFitResultI.GetCluster();
35 for (
const Cluster *
const pClusterJ : showerClustersJ)
39 if (pClusterI == pClusterJ)
42 if (2.f * thisLengthSquaredJ > thisLengthSquaredI)
45 this->
GetReclusteredHits(slidingFitResultI, pClusterJ, caloHitsToAddI, caloHitsToRemoveJ);
60 float minL(std::numeric_limits<float>::max());
61 float maxL(std::numeric_limits<float>::max());
77 for (CaloHitList::const_iterator iterJ = caloHitListJ.begin(), iterEndJ = caloHitListJ.end(); iterJ != iterEndJ; ++iterJ)
79 const CaloHit *
const pCaloHitJ = *iterJ;
84 float rL(0.f), rT(0.f);
92 const float rsqIJ((positionI - positionJ).GetMagnitudeSquared());
93 const float rsqJK((positionJ - positionK).GetMagnitudeSquared());
94 const float rsqKI((positionK - positionI).GetMagnitudeSquared());
98 if (associatedHits.empty())
105 minL = std::min(minL, rL);
106 maxL = std::max(maxL, rL);
109 associatedHits.push_back(pCaloHitJ);
113 const float associatedSpan(maxL - minL);
114 const float associatedFraction(
115 associatedHits.empty() ? 0.f :
static_cast<float>(associatedHits.size()) /
static_cast<float>(pClusterJ->
GetNCaloHits()));
119 for (CaloHitList::const_iterator iterK = associatedHits.begin(), iterEndK = associatedHits.end(); iterK != iterEndK; ++iterK)
121 const CaloHit *
const pCaloHit = *iterK;
122 const CaloHitList &caloHitList(caloHitsToRemoveJ[pClusterJ]);
124 if (caloHitList.end() != std::find(caloHitList.begin(), caloHitList.end(), pCaloHit))
127 caloHitsToAddI[pClusterI].push_back(pCaloHit);
128 caloHitsToRemoveJ[pClusterJ].push_back(pCaloHit);
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Header file for the track consolidation algorithm class.
static pandora::CartesianVector GetClosestPosition(const pandora::CartesianVector &position, const pandora::ClusterList &clusterList)
Get closest position in a list of clusters to a specified input position vector.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
float m_maxTransverseDisplacement
float m_minAssociatedSpan
void GetReclusteredHits(const TwoDSlidingFitResultList &slidingFitResultList, const pandora::ClusterVector &showerClusters, ClusterToHitMap &caloHitsToAdd, ClusterToHitMap &caloHitsToRemove) const
Get the list of hits to be added to track clusters and removed from shower clusters.
float m_minAssociatedFraction
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
TrackConsolidationAlgorithm()
Default constructor.
std::unordered_map< const pandora::Cluster *, pandora::CaloHitList > ClusterToHitMap
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
TwoDSlidingFitResult class.
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
pandora::StatusCode GetGlobalFitProjection(const pandora::CartesianVector &inputPosition, pandora::CartesianVector &projectedPosition) const
Get projected position on global fit for a given position vector.
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
unsigned int GetNCaloHits() const
Get the number of calo hits in the cluster.
const OrderedCaloHitList & GetOrderedCaloHitList() const
Get the ordered calo hit list.
void FillCaloHitList(CaloHitList &caloHitList) const
Fill a provided calo hit list with all the calo hits in the ordered calo hit list.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
std::vector< TwoDSlidingFitResult > TwoDSlidingFitResultList
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const CaloHit * > CaloHitList
StatusCode
The StatusCode enum.