22 m_nMaxTensorToolRepeats(1000),
23 m_minClusterCaloHits(5),
24 m_xOverlapWindow(2.f),
33 for (ClusterList::const_iterator iter = pInputClusterList->begin(), iterEnd = pInputClusterList->end(); iter != iterEnd; ++iter)
35 const Cluster *
const pCluster = *iter;
43 selectedClusterList.push_back(pCluster);
52 float xMinU(0.f), xMinV(0.f), xMinW(0.f), xMaxU(0.f), xMaxV(0.f), xMaxW(0.f);
57 const float xMin(std::max(xMinU, std::max(xMinV, xMinW)) -
m_xOverlapWindow);
58 const float xMax(std::min(xMaxU, std::min(xMaxV, xMaxW)) +
m_xOverlapWindow);
59 const float xOverlap(xMax - xMin);
61 if (xOverlap < std::numeric_limits<float>::epsilon())
65 float u(std::numeric_limits<float>::max()), v(std::numeric_limits<float>::max()), w(std::numeric_limits<float>::max());
78 const float pseudoChi2(((u - vw2u) * (u - vw2u) + (v - wu2v) * (v - wu2v) + (w - uv2w) * (w - uv2w)) / 3.f);
84 const float hackValue(
93 unsigned int repeatCounter(0);
97 if ((*iter)->Run(
this, this->GetMatchingControl().GetOverlapTensor()))
118 for (AlgorithmToolVector::const_iterator iter = algorithmToolVector.begin(), iterEnd = algorithmToolVector.end(); iter != iterEnd; ++iter)
122 if (!pRemnantTensorTool)
123 return STATUS_CODE_INVALID_PARAMETER;
Header file for the cluster helper class.
Header file for the geometry helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the three view remnants algorithm class.
static pandora::StatusCode GetAverageZ(const pandora::Cluster *const pCluster, const float xmin, const float xmax, float &averageZ)
Get average Z positions of the calo hits in a cluster in range xmin to xmax.
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
MatchingType & GetMatchingControl()
Get the matching control.
void SetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Set overlap result.
TensorType & GetOverlapTensor()
Get the overlap tensor.
void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
unsigned int m_minClusterCaloHits
The selection cut on the number of cluster calo hits.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
ThreeViewRemnantsAlgorithm()
Default constructor.
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
float m_pseudoChi2Cut
The selection cut on the matched chi2.
RemnantTensorToolVector m_algorithmToolVector
The algorithm tool list.
void CalculateOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW)
Calculate cluster overlap result and store in container.
float m_xOverlapWindow
The sampling pitch in the x coordinate.
bool IsAvailable() const
Whether the cluster is available to be added to a particle flow object.
unsigned int GetNCaloHits() const
Get the number of calo hits in the cluster.
float GetElectromagneticEnergy() const
Get the sum of electromagnetic energy measures of all constituent calo hits, units GeV.
void GetClusterSpanX(float &xmin, float &xmax) const
Get minimum and maximum X positions of the calo hits in this cluster.
const Pandora & GetPandora() const
Get the associated pandora instance.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
static StatusCode ProcessAlgorithmToolList(const Algorithm &algorithm, const TiXmlHandle &xmlHandle, const std::string &listName, AlgorithmToolVector &algorithmToolVector)
Process a list of algorithms tools in an xml file.
MANAGED_CONTAINER< const Cluster * > ClusterList
std::vector< AlgorithmTool * > AlgorithmToolVector
StatusCode
The StatusCode enum.