File indexing completed on 2024-04-06 12:14:52
0001
0002 #ifndef Geometry_HGCalCommonData_HGCalCellUV_h
0003 #define Geometry_HGCalCommonData_HGCalCellUV_h
0004
0005 #include <cstdint>
0006 #include <iterator>
0007 #include <map>
0008 #include <memory>
0009 #include "Geometry/HGCalCommonData/interface/HGCalCell.h"
0010
0011 class HGCalCellUV {
0012 public:
0013 HGCalCellUV(double waferSize, double separation, int32_t nFine, int32_t nCoarse);
0014
0015 std::pair<int32_t, int32_t> cellUVFromXY1(
0016 double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
0017
0018 std::pair<int32_t, int32_t> cellUVFromXY2(
0019 double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
0020
0021 std::pair<int32_t, int32_t> cellUVFromXY2(
0022 double xloc,
0023 double yloc,
0024 int32_t placement,
0025 int32_t type,
0026 int32_t partial,
0027 bool extend,
0028 bool debug) const;
0029
0030 std::pair<int32_t, int32_t> cellUVFromXY3(
0031 double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug) const;
0032
0033 std::pair<int32_t, int32_t> cellUVFromXY4(
0034 double xloc, double yloc, int32_t placement, int32_t type, bool extend, bool debug);
0035
0036 std::pair<int32_t, int32_t> cellUVFromXY1(
0037 double xloc, double yloc, int32_t placement, int32_t type, int32_t partial, bool extend, bool debug) const;
0038
0039 private:
0040 std::pair<int32_t, int32_t> cellUVFromXY4(double xloc,
0041 double yloc,
0042 int ncell,
0043 double cellX,
0044 double cellY,
0045 double cellXTotal,
0046 double cellYTotal,
0047 std::map<std::pair<int, int>, std::pair<double, double> >& cellPos,
0048 bool extend,
0049 bool debug);
0050
0051 static constexpr double sqrt3_ = 1.732050807568877;
0052 static constexpr double sin60_ = 0.5 * sqrt3_;
0053 static constexpr double cos60_ = 0.5;
0054
0055 const double waferSize_;
0056 int32_t ncell_[2];
0057 double cellX_[2], cellY_[2], cellXTotal_[2], cellYTotal_[2];
0058 std::unique_ptr<HGCalCell> hgcalcell_;
0059 std::map<std::pair<int32_t, int32_t>, std::pair<double, double> > cellPosFine_[HGCalCell::cellPlacementTotal],
0060 cellPosCoarse_[HGCalCell::cellPlacementTotal];
0061 };
0062
0063 #endif