SeedFinderAlgBase.h
Go to the documentation of this file.
1 /**
2  * @file SeedFinderAlgBase.h
3  *
4  * @brief This is intended to define an interface to all Seed finder algorithms employed
5  * by the 3D clustering
6  *
7  */
8 #ifndef SeedFinderAlgBase_h
9 #define SeedFinderAlgBase_h
10 
11 // Framework Includes
12 #include "fhiclcpp/ParameterSet.h"
14 
15 // Algorithm includes
17 
18 //------------------------------------------------------------------------------------------------------------------------------------------
19 
20 namespace lar_cluster3d {
21  typedef std::pair<recob::Seed, reco::HitPairListPtr> SeedHitPairListPair;
22  typedef std::vector<SeedHitPairListPair> SeedHitPairListPairVec;
23 
24  /**
25  * @brief SeedFinderAlgBase class
26  */
27  class SeedFinderAlgBase {
28  public:
29  /**
30  * @brief Define the interface to take an input list of 3D hits and return seed candidates
31  * so hits are ordered along the axis
32  */
33  virtual bool findTrackSeeds(reco::HitPairListPtr& hitPairListPtr,
34  reco::PrincipalComponents& inputPCA,
35  SeedHitPairListPairVec& seedHitPairVec) const = 0;
36 
37  protected:
38  /**
39  * @brief Define a comparator which will sort hits by arc length along a PCA axis
40  */
41  struct Sort3DHitsByArcLen3D {
42  bool
44  {
45  return left->getArclenToPoca() < right->getArclenToPoca();
46  }
47  };
48 
49  /**
50  * @brief Define a comparator which will sort hits by the absolute value of arc length
51  * so hits are ordered closed to PCA origin to furthest
52  */
54  bool
56  {
57  return fabs(left->getArclenToPoca()) < fabs(right->getArclenToPoca());
58  }
59  };
60 
61  private:
62  };
63 
64 } // namespace lar_cluster3d
65 #endif
bool operator()(const reco::ClusterHit3D *left, const reco::ClusterHit3D *right)
std::pair< recob::Seed, reco::HitPairListPtr > SeedHitPairListPair
Define a comparator which will sort hits by the absolute value of arc length so hits are ordered clos...
std::list< const reco::ClusterHit3D * > HitPairListPtr
Definition: Cluster3D.h:335
float getArclenToPoca() const
Definition: Cluster3D.h:170
std::vector< SeedHitPairListPair > SeedHitPairListPairVec
virtual bool findTrackSeeds(reco::HitPairListPtr &hitPairListPtr, reco::PrincipalComponents &inputPCA, SeedHitPairListPairVec &seedHitPairVec) const =0
Define the interface to take an input list of 3D hits and return seed candidates so hits are ordered ...
bool operator()(const reco::ClusterHit3D *left, const reco::ClusterHit3D *right)