Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DHoughFind Class Reference

#include <DHoughFind.h>

+ Inheritance diagram for DHoughFind:

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< DVector2GetPoints (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< DVector2points
 
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
 

Detailed Description

Definition at line 22 of file DHoughFind.h.

Constructor & Destructor Documentation

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.

DHoughFind::~DHoughFind ( )
virtual

Definition at line 36 of file DHoughFind.cc.

References hist.

Member Function Documentation

void DHoughFind::Add ( const DHoughFind hough)

Definition at line 292 of file DHoughFind.cc.

References _DBG_, hist, hist, Nbinsx, Nbinsy, xmax, xmin, ymax, ymax, ymin, and ymin.

void DHoughFind::AddPoint ( const DVector2 point)
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.

virtual const char* DHoughFind::className ( void  ) const
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  )
DVector2 DHoughFind::Find ( const vector< DVector2 > &  points)

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.

double DHoughFind::FindBeta ( double  xlo,
double  ylo,
double  widthx,
double  widthy,
DVector2 pos,
DVector2 step 
)
inline

Definition at line 96 of file DHoughFind.h.

double DHoughFind::FindBeta ( const DVector2 a,
const DVector2 b,
const DVector2 c,
const DVector2 d 
)
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.

void DHoughFind::FindIndexes ( const DVector2 pos,
int &  ix,
int &  iy 
)
inline

Definition at line 87 of file DHoughFind.h.

References ymin.

double DHoughFind::GetMaxBinContent ( void  )
DVector2 DHoughFind::GetMaxBinLocation ( void  )

Definition at line 87 of file DHoughFind.cc.

References x, y, and ymin.

DVector2 DHoughFind::GetMaxBinLocation ( vector< const DHoughFind * > &  houghs)
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.

unsigned int DHoughFind::GetNPoints ( void  )
inline

Definition at line 48 of file DHoughFind.h.

vector<DVector2> DHoughFind::GetPoints ( void  )
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.

References h, hist, ymax, and ymin.

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().

double DHoughFind::signof ( double  a)
inline

Definition at line 30 of file DHoughFind.h.

static const char* DHoughFind::static_className ( void  )
inlinestatic

Definition at line 28 of file DHoughFind.h.

Member Data Documentation

DVector2 DHoughFind::a0
protected

Definition at line 71 of file DHoughFind.h.

double DHoughFind::bin_size
protected

Definition at line 64 of file DHoughFind.h.

double DHoughFind::bin_widthx
protected

Definition at line 64 of file DHoughFind.h.

double DHoughFind::bin_widthy
protected

Definition at line 64 of file DHoughFind.h.

double* DHoughFind::hist
protected

Definition at line 69 of file DHoughFind.h.

Referenced by Add().

unsigned int DHoughFind::imax_binx
protected

Definition at line 66 of file DHoughFind.h.

unsigned int DHoughFind::imax_biny
protected

Definition at line 66 of file DHoughFind.h.

double DHoughFind::max_bin_content
protected

Definition at line 67 of file DHoughFind.h.

bool DHoughFind::max_bin_valid
protected

Definition at line 65 of file DHoughFind.h.

unsigned int DHoughFind::Nbinsx
protected

Definition at line 63 of file DHoughFind.h.

Referenced by Add().

unsigned int DHoughFind::Nbinsy
protected

Definition at line 63 of file DHoughFind.h.

Referenced by Add().

vector<DVector2> DHoughFind::points
protected

Definition at line 60 of file DHoughFind.h.

DVector2 DHoughFind::start
protected

Definition at line 75 of file DHoughFind.h.

DVector2 DHoughFind::stepdir
protected

Definition at line 74 of file DHoughFind.h.

DVector2 DHoughFind::xdir
protected

Definition at line 72 of file DHoughFind.h.

double DHoughFind::xmax
protected

Definition at line 62 of file DHoughFind.h.

Referenced by Add().

double DHoughFind::xmin
protected

Definition at line 62 of file DHoughFind.h.

Referenced by Add().

DVector2 DHoughFind::ydir
protected

Definition at line 73 of file DHoughFind.h.

double DHoughFind::ymax
protected

Definition at line 62 of file DHoughFind.h.

Referenced by Add().

double DHoughFind::ymin
protected

Definition at line 62 of file DHoughFind.h.

Referenced by Add().


The documentation for this class was generated from the following files: