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