LArSoft  v10_06_00
Liquid Argon Software toolkit - https://larsoft.org/
RandomFigureOfMeritTool.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
12 
13 using namespace pandora;
14 
15 namespace lar_content
16 {
17 
18 RandomFigureOfMeritTool::RandomFigureOfMeritTool() :
19  m_maxFomToRecluster{0.5f}
20 {
21 }
22 
23 //------------------------------------------------------------------------------------------------------------------------------------------
24 
25 StatusCode RandomFigureOfMeritTool::GetPfosToRecluster(const PfoList *pPfos, PfoList &pfosToRecluster)
26 {
27  if (!pfosToRecluster.empty())
28  return STATUS_CODE_FAILURE;
29 
30  for (const Pfo *const pPfo : *pPfos)
31  {
32  if (pPfo->GetNClusters() == 0)
33  continue;
35  pfosToRecluster.emplace_back(pPfo);
36  }
37 
38  return STATUS_CODE_SUCCESS;
39 }
40 
41 //------------------------------------------------------------------------------------------------------------------------------------------
42 
43 StatusCode RandomFigureOfMeritTool::CalcClusteringFom([[maybe_unused]] const ClusterList &clusters, float &fom)
44 {
45  fom = GetRandomFom();
46 
47  return STATUS_CODE_SUCCESS;
48 }
49 
50 //------------------------------------------------------------------------------------------------------------------------------------------
51 
52 StatusCode RandomFigureOfMeritTool::ReadSettings(const TiXmlHandle xmlHandle)
53 {
54  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ReadValue(xmlHandle, "MaxFomToRecluster", m_maxFomToRecluster));
55 
56  return STATUS_CODE_SUCCESS;
57 }
58 
59 } // namespace lar_content
float m_maxFomToRecluster
threshold figure of merit for reclustering a pfo
pandora::StatusCode GetPfosToRecluster(const pandora::PfoList *pPfos, pandora::PfoList &pfosToRecluster)
Identify pfos for which an attempt at 3D reclustering should be made.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
pandora::StatusCode CalcClusteringFom(const pandora::ClusterList &clusters, float &fom)
Calculate a measure of the goodness of a clustering.