#include <GeneralBinFinderInPhi.h>
Public Types | |
typedef PhiBorderFinder::Det | Det |
Public Member Functions | |
virtual int | binIndex (T phi) const |
virtual int | binIndex (int i) const |
Returns an index in the valid range, modulo Nbins. | |
virtual T | binPosition (int ind) const |
the middle of the bin in radians | |
GeneralBinFinderInPhi (const PhiBorderFinder &bf) | |
Construct from an already initialized PhiBorderFinder. | |
GeneralBinFinderInPhi () | |
GeneralBinFinderInPhi (std::vector< Det * >::const_iterator first, std::vector< Det * >::const_iterator last) | |
Construct from the list of Det*. | |
virtual | ~GeneralBinFinderInPhi () |
Private Member Functions | |
T | positiveRange (T phi) const |
Private Attributes | |
std::vector< T > | theBins |
std::vector< T > | theBorders |
int | theNbins |
A phi bin finder for a non-periodic group of detectors.
Definition at line 20 of file GeneralBinFinderInPhi.h.
typedef PhiBorderFinder::Det GeneralBinFinderInPhi< T >::Det |
Definition at line 24 of file GeneralBinFinderInPhi.h.
GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi | ( | ) | [inline] |
Definition at line 26 of file GeneralBinFinderInPhi.h.
{
GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi | ( | const PhiBorderFinder & | bf | ) | [inline] |
Construct from an already initialized PhiBorderFinder.
Definition at line 29 of file GeneralBinFinderInPhi.h.
GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi | ( | std::vector< Det * >::const_iterator | first, |
std::vector< Det * >::const_iterator | last | ||
) | [inline] |
Construct from the list of Det*.
Definition at line 36 of file GeneralBinFinderInPhi.h.
References PhiBorderFinder::phiBins(), PhiBorderFinder::phiBorders(), GeneralBinFinderInPhi< T >::theBins, GeneralBinFinderInPhi< T >::theBorders, and GeneralBinFinderInPhi< T >::theNbins.
: theNbins( last-first) { std::vector<Det*> dets(first,last); PhiBorderFinder bf(dets); theBorders=bf.phiBorders(); theBins=bf.phiBins(); theNbins=theBins.size(); }
virtual GeneralBinFinderInPhi< T >::~GeneralBinFinderInPhi | ( | ) | [inline, virtual] |
Definition at line 47 of file GeneralBinFinderInPhi.h.
{
virtual int GeneralBinFinderInPhi< T >::binIndex | ( | T | phi | ) | const [inline, virtual] |
Returns an index in the valid range for the bin that contains AND is closest to phi
Implements BaseBinFinder< T >.
Definition at line 51 of file GeneralBinFinderInPhi.h.
: "<< theNbins; for (int i = 0; i< theNbins; i++) { T cur = theBorders[i]; T next = theBorders[binIndex(i+1)]; T phi_ = phi; LogTrace(metname) << "bin: " << i << " border min " << cur << " border max: " << next << " phi: "<< phi_; if ( cur > next ) // we are crossing the pi edge: so move the edge to 0! { cur = positiveRange(cur); next = positiveRange(next); phi_ = positiveRange(phi_); } if (phi_ > cur-epsilon && phi_ < next) return i; } throw cms::Exception("UnexpectedState") << "GeneralBinFinderInPhi::binIndex( T phi) bin not found!"; }
virtual int GeneralBinFinderInPhi< T >::binIndex | ( | int | i | ) | const [inline, virtual] |
Returns an index in the valid range, modulo Nbins.
Implements BaseBinFinder< T >.
Definition at line 82 of file GeneralBinFinderInPhi.h.
: ind; }
virtual T GeneralBinFinderInPhi< T >::binPosition | ( | int | ind | ) | const [inline, virtual] |
the middle of the bin in radians
Implements BaseBinFinder< T >.
Definition at line 88 of file GeneralBinFinderInPhi.h.
: int theNbins;
T GeneralBinFinderInPhi< T >::positiveRange | ( | T | phi | ) | const [inline, private] |
Definition at line 99 of file GeneralBinFinderInPhi.h.
References Geom::twoPi().
{ return (phi > 0) ? phi : phi + Geom::twoPi(); }
std::vector<T> GeneralBinFinderInPhi< T >::theBins [private] |
Definition at line 96 of file GeneralBinFinderInPhi.h.
Referenced by GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi().
std::vector<T> GeneralBinFinderInPhi< T >::theBorders [private] |
Definition at line 95 of file GeneralBinFinderInPhi.h.
Referenced by GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi().
int GeneralBinFinderInPhi< T >::theNbins [private] |
Definition at line 94 of file GeneralBinFinderInPhi.h.
Referenced by GeneralBinFinderInPhi< T >::GeneralBinFinderInPhi().