LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
HoughSeedFinderAlg.h
Go to the documentation of this file.
1 
7 #ifndef HoughSeedFinderAlg_h
8 #define HoughSeedFinderAlg_h
9 
10 // Framework includes
11 #include "fhiclcpp/fwd.h"
12 
13 // LArSoft includes
18 
19 // ROOT includes
20 #include "TCanvas.h"
21 class TFrame;
22 class TVector3;
23 class TVirtualPad;
24 
25 //------------------------------------------------------------------------------------------------------------------------------------------
26 
27 namespace lar_cluster3d {
28 
33  public:
40 
44  bool findTrackSeeds(reco::HitPairListPtr& hitPairListPtr,
45  reco::PrincipalComponents& inputPCA,
46  SeedHitPairListPairVec& seedHitPairVec) const override;
47 
51  bool findTrackHits(reco::HitPairListPtr& hitPairListPtr,
52  reco::PrincipalComponents& inputPCA,
53  reco::HitPairListPtrList& hitPairListPtrList) const;
54 
55  private:
63  void findHitGaps(reco::HitPairListPtr& inputHitList, reco::HitPairListPtr& outputList) const;
64 
69  class AccumulatorBin;
72 
73  // Basic structure for holding our accumlator bins (to avoid a full array)
74  // structure will be rho bin for first key, theta bin for second key
75  typedef std::pair<int, int> BinIndex;
76  typedef std::map<BinIndex, AccumulatorBin> RhoThetaAccumulatorBinMap;
77  typedef std::list<BinIndex> HoughCluster;
78  typedef std::list<HoughCluster> HoughClusterList;
79 
80  void HoughRegionQuery(BinIndex& curBin,
81  RhoThetaAccumulatorBinMap& rhoThetaAccumulatorBinMap,
82  HoughCluster& neighborPts,
83  size_t threshold) const;
84 
85  void expandHoughCluster(BinIndex& curBin,
86  HoughCluster& neighborPts,
87  HoughCluster& houghCluster,
88  RhoThetaAccumulatorBinMap& rhoThetaAccumulatorBinMap,
89  size_t threshold) const;
90 
91  void findHoughClusters(const reco::HitPairListPtr& inputHits,
93  RhoThetaAccumulatorBinMap& rhoThetaMap,
94  HoughClusterList& clusterList) const;
95 
99  bool buildSeed(reco::HitPairListPtr& seed3DHits, SeedHitPairListPair& seedHitPair) const;
100 
101  void LineFit2DHits(std::set<const reco::ClusterHit2D*>& hitList,
102  double XOrigin,
103  TVector3& Pos,
104  TVector3& Dir,
105  double& ChiDOF) const;
106 
109  int m_rhoBins;
114  double m_numAveDocas;
117  double m_maximumGap;
118 
119  geo::WireReadoutGeom const* m_wireReadoutGeom; // pointer to the Geometry service
120  PrincipalComponentsAlg m_pcaAlg; // For running Principal Components Analysis
121 
123  mutable std::vector<std::unique_ptr<TCanvas>> m_Canvases;
124  mutable std::vector<TVirtualPad*> m_Pads;
125  };
126 
127 } // namespace lar_cluster3d
128 #endif
void LineFit2DHits(std::set< const reco::ClusterHit2D * > &hitList, double XOrigin, TVector3 &Pos, TVector3 &Dir, double &ChiDOF) const
void findHitGaps(reco::HitPairListPtr &inputHitList, reco::HitPairListPtr &outputList) const
Using Principal Components Axis, look for gaps in a list of 3D hits.
void findHoughClusters(const reco::HitPairListPtr &inputHits, reco::PrincipalComponents &pca, RhoThetaAccumulatorBinMap &rhoThetaMap, HoughClusterList &clusterList) const
std::vector< TVirtualPad * > m_Pads
View pads in current canvas.
SeedFinderAlgBase class.
bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitPairVec) const override
Given the list of hits this will search for candidate Seed objects and return them.
HoughSeedFinderAlg class.
HoughSeedFinderAlg(fhicl::ParameterSet const &pset)
Constructor.
std::list< HitPairListPtr > HitPairListPtrList
Definition: Cluster3D.h:328
void expandHoughCluster(BinIndex &curBin, HoughCluster &neighborPts, HoughCluster &houghCluster, RhoThetaAccumulatorBinMap &rhoThetaAccumulatorBinMap, size_t threshold) const
This is intended to define an interface to all Seed finder algorithms employed by the 3D clustering...
void HoughRegionQuery(BinIndex &curBin, RhoThetaAccumulatorBinMap &rhoThetaAccumulatorBinMap, HoughCluster &neighborPts, size_t threshold) const
Interface for a class providing readout channel mapping to geometry.
std::list< HoughCluster > HoughClusterList
std::list< const reco::ClusterHit3D * > HitPairListPtr
Definition: Cluster3D.h:326
bool buildSeed(reco::HitPairListPtr &seed3DHits, SeedHitPairListPair &seedHitPair) const
Given a list of candidate "seed" 3D hits, build the seed and get associated unique 2D hits...
std::map< BinIndex, AccumulatorBin > RhoThetaAccumulatorBinMap
This header file defines the interface to a principal components analysis designed to be used within ...
bool findTrackHits(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, reco::HitPairListPtrList &hitPairListPtrList) const
Given the list of hits this will return the sets of hits which belong on the same line...
std::vector< SeedHitPairListPair > SeedHitPairListPairVec
std::pair< recob::Seed, reco::HitPairListPtr > SeedHitPairListPair
std::vector< std::unique_ptr< TCanvas > > m_Canvases
Graphical trace canvases.
geo::WireReadoutGeom const * m_wireReadoutGeom