Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:33

0001 #ifndef GeometryVector_EtaInterval_H
0002 #define GeometryVector_EtaInterval_H
0003 #include "DataFormats/GeometryVector/interface/Basic3DVector.h"
0004 
0005 class EtaInterval {
0006 public:
0007   EtaInterval(float eta1, float eta2) : z1(::sinhf(eta1)), z2(::sinhf(eta2)) {}
0008 
0009   template <typename T>
0010   bool inside(Basic3DVector<T> const& v) const {
0011     auto z = v.z();
0012     auto r = v.perp();
0013     return (z > z1 * r) & (z < z2 * r);
0014   }
0015 
0016 private:
0017   float z1, z2;
0018 };
0019 
0020 #endif