HGCalTypes

TileSiPMType

TileType

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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
#ifndef Geometry_HGCalCommonData_HGCalTypes_h
#define Geometry_HGCalCommonData_HGCalTypes_h

#include <array>
#include <cmath>
#include <cstdint>
#include <vector>

class HGCalTypes {
public:
  HGCalTypes() {}

  static constexpr int32_t WaferCorner0 = 0;
  static constexpr int32_t WaferCorner1 = 1;
  static constexpr int32_t WaferCorner2 = 2;
  static constexpr int32_t WaferCorner3 = 3;
  static constexpr int32_t WaferCorner4 = 4;
  static constexpr int32_t WaferCorner5 = 5;

  static constexpr int32_t UnknownPosition = -1;
  static constexpr int32_t WaferCenter = 0;
  static constexpr int32_t CornerCenterYp = 1;
  static constexpr int32_t CornerCenterYm = 2;
  static constexpr int32_t CornerCenterXp = 3;
  static constexpr int32_t CornerCenterXm = 4;
  static constexpr int32_t WaferCenterB = 5;
  static constexpr int32_t WaferCenterR = 6;

  static constexpr int32_t WaferTypeUndefined = -1;
  static constexpr int32_t WaferHD120 = 0;
  static constexpr int32_t WaferLD200 = 1;
  static constexpr int32_t WaferLD300 = 2;
  static constexpr int32_t WaferHD200 = 3;

  static constexpr int32_t WaferFull = 0;
  static constexpr int32_t WaferFive = 1;
  static constexpr int32_t WaferChopTwo = 2;
  static constexpr int32_t WaferChopTwoM = 3;
  static constexpr int32_t WaferHalf = 4;
  static constexpr int32_t WaferSemi = 5;
  static constexpr int32_t WaferSemi2 = 6;
  static constexpr int32_t WaferThree = 7;
  static constexpr int32_t WaferHalf2 = 8;
  static constexpr int32_t WaferFive2 = 9;
  static constexpr int32_t WaferLDTop = 11;
  static constexpr int32_t WaferLDBottom = 12;
  static constexpr int32_t WaferLDLeft = 13;
  static constexpr int32_t WaferLDRight = 14;
  static constexpr int32_t WaferLDFive = 15;
  static constexpr int32_t WaferLDThree = 16;
  static constexpr int32_t WaferHDTop = 21;
  static constexpr int32_t WaferHDBottom = 22;
  static constexpr int32_t WaferHDLeft = 23;
  static constexpr int32_t WaferHDRight = 24;
  static constexpr int32_t WaferHDFive = 25;
  static constexpr int32_t WaferOut = 99;
  static constexpr int32_t WaferPartLDOffset = 11;
  static constexpr int32_t WaferPartHDOffset = 21;
  static constexpr int32_t WaferPartLDCount = 6;
  static constexpr int32_t WaferPartHDCount = 5;
  static constexpr int32_t WaferTypeOffset[3] = {0, 5, 11};

  static constexpr int32_t WaferOrient0 = 0;
  static constexpr int32_t WaferOrient1 = 1;
  static constexpr int32_t WaferOrient2 = 2;
  static constexpr int32_t WaferOrient3 = 3;
  static constexpr int32_t WaferOrient4 = 4;
  static constexpr int32_t WaferOrient5 = 5;

  static constexpr int32_t WaferCenteredFront = 0;
  static constexpr int32_t WaferCenteredBack = 1;
  static constexpr int32_t CornerCenteredY = 2;
  static constexpr int32_t CornerCenteredLambda = 3;
  static constexpr int32_t WaferCenteredRotated = 4;

  static constexpr int32_t WaferCornerMin = 3;
  static constexpr int32_t WaferCornerMax = 6;
  static constexpr int32_t WaferSizeMax = 9;

  // Condition for cells in partial wafer: arr[0]*u + arr[1]*v <= arr[2]
  static constexpr std::array<int, 3> edgeWaferLDTop = {{1, 0, 7}};
  static constexpr std::array<int, 3> edgeWaferLDBottom = {{-1, 0, -8}};
  static constexpr std::array<int, 3> edgeWaferLDLeft = {{-1, 2, 7}};
  static constexpr std::array<int, 3> edgeWaferLDRight = {{1, -2, -7}};
  static constexpr std::array<int, 3> edgeWaferLDFive = {{-1, 2, 15}};
  static constexpr std::array<int, 3> edgeWaferLDThree = {{1, -2, -15}};
  static constexpr std::array<int, 3> edgeWaferHDTop = {{1, 0, 9}};
  static constexpr std::array<int, 3> edgeWaferHDBottom = {{-1, 0, -10}};
  static constexpr std::array<int, 3> edgeWaferHDLeft = {{-1, 2, 4}};
  static constexpr std::array<int, 3> edgeWaferHDRight = {{1, -2, -18}};
  static constexpr std::array<int, 3> edgeWaferHDFive = {{-1, 2, 18}};

  static constexpr int k_OffsetRotation = 10;

  static constexpr double c00 = 0.0;
  static constexpr double c22O = 0.225;
  static constexpr double c221 = 0.2083;
  static constexpr double c22 = 0.1944;
  static constexpr double c25 = 0.25;
  static constexpr double c27O = 0.275;
  static constexpr double c271 = 0.2917;
  static constexpr double c27 = 0.3056;
  static constexpr double c50 = 0.5;
  static constexpr double c61O = 0.6125;
  static constexpr double c611 = 0.6042;
  static constexpr double c61 = 0.59722;
  static constexpr double c75 = 0.75;
  static constexpr double c77O = 0.775;
  static constexpr double c771 = 0.7917;
  static constexpr double c77 = 0.8055;
  static constexpr double c88O = 0.8875;
  static constexpr double c881 = 0.8958;
  static constexpr double c88 = 0.90277;
  static constexpr double c10 = 1.0;

  enum TileType { TileFine = 0, TileCoarseCast = 1, TileCoarseMould = 2 };

  enum TileSiPMType { SiPMUnknown = 0, SiPMSmall = 2, SiPMLarge = 4 };

  // Packing and unpacking of type, u, v of wafers
  static int32_t packTypeUV(int type, int u, int v);
  static int32_t getUnpackedType(int id);
  static int32_t getUnpackedU(int id);
  static int32_t getUnpackedV(int id);
  // Packing and unpacking of type, u, v of wafer cells
  static int32_t packCellTypeUV(int type, int u, int v);
  static int32_t getUnpackedCellType(int id);
  static int32_t getUnpackedCellU(int id);
  static int32_t getUnpackedCellV(int id);
  // Packing and unpacking of type, cell# of wafer cells (6 inch wafers)
  static int32_t packCellType6(int type, int cell);
  static int32_t getUnpackedCellType6(int id);
  static int32_t getUnpackedCell6(int id);
  // Translate from flat file format to CMSSW format of Layer type
  static int32_t layerType(int type);
  // Get the front-back index from the layer orientation index
  static constexpr int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); }
  static constexpr int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); }
  // LD vs HD and Fullvs Partial wafer
  static constexpr bool waferHD(int32_t type) { return ((type == WaferHD120) || (type == WaferHD200)); }
  static constexpr bool waferFull(int32_t type) { return (type == WaferFull); }

private:
  static constexpr int32_t facu_ = 1;
  static constexpr int32_t facv_ = 100;
  static constexpr int32_t factype_ = 1000000;
  static constexpr int32_t signu_ = 10000;
  static constexpr int32_t signv_ = 100000;
  static constexpr int32_t maxuv_ = 100;
  static constexpr int32_t maxsign_ = 10;
  static constexpr int32_t maxtype_ = 10;
  static constexpr int32_t faccell_ = 100;
  static constexpr int32_t faccelltype_ = 10000;
  static constexpr int32_t faccell6_ = 1000;
};

#endif