CMS 3D CMS Logo

EtaInterval.h
Go to the documentation of this file.
1 #ifndef GeometryVector_EtaInterval_H
2 #define GeometryVector_EtaInterval_H
4 
5 class EtaInterval {
6 public:
7  EtaInterval(float eta1, float eta2) : z1(::sinhf(eta1)), z2(::sinhf(eta2)) {}
8 
9  template <typename T>
10  bool inside(Basic3DVector<T> const& v) const {
11  auto z = v.z();
12  auto r = v.perp();
13  return (z > z1 * r) & (z < z2 * r);
14  }
15 
16 private:
17  float z1, z2;
18 };
19 
20 #endif
T z() const
Cartesian z coordinate.
EtaInterval(float eta1, float eta2)
Definition: EtaInterval.h:7
T perp() const
Magnitude of transverse component.
bool inside(Basic3DVector< T > const &v) const
Definition: EtaInterval.h:10