Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-28 01:33:49

0001 #ifndef Geometry_HGCalCommonData_HGCalCell_h
0002 #define Geometry_HGCalCommonData_HGCalCell_h
0003 
0004 #include <cmath>
0005 #include <cstdint>
0006 
0007 class HGCalCell {
0008 public:
0009   HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse);
0010 
0011   static constexpr int32_t cellPlacementIndex0 = 0;
0012   static constexpr int32_t cellPlacementIndex1 = 1;
0013   static constexpr int32_t cellPlacementIndex2 = 2;
0014   static constexpr int32_t cellPlacementIndex3 = 3;
0015   static constexpr int32_t cellPlacementIndex4 = 4;
0016   static constexpr int32_t cellPlacementIndex5 = 5;
0017   static constexpr int32_t cellPlacementIndex6 = 6;
0018   static constexpr int32_t cellPlacementIndex7 = 7;
0019   static constexpr int32_t cellPlacementIndex8 = 8;
0020   static constexpr int32_t cellPlacementIndex9 = 9;
0021   static constexpr int32_t cellPlacementIndex10 = 10;
0022   static constexpr int32_t cellPlacementIndex11 = 11;
0023 
0024   static constexpr int32_t cellPlacementExtra = 6;
0025   static constexpr int32_t cellPlacementOld = 7;
0026   static constexpr int32_t cellPlacementTotal = 12;
0027 
0028   static constexpr int32_t fullCell = 0;
0029   static constexpr int32_t cornerCell = 1;
0030   static constexpr int32_t truncatedCell = 2;
0031   static constexpr int32_t extendedCell = 3;
0032 
0033   static constexpr int32_t undefinedCell = -1;
0034   static constexpr int32_t centralCell = 0;
0035   static constexpr int32_t bottomLeftEdge = 1;
0036   static constexpr int32_t leftEdge = 2;
0037   static constexpr int32_t topLeftEdge = 3;
0038   static constexpr int32_t topRightEdge = 4;
0039   static constexpr int32_t rightEdge = 5;
0040   static constexpr int32_t bottomRightEdge = 6;
0041   static constexpr int32_t bottomCorner = 11;
0042   static constexpr int32_t bottomLeftCorner = 12;
0043   static constexpr int32_t topLeftCorner = 13;
0044   static constexpr int32_t topCorner = 14;
0045   static constexpr int32_t topRightCorner = 15;
0046   static constexpr int32_t bottomRightCorner = 16;
0047 
0048   std::pair<double, double> cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0049   std::pair<double, double> cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0050   // Get cell type and orientation index
0051   std::pair<int32_t, int32_t> cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
0052   // Get the placement index from zside, front-back tag, orientation flag
0053   static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient);
0054   // Get the orientation flag and front-back tag from placement index
0055   static std::pair<int32_t, int32_t> cellOrient(int32_t placementIndex);
0056   // Get cell type and position in the list
0057   static std::pair<int32_t, int32_t> cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex);
0058 
0059 private:
0060   const double sqrt3By2_ = (0.5 * std::sqrt(3.0));
0061   int32_t ncell_[2];
0062   double cellX_[2], cellY_[2];
0063 };
0064 
0065 #endif