IniSegAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Classes: IniSegAlg, Hit2D, bDistCentLess2D
3 // File: IniSegAlg.h
4 //
5 // dorota.stefan@cern.ch, robert.sulej@cern.ch, tjyang@fnal.gov
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 #ifndef IniSegAlg_h
10 #define IniSegAlg_h
11 
16 
17 namespace fhicl {
18  class ParameterSet;
19 }
20 
21 namespace dunefd {
22  class Hit2D;
23  class IniSegAlg;
24  class bDistCentLess2D;
25 }
26 
28 {
29  public:
30  Hit2D(TVector2 point2d, size_t key);
31  TVector2 const & GetPointCm(void) const { return fPoint;}
32  size_t const & GetKey(void) const { return fKey; }
33 
34  private:
35  TVector2 fPoint;
36  size_t fKey;
37 };
38 
39 #if defined __clang__
40  #pragma clang diagnostic push
41  #pragma clang diagnostic ignored "-Wunused-private-field"
42 #endif
44 {
45  public:
46  IniSegAlg(std::map<size_t, std::vector<dunefd::Hit2D> > clusters);
47  IniSegAlg(std::vector< art::Ptr<recob::Track> > const & tracks, TVector3 const & mcvtx);
48 
49  void FeedwithMc(TVector2 const & vtx, TVector2 const & dir, TVector3 const & dir3d);
50  void FeedwithMc(TVector3 const & dir3d);
51  std::map<size_t, std::vector< dunefd::Hit2D > > const & GetSelectedCl() const { return fSelCls; }
52  std::vector< dunefd::Hit2D > const & GetCl() const { return fCl; }
53 
54  const bool IsFound() { return fFound; }
55  art::Ptr<recob::Track> const & GetTrk() const { return fTrk; }
56 
57  float const & GetDist() const { return fDistVtxCl; }
58  float const & GetCos() const { return fCos; }
59 
60  private:
61  void FindClustersInRad();
62  void FindCluster();
63  void SortLess();
64 
65  void Find3dTrack();
66 
67  TVector2 ClusterDir(std::vector< Hit2D > const & hits);
68 
69  std::map<size_t, std::vector<dunefd::Hit2D> > fClusters;
70  std::map<size_t, std::vector<dunefd::Hit2D> > fSelCls;
71  //
72 
73  std::vector< art::Ptr<recob::Track> > fSelTrks;
75  bool fFound;
76  TVector3 fDir3d;
77 
78  TVector3 fFront;
79  TVector3 fBack;
80 
81  //
82  std::vector< dunefd::Hit2D > fCl;
83  TVector2 fMcVtx;
84  TVector3 fMcVtx3d;
85  TVector2 fDir;
86 
87  float fRadius;
88  float fDistVtxCl;
89  float const fThrcos;
90  float fCos;
91 };
92 #if defined __clang__
93  #pragma clang diagnostic pop
94 #endif
95 
97  public std::binary_function< Hit2D, Hit2D, bool >
98  {
99  public:
100  bDistCentLess2D(const TVector2& c) : center(c) {}
101 
102  bool operator() (Hit2D p1, Hit2D p2)
103  {
104  double dist1 = pma::Dist2(p1.GetPointCm(), center);
105  double dist2 = pma::Dist2(p2.GetPointCm(), center);
106 
107  return dist1 < dist2;
108  }
109 
110  private:
111  TVector2 center;
112  };
113 
114 #endif //IniSegAlg_h
std::vector< dunefd::Hit2D > fCl
Definition: IniSegAlg.h:82
bDistCentLess2D(const TVector2 &c)
Definition: IniSegAlg.h:100
Implementation of the Projection Matching Algorithm.
double Dist2(const TVector2 &v1, const TVector2 &v2)
Definition: Utilities.cxx:37
float const & GetDist() const
Definition: IniSegAlg.h:57
TVector2 fMcVtx
Definition: IniSegAlg.h:83
std::vector< art::Ptr< recob::Track > > fSelTrks
Definition: IniSegAlg.h:73
std::map< size_t, std::vector< dunefd::Hit2D > > const & GetSelectedCl() const
Definition: IniSegAlg.h:51
struct vector vector
TVector3 fBack
Definition: IniSegAlg.h:79
string dir
std::map< size_t, std::vector< dunefd::Hit2D > > fClusters
Definition: IniSegAlg.h:69
TVector3 fFront
Definition: IniSegAlg.h:78
TVector2 fPoint
Definition: IniSegAlg.h:35
TVector3 fMcVtx3d
Definition: IniSegAlg.h:84
size_t const & GetKey(void) const
Definition: IniSegAlg.h:32
def key(type, name=None)
Definition: graph.py:13
float const fThrcos
Definition: IniSegAlg.h:89
art::Ptr< recob::Track > fTrk
Definition: IniSegAlg.h:74
size_t fKey
Definition: IniSegAlg.h:36
const bool IsFound()
Definition: IniSegAlg.h:54
Definition: tracks.py:1
Implementation of the Projection Matching Algorithm.
TVector2 fDir
Definition: IniSegAlg.h:85
std::vector< dunefd::Hit2D > const & GetCl() const
Definition: IniSegAlg.h:52
def center(depos, point)
Definition: depos.py:117
Provides recob::Track data product.
TVector2 const & GetPointCm(void) const
Definition: IniSegAlg.h:31
float const & GetCos() const
Definition: IniSegAlg.h:58
std::map< size_t, std::vector< dunefd::Hit2D > > fSelCls
Definition: IniSegAlg.h:70
art::Ptr< recob::Track > const & GetTrk() const
Definition: IniSegAlg.h:55
TVector3 fDir3d
Definition: IniSegAlg.h:76