SimpleDiskBounds

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#ifndef Geom_SimpleDiskBounds_H
#define Geom_SimpleDiskBounds_H

#include "DataFormats/GeometryVector/interface/LocalPoint.h"
#include "DataFormats/GeometrySurface/interface/Bounds.h"

/** \class SimpleDiskBounds
 * Plane bounds that define a disk with a concentric hole in the middle.
 */

class SimpleDiskBounds final : public Bounds {
public:
  /// Construct the bounds from min and max R and Z in LOCAL coordinates.
  SimpleDiskBounds(float rmin, float rmax, float zmin, float zmax);

  float length() const override { return theZmax - theZmin; }
  float width() const override { return 2 * theRmax; }
  float thickness() const override { return theZmax - theZmin; }

  bool inside(const Local3DPoint& p) const override {
    return ((p.z() > theZmin) && (p.z() < theZmax)) &&
           ((p.perp2() > theRmin * theRmin) && (p.perp2() < theRmax * theRmax));
  }

  using Bounds::inside;

  bool inside(const Local3DPoint& p, const LocalError& err, float scale) const override;

  virtual bool inside(const Local2DPoint& p, const LocalError& err) const;

  Bounds* clone() const override;

  /// Extension of the Bounds interface
  float innerRadius() const { return theRmin; }
  float outerRadius() const { return theRmax; }

  float minZ() const { return theZmin; }
  float maxZ() const { return theZmax; }

private:
  float theRmin;
  float theRmax;
  float theZmin;
  float theZmax;
};

#endif  // Geom_SimpleDiskBounds_H