9 #include "Pandora/AlgorithmHeaders.h" 26 m_pInputClusterList1(nullptr),
27 m_pInputClusterList2(nullptr)
54 throw StatusCodeException(STATUS_CODE_FAILURE);
68 throw StatusCodeException(STATUS_CODE_FAILURE);
72 if (clusterList.end() != std::find(clusterList.begin(), clusterList.end(), pNewCluster))
73 throw StatusCodeException(STATUS_CODE_ALREADY_PRESENT);
75 clusterList.push_back(pNewCluster);
77 const ClusterList &clusterList2((1 == iter->second) ? m_clusterList2 :
m_clusterList1);
79 ClusterVector clusterVector2(clusterList2.begin(), clusterList2.end());
82 for (
const Cluster *
const pCluster2 : clusterVector2)
84 if (1 == iter->second)
114 template <
typename T>
119 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
121 if ((1 != iter->second) && (2 != iter->second))
122 throw StatusCodeException(STATUS_CODE_FAILURE);
129 template <
typename T>
134 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
142 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
147 template <
typename T>
152 throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
154 if ((1 != iter->second) && (2 != iter->second))
155 throw StatusCodeException(STATUS_CODE_FAILURE);
162 template <
typename T>
165 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=,
167 PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_INITIALIZED, !=,
172 if (PandoraContentApi::GetSettings(*m_pAlgorithm)->ShouldDisplayAlgorithmInfo())
173 std::cout <<
"TwoViewMatchingControl: one or more input cluster lists unavailable." <<
std::endl;
175 throw StatusCodeException(STATUS_CODE_SUCCESS);
190 template <
typename T>
199 template <
typename T>
214 template <
typename T>
222 for (
const Cluster *
const pCluster1 : clusterVector1)
224 for (
const Cluster *
const pCluster2 : clusterVector2)
231 template <
typename T>
234 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"InputClusterListName1",
m_inputClusterListName1));
235 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle,
"InputClusterListName2",
m_inputClusterListName2));
237 return STATUS_CODE_SUCCESS;
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.
void UpdateForNewCluster(const pandora::Cluster *const pNewCluster)
Update to reflect addition of a new cluster to the problem space.
TwoViewMatchingControl class.
const std::string & GetClusterListName(const pandora::HitType hitType) const
Get the cluster list name corresponding to a specified hit type.
void Clear()
Clear overlap matrix.
NViewMatchingControl class.
MatchingBaseAlgorithm * m_pAlgorithm
The address of the matching base algorithm.
void RemoveCluster(const pandora::Cluster *const pCluster)
Remove entries from matrix corresponding to specified cluster.
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.
pandora::ClusterList m_clusterList1
The selected modified cluster list 1.
void TidyUp()
Tidy member variables.
MatrixType & GetOverlapMatrix()
Get the overlap matrix.
virtual void SelectInputClusters(const pandora::ClusterList *const pInputClusterList, pandora::ClusterList &selectedClusterList) const
Select a subset of input clusters for processing in this algorithm.
void UpdateUponDeletion(const pandora::Cluster *const pDeletedCluster)
Update to reflect cluster deletion.
MatchingBaseAlgorithm class.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
void SelectAllInputClusters()
Select a subset of input clusters for processing in this algorithm.
std::string m_inputClusterListName2
The name of the view 2 cluster list.
const pandora::ClusterList & GetInputClusterList(const pandora::HitType hitType) const
Get the input cluster list corresponding to a specified hit type.
MatrixType m_overlapMatrix
The overlap matrix.
const pandora::ClusterList * m_pInputClusterList1
Address of the input cluster list 1.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read settings from xml.
pandora::ClusterList m_clusterList2
The selected modified cluster list 2.
HitTypeToIndexMap m_hitTypeToIndexMap
The hit type to index map.
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.
void PrepareAllInputClusters()
Perform any preparatory steps required on the input clusters, e.g. caching expensive fit results...
virtual ~TwoViewMatchingControl()
Destructor.
unsigned int GetHitTypeIndex(const pandora::HitType hitType)
Get the index of an input hit type returning 0 if not found in map.
const pandora::ClusterList & GetSelectedClusterList(const pandora::HitType hitType) const
Get the selected cluster list corresponding to a specified hit type.
std::string m_inputClusterListName1
The name of the view 1 cluster list.
void PerformMainLoop()
Main loop over cluster combinations in order to populate the overlap container. Responsible for calli...
const pandora::ClusterList * m_pInputClusterList2
Address of the input cluster list 2.
std::vector< art::Ptr< recob::Cluster > > ClusterVector
Header file for the two view matching control class.
Header file for the lar track two view overlap result class.
QTextStream & endl(QTextStream &s)
Header file for the three dimension algorithm base class.