CMS 3D CMS Logo

HGCalCellUV.h
Go to the documentation of this file.
1 #ifndef Geometry_HGCalCommonData_HGCalCellUV_h
2 #define Geometry_HGCalCommonData_HGCalCellUV_h
3 
4 #include <cstdint>
5 #include <iterator>
6 #include <map>
8 
9 class HGCalCellUV {
10 public:
11  HGCalCellUV(double waferSize, double separation, int32_t nFine, int32_t nCoarse);
12 
13  std::pair<int32_t, int32_t> cellUVFromXY1(
14  double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
15 
16  std::pair<int32_t, int32_t> cellUVFromXY2(
17  double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
18 
19  std::pair<int32_t, int32_t> cellUVFromXY3(
20  double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
21 
22  std::pair<int32_t, int32_t> cellUVFromXY4(
23  double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug);
24 
25  std::pair<int32_t, int32_t> cellUVFromXY1(
26  double xloc, double yloc, int32_t placement, int32_t type, int32_t partial, bool extend, bool debug) const;
27 
28 private:
29  std::pair<int32_t, int32_t> cellUVFromXY4(double xloc,
30  double yloc,
31  int ncell,
32  double cellX,
33  double cellY,
34  double cellXTotal,
35  double cellYTotal,
36  std::map<std::pair<int, int>, std::pair<double, double> >& cellPos,
37  bool extend,
38  bool debug);
39 
40  static constexpr double sqrt3_ = 1.732050807568877; // std::sqrt(3.0) in double precision
41  static constexpr double sin60_ = 0.5 * sqrt3_;
42  static constexpr double cos60_ = 0.5;
43 
44  int32_t ncell_[2];
45  double cellX_[2], cellY_[2], cellXTotal_[2], cellYTotal_[2], waferSize;
46 
47  std::map<std::pair<int32_t, int32_t>, std::pair<double, double> > cellPosFine_[HGCalCell::cellPlacementTotal],
49 };
50 
51 #endif
double waferSize
Definition: HGCalCellUV.h:45
std::pair< int32_t, int32_t > cellUVFromXY1(double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const
Definition: HGCalCellUV.cc:46
static constexpr double sqrt3_
Definition: HGCalCellUV.h:40
std::map< std::pair< int32_t, int32_t >, std::pair< double, double > > cellPosFine_[HGCalCell::cellPlacementTotal]
Definition: HGCalCellUV.h:47
static constexpr int32_t cellPlacementTotal
Definition: HGCalCell.h:26
double cellXTotal_[2]
Definition: HGCalCellUV.h:45
double cellYTotal_[2]
Definition: HGCalCellUV.h:45
double cellY_[2]
Definition: HGCalCellUV.h:45
double cellX_[2]
Definition: HGCalCellUV.h:45
static constexpr double cos60_
Definition: HGCalCellUV.h:42
std::pair< int32_t, int32_t > cellUVFromXY3(double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const
Definition: HGCalCellUV.cc:159
#define debug
Definition: HDRShower.cc:19
int32_t ncell_[2]
Definition: HGCalCellUV.h:44
HGCalCellUV(double waferSize, double separation, int32_t nFine, int32_t nCoarse)
Definition: HGCalCellUV.cc:9
static constexpr double sin60_
Definition: HGCalCellUV.h:41
std::map< std::pair< int32_t, int32_t >, std::pair< double, double > > cellPosCoarse_[HGCalCell::cellPlacementTotal]
Definition: HGCalCellUV.h:47
std::pair< int32_t, int32_t > cellUVFromXY4(double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug)
Definition: HGCalCellUV.cc:231
std::pair< int32_t, int32_t > cellUVFromXY2(double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const
Definition: HGCalCellUV.cc:89