CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PeriodicBinFinderInZ< T > Class Template Reference

#include <PeriodicBinFinderInZ.h>

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

Public Member Functions

int binIndex (T z) const override
 returns an index in the valid range for the bin that contains Z More...
 
int binIndex (int i) const override
 returns an index in the valid range More...
 
T binPosition (int ind) const override
 the middle of the bin More...
 
 PeriodicBinFinderInZ ()
 
 PeriodicBinFinderInZ (std::vector< const GeomDet *>::const_iterator first, std::vector< const GeomDet *>::const_iterator last)
 
- Public Member Functions inherited from BaseBinFinder< T >
 BaseBinFinder ()
 
virtual ~BaseBinFinder ()
 

Private Attributes

int theNbins
 
T theZOffset
 
T theZStep
 

Detailed Description

template<class T>
class PeriodicBinFinderInZ< T >

Bin finder along the global Z for (almost) equidistant bins. The bins are computed from GeomDet positions.

Definition at line 13 of file PeriodicBinFinderInZ.h.

Constructor & Destructor Documentation

◆ PeriodicBinFinderInZ() [1/2]

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

◆ PeriodicBinFinderInZ() [2/2]

template<class T>
PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ ( std::vector< const GeomDet *>::const_iterator  first,
std::vector< const GeomDet *>::const_iterator  last 
)
inline

Definition at line 17 of file PeriodicBinFinderInZ.h.

19  : theNbins(last - first) {
20  float zFirst = (**first).surface().position().z();
21  theZStep = ((**(last - 1)).surface().position().z() - zFirst) / (theNbins - 1);
22  theZOffset = zFirst - 0.5 * theZStep;
23  }

Member Function Documentation

◆ binIndex() [1/2]

template<class T>
int PeriodicBinFinderInZ< T >::binIndex ( T  z) const
inlineoverridevirtual

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

Implements BaseBinFinder< T >.

Definition at line 26 of file PeriodicBinFinderInZ.h.

Referenced by PeriodicBinFinderInZ< float >::binIndex(), PixelRod::compatibleDetsV(), and TOBRod::computeCrossings().

26 { return binIndex(int((z - theZOffset) / theZStep)); }
int binIndex(T z) const override
returns an index in the valid range for the bin that contains Z

◆ binIndex() [2/2]

template<class T>
int PeriodicBinFinderInZ< T >::binIndex ( int  i) const
inlineoverridevirtual

returns an index in the valid range

Implements BaseBinFinder< T >.

Definition at line 29 of file PeriodicBinFinderInZ.h.

◆ binPosition()

template<class T>
T PeriodicBinFinderInZ< T >::binPosition ( int  ind) const
inlineoverridevirtual

the middle of the bin

Implements BaseBinFinder< T >.

Definition at line 32 of file PeriodicBinFinderInZ.h.

Referenced by TOBRod::computeCrossings().

Member Data Documentation

◆ theNbins

template<class T>
int PeriodicBinFinderInZ< T >::theNbins
private

◆ theZOffset

template<class T>
T PeriodicBinFinderInZ< T >::theZOffset
private

◆ theZStep

template<class T>
T PeriodicBinFinderInZ< T >::theZStep
private