CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

GeneralBinFinderInR< T > Class Template Reference

#include <GeneralBinFinderInR.h>

Inheritance diagram for GeneralBinFinderInR< T >:
BaseBinFinder< T >

List of all members.

Public Types

typedef RBorderFinder::Det Det

Public Member Functions

virtual int binIndex (T R) const
virtual int binIndex (int i) const
 Returns an index in the valid range.
virtual T binPosition (int ind) const
 The middle of the bin.
 GeneralBinFinderInR (const RBorderFinder &bf)
 Construct from an already initialized RBorderFinder.
 GeneralBinFinderInR ()
 GeneralBinFinderInR (std::vector< Det * >::const_iterator first, std::vector< Det * >::const_iterator last)
 Construct from the list of Det*.

Private Attributes

std::vector< TtheBins
std::vector< TtheBorders
int theNbins

Detailed Description

template<class T>
class GeneralBinFinderInR< T >

A R binfinder for a non-periodic group of detectors.

Date:
2012/07/16 07:32:42
Revision:
1.3
Author:
N. Amapane - INFN Torino

Definition at line 19 of file GeneralBinFinderInR.h.


Member Typedef Documentation

template<class T>
typedef RBorderFinder::Det GeneralBinFinderInR< T >::Det

Definition at line 23 of file GeneralBinFinderInR.h.


Constructor & Destructor Documentation

template<class T>
GeneralBinFinderInR< T >::GeneralBinFinderInR ( ) [inline]

Definition at line 25 of file GeneralBinFinderInR.h.

{
template<class T>
GeneralBinFinderInR< T >::GeneralBinFinderInR ( const RBorderFinder bf) [inline]

Construct from an already initialized RBorderFinder.

Definition at line 28 of file GeneralBinFinderInR.h.

template<class T>
GeneralBinFinderInR< T >::GeneralBinFinderInR ( std::vector< Det * >::const_iterator  first,
std::vector< Det * >::const_iterator  last 
) [inline]

Construct from the list of Det*.

Definition at line 35 of file GeneralBinFinderInR.h.

References RBorderFinder::RBins(), RBorderFinder::RBorders(), GeneralBinFinderInR< T >::theBins, GeneralBinFinderInR< T >::theBorders, and GeneralBinFinderInR< T >::theNbins.

    : theNbins( last-first)
  {
    std::vector<const Det*> dets(first,last);
    RBorderFinder bf(dets);
    theBorders=bf.RBorders();
    theBins=bf.RBins();
    theNbins=theBins.size();
  }


Member Function Documentation

template<class T>
virtual int GeneralBinFinderInR< T >::binIndex ( T  R) const [inline, virtual]

Returns an index in the valid range for the bin that contains AND is closest to R

Implements BaseBinFinder< T >.

Definition at line 49 of file GeneralBinFinderInR.h.

References GeneralBinFinderInR< T >::theBorders.

                                 {
      if (R < theBorders[i]){
         break;
      }
    }
    return binIndex(i-1);
  }

template<class T>
virtual int GeneralBinFinderInR< T >::binIndex ( int  i) const [inline, virtual]

Returns an index in the valid range.

Implements BaseBinFinder< T >.

Definition at line 60 of file GeneralBinFinderInR.h.

                                        {
template<class T>
virtual T GeneralBinFinderInR< T >::binPosition ( int  ind) const [inline, virtual]

The middle of the bin.

Implements BaseBinFinder< T >.

Definition at line 65 of file GeneralBinFinderInR.h.

       :
  int theNbins;

Member Data Documentation

template<class T>
std::vector<T> GeneralBinFinderInR< T >::theBins [private]

Definition at line 73 of file GeneralBinFinderInR.h.

Referenced by GeneralBinFinderInR< T >::GeneralBinFinderInR().

template<class T>
std::vector<T> GeneralBinFinderInR< T >::theBorders [private]
template<class T>
int GeneralBinFinderInR< T >::theNbins [private]

Definition at line 71 of file GeneralBinFinderInR.h.

Referenced by GeneralBinFinderInR< T >::GeneralBinFinderInR().