9 #include "Pandora/AlgorithmHeaders.h"
21 ThreeViewRemnantsAlgorithm::ThreeViewRemnantsAlgorithm() :
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;
37 if (!pCluster->IsAvailable())
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);
53 pClusterU->GetClusterSpanX(xMinU, xMaxU);
54 pClusterV->GetClusterSpanX(xMinV, xMaxV);
55 pClusterW->GetClusterSpanX(xMinW, xMaxW);
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(
85 pseudoChi2 + pClusterU->GetElectromagneticEnergy() + pClusterV->GetElectromagneticEnergy() + pClusterW->GetElectromagneticEnergy());
93 unsigned int repeatCounter(0);
97 if ((*iter)->Run(
this,
this->GetMatchingControl().GetOverlapTensor()))
115 AlgorithmToolVector algorithmToolVector;
116 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*
this, xmlHandle,
"TrackTools", algorithmToolVector));
118 for (AlgorithmToolVector::const_iterator iter = algorithmToolVector.begin(), iterEnd = algorithmToolVector.end(); iter != iterEnd; ++iter)
120 RemnantTensorTool *
const pRemnantTensorTool(dynamic_cast<RemnantTensorTool *>(*iter));
122 if (!pRemnantTensorTool)
123 return STATUS_CODE_INVALID_PARAMETER;
128 PANDORA_RETURN_RESULT_IF_AND_IF(
129 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"NMaxTensorToolRepeats",
m_nMaxTensorToolRepeats));
131 PANDORA_RETURN_RESULT_IF_AND_IF(
132 STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"MinClusterCaloHits",
m_minClusterCaloHits));
134 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"OverlapWindow",
m_xOverlapWindow));
136 PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle,
"PseudoChi2Cut",
m_pseudoChi2Cut));
float m_pseudoChi2Cut
The selection cut on the matched chi2.
TensorType & GetOverlapTensor()
Get the overlap tensor.
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.
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.
RemnantTensorToolVector m_algorithmToolVector
The algorithm tool list.
MatchingType & GetMatchingControl()
Get the matching control.
Header file for the geometry helper class.
void SetOverlapResult(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, const OverlapResult &overlapResult)
Set overlap result.
Header file for the cluster helper class.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
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).
void ExamineOverlapContainer()
Examine contents of overlap container, collect together best-matching 2D particles and modify cluster...
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
unsigned int m_minClusterCaloHits
The selection cut on the number of cluster calo hits.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
float m_xOverlapWindow
The sampling pitch in the x coordinate.
unsigned int m_nMaxTensorToolRepeats
The maximum number of repeat loops over tensor tools.
Header file for the three view remnants algorithm class.
void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.