CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalFlexiHardcodeGeometryLoader.cc
Go to the documentation of this file.
7 
8 #include <vector>
9 
10 namespace {
11  const int MAX_HCAL_PHI = 72;
12  const double DEGREE2RAD = M_PI / 180.;
13 
14  // Parameter objects
15 
16  struct HBHOCellParameters {
17  HBHOCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_rMin, float f_rMax, float f_etaMin, float f_etaMax)
18  : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), rMin(f_rMin), rMax(f_rMax), etaMin(f_etaMin), etaMax(f_etaMax)
19  {}
20 
21  int eta;
22  int depth;
23  int phiFirst;
24  int phiStep;
25  int dphi;
26  float rMin;
27  float rMax;
28  float etaMin;
29  float etaMax;
30  };
31 
32  struct HECellParameters {
33  HECellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_zMin, float f_zMax, float f_etaMin, float f_etaMax)
34  : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), etaMin(f_etaMin), etaMax(f_etaMax)
35  {}
36 
37  int eta;
38  int depth;
39  int phiFirst;
40  int phiStep;
41  int dphi;
42  float zMin;
43  float zMax;
44  float etaMin;
45  float etaMax;
46  };
47 
48  struct HFCellParameters {
49  HFCellParameters (int f_eta, int f_depth, int f_phiFirst, int f_phiStep, int f_dPhi, float f_zMin, float f_zMax, float f_rMin, float f_rMax)
50  : eta(f_eta), depth(f_depth), phiFirst(f_phiFirst), phiStep(f_phiStep), dphi(f_dPhi), zMin(f_zMin), zMax(f_zMax), rMin(f_rMin), rMax(f_rMax)
51  {}
52 
53  int eta;
54  int depth;
55  int phiFirst;
56  int phiStep;
57  int dphi;
58  float zMin;
59  float zMax;
60  float rMin;
61  float rMax;
62  };
63 
64 
65 
66  // ----------> HB <-----------
67  std::vector <HBHOCellParameters> makeHBCells () {
68  const float HBRMIN = 181.1;
69  const float HBRMAX = 288.8;
70 
71  HBHOCellParameters cells [] = {
72  // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax
73  HBHOCellParameters ( 1, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*0, 0.087*1),
74  HBHOCellParameters ( 2, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*1, 0.087*2),
75  HBHOCellParameters ( 3, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*2, 0.087*3),
76  HBHOCellParameters ( 4, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*3, 0.087*4),
77  HBHOCellParameters ( 5, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*4, 0.087*5),
78  HBHOCellParameters ( 6, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*5, 0.087*6),
79  HBHOCellParameters ( 7, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*6, 0.087*7),
80  HBHOCellParameters ( 8, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*7, 0.087*8),
81  HBHOCellParameters ( 9, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*8, 0.087*9),
82  HBHOCellParameters (10, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*9, 0.087*10),
83  HBHOCellParameters (11, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*10, 0.087*11),
84  HBHOCellParameters (12, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*11, 0.087*12),
85  HBHOCellParameters (13, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*12, 0.087*13),
86  HBHOCellParameters (14, 1, 1, 1, 5, HBRMIN, HBRMAX, 0.087*13, 0.087*14),
87  HBHOCellParameters (15, 1, 1, 1, 5, HBRMIN, 258.4, 0.087*14, 0.087*15),
88  HBHOCellParameters (15, 2, 1, 1, 5, 258.4, HBRMAX, 0.087*14, 0.087*15),
89  HBHOCellParameters (16, 1, 1, 1, 5, HBRMIN, 190.4, 0.087*15, 0.087*16),
90  HBHOCellParameters (16, 2, 1, 1, 5, 190.4, 232.6, 0.087*15, 0.087*16)
91  };
92  int nCells = sizeof(cells)/sizeof(HBHOCellParameters);
93  std::vector <HBHOCellParameters> result;
94  result.reserve (nCells);
95  for (int i = 0; i < nCells; ++i) result.push_back (cells[i]);
96  return result;
97  }
98 
99  // ----------> HO <-----------
100  std::vector <HBHOCellParameters> makeHOCells () {
101  const float HORMIN0 = 390.0;
102  const float HORMIN1 = 412.6;
103  const float HORMAX = 413.6;
104 
105  HBHOCellParameters cells [] = {
106  // eta, depth, firstPhi, stepPhi, deltaPhi, rMin, rMax, etaMin, etaMax
107  HBHOCellParameters ( 1, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*0, 0.087*1),
108  HBHOCellParameters ( 2, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*1, 0.087*2),
109  HBHOCellParameters ( 3, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*2, 0.087*3),
110  HBHOCellParameters ( 4, 4, 1, 1, 5, HORMIN0, HORMAX, 0.087*3, 0.3075),
111  HBHOCellParameters ( 5, 4, 1, 1, 5, HORMIN1, HORMAX, 0.3395, 0.087*5),
112  HBHOCellParameters ( 6, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*5, 0.087*6),
113  HBHOCellParameters ( 7, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*6, 0.087*7),
114  HBHOCellParameters ( 8, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*7, 0.087*8),
115  HBHOCellParameters ( 9, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*8, 0.087*9),
116  HBHOCellParameters (10, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*9, 0.8494),
117  HBHOCellParameters (11, 4, 1, 1, 5, HORMIN1, HORMAX, 0.873, 0.087*11),
118  HBHOCellParameters (12, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*11, 0.087*12),
119  HBHOCellParameters (13, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*12, 0.087*13),
120  HBHOCellParameters (14, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*13, 0.087*14),
121  HBHOCellParameters (15, 4, 1, 1, 5, HORMIN1, HORMAX, 0.087*14, 0.087*15)
122  };
123  int nCells = sizeof(cells)/sizeof(HBHOCellParameters);
124  std::vector <HBHOCellParameters> result;
125  result.reserve (nCells);
126  for (int i = 0; i < nCells; ++i) result.push_back (cells[i]);
127  return result;
128  }
129 
130  // ----------> HE <-----------
131  std::vector <HECellParameters> makeHECells () {
132  const float HEZMIN = 400.458;
133  const float HEZMID = 436.168;
134  const float HEZMAX = 549.268;
135 
136  HECellParameters cells [] = {
137  // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, etaMin, etaMax
138  HECellParameters ( 16, 3, 1, 1, 5,418.768,470.968, 0.087*15, 0.087*16),
139  HECellParameters ( 17, 1, 1, 1, 5,409.698,514.468, 0.087*16, 0.087*17),
140  HECellParameters ( 18, 1, 1, 1, 5,391.883,427.468, 0.087*17, 0.087*18),
141  HECellParameters ( 18, 2, 1, 1, 5,427.468,540.568, 0.087*17, 0.087*18),
142  HECellParameters ( 19, 1, 1, 1, 5, HEZMIN, HEZMID, 0.087*18, 0.087*19),
143  HECellParameters ( 19, 2, 1, 1, 5, HEZMID, HEZMAX, 0.087*18, 0.087*19),
144  HECellParameters ( 20, 1, 1, 1, 5, HEZMIN, HEZMID, 0.087*19, 1.74),
145  HECellParameters ( 20, 2, 1, 1, 5, HEZMID, HEZMAX, 0.087*19, 1.74),
146  HECellParameters ( 21, 1, 1, 2,10, HEZMIN, HEZMID, 1.74, 1.83),
147  HECellParameters ( 21, 2, 1, 2,10, HEZMID, HEZMAX, 1.74, 1.83),
148  HECellParameters ( 22, 1, 1, 2,10, HEZMIN, HEZMID, 1.83, 1.93),
149  HECellParameters ( 22, 2, 1, 2,10, HEZMID, HEZMAX, 1.83, 1.93),
150  HECellParameters ( 23, 1, 1, 2,10, HEZMIN, HEZMID, 1.93, 2.043),
151  HECellParameters ( 23, 2, 1, 2,10, HEZMID, HEZMAX, 1.93, 2.043),
152  HECellParameters ( 24, 1, 1, 2,10, HEZMIN, HEZMID, 2.043, 2.172),
153  HECellParameters ( 24, 2, 1, 2,10, HEZMID, HEZMAX, 2.043, 2.172),
154  HECellParameters ( 25, 1, 1, 2,10, HEZMIN, HEZMID, 2.172, 2.322),
155  HECellParameters ( 25, 2, 1, 2,10, HEZMID, HEZMAX, 2.172, 2.322),
156  HECellParameters ( 26, 1, 1, 2,10, HEZMIN, HEZMID, 2.322, 2.500),
157  HECellParameters ( 26, 2, 1, 2,10, HEZMID, HEZMAX, 2.322, 2.500),
158  HECellParameters ( 27, 1, 1, 2,10, HEZMIN,418.768, 2.500, 2.650),
159  HECellParameters ( 27, 2, 1, 2,10,418.768, HEZMID, 2.500, 2.650),
160  HECellParameters ( 27, 3, 1, 2,10, HEZMID, HEZMAX, 2.500, 2.650),
161  HECellParameters ( 28, 1, 1, 2,10, HEZMIN,418.768, 2.650, 2.868),
162  HECellParameters ( 28, 2, 1, 2,10,418.768, HEZMID, 2.650, 2.868),
163  HECellParameters ( 28, 3, 1, 2,10, HEZMID, HEZMAX, 2.650, 3.000),
164  HECellParameters ( 29, 1, 1, 2,10, HEZMIN, HEZMID, 2.868, 3.000),
165  HECellParameters ( 29, 2, 1, 2,10,418.768, HEZMID, 2.868, 3.000)
166  };
167  int nCells = sizeof(cells)/sizeof(HECellParameters);
168  std::vector <HECellParameters> result;
169  result.reserve (nCells);
170  for (int i = 0; i < nCells; ++i) result.push_back (cells[i]);
171  return result;
172  }
173 
174 
175  // ----------> HE @ H2 <-----------
176  std::vector <HECellParameters> makeHECells_H2 () {
177  const float HEZMIN_H2 = 400.715;
178  const float HEZMID_H2 = 436.285;
179  const float HEZMAX_H2 = 541.885;
180 
181  HECellParameters cells [] = {
182  // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, etaMin, etaMax
183  HECellParameters ( 16, 3, 1, 1, 5, 409.885, 462.685, 1.305, 1.373),
184  HECellParameters ( 17, 1, 1, 1, 5, HEZMIN_H2, 427.485, 1.373, 1.444),
185  HECellParameters ( 17, 2, 1, 1, 5, 427.485, 506.685, 1.373, 1.444),
186  HECellParameters ( 18, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.444, 1.521),
187  HECellParameters ( 18, 2, 1, 1, 5, HEZMID_H2, 524.285, 1.444, 1.521),
188  HECellParameters ( 19, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.521, 1.603),
189  HECellParameters ( 19, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.521, 1.603),
190  HECellParameters ( 20, 1, 1, 1, 5, HEZMIN_H2, HEZMID_H2, 1.603, 1.693),
191  HECellParameters ( 20, 2, 1, 1, 5, HEZMID_H2, HEZMAX_H2, 1.603, 1.693),
192  HECellParameters ( 21, 1, 1, 2, 5, HEZMIN_H2, HEZMID_H2, 1.693, 1.79),
193  HECellParameters ( 21, 2, 1, 2, 5, HEZMID_H2, HEZMAX_H2, 1.693, 1.79),
194  HECellParameters ( 22, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.79, 1.88),
195  HECellParameters ( 22, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.79, 1.88),
196  HECellParameters ( 23, 1, 1, 2,10, HEZMIN_H2, HEZMID_H2, 1.88, 1.98),
197  HECellParameters ( 23, 2, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.88, 1.98),
198  HECellParameters ( 24, 1, 1, 2,10, HEZMIN_H2, 418.685, 1.98, 2.09),
199  HECellParameters ( 24, 2, 1, 2,10, 418.685, HEZMID_H2, 1.98, 2.09),
200  HECellParameters ( 24, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 1.98, 2.09),
201  HECellParameters ( 25, 1, 1, 2,10, HEZMIN_H2, 418.685, 2.09, 2.21),
202  HECellParameters ( 25, 2, 1, 2,10, 418.685, HEZMID_H2, 2.09, 2.21),
203  HECellParameters ( 25, 3, 1, 2,10, HEZMID_H2, HEZMAX_H2, 2.09, 2.21)
204  };
205  int nCells = sizeof(cells)/sizeof(HECellParameters);
206  std::vector <HECellParameters> result;
207  result.reserve (nCells);
208  for (int i = 0; i < nCells; ++i) result.push_back (cells[i]);
209  return result;
210  }
211 
212  // ----------> HF <-----------
213  std::vector <HFCellParameters> makeHFCells () {
214  const float HFZMIN1 = 1115.;
215  const float HFZMIN2 = 1137.;
216  const float HFZMAX = 1280.1;
217 
218  HFCellParameters cells [] = {
219  // eta, depth, firstPhi, stepPhi, deltaPhi, zMin, zMax, rMin, rMax
220  HFCellParameters (29, 1, 1, 2, 10, HFZMIN1, HFZMAX,116.2,130.0),
221  HFCellParameters (29, 2, 1, 2, 10, HFZMIN2, HFZMAX,116.2,130.0),
222  HFCellParameters (30, 1, 1, 2, 10, HFZMIN1, HFZMAX, 97.5,116.2),
223  HFCellParameters (30, 2, 1, 2, 10, HFZMIN2, HFZMAX, 97.5,116.2),
224  HFCellParameters (31, 1, 1, 2, 10, HFZMIN1, HFZMAX, 81.8, 97.5),
225  HFCellParameters (31, 2, 1, 2, 10, HFZMIN2, HFZMAX, 81.8, 97.5),
226  HFCellParameters (32, 1, 1, 2, 10, HFZMIN1, HFZMAX, 68.6, 81.8),
227  HFCellParameters (32, 2, 1, 2, 10, HFZMIN2, HFZMAX, 68.6, 81.8),
228  HFCellParameters (33, 1, 1, 2, 10, HFZMIN1, HFZMAX, 57.6, 68.6),
229  HFCellParameters (33, 2, 1, 2, 10, HFZMIN2, HFZMAX, 57.6, 68.6),
230  HFCellParameters (34, 1, 1, 2, 10, HFZMIN1, HFZMAX, 48.3, 57.6),
231  HFCellParameters (34, 2, 1, 2, 10, HFZMIN2, HFZMAX, 48.3, 57.6),
232  HFCellParameters (35, 1, 1, 2, 10, HFZMIN1, HFZMAX, 40.6, 48.3),
233  HFCellParameters (35, 2, 1, 2, 10, HFZMIN2, HFZMAX, 40.6, 48.3),
234  HFCellParameters (36, 1, 1, 2, 10, HFZMIN1, HFZMAX, 34.0, 40.6),
235  HFCellParameters (36, 2, 1, 2, 10, HFZMIN2, HFZMAX, 34.0, 40.6),
236  HFCellParameters (37, 1, 1, 2, 10, HFZMIN1, HFZMAX, 28.6, 34.0),
237  HFCellParameters (37, 2, 1, 2, 10, HFZMIN2, HFZMAX, 28.6, 34.0),
238  HFCellParameters (38, 1, 1, 2, 10, HFZMIN1, HFZMAX, 24.0, 28.6),
239  HFCellParameters (38, 2, 1, 2, 10, HFZMIN2, HFZMAX, 24.0, 28.6),
240  HFCellParameters (39, 1, 1, 2, 10, HFZMIN1, HFZMAX, 20.1, 24.0),
241  HFCellParameters (39, 2, 1, 2, 10, HFZMIN2, HFZMAX, 20.1, 24.0),
242  HFCellParameters (40, 1, 3, 4, 20, HFZMIN1, HFZMAX, 16.9, 20.1),
243  HFCellParameters (40, 2, 3, 4, 20, HFZMIN2, HFZMAX, 16.9, 20.1),
244  HFCellParameters (41, 1, 3, 4, 20, HFZMIN1, HFZMAX, 12.5, 16.9),
245  HFCellParameters (41, 2, 3, 4, 20, HFZMIN2, HFZMAX, 12.5, 16.9)
246  };
247  int nCells = sizeof(cells)/sizeof(HFCellParameters);
248  std::vector <HFCellParameters> result;
249  result.reserve (nCells);
250  for (int i = 0; i < nCells; ++i) result.push_back (cells[i]);
251  return result;
252  }
253 
254  //
255  // Convert constants to appropriate cells
256  //
257  void fillHBHO (CaloSubdetectorGeometry* fGeometry, const std::vector <HBHOCellParameters>& fCells, bool fHB) {
258  for (size_t iCell = 0; iCell < fCells.size(); ++iCell) {
259  const HBHOCellParameters& param = fCells[iCell];
260  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
261  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
262  HcalDetId hid (fHB ? HcalBarrel : HcalOuter, param.eta*iside, iPhi, param.depth);
263  double phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell
264  double etaCenter = 0.5*(param.etaMin + param.etaMax);
265  double x = param.rMin* cos (phiCenter);
266  double y = param.rMin* sin (phiCenter);
267  double z = iside * param.rMin * sinh(etaCenter);
268  // make cell geometry
269  GlobalPoint refPoint (x,y,z); // center of the cell's face
270  std::vector<double> cellParams;
271  cellParams.reserve (5);
272  cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); // deta_half
273  cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half
274  cellParams.push_back (0.5 * (param.rMax - param.rMin) * cosh (etaCenter)); // dr_half
275  cellParams.push_back ( fabs( refPoint.eta() ) ) ;
276  cellParams.push_back ( fabs( refPoint.z() ) ) ;
277 
278 // std::cout << "HcalFlexiHardcodeGeometryLoader::fillHBHO-> " << hid << hid.ieta() << '/' << hid.iphi() << '/' << hid.depth()
279 // << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl;
280 
281  CaloCellGeometry* newcell =
282  new calogeom::IdealObliquePrism( refPoint,
283  fGeometry->cornersMgr(),
285  cellParams,
286  fGeometry->parMgr(),
287  fGeometry->parVecVec()));
288  // ... and store it
289  fGeometry->addCell (hid, newcell);
290  }
291  }
292  }
293  }
294 
295  void fillHE (CaloSubdetectorGeometry* fGeometry, const std::vector <HECellParameters>& fCells) {
296  for (size_t iCell = 0; iCell < fCells.size(); ++iCell) {
297  const HECellParameters& param = fCells[iCell];
298  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
299  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
300  HcalDetId hid (HcalEndcap, param.eta*iside, iPhi, param.depth);
301  double phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell
302  double etaCenter = 0.5 * (param.etaMin + param.etaMax);
303 
304  double perp = param.zMin / sinh (etaCenter);
305  double x = perp * cos (phiCenter);
306  double y = perp * sin (phiCenter);
307  double z = iside * param.zMin;
308  // make cell geometry
309  GlobalPoint refPoint (x,y,z); // center of the cell's face
310  std::vector<double> cellParams;
311  cellParams.reserve (5);
312  cellParams.push_back (0.5 * (param.etaMax - param.etaMin)); // deta_half
313  cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half
314  cellParams.push_back (-0.5 * (param.zMax - param.zMin) / tanh (etaCenter)); // dz_half, "-" means edges in Z
315  cellParams.push_back ( fabs( refPoint.eta() ) ) ;
316  cellParams.push_back ( fabs( refPoint.z() ) ) ;
317 
318 // std::cout << "HcalFlexiHardcodeGeometryLoader::fillHE-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl;
319 
320  CaloCellGeometry* newcell =
321  new calogeom::IdealObliquePrism( refPoint,
322  fGeometry->cornersMgr(),
324  cellParams,
325  fGeometry->parMgr(),
326  fGeometry->parVecVec()));
327  // ... and store it
328  fGeometry->addCell (hid, newcell);
329  }
330  }
331  }
332  }
333 
334  void fillHF (CaloSubdetectorGeometry* fGeometry, const std::vector <HFCellParameters>& fCells) {
335  for (size_t iCell = 0; iCell < fCells.size(); ++iCell) {
336  const HFCellParameters& param = fCells[iCell];
337  for (int iPhi = param.phiFirst; iPhi <= MAX_HCAL_PHI; iPhi += param.phiStep) {
338  for (int iside = -1; iside <= 1; iside += 2) { // both detector sides are identical
339  HcalDetId hid (HcalForward, param.eta*iside, iPhi, param.depth);
340  double phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD; // middle of the cell
341  GlobalPoint inner (param.rMin, 0, param.zMin);
342  GlobalPoint outer (param.rMax, 0, param.zMin);
343  double etaCenter = 0.5 * (inner.eta() + outer.eta());
344 
345  double perp = param.zMin / sinh (etaCenter);
346  double x = perp * cos (phiCenter);
347  double y = perp * sin (phiCenter);
348  double z = iside * param.zMin;
349  // make cell geometry
350  GlobalPoint refPoint (x,y,z); // center of the cell's face
351  std::vector<double> cellParams; cellParams.reserve (3);
352  cellParams.push_back (0.5 * (inner.eta() - outer.eta())); // deta_half
353  cellParams.push_back (0.5 * param.dphi * DEGREE2RAD); // dphi_half
354  cellParams.push_back (0.5 * (param.zMax - param.zMin)); // dz_half
355  cellParams.push_back ( fabs( refPoint.eta() ) ) ;
356  cellParams.push_back ( fabs( refPoint.z() ) ) ;
357 
358 // std::cout << "HcalFlexiHardcodeGeometryLoader::fillHF-> " << hid << refPoint << '/' << cellParams [0] << '/' << cellParams [1] << '/' << cellParams [2] << std::endl;
359 
360  CaloCellGeometry* newcell =
361  new calogeom::IdealZPrism( refPoint,
362  fGeometry->cornersMgr(),
364  cellParams,
365  fGeometry->parMgr(),
366  fGeometry->parVecVec()));
367  // ... and store it
368  fGeometry->addCell (hid, newcell);
369  }
370  }
371  }
372  }
373 
374 } // end of local stuff
375 
376 // ==============> Loader Itself <==========================
377 
379 {
380 }
381 
383  CaloSubdetectorGeometry* hcalGeometry = new HcalGeometry (&fTopology);
384  if( 0 == hcalGeometry->cornersMgr() ) hcalGeometry->allocateCorners (
386  if( 0 == hcalGeometry->parMgr() ) hcalGeometry->allocatePar (
389  // ugly kluge to extract H2 mode from the topology
390  if (fTopology.firstHEDoublePhiRing() < 22) { // regular geometry
391  fillHBHO (hcalGeometry, makeHBCells(), true);
392  fillHBHO (hcalGeometry, makeHOCells(), false);
393  fillHF (hcalGeometry, makeHFCells());
394  fillHE (hcalGeometry, makeHECells());
395  }
396  else { // TB geometry
397  fillHBHO (hcalGeometry, makeHBCells(), true);
398  fillHBHO (hcalGeometry, makeHOCells(), false);
399  fillHE (hcalGeometry, makeHECells_H2());
400  }
401  return hcalGeometry;
402 }
403 
404 
405 
int i
Definition: DBlmapReader.cc:9
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T eta() const
void allocatePar(ParVec::size_type n, unsigned int m)
double double double z
void addCell(const DetId &id, CaloCellGeometry *ccg)
Add a cell to the geometry.
tuple result
Definition: query.py:137
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloSubdetectorGeometry * load(const HcalTopology &fTopology)
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:70
#define M_PI
Definition: BFit3D.cc:3
CaloCellGeometry::CornersMgr * cornersMgr()
static const double * getParmPtr(const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
T perp() const
Magnitude of transverse component.
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
Definition: DDAxes.h:10