CMS 3D CMS Logo

DDEcalPreshowerAlgo.cc
Go to the documentation of this file.
1 #include "DD4hep/DetFactoryHelper.h"
5 #include "DD4hep/Shapes.h"
6 
7 #include <string>
8 #include <vector>
9 
10 using namespace std;
11 using namespace cms;
12 using namespace dd4hep;
13 using namespace cms_units::operators;
14 
15 namespace {
16  struct EcalPreshower {
17  double thickness_; // overall thickness of the preshower envelope
18  vector<string> materials_; // materials of the presh-layers
19  vector<string> layName_; // names of the presh-layers
20  vector<string> ladPfx_; // name prefix for ladders
21  string LaddMaterial_; // ladd material - air
22  vector<double> thickLayers_;
23  vector<double> abs1stx;
24  vector<double> abs1sty;
25  vector<double> abs2ndx;
26  vector<double> abs2ndy;
27  vector<double> asym_ladd_;
28  vector<double> rminVec;
29  vector<double> rmaxVec;
30  vector<double> noLaddInCol_;
31  vector<double> startOfFirstLadd_;
32  vector<string> types_l5_;
33  vector<string> types_l4_;
34  vector<double> ladd_l5_map_;
35  vector<double> ladd_l4_map_;
36  vector<string> typeOfLaddRow0;
37  vector<string> typeOfLaddRow1;
38  vector<string> typeOfLaddRow2;
39  vector<string> typeOfLaddRow3;
40 
41  double zlead1_, zlead2_, zfoam1_, zfoam2_;
42  double waf_intra_col_sep, waf_inter_col_sep, waf_active, wedge_length, wedge_offset, zwedge_ceramic_diff,
43  ywedge_ceramic_diff, wedge_angle, box_thick, dee_separation, In_rad_Abs_Al, In_rad_Abs_Pb;
44  double ladder_thick, yladder_1stwedge_diff, ladder_width, ladder_length, micromodule_length;
45  double absAlX_X_, absAlX_Y_, absAlX_subtr1_Xshift_, absAlX_subtr1_Yshift_, rMax_Abs_Al_;
46  double absAlY_X_, absAlY_Y_, absAlY_subtr1_Xshift_, absAlY_subtr1_Yshift_;
47  double LdrBck_Length, LdrFrnt_Length, LdrFrnt_Offset, LdrBck_Offset, ceramic_length, wedge_back_thick;
48  };
49 } // namespace
50 
51 static long algorithm(dd4hep::Detector& /* description */,
53  xml_h e,
54  dd4hep::SensitiveDetector& /* sens */) {
55  BenchmarkGrd counter("DDEcalPreshowerAlgo");
56  cms::DDNamespace ns(ctxt, e, true);
58 
59  Volume parentVolume = ns.volume(args.parentName());
60  Volume swedLog = ns.volume("esalgo:SWED");
61  Volume sfLog = ns.volume("esalgo:SF");
62  Volume sfbxLog = ns.volume("esalgo:SFBX");
63  Volume sfbyLog = ns.volume("esalgo:SFBY");
64 
65  EcalPreshower es;
66  es.asym_ladd_ = args.vecDble("ASYMETRIC_LADDER");
67  es.types_l5_ = args.vecStr("TYPES_OF_LADD_L5");
68  es.types_l4_ = args.vecStr("TYPES_OF_LADD_L4");
69  es.ladd_l5_map_ = args.vecDble("LADD_L5_MAP");
70  es.ladd_l4_map_ = args.vecDble("LADD_L4_MAP");
71  es.noLaddInCol_ = args.vecDble("NUMB_OF_LADD_IN_COL");
72  es.startOfFirstLadd_ = args.vecDble("START_OF_1ST_LADD");
73  es.typeOfLaddRow0 = args.vecStr("TYPE_OF_LADD_1");
74  es.typeOfLaddRow1 = args.vecStr("TYPE_OF_LADD_2");
75  es.typeOfLaddRow2 = args.vecStr("TYPE_OF_LADD_3");
76  es.typeOfLaddRow3 = args.vecStr("TYPE_OF_LADD_4");
77  es.thickLayers_ = args.vecDble("Layers");
78  es.thickness_ = args.dble("PRESH_Z_TOTAL");
79  es.materials_ = args.vecStr("LayMat");
80  es.layName_ = args.vecStr("LayName");
81  es.rmaxVec = args.vecDble("R_MAX"); // inner radii
82  es.rminVec = args.vecDble("R_MIN"); // outer radii
83  es.waf_intra_col_sep = args.dble("waf_intra_col_sep");
84  es.waf_inter_col_sep = args.dble("waf_inter_col_sep");
85  es.waf_active = args.dble("waf_active");
86  es.wedge_length = args.dble("wedge_length");
87  es.wedge_offset = args.dble("wedge_offset");
88  es.zwedge_ceramic_diff = args.dble("zwedge_ceramic_diff");
89  es.ywedge_ceramic_diff = args.dble("ywedge_ceramic_diff");
90  es.ceramic_length = args.dble("ceramic_length");
91  es.wedge_angle = args.dble("wedge_angle");
92  es.wedge_back_thick = args.dble("wedge_back_thick");
93  es.ladder_thick = args.dble("ladder_thick");
94  es.ladder_width = args.dble("ladder_width");
95  es.micromodule_length = args.dble("micromodule_length");
96  es.box_thick = args.dble("box_thick");
97  es.abs1stx = args.vecDble("1ST_ABSX");
98  es.abs1sty = args.vecDble("1ST_ABSY");
99  es.abs2ndx = args.vecDble("2ND_ABSX");
100  es.abs2ndy = args.vecDble("2ND_ABSY");
101  es.ladPfx_ = args.vecStr("LadPrefix");
102  es.LaddMaterial_ = args.str("LadderMaterial");
103  es.LdrFrnt_Length = args.dble("LdrFrnt_Length");
104  es.LdrFrnt_Offset = args.dble("LdrFrnt_Offset");
105  es.LdrBck_Length = args.dble("LdrBck_Length");
106  es.LdrBck_Offset = args.dble("LdrBck_Offset");
107  es.dee_separation = args.dble("dee_sep");
108  es.In_rad_Abs_Al = args.dble("R_MIN_Abs_Al");
109  es.In_rad_Abs_Pb = args.dble("R_MIN_Abs_Pb");
110  es.rMax_Abs_Al_ = args.dble("R_MAX_Abs_Al");
111  es.absAlX_X_ = args.dble("AbsAlX_X");
112  es.absAlX_Y_ = args.dble("AbsAlX_Y");
113  es.absAlX_subtr1_Xshift_ = args.dble("AbsAlX_subtr1_Xshift");
114  es.absAlX_subtr1_Yshift_ = args.dble("AbsAlX_subtr1_Yshift");
115  es.absAlY_X_ = args.dble("AbsAlY_X");
116  es.absAlY_Y_ = args.dble("AbsAlY_Y");
117  es.absAlY_subtr1_Xshift_ = args.dble("AbsAlY_subtr1_Xshift");
118  es.absAlY_subtr1_Yshift_ = args.dble("AbsAlY_subtr1_Yshift");
119 
120  // create all the tube-like layers of the preshower
121  {
122  double zpos = -es.thickness_ / 2., sdx(0), sdy(0), bdx(0), bdy(0);
123 
124  for (size_t i = 0; i < es.thickLayers_.size(); ++i) {
125  int I = int(i) + 1; // FOTRAN I (offset +1)
126 
127  double rIn(0), rOut(0), zHalf(0);
128 
129  // create the name
130  string ddname(es.layName_[i]); // namespace:name
131 
132  // cone dimensions
133  rIn = es.rminVec[i];
134  rOut = es.rmaxVec[i];
135  zHalf = es.thickLayers_[i] / 2.;
136 
137  // create a logical part representing a single layer in the preshower
138  Solid solid = ns.addSolid(ddname, Tube(ddname, rIn, rOut, zHalf, 0., 360._deg));
139  Volume layer = ns.addVolume(Volume(ddname, solid, ns.material(es.materials_[i])));
140 
141  // position the logical part w.r.t. the parent volume
142  zpos += zHalf;
143 
144  // create a logical part representing a single layer in the preshower
145  // skip layers with detectors, front and rear window
146  if (I == 2 || I == 28 || I == 13 || I == 23) {
147  zpos += zHalf;
148  continue;
149  }
150 
151  if (I == 12) {
152  es.zlead1_ = zpos + zHalf;
153  }
154  if (I == 22) {
155  es.zlead2_ = zpos + zHalf;
156  }
157 
158  if (I == 10 || I == 20) { // New lead shape
159 
160  int absz = 0;
161  double outalbx, outalby, shiftR, outalbx2, outalby2, shiftR2;
162 
163  absz = int(es.abs1stx.size());
164  if (I == 20)
165  absz = int(es.abs2ndx.size());
166  int cutabsx = -1, cutabsy = -1;
167 
168  string dd_tmp_name_b("esalgo:" + es.layName_[i] + "Lcut");
169  string dd_tmp_name_c("esalgo:" + es.layName_[i] + "tmpb");
170  string dd_tmp_name_d("esalgo:" + es.layName_[i] + "LinPb");
171 
172  string dd_tmp_name_e("esalgo:" + es.layName_[i] + "LinAl");
173  string dd_tmp_name_f("esalgo:" + es.layName_[i] + "LOutAl");
174 
175  ostringstream tmp_Alname_fin;
176  tmp_Alname_fin << es.layName_[i] << "LtmpAl" << absz - 1;
177  string dd_Alname_fin("esalgo:" + tmp_Alname_fin.str());
178 
179  string dd_Alname_f(es.layName_[i] + "LOutAl");
180  string dd_Alname_g(es.layName_[i] + "LOutAl2");
181  string dd_Alname_h(es.layName_[i] + "LOutAltmp");
182  string dd_Alname_i(es.layName_[i] + "LOutAltmp2");
183  string dd_Alname_j(es.layName_[i] + "LOutAltmp3");
184  string dd_Alname_k(es.layName_[i] + "LOutAltmp4");
185  string dd_Alname_l(es.layName_[i] + "LOutAltmp5");
186  string dd_Alname_m(es.layName_[i] + "LOutAltmp6");
187 
188  Solid Out_Al = ns.addSolid(
189  dd_Alname_f, Tube(dd_Alname_f, es.rMax_Abs_Al_ - 20_cm, es.rMax_Abs_Al_, zHalf - 0.1_mm, 0., 90._deg));
190 
191  outalbx = es.absAlX_X_ * 0.1;
192  outalby = es.rMax_Abs_Al_ + 0.1_mm - es.absAlX_subtr1_Yshift_;
193  shiftR = es.absAlX_subtr1_Yshift_;
194  if (I == 20) {
195  outalbx = es.absAlY_X_ * 0.1;
196  outalby = es.rMax_Abs_Al_ + 0.1_mm - es.absAlY_subtr1_Yshift_;
197  shiftR = es.absAlY_subtr1_Xshift_;
198  }
199  Solid OutAltmp = ns.addSolid(dd_Alname_h, Box(dd_Alname_h, outalbx / 2 + 0.1_mm, outalby / 2 + 0.1_mm, zHalf));
200  Solid Out_Altmp3 = ns.addSolid(
201  dd_Alname_j,
202  SubtractionSolid(dd_Alname_j, Out_Al, OutAltmp, Position(outalbx / 2, outalby / 2 + shiftR, 0)));
203  outalby2 = es.absAlX_Y_ * 0.1;
204  outalbx2 = es.rMax_Abs_Al_ + 0.1_mm - es.absAlX_subtr1_Xshift_;
205  shiftR2 = es.absAlX_subtr1_Xshift_;
206  if (I == 20) {
207  outalby2 = es.absAlY_Y_ * 0.1;
208  outalbx2 = es.rMax_Abs_Al_ + 0.1_mm - es.absAlY_subtr1_Xshift_;
209  shiftR2 = es.absAlY_subtr1_Xshift_;
210  }
211  Solid OutAltmp2 =
212  ns.addSolid(dd_Alname_i, Box(dd_Alname_i, outalbx2 / 2 + 0.1_mm, outalby2 / 2 + 0.1_mm, zHalf));
213  Solid Out_Altmp4 = ns.addSolid(
214  dd_Alname_k,
215  SubtractionSolid(dd_Alname_k, Out_Altmp3, OutAltmp2, Position(outalbx2 / 2 + shiftR2, outalby2 / 2, 0)));
216  Solid Out_Altmp5 =
217  ns.addSolid(dd_Alname_l, UnionSolid(dd_Alname_l, Out_Altmp4, Out_Altmp4, ns.rotation("esalgo:RABS90")));
218  Solid Out_Altmp6 =
219  ns.addSolid(dd_Alname_m, UnionSolid(dd_Alname_m, Out_Altmp5, Out_Altmp4, ns.rotation("esalgo:RABS180B")));
220  Solid Out_Al2 = //FIXME
221  ns.addSolid(dd_Alname_g, UnionSolid(dd_Alname_g, Out_Altmp6, Out_Altmp4, ns.rotation("esalgo:R180")));
222 
223  // FIXME Solid Outer_Al = ns.solid(dd_Alname_fin);
224  Volume layerFinOutAl = Volume(dd_tmp_name_f, /* FIXME: Outer_Al */ Out_Al2, ns.material(es.materials_[i - 1]));
225 
226  for (int L = 0; L < absz; ++L) {
227  int K = L;
228  ostringstream tmp_name_b, tmp_name_b2, tmp_FAl_name_c, tmp_FAl_name_d1, tmp_FAl_name_d2, tmp_FAl_name_d3,
229  tmp_FAl_name_d;
230  tmp_name_b << es.layName_[i] << "L" << K;
231  tmp_name_b2 << es.layName_[i] << "Lb2" << K;
232 
233  if (L == 0)
234  tmp_FAl_name_c << es.layName_[i] << "LOutAl2";
235  if (L > 0)
236  tmp_FAl_name_c << es.layName_[i] << "LtmpAl" << K - 1;
237 
238  tmp_FAl_name_d1 << es.layName_[i] << "LtmpAl" << K << "_1";
239  tmp_FAl_name_d2 << es.layName_[i] << "LtmpAl" << K << "_2";
240  tmp_FAl_name_d3 << es.layName_[i] << "LtmpAl" << K << "_3";
241  tmp_FAl_name_d << es.layName_[i] << "LtmpAl" << K;
242 
243  string dd_tmp_name_b(tmp_name_b.str());
244  string dd_tmp_name_b2(tmp_name_b2.str());
245  string dd_FAl_name_c(tmp_FAl_name_c.str());
246  string dd_FAl_name_d1(tmp_FAl_name_d1.str());
247  string dd_FAl_name_d2(tmp_FAl_name_d2.str());
248  string dd_FAl_name_d3(tmp_FAl_name_d3.str());
249  string dd_FAl_name_d(tmp_FAl_name_d.str());
250 
251  if (L == 0)
252  bdx = abs(es.abs1stx[K]) / 2;
253  if (L > 0)
254  bdx = abs(es.abs1stx[K] - es.abs1stx[K - 1]) / 2;
255  bdy = es.abs1sty[K];
256  if (es.abs1stx[K] < rIn + 30_cm) {
257  bdy = es.abs1sty[K] / 2 - 30_cm;
258  cutabsx = K;
259  }
260 
261  if (I == 20) {
262  if (L == 0)
263  bdx = abs(es.abs2ndx[K]) / 2;
264  if (L > 0)
265  bdx = abs(es.abs2ndx[K] - es.abs2ndx[K - 1]) / 2;
266  bdy = es.abs2ndy[K];
267  }
268 
269  if ((es.abs2ndx[K] < rIn + 30_cm) && I == 20) {
270  bdy = es.abs2ndy[K] / 2 - 30_cm;
271  cutabsy = K;
272  }
273 
274  Solid solid_b = Box(dd_tmp_name_b, bdx, bdy, zHalf);
275  Solid solid_b2 = Box(dd_tmp_name_b2, bdx + 0.1_mm, bdy + 0.1_mm, zHalf);
276 
277  sdx = es.abs1stx[K] - bdx;
278  sdy = 0;
279  if (es.abs1stx[K] < rIn + 30_cm)
280  sdy = es.abs1sty[K] - bdy;
281 
282  if (I == 20) {
283  sdx = es.abs2ndx[K] - bdx;
284  sdy = 0;
285  }
286  if ((es.abs2ndx[K] < rIn + 30_cm) && I == 20)
287  sdy = es.abs2ndy[K] - bdy;
288 
289  Volume layer = Volume(dd_tmp_name_b, solid_b, ns.material(es.materials_[i]));
290 
291  layerFinOutAl.placeVolume(layer, 1, Position(sdx, sdy, 0));
292  layerFinOutAl.placeVolume(layer, 2, Position(-sdx, sdy, 0));
293 
294  Solid solid_c = ns.solid(dd_FAl_name_c);
295  Solid solid_d1 = UnionSolid(dd_FAl_name_d1, solid_c, solid_b2, Position(sdx, sdy, 0));
296  Solid solid_d2 =
297  ns.addSolid(dd_FAl_name_d, UnionSolid(dd_FAl_name_d, solid_d1, solid_b2, Position(-sdx, -sdy, 0)));
298 
299  if (((es.abs1stx[K] < rIn + 30_cm) && I == 10) || ((es.abs2ndx[K] < rIn + 30_cm) && I == 20)) {
300  layerFinOutAl.placeVolume(layer, 3, Position(sdx, -sdy, 0));
301  layerFinOutAl.placeVolume(layer, 4, Position(-sdx, -sdy, 0));
302 
303  Solid solid_c = ns.solid(dd_FAl_name_c);
304  Solid solid_d1 = UnionSolid(dd_FAl_name_d1, solid_c, solid_b2, Position(sdx, sdy, 0));
305  /*Solid solid_d2 = */
306  ns.addSolid(dd_FAl_name_d2, UnionSolid(dd_FAl_name_d2, solid_d1, solid_b2, Position(sdx, -sdy, 0)));
307  Solid solid_d3 = UnionSolid(dd_FAl_name_d3, solid_d2, solid_b2, Position(-sdx, sdy, 0));
308  /*Solid solid_d4 = */
309  ns.addSolid(dd_FAl_name_d, UnionSolid(dd_FAl_name_d, solid_d3, solid_b2, Position(-sdx, -sdy, 0)));
310  }
311  }
312 
313  bdx = es.abs1stx[cutabsx];
314  if (I == 20)
315  bdx = es.abs2ndx[cutabsy];
316  bdy = 2 * 30_cm;
317 
318  Solid solidcut = Box(dd_tmp_name_b, bdx, bdy, zHalf);
319  Solid iner = Tube(dd_tmp_name_c, 0, es.In_rad_Abs_Pb, zHalf + 0.1_mm, 0., 360._deg);
320  Solid final = SubtractionSolid(dd_tmp_name_d, solidcut, iner);
321 
322  Volume layer = Volume(dd_tmp_name_d, final, ns.material(es.materials_[i]));
323  parentVolume.placeVolume(layer, 1, Position(0, 0, zpos));
324 
325  Solid iner_Al = Tube(dd_tmp_name_e, es.In_rad_Abs_Al, es.In_rad_Abs_Pb - 0.01_mm, zHalf, 0., 360._deg);
326  Volume layerAl = Volume(dd_tmp_name_e, iner_Al, ns.material(es.materials_[i - 1]));
327  parentVolume.placeVolume(layerAl, 1, Position(0, 0, zpos));
328  parentVolume.placeVolume(layerFinOutAl, 1, Position(0, 0, zpos));
329  } else {
330  parentVolume.placeVolume(layer, 1, Position(0., 0., zpos));
331  }
332  zpos += zHalf;
333  }
334  }
335  // create and place the ladders
336  {
337  double xpos(0), ypos(0), zpos(0), sdx(0), sdy(0), sdz(0);
338  double prev_length_(0), ladder_new_length_(0), ladd_shift_(0), ladder_length(0);
339  int enb(0), swed_scopy_glob(0);
340  double sdxe[50] = {0}, sdye[50] = {0}, sdze[50] = {0};
341  double sdxe2[50] = {0}, sdye2[50] = {0}, sdze2[50] = {0}, sdxe3[50] = {0}, sdye3[50] = {0}, sdze3[50] = {0};
342 
343  for (int M = 0; M < int(es.types_l5_.size() + es.types_l4_.size()); M++) {
344  int scopy(0);
345  double boxax(0), boxay(0), boxaz(0);
346  int ladd_not_plain(0), ladd_subtr_no(0), ladd_upper(0), ladd_side(0);
347 
348  Solid solid_lfront = Trap("esalgo:LDRFRNT",
349  es.LdrFrnt_Length / 2, // pDz
350  -es.wedge_angle, // pTheta
351  0, // pPhi
352  es.ladder_width / 2, // pDy1
353  (es.ladder_thick) / 2, // pDx1
354  (es.ladder_thick) / 2, // pDx2
355  0, //pAlp1
356  es.ladder_width / 2, //pDy2
357  (es.ladder_thick - es.ceramic_length * sin(es.wedge_angle * 2)) / 2, // pDx3
358  (es.ladder_thick - es.ceramic_length * sin(es.wedge_angle * 2)) / 2, // pDx4
359  0);
360 
361  Solid solid_lbck = Trap("esalgo:LDRBCK",
362  es.LdrBck_Length / 2, // pDz
363  -es.wedge_angle, // pTheta
364  0, // pPhi
365  es.ladder_width / 2, // pDy1
366  (es.box_thick / cos(es.wedge_angle * 2) + 0.02_mm) / 2, // pDx1
367  (es.box_thick / cos(es.wedge_angle * 2) + 0.02_mm) / 2, // pDx2
368  0, //pAlp1
369  es.ladder_width / 2, //pDy2
370  (es.ladder_thick - es.wedge_back_thick) / 2, // pDx3
371  (es.ladder_thick - es.wedge_back_thick) / 2, // pDx4
372  0);
373 
374  Solid solid_lfhalf = Trap("esalgo:LDRFHALF",
375  es.LdrFrnt_Length / 2, // pDz
376  -es.wedge_angle, // pTheta
377  0, // pPhi
378  (es.ladder_width / 2) / 2, // pDy1
379  (es.ladder_thick) / 2, // pDx1
380  (es.ladder_thick) / 2, // pDx2
381  0, //pAlp1
382  (es.ladder_width / 2) / 2, //pDy2
383  (es.ladder_thick - es.ceramic_length * sin(es.wedge_angle * 2)) / 2, // pDx3
384  (es.ladder_thick - es.ceramic_length * sin(es.wedge_angle * 2)) / 2, // pDx4
385  0);
386 
387  Solid solid_lbhalf = Trap("esalgo:LDRBHALF",
388  es.LdrBck_Length / 2, // pDz
389  -es.wedge_angle, // pTheta
390  0, // pPhi
391  (es.ladder_width / 2) / 2, // pDy1
392  (es.box_thick / cos(es.wedge_angle * 2) + 0.02_mm) / 2, // pDx1
393  (es.box_thick / cos(es.wedge_angle * 2) + 0.02_mm) / 2, // pDx2
394  0, //pAlp1
395  (es.ladder_width / 2) / 2, //pDy2
396  (es.ladder_thick - es.wedge_back_thick) / 2, // pDx3
397  (es.ladder_thick - es.wedge_back_thick) / 2, // pDx4
398  0);
399 
400  Solid solid_lfhtrunc =
401  Trap("esalgo:LDRFHTR",
402  (es.LdrFrnt_Length - es.waf_active) / 2, // pDz
403  -es.wedge_angle, // pTheta
404  0, // pPhi
405  (es.ladder_width / 2) / 2, // pDy1
406  (es.ladder_thick) / 2, // pDx1
407  (es.ladder_thick) / 2, // pDx2
408  0, //pAlp1
409  (es.ladder_width / 2) / 2, //pDy2
410  (es.ladder_thick - (es.ceramic_length - es.waf_active) * sin(es.wedge_angle * 2)) / 2, // pDx3
411  (es.ladder_thick - (es.ceramic_length - es.waf_active) * sin(es.wedge_angle * 2)) / 2, // pDx4
412  0);
413 
414  // Creation of ladders with 5 micromodules length
415 
416  if (M < int(es.types_l5_.size())) {
417  for (int i = 0; i <= 1; i++) {
418  for (int j = 0; j <= 3; j++) {
419  if (es.ladd_l5_map_[(i + j * 2 + M * 10)] != 1) {
420  ladd_not_plain = 1;
421  ladd_subtr_no++;
422  if (j > 1)
423  ladd_upper = 1;
424  ladd_side = i;
425  }
426  }
427  }
428 
429  string ddname("esalgo:" + es.ladPfx_[0] + es.types_l5_[M]);
430  ladder_length = es.micromodule_length + 4 * es.waf_active + 0.1_mm;
431 
432  if (ladd_not_plain) {
433  // enb++;
434  ostringstream tmp_name_5b, tmp_name_5c, tmp_name_5d;
435  if (ladd_upper) {
436  } //upper
437  else {
438  enb++;
439  ostringstream tmp_name_5b, tmp_name_5c, tmp_name_5d;
440  string dd_tmp_name_5a("esalgo:" + es.ladPfx_[2]);
441  tmp_name_5b << es.ladPfx_[3] << enb;
442  string dd_tmp_name_5b("esalgo:" + tmp_name_5b.str());
443  tmp_name_5c << es.ladPfx_[4] << enb;
444  string dd_tmp_name_5c("esalgo:" + tmp_name_5c.str());
445  tmp_name_5d << es.ladPfx_[5] << enb;
446  string dd_tmp_name_5d("esalgo:" + tmp_name_5d.str());
447 
448  string dd_tmp_name_5e("esalgo:" + es.ladPfx_[6]);
449 
450  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
451  boxax = es.ladder_width;
452  boxaz = es.ladder_thick;
453 
454  Solid solid_5a = Box(dd_tmp_name_5a, boxax / 2, boxay / 2, boxaz / 2.);
455  if (ladd_side == 0)
456  sdxe[enb] = es.ladder_width / 4;
457  sdye[enb] = -boxay / 2 - es.LdrFrnt_Length / 2;
458  sdze[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
459  if (ladd_side == 1)
460  sdxe[enb] = -es.ladder_width / 4;
461 
462  Solid solid_5b =
463  UnionSolid(dd_tmp_name_5b,
464  solid_5a,
465  solid_lfhalf,
466  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe[enb], sdye[enb], sdze[enb])));
467 
468  if (ladd_side == 0)
469  sdxe2[enb] = -es.ladder_width / 4;
470  sdye2[enb] = -boxay / 2 - es.LdrFrnt_Length / 2 + es.waf_active / 2;
471  sdze2[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset + (es.waf_active * sin(es.wedge_angle * 2)) / 4;
472  if (ladd_side == 1)
473  sdxe2[enb] = es.ladder_width / 4;
474 
475  Solid solid_5c =
476  UnionSolid(dd_tmp_name_5c,
477  solid_5b,
478  solid_lfhtrunc,
479  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
480 
481  sdxe3[enb] = 0;
482  sdye3[enb] = boxay / 2 + es.LdrBck_Length / 2;
483  sdze3[enb] = -es.ladder_thick / 2. + es.LdrBck_Offset;
484  Solid solid =
485  UnionSolid(ddname,
486  solid_5c,
487  solid_lbck,
488  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe3[enb], sdye3[enb], sdze3[enb])));
489 
490  /*Volume ladder = */
491  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
492  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l5_[M]);
493  /* Volume ladder2 = */
494  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
495  }
496  } //end of not plain ladder shape
497  else {
498  string dd_tmp_name_5pa("esalgo:" + es.ladPfx_[2] + "5p");
499  string dd_tmp_name_5pb("esalgo:" + es.ladPfx_[3] + "5p");
500 
501  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
502  boxax = es.ladder_width;
503  boxaz = es.ladder_thick;
504 
505  Solid solid_5pa = Box(dd_tmp_name_5pa, boxax / 2, boxay / 2, boxaz / 2.);
506  sdx = 0;
507  sdy = -boxay / 2 - es.LdrFrnt_Length / 2;
508  sdz = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
509 
510  Solid solid_5pb = UnionSolid(dd_tmp_name_5pb,
511  solid_5pa,
512  solid_lfront,
513  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdx, sdy, sdz)));
514 
515  sdx = 0;
516  sdy = boxay / 2 + es.LdrBck_Length / 2;
517  sdz = -es.ladder_thick / 2. + es.LdrBck_Offset;
518 
519  Solid solid = UnionSolid(
520  ddname, solid_5pb, solid_lbck, Transform3D(ns.rotation("esalgo:RM1299"), Position(sdx, sdy, sdz)));
521  /* Volume ladder = */
522  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
523  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l5_[M]);
524  /* Volume ladder2 = */
525  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
526  }
527  }
528 
529  // Creation of ladders with 4 micromodules length
530 
531  if (M >= int(es.types_l5_.size())) {
532  int d = M - es.types_l5_.size();
533 
534  for (int i = 0; i <= 1; i++) {
535  for (int j = 0; j <= 3; j++) {
536  if (es.ladd_l4_map_[(i + j * 2 + (M - es.types_l5_.size()) * 8)] != 1) {
537  ladd_not_plain = 1;
538  ladd_subtr_no++;
539  if (j > 1)
540  ladd_upper = 1;
541  ladd_side = i;
542  }
543  }
544  }
545 
546  string ddname("esalgo:" + es.ladPfx_[0] + es.types_l4_[d]);
547  ladder_length = es.micromodule_length + 3 * es.waf_active + 0.1_mm;
548 
549  if (ladd_not_plain) {
550  ostringstream tmp_name_b, tmp_name_c, tmp_name_d;
551  if (ladd_upper) {
552  enb++;
553 
554  string dd_tmp_name_a("esalgo:" + es.ladPfx_[7]);
555  tmp_name_b << es.ladPfx_[8] << enb;
556  string dd_tmp_name_b("esalgo:" + tmp_name_b.str());
557  tmp_name_c << es.ladPfx_[9] << enb;
558  string dd_tmp_name_c("esalgo:" + tmp_name_c.str());
559  tmp_name_d << es.ladPfx_[10] << enb;
560  string dd_tmp_name_d("esalgo:" + tmp_name_d.str());
561  string dd_tmp_name_e("esalgo:" + es.ladPfx_[11]);
562 
563  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
564  boxax = es.ladder_width;
565  boxaz = es.ladder_thick;
566  Solid solid_a = Box(dd_tmp_name_a, boxax / 2, boxay / 2, boxaz / 2.);
567 
568  sdxe[enb] = 0;
569  sdye[enb] = -boxay / 2 - es.LdrFrnt_Length / 2;
570  sdze[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
571  Solid solid_b =
572  UnionSolid(dd_tmp_name_b,
573  solid_a,
574  solid_lfront,
575  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe[enb], sdye[enb], sdze[enb])));
576 
577  if (ladd_side == 0)
578  sdxe2[enb] = es.ladder_width / 4;
579  sdye2[enb] = boxay / 2 + es.LdrBck_Length / 2;
580  sdze2[enb] = -es.ladder_thick / 2. + es.LdrBck_Offset;
581  if (ladd_side == 1)
582  sdxe2[enb] = -es.ladder_width / 4;
583  Solid solid =
584  UnionSolid(ddname,
585  solid_b,
586  solid_lbhalf,
587  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
588 
589  /* Volume ladder = */
590  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
591  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l4_[d]);
592  /* Volume ladder2 = */
593  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
594 
595  } //upper
596  else {
597  if (ladd_subtr_no > 1) {
598  enb++;
599 
600  string dd_tmp_name_a("esalgo:" + es.ladPfx_[7]);
601  tmp_name_b << es.ladPfx_[8] << enb;
602  string dd_tmp_name_b("esalgo:" + tmp_name_b.str());
603  tmp_name_c << es.ladPfx_[9] << enb;
604  string dd_tmp_name_c("esalgo:" + tmp_name_c.str());
605  tmp_name_d << es.ladPfx_[10] << enb;
606  string dd_tmp_name_d("esalgo:" + tmp_name_d.str());
607  string dd_tmp_name_e("esalgo:" + es.ladPfx_[11]);
608 
609  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
610  boxax = es.ladder_width;
611  boxaz = es.ladder_thick;
612 
613  Solid solid_a = Box(dd_tmp_name_a, boxax / 2, boxay / 2, boxaz / 2.);
614  if (ladd_side == 0)
615  sdxe[enb] = es.ladder_width / 4;
616  sdye[enb] = -boxay / 2 - es.LdrFrnt_Length / 2;
617  sdze[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
618  if (ladd_side == 1)
619  sdxe[enb] = -es.ladder_width / 4;
620 
621  Solid solid_b =
622  UnionSolid(dd_tmp_name_b,
623  solid_a,
624  solid_lfhalf,
625  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe[enb], sdye[enb], sdze[enb])));
626 
627  sdxe2[enb] = 0;
628  sdye2[enb] = boxay / 2 + es.LdrBck_Length / 2;
629  sdze2[enb] = -es.ladder_thick / 2. + es.LdrBck_Offset;
630 
631  Solid solid =
632  UnionSolid(ddname,
633  solid_b,
634  solid_lbck,
635  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
636 
637  /* Volume ladder = */
638  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
639  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l4_[d]);
640  /* Volume ladder2 = */
641  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
642  } else {
643  enb++;
644  string dd_tmp_name_a("esalgo:" + es.ladPfx_[7]);
645  tmp_name_b << es.ladPfx_[8] << enb;
646  string dd_tmp_name_b("esalgo:" + tmp_name_b.str());
647  tmp_name_c << es.ladPfx_[9] << enb;
648  string dd_tmp_name_c("esalgo:" + tmp_name_c.str());
649  tmp_name_d << es.ladPfx_[10] << enb;
650  string dd_tmp_name_d("esalgo:" + tmp_name_d.str());
651  string dd_tmp_name_e("esalgo:" + es.ladPfx_[11]);
652 
653  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
654  boxax = es.ladder_width;
655  boxaz = es.ladder_thick;
656  Solid solid_a = Box(dd_tmp_name_a, boxax / 2, boxay / 2, boxaz / 2.);
657  if (ladd_side == 0)
658  sdxe[enb] = es.ladder_width / 4;
659  sdye[enb] = -boxay / 2 - es.LdrFrnt_Length / 2;
660  sdze[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
661  if (ladd_side == 1)
662  sdxe[enb] = -es.ladder_width / 4;
663 
664  Solid solid_b =
665  UnionSolid(dd_tmp_name_b,
666  solid_a,
667  solid_lfhalf,
668  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe[enb], sdye[enb], sdze[enb])));
669 
670  if (ladd_side == 0)
671  sdxe2[enb] = -es.ladder_width / 4;
672  sdye2[enb] = -boxay / 2 - es.LdrFrnt_Length / 2 + es.waf_active / 2;
673  sdze2[enb] = -es.ladder_thick / 2. + es.LdrFrnt_Offset + (es.waf_active * sin(es.wedge_angle * 2)) / 4;
674  if (ladd_side == 1)
675  sdxe2[enb] = es.ladder_width / 4;
676 
677  Solid solid_c =
678  UnionSolid(dd_tmp_name_c,
679  solid_b,
680  solid_lfhtrunc,
681  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe2[enb], sdye2[enb], sdze2[enb])));
682 
683  sdxe3[enb] = 0;
684  sdye3[enb] = boxay / 2 + es.LdrBck_Length / 2;
685  sdze3[enb] = -es.ladder_thick / 2. + es.LdrBck_Offset;
686  Solid solid =
687  UnionSolid(ddname,
688  solid_c,
689  solid_lbck,
690  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdxe3[enb], sdye3[enb], sdze3[enb])));
691 
692  /* Volume ladder = */
693  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
694  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l4_[d]);
695  /* Volume ladder2 = */
696  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
697  }
698  }
699  } //end of not plain ladder shape
700  else {
701  string dd_tmp_name_pa("esalgo:" + es.ladPfx_[2] + "p");
702  string dd_tmp_name_pb("esalgo:" + es.ladPfx_[3] + "p");
703 
704  boxay = ladder_length - es.LdrFrnt_Length - es.LdrBck_Length;
705  boxax = es.ladder_width;
706  boxaz = es.ladder_thick;
707 
708  Solid solid_pa = Box(dd_tmp_name_pa, boxax / 2, boxay / 2, boxaz / 2.);
709  sdx = 0;
710  sdy = -boxay / 2 - es.LdrFrnt_Length / 2;
711  sdz = -es.ladder_thick / 2. + es.LdrFrnt_Offset;
712 
713  Solid solid_pb = UnionSolid(dd_tmp_name_pb,
714  solid_pa,
715  solid_lfront,
716  Transform3D(ns.rotation("esalgo:RM1299"), Position(sdx, sdy, sdz)));
717 
718  sdx = 0;
719  sdy = boxay / 2 + es.LdrBck_Length / 2;
720  sdz = -es.ladder_thick / 2. + es.LdrBck_Offset;
721  Solid solid = UnionSolid(
722  ddname, solid_pb, solid_lbck, Transform3D(ns.rotation("esalgo:RM1299"), Position(sdx, sdy, sdz)));
723  /* Volume ladder = */
724  ns.addVolumeNS(Volume(ddname, solid, ns.material(es.LaddMaterial_)));
725  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l4_[d]);
726  /* Volume ladder2 = */
727  ns.addVolumeNS(Volume(ddname2, solid, ns.material(es.LaddMaterial_)));
728  }
729  }
730 
731  // insert SWED, SFBX and SFBY into ladders
732  swed_scopy_glob++;
733  if (M < int(es.types_l5_.size())) {
734  string ddname("esalgo:" + es.ladPfx_[0] + es.types_l5_[M]);
735  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l5_[M]);
736  for (int i = 0; i <= 1; i++) {
737  for (int j = 0; j <= 4; j++) {
738  xpos = (i * 2 - 1) * es.waf_intra_col_sep / 2.;
739  ypos = -ladder_length / 2. + 0.05_mm - (es.LdrFrnt_Length - es.LdrBck_Length) / 2 + es.wedge_length / 2. +
740  j * es.waf_active;
741  zpos = -es.ladder_thick / 2. + 0.005_mm + es.wedge_offset;
742  if (es.ladd_l5_map_[(i + j * 2 + M * 10)] == 1) {
743  scopy++;
744  ns.volume(ddname).placeVolume(swedLog,
745  scopy + 1000 * swed_scopy_glob,
746  Transform3D(ns.rotation("esalgo:RM1299"), Position(xpos, ypos, zpos)));
747  ns.volume(ddname2).placeVolume(swedLog,
748  scopy + 1000 * swed_scopy_glob + 100,
749  Transform3D(ns.rotation("esalgo:RM1299"), Position(xpos, ypos, zpos)));
750 
751  ypos = ypos + es.ywedge_ceramic_diff;
752  zpos = -es.ladder_thick / 2. + 0.005_mm + es.zwedge_ceramic_diff;
753  ns.volume(ddname).placeVolume(sfbxLog,
754  scopy + 1000 * swed_scopy_glob,
755  Transform3D(ns.rotation("esalgo:RM1298"), Position(xpos, ypos, zpos)));
756 
757  ns.volume(ddname2).placeVolume(sfbyLog,
758  scopy + 1000 * swed_scopy_glob,
759  Transform3D(ns.rotation("esalgo:RM1300A"), Position(xpos, ypos, zpos)));
760  }
761  }
762  }
763  } else {
764  int d = M - es.types_l5_.size();
765  string ddname("esalgo:" + es.ladPfx_[0] + es.types_l4_[d]);
766  string ddname2("esalgo:" + es.ladPfx_[1] + es.types_l4_[d]);
767  for (int i = 0; i <= 1; i++) {
768  for (int j = 0; j <= 3; j++) {
769  xpos = (i * 2 - 1) * es.waf_intra_col_sep / 2.;
770  ypos = -ladder_length / 2. + 0.05_mm - (es.LdrFrnt_Length - es.LdrBck_Length) / 2 + es.wedge_length / 2. +
771  j * es.waf_active;
772  zpos = -es.ladder_thick / 2. + 0.005_mm + es.wedge_offset;
773  if (es.ladd_l4_map_[(i + j * 2 + (M - es.types_l5_.size()) * 8)] == 1) {
774  scopy++;
775  ns.volume(ddname).placeVolume(swedLog,
776  scopy + 1000 * swed_scopy_glob,
777  Transform3D(ns.rotation("esalgo:RM1299"), Position(xpos, ypos, zpos)));
778  ns.volume(ddname2).placeVolume(swedLog,
779  scopy + 1000 * swed_scopy_glob + 100,
780  Transform3D(ns.rotation("esalgo:RM1299"), Position(xpos, ypos, zpos)));
781 
782  ypos = ypos + es.ywedge_ceramic_diff;
783  zpos = -es.ladder_thick / 2. + 0.005_mm + es.zwedge_ceramic_diff;
784  ns.volume(ddname).placeVolume(sfbxLog,
785  scopy + 1000 * swed_scopy_glob,
786  Transform3D(ns.rotation("esalgo:RM1298"), Position(xpos, ypos, zpos)));
787 
788  ns.volume(ddname2).placeVolume(sfbyLog,
789  scopy + 1000 * swed_scopy_glob,
790  Transform3D(ns.rotation("esalgo:RM1300A"), Position(xpos, ypos, zpos)));
791  }
792  }
793  }
794  }
795  }
796 
797  // Positioning of ladders
798 
799  string type;
800  int icopy[100] = {0};
801 
802  for (int I = -9; I <= 9; ++I) {
803  prev_length_ = 0;
804  int J = abs(I);
805  for (int K = 0; K < es.noLaddInCol_[J]; K++) {
806  string type;
807 
808  ladder_new_length_ = es.micromodule_length + 3 * es.waf_active;
809  ladd_shift_ = 4 * es.waf_active;
810 
811  if (K == 0)
812  type = es.typeOfLaddRow0[J];
813  if (K == 1)
814  type = es.typeOfLaddRow1[J];
815  if (K == 2)
816  type = es.typeOfLaddRow2[J];
817  if (K == 3)
818  type = es.typeOfLaddRow3[J];
819 
820  for (const auto& i : es.types_l5_)
821  if (type == i) {
822  ladder_new_length_ = es.micromodule_length + 4 * es.waf_active;
823  ladd_shift_ = 5 * es.waf_active;
824  }
825 
826  int j = 0;
827 
828  for (int t = 0; t < int(es.types_l5_.size()); t++)
829  if (type == es.types_l5_[t]) {
830  j = t;
831  if (I < 0 && es.asym_ladd_[t] == 1) {
832  j = j + 1;
833  type = es.types_l5_[j];
834  }
835  }
836  for (int t = 0; t < int(es.types_l4_.size()); t++)
837  if (type == es.types_l4_[t]) {
838  j = t + es.types_l5_.size();
839  if (I < 0 && es.asym_ladd_[(t + es.types_l5_.size())] == 1) {
840  j = j + 1;
841  type = es.types_l4_[j - es.types_l5_.size()];
842  }
843  }
844 
845  xpos = I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
846  if (I > 0)
847  xpos = xpos + es.dee_separation;
848  if (I < 0)
849  xpos = xpos - es.dee_separation;
850 
851  int sz = 20;
852  ypos = (sz - int(es.startOfFirstLadd_[J])) * es.waf_active - ladder_new_length_ / 2. +
853  (es.LdrFrnt_Length - es.LdrBck_Length) / 2 + es.micromodule_length + 0.05_cm - prev_length_;
854 
855  prev_length_ += ladd_shift_;
856 
857  zpos = es.zlead1_ + es.ladder_thick / 2. + 0.01_mm;
858  icopy[j] += 1;
859 
860  string ddname("esalgo:" + es.ladPfx_[0] + type);
861  sfLog.placeVolume(ns.volume(ddname), icopy[j], Position(xpos, ypos, zpos));
862 
863  string ddname2("esalgo:" + es.ladPfx_[1] + type);
864  xpos = I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
865  sfLog.placeVolume(
866  ns.volume(ddname2),
867  icopy[j],
868  Transform3D(ns.rotation("esalgo:R270"), Position(ypos, -xpos, zpos - es.zlead1_ + es.zlead2_)));
869 
870  int changed = 0;
871  for (int t = 0; t < int(es.types_l5_.size()); t++)
872  if (type == es.types_l5_[t]) {
873  j = t;
874  if (es.asym_ladd_[t] == 2 && !changed) {
875  j = j - 1;
876  changed = 1;
877  }
878  if (es.asym_ladd_[t] == 1 && !changed) {
879  j = j + 1;
880  changed = 1;
881  }
882  type = es.types_l5_[j];
883  }
884  for (int t = 0; t < int(es.types_l4_.size()); t++)
885  if (type == es.types_l4_[t]) {
886  j = t + es.types_l5_.size();
887  if (es.asym_ladd_[(t + es.types_l5_.size())] == 2 && !changed) {
888  j = j - 1;
889  changed = 1;
890  }
891  if (es.asym_ladd_[(t + es.types_l5_.size())] == 1 && !changed) {
892  j = j + 1;
893  changed = 1;
894  }
895  type = es.types_l4_[j - es.types_l5_.size()];
896  }
897 
898  icopy[j] += 1;
899 
900  if (I > 0)
901  xpos = xpos + es.dee_separation;
902  if (I < 0)
903  xpos = xpos - es.dee_separation;
904 
905  string ddname3("esalgo:" + es.ladPfx_[0] + type);
906  sfLog.placeVolume(
907  ns.volume(ddname3), icopy[j], Transform3D(ns.rotation("esalgo:R180"), Position(xpos, -ypos, zpos)));
908 
909  string ddname4("esalgo:" + es.ladPfx_[1] + type);
910 
911  xpos = I * (2 * es.waf_intra_col_sep + es.waf_inter_col_sep);
912 
913  sfLog.placeVolume(
914  ns.volume(ddname3),
915  icopy[j],
916  Transform3D(ns.rotation("esalgo:R090"), Position(-ypos, -xpos, zpos - es.zlead1_ + es.zlead2_)));
917  }
918  }
919  }
920  // place the slicon strips in active silicon wafers
921  {
922  double xpos(0), ypos(0);
923  Volume sfwxLog = ns.volume("esalgo:SFWX");
924  Volume sfwyLog = ns.volume("esalgo:SFWY");
925  Volume sfsxLog = ns.volume("esalgo:SFSX");
926  Volume sfsyLog = ns.volume("esalgo:SFSY");
927 
928  for (size_t i = 0; i < 32; ++i) {
929  xpos = -es.waf_active / 2. + i * es.waf_active / 32. + es.waf_active / 64.;
930  sfwxLog.placeVolume(sfsxLog, i + 1, Position(xpos, 0., 0.));
931 
932  ypos = -es.waf_active / 2. + i * es.waf_active / 32. + es.waf_active / 64.;
933  sfwyLog.placeVolume(sfsyLog, i + 1, Position(0., ypos, 0.));
934  }
935  }
936  return 1;
937 }
938 
939 DECLARE_DDCMS_DETELEMENT(DDCMS_ecal_DDEcalPreshowerAlgo, algorithm)
writedatasetfile.args
args
Definition: writedatasetfile.py:18
dttmaxenums::L
Definition: DTTMax.h:29
mps_fire.i
i
Definition: mps_fire.py:355
cms_units::operators
Definition: CMSUnits.h:13
algorithm
static long algorithm(dd4hep::Detector &, cms::DDParsingContext &ctxt, xml_h e, dd4hep::SensitiveDetector &)
Definition: DDEcalPreshowerAlgo.cc:51
cms::DDNamespace::solid
dd4hep::Solid solid(const std::string &name) const
Definition: DDNamespace.cc:225
DECLARE_DDCMS_DETELEMENT
#define DECLARE_DDCMS_DETELEMENT(name, func)
Definition: DDPlugins.h:30
cms::DDNamespace::material
dd4hep::Material material(const std::string &name) const
Definition: DDNamespace.cc:121
cms::DDParsingContext
Definition: DDParsingContext.h:14
cms::DDNamespace
Definition: DDNamespace.h:16
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Exhume::I
const std::complex< double > I
Definition: I.h:8
PixelTestBeamValidation_cfi.Position
Position
Definition: PixelTestBeamValidation_cfi.py:62
cms::DDNamespace::rotation
const dd4hep::Rotation3D & rotation(const std::string &name) const
Definition: DDNamespace.cc:130
OrderedSet.t
t
Definition: OrderedSet.py:90
cms::Volume
dd4hep::Volume Volume
Definition: DDFilteredView.h:45
DDPlugins.h
createfilelist.int
int
Definition: createfilelist.py:10
cms::DDNamespace::addVolume
dd4hep::Volume addVolume(dd4hep::Volume vol) const
Add rotation matrix to current namespace.
Definition: DDNamespace.cc:170
cms::DDAlgoArguments
Definition: DDAlgoArguments.h:28
cms::DDNamespace::addSolid
dd4hep::Solid addSolid(const std::string &name, dd4hep::Solid solid) const
Definition: DDNamespace.cc:221
counter
static std::atomic< unsigned int > counter
Definition: SharedResourceNames.cc:15
BenchmarkGrd.h
cms::DDNamespace::addVolumeNS
dd4hep::Volume addVolumeNS(dd4hep::Volume vol) const
Definition: DDNamespace.cc:150
EcalPreshower
Definition: EcalSubdetector.h:10
align::Detector
Definition: StructureType.h:86
type
type
Definition: HCALResponse.h:21
std
Definition: JetResolutionObject.h:76
dd4hep
Definition: DDPlugins.h:8
BenchmarkGrd
Definition: BenchmarkGrd.h:9
CMSUnits.h
ztail.d
d
Definition: ztail.py:151
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cms::DDNamespace::volume
dd4hep::Volume volume(const std::string &name, bool exc=true) const
Definition: DDNamespace.cc:190
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37