Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:48

0001 #ifndef SimG4CMS_HGCGuardRingPartial_h
0002 #define SimG4CMS_HGCGuardRingPartial_h
0003 
0004 #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h"
0005 #include "G4ThreeVector.hh"
0006 
0007 #include <vector>
0008 #include <array>
0009 
0010 class HGCGuardRingPartial {
0011 public:
0012   HGCGuardRingPartial(const HGCalDDDConstants& hgc);
0013   bool exclude(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;  // std::sqrt(3.0) in double precision
0018   const HGCalDDDConstants& hgcons_;
0019   const HGCalGeometryMode::GeometryMode modeUV_;
0020   const bool v17OrLess_;
0021   const double waferSize_, 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_, c22_, c27_;
0028 };
0029 
0030 #endif  // HGCGuardRing_h