CMS 3D CMS Logo

HGCalCell.h
Go to the documentation of this file.
1 #ifndef Geometry_HGCalCommonData_HGCalCell_h
2 #define Geometry_HGCalCommonData_HGCalCell_h
3 
4 #include <cmath>
5 #include <cstdint>
6 
7 class HGCalCell {
8 public:
9  HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse);
10 
11  static constexpr int32_t cellPlacementIndex0 = 0;
12  static constexpr int32_t cellPlacementIndex1 = 1;
13  static constexpr int32_t cellPlacementIndex2 = 2;
14  static constexpr int32_t cellPlacementIndex3 = 3;
15  static constexpr int32_t cellPlacementIndex4 = 4;
16  static constexpr int32_t cellPlacementIndex5 = 5;
17  static constexpr int32_t cellPlacementIndex6 = 6;
18  static constexpr int32_t cellPlacementIndex7 = 7;
19  static constexpr int32_t cellPlacementIndex8 = 8;
20  static constexpr int32_t cellPlacementIndex9 = 9;
21  static constexpr int32_t cellPlacementIndex10 = 10;
22  static constexpr int32_t cellPlacementIndex11 = 11;
23 
24  static constexpr int32_t cellPlacementExtra = 6;
25  static constexpr int32_t cellPlacementOld = 7;
26  static constexpr int32_t cellPlacementTotal = 12;
27 
28  static constexpr int32_t fullCell = 0;
29  static constexpr int32_t cornerCell = 1;
30  static constexpr int32_t truncatedCell = 2;
31  static constexpr int32_t extendedCell = 3;
32  static constexpr int32_t truncatedMBCell = 4;
33  static constexpr int32_t extendedMBCell = 5;
34  static constexpr int32_t fullWaferCellsCount = 6;
35 
36  static constexpr int32_t halfCell = 11;
37  static constexpr int32_t halfTrunCell = 12;
38  static constexpr int32_t halfExtCell = 13;
39  static constexpr int32_t partiaclWaferCellsOffset = 11;
40 
41  static constexpr int32_t LDPartial0714Cell = 14;
42  static constexpr int32_t LDPartial0209Cell = 15;
43  static constexpr int32_t LDPartial0007Cell = 16;
44  static constexpr int32_t LDPartial0815Cell = 17;
45  static constexpr int32_t LDPartial1415Cell = 18;
46  static constexpr int32_t LDPartial1515Cell = 19;
47 
48  static constexpr int32_t HDPartial0920Cell = 20;
49  static constexpr int32_t HDPartial1021Cell = 21;
50 
51  static constexpr int32_t undefinedCell = -1;
52  static constexpr int32_t centralCell = 0;
53  static constexpr int32_t bottomLeftEdge = 1;
54  static constexpr int32_t leftEdge = 2;
55  static constexpr int32_t topLeftEdge = 3;
56  static constexpr int32_t topRightEdge = 4;
57  static constexpr int32_t rightEdge = 5;
58  static constexpr int32_t bottomRightEdge = 6;
59  static constexpr int32_t bottomCorner = 11;
60  static constexpr int32_t bottomLeftCorner = 12;
61  static constexpr int32_t topLeftCorner = 13;
62  static constexpr int32_t topCorner = 14;
63  static constexpr int32_t topRightCorner = 15;
64  static constexpr int32_t bottomRightCorner = 16;
65 
66  static constexpr int32_t leftCell = 21;
67  static constexpr int32_t rightCell = 22;
68  static constexpr int32_t topCell = 23;
69  static constexpr int32_t bottomCell = 24;
70  static constexpr int32_t partiaclCellsPosOffset = 21;
71 
72  std::pair<double, double> cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
73  std::pair<double, double> cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
74  // Get cell type and orientation index
75  std::pair<int32_t, int32_t> cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
76  // Get the placement index from zside, front-back tag, orientation flag
77  static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient);
78  // Get the orientation flag and front-back tag from placement index
79  static std::pair<int32_t, int32_t> cellOrient(int32_t placementIndex);
80  // Get cell type and position in the list
81  static std::pair<int32_t, int32_t> cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex);
82  static std::pair<int32_t, int32_t> cellType(
83  int32_t u, int32_t v, int32_t ncell, int32_t placementIndex, int32_t partialType);
84 
85 private:
86  const double sqrt3By2_ = (0.5 * std::sqrt(3.0));
87  int32_t ncell_[2];
88  double cellX_[2], cellY_[2];
89 };
90 
91 #endif
static constexpr int32_t LDPartial0007Cell
Definition: HGCalCell.h:43
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:239
static constexpr int32_t fullCell
Definition: HGCalCell.h:28
static constexpr int32_t cellPlacementOld
Definition: HGCalCell.h:25
const double sqrt3By2_
Definition: HGCalCell.h:86
static constexpr int32_t partiaclCellsPosOffset
Definition: HGCalCell.h:70
static constexpr int32_t undefinedCell
Definition: HGCalCell.h:51
static constexpr int32_t cellPlacementIndex8
Definition: HGCalCell.h:19
static std::pair< int32_t, int32_t > cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex)
Definition: HGCalCell.cc:251
static constexpr int32_t topCorner
Definition: HGCalCell.h:62
static constexpr int32_t HDPartial1021Cell
Definition: HGCalCell.h:49
static constexpr int32_t extendedMBCell
Definition: HGCalCell.h:33
static constexpr int32_t cellPlacementTotal
Definition: HGCalCell.h:26
static constexpr int32_t cellPlacementIndex3
Definition: HGCalCell.h:14
static constexpr int32_t leftEdge
Definition: HGCalCell.h:54
int32_t ncell_[2]
Definition: HGCalCell.h:87
static constexpr int32_t HDPartial0920Cell
Definition: HGCalCell.h:48
static constexpr int32_t partiaclWaferCellsOffset
Definition: HGCalCell.h:39
static constexpr int32_t cellPlacementIndex10
Definition: HGCalCell.h:21
static constexpr int32_t truncatedMBCell
Definition: HGCalCell.h:32
std::pair< int32_t, int32_t > cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:103
static constexpr int32_t leftCell
Definition: HGCalCell.h:66
static constexpr int32_t LDPartial0209Cell
Definition: HGCalCell.h:42
static constexpr int32_t cellPlacementIndex0
Definition: HGCalCell.h:11
static constexpr int32_t topLeftCorner
Definition: HGCalCell.h:61
static constexpr int32_t fullWaferCellsCount
Definition: HGCalCell.h:34
static constexpr int32_t topCell
Definition: HGCalCell.h:68
static std::pair< int32_t, int32_t > cellOrient(int32_t placementIndex)
Definition: HGCalCell.cc:244
T sqrt(T t)
Definition: SSEVec.h:23
static constexpr int32_t bottomLeftCorner
Definition: HGCalCell.h:60
static constexpr int32_t topRightCorner
Definition: HGCalCell.h:63
static constexpr int32_t bottomRightEdge
Definition: HGCalCell.h:58
static constexpr int32_t cellPlacementIndex9
Definition: HGCalCell.h:20
static constexpr int32_t cellPlacementIndex5
Definition: HGCalCell.h:16
static constexpr int32_t halfCell
Definition: HGCalCell.h:36
HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse)
Definition: HGCalCell.cc:9
static constexpr int32_t LDPartial0714Cell
Definition: HGCalCell.h:41
static constexpr int32_t LDPartial1515Cell
Definition: HGCalCell.h:46
static constexpr int32_t bottomLeftEdge
Definition: HGCalCell.h:53
static constexpr int32_t cellPlacementIndex7
Definition: HGCalCell.h:18
static constexpr int32_t bottomRightCorner
Definition: HGCalCell.h:64
static constexpr int32_t truncatedCell
Definition: HGCalCell.h:30
static constexpr int32_t halfTrunCell
Definition: HGCalCell.h:37
static constexpr int32_t centralCell
Definition: HGCalCell.h:52
std::pair< double, double > cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:22
static constexpr int32_t extendedCell
Definition: HGCalCell.h:31
static constexpr int32_t topRightEdge
Definition: HGCalCell.h:56
static constexpr int32_t cellPlacementIndex11
Definition: HGCalCell.h:22
static constexpr int32_t LDPartial0815Cell
Definition: HGCalCell.h:44
std::pair< double, double > cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:79
static constexpr int32_t LDPartial1415Cell
Definition: HGCalCell.h:45
static constexpr int32_t halfExtCell
Definition: HGCalCell.h:38
static constexpr int32_t rightEdge
Definition: HGCalCell.h:57
static constexpr int32_t bottomCorner
Definition: HGCalCell.h:59
static constexpr int32_t cornerCell
Definition: HGCalCell.h:29
static constexpr int32_t rightCell
Definition: HGCalCell.h:67
static constexpr int32_t cellPlacementIndex4
Definition: HGCalCell.h:15
static constexpr int32_t cellPlacementIndex1
Definition: HGCalCell.h:12
double cellX_[2]
Definition: HGCalCell.h:88
static constexpr int32_t cellPlacementIndex6
Definition: HGCalCell.h:17
double cellY_[2]
Definition: HGCalCell.h:88
static constexpr int32_t cellPlacementIndex2
Definition: HGCalCell.h:13
static constexpr int32_t topLeftEdge
Definition: HGCalCell.h:55
static constexpr int32_t bottomCell
Definition: HGCalCell.h:69
static constexpr int32_t cellPlacementExtra
Definition: HGCalCell.h:24