Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
DeltaRayMatchingAlgorithm.h
Go to the documentation of this file.
1
8#ifndef LAR_DELTA_RAY_MATCHING_ALGORITHM_H
9#define LAR_DELTA_RAY_MATCHING_ALGORITHM_H 1
10
11#include "Pandora/Algorithm.h"
12
14
15namespace lar_content
16{
17
18template <typename, unsigned int>
19class KDTreeLinkerAlgo;
20template <typename, unsigned int>
21class KDTreeNodeInfoT;
22
23//------------------------------------------------------------------------------------------------------------------------------------------
24
29{
30public:
35
36private:
38
43 {
44 public:
53 Particle(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3,
54 const pandora::ParticleFlowObject *const pPfo);
55
59 const pandora::Cluster *GetClusterU() const;
60
64 const pandora::Cluster *GetClusterV() const;
65
69 const pandora::Cluster *GetClusterW() const;
70
75
79 unsigned int GetNViews() const;
80
84 unsigned int GetNCaloHits() const;
85
86 private:
91 };
92
93 typedef std::vector<Particle> ParticleList;
94
97 typedef std::vector<HitKDNode2D> HitKDNode2DList;
98
99 typedef std::unordered_map<const pandora::Cluster *, pandora::ClusterList> ClusterToClustersMap;
100 typedef std::unordered_map<const pandora::CaloHit *, const pandora::Cluster *> HitToClusterMap;
101
106
113 void InitializeNearbyClusterMap(const std::string &clusterListName, ClusterToClustersMap &nearbyClusters);
114
119
126 void GetAllPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const;
127
134 void GetTrackPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const;
135
143 void GetClusters(const std::string &clusterListName, pandora::ClusterVector &clusterVector) const;
144
145 typedef std::unordered_map<const pandora::Cluster *, float> ClusterLengthMap;
146 typedef std::unordered_map<const pandora::ParticleFlowObject *, float> PfoLengthMap;
147
153 void ThreeViewMatching(ClusterLengthMap &clusterLengthMap) const;
154
160 void TwoViewMatching(ClusterLengthMap &clusterLengthMap) const;
161
167 void OneViewMatching(ClusterLengthMap &clusterLengthMap) const;
168
179 void ThreeViewMatching(const pandora::ClusterVector &clusters1, const pandora::ClusterVector &clusters2,
180 const pandora::ClusterVector &clusters3, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, ParticleList &particleList) const;
181
191 void TwoViewMatching(const pandora::ClusterVector &clusters1, const pandora::ClusterVector &clusters2,
192 ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, ParticleList &particleList) const;
193
202 void OneViewMatching(const pandora::ClusterVector &clusters, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap,
203 ParticleList &particleList) const;
204
212 void SelectParticles(const ParticleList &inputParticles, ClusterLengthMap &clusterLengthMap, ParticleList &outputParticles) const;
213
219 void CreateParticles(const ParticleList &particleList) const;
220
231 void FindBestParentPfo(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW,
232 ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, const pandora::ParticleFlowObject *&pBestPfo) const;
233
242 float GetLengthFromCache(const pandora::Cluster *const pCluster, ClusterLengthMap &clusterLengthMap) const;
243
252 float GetLengthFromCache(const pandora::ParticleFlowObject *const pPfo, PfoLengthMap &pfoLengthMap) const;
253
262 float GetLength(const Particle &particle, ClusterLengthMap &clusterLengthMap) const;
263
271 bool AreClustersMatched(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const;
272
279 float GetDistanceSquaredToPfo(const pandora::Cluster *const pCluster, const pandora::ParticleFlowObject *const pPfo) const;
280
287 void CreateDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const;
288
295 void AddToDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const;
296
298
301
305
310
315};
316
317//------------------------------------------------------------------------------------------------------------------------------------------
318//------------------------------------------------------------------------------------------------------------------------------------------
319
324
325//------------------------------------------------------------------------------------------------------------------------------------------
327{
328 return m_pClusterV;
329}
330
331//------------------------------------------------------------------------------------------------------------------------------------------
333{
334 return m_pClusterW;
335}
336
337//------------------------------------------------------------------------------------------------------------------------------------------
339{
340 return m_pParentPfo;
341}
342
343} // namespace lar_content
344
345#endif // #ifndef LAR_DELTA_RAY_MATCHING_ALGORITHM_H
Header file for the algorithm class.
Header file for the lar two dimensional sliding fit result class.
const pandora::ParticleFlowObject * m_pParentPfo
Address of parent Pfo.
const pandora::ParticleFlowObject * GetParentPfo() const
Get parent Pfo.
const pandora::Cluster * m_pClusterV
Address of cluster in V view.
unsigned int GetNCaloHits() const
Get number of calo hits.
const pandora::Cluster * m_pClusterU
Address of cluster in U view.
const pandora::Cluster * GetClusterV() const
Get cluster in V view.
unsigned int GetNViews() const
Get number of views.
const pandora::Cluster * GetClusterW() const
Get cluster in W view.
const pandora::Cluster * GetClusterU() const
Get cluster in U view.
const pandora::Cluster * m_pClusterW
Address of cluster in W view.
std::unordered_map< const pandora::CaloHit *, const pandora::Cluster * > HitToClusterMap
std::string m_inputClusterListNameW
The input cluster list name for the w view.
KDTreeNodeInfoT< const pandora::CaloHit *, 2 > HitKDNode2D
float m_searchRegion1D
Search region, applied to each dimension, for look-up from kd-trees.
std::unordered_map< const pandora::Cluster *, float > ClusterLengthMap
void OneViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using single views.
ClusterToClustersMap m_nearbyClustersV
The nearby clusters map for the v view.
void CreateDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const
Create a new Pfo from an input cluster list and set up a parent/daughter relationship.
KDTreeLinkerAlgo< const pandora::CaloHit *, 2 > HitKDTree2D
void CreateParticles(const ParticleList &particleList) const
Build new particle flow objects.
float m_distanceForMatching
The maximum allowed distance between tracks and delta rays.
void InitializeNearbyClusterMaps()
Initialize nearby cluster maps.
pandora::StatusCode Run()
Run the algorithm.
void ThreeViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using all three views.
std::string m_inputClusterListNameV
The input cluster list name for the v view.
std::string m_parentPfoListName
The parent pfo list name.
void SelectParticles(const ParticleList &inputParticles, ClusterLengthMap &clusterLengthMap, ParticleList &outputParticles) const
Resolve any ambiguities between candidate particles.
float m_xOverlapWindow
The maximum allowed displacement in x position.
bool AreClustersMatched(const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, const pandora::Cluster *const pCluster3) const
Look at consistency of a combination of clusters.
ClusterToClustersMap m_nearbyClustersW
The nearby clusters map for the w view.
void InitializeNearbyClusterMap(const std::string &clusterListName, ClusterToClustersMap &nearbyClusters)
Initialize a nearby cluster map with details relating to a specific cluster list.
void ClearNearbyClusterMaps()
Clear nearby cluster maps.
float m_pseudoChi2Cut
Pseudo chi2 cut for three view matching.
std::string m_inputClusterListNameU
The input cluster list name for the u view.
void FindBestParentPfo(const pandora::Cluster *const pClusterU, const pandora::Cluster *const pClusterV, const pandora::Cluster *const pClusterW, ClusterLengthMap &clusterLengthMap, PfoLengthMap &pfoLengthMap, const pandora::ParticleFlowObject *&pBestPfo) const
Find best Pfo to associate a UVW triplet.
std::string m_daughterPfoListName
The daughter pfo list name for new daughter particles.
unsigned int m_minCaloHitsPerCluster
The min number of calo hits per candidate cluster.
std::unordered_map< const pandora::ParticleFlowObject *, float > PfoLengthMap
void AddToDaughterPfo(const pandora::ClusterList &clusterList, const pandora::ParticleFlowObject *const pParentPfo) const
Merge an input cluster list with an existing daughter Pfo.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterToClustersMap
void GetAllPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const
Get a vector of all Pfos in the provided input Pfo lists.
float GetLength(const Particle &particle, ClusterLengthMap &clusterLengthMap) const
Get the length (squared) of a candidate particle.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
float GetLengthFromCache(const pandora::Cluster *const pCluster, ClusterLengthMap &clusterLengthMap) const
Reduce number of length (squared) calculations by caching results when they are first obtained.
void GetTrackPfos(const std::string &inputPfoListName, pandora::PfoVector &pfoVector) const
Get a vector of track-like Pfos in the provided input Pfo lists.
void TwoViewMatching(ClusterLengthMap &clusterLengthMap) const
Match clusters using pairs of views.
ClusterToClustersMap m_nearbyClustersU
The nearby clusters map for the u view.
void GetClusters(const std::string &clusterListName, pandora::ClusterVector &clusterVector) const
Get a vector containing all available input clusters in the provided cluster list,...
float GetDistanceSquaredToPfo(const pandora::Cluster *const pCluster, const pandora::ParticleFlowObject *const pPfo) const
Get displacementr between cluster and particle flow object.
Class that implements the KDTree partition of 2D space and a closest point search algorithm.
Data stored in each KDTree node. The dim1/dim2 fields are usually the duplication of some PFRecHit va...
Algorithm class. Algorithm addresses are held only by the algorithm manager. They have a fully define...
Definition Algorithm.h:21
Cluster class.
Definition Cluster.h:31
ParticleFlowObject class.
std::vector< const Cluster * > ClusterVector
MANAGED_CONTAINER< const Cluster * > ClusterList
std::vector< const ParticleFlowObject * > PfoVector
StatusCode
The StatusCode enum.