CMS 3D CMS Logo

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