LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
HoughSeedFinderAlg.h
Go to the documentation of this file.
1 
7 #ifndef HoughSeedFinderAlg_h
8 #define HoughSeedFinderAlg_h
9 
12 
13 // LArSoft includes
16 
17 // Algorithm includes
19 
20 // ROOT includes
21 #include "TCanvas.h"
22 #include "TFrame.h"
23 #include "TH2D.h"
24 
25 //------------------------------------------------------------------------------------------------------------------------------------------
26 
27 namespace lar_cluster3d
28 {
29 
33 class HoughSeedFinderAlg : virtual public SeedFinderAlgBase
34 {
35 public:
42 
46  virtual ~HoughSeedFinderAlg();
47 
51  virtual void reconfigure(fhicl::ParameterSet const &pset);
52 
56  virtual bool findTrackSeeds(reco::HitPairListPtr& hitPairListPtr,
57  reco::PrincipalComponents& inputPCA,
58  SeedHitPairListPairVec& seedHitPairVec) const;
59 
63  virtual bool findTrackHits(reco::HitPairListPtr& hitPairListPtr,
64  reco::PrincipalComponents& inputPCA,
65  reco::HitPairListPtrList& hitPairListPtrList) const;
66 
67 private:
68 
76  void findHitGaps(reco::HitPairListPtr& inputHitList, reco::HitPairListPtr& outputList) const;
77 
82  class AccumulatorBin;
85 
86  // Basic structure for holding our accumlator bins (to avoid a full array)
87  // structure will be rho bin for first key, theta bin for second key
88  typedef std::pair<int, int> BinIndex;
89  typedef std::map<BinIndex, AccumulatorBin> RhoThetaAccumulatorBinMap;
90  typedef std::list<BinIndex> HoughCluster;
91  typedef std::list<HoughCluster > HoughClusterList;
92 
93  void HoughRegionQuery(BinIndex& curBin, RhoThetaAccumulatorBinMap& rhoThetaAccumulatorBinMap, HoughCluster& neighborPts, size_t threshold) const;
94 
95  void expandHoughCluster(BinIndex& curBin,
96  HoughCluster& neighborPts,
97  HoughCluster& houghCluster,
98  RhoThetaAccumulatorBinMap& rhoThetaAccumulatorBinMap,
99  size_t threshold) const;
100 
101  void findHoughClusters(const reco::HitPairListPtr& inputHits,
103  int& nLoops,
104  RhoThetaAccumulatorBinMap& rhoThetaMap,
105  HoughClusterList& clusterList) const;
106 
110  bool buildSeed(reco::HitPairListPtr& seed3DHits, SeedHitPairListPair& seedHitPair) const;
111 
112  void LineFit2DHits(std::set<const reco::ClusterHit2D*>& hitList, double XOrigin, TVector3& Pos, TVector3& Dir, double& ChiDOF) const;
113 
116  int m_rhoBins;
121  double m_numAveDocas;
124  double m_maximumGap;
125 
126  geo::Geometry* m_geometry; // pointer to the Geometry service
127  // const detinfo::DetectorProperties* m_detector; // Pointer to the detector properties
128 
129  PrincipalComponentsAlg m_pcaAlg; // For running Principal Components Analysis
130 
132  mutable std::vector<std::unique_ptr<TCanvas> > m_Canvases;
133  mutable std::vector<TVirtualPad*> m_Pads;
134 };
135 
136 } // namespace lar_cluster3d
137 #endif
void LineFit2DHits(std::set< const reco::ClusterHit2D * > &hitList, double XOrigin, TVector3 &Pos, TVector3 &Dir, double &ChiDOF) const
std::vector< SeedHitPairListPair > SeedHitPairListPairVec
void findHitGaps(reco::HitPairListPtr &inputHitList, reco::HitPairListPtr &outputList) const
Using Principal Components Axis, look for gaps in a list of 3D hits.
std::vector< TVirtualPad * > m_Pads
View pads in current canvas.
SeedFinderAlgBase class.
virtual void reconfigure(fhicl::ParameterSet const &pset)
a handler for the case where the algorithm control parameters are to be reset
HoughSeedFinderAlg class.
HoughSeedFinderAlg(fhicl::ParameterSet const &pset)
Constructor.
std::list< HitPairListPtr > HitPairListPtrList
Definition: Cluster3D.h:317
void findHoughClusters(const reco::HitPairListPtr &inputHits, reco::PrincipalComponents &pca, int &nLoops, RhoThetaAccumulatorBinMap &rhoThetaMap, HoughClusterList &clusterList) const
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
std::list< HoughCluster > HoughClusterList
std::list< const reco::ClusterHit3D * > HitPairListPtr
Definition: Cluster3D.h:315
The geometry of one entire detector, as served by art.
Definition: Geometry.h:110
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 ...
virtual 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...
virtual ~HoughSeedFinderAlg()
Destructor.
std::pair< recob::Seed, reco::HitPairListPtr > SeedHitPairListPair
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitPairVec) const
Given the list of hits this will search for candidate Seed objects and return them.
std::vector< std::unique_ptr< TCanvas > > m_Canvases
Graphical trace canvases.
art framework interface to geometry description