CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
PeriodicBinFinderInPhi< T > Class Template Reference

#include <MagBLayer.h>

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

Public Member Functions

int binIndex (T phi) const override
 returns an index in the valid range for the bin that contains phi More...
 
int binIndex (int i) const override
 returns an index in the valid range, modulo Nbins More...
 
T binPosition (int ind) const override
 the middle of the bin in radians More...
 
 PeriodicBinFinderInPhi ()
 
 PeriodicBinFinderInPhi (T firstPhi, int nbins)
 
- Public Member Functions inherited from BaseBinFinder< T >
 BaseBinFinder ()
 
virtual ~BaseBinFinder ()
 

Static Public Member Functions

static constexpr T pi ()
 
static constexpr T twoPi ()
 

Private Attributes

T theInvPhiStep = 0
 
int theNbins = 0
 
T thePhiOffset = 0
 
T thePhiStep = 0
 

Static Private Attributes

static constexpr T piC = 3.141592653589793238
 
static constexpr T twoPiC = 2 * piC
 

Detailed Description

template<class T>
class PeriodicBinFinderInPhi< T >

Periodic Bin Finder around a circle for (almost) equidistant bins. Phi is the angle on the circle in radians.

Definition at line 22 of file MagBLayer.h.

Constructor & Destructor Documentation

template<class T>
PeriodicBinFinderInPhi< T >::PeriodicBinFinderInPhi ( )
inline

Definition at line 16 of file PeriodicBinFinderInPhi.h.

16 {}
template<class T>
PeriodicBinFinderInPhi< T >::PeriodicBinFinderInPhi ( T  firstPhi,
int  nbins 
)
inline

Member Function Documentation

template<class T>
int PeriodicBinFinderInPhi< T >::binIndex ( T  phi) const
inlineoverridevirtual

returns an index in the valid range for the bin that contains phi

Implements BaseBinFinder< T >.

Definition at line 25 of file PeriodicBinFinderInPhi.h.

Referenced by MTDDetRing::compatibleDets(), MuDetRing::compatibleDets(), Phase2EndcapSingleRing::computeCrossing(), TECLayer::computeCrossings(), TIDRing::computeCrossings(), Phase2EndcapRing::computeCrossings(), PixelForwardLayer::computeCrossings(), PixelForwardLayerPhase1::computeCrossings(), TIBRing::computeCrossings(), MagBLayer::findVolume(), MagGeometry::findVolume(), PixelForwardLayer::groupedCompatibleDetsV(), PixelForwardLayerPhase1::groupedCompatibleDetsV(), TIBRing::groupedCompatibleDetsV(), TECLayer::searchNeighbors(), PixelForwardLayer::searchNeighbors(), PixelForwardLayerPhase1::searchNeighbors(), Phase2EndcapSingleRing::searchNeighbors(), TIDRing::searchNeighbors(), Phase2EndcapRing::searchNeighbors(), TBPLayer::searchNeighbors(), and TIBRing::searchNeighbors().

25  {
26  T tmp = std::fmod((phi - thePhiOffset), twoPiC) * theInvPhiStep;
27  if (tmp < 0)
28  tmp += theNbins;
29  return std::min(int(tmp), theNbins - 1);
30  }
tmp
align.sh
Definition: createJobs.py:716
long double T
template<class T>
int PeriodicBinFinderInPhi< T >::binIndex ( int  i) const
inlineoverridevirtual

returns an index in the valid range, modulo Nbins

Implements BaseBinFinder< T >.

Definition at line 33 of file PeriodicBinFinderInPhi.h.

33  {
34  int ind = i % theNbins;
35  return ind < 0 ? ind + theNbins : ind;
36  }
template<class T>
T PeriodicBinFinderInPhi< T >::binPosition ( int  ind) const
inlineoverridevirtual

the middle of the bin in radians

Implements BaseBinFinder< T >.

Definition at line 39 of file PeriodicBinFinderInPhi.h.

39 { return thePhiOffset + thePhiStep * (T(ind) + T(0.5)); }
long double T
template<class T>
static constexpr T PeriodicBinFinderInPhi< T >::pi ( )
inlinestatic

Definition at line 41 of file PeriodicBinFinderInPhi.h.

41 { return piC; }
template<class T>
static constexpr T PeriodicBinFinderInPhi< T >::twoPi ( )
inlinestatic

Definition at line 42 of file PeriodicBinFinderInPhi.h.

42 { return twoPiC; }

Member Data Documentation

template<class T>
constexpr T PeriodicBinFinderInPhi< T >::piC = 3.141592653589793238
staticprivate

Definition at line 45 of file PeriodicBinFinderInPhi.h.

Referenced by PeriodicBinFinderInPhi< float >::pi().

template<class T>
T PeriodicBinFinderInPhi< T >::theInvPhiStep = 0
private

Definition at line 50 of file PeriodicBinFinderInPhi.h.

Referenced by PeriodicBinFinderInPhi< float >::binIndex().

template<class T>
int PeriodicBinFinderInPhi< T >::theNbins = 0
private

Definition at line 48 of file PeriodicBinFinderInPhi.h.

Referenced by PeriodicBinFinderInPhi< float >::binIndex().

template<class T>
T PeriodicBinFinderInPhi< T >::thePhiOffset = 0
private
template<class T>
T PeriodicBinFinderInPhi< T >::thePhiStep = 0
private
template<class T>
constexpr T PeriodicBinFinderInPhi< T >::twoPiC = 2 * piC
staticprivate