CMS 3D CMS Logo

HGCalParameters.h
Go to the documentation of this file.
1 #ifndef Geometry_HGCalCommonData_HGCalParameters_h
2 #define Geometry_HGCalCommonData_HGCalParameters_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  struct waferInfo {
18  int32_t type, part, orient, cassette;
19  waferInfo(int32_t t = 0, int32_t p = 0, int32_t o = 0, int32_t c = 0) : type(t), part(p), orient(o), cassette(c) {}
20  };
21  struct tileInfo {
22  int32_t type, sipm, cassette, hex[6];
23  tileInfo(int32_t t = 0,
24  int32_t s = 0,
25  int32_t h1 = 0,
26  int32_t h2 = 0,
27  int32_t h3 = 0,
28  int32_t h4 = 0,
29  int32_t h5 = 0,
30  int32_t h6 = 0)
31  : type(t), sipm(s) {
32  hex[0] = h1;
33  hex[1] = h2;
34  hex[2] = h3;
35  hex[3] = h4;
36  hex[4] = h5;
37  hex[5] = h6;
38  };
39  };
40  typedef std::vector<std::unordered_map<int32_t, int32_t> > layer_map;
41  typedef std::unordered_map<int32_t, int32_t> wafer_map;
42  typedef std::unordered_map<int32_t, std::pair<int32_t, int32_t> > waferT_map;
43  typedef std::unordered_map<int32_t, waferInfo> waferInfo_map;
44  typedef std::unordered_map<int32_t, tileInfo> tileInfo_map;
45 
46  static constexpr double k_ScaleFromDDD = 0.1;
47  static constexpr double k_ScaleFromDDD2 = 0.01;
48  static constexpr double k_ScaleToDDD = 10.0;
49  static constexpr double k_ScaleToDDD2 = 100.0;
50  static constexpr double k_ScaleFromDDDToG4 = 1.0;
51  static constexpr double k_ScaleToDDDFromG4 = 1.0;
52  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
53  static constexpr double k_ScaleToDD4hep = dd4hep::cm;
54  static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
55  static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;
56  static constexpr uint32_t k_CornerSize = 6;
57  static constexpr double tol = 1.0e-12;
58 
59  struct hgtrap {
60  int lay;
61  float bl, tl, h, dz, alpha, cellSize;
62  };
63 
64  struct hgtrform {
65  int zp, lay, sec, subsec;
66  CLHEP::Hep3Vector h3v;
67  CLHEP::HepRotation hr;
68  };
69 
70  HGCalParameters(const std::string& nam);
71  ~HGCalParameters(void) = default;
72  void fillModule(const hgtrap& mytr, bool reco);
73  hgtrap getModule(unsigned int k, bool reco) const;
74  void fillTrForm(const hgtrform& mytr);
75  hgtrform getTrForm(unsigned int k) const;
76  void addTrForm(const CLHEP::Hep3Vector& h3v);
77  void scaleTrForm(double);
78  int scintCells(const int layer) const { return nPhiBinBH_[scintType(layer)]; }
79  double scintCellSize(const int layer) const { return cellSize_[scintType(layer)]; }
80  int scintType(const int layer) const { return ((layer < layerFrontBH_[1]) ? 0 : 1); }
81  std::array<int, 4> getID(unsigned int k) const;
82 
84  int detectorType_ = 0;
85  int useSimWt_ = 0;
86  int nCells_ = 0;
87  int nSectors_ = 0;
88  int firstLayer_ = 0;
91 
92  std::vector<double> cellSize_;
93  std::vector<double> slopeMin_;
94  std::vector<double> zFrontMin_;
95  std::vector<double> rMinFront_;
96  std::vector<double> slopeTop_;
97  std::vector<double> zFrontTop_;
98  std::vector<double> rMaxFront_;
99  std::vector<double> zRanges_;
100  std::vector<int> moduleLayS_;
101  std::vector<double> moduleBlS_;
102  std::vector<double> moduleTlS_;
103  std::vector<double> moduleHS_;
104  std::vector<double> moduleDzS_;
105  std::vector<double> moduleAlphaS_;
106  std::vector<double> moduleCellS_;
107  std::vector<int> moduleLayR_;
108  std::vector<double> moduleBlR_;
109  std::vector<double> moduleTlR_;
110  std::vector<double> moduleHR_;
111  std::vector<double> moduleDzR_;
112  std::vector<double> moduleAlphaR_;
113  std::vector<double> moduleCellR_;
114  std::vector<uint32_t> trformIndex_;
115  std::vector<double> trformTranX_;
116  std::vector<double> trformTranY_;
117  std::vector<double> trformTranZ_;
118  std::vector<double> trformRotXX_;
119  std::vector<double> trformRotYX_;
120  std::vector<double> trformRotZX_;
121  std::vector<double> trformRotXY_;
122  std::vector<double> trformRotYY_;
123  std::vector<double> trformRotZY_;
124  std::vector<double> trformRotXZ_;
125  std::vector<double> trformRotYZ_;
126  std::vector<double> trformRotZZ_;
127  std::vector<double> xLayerHex_;
128  std::vector<double> yLayerHex_;
129  std::vector<double> zLayerHex_;
130  std::vector<double> rMinLayHex_;
131  std::vector<double> rMaxLayHex_;
132  std::vector<double> waferPosX_;
133  std::vector<double> waferPosY_;
135  std::vector<double> cellFineX_;
136  std::vector<double> cellFineY_;
137  std::vector<bool> cellFineHalf_;
139  std::vector<double> cellCoarseX_;
140  std::vector<double> cellCoarseY_;
141  std::vector<bool> cellCoarseHalf_;
142  std::vector<double> boundR_;
143  std::vector<int> layer_;
144  std::vector<int> layerIndex_;
145  std::vector<int> layerGroup_;
146  std::vector<int> cellFactor_;
147  std::vector<int> depth_;
148  std::vector<int> depthIndex_;
149  std::vector<int> depthLayerF_;
150  std::vector<int> waferCopy_;
151  std::vector<int> waferTypeL_;
152  std::vector<int> waferTypeT_;
153  std::vector<int> layerGroupM_;
154  std::vector<int> layerGroupO_;
155  std::vector<double> rLimit_;
156  std::vector<int> cellFine_;
157  std::vector<int> cellCoarse_;
158  double waferR_ = 0.;
159  std::vector<int> levelT_;
160  int levelZSide_ = 0;
162  int nCellsFine_ = 0;
163  int nCellsCoarse_ = 0;
164  double waferSize_ = 0.;
165  double waferThick_ = 0.;
166  double sensorSeparation_ = 0.;
167  double sensorSizeOffset_ = 0.;
168  double guardRingOffset_ = 0.;
169  double mouseBite_ = 0.;
170  int useOffset_ = 0;
171  int waferUVMax_ = 0;
172  std::vector<int> waferUVMaxLayer_;
173  bool defineFull_ = false;
174  std::vector<double> waferThickness_;
175  std::vector<double> cellThickness_;
176  std::vector<double> radius100to200_;
177  std::vector<double> radius200to300_;
178  int choiceType_ = 0;
179  int nCornerCut_ = 0;
180  double fracAreaMin_ = 0.;
181  double zMinForRad_ = 0.;
182  std::vector<double> radiusMixBoundary_;
183  std::vector<int> nPhiBinBH_;
184  std::vector<int> layerFrontBH_;
185  std::vector<double> rMinLayerBH_;
186  std::vector<double> radiusLayer_[2];
187  std::vector<int> iradMinBH_;
188  std::vector<int> iradMaxBH_;
189  double minTileSize_ = 0.;
190  std::vector<int> firstModule_;
191  std::vector<int> lastModule_;
192  int layerOffset_ = 0;
193  double layerRotation_ = 0.;
194  std::vector<int> layerType_;
195  std::vector<int> layerCenter_;
199  int waferMaskMode_ = 0;
200  int waferZSide_ = 0;
202  std::vector<std::pair<double, double> > layerRotV_;
204  std::vector<std::pair<double, double> > tileRingR_;
205  std::vector<std::pair<int, int> > tileRingRange_;
206  std::vector<std::pair<double, double> > tileRingFineR_;
207  std::vector<std::pair<int, int> > tileRingFineRange_;
208  int cassettes_ = 0;
209  int nphiCassette_ = 0;
211  int phiOffset_ = 0;
212  std::vector<double> cassetteShift_;
213  std::vector<double> cassetteShiftTile_;
214  double calibCellRHD_ = 0.;
215  std::vector<int> calibCellFullHD_;
216  std::vector<int> calibCellPartHD_;
217  double calibCellRLD_ = 0.;
218  std::vector<int> calibCellFullLD_;
219  std::vector<int> calibCellPartLD_;
220 
222 
223 private:
224  static constexpr int kMaskZside = 0x1;
225  static constexpr int kMaskLayer = 0x7F;
226  static constexpr int kMaskSector = 0x3FF;
227  static constexpr int kMaskSubSec = 0x1;
228  static constexpr int kShiftZside = 19;
229  static constexpr int kShiftLayer = 12;
230  static constexpr int kShiftSector = 1;
231  static constexpr int kShiftSubSec = 0;
232 };
233 
234 #endif
std::vector< int > iradMaxBH_
std::vector< double > waferPosY_
std::vector< int > layer_
std::vector< double > moduleDzR_
std::vector< int > depthLayerF_
std::vector< int > depth_
std::vector< double > zFrontMin_
std::vector< double > moduleCellR_
hgtrap getModule(unsigned int k, bool reco) const
std::vector< double > moduleHR_
wafer_map cellFineIndex_
layer_map copiesInLayers_
std::vector< std::pair< double, double > > layerRotV_
std::vector< bool > cellCoarseHalf_
int scintType(const int layer) const
std::vector< bool > cellFineHalf_
std::vector< int > moduleLayR_
static constexpr double k_ScaleToDDDFromG4
std::unordered_map< int32_t, waferInfo > waferInfo_map
static constexpr int kMaskZside
std::vector< int > cellFine_
std::vector< double > moduleHS_
std::vector< double > trformTranY_
static constexpr int kMaskLayer
std::vector< double > cellFineY_
waferInfo(int32_t t=0, int32_t p=0, int32_t o=0, int32_t c=0)
std::array< int, 4 > getID(unsigned int k) const
std::vector< double > trformRotZY_
std::vector< uint32_t > trformIndex_
std::vector< int > layerGroupM_
std::vector< std::pair< int, int > > tileRingFineRange_
HGCalGeometryMode::GeometryMode mode_
std::vector< int > cellFactor_
std::vector< double > trformRotXX_
std::vector< int > nPhiBinBH_
hgtrform getTrForm(unsigned int k) const
static constexpr double tol
void fillTrForm(const hgtrform &mytr)
static constexpr uint32_t k_CornerSize
wafer_map wafersInLayers_
HGCalParameters(const std::string &nam)
std::vector< double > rMinLayerBH_
std::vector< double > trformRotZX_
double scintCellSize(const int layer) const
static constexpr double k_ScaleFromDDD2
std::vector< double > cellCoarseX_
std::vector< std::pair< int, int > > tileRingRange_
std::vector< int > firstModule_
std::vector< int > cellCoarse_
std::vector< double > trformRotYZ_
std::vector< double > boundR_
static constexpr int kShiftSector
std::vector< double > cellSize_
std::vector< int > waferUVMaxLayer_
std::vector< double > moduleDzS_
std::vector< int > layerIndex_
std::vector< double > moduleAlphaR_
std::vector< double > yLayerHex_
std::vector< double > trformRotXY_
std::vector< double > rMaxFront_
std::vector< double > trformRotYX_
std::vector< double > waferThickness_
std::vector< double > slopeTop_
std::vector< int > calibCellPartHD_
std::vector< int > layerCenter_
static constexpr double k_ScaleFromDD4hep
std::vector< double > moduleBlR_
std::vector< double > rMinLayHex_
void fillModule(const hgtrap &mytr, bool reco)
std::vector< double > moduleTlS_
std::vector< int > calibCellFullHD_
std::vector< double > zLayerHex_
std::vector< int > layerType_
std::vector< std::pair< double, double > > tileRingFineR_
static constexpr int kShiftLayer
waferT_map waferTypes_
std::vector< double > rMaxLayHex_
std::vector< double > trformTranX_
static constexpr double k_ScaleFromDD4hepToG4
std::unordered_map< int32_t, std::pair< int32_t, int32_t > > waferT_map
std::vector< double > zRanges_
std::vector< double > slopeMin_
std::vector< int > lastModule_
static constexpr double k_ScaleToDDD
std::vector< double > radiusMixBoundary_
std::vector< double > cellThickness_
std::unordered_map< int32_t, tileInfo > tileInfo_map
std::vector< double > trformRotXZ_
void scaleTrForm(double)
std::vector< int > layerGroup_
std::unordered_map< int32_t, int32_t > wafer_map
static constexpr double k_ScaleToDD4hepFromG4
part
Definition: HCALResponse.h:20
std::vector< double > moduleCellS_
static constexpr double k_ScaleToDD4hep
static constexpr int kShiftZside
std::vector< double > radius200to300_
static constexpr int kMaskSector
static constexpr int kMaskSubSec
std::vector< double > radius100to200_
wafer_map cellCoarseIndex_
std::vector< double > rMinFront_
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< int > iradMinBH_
std::vector< double > trformRotYY_
std::vector< double > cellFineX_
static constexpr double k_ScaleFromDDDToG4
wafer_map typesInLayers_
std::vector< double > trformRotZZ_
static constexpr double k_ScaleFromDDD
std::vector< double > moduleAlphaS_
std::vector< int > layerGroupO_
fixed size matrix
std::vector< double > moduleBlS_
std::vector< int > waferCopy_
std::vector< double > cassetteShift_
std::vector< int > depthIndex_
std::vector< int > layerFrontBH_
std::vector< int > calibCellPartLD_
std::vector< double > rLimit_
std::vector< double > zFrontTop_
std::vector< double > radiusLayer_[2]
std::vector< int > waferTypeT_
std::vector< int > levelT_
std::vector< double > cellCoarseY_
static constexpr double k_ScaleToDDD2
std::vector< std::pair< double, double > > tileRingR_
waferInfo_map waferInfoMap_
tileInfo(int32_t t=0, int32_t s=0, int32_t h1=0, int32_t h2=0, int32_t h3=0, int32_t h4=0, int32_t h5=0, int32_t h6=0)
std::vector< int > moduleLayS_
std::vector< double > trformTranZ_
~HGCalParameters(void)=default
CLHEP::HepRotation hr
std::vector< double > waferPosX_
int scintCells(const int layer) const
void addTrForm(const CLHEP::Hep3Vector &h3v)
static constexpr int kShiftSubSec
tileInfo_map tileInfoMap_
std::vector< double > moduleTlR_
std::vector< int > waferTypeL_
std::vector< double > cassetteShiftTile_
std::vector< double > xLayerHex_
std::string name_
std::vector< std::unordered_map< int32_t, int32_t > > layer_map
std::vector< int > calibCellFullLD_