Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gar::rec::alg::XIndex< T, N > Class Template Reference

#include <NNClusters.h>

Public Member Functions

 XIndex (float xmin, float xmax)
 
int operator() (T *hit)
 

Protected Member Functions

 XIndex ()
 

Protected Attributes

float _xmin
 
float _xmax
 

Detailed Description

template<class T, int N>
class gar::rec::alg::XIndex< T, N >

Simple predicate class for computing an index from N bins of the x-coordinate of Objects that have a float/double* Position() method.

Definition at line 311 of file NNClusters.h.

Constructor & Destructor Documentation

template<class T, int N>
gar::rec::alg::XIndex< T, N >::XIndex ( float  xmin,
float  xmax 
)
inline

C'tor takes xmin and xmax - NB index can be negative and larger than N

Definition at line 314 of file NNClusters.h.

314 : _xmin( xmin ), _xmax( xmax ) {}
template<class T, int N>
gar::rec::alg::XIndex< T, N >::XIndex ( )
inlineprotected

Definition at line 323 of file NNClusters.h.

323 {} ;

Member Function Documentation

template<class T, int N>
int gar::rec::alg::XIndex< T, N >::operator() ( T *  hit)
inline

Definition at line 316 of file NNClusters.h.

316  {
317 
318  return (int) std::floor( ( hit->Position()[0] - _xmin ) / ( _xmax - _xmin ) * N ) ;
319  }
Detector simulation of raw signals on wires.

Member Data Documentation

template<class T, int N>
float gar::rec::alg::XIndex< T, N >::_xmax
protected

Definition at line 325 of file NNClusters.h.

template<class T, int N>
float gar::rec::alg::XIndex< T, N >::_xmin
protected

Definition at line 323 of file NNClusters.h.


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