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 
33  static constexpr int32_t undefinedCell = -1;
34  static constexpr int32_t centralCell = 0;
35  static constexpr int32_t bottomLeftEdge = 1;
36  static constexpr int32_t leftEdge = 2;
37  static constexpr int32_t topLeftEdge = 3;
38  static constexpr int32_t topRightEdge = 4;
39  static constexpr int32_t rightEdge = 5;
40  static constexpr int32_t bottomRightEdge = 6;
41  static constexpr int32_t bottomCorner = 11;
42  static constexpr int32_t bottomLeftCorner = 12;
43  static constexpr int32_t topLeftCorner = 13;
44  static constexpr int32_t topCorner = 14;
45  static constexpr int32_t topRightCorner = 15;
46  static constexpr int32_t bottomRightCorner = 16;
47 
48  std::pair<double, double> cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
49  std::pair<double, double> cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
50  // Get cell type and orientation index
51  std::pair<int32_t, int32_t> cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type);
52  // Get the placement index from zside, forward-backward tag, orientation flag
53  static int32_t cellPlacementIndex(int32_t iz, int32_t fwdBack, int32_t orient);
54  // Get the orientation flag and forward-backward tag from placement index
55  static std::pair<int32_t, int32_t> cellOrient(int32_t placementIndex);
56  // Get cell type and position in the list
57  static std::pair<int32_t, int32_t> cellType(int32_t u, int32_t v, int32_t ncell, int32_t placementIndex);
58 
59 private:
60  const double sqrt3By2_ = (0.5 * std::sqrt(3.0));
61  int32_t ncell_[2];
62  double cellX_[2], cellY_[2];
63 };
64 
65 #endif
static constexpr int32_t fullCell
Definition: HGCalCell.h:28
static constexpr int32_t cellPlacementOld
Definition: HGCalCell.h:25
const double sqrt3By2_
Definition: HGCalCell.h:60
static constexpr int32_t undefinedCell
Definition: HGCalCell.h:33
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:242
static constexpr int32_t topCorner
Definition: HGCalCell.h:44
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:36
int32_t ncell_[2]
Definition: HGCalCell.h:61
static constexpr int32_t cellPlacementIndex10
Definition: HGCalCell.h:21
std::pair< int32_t, int32_t > cellUV2Cell(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:94
static constexpr int32_t cellPlacementIndex0
Definition: HGCalCell.h:11
static constexpr int32_t topLeftCorner
Definition: HGCalCell.h:43
static std::pair< int32_t, int32_t > cellOrient(int32_t placementIndex)
Definition: HGCalCell.cc:235
static int32_t cellPlacementIndex(int32_t iz, int32_t fwdBack, int32_t orient)
Definition: HGCalCell.cc:230
T sqrt(T t)
Definition: SSEVec.h:19
static constexpr int32_t bottomLeftCorner
Definition: HGCalCell.h:42
static constexpr int32_t topRightCorner
Definition: HGCalCell.h:45
static constexpr int32_t bottomRightEdge
Definition: HGCalCell.h:40
static constexpr int32_t cellPlacementIndex9
Definition: HGCalCell.h:20
static constexpr int32_t cellPlacementIndex5
Definition: HGCalCell.h:16
HGCalCell(double waferSize, int32_t nFine, int32_t nCoarse)
Definition: HGCalCell.cc:4
static constexpr int32_t bottomLeftEdge
Definition: HGCalCell.h:35
static constexpr int32_t cellPlacementIndex7
Definition: HGCalCell.h:18
static constexpr int32_t bottomRightCorner
Definition: HGCalCell.h:46
static constexpr int32_t truncatedCell
Definition: HGCalCell.h:30
static constexpr int32_t centralCell
Definition: HGCalCell.h:34
std::pair< double, double > cellUV2XY1(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:13
static constexpr int32_t extendedCell
Definition: HGCalCell.h:31
static constexpr int32_t topRightEdge
Definition: HGCalCell.h:38
static constexpr int32_t cellPlacementIndex11
Definition: HGCalCell.h:22
std::pair< double, double > cellUV2XY2(int32_t u, int32_t v, int32_t placementIndex, int32_t type)
Definition: HGCalCell.cc:70
static constexpr int32_t rightEdge
Definition: HGCalCell.h:39
static constexpr int32_t bottomCorner
Definition: HGCalCell.h:41
static constexpr int32_t cornerCell
Definition: HGCalCell.h:29
static constexpr int32_t cellPlacementIndex4
Definition: HGCalCell.h:15
static constexpr int32_t cellPlacementIndex1
Definition: HGCalCell.h:12
double cellX_[2]
Definition: HGCalCell.h:62
static constexpr int32_t cellPlacementIndex6
Definition: HGCalCell.h:17
double cellY_[2]
Definition: HGCalCell.h:62
static constexpr int32_t cellPlacementIndex2
Definition: HGCalCell.h:13
static constexpr int32_t topLeftEdge
Definition: HGCalCell.h:37
static constexpr int32_t cellPlacementExtra
Definition: HGCalCell.h:24