CMS 3D CMS Logo

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 (int i) const override
 returns an index in the valid range, modulo Nbins More...
 
int binIndex (T phi) const override
 returns an index in the valid range for the bin that contains phi 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

◆ PeriodicBinFinderInPhi() [1/2]

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

Definition at line 16 of file PeriodicBinFinderInPhi.h.

16 {}

◆ PeriodicBinFinderInPhi() [2/2]

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

Definition at line 18 of file PeriodicBinFinderInPhi.h.

19  : theNbins(nbins),
22  thePhiOffset(firstPhi - T(0.5) * thePhiStep) {}

Member Function Documentation

◆ binIndex() [1/2]

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  }

◆ binIndex() [2/2]

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

◆ binPosition()

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)); }

◆ pi()

template<class T>
static constexpr T PeriodicBinFinderInPhi< T >::pi ( )
inlinestaticconstexpr

Definition at line 41 of file PeriodicBinFinderInPhi.h.

41 { return piC; }

◆ twoPi()

template<class T>
static constexpr T PeriodicBinFinderInPhi< T >::twoPi ( )
inlinestaticconstexpr

Definition at line 42 of file PeriodicBinFinderInPhi.h.

42 { return twoPiC; }

Member Data Documentation

◆ piC

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

Definition at line 45 of file PeriodicBinFinderInPhi.h.

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

◆ theInvPhiStep

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

Definition at line 50 of file PeriodicBinFinderInPhi.h.

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

◆ theNbins

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

Definition at line 48 of file PeriodicBinFinderInPhi.h.

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

◆ thePhiOffset

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

◆ thePhiStep

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

◆ twoPiC

template<class T>
constexpr T PeriodicBinFinderInPhi< T >::twoPiC = 2 * piC
staticconstexprprivate
mps_fire.i
i
Definition: mps_fire.py:428
min
T min(T a, T b)
Definition: MathUtil.h:58
PeriodicBinFinderInPhi::thePhiStep
T thePhiStep
Definition: PeriodicBinFinderInPhi.h:49
PeriodicBinFinderInPhi::twoPiC
static constexpr T twoPiC
Definition: PeriodicBinFinderInPhi.h:46
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
PeriodicBinFinderInPhi::theNbins
int theNbins
Definition: PeriodicBinFinderInPhi.h:48
PeriodicBinFinderInPhi::theInvPhiStep
T theInvPhiStep
Definition: PeriodicBinFinderInPhi.h:50
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
DDAxes::phi
T
long double T
Definition: Basic3DVectorLD.h:48
PeriodicBinFinderInPhi::thePhiOffset
T thePhiOffset
Definition: PeriodicBinFinderInPhi.h:51
PeriodicBinFinderInPhi::piC
static constexpr T piC
Definition: PeriodicBinFinderInPhi.h:45