27 m_pInputClusterListU(nullptr),
28 m_pInputClusterListV(nullptr),
29 m_pInputClusterListW(nullptr)
45 return m_overlapTensor;
60 if (clusterList.end() != std::find(clusterList.begin(), clusterList.end(), pNewCluster))
63 clusterList.push_back(pNewCluster);
68 ClusterVector clusterVector2(clusterList2.begin(), clusterList2.end());
69 ClusterVector clusterVector3(clusterList3.begin(), clusterList3.end());
73 for (
const Cluster *
const pCluster2 : clusterVector2)
75 for (
const Cluster *
const pCluster3 : clusterVector3)
79 m_pAlgorithm->CalculateOverlapResult(pNewCluster, pCluster2, pCluster3);
83 m_pAlgorithm->CalculateOverlapResult(pCluster2, pNewCluster, pCluster3);
87 m_pAlgorithm->CalculateOverlapResult(pCluster2, pCluster3, pNewCluster);
98 ClusterList::iterator iterU = std::find(m_clusterListU.begin(), m_clusterListU.end(), pDeletedCluster);
99 ClusterList::iterator iterV = std::find(m_clusterListV.begin(), m_clusterListV.end(), pDeletedCluster);
100 ClusterList::iterator iterW = std::find(m_clusterListW.begin(), m_clusterListW.end(), pDeletedCluster);
102 if (m_clusterListU.end() != iterU)
103 m_clusterListU.erase(iterU);
105 if (m_clusterListV.end() != iterV)
106 m_clusterListV.erase(iterV);
108 if (m_clusterListW.end() != iterW)
109 m_clusterListW.erase(iterW);
111 m_overlapTensor.RemoveCluster(pDeletedCluster);
120 return m_inputClusterListNameU;
123 return m_inputClusterListNameV;
126 return m_inputClusterListNameW;
136 if ((
TPC_VIEW_U == hitType) && m_pInputClusterListU)
137 return (*m_pInputClusterListU);
139 if ((
TPC_VIEW_V == hitType) && m_pInputClusterListV)
140 return (*m_pInputClusterListV);
142 if ((
TPC_VIEW_W == hitType) && m_pInputClusterListW)
143 return (*m_pInputClusterListW);
154 return m_clusterListU;
157 return m_clusterListV;
160 return m_clusterListW;
177 if (!m_pInputClusterListU || !m_pInputClusterListV || !m_pInputClusterListW)
180 std::cout <<
"ThreeViewMatchingControl: one or more input cluster lists unavailable." << std::endl;
185 m_pAlgorithm->SelectInputClusters(m_pInputClusterListU, m_clusterListU);
186 m_pAlgorithm->SelectInputClusters(m_pInputClusterListV, m_clusterListV);
187 m_pAlgorithm->SelectInputClusters(m_pInputClusterListW, m_clusterListW);
195 m_pAlgorithm->PrepareInputClusters(m_clusterListU);
196 m_pAlgorithm->PrepareInputClusters(m_clusterListV);
197 m_pAlgorithm->PrepareInputClusters(m_clusterListW);
205 m_overlapTensor.Clear();
207 m_pInputClusterListU =
nullptr;
208 m_pInputClusterListV =
nullptr;
209 m_pInputClusterListW =
nullptr;
211 m_clusterListU.clear();
212 m_clusterListV.clear();
213 m_clusterListW.clear();
221 ClusterVector clusterVectorU(m_clusterListU.begin(), m_clusterListU.end());
222 ClusterVector clusterVectorV(m_clusterListV.begin(), m_clusterListV.end());
223 ClusterVector clusterVectorW(m_clusterListW.begin(), m_clusterListW.end());
228 for (
const Cluster *
const pClusterU : clusterVectorU)
230 for (
const Cluster *
const pClusterV : clusterVectorV)
232 for (
const Cluster *
const pClusterW : clusterVectorW)
233 m_pAlgorithm->CalculateOverlapResult(pClusterU, pClusterV, pClusterW);
247 return STATUS_CODE_SUCCESS;
Header file for the cluster helper class.
Header file for the lar shower overlap result class.
Header file for the lar track overlap result class.
Header file for the three dimension algorithm base class.
#define PANDORA_THROW_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
#define PANDORA_RETURN_RESULT_IF(StatusCode1, Operator, Command)
Header file for the three view matching control class.
static pandora::StatusCode GetList(const pandora::Algorithm &algorithm, const std::string &listName, const T *&pT)
Get a named list.
static const pandora::PandoraSettings * GetSettings(const pandora::Algorithm &algorithm)
Get the pandora settings instance.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
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,...
MatchingBaseAlgorithm class.
NViewMatchingControl class.
ThreeViewMatchingControl class.
void SelectAllInputClusters()
Select a subset of input clusters for processing in this algorithm.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from xml.
void PerformMainLoop()
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
ThreeViewMatchingControl(MatchingBaseAlgorithm *const pAlgorithm)
Constructor.
void PrepareAllInputClusters()
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results.
const pandora::ClusterList & GetSelectedClusterList(const pandora::HitType hitType) const
Get the selected cluster list corresponding to a specified hit type.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
virtual ~ThreeViewMatchingControl()
Destructor.
TensorType & GetOverlapTensor()
Get the overlap tensor.
const pandora::ClusterList & GetInputClusterList(const pandora::HitType hitType) const
Get the input cluster list corresponding to a specified hit type.
void TidyUp()
Tidy member variables.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
const std::string & GetClusterListName(const pandora::HitType hitType) const
Get the cluster list name corresponding to a specified hit type.
bool ShouldDisplayAlgorithmInfo() const
Whether to display algorithm information during processing.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
StatusCode
The StatusCode enum.