86 Volume parentVolume = ns.volume(
args.parentName());
87 Volume swedLog = ns.volume(
"esalgo:SWED");
88 Volume sfLog = ns.volume(
"esalgo:SF");
89 Volume sfbxLog = ns.volume(
"esalgo:SFBX");
90 Volume sfbyLog = ns.volume(
"esalgo:SFBY");
93 es.asymLadd =
args.vecDble(
"ASYMETRIC_LADDER");
94 es.typesL5 =
args.vecStr(
"TYPES_OF_LADD_L5");
95 es.typesL4 =
args.vecStr(
"TYPES_OF_LADD_L4");
96 es.laddL5map =
args.vecDble(
"LADD_L5_MAP");
97 es.laddL4map =
args.vecDble(
"LADD_L4_MAP");
98 es.noLaddInCol =
args.vecDble(
"NUMB_OF_LADD_IN_COL");
99 es.startOfFirstLadd =
args.vecDble(
"START_OF_1ST_LADD");
100 es.typeOfLaddRow0 =
args.vecStr(
"TYPE_OF_LADD_1");
101 es.typeOfLaddRow1 =
args.vecStr(
"TYPE_OF_LADD_2");
102 es.typeOfLaddRow2 =
args.vecStr(
"TYPE_OF_LADD_3");
103 es.typeOfLaddRow3 =
args.vecStr(
"TYPE_OF_LADD_4");
104 es.thickLayers =
args.vecDble(
"Layers");
105 es.thickness =
args.dble(
"PRESH_Z_TOTAL");
106 es.materials =
args.vecStr(
"LayMat");
107 es.layName =
args.vecStr(
"LayName");
108 es.rmaxVec =
args.vecDble(
"R_MAX");
109 es.rminVec =
args.vecDble(
"R_MIN");
110 es.waf_intra_col_sep =
args.dble(
"waf_intra_col_sep");
111 es.waf_inter_col_sep =
args.dble(
"waf_inter_col_sep");
112 es.waf_active =
args.dble(
"waf_active");
113 es.wedge_length =
args.dble(
"wedge_length");
114 es.wedge_offset =
args.dble(
"wedge_offset");
115 es.zwedge_ceramic_diff =
args.dble(
"zwedge_ceramic_diff");
116 es.ywedge_ceramic_diff =
args.dble(
"ywedge_ceramic_diff");
117 es.ceramic_length =
args.dble(
"ceramic_length");
118 es.wedge_angle =
args.dble(
"wedge_angle");
119 es.wedge_back_thick =
args.dble(
"wedge_back_thick");
120 es.ladder_thick =
args.dble(
"ladder_thick");
121 es.ladder_width =
args.dble(
"ladder_width");
122 es.micromodule_length =
args.dble(
"micromodule_length");
123 es.box_thick =
args.dble(
"box_thick");
124 es.abs1stx =
args.vecDble(
"1ST_ABSX");
125 es.abs1sty =
args.vecDble(
"1ST_ABSY");
126 es.abs2ndx =
args.vecDble(
"2ND_ABSX");
127 es.abs2ndy =
args.vecDble(
"2ND_ABSY");
128 es.ladPfx =
args.vecStr(
"LadPrefix");
129 es.laddMaterial =
args.str(
"LadderMaterial");
130 es.ldrFrnt_Length =
args.dble(
"LdrFrnt_Length");
131 es.ldrFrnt_Offset =
args.dble(
"LdrFrnt_Offset");
132 es.ldrBck_Length =
args.dble(
"LdrBck_Length");
133 es.ldrBck_Offset =
args.dble(
"LdrBck_Offset");
134 es.dee_separation =
args.dble(
"dee_sep");
135 es.in_rad_Abs_Al =
args.dble(
"R_MIN_Abs_Al");
136 es.in_rad_Abs_Pb =
args.dble(
"R_MIN_Abs_Pb");
137 es.rMax_Abs_Al =
args.dble(
"R_MAX_Abs_Al");
138 es.absAlX_X =
args.dble(
"AbsAlX_X");
139 es.absAlX_Y =
args.dble(
"AbsAlX_Y");
140 es.absAlX_subtr1_Xshift =
args.dble(
"AbsAlX_subtr1_Xshift");
141 es.absAlX_subtr1_Yshift =
args.dble(
"AbsAlX_subtr1_Yshift");
142 es.absAlY_X =
args.dble(
"AbsAlY_X");
143 es.absAlY_Y =
args.dble(
"AbsAlY_Y");
144 es.absAlY_subtr1_Xshift =
args.dble(
"AbsAlY_subtr1_Xshift");
145 es.absAlY_subtr1_Yshift =
args.dble(
"AbsAlY_subtr1_Yshift");
149 double zpos = -es.thickness / 2., sdx(0), sdy(0), bdx(0), bdy(0);
151 for (
size_t i = 0;
i < es.thickLayers.size(); ++
i) {
154 double rIn(0), rOut(0), zHalf(0);
157 const string& ddname(
"esalgo:" + es.layName[
i]);
161 rOut = es.rmaxVec[
i];
162 zHalf = es.thickLayers[
i] / 2.;
165 Solid solid = ns.addSolid(ddname, Tube(ddname, rIn, rOut, zHalf, 0., 360._deg));
177 if (
I == 2 ||
I == 28 ||
I == 13 ||
I == 23) {
183 es.zlead1 = zpos + zHalf;
186 es.zlead2 = zpos + zHalf;
189 if (
I == 10 ||
I == 20) {
192 double outalbx, outalby, shiftR, outalbx2, outalby2, shiftR2;
194 absz =
int(es.abs1stx.size());
196 absz =
int(es.abs2ndx.size());
200 const string& dd_tmp_name_b(
"esalgo:" + es.layName[
i] +
"Lcut");
201 const string& dd_tmp_name_c(
"esalgo:" + es.layName[
i] +
"tmpb");
202 const string& dd_tmp_name_d(
"esalgo:" + es.layName[
i] +
"LinPb");
203 const string& dd_tmp_name_e(
"esalgo:" + es.layName[
i] +
"LinAl");
204 const string& dd_tmp_name_f(
"esalgo:" + es.layName[
i] +
"LOutAl");
206 const string& dd_Alname_f(
"esalgo:" + es.layName[
i] +
"LOutAl");
207 const string& dd_Alname_g(
"esalgo:" + es.layName[
i] +
"LOutAl2");
208 const string& dd_Alname_h(
"esalgo:" + es.layName[
i] +
"LOutAltmp");
209 const string& dd_Alname_i(
"esalgo:" + es.layName[
i] +
"LOutAltmp2");
210 const string& dd_Alname_j(
"esalgo:" + es.layName[
i] +
"LOutAltmp3");
211 const string& dd_Alname_k(
"esalgo:" + es.layName[
i] +
"LOutAltmp4");
212 const string& dd_Alname_l(
"esalgo:" + es.layName[
i] +
"LOutAltmp5");
213 const string& dd_Alname_m(
"esalgo:" + es.layName[
i] +
"LOutAltmp6");
215 Solid outAl = ns.addSolid(
216 dd_Alname_f, Tube(dd_Alname_f, es.rMax_Abs_Al - 70 * dd4hep::cm, es.rMax_Abs_Al, zHalf, 0., 90._deg));
223 outalbx = es.absAlX_X * 0.1;
224 outalby = es.rMax_Abs_Al + 0.1 * dd4hep::mm - es.absAlX_subtr1_Yshift;
225 shiftR = es.absAlX_subtr1_Yshift;
227 outalbx = es.absAlY_X * 0.1;
228 outalby = es.rMax_Abs_Al + 0.1 * dd4hep::mm - es.absAlY_subtr1_Yshift;
229 shiftR = es.absAlY_subtr1_Xshift;
231 Solid outAltmp = ns.addSolid(dd_Alname_h,
233 outalbx / 2. + 0.1 * dd4hep::mm,
234 outalby / 2. + 0.1 * dd4hep::mm,
235 zHalf + 0.1 * dd4hep::mm));
236 Solid outAltmp3 = ns.addSolid(
238 SubtractionSolid(dd_Alname_j, outAl, outAltmp,
Position(outalbx / 2., outalby / 2. + shiftR, 0)));
243 edm::LogVerbatim(
"SFGeomX") << dd_Alname_j <<
" Subtraction " << outAl.name() <<
":" << outAltmp.name()
249 outalby2 = es.absAlX_Y * 0.1;
250 outalbx2 = es.rMax_Abs_Al + 0.1 * dd4hep::mm - es.absAlX_subtr1_Xshift;
251 shiftR2 = es.absAlX_subtr1_Xshift;
253 outalby2 = es.absAlY_Y * 0.1;
254 outalbx2 = es.rMax_Abs_Al + 0.1 * dd4hep::mm - es.absAlY_subtr1_Xshift;
255 shiftR2 = es.absAlY_subtr1_Xshift;
257 Solid outAltmp2 = ns.addSolid(dd_Alname_i,
259 outalbx2 / 2. + 0.1 * dd4hep::mm,
260 outalby2 / 2. + 0.1 * dd4hep::mm,
261 zHalf + 0.1 * dd4hep::mm));
262 Solid outAltmp4 = ns.addSolid(
264 SubtractionSolid(dd_Alname_k, outAltmp3, outAltmp2,
Position(outalbx2 / 2. + shiftR2, outalby2 / 2., 0)));
266 ns.addSolid(dd_Alname_l, UnionSolid(dd_Alname_l, outAltmp4, outAltmp4, ns.rotation(
"esalgo:RABS90")));
268 ns.addSolid(dd_Alname_m, UnionSolid(dd_Alname_m, outAltmp5, outAltmp4, ns.rotation(
"esalgo:RABS180B")));
270 ns.addSolid(dd_Alname_g, UnionSolid(dd_Alname_g, outAltmp6, outAltmp4, ns.rotation(
"esalgo:R180")));
272 Solid outAlCut = Box(65 * dd4hep::cm, 60 * dd4hep::cm - 0.1 * dd4hep::mm, zHalf + 0.2 * dd4hep::mm);
273 Solid outAlFin = SubtractionSolid(outAl2, outAlCut);
278 edm::LogVerbatim(
"SFGeomX") << dd_Alname_k <<
" Subtraction " << outAltmp3.name() <<
":" << outAltmp2.name()
281 edm::LogVerbatim(
"SFGeomX") << dd_Alname_l <<
" Union " << outAltmp4.name() <<
":" << outAltmp4.name()
282 <<
" at (0,0,0) rotation esalgo:RABS90";
283 edm::LogVerbatim(
"SFGeomX") << dd_Alname_m <<
" Union " << outAltmp5.name() <<
":" << outAltmp4.name()
284 <<
" at (0,0,0) rotation esalgo:RABS180B";
285 edm::LogVerbatim(
"SFGeomX") << dd_Alname_g <<
" Union " << outAltmp6.name() <<
":" << outAltmp4.name()
286 <<
" at (0,0,0) rotation esalgo:R180";
290 edm::LogVerbatim(
"SFGeomX") << outAlFin.name() <<
" Subtraction " << outAl2.name() <<
":" << outAlCut.name()
291 <<
" at (0,0,0) no rotation";
293 Volume layerFinOutAl =
Volume(dd_tmp_name_f, outAlFin, ns.material(es.materials[
i - 1]));
295 for (
int L = 0;
L < absz; ++
L) {
297 ostringstream tmp_name_b, tmp_name_b2, tmp_FAl_name_c, tmp_FAl_name_d1, tmp_FAl_name_d2, tmp_FAl_name_d3,
299 tmp_name_b << es.layName[
i] <<
"L" << K;
300 tmp_name_b2 << es.layName[
i] <<
"Lb2" << K;
303 tmp_FAl_name_c << es.layName[
i] <<
"LOutAl2";
305 tmp_FAl_name_c << es.layName[
i] <<
"LtmpAl" << K - 1;
307 tmp_FAl_name_d1 << es.layName[
i] <<
"LtmpAl" << K <<
"_1";
308 tmp_FAl_name_d2 << es.layName[
i] <<
"LtmpAl" << K <<
"_2";
309 tmp_FAl_name_d3 << es.layName[
i] <<
"LtmpAl" << K <<
"_3";
310 tmp_FAl_name_d << es.layName[
i] <<
"LtmpAl" << K;
312 const string& dd_tmp_name_b(
"esalgo:" + tmp_name_b.str());
313 const string& dd_tmp_name_b2(
"esalgo:" + tmp_name_b2.str());
314 const string& dd_FAl_name_c(
"esalgo:" + tmp_FAl_name_c.str());
315 const string& dd_FAl_name_d1(
"esalgo:" + tmp_FAl_name_d1.str());
316 const string& dd_FAl_name_d2(
"esalgo:" + tmp_FAl_name_d2.str());
317 const string& dd_FAl_name_d3(
"esalgo:" + tmp_FAl_name_d3.str());
318 const string& dd_FAl_name_d(
"esalgo:" + tmp_FAl_name_d.str());
321 bdx =
abs(es.abs1stx[K]) / 2.;
323 bdx =
abs(es.abs1stx[K] - es.abs1stx[K - 1]) / 2.;
325 if (es.abs1stx[K] < rIn + 30 * dd4hep::cm) {
326 bdy = es.abs1sty[K] / 2. - 30 * dd4hep::cm;
332 bdx =
abs(es.abs2ndx[K]) / 2.;
334 bdx =
abs(es.abs2ndx[K] - es.abs2ndx[K - 1]) / 2.;
338 if ((es.abs2ndx[K] < rIn + 30 * dd4hep::cm) &&
I == 20) {
339 bdy = es.abs2ndy[K] / 2. - 30 * dd4hep::cm;
343 Solid solid_b = Box(dd_tmp_name_b, bdx, bdy, zHalf);
344 Solid solid_b2 = Box(dd_tmp_name_b2, bdx + 0.1 * dd4hep::mm, bdy + 0.1 * dd4hep::mm, zHalf);
351 sdx = es.abs1stx[K] - bdx;
353 if (es.abs1stx[K] < rIn + 30 * dd4hep::cm)
354 sdy = es.abs1sty[K] - bdy;
357 sdx = es.abs2ndx[K] - bdx;
360 if ((es.abs2ndx[K] < rIn + 30 * dd4hep::cm) &&
I == 20)
361 sdy = es.abs2ndy[K] - bdy;
374 Solid solid_c = ns.solid(dd_FAl_name_c);
375 Solid solid_d1 = UnionSolid(dd_FAl_name_d1, solid_c, solid_b2,
Position(sdx, sdy, 0));
377 ns.addSolid(dd_FAl_name_d, UnionSolid(dd_FAl_name_d, solid_d1, solid_b2,
Position(-sdx, -sdy, 0)));
379 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d1 <<
" Union " << solid_c.name() <<
":" << solid_b2.name()
381 <<
",0) no rotation";
382 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d <<
" Union " << solid_d1.name() <<
":" << solid_b2.name()
384 <<
",0) no rotation";
387 if (((es.abs1stx[K] < rIn + 30 * dd4hep::cm) &&
I == 10) ||
388 ((es.abs2ndx[K] < rIn + 30 * dd4hep::cm) &&
I == 20)) {
390 layerFinOutAl.placeVolume(
layer, 4,
Position(-sdx, -sdy, 0));
398 Solid solid_c = ns.solid(dd_FAl_name_c);
399 Solid solid_d1 = UnionSolid(dd_FAl_name_d1, solid_c, solid_b2,
Position(sdx, sdy, 0));
400 ns.addSolid(dd_FAl_name_d2, UnionSolid(dd_FAl_name_d2, solid_d1, solid_b2,
Position(sdx, -sdy, 0)));
401 Solid solid_d3 = UnionSolid(dd_FAl_name_d3, solid_d2, solid_b2,
Position(-sdx, sdy, 0));
402 ns.addSolid(dd_FAl_name_d, UnionSolid(dd_FAl_name_d, solid_d3, solid_b2,
Position(-sdx, -sdy, 0)));
404 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d1 <<
" Union " << solid_c.name() <<
":" << solid_b2.name()
406 <<
",0) no rotation";
407 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d2 <<
" Union " << solid_d1.name() <<
":" << solid_b2.name()
409 <<
",0) no rotation";
410 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d3 <<
" Union " << solid_d2.name() <<
":" << solid_b2.name()
412 <<
",0) no rotation";
413 edm::LogVerbatim(
"SFGeomX") << dd_FAl_name_d <<
" Union " << solid_d3.name() <<
":" << solid_b2.name()
415 <<
",0) no rotation";
420 bdx = es.abs1stx[cutabsx];
422 bdx = es.abs2ndx[cutabsy];
423 bdy = 2 * 30 * dd4hep::cm;
425 Solid solidcut = Box(dd_tmp_name_b, bdx, bdy, zHalf);
426 Solid iner = Tube(dd_tmp_name_c, 0, es.in_rad_Abs_Pb, zHalf + 0.1 * dd4hep::mm, 0., 360._deg);
427 Solid
final = SubtractionSolid(dd_tmp_name_d, solidcut, iner);
433 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_d <<
" Subtraction " << solidcut.name() <<
":" << iner.name()
434 <<
" at (0,0,0) no rotation";
437 Volume blayer =
Volume(dd_tmp_name_d,
final, ns.material(es.materials[
i]));
438 parentVolume.placeVolume(blayer, 1,
Position(0, 0, zpos));
440 edm::LogVerbatim(
"SFGeom") << blayer.name() <<
" copy 1 in " << parentVolume.name() <<
" at (0,0,"
445 Tube(dd_tmp_name_e, es.in_rad_Abs_Al, es.in_rad_Abs_Pb - 0.01 * dd4hep::mm, zHalf, 0., 360._deg);
451 Volume layerAl =
Volume(dd_tmp_name_e, iner_Al, ns.material(es.materials[
i - 1]));
452 parentVolume.placeVolume(layerAl, 1,
Position(0, 0, zpos));
453 parentVolume.placeVolume(layerFinOutAl, 1,
Position(0, 0, zpos));
455 edm::LogVerbatim(
"SFGeom") << layerAl.name() <<
" copy 1 in " << parentVolume.name() <<
" at (0,0,"
457 edm::LogVerbatim(
"SFGeom") << layerFinOutAl.name() <<
" copy 1 in " << parentVolume.name() <<
" at (0,0,"
472 double xpos(0.), ypos(0.), zpos(0.), sdx(0.), sdy(0.), sdz(0.);
473 double prev_length(0.), ladder_new_length(0.);
474 double ladd_shift(0.);
475 double ladder_length(0.);
476 int enb(0), swed_scopy_glob(0);
477 double sdxe[50] = {0}, sdye[50] = {0}, sdze[50] = {0};
478 double sdxe2[50] = {0}, sdye2[50] = {0}, sdze2[50] = {0}, sdxe3[50] = {0}, sdye3[50] = {0}, sdze3[50] = {0};
480 for (
int M = 0; M <
int(es.typesL5.size() + es.typesL4.size()); M++) {
482 double boxax(0.), boxay(0.), boxaz(0.);
483 int ladd_not_plain(0), ladd_subtr_no(0), ladd_upper(0), ladd_side(0);
484 Solid solid_lfront = Trap(
"esalgo:LDRFRNT",
485 es.ldrFrnt_Length / 2.,
488 es.ladder_width / 2.,
489 (es.ladder_thick) / 2.,
490 (es.ladder_thick) / 2.,
492 es.ladder_width / 2.,
493 (es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.,
494 (es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.,
497 Solid solid_lbck = Trap(
"esalgo:LDRBCK",
498 es.ldrBck_Length / 2.,
501 es.ladder_width / 2.,
502 (es.box_thick /
cos(es.wedge_angle * 2) + 0.02 * dd4hep::mm) / 2.,
503 (es.box_thick /
cos(es.wedge_angle * 2) + 0.02 * dd4hep::mm) / 2.,
505 es.ladder_width / 2.,
506 (es.ladder_thick - es.wedge_back_thick) / 2.,
507 (es.ladder_thick - es.wedge_back_thick) / 2.,
510 Solid solid_lfhalf = Trap(
"esalgo:LDRFHALF",
511 es.ldrFrnt_Length / 2.,
514 (es.ladder_width / 2.) / 2.,
515 (es.ladder_thick) / 2.,
516 (es.ladder_thick) / 2.,
518 (es.ladder_width / 2.) / 2.,
519 (es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.,
520 (es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.,
523 Solid solid_lbhalf = Trap(
"esalgo:LDRBHALF",
524 es.ldrBck_Length / 2.,
527 (es.ladder_width / 2.) / 2.,
528 (es.box_thick /
cos(es.wedge_angle * 2.) + 0.02 * dd4hep::mm) / 2.,
529 (es.box_thick /
cos(es.wedge_angle * 2.) + 0.02 * dd4hep::mm) / 2.,
531 (es.ladder_width / 2.) / 2.,
532 (es.ladder_thick - es.wedge_back_thick) / 2.,
533 (es.ladder_thick - es.wedge_back_thick) / 2.,
536 Solid solid_lfhtrunc =
537 Trap(
"esalgo:LDRFHTR",
538 (es.ldrFrnt_Length - es.waf_active) / 2.,
541 (es.ladder_width / 2.) / 2.,
542 (es.ladder_thick) / 2.,
543 (es.ladder_thick) / 2.,
545 (es.ladder_width / 2.) / 2.,
546 (es.ladder_thick - (es.ceramic_length - es.waf_active) *
sin(es.wedge_angle * 2)) / 2.,
547 (es.ladder_thick - (es.ceramic_length - es.waf_active) *
sin(es.wedge_angle * 2)) / 2.,
551 <<
"esalgo:LDRFRNT Trap " <<
cms::convert2mm(es.ldrFrnt_Length / 2.) <<
":"
555 <<
cms::convert2mm((es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.) <<
":"
556 <<
cms::convert2mm((es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.) <<
":0";
564 <<
cms::convert2mm((es.ladder_thick - es.wedge_back_thick) / 2.) <<
":"
565 <<
cms::convert2mm((es.ladder_thick - es.wedge_back_thick) / 2.) <<
":0";
567 <<
"esalgo:LDRFHALF Trap " <<
cms::convert2mm(es.ldrFrnt_Length / 2.) <<
":"
571 <<
cms::convert2mm((es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.) <<
":"
572 <<
cms::convert2mm((es.ladder_thick - es.ceramic_length *
sin(es.wedge_angle * 2.)) / 2.) <<
":0";
576 <<
cms::convert2mm((es.box_thick /
cos(es.wedge_angle * 2.) + 0.02 * dd4hep::mm) / 2.)
578 <<
cms::convert2mm((es.box_thick /
cos(es.wedge_angle * 2.) + 0.02 * dd4hep::mm) / 2.)
580 <<
cms::convert2mm((es.ladder_thick - es.wedge_back_thick) / 2.) <<
":"
581 <<
cms::convert2mm((es.ladder_thick - es.wedge_back_thick) / 2.) <<
":0";
583 <<
"esalgo:LDRFHTR Trap " <<
cms::convert2mm((es.ldrFrnt_Length - es.waf_active) / 2.) <<
":"
587 <<
cms::convert2mm((es.ladder_thick - (es.ceramic_length - es.waf_active) *
sin(es.wedge_angle * 2)) / 2.)
589 <<
cms::convert2mm((es.ladder_thick - (es.ceramic_length - es.waf_active) *
sin(es.wedge_angle * 2)) / 2.)
595 if (M <
int(es.typesL5.size())) {
596 for (
int i = 0;
i <= 1;
i++) {
597 for (
int j = 0;
j <= 3;
j++) {
598 if (es.laddL5map[(
i +
j * 2 + M * 10)] != 1) {
608 edm::LogVerbatim(
"SFGeomX") <<
"Side " << ladd_side <<
":" << ladd_upper <<
":" << ladd_subtr_no <<
":"
609 << ladd_not_plain <<
" Index " << M <<
":" << es.typesL5.size();
611 const string& ddname(
"esalgo:" + es.ladPfx[0] + es.typesL5[M]);
612 ladder_length = es.micromodule_length + 4 * es.waf_active + 0.1 * dd4hep::mm;
614 if (ladd_not_plain) {
617 const string& dd_tmp_name_5a(
"esalgo:" + es.ladPfx[2]);
618 const string& dd_tmp_name_5b(
"esalgo:" + es.ladPfx[3] + to_string(enb));
619 const string& dd_tmp_name_5c(
"esalgo:" + es.ladPfx[4] + to_string(enb));
621 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
622 boxax = es.ladder_width;
623 boxaz = es.ladder_thick;
625 Solid solid_5a = Box(dd_tmp_name_5a, boxax / 2., boxay / 2., boxaz / 2.);
631 sdxe[enb] = es.ladder_width / 4.;
632 sdye[enb] = -boxay / 2. - es.ldrFrnt_Length / 2.;
633 sdze[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
635 sdxe[enb] = -es.ladder_width / 4.;
638 UnionSolid(dd_tmp_name_5b,
641 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe[enb], sdye[enb], sdze[enb])));
643 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_5b <<
" Union " << solid_5a.name() <<
":" << solid_lfhalf.name()
649 sdxe2[enb] = -es.ladder_width / 4.;
650 sdye2[enb] = -boxay / 2. - es.ldrFrnt_Length / 2. + es.waf_active / 2.;
651 sdze2[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset + (es.waf_active *
sin(es.wedge_angle * 2)) / 4.;
653 sdxe2[enb] = es.ladder_width / 4.;
656 UnionSolid(dd_tmp_name_5c,
659 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
661 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_5c <<
" Union " << solid_5b.name() <<
":"
662 << solid_lfhtrunc.name() <<
" at (" <<
cms::convert2mm(sdxe2[enb]) <<
","
664 <<
") rotation esalgo:RM1299";
668 sdye3[enb] = boxay / 2. + es.ldrBck_Length / 2.;
669 sdze3[enb] = -es.ladder_thick / 2. + es.ldrBck_Offset;
674 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe3[enb], sdye3[enb], sdze3[enb])));
676 edm::LogVerbatim(
"SFGeomX") << ddname <<
" Union " << solid_5c.name() <<
":" << solid_lbck.name() <<
" at ("
681 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
682 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL5[M], solid, ns.material(es.laddMaterial)));
686 const string& dd_tmp_name_5pa(
"esalgo:" + es.ladPfx[2] +
"5p");
687 const string& dd_tmp_name_5pb(
"esalgo:" + es.ladPfx[3] +
"5p");
689 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
690 boxax = es.ladder_width;
691 boxaz = es.ladder_thick;
693 Solid solid_5pa = Box(dd_tmp_name_5pa, boxax / 2., boxay / 2., boxaz / 2.);
699 sdy = -boxay / 2. - es.ldrFrnt_Length / 2.;
700 sdz = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
702 Solid solid_5pb = UnionSolid(dd_tmp_name_5pb,
705 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdx, sdy, sdz)));
707 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_5pb <<
" Union " << solid_5pa.name() <<
":" << solid_lfront.name()
713 sdy = boxay / 2. + es.ldrBck_Length / 2.;
714 sdz = -es.ladder_thick / 2. + es.ldrBck_Offset;
716 Solid solid = UnionSolid(
717 ddname, solid_5pb, solid_lbck, Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdx, sdy, sdz)));
719 edm::LogVerbatim(
"SFGeomX") << ddname <<
" Union " << solid_5pb.name() <<
":" << solid_lbck.name() <<
" at ("
723 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
724 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL5[M], solid, ns.material(es.laddMaterial)));
730 if (M >=
int(es.typesL5.size())) {
731 int d = M - es.typesL5.size();
733 for (
int i = 0;
i <= 1;
i++) {
734 for (
int j = 0;
j <= 3;
j++) {
735 if (es.laddL4map[(
i +
j * 2 + (M - es.typesL5.size()) * 8)] != 1) {
745 edm::LogVerbatim(
"SFGeomX") <<
"Side " << ladd_side <<
":" << ladd_upper <<
":" << ladd_subtr_no <<
":"
746 << ladd_not_plain <<
" Index " << M <<
":" << es.typesL5.size();
748 const string& ddname(
"esalgo:" + es.ladPfx[0] + es.typesL4[
d]);
749 ladder_length = es.micromodule_length + 3 * es.waf_active + 0.1 * dd4hep::mm;
751 if (ladd_not_plain) {
755 const string& dd_tmp_name_a(
"esalgo:" + es.ladPfx[7]);
756 const string& dd_tmp_name_b(
"esalgo:" + es.ladPfx[8] + to_string(enb));
758 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
759 boxax = es.ladder_width;
760 boxaz = es.ladder_thick;
761 Solid solid_a = Box(dd_tmp_name_a, boxax / 2., boxay / 2., boxaz / 2.);
768 sdye[enb] = -boxay / 2. - es.ldrFrnt_Length / 2.;
769 sdze[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
771 UnionSolid(dd_tmp_name_b,
774 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe[enb], sdye[enb], sdze[enb])));
776 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_b <<
" Union " << solid_a.name() <<
":" << solid_lfront.name()
782 sdxe2[enb] = es.ladder_width / 4.;
783 sdye2[enb] = boxay / 2. + es.ldrBck_Length / 2.;
784 sdze2[enb] = -es.ladder_thick / 2. + es.ldrBck_Offset;
786 sdxe2[enb] = -es.ladder_width / 4.;
791 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
793 edm::LogVerbatim(
"SFGeomX") << ddname <<
" Union " << solid_b.name() <<
":" << solid_lbhalf.name()
798 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
799 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL4[
d], solid, ns.material(es.laddMaterial)));
803 if (ladd_subtr_no > 1) {
806 const string& dd_tmp_name_a(
"esalgo:" + es.ladPfx[7]);
807 const string& dd_tmp_name_b(
"esalgo:" + es.ladPfx[8] + to_string(enb));
809 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
810 boxax = es.ladder_width;
811 boxaz = es.ladder_thick;
813 Solid solid_a = Box(dd_tmp_name_a, boxax / 2., boxay / 2., boxaz / 2.);
819 sdxe[enb] = es.ladder_width / 4.;
820 sdye[enb] = -boxay / 2. - es.ldrFrnt_Length / 2.;
821 sdze[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
823 sdxe[enb] = -es.ladder_width / 4.;
826 UnionSolid(dd_tmp_name_b,
829 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe[enb], sdye[enb], sdze[enb])));
831 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_b <<
" Union " << solid_a.name() <<
":" << solid_lfhalf.name()
837 sdye2[enb] = boxay / 2. + es.ldrBck_Length / 2.;
838 sdze2[enb] = -es.ladder_thick / 2. + es.ldrBck_Offset;
844 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
847 << ddname <<
" Union " << solid_b.name() <<
":" << solid_lbck.name() <<
" at ("
852 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
853 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL4[
d], solid, ns.material(es.laddMaterial)));
856 const string& dd_tmp_name_a(
"esalgo:" + es.ladPfx[7]);
857 const string& dd_tmp_name_b(
"esalgo:" + es.ladPfx[8] + to_string(enb));
858 const string& dd_tmp_name_c(
"esalgo:" + es.ladPfx[9] + to_string(enb));
860 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
861 boxax = es.ladder_width;
862 boxaz = es.ladder_thick;
863 Solid solid_a = Box(dd_tmp_name_a, boxax / 2., boxay / 2., boxaz / 2.);
869 sdxe[enb] = es.ladder_width / 4.;
870 sdye[enb] = -boxay / 2. - es.ldrFrnt_Length / 2.;
871 sdze[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
873 sdxe[enb] = -es.ladder_width / 4.;
876 UnionSolid(dd_tmp_name_b,
879 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe[enb], sdye[enb], sdze[enb])));
881 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_b <<
" Union " << solid_a.name() <<
":" << solid_lfhalf.name()
887 sdxe2[enb] = -es.ladder_width / 4.;
888 sdye2[enb] = -boxay / 2. - es.ldrFrnt_Length / 2. + es.waf_active / 2.;
889 sdze2[enb] = -es.ladder_thick / 2. + es.ldrFrnt_Offset + (es.waf_active *
sin(es.wedge_angle * 2)) / 4.;
891 sdxe2[enb] = es.ladder_width / 4.;
894 UnionSolid(dd_tmp_name_c,
897 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
900 << dd_tmp_name_c <<
" Union " << solid_b.name() <<
":" << solid_lfhtrunc.name() <<
" at ("
906 sdye3[enb] = boxay / 2. + es.ldrBck_Length / 2.;
907 sdze3[enb] = -es.ladder_thick / 2. + es.ldrBck_Offset;
912 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdxe3[enb], sdye3[enb], sdze3[enb])));
915 << ddname <<
" Union " << solid_c.name() <<
":" << solid_lbck.name() <<
" at ("
920 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
921 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL4[
d], solid, ns.material(es.laddMaterial)));
926 const string& dd_tmp_name_pa(
"esalgo:" + es.ladPfx[2] +
"p");
927 const string& dd_tmp_name_pb(
"esalgo:" + es.ladPfx[3] +
"p");
929 boxay = ladder_length - es.ldrFrnt_Length - es.ldrBck_Length;
930 boxax = es.ladder_width;
931 boxaz = es.ladder_thick;
933 Solid solid_pa = Box(dd_tmp_name_pa, boxax / 2., boxay / 2., boxaz / 2.);
939 sdy = -boxay / 2. - es.ldrFrnt_Length / 2.;
940 sdz = -es.ladder_thick / 2. + es.ldrFrnt_Offset;
942 Solid solid_pb = UnionSolid(dd_tmp_name_pb,
945 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdx, sdy, sdz)));
947 edm::LogVerbatim(
"SFGeomX") << dd_tmp_name_pb <<
" Union " << solid_pa.name() <<
":" << solid_lfront.name()
953 sdy = boxay / 2. + es.ldrBck_Length / 2.;
954 sdz = -es.ladder_thick / 2. + es.ldrBck_Offset;
955 Solid solid = UnionSolid(
956 ddname, solid_pb, solid_lbck, Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(sdx, sdy, sdz)));
958 edm::LogVerbatim(
"SFGeomX") << ddname <<
" Union " << solid_pb.name() <<
":" << solid_lbck.name() <<
" at ("
962 ns.addVolumeNS(
Volume(ddname, solid, ns.material(es.laddMaterial)));
963 ns.addVolumeNS(
Volume(
"esalgo:" + es.ladPfx[1] + es.typesL4[
d], solid, ns.material(es.laddMaterial)));
969 if (M <
int(es.typesL5.size())) {
970 const string& ddname(
"esalgo:" + es.ladPfx[0] + es.typesL5[M]);
971 const string& ddname2(
"esalgo:" + es.ladPfx[1] + es.typesL5[M]);
972 for (
int i = 0;
i <= 1;
i++) {
973 for (
int j = 0;
j <= 4;
j++) {
974 xpos = (
i * 2 - 1) * es.waf_intra_col_sep / 2.;
975 ypos = -ladder_length / 2. + 0.05 * dd4hep::mm - (es.ldrFrnt_Length - es.ldrBck_Length) / 2. +
976 es.wedge_length / 2. +
j * es.waf_active;
977 zpos = -es.ladder_thick / 2. + 0.005 * dd4hep::mm + es.wedge_offset;
978 if (es.laddL5map[(
i +
j * 2 + M * 10)] == 1) {
980 ns.volume(ddname).placeVolume(swedLog,
981 scopy + 1000 * swed_scopy_glob,
982 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(xpos, ypos, zpos)));
983 ns.volume(ddname2).placeVolume(swedLog,
984 scopy + 1000 * swed_scopy_glob + 100,
985 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(xpos, ypos, zpos)));
987 edm::LogVerbatim(
"SFGeom") << swedLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
990 edm::LogVerbatim(
"SFGeom") << swedLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob + 100)
993 <<
") rotation esalgo:RM1299";
996 ypos = ypos + es.ywedge_ceramic_diff;
997 zpos = -es.ladder_thick / 2. + 0.005 * dd4hep::mm + es.zwedge_ceramic_diff;
998 ns.volume(ddname).placeVolume(sfbxLog,
999 scopy + 1000 * swed_scopy_glob,
1000 Transform3D(ns.rotation(
"esalgo:RM1298"),
Position(xpos, ypos, zpos)));
1001 ns.volume(ddname2).placeVolume(sfbyLog,
1002 scopy + 1000 * swed_scopy_glob,
1003 Transform3D(ns.rotation(
"esalgo:RM1300A"),
Position(xpos, ypos, zpos)));
1005 edm::LogVerbatim(
"SFGeom") << sfbxLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
1008 edm::LogVerbatim(
"SFGeom") << sfbyLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
1016 int d = M - es.typesL5.size();
1017 const string& ddname(
"esalgo:" + es.ladPfx[0] + es.typesL4[
d]);
1018 const string& ddname2(
"esalgo:" + es.ladPfx[1] + es.typesL4[
d]);
1019 for (
int i = 0;
i <= 1;
i++) {
1020 for (
int j = 0;
j <= 3;
j++) {
1021 xpos = (
i * 2 - 1) * es.waf_intra_col_sep / 2.;
1022 ypos = -ladder_length / 2. + 0.05 * dd4hep::mm - (es.ldrFrnt_Length - es.ldrBck_Length) / 2. +
1023 es.wedge_length / 2. +
j * es.waf_active;
1024 zpos = -es.ladder_thick / 2. + 0.005 * dd4hep::mm + es.wedge_offset;
1025 if (es.laddL4map[(
i +
j * 2 + (M - es.typesL5.size()) * 8)] == 1) {
1027 ns.volume(ddname).placeVolume(swedLog,
1028 scopy + 1000 * swed_scopy_glob,
1029 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(xpos, ypos, zpos)));
1030 ns.volume(ddname2).placeVolume(swedLog,
1031 scopy + 1000 * swed_scopy_glob + 100,
1032 Transform3D(ns.rotation(
"esalgo:RM1299"),
Position(xpos, ypos, zpos)));
1034 edm::LogVerbatim(
"SFGeom") << swedLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
1037 edm::LogVerbatim(
"SFGeom") << swedLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob + 100)
1040 <<
") rotation esalgo:RM1299";
1043 ypos = ypos + es.ywedge_ceramic_diff;
1044 zpos = -es.ladder_thick / 2. + 0.005 * dd4hep::mm + es.zwedge_ceramic_diff;
1045 ns.volume(ddname).placeVolume(sfbxLog,
1046 scopy + 1000 * swed_scopy_glob,
1047 Transform3D(ns.rotation(
"esalgo:RM1298"),
Position(xpos, ypos, zpos)));
1048 ns.volume(ddname2).placeVolume(sfbyLog,
1049 scopy + 1000 * swed_scopy_glob,
1050 Transform3D(ns.rotation(
"esalgo:RM1300A"),
Position(xpos, ypos, zpos)));
1052 edm::LogVerbatim(
"SFGeom") << sfbxLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
1055 edm::LogVerbatim(
"SFGeom") << sfbyLog.name() <<
" copy " << (scopy + 1000 * swed_scopy_glob) <<
" in "
1066 int icopy[100] = {0};
1067 constexpr
int sz = 20;
1069 for (
int I = -9;
I <= 9; ++
I) {
1072 for (
int K = 0; K < es.noLaddInCol[J]; K++) {
1075 ladder_new_length = es.micromodule_length + 3. * es.waf_active;
1076 ladd_shift = 4. * es.waf_active;
1079 type = es.typeOfLaddRow0[J];
1081 type = es.typeOfLaddRow1[J];
1083 type = es.typeOfLaddRow2[J];
1085 type = es.typeOfLaddRow3[J];
1087 for (
const auto&
i : es.typesL5)
1089 ladder_new_length = es.micromodule_length + 4. * es.waf_active;
1090 ladd_shift = 5. * es.waf_active;
1095 for (
int t = 0;
t <
int(es.typesL5.size());
t++)
1096 if (
type == es.typesL5[
t]) {
1098 if (
I < 0 && es.asymLadd[
t] == 1) {
1100 type = es.typesL5[
j];
1103 for (
int t = 0;
t <
int(es.typesL4.size());
t++)
1104 if (
type == es.typesL4[
t]) {
1105 j =
t + es.typesL5.size();
1106 if (
I < 0 && es.asymLadd[(
t + es.typesL5.size())] == 1) {
1108 type = es.typesL4[
j - es.typesL5.size()];
1112 xpos =
I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
1114 xpos = xpos + es.dee_separation;
1116 xpos = xpos - es.dee_separation;
1118 ypos = (sz -
int(es.startOfFirstLadd[J])) * es.waf_active - ladder_new_length / 2. +
1119 (es.ldrFrnt_Length - es.ldrBck_Length) / 2. + es.micromodule_length + 0.05 * dd4hep::cm - prev_length;
1121 prev_length += ladd_shift;
1123 zpos = es.zlead1 + es.ladder_thick / 2. + 0.01 * dd4hep::mm;
1126 sfLog.placeVolume(ns.volume(
"esalgo:" + es.ladPfx[0] +
type), icopy[
j],
Position(xpos, ypos, zpos));
1133 xpos =
I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
1134 sfLog.placeVolume(ns.volume(
"esalgo:" + es.ladPfx[1] +
type),
1136 Transform3D(ns.rotation(
"esalgo:R270"),
Position(ypos, -xpos, zpos - es.zlead1 + es.zlead2)));
1140 <<
"," <<
cms::convert2mm(zpos - es.zlead1 + es.zlead2) <<
") rotation esalgo:R270";
1144 for (
int t = 0;
t <
int(es.typesL5.size());
t++)
1145 if (
type == es.typesL5[
t]) {
1147 if (es.asymLadd[
t] == 2 && !changed) {
1151 if (es.asymLadd[
t] == 1 && !changed) {
1155 type = es.typesL5[
j];
1157 for (
int t = 0;
t <
int(es.typesL4.size());
t++)
1158 if (
type == es.typesL4[
t]) {
1159 j =
t + es.typesL5.size();
1160 if (es.asymLadd[(
t + es.typesL5.size())] == 2 && !changed) {
1164 if (es.asymLadd[(
t + es.typesL5.size())] == 1 && !changed) {
1168 type = es.typesL4[
j - es.typesL5.size()];
1174 xpos = xpos + es.dee_separation;
1176 xpos = xpos - es.dee_separation;
1178 sfLog.placeVolume(ns.volume(
"esalgo:" + es.ladPfx[0] +
type),
1180 Transform3D(ns.rotation(
"esalgo:R180"),
Position(xpos, -ypos, zpos)));
1187 xpos =
I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
1190 ns.volume(
"esalgo:" + es.ladPfx[1] +
type),
1192 Transform3D(ns.rotation(
"esalgo:R090"),
Position(-ypos, -xpos, zpos - es.zlead1 + es.zlead2)));
1196 <<
"," <<
cms::convert2mm(zpos - es.zlead1 + es.zlead2) <<
") rotation esalgo:R090";
1203 double xpos(0), ypos(0);
1204 Volume sfwxLog = ns.volume(
"esalgo:SFWX");
1205 Volume sfwyLog = ns.volume(
"esalgo:SFWY");
1206 Volume sfsxLog = ns.volume(
"esalgo:SFSX");
1207 Volume sfsyLog = ns.volume(
"esalgo:SFSY");
1209 for (
size_t i = 0;
i < 32; ++
i) {
1210 xpos = -es.waf_active / 2. +
i * es.waf_active / 32. + es.waf_active / 64.;
1211 sfwxLog.placeVolume(sfsxLog,
i + 1,
Position(xpos, 0., 0.));
1213 edm::LogVerbatim(
"SFGeom") << sfsxLog.name() <<
" copy " << (
i + 1) <<
" in " << sfwxLog.name() <<
" at ("
1217 ypos = -es.waf_active / 2. +
i * es.waf_active / 32. + es.waf_active / 64.;
1218 sfwyLog.placeVolume(sfsyLog,
i + 1,
Position(0., ypos, 0.));
1220 edm::LogVerbatim(
"SFGeom") << sfsyLog.name() <<
" copy " << (
i + 1) <<
" in " << sfwyLog.name() <<
" at (0,"