LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
MissingTrackSegmentTool.h
Go to the documentation of this file.
1 
8 #ifndef MISSING_TRACK_SEGMENT_TOOL_H
9 #define MISSING_TRACK_SEGMENT_TOOL_H 1
10 
12 
13 #include <unordered_map>
14 
15 namespace lar_content
16 {
17 
22 {
23 public:
28 
29  bool Run(ThreeDTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor);
30 
31 private:
35  class Particle
36  {
37  public:
43  Particle(const TensorType::Element &element);
44 
45  const pandora::Cluster *m_pShortCluster;
46  const pandora::Cluster *m_pCluster1;
47  const pandora::Cluster *m_pCluster2;
48  pandora::HitType m_shortHitType;
49  pandora::HitType m_hitType1;
50  pandora::HitType m_hitType2;
51  float m_shortMinX;
52  float m_shortMaxX;
53  float m_longMinX;
54  float m_longMaxX;
55  };
56 
61  {
62  public:
67 
68  unsigned int m_nSamplingPoints;
69  unsigned int m_nMatchedSamplingPoints;
73  };
74 
75  pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
76 
77  typedef std::unordered_map<const pandora::Cluster*, SegmentOverlap> SegmentOverlapMap;
78  typedef std::unordered_map<const pandora::Cluster*, pandora::ClusterList> ClusterMergeMap;
79 
88  void FindTracks(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector,
89  ClusterMergeMap &clusterMergeMap) const;
90 
98  void SelectElements(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const;
99 
108  bool PassesParticleChecks(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, pandora::ClusterSet &usedClusters,
109  ClusterMergeMap &clusterMergeMap) const;
110 
118  void GetCandidateClusters(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, pandora::ClusterList &candidateClusters) const;
119 
127  void GetSlidingFitResultMap(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const pandora::ClusterList &candidateClusterList,
128  TwoDSlidingFitResultMap &slidingFitResultMap) const;
129 
138  void GetSegmentOverlapMap(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle,
139  const TwoDSlidingFitResultMap &slidingFitResultMap, SegmentOverlapMap &segmentOverlapMap) const;
140 
152  bool MakeDecisions(const Particle &particle, const TwoDSlidingFitResultMap &slidingFitResultMap, const SegmentOverlapMap &segmentOverlapMap,
153  pandora::ClusterSet &usedClusters, ClusterMergeMap &clusterMergeMap) const;
154 
162  bool PassesSamplingCuts(const SegmentOverlap &segmentOverlap) const;
163 
174  bool IsPossibleMerge(const pandora::Cluster *const pCluster, const Particle &particle, const SegmentOverlap &segmentOverlap,
175  const TwoDSlidingFitResultMap &slidingFitResultMap) const;
176 
180 
183 
186 
191 
194 };
195 
196 //------------------------------------------------------------------------------------------------------------------------------------------
197 
199  m_nSamplingPoints(0),
200  m_nMatchedSamplingPoints(0),
201  m_pseudoChi2Sum(0.f),
202  m_matchedSamplingMinX(std::numeric_limits<float>::max()),
203  m_matchedSamplingMaxX(-std::numeric_limits<float>::max())
204 {
205 }
206 
207 } // namespace lar_content
208 
209 #endif // #ifndef MISSING_TRACK_SEGMENT_TOOL_H
float m_minMatchedFraction
The min matched sampling point fraction for particle creation.
float m_longMaxX
The max x coordinate of the long clusters.
void GetSlidingFitResultMap(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const pandora::ClusterList &candidateClusterList, TwoDSlidingFitResultMap &slidingFitResultMap) const
Get a sliding fit result map for the list of candidate clusters.
std::vector< ProtoParticle > ProtoParticleVector
unsigned int m_minMatchedSamplingPoints
The min number of matched sampling points for particle creation.
const pandora::Cluster * m_pShortCluster
Address of the short cluster.
std::vector< TensorType::ElementList::const_iterator > IteratorList
void GetSegmentOverlapMap(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, const TwoDSlidingFitResultMap &slidingFitResultMap, SegmentOverlapMap &segmentOverlapMap) const
Get a segment overlap map, describing overlap between a provided particle and all clusters in a slidi...
bool IsPossibleMerge(const pandora::Cluster *const pCluster, const Particle &particle, const SegmentOverlap &segmentOverlap, const TwoDSlidingFitResultMap &slidingFitResultMap) const
Whether the cluster could be merged with the candidate particle.
pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
STL namespace.
void GetCandidateClusters(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const Particle &particle, pandora::ClusterList &candidateClusters) const
Get a list of candidate clusters, which may represent missing track segments for a provided particle...
float m_matchedSamplingMaxX
The max matched sampling point x coordinate.
float m_minInitialXOverlapFraction
The min x overlap fraction (between long clusters and short cluster vs. shared overlap) ...
float m_matchedSamplingMinX
The min matched sampling point x coordinate.
std::unordered_map< const pandora::Cluster *, TwoDSlidingFitResult > TwoDSlidingFitResultMap
bool MakeDecisions(const Particle &particle, const TwoDSlidingFitResultMap &slidingFitResultMap, const SegmentOverlapMap &segmentOverlapMap, pandora::ClusterSet &usedClusters, ClusterMergeMap &clusterMergeMap) const
Make decisions about whether to create a pfo for a provided particle and whether to make cluster merg...
TFile f
Definition: plotHisto.C:6
unsigned int m_makePfoMinMatchedSamplingPoints
The min number of matched sampling points in order to be able to make pfo.
Int_t max
Definition: plot.C:27
float m_makePfoMaxImpactParameter
The max transverse impact parameter in order to be able to make pfo.
bool SegmentOverlap(double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Dx, double Dy)
Definition: Polygon2D.cxx:18
const pandora::Cluster * m_pCluster1
Address of long cluster in view 1.
unsigned int m_minCaloHitsInCandidateCluster
The min no. of calo hits in a candidate cluster, for matching with long clusters. ...
unsigned int m_nSamplingPoints
The number of sampling points.
void SelectElements(const TensorType::ElementList &elementList, const pandora::ClusterSet &usedClusters, IteratorList &iteratorList) const
Select a list of the relevant elements from a set of connected tensor elements.
std::unordered_map< const pandora::Cluster *, pandora::ClusterList > ClusterMergeMap
bool Run(ThreeDTransverseTracksAlgorithm *const pAlgorithm, TensorType &overlapTensor)
Run the algorithm tool.
const pandora::Cluster * m_pCluster2
Address of long cluster in view 2.
float m_pseudoChi2Cut
The pseudo chi2 cut to determine whether a sampling point is matched.
pandora::HitType m_hitType1
The hit type of the long cluster in view 1.
unsigned int m_minMatchedSamplingPointRatio
The min ratio between 1st and 2nd highest msps for simple ambiguity resolution.
unsigned int m_makePfoMinSamplingPoints
The min number of sampling points in order to be able to make pfo.
float m_minFinalXOverlapFraction
The min x overlap fraction between extended short cluster and the long clusters.
float m_longMinX
The min x coordinate of the long clusters.
float m_mergeXContainmentTolerance
The tolerance in determining whether candidate cluster is contained in x window.
unsigned int m_nMatchedSamplingPoints
The number of matched sampling points.
pandora::HitType m_shortHitType
The hit type of the short cluster.
Header file for the three dimensional transverse tracks algorithm class.
MissingTrackSegmentTool class.
void FindTracks(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const TensorType &overlapTensor, ProtoParticleVector &protoParticleVector, ClusterMergeMap &clusterMergeMap) const
Find remaining tracks, hidden by missing track segments (and maybe other ambiguities) in the tensor...
Particle(const TensorType::Element &element)
Constructor.
std::unordered_map< const pandora::Cluster *, SegmentOverlap > SegmentOverlapMap
bool PassesSamplingCuts(const SegmentOverlap &segmentOverlap) const
Whether the segment overlap object passes cuts on matched sampling points, etc.
float m_makePfoMinMatchedFraction
The min matched sampling point fraction in order to be able to make pfo.
float m_shortMaxX
The max x coordinate of the short cluster.
float m_mergeMaxChi2PerSamplingPoint
The max value of chi2 per sampling point in order to merge cluster with parent.
bool PassesParticleChecks(ThreeDTransverseTracksAlgorithm *const pAlgorithm, const TensorType::Element &element, pandora::ClusterSet &usedClusters, ClusterMergeMap &clusterMergeMap) const
Whether a provided tensor element can be used to construct a pfo.
float m_shortMinX
The min x coordinate of the short cluster.
pandora::HitType m_hitType2
The hit type of the long cluster in view 2.