#include <TrackingTools/DetLayers/interface/PeriodicBinFinderInZ.h>
Public Member Functions | |
virtual int | binIndex (int i) const |
returns an index in the valid range | |
virtual int | binIndex (T z) const |
returns an index in the valid range for the bin that contains Z | |
virtual T | binPosition (int ind) const |
the middle of the bin | |
PeriodicBinFinderInZ (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last) | |
PeriodicBinFinderInZ () | |
Private Attributes | |
int | theNbins |
T | theZOffset |
T | theZStep |
The bins are computed from GeomDet positions.
Definition at line 13 of file PeriodicBinFinderInZ.h.
PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ | ( | ) | [inline] |
Definition at line 16 of file PeriodicBinFinderInZ.h.
00016 : theNbins(0), theZStep(0), theZOffset(0) {}
PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ | ( | std::vector< const GeomDet * >::const_iterator | first, | |
std::vector< const GeomDet * >::const_iterator | last | |||
) | [inline] |
Definition at line 18 of file PeriodicBinFinderInZ.h.
References PeriodicBinFinderInZ< T >::theNbins, PeriodicBinFinderInZ< T >::theZOffset, and PeriodicBinFinderInZ< T >::theZStep.
00019 : 00020 theNbins( last-first) 00021 { 00022 float zFirst = (**first).surface().position().z(); 00023 theZStep = ((**(last-1)).surface().position().z() - zFirst) / (theNbins-1); 00024 theZOffset = zFirst - 0.5*theZStep; 00025 }
virtual int PeriodicBinFinderInZ< T >::binIndex | ( | int | i | ) | const [inline, virtual] |
returns an index in the valid range
Implements BaseBinFinder< T >.
Definition at line 33 of file PeriodicBinFinderInZ.h.
References max, min, and PeriodicBinFinderInZ< T >::theNbins.
virtual int PeriodicBinFinderInZ< T >::binIndex | ( | T | z | ) | const [inline, virtual] |
returns an index in the valid range for the bin that contains Z
Implements BaseBinFinder< T >.
Definition at line 28 of file PeriodicBinFinderInZ.h.
References PeriodicBinFinderInZ< T >::theZOffset, and PeriodicBinFinderInZ< T >::theZStep.
Referenced by PixelRod::compatibleDetsV().
00028 { 00029 return binIndex( int((z-theZOffset)/theZStep)); 00030 }
virtual T PeriodicBinFinderInZ< T >::binPosition | ( | int | ind | ) | const [inline, virtual] |
the middle of the bin
Implements BaseBinFinder< T >.
Definition at line 38 of file PeriodicBinFinderInZ.h.
References PeriodicBinFinderInZ< T >::theZOffset, and PeriodicBinFinderInZ< T >::theZStep.
00038 { 00039 return theZOffset + theZStep * ( ind + 0.5); 00040 }
int PeriodicBinFinderInZ< T >::theNbins [private] |
Definition at line 44 of file PeriodicBinFinderInZ.h.
Referenced by PeriodicBinFinderInZ< T >::binIndex(), and PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ().
T PeriodicBinFinderInZ< T >::theZOffset [private] |
Definition at line 46 of file PeriodicBinFinderInZ.h.
Referenced by PeriodicBinFinderInZ< T >::binIndex(), PeriodicBinFinderInZ< T >::binPosition(), and PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ().
T PeriodicBinFinderInZ< T >::theZStep [private] |
Definition at line 45 of file PeriodicBinFinderInZ.h.
Referenced by PeriodicBinFinderInZ< T >::binIndex(), PeriodicBinFinderInZ< T >::binPosition(), and PeriodicBinFinderInZ< T >::PeriodicBinFinderInZ().