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_ScaleToDDD = 10.0;
39  static constexpr double k_ScaleFromDDDToG4 = 1.0;
40  static constexpr double k_ScaleToDDDFromG4 = 1.0;
41  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
42  static constexpr double k_ScaleToDD4hep = dd4hep::cm;
43  static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
44  static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;
45  static constexpr uint32_t k_CornerSize = 6;
46  static constexpr double tol = 1.0e-12;
47 
48  struct hgtrap {
49  int lay;
50  float bl, tl, h, dz, alpha, cellSize;
51  };
52 
53  struct hgtrform {
54  int zp, lay, sec, subsec;
55  CLHEP::Hep3Vector h3v;
56  CLHEP::HepRotation hr;
57  };
58 
59  HGCalParameters(const std::string& nam);
60  ~HGCalParameters(void) = default;
61  void fillModule(const hgtrap& mytr, bool reco);
62  hgtrap getModule(unsigned int k, bool reco) const;
63  void fillTrForm(const hgtrform& mytr);
64  hgtrform getTrForm(unsigned int k) const;
65  void addTrForm(const CLHEP::Hep3Vector& h3v);
66  void scaleTrForm(double);
67  int scintCells(const int layer) const { return nPhiBinBH_[scintType(layer)]; }
68  double scintCellSize(const int layer) const { return cellSize_[scintType(layer)]; }
69  int scintType(const int layer) const { return ((layer < layerFrontBH_[1]) ? 0 : 1); }
70  std::array<int, 4> getID(unsigned int k) const;
71 
74  int useSimWt_;
75  int nCells_;
76  int nSectors_;
80 
81  std::vector<double> cellSize_;
82  std::vector<double> slopeMin_;
83  std::vector<double> zFrontMin_;
84  std::vector<double> rMinFront_;
85  std::vector<double> slopeTop_;
86  std::vector<double> zFrontTop_;
87  std::vector<double> rMaxFront_;
88  std::vector<double> zRanges_;
89  std::vector<int> moduleLayS_;
90  std::vector<double> moduleBlS_;
91  std::vector<double> moduleTlS_;
92  std::vector<double> moduleHS_;
93  std::vector<double> moduleDzS_;
94  std::vector<double> moduleAlphaS_;
95  std::vector<double> moduleCellS_;
96  std::vector<int> moduleLayR_;
97  std::vector<double> moduleBlR_;
98  std::vector<double> moduleTlR_;
99  std::vector<double> moduleHR_;
100  std::vector<double> moduleDzR_;
101  std::vector<double> moduleAlphaR_;
102  std::vector<double> moduleCellR_;
103  std::vector<uint32_t> trformIndex_;
104  std::vector<double> trformTranX_;
105  std::vector<double> trformTranY_;
106  std::vector<double> trformTranZ_;
107  std::vector<double> trformRotXX_;
108  std::vector<double> trformRotYX_;
109  std::vector<double> trformRotZX_;
110  std::vector<double> trformRotXY_;
111  std::vector<double> trformRotYY_;
112  std::vector<double> trformRotZY_;
113  std::vector<double> trformRotXZ_;
114  std::vector<double> trformRotYZ_;
115  std::vector<double> trformRotZZ_;
116  std::vector<double> xLayerHex_;
117  std::vector<double> yLayerHex_;
118  std::vector<double> zLayerHex_;
119  std::vector<double> rMinLayHex_;
120  std::vector<double> rMaxLayHex_;
121  std::vector<double> waferPosX_;
122  std::vector<double> waferPosY_;
124  std::vector<double> cellFineX_;
125  std::vector<double> cellFineY_;
126  std::vector<bool> cellFineHalf_;
128  std::vector<double> cellCoarseX_;
129  std::vector<double> cellCoarseY_;
130  std::vector<bool> cellCoarseHalf_;
131  std::vector<double> boundR_;
132  std::vector<int> layer_;
133  std::vector<int> layerIndex_;
134  std::vector<int> layerGroup_;
135  std::vector<int> cellFactor_;
136  std::vector<int> depth_;
137  std::vector<int> depthIndex_;
138  std::vector<int> depthLayerF_;
139  std::vector<int> waferCopy_;
140  std::vector<int> waferTypeL_;
141  std::vector<int> waferTypeT_;
142  std::vector<int> layerGroupM_;
143  std::vector<int> layerGroupO_;
144  std::vector<double> rLimit_;
145  std::vector<int> cellFine_;
146  std::vector<int> cellCoarse_;
147  double waferR_;
148  std::vector<int> levelT_;
153  double waferSize_;
154  double waferThick_;
158  double mouseBite_;
161  std::vector<int> waferUVMaxLayer_;
163  std::vector<double> waferThickness_;
164  std::vector<double> cellThickness_;
165  std::vector<double> radius100to200_;
166  std::vector<double> radius200to300_;
169  double fracAreaMin_;
170  double zMinForRad_;
171  std::vector<double> radiusMixBoundary_;
172  std::vector<int> nPhiBinBH_;
173  std::vector<int> layerFrontBH_;
174  std::vector<double> rMinLayerBH_;
175  std::vector<double> radiusLayer_[2];
176  std::vector<int> iradMinBH_;
177  std::vector<int> iradMaxBH_;
178  double minTileSize_;
179  std::vector<int> firstModule_;
180  std::vector<int> lastModule_;
183  std::vector<int> layerType_;
184  std::vector<int> layerCenter_;
191  std::vector<std::pair<double, double> > layerRotV_;
193  std::vector<std::pair<double, double> > tileRingR_;
194  std::vector<std::pair<int, int> > tileRingRange_;
198  std::vector<double> cassetteShift_;
200  std::vector<int> calibCellFullHD_;
201  std::vector<int> calibCellPartHD_;
203  std::vector<int> calibCellFullLD_;
204  std::vector<int> calibCellPartLD_;
205 
207 
208 private:
209  static constexpr int kMaskZside = 0x1;
210  static constexpr int kMaskLayer = 0x7F;
211  static constexpr int kMaskSector = 0x3FF;
212  static constexpr int kMaskSubSec = 0x1;
213  static constexpr int kShiftZside = 19;
214  static constexpr int kShiftLayer = 12;
215  static constexpr int kShiftSector = 1;
216  static constexpr int kShiftSubSec = 0;
217 };
218 
219 #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_
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
std::vector< double > trformRotZX_
double scintCellSize(const int layer) const
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_
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_