APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
ChargedFragmentsMergingAlgorithm3.h
Go to the documentation of this file.
1 /*
3  *
4  * ChargedFragmentsMergingAlgorithm3.h header template automatically generated by a class generator
5  * Creation date : jeu. avr. 9 2015
6  *
7  * This file is part of APRILContent libraries.
8  *
9  * APRILContent is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  * based upon these libraries are permitted. Any copy of these libraries
14  * must include this copyright notice.
15  *
16  * APRILContent is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with APRILContent. If not, see <http://www.gnu.org/licenses/>.
23  *
24  * @author Remi Ete
25  * @copyright CNRS , IPNL
26  */
27 
28 
29 #ifndef CHARGEDFRAGMENTSMERGINGALGORITHM3_H
30 #define CHARGEDFRAGMENTSMERGINGALGORITHM3_H
31 
32 #include "Pandora/Algorithm.h"
33 #include "Pandora/PandoraInputTypes.h"
35 
38 
39 namespace pandora { class ClusterFitResult; }
40 
41 namespace april_content
42 {
43 
47 class ChargedFragmentsMergingAlgorithm3 : public pandora::Algorithm
48 {
49 public:
53  class Factory : public pandora::AlgorithmFactory
54  {
55  public:
56  pandora::Algorithm *CreateAlgorithm() const;
57  };
58 
59 private:
60  pandora::StatusCode Run();
61  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
62 
63  april_content::APRILCluster* GetMainCluster(const pandora::CaloHitVector& caloHitVector);
64 
65  void GetNearbyClusters(pandora::Cluster* cluster, const std::vector<april_content::APRILCluster*>& clusterVector,
66  std::vector<april_content::APRILCluster*>& clustersInRange);
67 
68  bool CheckNearbyClusterWithCharge(const april_content::APRILCluster* pCluster, std::vector<april_content::APRILCluster*>& nearbyClusters, int charge);
69 
70  void SearchProperClusters(APRILCluster* startingCluster,
71  std::vector<april_content::APRILCluster*>& allClusters,
72  std::vector<april_content::APRILCluster*>& properClusters,
73  std::vector<float>& distances);
74 
75  void FillClusters(std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap,
76  pandora::Cluster* cluster, pandora::Cluster* clusterToMerge);
77 
78  void MCClusterMerging(const pandora::ClusterList& clustersForMerging);
79 
80  void MergeClusters(std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap);
81 
82  void MakeMergingMap(std::vector<APRILCluster*>& clustersToMerge, std::vector<APRILCluster*>& clusterVector,
83  std::map<const pandora::Cluster*, pandora::ClusterList>& clustersMergingMap);
84 
85  pandora::StatusCode CleanClusterForMerging(std::vector<APRILCluster*>& clusterVector);
86 
87  bool CheckStartingPoints(const pandora::Cluster* chargedCluster, const pandora::Cluster* fragment);
88 
94  pandora::StatusCode GetEligibleClusters(std::vector<APRILCluster*>& clusterVector) const;
95 
102  pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const;
103 
111  bool CanMergeCluster(const pandora::Cluster *const pCluster) const;
112 
120  pandora::StatusCode FindBestParentCluster(const pandora::Cluster *const pDaughterCluster, const pandora::ClusterVector &clusterVector,
121  const pandora::Cluster *&pBestParentCluster) const;
122 
123 private:
124  float m_maxStartingClusterDistance;
125  float m_maxClosestClusterDistance;
126 
127  bool m_debugOutput;
128  bool m_debugOutput2;
129  bool m_onlyUseConnectedHits;
130  bool m_useMCPForPID;
131  bool m_makeRecord;
132 
133  arma::mat m_clusterCentroidsMatrix;
134  std::vector<APRILCluster*> m_clustersToMerge;
135 };
136 
137 //------------------------------------------------------------------------------------------------------------------------------------------
138 
139 inline pandora::Algorithm *ChargedFragmentsMergingAlgorithm3::Factory::CreateAlgorithm() const
140 {
142 }
143 
144 }
145 
146 #endif
Factory class for instantiating algorithm.
Definition: ChargedFragmentsMergingAlgorithm3.h:53
pandora::StatusCode FindBestParentCluster(const pandora::Cluster *const pDaughterCluster, const pandora::ClusterVector &clusterVector, const pandora::Cluster *&pBestParentCluster) const
Find the best parent cluster to merge a daughter one.
bool CanMergeCluster(const pandora::Cluster *const pCluster) const
Whether the cluster is eligible for association.
pandora::StatusCode GetEligibleClusters(std::vector< APRILCluster * > &clusterVector) const
Get the eligible clusters for parent-daughter association.
Definition: ChargedFragmentsMergingAlgorithm3.cc:1168
Cluster class.
Definition: Cluster.h:89
pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const
Algorithm workhorse, find associations between daughter and parent cluster.
ChargedFragmentsMergingAlgorithm3 class.
Definition: ChargedFragmentsMergingAlgorithm3.h:47