MergeClusterAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////
2 // Merge Cluster algorithm
3 //
4 // Runs on the output of previous clustering algorithms to merge
5 // clusters together which lie on a straight line and are within
6 // some separation threshold.
7 // Runs recursively over all clusters, including new ones formed
8 // in the algorithm.
9 //
10 // M Wallbank (m.wallbank@sheffield.ac.uk), July 2015
11 ////////////////////////////////////////////////////////////////////
12 
13 #ifndef MergeCluster_h
14 #define MergeCluster_h
15 
16 // Framework includes
18 #include "art_root_io/TFileService.h"
21 namespace fhicl { class ParameterSet; }
22 
23 // LArSoft includes
27 namespace geo { struct WireID; }
28 
29 //tmp
31 
32 #include "TVector2.h"
33 class TTree;
34 
35 #include <vector>
36 #include <map>
37 
38 namespace cluster {
39  class MergeClusterAlg;
40 }
41 
43 public:
44 
46 
47  void FindClusterEndPoints(art::PtrVector<recob::Hit> const& cluster, TVector2 const& centre, TVector2 const& direction, TVector2& start, TVector2& end) const;
48  double FindClusterOverlap(TVector2 const& direction, TVector2 const& centre, TVector2 const& start1, TVector2 const& end1, TVector2 const& start2, TVector2 const& end2) const;
49  double FindCrossingDistance(TVector2 const &direction1, TVector2 const &centre1, TVector2 const&direction2, TVector2 const &centre2) const;
50  double FindMinSeparation(art::PtrVector<recob::Hit> const &cluster1, art::PtrVector<recob::Hit> const &cluster2) const;
51  double FindProjectedWidth(TVector2 const& centre1, TVector2 const& start1, TVector2 const& end1, TVector2 const& centre2, TVector2 const& start2, TVector2 const& end2) const;
52  double GlobalWire(geo::WireID const& wireID) const;
53  TVector2 HitCoordinates(art::Ptr<recob::Hit> const& hit) const;
54  int MergeClusters(std::vector<art::PtrVector<recob::Hit> > const &planeClusters, std::vector<art::PtrVector<recob::Hit> > &clusters) const;
55  void reconfigure(fhicl::ParameterSet const& p);
56  bool PassCuts(double const& angle, double const& crossingDistance, double const& projectedWidth, double const& separation, double const& overlap, double const& longLength) const;
57 
58 private:
59 
60  // Merging parameters
61  unsigned int fMinMergeClusterSize; // Minimum size of a cluster for it to be considered for merging
62  double fMaxMergeSeparation; // Maximum separation of clusters for merging
63  double fProjWidthThreshold; // Maximum projected width (width of a tube parallel to the line connecting centres of clusters which just encompasses the clusters) for merging
64 
65  // Create geometry and detector property handle
68 
69  std::map<int,int> trueClusterMap;
70 
71  // Tree
72  TTree *fTree;
73  double fAngle;
74  double fEigenvalue;
77  double fLength1;
78  double fLength2;
79  double fSeparation;
82  double fOverlap;
83  bool fTrueMerge;
84 // bool fMerge;
85 
86 };
87 
88 #endif
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::map< int, int > trueClusterMap
art::ServiceHandle< geo::Geometry const > fGeom
art::ServiceHandle< art::TFileService const > tfs
struct vector vector
Cluster finding and building.
art framework interface to geometry description
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
virtual void reconfigure(fhicl::ParameterSet const &pset)
p
Definition: test.py:223
Detector simulation of raw signals on wires.
Declaration of signal hit object.
Encapsulate the construction of a single detector plane.
unsigned int fMinMergeClusterSize
LArSoft geometry interface.
Definition: ChannelGeo.h:16