NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
Public Member Functions | List of all members
TrAnal::TrapFilter< T > Class Template Reference

A simple fast filter (lead sum - trail sum) More...

#include <TrapFilter.hpp>

Inheritance diagram for TrAnal::TrapFilter< T >:
TrAnal::AlgoIterator< T >

Public Member Functions

 TrapFilter (const TrIterator< T > &begin, int rise_range, int gap_range)
 Constructs a symmetric trap filter. More...
 
 TrapFilter (const TrRange< T > &trail_range, const TrRange< T > &lead_range)
 Constructs an arbitrary trap filter. More...
 
TrapFilteroperator= (const TrapFilter &that)
 Assignment operator. More...
 
virtual ~TrapFilter ()
 Virtual destructor. More...
 
virtual TrapFilteroperator++ ()
 ++filter style increment More...
 
TrapFilter operator++ (int)
 filter++ style increment More...
 
virtual bool operator< (const TrIterator< T > &it) const
 Less than comparison to TrIterator. More...
 
bool operator> (const TrIterator< T > &it) const
 Greater than comparison to TrIterator. More...
 
virtual TrIterator< T > max_extent () const
 Gets the most advanced iterator position of the summing regions. More...
 
virtual TrIterator< T > min_extent () const
 Gets the minimum iterator position of the summing regions. More...
 
virtual double operator* () const
 Dereference operator <==> evaluates to current filter value. More...
 
- Public Member Functions inherited from TrAnal::AlgoIterator< T >
 AlgoIterator ()
 Default constructor.
 
 AlgoIterator (const AlgoIterator &)
 Copy constructor.
 
AlgoIteratoroperator= (const AlgoIterator &)
 Assignment operator.
 

Detailed Description

template<class T>
class TrAnal::TrapFilter< T >

A simple fast filter (lead sum - trail sum)

A simple trapezoidal filter is implemented that evaluates the difference between a leading sum and a trailing sum. It is naturally composed of two SumIterator objects. The filter implements the AlgoIterator interface and functionally is like an input iterator. When this is dereferenced, the difference between the current values of the two summing regions is returned. When it is incremented, the two summing regions are also incremented.

Constructor & Destructor Documentation

template<class T>
TrAnal::TrapFilter< T >::TrapFilter ( const TrIterator< T > &  begin,
int  rise_range,
int  gap_range 
)
inline

Constructs a symmetric trap filter.

Given a starting position, the symmetric filter is built from the rise_range and gap_range provided. These make use of the offset definitions of a TrRange. The trailing sum is defined as a region [begin, begin+rise_range) and the leading sum is defined as [begin+rise_range+gap_range, begin+ 2*rise_range+gap_range).

Parameters
beginthe iterator defining the starting position of the trailing sum
rise_rangethe range of the summing region and the length of the filter rise
gap_rangethe distance between the max_extent of the trailing sum and min_extent of leading sum
template<class T>
TrAnal::TrapFilter< T >::TrapFilter ( const TrRange< T > &  trail_range,
const TrRange< T > &  lead_range 
)
inline

Constructs an arbitrary trap filter.

Construct an arbitrary fast trapezoidal filter by providing the summing ranges

Parameters
trail_rangethe initial trailing sum range
lead_rangethe initial leading sum range
template<class T>
virtual TrAnal::TrapFilter< T >::~TrapFilter ( )
inlinevirtual

Virtual destructor.

Does nothing b/c no memory has been allocated dynamically

Member Function Documentation

template<class T>
virtual TrIterator<T> TrAnal::TrapFilter< T >::max_extent ( ) const
inlinevirtual

Gets the most advanced iterator position of the summing regions.

Returns the most advanced iterator between the two summing regions. This most likely points to the first value outside of the leading sum's range. However, no assumption is made about which summing region comes before the other because no logic is in place to ensure proper ordering.

Returns
iterator pointing to the most advanced iterator of the two summing regions

Reimplemented from TrAnal::AlgoIterator< T >.

template<class T>
virtual TrIterator<T> TrAnal::TrapFilter< T >::min_extent ( ) const
inlinevirtual

Gets the minimum iterator position of the summing regions.

Returns the minimum iterator position between the two summing regions. This most likely points to the first valid value of the trailing sum's range. However, no assumption is made about which summing region comes before the other because no logic is in place to ensure proper ordering.

Returns
iterator pointing to the minimum iterator position of the two summing regions

Reimplemented from TrAnal::AlgoIterator< T >.

template<class T>
virtual double TrAnal::TrapFilter< T >::operator* ( ) const
inlinevirtual

Dereference operator <==> evaluates to current filter value.

Returns
difference between leading and trailing sums.

Reimplemented from TrAnal::AlgoIterator< T >.

template<class T>
virtual TrapFilter& TrAnal::TrapFilter< T >::operator++ ( )
inlinevirtual

++filter style increment

Increments the two summing regions together as ++sum

Returns
a reference to this after incrementing

Reimplemented from TrAnal::AlgoIterator< T >.

template<class T>
TrapFilter TrAnal::TrapFilter< T >::operator++ ( int  )
inline

filter++ style increment

Increments the two summing regions together as sum++

Returns
a copy of filter before incrementing
template<class T>
virtual bool TrAnal::TrapFilter< T >::operator< ( const TrIterator< T > &  it) const
inlinevirtual

Less than comparison to TrIterator.

Comparison against a simple iterator (useful for checking whether next dereference will be a valid and safe). Literally compares whether the iterator returned by max_extent() is less than the argument. In normal situations, this is analogous to checking whether the max_extent() of the leading sum comes before the argument.

Parameters
itthe iterator to compare to
Returns
true if it<max_extent(), false otherwise

Reimplemented from TrAnal::AlgoIterator< T >.

template<class T>
TrapFilter& TrAnal::TrapFilter< T >::operator= ( const TrapFilter< T > &  that)
inline

Assignment operator.

Copy the two summing regions.

Parameters
thatthe object whose state will be copied
Returns
a reference to this after assignment
template<class T>
bool TrAnal::TrapFilter< T >::operator> ( const TrIterator< T > &  it) const
inline

Greater than comparison to TrIterator.

Comparison against a simple iterator. Literally compares whether the iterator returned by min_extent() is greater than the argument. In normal situations, this is analogous to checking whether the min_extent() of the trailing sum comes after the argument.

Parameters
itthe iterator to compare to
Returns
true if min_extent() > it, false otherwise

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