LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fuzzyClusterAlg.h
Go to the documentation of this file.
1 
2 #ifndef fuzzyClusterALG_H
3 #define fuzzyClusterALG_H
4 
5 // Standard C/C++ libraries
6 #include <vector>
7 #include <set>
8 #include <stdint.h> // uint32_t
9 
10 // ART and support libraries
13 
14 // LArSoft libraries
18 
19 namespace fhicl { class ParameterSet; }
20 
21 namespace recob { class Hit; }
22 
23 namespace cluster {
24 
25  //---------------------------------------------------------------
27  public:
28 
29 
31  virtual ~fuzzyClusterAlg();
32 
33  void reconfigure(fhicl::ParameterSet const& p);
34  void InitFuzzy(std::vector<art::Ptr<recob::Hit> >& allhits, std::set<uint32_t> badChannels);
35  // Three differnt version of the clustering code
36  void run_fuzzy_cluster(const std::vector<art::Ptr<recob::Hit> >& allhits);
37 
38 
39  std::vector<std::vector<unsigned int> > fclusters;
40  std::vector<std::vector<double> > fps;
41  std::vector<unsigned int> fpointId_to_clusterId;
42  std::vector<std::vector<double> > fsim;
43  std::vector<std::vector<double> > fsim2;
44  std::vector<std::vector<double> > fsim3;
45  double fMaxWidth;
46 
47  // Get functions and structures from HoughBaseAlg
48  //friend class HoughBaseAlg;
49 
50 
51 
52  //double **data = NULL;
53  std::vector<std::vector<double>> data;
54 
55 
56 
57 
58  private:
59 
60  // privately defined
61  class baseCluster;
62  class trackCluster;
64 
65 
66  double fNumberTimeBoundaries;
68 
69  // Run the Hough line finder?
70  bool fRunHough;
72 
75 
80 
84 
88 
90 
93 
94 
95 
96 
97 
98 
99 
100  void mergeHoughLinesBySegment(unsigned int k,
101  std::vector<protoTrack> *protoTracks,
102  double xyScale,
103  int mergeStyle,
104  double wire_dist,
105  double tickToDist);
106 
107  bool mergeTrackClusters(unsigned int k,
108  std::vector<trackCluster> *trackClusters,
109  double xyScale,
110  double wire_dist,
111  double tickToDist);
112 
113  bool mergeShowerClusters(unsigned int k,
114  std::vector<showerCluster> *showerClusters,
115  double xyScale,
116  double wire_dist,
117  double tickToDist);
118 
119  bool mergeShowerTrackClusters(showerCluster *showerClusterI,
120  trackCluster *trackClusterJ,
121  double xyScale,
122  double wire_dist,
123  double tickToDist);
124 
125  //std::vector<lineSlope> linesFound;
126  double HoughLineDistance(double p0MinLine1,
127  double p1MinLine1,
128  double p0MaxLine1,
129  double p1MaxLine1,
130  double p0MinLine2,
131  double p1MinLine2,
132  double p0MaxLine2,
133  double p1MaxLine2);
134  bool HoughLineIntersect(double x11,
135  double y11,
136  double x12,
137  double y12,
138  double x21,
139  double y21,
140  double x22,
141  double y22);
142  double PointSegmentDistance(double px,
143  double py,
144  double x1,
145  double y1,
146  double x2,
147  double y2);
148 
149  double DistanceBetweenHits(
152  double wire_dist,
153  double tickToDist);
154 
155  // noise vector
156  std::vector<bool> fnoise;
157  std::vector<bool> fvisited;
158  std::vector<double> fWirePitch;
159  std::set<uint32_t> fBadChannels;
160  std::vector<uint32_t> fBadWireSum;
161 
163 
164 
165 
166  //void IntArray_Push( IntArray *self, int value );
167 
168 
169  // Object used for Hough transforms
171 
172  // Object used for DBScan
174 
176 
177  }; // class fuzzyClusterAlg
178 
179 
180 
181 
182 
183 } // namespace
184 
185 #endif // ifndef fuzzyClusterALG_H
186 
187 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
std::vector< std::vector< double > > fsim3
std::vector< std::vector< double > > data
std::vector< bool > fnoise
Reconstruction base classes.
art::ServiceHandle< geo::Geometry > fGeom
handle to geometry service
double fFuzzyRemnantMergeCutoff
cut off on merging the fuzzy cluster remnants into the nearest shower or track
double fSigmaChargeAsymAngleCut
Cut on product of charge asymmetry and sin of angle between slopes of lines.
Float_t y1[n_points_granero]
Definition: compare.C:5
std::vector< bool > fvisited
Float_t x1[n_points_granero]
Definition: compare.C:5
std::vector< std::vector< double > > fsim2
std::set< uint32_t > fBadChannels
set of bad channels in this detector
double fTrackClusterMergeCutoff
Max distance between Hough lines before two lines are merged (muon tracks),.
int fMaxVertexLines
Max number of line end points allowed in a Hough line merge region for a merge to happen...
double fNumberWireBoundaries
Number of boundaries in wires for the drift window to be divided up to make the Hough line finder eas...
std::vector< std::vector< double > > fsim
bool fDoFuzzyRemnantMerge
Tell the algorithm to merge fuzzy cluster remnants into showers or tracks (0-off, 1-on) ...
Cluster finding and building.
This stores information about a tracklike cluster.
double fShowerTrackClusterMergeAngle
Max angle between slopes before two lines are merged, for lines in shower line regions.
Float_t y2[n_points_geant4]
Definition: compare.C:26
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
bool fDoTrackClusterMerge
Turn on cut on product of charge asymmetry and sin of angle between slopes of lines.
bool fDoShowerTrackClusterMerge
Turn on cut on product of charge asymmetry and sin of angle between slopes of lines.
bool fDoShowerClusterMerge
Turns on shower Hough line merging (0-off, 1-on)
parameter set interface
std::vector< uint32_t > fBadWireSum
This stores information about a cluster.
This stores information about a showerlike cluster.
std::vector< std::vector< double > > fps
the collection of points we are working on
bool fGenerateHoughLinesOnly
Show only the results of the Hough line finder, hits not in a line will not be clustered.
std::vector< unsigned int > fpointId_to_clusterId
mapping point_id -> clusterId
double fShowerClusterMergeAngle
Max angle between slopes before two lines are merged, for lines in shower line regions.
std::vector< double > fWirePitch
the pitch of the wires in each plane
double fNumberTimeBoundaries
Number of boundaries in ticks for the drift window to be divided up to make the Hough line finder eas...
std::vector< std::vector< unsigned int > > fclusters
collection of something
double fShowerTrackClusterMergeCutoff
Max distance between Hough lines before two lines are merged (electron showers),. ...
double fShowerLikenessCut
Cut on shower likeness (larger the more shower like, smaller the less shower like) ...
double fVertexLinesCutoff
Size of the vertex region to count up lines for fMaxVertexLines.
double fShowerClusterMergeCutoff
Max distance between Hough lines before two lines are merged (electron showers),. ...
Float_t x2[n_points_geant4]
Definition: compare.C:26
double fChargeAsymAngleCut
Cut on product of charge asymmetry and sin of angle between slopes of lines.
art framework interface to geometry description