CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 <cstdint>
6 #include <string>
7 #include <unordered_map>
8 #include <vector>
12 #include "DD4hep/DD4hepUnits.h"
13 
15 public:
16  struct waferInfo {
17  int32_t type, part, orient;
18  waferInfo(int32_t t = 0, int32_t p = 0, int32_t o = 0) : type(t), part(p), orient(o){};
19  };
20  struct tileInfo {
21  int32_t type, sipm, hex[4];
22  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)
23  : type(t), sipm(s) {
24  hex[0] = h1;
25  hex[1] = h2;
26  hex[2] = h3;
27  hex[3] = h4;
28  };
29  };
30  typedef std::vector<std::unordered_map<int32_t, int32_t> > layer_map;
31  typedef std::unordered_map<int32_t, int32_t> wafer_map;
32  typedef std::unordered_map<int32_t, std::pair<int32_t, int32_t> > waferT_map;
33  typedef std::unordered_map<int32_t, waferInfo> waferInfo_map;
34  typedef std::unordered_map<int32_t, tileInfo> tileInfo_map;
35 
36  static constexpr double k_ScaleFromDDD = 0.1;
37  static constexpr double k_ScaleToDDD = 10.0;
38  static constexpr double k_ScaleFromDDDToG4 = 1.0;
39  static constexpr double k_ScaleToDDDFromG4 = 1.0;
40  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
41  static constexpr double k_ScaleToDD4hep = dd4hep::cm;
42  static constexpr double k_ScaleFromDD4hepToG4 = (1.0 / dd4hep::mm);
43  static constexpr double k_ScaleToDD4hepFromG4 = dd4hep::mm;
44  static constexpr uint32_t k_CornerSize = 6;
45  static constexpr double tol = 1.0e-12;
46 
47  struct hgtrap {
48  int lay;
49  float bl, tl, h, dz, alpha, cellSize;
50  };
51 
52  struct hgtrform {
53  int zp, lay, sec, subsec;
54  CLHEP::Hep3Vector h3v;
55  CLHEP::HepRotation hr;
56  };
57 
58  HGCalParameters(const std::string& nam);
59  ~HGCalParameters(void);
60  void fillModule(const hgtrap& mytr, bool reco);
61  hgtrap getModule(unsigned int k, bool reco) const;
62  void fillTrForm(const hgtrform& mytr);
63  hgtrform getTrForm(unsigned int k) const;
64  void addTrForm(const CLHEP::Hep3Vector& h3v);
65  void scaleTrForm(double);
66  int scintCells(const int layer) const { return nPhiBinBH_[scintType(layer)]; }
67  double scintCellSize(const int layer) const { return cellSize_[scintType(layer)]; }
68  int scintType(const int layer) const { return ((layer < layerFrontBH_[1]) ? 0 : 1); }
69  std::array<int, 4> getID(unsigned int k) const;
70 
73  int nCells_;
74  int nSectors_;
75  std::vector<double> cellSize_;
76  std::vector<int> moduleLayS_;
77  std::vector<double> moduleBlS_;
78  std::vector<double> moduleTlS_;
79  std::vector<double> moduleHS_;
80  std::vector<double> moduleDzS_;
81  std::vector<double> moduleAlphaS_;
82  std::vector<double> moduleCellS_;
83  std::vector<int> moduleLayR_;
84  std::vector<double> moduleBlR_;
85  std::vector<double> moduleTlR_;
86  std::vector<double> moduleHR_;
87  std::vector<double> moduleDzR_;
88  std::vector<double> moduleAlphaR_;
89  std::vector<double> moduleCellR_;
90  std::vector<uint32_t> trformIndex_;
91  std::vector<double> trformTranX_;
92  std::vector<double> trformTranY_;
93  std::vector<double> trformTranZ_;
94  std::vector<double> trformRotXX_;
95  std::vector<double> trformRotYX_;
96  std::vector<double> trformRotZX_;
97  std::vector<double> trformRotXY_;
98  std::vector<double> trformRotYY_;
99  std::vector<double> trformRotZY_;
100  std::vector<double> trformRotXZ_;
101  std::vector<double> trformRotYZ_;
102  std::vector<double> trformRotZZ_;
103  std::vector<int> layer_;
104  std::vector<int> layerIndex_;
105  std::vector<int> layerGroup_;
106  std::vector<int> cellFactor_;
107  std::vector<int> depth_;
108  std::vector<int> depthIndex_;
109  std::vector<int> depthLayerF_;
110  std::vector<double> xLayerHex_;
111  std::vector<double> yLayerHex_;
112  std::vector<double> zLayerHex_;
113  std::vector<double> rMinLayHex_;
114  std::vector<double> rMaxLayHex_;
115  std::vector<int> waferCopy_;
116  std::vector<int> waferTypeL_;
117  std::vector<int> waferTypeT_;
118  std::vector<double> waferPosX_;
119  std::vector<double> waferPosY_;
120  std::vector<double> cellFineX_;
121  std::vector<double> cellFineY_;
123  std::vector<bool> cellFineHalf_;
124  std::vector<double> cellCoarseX_;
125  std::vector<double> cellCoarseY_;
127  std::vector<bool> cellCoarseHalf_;
128  std::vector<int> layerGroupM_;
129  std::vector<int> layerGroupO_;
130  std::vector<double> boundR_;
131  std::vector<double> rLimit_;
132  std::vector<int> cellFine_;
133  std::vector<int> cellCoarse_;
134  double waferR_;
135  std::vector<int> levelT_;
138  std::vector<double> slopeMin_;
139  std::vector<double> zFrontMin_;
140  std::vector<double> rMinFront_;
144  double waferSize_;
145  double waferThick_;
147  double mouseBite_;
149  std::vector<int> waferUVMaxLayer_;
151  std::vector<double> waferThickness_;
152  std::vector<double> cellThickness_;
153  std::vector<double> radius100to200_;
154  std::vector<double> radius200to300_;
157  double fracAreaMin_;
158  double zMinForRad_;
159  std::vector<double> radiusMixBoundary_;
160  std::vector<int> nPhiBinBH_;
161  std::vector<int> layerFrontBH_;
162  std::vector<double> rMinLayerBH_;
163  std::vector<double> radiusLayer_[2];
164  std::vector<int> iradMinBH_;
165  std::vector<int> iradMaxBH_;
166  double minTileSize_;
167  std::vector<int> firstModule_;
168  std::vector<int> lastModule_;
169  std::vector<double> slopeTop_;
170  std::vector<double> zFrontTop_;
171  std::vector<double> rMaxFront_;
172  std::vector<double> zRanges_;
177  std::vector<int> layerType_;
178  std::vector<int> layerCenter_;
185  std::vector<std::pair<double, double> > layerRotV_;
187  std::vector<std::pair<double, double> > tileRingR_;
188  std::vector<std::pair<int, int> > tileRingRange_;
189 
191 
192 private:
193  static constexpr int kMaskZside = 0x1;
194  static constexpr int kMaskLayer = 0x7F;
195  static constexpr int kMaskSector = 0x3FF;
196  static constexpr int kMaskSubSec = 0x1;
197  static constexpr int kShiftZside = 19;
198  static constexpr int kShiftLayer = 12;
199  static constexpr int kShiftSector = 1;
200  static constexpr int kShiftSubSec = 0;
201 };
202 
203 #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_
std::vector< double > moduleHR_
wafer_map cellFineIndex_
layer_map copiesInLayers_
std::vector< std::pair< double, double > > layerRotV_
std::vector< bool > cellCoarseHalf_
std::vector< bool > cellFineHalf_
int scintType(const int layer) const
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_
std::vector< double > trformRotZY_
std::vector< uint32_t > trformIndex_
std::vector< int > layerGroupM_
HGCalGeometryMode::GeometryMode mode_
double scintCellSize(const int layer) const
std::vector< int > cellFactor_
std::vector< double > trformRotXX_
std::vector< int > nPhiBinBH_
static constexpr double tol
void fillTrForm(const hgtrform &mytr)
static constexpr uint32_t k_CornerSize
constexpr std::array< uint8_t, layerIndexSize > layer
wafer_map wafersInLayers_
waferInfo(int32_t t=0, int32_t p=0, int32_t o=0)
HGCalParameters(const std::string &nam)
std::vector< double > rMinLayerBH_
std::vector< double > trformRotZX_
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_
std::array< int, 4 > getID(unsigned int k) const
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_
hgtrform getTrForm(unsigned int k) const
std::vector< double > trformRotXY_
std::vector< double > rMaxFront_
std::vector< double > trformRotYX_
int scintCells(const int layer) const
hgtrap getModule(unsigned int k, bool reco) const
std::vector< double > waferThickness_
std::vector< double > slopeTop_
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< 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_
std::vector< double > moduleBlS_
std::vector< int > waferCopy_
std::vector< int > depthIndex_
std::vector< int > layerFrontBH_
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_
CLHEP::HepRotation hr
std::vector< double > waferPosX_
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