CMS 3D CMS Logo

DiskSectorBounds.h
Go to the documentation of this file.
1 #ifndef DataFormats_GeometrySurface_DiskSectorBounds_h
2 #define DataFormats_GeometrySurface_DiskSectorBounds_h
3 
7 #include <algorithm>
8 #include <cmath>
9 #include <cassert>
10 
11 class DiskSectorBounds final : public Bounds {
12 public:
13  DiskSectorBounds(float rmin, float rmax, float zmin, float zmax, float phiExt)
14  : theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExtH(0.5f * phiExt) {
15  assert(thePhiExtH > 0);
16  if (theRmin > theRmax)
18  if (theZmin > theZmax)
20  theOffset = theRmin + 0.5f * (theRmax - theRmin);
21  }
22 
23  float length() const override { return theRmax - theRmin * std::cos(thePhiExtH); }
24  float width() const override { return 2.f * theRmax * std::sin(thePhiExtH); }
25  float thickness() const override { return theZmax - theZmin; }
26 
27  bool inside(const Local3DPoint& p) const override;
28 
29  bool inside(const Local3DPoint& p, const LocalError& err, float scale) const override;
30 
31  Bounds* clone() const override { return new DiskSectorBounds(*this); }
32 
33  float innerRadius() const { return theRmin; }
34  float outerRadius() const { return theRmax; }
35  float phiHalfExtension() const { return thePhiExtH; }
36 
37 private:
38  float theRmin;
39  float theRmax;
40  float theZmin;
41  float theZmax;
42  float thePhiExtH;
43  float theOffset;
44 };
45 
46 #endif
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
assert(be >=bs)
float width() const override
float phiHalfExtension() const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
float outerRadius() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float thickness() const override
double f[11][100]
float length() const override
bool inside(const Local3DPoint &p) const override
Determine if the point is inside the bounds.
float innerRadius() const
Definition: Bounds.h:18
DiskSectorBounds(float rmin, float rmax, float zmin, float zmax, float phiExt)
Bounds * clone() const override