LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
ThreeDReclusteringAlgorithm.h
Go to the documentation of this file.
1 
9 #ifndef LAR_THREE_D_RECLUSTERING_ALGORITHM_H
10 #define LAR_THREE_D_RECLUSTERING_ALGORITHM_H 1
11 
12 #include "Objects/ParticleFlowObject.h"
13 #include "Pandora/Algorithm.h"
14 #include "Pandora/AlgorithmTool.h"
15 #include "Pandora/PandoraInternal.h"
16 
17 namespace lar_content
18 {
19 
20 class ClusteringTool;
21 
22 //------------------------------------------------------------------------------------------------------------------------------------------
23 
27 class ThreeDReclusteringAlgorithm : public pandora::Algorithm
28 {
29 public:
34  {
36  };
37 
42 
47 
48 private:
49  typedef std::vector<ClusteringTool *> ClusteringToolVector;
50 
51  pandora::StatusCode Run();
52 
59  pandora::StatusCode RebuildPfo(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList);
60 
67  pandora::StatusCode BuildNewTwoDClusters(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList);
68 
75  pandora::StatusCode BuildNewPfos(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList);
76 
84  float GetFigureOfMerit(const pandora::CaloHitList &mergedClusterCaloHitList3D);
85 
94  float GetFigureOfMerit(const std::string &figureOfMeritName, const pandora::CaloHitList &mergedClusterCaloHitList3D);
95 
103  float GetFigureOfMerit(const std::vector<pandora::CaloHitList> &newClustersCaloHitList3D);
104 
113  float GetFigureOfMerit(const std::string &figureOfMeritName, const std::vector<pandora::CaloHitList> &newClustersCaloHitLists3D);
114 
122  float GetCheatedFigureOfMerit(const pandora::CaloHitList &mergedClusterCaloHitList3D);
123 
131  bool PassesCutsForReclustering(const pandora::ParticleFlowObject *const pPfo);
132 
133  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
134 
135  ClusteringToolVector m_algorithmToolVector;
136  std::string m_pfoListName;
137  std::string m_clusterListName;
138  pandora::StringVector m_figureOfMeritNames;
140  std::string m_mcParticleListName;
143  std::string m_uClustersListName;
144  std::string m_vClustersListName;
145  std::string m_wClustersListName; //Names of U,V and W cluster lists
146  std::map<int, const pandora::Cluster *> m_newClustersUMap, m_newClustersVMap, m_newClustersWMap;
147 
148  static const std::unordered_map<std::string, ThreeDReclusteringAlgorithm::FigureOfMeritType> m_stringToEnumMap; //Figure of merit type enum to string map
149 };
150 
151 //------------------------------------------------------------------------------------------------------------------------------------------
152 
156 class ClusteringTool : public pandora::AlgorithmTool
157 {
158 public:
159  ClusteringTool() = default;
160  ~ClusteringTool() = default;
161  virtual bool Run(const pandora::CaloHitList &inputCaloHitList, std::vector<pandora::CaloHitList> &outputCaloHitListsVector) = 0;
162 };
163 
164 } // namespace lar_content
165 
166 #endif // #ifndef LAR_THREE_D_RECLUSTERING_ALGORITHM_H
pandora::StatusCode BuildNewPfos(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList)
Create new Pfos for each new ThreeD cluster in newClustersList.
std::map< int, const pandora::Cluster * > m_newClustersVMap
std::string m_clusterListName
Name of the list of clusters to consider for reclustering.
std::string m_PfosForReclusteringListName
Name of the internal list to contain new Pfos before/after reclustering.
float m_fomThresholdForReclustering
A threshold on the minimum figure of merit for reclustering.
std::string m_pfoListName
Name of the list of pfos to consider for reclustering.
pandora::StatusCode RebuildPfo(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList)
Create new TwoD clusters and Pfos for each new ThreeD cluster in newClustersList. ...
std::map< int, const pandora::Cluster * > m_newClustersWMap
Per-view maps associating new 3D clusters with new 2D clusters.
float GetCheatedFigureOfMerit(const pandora::CaloHitList &mergedClusterCaloHitList3D)
Get cheated FOM as an impurity: the fraction of hits that are NOT contributed by the main MC particle...
static const std::unordered_map< std::string, ThreeDReclusteringAlgorithm::FigureOfMeritType > m_stringToEnumMap
FigureOfMeritType
FigureOfMerit type enumeration.
std::vector< ClusteringTool * > ClusteringToolVector
std::string m_mcParticleListName
The mc particle list name.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
std::map< int, const pandora::Cluster * > m_newClustersUMap
float GetFigureOfMerit(const pandora::CaloHitList &mergedClusterCaloHitList3D)
Loop over all specified figure of merit names, calculate figures of merit for the CaloHitList under c...
bool PassesCutsForReclustering(const pandora::ParticleFlowObject *const pPfo)
Select pfos to be reclustered if it passes reclustering criteria.
ClusteringToolVector m_algorithmToolVector
The reclustering algorithm tool vector.
pandora::StringVector m_figureOfMeritNames
The names of the figures of merit to use.
pandora::StatusCode BuildNewTwoDClusters(const pandora::Pfo *pPfoToRebuild, pandora::ClusterList &newClustersList)
Create new TwoD clusters for each new ThreeD cluster in newClustersList.