13 const int MAX_HCAL_PHI = 72;
14 const float DEGREE2RAD =
M_PI / 180.;
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)
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)
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)
69 std::vector <HBHOCellParameters> makeHBCells () {
70 const float HBRMIN = 181.1;
71 const float HBRMAX = 288.8;
73 HBHOCellParameters cells [] = {
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)
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]);
102 std::vector <HBHOCellParameters> makeHOCells () {
103 const float HORMIN0 = 390.0;
104 const float HORMIN1 = 412.6;
105 const float HORMAX = 413.6;
107 HBHOCellParameters cells [] = {
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)
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]);
133 std::vector <HECellParameters> makeHECells () {
134 const float HEZMIN = 400.458;
135 const float HEZMID = 436.168;
136 const float HEZMAX = 549.268;
138 HECellParameters cells [] = {
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)
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]);
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;
183 HECellParameters cells [] = {
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)
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]);
215 std::vector <HFCellParameters> makeHFCells () {
216 const float HFZMIN1 = 1115.;
217 const float HFZMIN2 = 1137.;
218 const float HFZMAX = 1280.1;
220 HFCellParameters cells [] = {
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)
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]);
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) {
265 float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD;
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);
272 std::vector<CCGFloat> cellParams;
273 cellParams.reserve (5);
274 cellParams.push_back (0.5 * (param.etaMax - param.etaMin));
275 cellParams.push_back (0.5 * param.dphi * DEGREE2RAD);
276 cellParams.push_back (0.5 * (param.rMax - param.rMin) * cosh (etaCenter));
277 cellParams.push_back ( fabs( refPoint.
eta()));
278 cellParams.push_back ( fabs( refPoint.
z() ) ) ;
283 fGeometry->
newCell( refPoint, refPoint, refPoint,
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) {
300 float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD;
301 float etaCenter = 0.5 * (param.etaMin + param.etaMax);
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;
309 std::vector<CCGFloat> cellParams;
310 cellParams.reserve (5);
311 cellParams.push_back (0.5 * (param.etaMax - param.etaMin));
312 cellParams.push_back (0.5 * param.dphi * DEGREE2RAD);
313 cellParams.push_back (-0.5 * (param.zMax - param.zMin) / tanh (etaCenter));
314 cellParams.push_back ( fabs( refPoint.
eta()));
315 cellParams.push_back ( fabs( refPoint.
z() ) ) ;
319 fGeometry->
newCell( refPoint, refPoint, refPoint,
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) {
336 float phiCenter = ((iPhi-1)*360./MAX_HCAL_PHI + 0.5*param.dphi) * DEGREE2RAD;
339 float iEta = inner.
eta();
340 float oEta = outer.
eta();
341 float etaCenter = 0.5 * ( iEta + oEta );
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;
349 std::vector<CCGFloat> cellParams;
350 cellParams.reserve (5);
351 cellParams.push_back (0.5 * ( iEta - oEta ));
352 cellParams.push_back (0.5 * param.dphi * DEGREE2RAD);
353 cellParams.push_back (0.5 * (param.zMax - param.zMin));
354 cellParams.push_back ( fabs( refPoint.
eta()));
355 cellParams.push_back ( fabs( refPoint.
z() ) ) ;
359 fGeometry->
newCell( refPoint, refPoint, refPoint,
387 fillHBHO (hcalGeometry, makeHBCells(),
true);
388 fillHBHO (hcalGeometry, makeHOCells(),
false);
389 fillHF (hcalGeometry, makeHFCells());
390 fillHE (hcalGeometry, makeHECells());
393 fillHBHO (hcalGeometry, makeHBCells(),
true);
394 fillHBHO (hcalGeometry, makeHOCells(),
false);
395 fillHE (hcalGeometry, makeHECells_H2());
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)
void allocatePar(ParVec::size_type n, unsigned int m)
Cos< T >::type cos(const T &t)
CaloSubdetectorGeometry * load(const HcalTopology &fTopology)
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
int firstHEDoublePhiRing() const
CaloCellGeometry::CornersMgr * cornersMgr()
T perp() const
Magnitude of transverse component.
void allocateCorners(CaloCellGeometry::CornersVec::size_type n)
HcalFlexiHardcodeGeometryLoader()