APRILContent
Algorithm of Particle Reconstruction for ILC - implementation with PandoraSDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
ClusterFromTrackMergingAlgorithm3.h
Go to the documentation of this file.
1 /*
3  *
4  * ClusterFromTrackMergingAlgorithm3.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 CLUSTERFROMTRACKMERGINGALGORITHM3_H
30 #define CLUSTERFROMTRACKMERGINGALGORITHM3_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 ClusterFromTrackMergingAlgorithm3 : 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  void SearchProperClusters(APRILCluster* startingCluster,
69  std::vector<april_content::APRILCluster*>& properClusters);
70 
71  void SearchProperClusters(const pandora::Track* pTrack, APRILCluster* startingCluster,
72  std::vector<april_content::APRILCluster*>& properClusters);
73 
74  pandora::StatusCode CleanClusterForMerging(std::vector<APRILCluster*>& clusterVector);
75 
81  pandora::StatusCode GetEligibleClusters(std::vector<APRILCluster*>& clusterVector) const;
82 
89  pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const;
90 
98  bool CanMergeCluster(const pandora::Cluster *const pCluster) const;
99 
107  pandora::StatusCode FindBestParentCluster(const pandora::Cluster *const pDaughterCluster, const pandora::ClusterVector &clusterVector,
108  const pandora::Cluster *&pBestParentCluster) const;
109 
117  pandora::StatusCode GetClusterBackwardDirection(const pandora::Cluster *const pCluster, pandora::CartesianVector &backwardDirection, pandora::CartesianVector &innerPosition) const;
118 
119 private:
121  bool m_allowNeutralParentMerging;
122  unsigned int m_minNCaloHits;
123  unsigned int m_maxNCaloHits;
124  unsigned int m_minNPseudoLayers;
125  unsigned int m_maxNPseudoLayers;
126  float m_chi2AssociationCut;
127  unsigned int m_nBackwardLayersFit;
128  float m_maxBackwardAngle;
129  float m_maxBackwardDistanceFine;
130  float m_maxBackwardDistanceCoarse;
131  unsigned int m_maxBackwardPseudoLayer;
132  unsigned int m_minParentClusterBackwardNHits;
133  float m_maxClusterFitDca;
134  float m_minClusterCosOpeningAngle;
135  float m_minClusterFitCosOpeningAngle;
136  float m_minClusterFitCosOpeningAngle2;
137 
138  float m_maxStartingClusterDistance;
139  float m_maxClusterDistanceToMerge;
140  float m_maxClosestPhotonDistance;
141 
142  bool m_mergePhotonClusters;
143  bool m_mergeChargedClusters;
144  bool m_debugOutput;
145  bool m_onlyUseConnectedHits;
146 
147  arma::mat m_clusterCentroidsMatrix;
148  std::vector<APRILCluster*> m_clustersToMerge;
149 };
150 
151 //------------------------------------------------------------------------------------------------------------------------------------------
152 
153 inline pandora::Algorithm *ClusterFromTrackMergingAlgorithm3::Factory::CreateAlgorithm() const
154 {
156 }
157 
158 }
159 
160 #endif
ClusterFromTrackMergingAlgorithm3 class.
Definition: ClusterFromTrackMergingAlgorithm3.h:47
Factory class for instantiating algorithm.
Definition: ClusterFromTrackMergingAlgorithm3.h:53
bool m_discriminatePhotonPid
Whether to discriminate photons.
Definition: ClusterFromTrackMergingAlgorithm3.h:120
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.
Definition: ClusterFromTrackMergingAlgorithm3.cc:766
pandora::StatusCode GetEligibleClusters(std::vector< APRILCluster * > &clusterVector) const
Get the eligible clusters for parent-daughter association.
Definition: ClusterFromTrackMergingAlgorithm3.cc:734
Cluster class.
Definition: Cluster.h:89
pandora::StatusCode Run()
Definition: ClusterFromTrackMergingAlgorithm3.cc:54
pandora::StatusCode FindClustersToMerge(const pandora::ClusterVector &clusterVector, ClusterToClusterMap &clusterToClusterMap) const
Algorithm workhorse, find associations between daughter and parent cluster.
bool CanMergeCluster(const pandora::Cluster *const pCluster) const
Whether the cluster is eligible for association.
pandora::StatusCode GetClusterBackwardDirection(const pandora::Cluster *const pCluster, pandora::CartesianVector &backwardDirection, pandora::CartesianVector &innerPosition) const
Get the cluster backward direction and the inner cluster position using a cluster fit of the n first ...
Definition: ClusterFromTrackMergingAlgorithm3.cc:888