Hall-D Software
alpha
|
#include <DHoughFind.h>
Public Member Functions | |
DHoughFind () | |
DHoughFind (double xmin, double xmax, double ymin, double ymax, unsigned int Nbinsx, unsigned int Nbinsy) | |
virtual | ~DHoughFind () |
virtual const char * | className (void) const |
double | signof (double a) |
void | SetLimits (double xmin, double xmax, double ymin, double ymax, unsigned int Nbinsx, unsigned int Nbinsy) |
void | ResetHist (void) |
DVector2 | GetMaxBinLocation (void) |
double | GetMaxBinContent (void) |
double | GetSigmaX (void) |
double | GetSigmaY (void) |
DVector2 | Find (void) |
DVector2 | Find (const vector< DVector2 > &points) |
void | Fill (double x, double sigmax, double y, double sigmay) |
void | Add (const DHoughFind *hough) |
void | AddPoint (const DVector2 &point) |
void | AddPoint (const double &x, const double &y) |
void | AddPoints (const vector< DVector2 > &points) |
unsigned int | GetNPoints (void) |
vector< DVector2 > | GetPoints (void) |
void | ClearPoints (void) |
void | PrintHist (void) |
void | FindIndexes (const DVector2 &pos, int &ix, int &iy) |
double | FindBeta (double xlo, double ylo, double widthx, double widthy, DVector2 &pos, DVector2 &step) |
double | FindBeta (const DVector2 &a, const DVector2 &b, const DVector2 &c, const DVector2 &d) |
TH2D * | MakeIntoRootHist (string hname) |
Static Public Member Functions | |
static const char * | static_className (void) |
static DVector2 | GetMaxBinLocation (vector< const DHoughFind * > &houghs) |
Protected Attributes | |
vector< DVector2 > | points |
double | xmin |
double | xmax |
double | ymin |
double | ymax |
unsigned int | Nbinsx |
unsigned int | Nbinsy |
double | bin_widthx |
double | bin_widthy |
double | bin_size |
bool | max_bin_valid |
unsigned int | imax_binx |
unsigned int | imax_biny |
double | max_bin_content |
double * | hist |
DVector2 | a0 |
DVector2 | xdir |
DVector2 | ydir |
DVector2 | stepdir |
DVector2 | start |
Definition at line 22 of file DHoughFind.h.
DHoughFind::DHoughFind | ( | ) |
Definition at line 18 of file DHoughFind.cc.
References hist.
DHoughFind::DHoughFind | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
unsigned int | Nbinsx, | ||
unsigned int | Nbinsy | ||
) |
Definition at line 27 of file DHoughFind.cc.
References hist.
|
virtual |
Definition at line 36 of file DHoughFind.cc.
References hist.
void DHoughFind::Add | ( | const DHoughFind * | hough | ) |
void DHoughFind::AddPoint | ( | const DVector2 & | point | ) |
Definition at line 321 of file DHoughFind.cc.
Referenced by DTrackCandidate_factory_FDCCathodes::LinkSegmentsHough().
void DHoughFind::AddPoint | ( | const double & | x, |
const double & | y | ||
) |
Definition at line 329 of file DHoughFind.cc.
void DHoughFind::AddPoints | ( | const vector< DVector2 > & | points | ) |
Definition at line 338 of file DHoughFind.cc.
|
inlinevirtual |
Definition at line 27 of file DHoughFind.h.
void DHoughFind::ClearPoints | ( | void | ) |
Definition at line 346 of file DHoughFind.cc.
void DHoughFind::Fill | ( | double | x, |
double | sigmax, | ||
double | y, | ||
double | sigmay | ||
) |
Increment the histogram bins according to the given location and sigmas. This will increment each bin by calculating the product of 2 gaussians using the coordinates of the center of the bin. Only bins within 4 sigma in each dimension are incremented.
Note that the histogram is NOT reset prior to filling. This is to allow accumulation over multiple calls.
Definition at line 204 of file DHoughFind.cc.
References hist, xstream::base64::index(), and ymin.
DVector2 DHoughFind::Find | ( | void | ) |
Definition at line 124 of file DHoughFind.cc.
Referenced by DTrackCandidate_factory_FDCCathodes::LinkSegmentsHough().
Loop over "points" transforming them into lines and filling the 2-D histogram.
Definition at line 132 of file DHoughFind.cc.
References hist, xstream::base64::index(), ymax, and ymin.
|
inline |
Definition at line 96 of file DHoughFind.h.
|
inline |
Given the 2-D vectors a,b,c, and d find the scaler value "beta" such that
a + alpha*b = c + beta*d
It vectors b and d should be unit vectors. The value of alpha is not returned, but can be calculated via:
alpha = beta*(d.b) - b.(a-c)
If the vectors b and d are parallel, then the return value will be inf or whatever division by zero returns on the system.
Definition at line 147 of file DHoughFind.h.
|
inline |
Definition at line 87 of file DHoughFind.h.
References ymin.
double DHoughFind::GetMaxBinContent | ( | void | ) |
Definition at line 100 of file DHoughFind.cc.
Referenced by DTrackCandidate_factory_FDCCathodes::LinkSegmentsHough().
DVector2 DHoughFind::GetMaxBinLocation | ( | void | ) |
Definition at line 87 of file DHoughFind.cc.
|
static |
This routine is designed to be called statically via:
DHoughFind::GetMaxBinLocation(houghs);
It will find the location of the center of the bin with the maximum content based on the sum of the input DHough objects. It does this dynamically without maintaining a sum histogram.
WARNING: If you call this as a method of an existing object, (e.g. like this myhough->GetMacBinLocation(houghs); ) the object is NOT used unless it explicitly appears in the "houghs" list!
It is left to the caller to ensure the limits and number of bins for each DHough object are the same.
Definition at line 244 of file DHoughFind.cc.
References xstream::base64::index(), x, and y.
|
inline |
Definition at line 48 of file DHoughFind.h.
|
inline |
Definition at line 49 of file DHoughFind.h.
Referenced by DTrackCandidate_factory_FDCCathodes::LinkSegmentsHough().
double DHoughFind::GetSigmaX | ( | void | ) |
Definition at line 108 of file DHoughFind.cc.
References sqrt().
double DHoughFind::GetSigmaY | ( | void | ) |
Definition at line 116 of file DHoughFind.cc.
References sqrt().
TH2D * DHoughFind::MakeIntoRootHist | ( | string | hname | ) |
Make a ROOT TH2D histogram out of this contents of this DHoughFind object. Note that it is up to the caller to delete the returned TH2D object.
Definition at line 383 of file DHoughFind.cc.
void DHoughFind::PrintHist | ( | void | ) |
Dump an ASCII representation of the normalized histogram to the screen. This will dump a table of Nbinsx x Nbinsy characters to the screen as a sort of cheap visual of the histgram. It is only intended for debugging.
Definition at line 354 of file DHoughFind.cc.
References c, hist, xstream::base64::index(), sprintf(), and ymin.
void DHoughFind::ResetHist | ( | void | ) |
Definition at line 74 of file DHoughFind.cc.
References hist.
void DHoughFind::SetLimits | ( | double | xmin, |
double | xmax, | ||
double | ymin, | ||
double | ymax, | ||
unsigned int | Nbinsx, | ||
unsigned int | Nbinsy | ||
) |
Definition at line 44 of file DHoughFind.cc.
References hist, ymax, and ymin.
Referenced by DTrackCandidate_factory_FDCCathodes::LinkSegmentsHough().
|
inline |
Definition at line 30 of file DHoughFind.h.
|
inlinestatic |
Definition at line 28 of file DHoughFind.h.
|
protected |
Definition at line 71 of file DHoughFind.h.
|
protected |
Definition at line 64 of file DHoughFind.h.
|
protected |
Definition at line 64 of file DHoughFind.h.
|
protected |
Definition at line 64 of file DHoughFind.h.
|
protected |
Definition at line 69 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 66 of file DHoughFind.h.
|
protected |
Definition at line 66 of file DHoughFind.h.
|
protected |
Definition at line 67 of file DHoughFind.h.
|
protected |
Definition at line 65 of file DHoughFind.h.
|
protected |
Definition at line 63 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 63 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 60 of file DHoughFind.h.
|
protected |
Definition at line 75 of file DHoughFind.h.
|
protected |
Definition at line 74 of file DHoughFind.h.
|
protected |
Definition at line 72 of file DHoughFind.h.
|
protected |
Definition at line 62 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 62 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 73 of file DHoughFind.h.
|
protected |
Definition at line 62 of file DHoughFind.h.
Referenced by Add().
|
protected |
Definition at line 62 of file DHoughFind.h.
Referenced by Add().