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