Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-08 22:57:01

0001 #ifndef Geometry_HGCalCommonData_HGCalTypes_h
0002 #define Geometry_HGCalCommonData_HGCalTypes_h
0003 
0004 #include <array>
0005 #include <cmath>
0006 #include <cstdint>
0007 #include <vector>
0008 
0009 class HGCalTypes {
0010 public:
0011   HGCalTypes() {}
0012 
0013   static constexpr int32_t WaferCorner0 = 0;
0014   static constexpr int32_t WaferCorner1 = 1;
0015   static constexpr int32_t WaferCorner2 = 2;
0016   static constexpr int32_t WaferCorner3 = 3;
0017   static constexpr int32_t WaferCorner4 = 4;
0018   static constexpr int32_t WaferCorner5 = 5;
0019 
0020   static constexpr int32_t UnknownPosition = -1;
0021   static constexpr int32_t WaferCenter = 0;
0022   static constexpr int32_t CornerCenterYp = 1;
0023   static constexpr int32_t CornerCenterYm = 2;
0024   static constexpr int32_t CornerCenterXp = 3;
0025   static constexpr int32_t CornerCenterXm = 4;
0026   static constexpr int32_t WaferCenterB = 5;
0027   static constexpr int32_t WaferCenterR = 6;
0028 
0029   static constexpr int32_t WaferTypeUndefined = -1;
0030   static constexpr int32_t WaferFineThin = 0;
0031   static constexpr int32_t WaferCoarseThin = 1;
0032   static constexpr int32_t WaferCoarseThick = 2;
0033   static constexpr int32_t WaferFineThick = 3;
0034 
0035   static constexpr int32_t WaferFull = 0;
0036   static constexpr int32_t WaferFive = 1;
0037   static constexpr int32_t WaferChopTwo = 2;
0038   static constexpr int32_t WaferChopTwoM = 3;
0039   static constexpr int32_t WaferHalf = 4;
0040   static constexpr int32_t WaferSemi = 5;
0041   static constexpr int32_t WaferSemi2 = 6;
0042   static constexpr int32_t WaferThree = 7;
0043   static constexpr int32_t WaferHalf2 = 8;
0044   static constexpr int32_t WaferFive2 = 9;
0045   static constexpr int32_t WaferLDTop = 11;
0046   static constexpr int32_t WaferLDBottom = 12;
0047   static constexpr int32_t WaferLDLeft = 13;
0048   static constexpr int32_t WaferLDRight = 14;
0049   static constexpr int32_t WaferLDFive = 15;
0050   static constexpr int32_t WaferLDThree = 16;
0051   static constexpr int32_t WaferHDTop = 21;
0052   static constexpr int32_t WaferHDBottom = 22;
0053   static constexpr int32_t WaferHDLeft = 23;
0054   static constexpr int32_t WaferHDRight = 24;
0055   static constexpr int32_t WaferHDFive = 25;
0056   static constexpr int32_t WaferOut = 99;
0057   static constexpr int32_t WaferPartLDOffset = 11;
0058   static constexpr int32_t WaferPartHDOffset = 21;
0059   static constexpr int32_t WaferTypeOffset[3] = {0, 5, 11};
0060 
0061   static constexpr int32_t WaferOrient0 = 0;
0062   static constexpr int32_t WaferOrient1 = 1;
0063   static constexpr int32_t WaferOrient2 = 2;
0064   static constexpr int32_t WaferOrient3 = 3;
0065   static constexpr int32_t WaferOrient4 = 4;
0066   static constexpr int32_t WaferOrient5 = 5;
0067 
0068   static constexpr int32_t WaferCenteredFront = 0;
0069   static constexpr int32_t WaferCenteredBack = 1;
0070   static constexpr int32_t CornerCenteredY = 2;
0071   static constexpr int32_t CornerCenteredLambda = 3;
0072   static constexpr int32_t WaferCenteredRotated = 4;
0073 
0074   static constexpr int32_t WaferCornerMin = 3;
0075   static constexpr int32_t WaferCornerMax = 6;
0076   static constexpr int32_t WaferSizeMax = 9;
0077 
0078   // Condition for cells in partial wafer: arr[0]*u + arr[1]*v <= arr[2]
0079   static constexpr std::array<int, 3> edgeWaferLDTop = {{1, 0, 7}};
0080   static constexpr std::array<int, 3> edgeWaferLDBottom = {{-1, 0, -8}};
0081   static constexpr std::array<int, 3> edgeWaferLDLeft = {{-1, 2, 7}};
0082   static constexpr std::array<int, 3> edgeWaferLDRight = {{1, -2, -7}};
0083   static constexpr std::array<int, 3> edgeWaferLDFive = {{-1, 2, 15}};
0084   static constexpr std::array<int, 3> edgeWaferLDThree = {{1, -2, -15}};
0085   static constexpr std::array<int, 3> edgeWaferHDTop = {{1, 0, 9}};
0086   static constexpr std::array<int, 3> edgeWaferHDBottom = {{-1, 0, -10}};
0087   static constexpr std::array<int, 3> edgeWaferHDLeft = {{-1, 2, 4}};
0088   static constexpr std::array<int, 3> edgeWaferHDRight = {{1, -2, -18}};
0089   static constexpr std::array<int, 3> edgeWaferHDFive = {{-1, 2, 18}};
0090 
0091   static constexpr int k_OffsetRotation = 10;
0092 
0093   static constexpr double c00 = 0.0;
0094   static constexpr double c22 = 0.225;
0095   static constexpr double c25 = 0.25;
0096   static constexpr double c27 = 0.275;
0097   static constexpr double c50 = 0.5;
0098   static constexpr double c61 = 0.6125;
0099   static constexpr double c75 = 0.75;
0100   static constexpr double c77 = 0.775;
0101   static constexpr double c88 = 0.8875;
0102   static constexpr double c10 = 1.0;
0103 
0104   enum TileType { TileFine = 0, TileCoarseCast = 1, TileCoarseMould = 2 };
0105 
0106   enum TileSiPMType { SiPMUnknown = 0, SiPMSmall = 2, SiPMLarge = 4 };
0107 
0108   // Packing and unpacking of type, u, v of wafers
0109   static int32_t packTypeUV(int type, int u, int v);
0110   static int32_t getUnpackedType(int id);
0111   static int32_t getUnpackedU(int id);
0112   static int32_t getUnpackedV(int id);
0113   // Packing and unpacking of type, u, v of wafer cells
0114   static int32_t packCellTypeUV(int type, int u, int v);
0115   static int32_t getUnpackedCellType(int id);
0116   static int32_t getUnpackedCellU(int id);
0117   static int32_t getUnpackedCellV(int id);
0118   // Packing and unpacking of type, cell# of wafer cells (6 inch wafers)
0119   static int32_t packCellType6(int type, int cell);
0120   static int32_t getUnpackedCellType6(int id);
0121   static int32_t getUnpackedCell6(int id);
0122   // Translate from flat file format to CMSSW format of Layer type
0123   static int32_t layerType(int type);
0124   // Get the front-back index from the layer orientation index
0125   static int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); }
0126   static int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); }
0127 
0128 private:
0129   static constexpr int32_t facu_ = 1;
0130   static constexpr int32_t facv_ = 100;
0131   static constexpr int32_t factype_ = 1000000;
0132   static constexpr int32_t signu_ = 10000;
0133   static constexpr int32_t signv_ = 100000;
0134   static constexpr int32_t maxuv_ = 100;
0135   static constexpr int32_t maxsign_ = 10;
0136   static constexpr int32_t maxtype_ = 10;
0137   static constexpr int32_t faccell_ = 100;
0138   static constexpr int32_t faccelltype_ = 10000;
0139   static constexpr int32_t faccell6_ = 1000;
0140 };
0141 
0142 #endif