9 #include "Pandora/AlgorithmHeaders.h" 27 m_pInputClusterListU(nullptr),
28 m_pInputClusterListV(nullptr),
29 m_pInputClusterListW(nullptr)
55 if (!((TPC_VIEW_U == hitType) || (TPC_VIEW_V == hitType) || (TPC_VIEW_W == hitType)))
56 throw StatusCodeException(STATUS_CODE_FAILURE);
60 if (clusterList.end() != std::find(clusterList.begin(), clusterList.end(), pNewCluster))
61 throw StatusCodeException(STATUS_CODE_ALREADY_PRESENT);
63 clusterList.push_back(pNewCluster);
66 const ClusterList &clusterList3((TPC_VIEW_W == hitType) ?
m_clusterListV : m_clusterListW);
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)
77 if (TPC_VIEW_U == hitType)
81 else if (TPC_VIEW_V == hitType)
116 template <
typename T>
119 if (TPC_VIEW_U == hitType)
122 if (TPC_VIEW_V == hitType)
125 if (TPC_VIEW_W == hitType)
128 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
133 template <
typename T>
145 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
150 template <
typename T>
153 if (TPC_VIEW_U == hitType)
156 if (TPC_VIEW_V == hitType)
159 if (TPC_VIEW_W == hitType)
162 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
167 template <
typename T>
170 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=,
172 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=,
174 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=,
179 if (PandoraContentApi::GetSettings(*m_pAlgorithm)->ShouldDisplayAlgorithmInfo())
180 std::cout <<
"ThreeViewMatchingControl: one or more input cluster lists unavailable." <<
std::endl;
182 throw StatusCodeException(STATUS_CODE_SUCCESS);
192 template <
typename T>
202 template <
typename T>
218 template <
typename T>
228 for (
const Cluster *
const pClusterU : clusterVectorU)
230 for (
const Cluster *
const pClusterV : clusterVectorV)
232 for (
const Cluster *
const pClusterW : clusterVectorW)
240 template <
typename T>
243 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"InputClusterListNameU",
m_inputClusterListNameU));
244 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"InputClusterListNameV",
m_inputClusterListNameV));
245 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"InputClusterListNameW",
m_inputClusterListNameW));
247 return STATUS_CODE_SUCCESS;
ThreeViewMatchingControl class.
pandora::ClusterList m_clusterListW
The selected modified cluster list W.
pandora::ClusterList m_clusterListU
The selected modified cluster list U.
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, then pulse-height.
std::string m_inputClusterListNameW
The name of the view W cluster list.
NViewMatchingControl class.
MatchingBaseAlgorithm * m_pAlgorithm
The address of the matching base algorithm.
TensorType & GetOverlapTensor()
Get the overlap tensor.
pandora::ClusterList m_clusterListV
The selected modified cluster list V.
void PerformMainLoop()
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
virtual void CalculateOverlapResult(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3=nullptr)=0
Calculate cluster overlap result and store in container.
virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
MatchingBaseAlgorithm class.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from xml.
void Clear()
Clear overlap tensor.
std::string m_inputClusterListNameV
The name of the view V cluster list.
void PrepareAllInputClusters()
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results...
virtual void PrepareInputClusters(pandora::ClusterList &preparedClusterList)
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results...
Header file for the cluster helper class.
const std::string & GetClusterListName(const pandora::HitType hitType) const
Get the cluster list name corresponding to a specified hit type.
Header file for the lar shower overlap result class.
const pandora::ClusterList * m_pInputClusterListU
Address of the input cluster list U.
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.
TensorType m_overlapTensor
The overlap tensor.
Header file for the lar track overlap result class.
const pandora::ClusterList * m_pInputClusterListV
Address of the input cluster list V.
Header file for the three view matching control class.
const pandora::ClusterList * m_pInputClusterListW
Address of the input cluster list W.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
const pandora::ClusterList & GetSelectedClusterList(const pandora::HitType hitType) const
Get the selected cluster list corresponding to a specified hit type.
void RemoveCluster(const pandora::Cluster *const pCluster)
Remove entries from tensor corresponding to specified cluster.
std::string m_inputClusterListNameU
The name of the view U cluster list.
virtual ~ThreeViewMatchingControl()
Destructor.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
void SelectAllInputClusters()
Select a subset of input clusters for processing in this algorithm.
QTextStream & endl(QTextStream &s)
Header file for the three dimension algorithm base class.