9 #include "Pandora/AlgorithmHeaders.h" 21 TwoDSlidingFitSplittingAlgorithm::TwoDSlidingFitSplittingAlgorithm() :
22 m_slidingFitHalfWindow(20),
23 m_minClusterLength(10.
f)
32 return STATUS_CODE_NOT_FOUND;
39 CartesianVector splitPosition(0.
f, 0.
f, 0.
f);
43 return this->
DivideCaloHits(slidingFitResult, splitPosition, firstHitList, secondHitList);
46 catch (StatusCodeException &statusCodeException)
48 if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
49 throw statusCodeException;
52 return STATUS_CODE_NOT_FOUND;
58 const CartesianVector &splitPosition, CaloHitList &firstCaloHitList, CaloHitList &secondCaloHitList)
const 60 float rL(0.
f), rT(0.
f);
63 const Cluster *
const pCluster(slidingFitResult.
GetCluster());
64 const OrderedCaloHitList &orderedCaloHitList(pCluster->GetOrderedCaloHitList());
68 for (
CaloHitList::const_iterator hitIter = iter->second->begin(), hitIterEnd = iter->second->end(); hitIter != hitIterEnd; ++hitIter)
70 const CaloHit *
const pCaloHit = *hitIter;
72 float thisL(0.
f), thisT(0.
f);
73 slidingFitResult.
GetLocalPosition(pCaloHit->GetPositionVector(), thisL, thisT);
77 firstCaloHitList.push_back(pCaloHit);
81 secondCaloHitList.push_back(pCaloHit);
86 if (firstCaloHitList.empty() || secondCaloHitList.empty())
87 return STATUS_CODE_NOT_FOUND;
89 return STATUS_CODE_SUCCESS;
96 PANDORA_RETURN_RESULT_IF_AND_IF(
97 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"SlidingFitHalfWindow",
m_slidingFitHalfWindow));
99 PANDORA_RETURN_RESULT_IF_AND_IF(
100 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinClusterLength",
m_minClusterLength));
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
virtual pandora::StatusCode FindBestSplitPosition(const TwoDSlidingFitResult &slidingFitResult, pandora::CartesianVector &splitPosition) const =0
Use sliding linear fit to identify the best split position.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
unsigned int m_slidingFitHalfWindow
Header file for the geometry helper class.
pandora::StatusCode DivideCaloHits(const pandora::Cluster *const pCluster, pandora::CaloHitList &firstCaloHitList, pandora::CaloHitList &secondCaloHitList) const
Divide calo hits in a cluster into two lists, each associated with a separate fragment cluster...
Header file for the cluster helper class.
static float GetWirePitch(const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
const pandora::Cluster * GetCluster() const
Get the address of the cluster, if originally provided.
Header file for the two dimensional sliding fit splitting algorithm class.
static float GetLengthSquared(const pandora::Cluster *const pCluster)
Get length squared of cluster.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void GetLocalPosition(const pandora::CartesianVector &position, float &rL, float &rT) const
Get local sliding fit coordinates for a given global position.
TwoDSlidingFitResult class.