LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
MergeClusterAlg.h
Go to the documentation of this file.
1 // 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
12 
13 #ifndef MergeCluster_h
14 #define MergeCluster_h
15 
16 // Framework includes
22 
23 // LArSoft includes
29 
30 //tmp
33 //The backtracker is not actually used, so it is commented out.
34 //#include "larsim/MCCheater/BackTrackerService.h"
46 
47 #include "TTree.h"
48 #include "TPrincipal.h"
49 #include "TVector2.h"
50 
51 #include <vector>
52 #include <map>
53 
54 namespace cluster {
55  class MergeClusterAlg;
56 }
57 
59 public:
60 
62 
63  void FindClusterEndPoints(art::PtrVector<recob::Hit> const& cluster, TVector2 const& centre, TVector2 const& direction, TVector2& start, TVector2& end);
64  double FindClusterOverlap(TVector2 const& direction, TVector2 const& centre, TVector2 const& start1, TVector2 const& end1, TVector2 const& start2, TVector2 const& end2);
65  double FindCrossingDistance(TVector2 const &direction1, TVector2 const &centre1, TVector2 const&direction2, TVector2 const &centre2);
66  double FindMinSeparation(art::PtrVector<recob::Hit> const &cluster1, art::PtrVector<recob::Hit> const &cluster2);
67  double FindProjectedWidth(TVector2 const& centre1, TVector2 const& start1, TVector2 const& end1, TVector2 const& centre2, TVector2 const& start2, TVector2 const& end2);
68  double GlobalWire(geo::WireID const& wireID);
69  TVector2 HitCoordinates(art::Ptr<recob::Hit> const& hit);
71  void reconfigure(fhicl::ParameterSet const& p);
72  bool PassCuts(double const& angle, double const& crossingDistance, double const& projectedWidth, double const& separation, double const& overlap, double const& longLength);
73 
74 private:
75 
76  // Merging parameters
77  unsigned int fMinMergeClusterSize; // Minimum size of a cluster for it to be considered for merging
78  double fMaxMergeSeparation; // Maximum separation of clusters for merging
79  double fProjWidthThreshold; // Maximum projected width (width of a tube parallel to the line connecting centres of clusters which just encompasses the clusters) for merging
80 
81  // Create geometry and detector property handle
83 // const detinfo::DetectorProperties* fDetProp;
85 // art::ServiceHandle<cheat::BackTracker> backtracker;
86 
87  std::map<int,int> trueClusterMap;
88 
89  // Tree
90  TTree *fTree;
91  double fAngle;
92  double fEigenvalue;
95  double fLength1;
96  double fLength2;
97  double fSeparation;
100  double fOverlap;
102 // bool fMerge;
103 
104 };
105 
106 #endif
MergeClusterAlg(fhicl::ParameterSet const &pset)
Encapsulate the construction of a single cyostat.
std::map< int, int > trueClusterMap
art::ServiceHandle< art::TFileService > tfs
Declaration of signal hit object.
int MergeClusters(std::vector< art::PtrVector< recob::Hit > > const &planeClusters, std::vector< art::PtrVector< recob::Hit > > &clusters)
Cluster finding and building.
TVector2 HitCoordinates(art::Ptr< recob::Hit > const &hit)
void reconfigure(fhicl::ParameterSet const &p)
double FindProjectedWidth(TVector2 const &centre1, TVector2 const &start1, TVector2 const &end1, TVector2 const &centre2, TVector2 const &start2, TVector2 const &end2)
void FindClusterEndPoints(art::PtrVector< recob::Hit > const &cluster, TVector2 const &centre, TVector2 const &direction, TVector2 &start, TVector2 &end)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
Provides recob::Track data product.
double FindMinSeparation(art::PtrVector< recob::Hit > const &cluster1, art::PtrVector< recob::Hit > const &cluster2)
Declaration of cluster object.
double FindCrossingDistance(TVector2 const &direction1, TVector2 const &centre1, TVector2 const &direction2, TVector2 const &centre2)
Detector simulation of raw signals on wires.
Encapsulate the geometry of a wire.
Utility object to perform functions of association.
Encapsulate the construction of a single detector plane.
double GlobalWire(geo::WireID const &wireID)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
double FindClusterOverlap(TVector2 const &direction, TVector2 const &centre, TVector2 const &start1, TVector2 const &end1, TVector2 const &start2, TVector2 const &end2)
unsigned int fMinMergeClusterSize
art framework interface to geometry description
bool PassCuts(double const &angle, double const &crossingDistance, double const &projectedWidth, double const &separation, double const &overlap, double const &longLength)
Encapsulate the construction of a single detector plane.
art::ServiceHandle< geo::Geometry > fGeom