CMS 3D CMS Logo

HGCalTBParameters.h
Go to the documentation of this file.
1 #ifndef Geometry_HGCalCommonData_HGCalTBParameters_h
2 #define Geometry_HGCalCommonData_HGCalTBParameters_h
3 
4 #include <CLHEP/Geometry/Transform3D.h>
5 #include <array>
6 #include <cstdint>
7 #include <string>
8 #include <unordered_map>
9 #include <vector>
13 #include "DD4hep/DD4hepUnits.h"
14 
16 public:
17  typedef std::vector<std::unordered_map<int32_t, int32_t> > layer_map;
18  typedef std::unordered_map<int32_t, int32_t> wafer_map;
19  typedef std::unordered_map<int32_t, std::pair<int32_t, int32_t> > waferT_map;
20 
21  static constexpr double k_ScaleFromDDD = 0.1;
22  static constexpr double k_ScaleToDDD = 10.0;
23  static constexpr double k_ScaleFromDDDToG4 = 1.0;
24  static constexpr double k_ScaleToDDDFromG4 = 1.0;
25  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
26  static constexpr double k_ScaleToDD4hep = dd4hep::cm;
27  static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
28  static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;
29  static constexpr uint32_t k_CornerSize = 6;
30  static constexpr double tol = 1.0e-12;
32 
33  struct hgtrap {
34  int lay;
35  float bl, tl, h, dz, alpha, cellSize;
36  };
37 
38  struct hgtrform {
39  int zp, lay, sec, subsec;
40  CLHEP::Hep3Vector h3v;
41  CLHEP::HepRotation hr;
42  };
43 
44  HGCalTBParameters(const std::string& nam);
45  ~HGCalTBParameters(void) = default;
46  void fillModule(const hgtrap& mytr, bool reco);
47  hgtrap getModule(unsigned int k, bool reco) const;
48  void fillTrForm(const hgtrform& mytr);
49  hgtrform getTrForm(unsigned int k) const;
50  void addTrForm(const CLHEP::Hep3Vector& h3v);
51  void scaleTrForm(double);
52  std::array<int, 4> getID(unsigned int k) const;
53 
56  int useSimWt_;
57  int nCells_;
58  int nSectors_;
62 
63  std::vector<double> cellSize_;
64  std::vector<double> slopeMin_;
65  std::vector<double> zFrontMin_;
66  std::vector<double> rMinFront_;
67  std::vector<double> slopeTop_;
68  std::vector<double> zFrontTop_;
69  std::vector<double> rMaxFront_;
70  std::vector<double> zRanges_;
71  std::vector<int> moduleLayS_;
72  std::vector<double> moduleBlS_;
73  std::vector<double> moduleTlS_;
74  std::vector<double> moduleHS_;
75  std::vector<double> moduleDzS_;
76  std::vector<double> moduleAlphaS_;
77  std::vector<double> moduleCellS_;
78  std::vector<int> moduleLayR_;
79  std::vector<double> moduleBlR_;
80  std::vector<double> moduleTlR_;
81  std::vector<double> moduleHR_;
82  std::vector<double> moduleDzR_;
83  std::vector<double> moduleAlphaR_;
84  std::vector<double> moduleCellR_;
85  std::vector<uint32_t> trformIndex_;
86  std::vector<double> trformTranX_;
87  std::vector<double> trformTranY_;
88  std::vector<double> trformTranZ_;
89  std::vector<double> trformRotXX_;
90  std::vector<double> trformRotYX_;
91  std::vector<double> trformRotZX_;
92  std::vector<double> trformRotXY_;
93  std::vector<double> trformRotYY_;
94  std::vector<double> trformRotZY_;
95  std::vector<double> trformRotXZ_;
96  std::vector<double> trformRotYZ_;
97  std::vector<double> trformRotZZ_;
98  std::vector<double> xLayerHex_;
99  std::vector<double> yLayerHex_;
100  std::vector<double> zLayerHex_;
101  std::vector<double> rMinLayHex_;
102  std::vector<double> rMaxLayHex_;
103  std::vector<double> waferPosX_;
104  std::vector<double> waferPosY_;
106  std::vector<double> cellFineX_;
107  std::vector<double> cellFineY_;
108  std::vector<bool> cellFineHalf_;
110  std::vector<double> cellCoarseX_;
111  std::vector<double> cellCoarseY_;
112  std::vector<bool> cellCoarseHalf_;
113  std::vector<double> boundR_;
114  std::vector<int> layer_;
115  std::vector<int> layerIndex_;
116  std::vector<int> layerGroup_;
117  std::vector<int> cellFactor_;
118  std::vector<int> depth_;
119  std::vector<int> depthIndex_;
120  std::vector<int> depthLayerF_;
121  std::vector<int> waferCopy_;
122  std::vector<int> waferTypeL_;
123  std::vector<int> waferTypeT_;
124  std::vector<int> layerGroupM_;
125  std::vector<int> layerGroupO_;
126  std::vector<double> rLimit_;
127  std::vector<int> cellFine_;
128  std::vector<int> cellCoarse_;
129  double waferR_;
130  std::vector<int> levelT_;
133  double waferSize_;
134  double waferThick_;
136  double mouseBite_;
138  std::vector<int> waferUVMaxLayer_;
140 
142 
143 private:
144  static constexpr int kMaskZside = 0x1;
145  static constexpr int kMaskLayer = 0x7F;
146  static constexpr int kMaskSector = 0x3FF;
147  static constexpr int kMaskSubSec = 0x1;
148  static constexpr int kShiftZside = 19;
149  static constexpr int kShiftLayer = 12;
150  static constexpr int kShiftSector = 1;
151  static constexpr int kShiftSubSec = 0;
152 };
153 
154 #endif
std::vector< double > moduleCellR_
std::vector< double > moduleBlS_
std::vector< double > cellFineX_
static constexpr int kMaskLayer
std::unordered_map< int32_t, int32_t > wafer_map
std::vector< int > layer_
std::vector< bool > cellCoarseHalf_
std::vector< int > waferCopy_
static constexpr double k_ScaleFromDDD
std::vector< double > rMaxLayHex_
std::vector< double > trformRotZY_
std::vector< double > moduleHS_
std::vector< double > trformRotZX_
std::vector< double > moduleTlS_
std::vector< std::unordered_map< int32_t, int32_t > > layer_map
static constexpr double k_ScaleFromDD4hepToG4
static constexpr double k_ScaleFromDD4hep
std::vector< double > trformTranX_
std::vector< int > waferTypeL_
std::vector< double > cellCoarseY_
std::vector< double > slopeTop_
std::vector< int > moduleLayR_
void scaleTrForm(double)
static constexpr uint32_t k_CornerSize
std::vector< double > moduleHR_
std::vector< double > boundR_
std::vector< double > rMinFront_
std::vector< int > layerIndex_
static constexpr int kMaskSubSec
std::vector< double > cellCoarseX_
std::vector< double > slopeMin_
std::vector< double > moduleAlphaR_
std::vector< int > cellFine_
static constexpr double k_ScaleToDDD
std::vector< double > trformRotYZ_
std::vector< double > waferPosX_
static constexpr double k_ScaleToDDDFromG4
hgtrform getTrForm(unsigned int k) const
static constexpr double k_ScaleFromDDDToG4
std::vector< int > depthIndex_
std::vector< double > moduleAlphaS_
std::vector< double > zFrontMin_
std::vector< double > xLayerHex_
std::vector< double > zLayerHex_
static constexpr double tol
std::vector< int > cellCoarse_
void fillTrForm(const hgtrform &mytr)
std::vector< int > waferTypeT_
std::vector< int > cellFactor_
std::vector< double > moduleDzR_
static constexpr int kShiftSector
static constexpr int kMaskSector
std::vector< double > zFrontTop_
HGCalGeometryMode::GeometryMode mode_
std::array< int, 4 > getID(unsigned int k) const
std::vector< double > trformTranZ_
std::vector< double > moduleBlR_
std::vector< int > levelT_
std::vector< int > layerGroup_
std::vector< int > moduleLayS_
std::vector< double > trformRotXX_
void fillModule(const hgtrap &mytr, bool reco)
std::vector< int > waferUVMaxLayer_
std::vector< double > trformRotYX_
std::vector< double > rMaxFront_
std::vector< double > rMinLayHex_
std::vector< int > layerGroupM_
std::vector< double > trformRotZZ_
std::vector< double > cellFineY_
std::vector< double > cellSize_
std::vector< double > trformRotYY_
std::unordered_map< int32_t, std::pair< int32_t, int32_t > > waferT_map
std::vector< double > yLayerHex_
void addTrForm(const CLHEP::Hep3Vector &h3v)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< double > trformTranY_
std::vector< int > depth_
std::vector< uint32_t > trformIndex_
static constexpr int kShiftLayer
fixed size matrix
static constexpr int kShiftSubSec
std::vector< int > depthLayerF_
std::vector< double > trformRotXY_
static constexpr int kShiftZside
std::vector< double > moduleTlR_
HGCalTBParameters(const std::string &nam)
std::vector< bool > cellFineHalf_
std::vector< double > trformRotXZ_
std::vector< int > layerGroupO_
static constexpr int kMaskZside
static constexpr double k_ScaleToDD4hepFromG4
~HGCalTBParameters(void)=default
std::vector< double > zRanges_
std::vector< double > moduleDzS_
std::vector< double > moduleCellS_
std::vector< double > waferPosY_
static constexpr double k_ScaleToDD4hep
std::vector< double > rLimit_
hgtrap getModule(unsigned int k, bool reco) const