File indexing completed on 2025-06-03 00:12:03
0001 #ifndef Geometry_HGCalCommonData_HGCGuardRing_h
0002 #define Geometry_HGCalCommonData_HGCGuardRing_h
0003
0004 #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h"
0005 #include "G4ThreeVector.hh"
0006
0007 #include <vector>
0008
0009 class HGCGuardRing {
0010 public:
0011 HGCGuardRing(const HGCalDDDConstants& hgc);
0012 bool exclude(G4ThreeVector& point, int zside, int frontBack, int layer, int waferU, int waferV);
0013 bool excludePartial(G4ThreeVector& point, int zside, int frontBack, int layer, int waferU, int waferV);
0014 static bool insidePolygon(double x, double y, const std::vector<std::pair<double, double> >& xyv);
0015
0016 private:
0017 static constexpr double sqrt3_ = 1.732050807568877;
0018 const HGCalDDDConstants& hgcons_;
0019 const HGCalGeometryMode::GeometryMode modeUV_;
0020 const bool v17OrLess_;
0021 const double waferSize_, sensorSizeOffset_, guardRingOffset_;
0022 static constexpr std::array<double, 12> tan_1 = {
0023 {-sqrt3_, sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0}};
0024 static constexpr std::array<double, 12> cos_1 = {{0.5, -0.5, -1.0, -0.5, 0.5, 1.0, -0.5, 0.5, 1.0, 0.5, -0.5, -1.0}};
0025 static constexpr std::array<double, 12> cot_1 = {
0026 {sqrt3_, -sqrt3_, 0.0, sqrt3_, -sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0, -sqrt3_, sqrt3_, 0.0}};
0027 double offset_, offsetPartial_, xmax_, ymax_, c22_, c27_;
0028 };
0029
0030 #endif