LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "HoughBaseAlg.h"
Classes | |
struct | ChargeInfo_t |
Data structure collecting charge information to be filled in cluster. More... | |
Public Member Functions | |
HoughBaseAlg (fhicl::ParameterSet const &pset) | |
virtual | ~HoughBaseAlg () |
size_t | FastTransform (const std::vector< art::Ptr< recob::Cluster > > &clusIn, std::vector< recob::Cluster > &ccol, std::vector< art::PtrVector< recob::Hit > > &clusHitsOut, art::Event const &evt, std::string const &label) |
size_t | Transform (std::vector< art::Ptr< recob::Hit > > const &hits, std::vector< unsigned int > *fpointId_to_clusterId, unsigned int clusterId, unsigned int *nClusters, std::vector< protoTrack > *protoTracks) |
size_t | FastTransform (std::vector< art::Ptr< recob::Hit >> &clusIn, std::vector< art::PtrVector< recob::Hit >> &clusHitsOut) |
size_t | FastTransform (std::vector< art::Ptr< recob::Hit >> &clusIn, std::vector< art::PtrVector< recob::Hit >> &clusHitsOut, std::vector< double > &slope, std::vector< ChargeInfo_t > &totalQ) |
size_t | Transform (std::vector< art::Ptr< recob::Hit > > const &hits) |
size_t | Transform (std::vector< art::Ptr< recob::Hit > > const &hits, double &slope, double &intercept) |
virtual void | reconfigure (fhicl::ParameterSet const &pset) |
Protected Member Functions | |
void | HLSSaveBMPFile (char const *, unsigned char *, int, int) |
Private Attributes | |
int | fMaxLines |
Max number of lines that can be found. More... | |
int | fMinHits |
int | fSaveAccumulator |
Save bitmap image of accumulator for debugging? More... | |
int | fNumAngleCells |
float | fMaxDistance |
Max distance that a hit can be from a line to be considered part of that line. More... | |
float | fMaxSlope |
Max slope a line can have. More... | |
int | fRhoZeroOutRange |
Range in rho over which to zero out area around previously found lines in the accumulator. More... | |
int | fThetaZeroOutRange |
Range in theta over which to zero out area around previously found lines in the accumulator. More... | |
float | fRhoResolutionFactor |
Factor determining the resolution in rho. More... | |
int | fPerCluster |
int | fMissedHits |
float | fMissedHitsDistance |
Distance between hits in a hough line before a hit is considered missed. More... | |
float | fMissedHitsToLineSize |
Ratio of missed hits to line size for a line to be considered a fake. More... | |
Friends | |
class | HoughTransformClus |
Definition at line 550 of file HoughBaseAlg.h.
cluster::HoughBaseAlg::HoughBaseAlg | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 211 of file HoughBaseAlg.cxx.
References reconfigure().
|
virtual |
Definition at line 217 of file HoughBaseAlg.cxx.
size_t cluster::HoughBaseAlg::FastTransform | ( | const std::vector< art::Ptr< recob::Cluster > > & | clusIn, |
std::vector< recob::Cluster > & | ccol, | ||
std::vector< art::PtrVector< recob::Hit > > & | clusHitsOut, | ||
art::Event const & | evt, | ||
std::string const & | label | ||
) |
Definition at line 1051 of file HoughBaseAlg.cxx.
References lar::util::StatCollector< T, W >::add(), cluster::HoughTransform::AddPointReturnMax(), art::PtrVector< T >::back(), art::PtrVector< T >::clear(), geo::GeometryCore::Cryostat(), art::PtrVector< T >::end(), fMaxDistance, fMaxLines, fMaxSlope, fMinHits, fMissedHits, fMissedHitsDistance, fMissedHitsToLineSize, fNumAngleCells, fPerCluster, fRhoResolutionFactor, fRhoZeroOutRange, fSaveAccumulator, fThetaZeroOutRange, cluster::HoughTransform::GetCell(), cluster::HoughTransform::GetEquation(), hits(), HLSSaveBMPFile(), cluster::ClusterParamsImportWrapper< Algo >::ImportHits(), cluster::HoughTransform::Init(), geo::kInduction, LOG_DEBUG, max, geo::GeometryCore::Nplanes(), geo::PlaneGeo::Nwires(), recob::Hit::PeakTime(), geo::TPCGeo::Plane(), geo::WireID::planeID(), art::PtrVector< T >::push_back(), lar::util::StatCollector< T, W >::RMS(), recob::Cluster::Sentry, cluster::HoughTransform::SetCell(), recob::Hit::SigmaPeakTime(), geo::GeometryCore::SignalType(), lar::util::StatCollector< T, W >::Sum(), sw, geo::CryostatGeo::TPC(), lar::dump::vector(), recob::Hit::View(), geo::GeometryCore::Views(), geo::WireID::Wire, recob::Hit::WireID(), geo::GeometryCore::WirePitch(), x, xx, and y.
Referenced by cluster::HoughLineFinder::produce().
size_t cluster::HoughBaseAlg::FastTransform | ( | std::vector< art::Ptr< recob::Hit >> & | clusIn, |
std::vector< art::PtrVector< recob::Hit >> & | clusHitsOut | ||
) |
size_t cluster::HoughBaseAlg::FastTransform | ( | std::vector< art::Ptr< recob::Hit >> & | clusIn, |
std::vector< art::PtrVector< recob::Hit >> & | clusHitsOut, | ||
std::vector< double > & | slope, | ||
std::vector< ChargeInfo_t > & | totalQ | ||
) |
|
protected |
|
virtual |
Definition at line 222 of file HoughBaseAlg.cxx.
References fMaxDistance, fMaxLines, fMaxSlope, fMinHits, fMissedHits, fMissedHitsDistance, fMissedHitsToLineSize, fNumAngleCells, fPerCluster, fRhoResolutionFactor, fRhoZeroOutRange, fSaveAccumulator, fThetaZeroOutRange, and fhicl::ParameterSet::get().
Referenced by HoughBaseAlg(), cluster::fuzzyClusterAlg::reconfigure(), and cluster::HoughLineFinder::reconfigure().
size_t cluster::HoughBaseAlg::Transform | ( | std::vector< art::Ptr< recob::Hit > > const & | hits, |
std::vector< unsigned int > * | fpointId_to_clusterId, | ||
unsigned int | clusterId, | ||
unsigned int * | nClusters, | ||
std::vector< protoTrack > * | protoTracks | ||
) |
characteristic hit width of induction and collection plane
LOOP over hits, picking a random one Enter the point into the accumulator IF it is already in the accumulator or part of a line, skip it Store it in a vector of points that have been chosen
Find max value in accumulator; IF above threshold, create a line Subtract points in line from accumulator
END LOOP over hits, picking a random one
Init specifies the size of the two-dimensional accumulator (based on the arguments, number of wires and number of time samples).
Adds all of the hits to the accumulator
count is how many points are left to randomly insert
Get the random number generator
The random hit we are examining unsigned int randInd = rand() % hits.size();
If the point isn't in the current fuzzy cluster, skip it
Skip if it's already in a line
If we have already accumulated the point, skip it
zeroes out the neighborhood of all previous lines
end loop over size of listxmax
Find the weightiest cell in the accumulator.
Add the randomly selected point to the accumulator
The threshold calculation, see http://www.via.cornell.edu/ece547/projects/Hough/webpage/statistics.html accDx is the number of rho bins,m_rowLength
The threshold calculation using a Poisson distribution instead
Continue if the biggest maximum for the randomly selected point is smaller than fMinHits
Find the center of mass of the 3x3 cell system (with maxCell at the center).
fill the list of cells that have already been found
end iterator over hits
std::cout << "nClusters: " << *nClusters << std::endl;
Subtract points from the accumulator that have already been used
std::cout << std::endl; std::cout << "pCornerMin[0]: " << pCornerMin[0] << " pCornerMin[1]: " << pCornerMin[1] << std::endl; std::cout << "pCornerMax[0]: " << pCornerMax[0] << " pCornerMax[1]: " << pCornerMax[1] << std::endl;
end if !std::isnan
end loop over hits
Definition at line 248 of file HoughBaseAlg.cxx.
References cluster::HoughTransform::AddPointReturnMax(), geo::GeometryCore::Cryostat(), e, fMaxDistance, fMaxLines, fMaxSlope, fMinHits, fMissedHits, fNumAngleCells, fRhoResolutionFactor, fRhoZeroOutRange, fSaveAccumulator, fThetaZeroOutRange, cluster::HoughTransform::GetAccumSize(), cluster::HoughTransform::GetCell(), cluster::HoughTransform::GetEquation(), hits(), HLSSaveBMPFile(), protoTrack::Init(), cluster::HoughTransform::Init(), geo::kInduction, LOG_DEBUG, max, geo::GeometryCore::Nplanes(), geo::PlaneGeo::Nwires(), geo::TPCGeo::Plane(), cluster::HoughTransform::SetCell(), geo::GeometryCore::SignalType(), sqr(), cluster::HoughTransform::SubtractPoint(), geo::CryostatGeo::TPC(), w, geo::GeometryCore::WirePitch(), x, and y.
Referenced by cluster::fuzzyClusterAlg::run_fuzzy_cluster().
size_t cluster::HoughBaseAlg::Transform | ( | std::vector< art::Ptr< recob::Hit > > const & | hits | ) |
size_t cluster::HoughBaseAlg::Transform | ( | std::vector< art::Ptr< recob::Hit > > const & | hits, |
double & | slope, | ||
double & | intercept | ||
) |
Definition at line 1874 of file HoughBaseAlg.cxx.
References cluster::HoughTransform::AddPointReturnMax(), fNumAngleCells, fRhoResolutionFactor, cluster::HoughTransform::GetAccumSize(), cluster::HoughTransform::GetCell(), cluster::HoughTransform::GetEquation(), cluster::HoughTransform::GetMax(), hits(), cluster::HoughTransform::Init(), LOG_DEBUG, geo::GeometryCore::Nwires(), and detinfo::DetectorProperties::ReadOutWindowSize().
|
friend |
Definition at line 635 of file HoughBaseAlg.h.
|
private |
Max distance that a hit can be from a line to be considered part of that line.
Definition at line 621 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Max number of lines that can be found.
Definition at line 613 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Max slope a line can have.
Definition at line 622 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Min number of hits in the accumulator to consider (number of hits required to be considered a line).
Definition at line 614 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Number of wires that are allowed to be missed before a line is broken up into segments
Definition at line 628 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Distance between hits in a hough line before a hit is considered missed.
Definition at line 630 of file HoughBaseAlg.h.
Referenced by FastTransform(), and reconfigure().
|
private |
Ratio of missed hits to line size for a line to be considered a fake.
Definition at line 631 of file HoughBaseAlg.h.
Referenced by FastTransform(), and reconfigure().
|
private |
Number of angle cells in the accumulator (a measure of the angular resolution of the line finder). If this number is too large than the number of votes that fall into the "correct" bin will be small and consistent with noise.
Definition at line 617 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Tells the original Hough algorithm to look at clusters individually, or all hits at once
Definition at line 626 of file HoughBaseAlg.h.
Referenced by FastTransform(), and reconfigure().
|
private |
Factor determining the resolution in rho.
Definition at line 625 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Range in rho over which to zero out area around previously found lines in the accumulator.
Definition at line 623 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Save bitmap image of accumulator for debugging?
Definition at line 616 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().
|
private |
Range in theta over which to zero out area around previously found lines in the accumulator.
Definition at line 624 of file HoughBaseAlg.h.
Referenced by FastTransform(), reconfigure(), and Transform().