CMS 3D CMS Logo

DDEcalBarrelNewAlgo.cc
Go to the documentation of this file.
1 // File: DDEcalBarrelNewAlgo.cc
3 // Description: Geometry factory class for Ecal Barrel
5 
6 #include <cmath>
7 #include <algorithm>
8 
14 #include "CLHEP/Units/GlobalSystemOfUnits.h"
15 
16 #include <CLHEP/Geometry/Point3D.h>
17 #include <CLHEP/Geometry/Vector3D.h>
18 #include <CLHEP/Geometry/Transform3D.h>
19 #include <map>
20 #include <string>
21 #include <vector>
29 #include "CLHEP/Geometry/Transform3D.h"
30 
31 //#define EDM_ML_DEBUG
32 
33 class DDEcalBarrelNewAlgo : public DDAlgorithm {
34 public:
36  typedef HepGeom::Point3D<double> Pt3D;
37  typedef HepGeom::Transform3D Tf3D;
38  typedef HepGeom::ReflectZ3D RfZ3D;
39  typedef HepGeom::Translate3D Tl3D;
40  typedef HepGeom::Rotate3D Ro3D;
41  typedef HepGeom::RotateZ3D RoZ3D;
42  typedef HepGeom::RotateY3D RoY3D;
43  typedef HepGeom::RotateX3D RoX3D;
44 
45  typedef CLHEP::Hep3Vector Vec3;
46  typedef CLHEP::HepRotation Rota;
47 
48  //Constructor and Destructor
50  ~DDEcalBarrelNewAlgo() override;
51 
52  void initialize(const DDNumericArguments& nArgs,
53  const DDVectorArguments& vArgs,
54  const DDMapArguments& mArgs,
55  const DDStringArguments& sArgs,
56  const DDStringVectorArguments& vsArgs) override;
57  void execute(DDCompactView& cpv) override;
58 
59  DDMaterial ddmat(const std::string& s) const;
60  DDName ddname(const std::string& s) const;
61  DDRotation myrot(const std::string& s, const CLHEP::HepRotation& r) const;
62  DDSolid mytrap(const std::string& s, const Trap& t) const;
63 
64  const std::string& idNameSpace() const { return m_idNameSpace; }
65 
66  // barrel parent volume
67  DDName barName() const { return ddname(m_BarName); }
68  DDMaterial barMat() const { return ddmat(m_BarMat); }
69  const std::vector<double>& vecBarZPts() const { return m_vecBarZPts; }
70  const std::vector<double>& vecBarRMin() const { return m_vecBarRMin; }
71  const std::vector<double>& vecBarRMax() const { return m_vecBarRMax; }
72  const std::vector<double>& vecBarTran() const { return m_vecBarTran; }
73  const std::vector<double>& vecBarRota() const { return m_vecBarRota; }
74  const std::vector<double>& vecBarRota2() const { return m_vecBarRota2; }
75  const std::vector<double>& vecBarRota3() const { return m_vecBarRota3; }
76  double barPhiLo() const { return m_BarPhiLo; }
77  double barPhiHi() const { return m_BarPhiHi; }
78  double barHere() const { return m_BarHere; }
79 
80  DDName spmName() const { return ddname(m_SpmName); }
81  DDMaterial spmMat() const { return ddmat(m_SpmMat); }
82  const std::vector<double>& vecSpmZPts() const { return m_vecSpmZPts; }
83  const std::vector<double>& vecSpmRMin() const { return m_vecSpmRMin; }
84  const std::vector<double>& vecSpmRMax() const { return m_vecSpmRMax; }
85  const std::vector<double>& vecSpmTran() const { return m_vecSpmTran; }
86  const std::vector<double>& vecSpmRota() const { return m_vecSpmRota; }
87  const std::vector<double>& vecSpmBTran() const { return m_vecSpmBTran; }
88  const std::vector<double>& vecSpmBRota() const { return m_vecSpmBRota; }
89  unsigned int spmNPerHalf() const { return m_SpmNPerHalf; }
90  double spmLowPhi() const { return m_SpmLowPhi; }
91  double spmDelPhi() const { return m_SpmDelPhi; }
92  double spmPhiOff() const { return m_SpmPhiOff; }
93  const std::vector<double>& vecSpmHere() const { return m_vecSpmHere; }
94  DDName spmCutName() const { return ddname(m_SpmCutName); }
95  double spmCutThick() const { return m_SpmCutThick; }
96  int spmCutShow() const { return m_SpmCutShow; }
97  double spmCutRM() const { return m_SpmCutRM; }
98  double spmCutRP() const { return m_SpmCutRP; }
99  const std::vector<double>& vecSpmCutTM() const { return m_vecSpmCutTM; }
100  const std::vector<double>& vecSpmCutTP() const { return m_vecSpmCutTP; }
101  double spmExpThick() const { return m_SpmExpThick; }
102  double spmExpWide() const { return m_SpmExpWide; }
103  double spmExpYOff() const { return m_SpmExpYOff; }
104  DDName spmSideName() const { return ddname(m_SpmSideName); }
106  double spmSideHigh() const { return m_SpmSideHigh; }
107  double spmSideThick() const { return m_SpmSideThick; }
108  double spmSideYOffM() const { return m_SpmSideYOffM; }
109  double spmSideYOffP() const { return m_SpmSideYOffP; }
110 
111  double nomCryDimAF() const { return m_NomCryDimAF; }
112  double nomCryDimLZ() const { return m_NomCryDimLZ; }
113  const std::vector<double>& vecNomCryDimBF() const { return m_vecNomCryDimBF; }
114  const std::vector<double>& vecNomCryDimCF() const { return m_vecNomCryDimCF; }
115  const std::vector<double>& vecNomCryDimAR() const { return m_vecNomCryDimAR; }
116  const std::vector<double>& vecNomCryDimBR() const { return m_vecNomCryDimBR; }
117  const std::vector<double>& vecNomCryDimCR() const { return m_vecNomCryDimCR; }
118 
119  double underAF() const { return m_UnderAF; }
120  double underLZ() const { return m_UnderLZ; }
121  double underBF() const { return m_UnderBF; }
122  double underCF() const { return m_UnderCF; }
123  double underAR() const { return m_UnderAR; }
124  double underBR() const { return m_UnderBR; }
125  double underCR() const { return m_UnderCR; }
126 
127  double wallThAlv() const { return m_WallThAlv; }
128  double wrapThAlv() const { return m_WrapThAlv; }
129  double clrThAlv() const { return m_ClrThAlv; }
130  const std::vector<double>& vecGapAlvEta() const { return m_vecGapAlvEta; }
131 
132  double wallFrAlv() const { return m_WallFrAlv; }
133  double wrapFrAlv() const { return m_WrapFrAlv; }
134  double clrFrAlv() const { return m_ClrFrAlv; }
135 
136  double wallReAlv() const { return m_WallReAlv; }
137  double wrapReAlv() const { return m_WrapReAlv; }
138  double clrReAlv() const { return m_ClrReAlv; }
139 
140  unsigned int nCryTypes() const { return m_NCryTypes; }
141  unsigned int nCryPerAlvEta() const { return m_NCryPerAlvEta; }
142 
143  const std::string& cryName() const { return m_CryName; }
144  const std::string& clrName() const { return m_ClrName; }
145  const std::string& wrapName() const { return m_WrapName; }
146  const std::string& wallName() const { return m_WallName; }
147 
148  DDMaterial cryMat() const { return ddmat(m_CryMat); }
149  DDMaterial clrMat() const { return ddmat(m_ClrMat); }
150  DDMaterial wrapMat() const { return ddmat(m_WrapMat); }
151  DDMaterial wallMat() const { return ddmat(m_WallMat); }
152  DDName capName() const { return ddname(m_capName); }
153  double capHere() const { return m_capHere; }
154  DDMaterial capMat() const { return ddmat(m_capMat); }
155  double capXSize() const { return m_capXSize; }
156  double capYSize() const { return m_capYSize; }
157  double capThick() const { return m_capThick; }
158 
159  DDName cerName() const { return ddname(m_CERName); }
160  DDMaterial cerMat() const { return ddmat(m_CERMat); }
161  double cerXSize() const { return m_CERXSize; }
162  double cerYSize() const { return m_CERYSize; }
163  double cerThick() const { return m_CERThick; }
164 
165  DDName bsiName() const { return ddname(m_BSiName); }
166  DDMaterial bsiMat() const { return ddmat(m_BSiMat); }
167  double bsiXSize() const { return m_BSiXSize; }
168  double bsiYSize() const { return m_BSiYSize; }
169  double bsiThick() const { return m_BSiThick; }
170 
171  DDName atjName() const { return ddname(m_ATJName); }
172  DDMaterial atjMat() const { return ddmat(m_ATJMat); }
173  double atjThick() const { return m_ATJThick; }
174 
175  DDName sglName() const { return ddname(m_SGLName); }
176  DDMaterial sglMat() const { return ddmat(m_SGLMat); }
177  double sglThick() const { return m_SGLThick; }
178 
179  DDName aglName() const { return ddname(m_AGLName); }
180  DDMaterial aglMat() const { return ddmat(m_AGLMat); }
181  double aglThick() const { return m_AGLThick; }
182 
183  DDName andName() const { return ddname(m_ANDName); }
184  DDMaterial andMat() const { return ddmat(m_ANDMat); }
185  double andThick() const { return m_ANDThick; }
186 
187  DDName apdName() const { return ddname(m_APDName); }
188  DDMaterial apdMat() const { return ddmat(m_APDMat); }
189  double apdSide() const { return m_APDSide; }
190  double apdThick() const { return m_APDThick; }
191  double apdZ() const { return m_APDZ; }
192  double apdX1() const { return m_APDX1; }
193  double apdX2() const { return m_APDX2; }
194 
195  double webHere() const { return m_WebHere; }
196  const std::string& webPlName() const { return m_WebPlName; }
197  const std::string& webClrName() const { return m_WebClrName; }
198  DDMaterial webPlMat() const { return ddmat(m_WebPlMat); }
199  DDMaterial webClrMat() const { return ddmat(m_WebClrMat); }
200  const std::vector<double>& vecWebPlTh() const { return m_vecWebPlTh; }
201  const std::vector<double>& vecWebClrTh() const { return m_vecWebClrTh; }
202  const std::vector<double>& vecWebLength() const { return m_vecWebLength; }
203 
204  double ilyHere() const { return m_IlyHere; }
205  const std::string& ilyName() const { return m_IlyName; }
206  double ilyPhiLow() const { return m_IlyPhiLow; }
207  double ilyDelPhi() const { return m_IlyDelPhi; }
208  const std::vector<std::string>& vecIlyMat() const { return m_vecIlyMat; }
209  const std::vector<double>& vecIlyThick() const { return m_vecIlyThick; }
210 
211  const std::string& ilyPipeName() const { return m_IlyPipeName; }
212  double ilyPipeHere() const { return m_IlyPipeHere; }
214  double ilyPipeOD() const { return m_IlyPipeOD; }
215  double ilyPipeID() const { return m_IlyPipeID; }
216  const std::vector<double>& vecIlyPipeLength() const { return m_vecIlyPipeLength; }
217  const std::vector<double>& vecIlyPipeType() const { return m_vecIlyPipeType; }
218  const std::vector<double>& vecIlyPipePhi() const { return m_vecIlyPipePhi; }
219  const std::vector<double>& vecIlyPipeZ() const { return m_vecIlyPipeZ; }
220 
221  DDName ilyPTMName() const { return ddname(m_IlyPTMName); }
222  double ilyPTMHere() const { return m_IlyPTMHere; }
223  DDMaterial ilyPTMMat() const { return ddmat(m_IlyPTMMat); }
224  double ilyPTMWidth() const { return m_IlyPTMWidth; }
225  double ilyPTMLength() const { return m_IlyPTMLength; }
226  double ilyPTMHeight() const { return m_IlyPTMHeight; }
227  const std::vector<double>& vecIlyPTMZ() const { return m_vecIlyPTMZ; }
228  const std::vector<double>& vecIlyPTMPhi() const { return m_vecIlyPTMPhi; }
229 
231  double ilyFanOutHere() const { return m_IlyFanOutHere; }
233  double ilyFanOutWidth() const { return m_IlyFanOutWidth; }
234  double ilyFanOutLength() const { return m_IlyFanOutLength; }
235  double ilyFanOutHeight() const { return m_IlyFanOutHeight; }
236  const std::vector<double>& vecIlyFanOutZ() const { return m_vecIlyFanOutZ; }
237  const std::vector<double>& vecIlyFanOutPhi() const { return m_vecIlyFanOutPhi; }
238  DDName ilyDiffName() const { return ddname(m_IlyDiffName); }
240  double ilyDiffOff() const { return m_IlyDiffOff; }
241  double ilyDiffLength() const { return m_IlyDiffLength; }
242  DDName ilyBndlName() const { return ddname(m_IlyBndlName); }
244  double ilyBndlOff() const { return m_IlyBndlOff; }
245  double ilyBndlLength() const { return m_IlyBndlLength; }
246  DDName ilyFEMName() const { return ddname(m_IlyFEMName); }
247  DDMaterial ilyFEMMat() const { return ddmat(m_IlyFEMMat); }
248  double ilyFEMWidth() const { return m_IlyFEMWidth; }
249  double ilyFEMLength() const { return m_IlyFEMLength; }
250  double ilyFEMHeight() const { return m_IlyFEMHeight; }
251  const std::vector<double>& vecIlyFEMZ() const { return m_vecIlyFEMZ; }
252  const std::vector<double>& vecIlyFEMPhi() const { return m_vecIlyFEMPhi; }
253 
254  DDName hawRName() const { return ddname(m_HawRName); }
255  DDName fawName() const { return ddname(m_FawName); }
256  double fawHere() const { return m_FawHere; }
257  double hawRHBIG() const { return m_HawRHBIG; }
258  double hawRhsml() const { return m_HawRhsml; }
259  double hawRCutY() const { return m_HawRCutY; }
260  double hawRCutZ() const { return m_HawRCutZ; }
261  double hawRCutDelY() const { return m_HawRCutDelY; }
262  double hawYOffCry() const { return m_HawYOffCry; }
263 
264  unsigned int nFawPerSupm() const { return m_NFawPerSupm; }
265  double fawPhiOff() const { return m_FawPhiOff; }
266  double fawDelPhi() const { return m_FawDelPhi; }
267  double fawPhiRot() const { return m_FawPhiRot; }
268  double fawRadOff() const { return m_FawRadOff; }
269 
270  double gridHere() const { return m_GridHere; }
271  DDName gridName() const { return ddname(m_GridName); }
272  DDMaterial gridMat() const { return ddmat(m_GridMat); }
273  double gridThick() const { return m_GridThick; }
274 
275  double backHere() const { return m_BackHere; }
276  double backXOff() const { return m_BackXOff; }
277  double backYOff() const { return m_BackYOff; }
279  double backSideHere() const { return m_BackSideHere; }
280  double backSideLength() const { return m_BackSideLength; }
281  double backSideHeight() const { return m_BackSideHeight; }
282  double backSideWidth() const { return m_BackSideWidth; }
283  double backSideYOff1() const { return m_BackSideYOff1; }
284  double backSideYOff2() const { return m_BackSideYOff2; }
285  double backSideAngle() const { return m_BackSideAngle; }
288  double backPlateHere() const { return m_BackPlateHere; }
289  double backPlateLength() const { return m_BackPlateLength; }
290  double backPlateThick() const { return m_BackPlateThick; }
291  double backPlateWidth() const { return m_BackPlateWidth; }
294  double backPlate2Thick() const { return m_BackPlate2Thick; }
296  const std::string& grilleName() const { return m_GrilleName; }
297  double grilleThick() const { return m_GrilleThick; }
298  double grilleHere() const { return m_GrilleHere; }
299  double grilleWidth() const { return m_GrilleWidth; }
300  double grilleZSpace() const { return m_GrilleZSpace; }
301  DDMaterial grilleMat() const { return ddmat(m_GrilleMat); }
302  const std::vector<double>& vecGrilleHeight() const { return m_vecGrilleHeight; }
303  const std::vector<double>& vecGrilleZOff() const { return m_vecGrilleZOff; }
304 
307  double grEdgeSlotHere() const { return m_GrEdgeSlotHere; }
308  double grEdgeSlotHeight() const { return m_GrEdgeSlotHeight; }
309  double grEdgeSlotWidth() const { return m_GrEdgeSlotWidth; }
310  const std::string& grMidSlotName() const { return m_GrMidSlotName; }
312  double grMidSlotHere() const { return m_GrMidSlotHere; }
313  double grMidSlotWidth() const { return m_GrMidSlotWidth; }
314  double grMidSlotXOff() const { return m_GrMidSlotXOff; }
315  const std::vector<double>& vecGrMidSlotHeight() const { return m_vecGrMidSlotHeight; }
316 
317  double backPipeHere() const { return m_BackPipeHere; }
318  const std::string& backPipeName() const { return m_BackPipeName; }
319  const std::vector<double>& vecBackPipeDiam() const { return m_vecBackPipeDiam; }
320  const std::vector<double>& vecBackPipeThick() const { return m_vecBackPipeThick; }
323  double backMiscHere() const { return m_BackMiscHere; }
324  const std::vector<double>& vecBackMiscThick() const { return m_vecBackMiscThick; }
325  const std::vector<std::string>& vecBackMiscName() const { return m_vecBackMiscName; }
326  const std::vector<std::string>& vecBackMiscMat() const { return m_vecBackMiscMat; }
327  double patchPanelHere() const { return m_PatchPanelHere; }
328  const std::vector<double>& vecPatchPanelThick() const { return m_vecPatchPanelThick; }
329  const std::vector<std::string>& vecPatchPanelNames() const { return m_vecPatchPanelNames; }
330  const std::vector<std::string>& vecPatchPanelMat() const { return m_vecPatchPanelMat; }
332 
333  const std::vector<std::string>& vecBackCoolName() const { return m_vecBackCoolName; }
334  double backCoolHere() const { return m_BackCoolHere; }
335  double backCoolBarWidth() const { return m_BackCoolBarWidth; }
336  double backCoolBarHeight() const { return m_BackCoolBarHeight; }
338  double backCoolBarHere() const { return m_BackCoolBarHere; }
340  double backCoolBarThick() const { return m_BackCoolBarThick; }
343  double backCoolBarSSThick() const { return m_BackCoolBarSSThick; }
346  double backCoolBarWaThick() const { return m_BackCoolBarWaThick; }
348  double backCoolVFEHere() const { return m_BackCoolVFEHere; }
351  DDName backVFEName() const { return ddname(m_BackVFEName); }
353  const std::vector<double>& vecBackVFELyrThick() const { return m_vecBackVFELyrThick; }
354  const std::vector<std::string>& vecBackVFELyrName() const { return m_vecBackVFELyrName; }
355  const std::vector<std::string>& vecBackVFELyrMat() const { return m_vecBackVFELyrMat; }
356  const std::vector<double>& vecBackCoolNSec() const { return m_vecBackCoolNSec; }
357  const std::vector<double>& vecBackCoolSecSep() const { return m_vecBackCoolSecSep; }
358  const std::vector<double>& vecBackCoolNPerSec() const { return m_vecBackCoolNPerSec; }
359  double backCBStdSep() const { return m_BackCBStdSep; }
360 
361  double backCoolTankHere() const { return m_BackCoolTankHere; }
363  double backCoolTankWidth() const { return m_BackCoolTankWidth; }
364  double backCoolTankThick() const { return m_BackCoolTankThick; }
367  double backCoolTankWaWidth() const { return m_BackCoolTankWaWidth; }
369  const std::string& backBracketName() const { return m_BackBracketName; }
370  double backBracketHeight() const { return m_BackBracketHeight; }
372 
373  double dryAirTubeHere() const { return m_DryAirTubeHere; }
374  const std::string& dryAirTubeName() const { return m_DryAirTubeName; }
375  double mBCoolTubeNum() const { return m_MBCoolTubeNum; }
376  double dryAirTubeInnDiam() const { return m_DryAirTubeInnDiam; }
377  double dryAirTubeOutDiam() const { return m_DryAirTubeOutDiam; }
379  double mBCoolTubeHere() const { return m_MBCoolTubeHere; }
380  const std::string& mBCoolTubeName() const { return m_MBCoolTubeName; }
381  double mBCoolTubeInnDiam() const { return m_MBCoolTubeInnDiam; }
382  double mBCoolTubeOutDiam() const { return m_MBCoolTubeOutDiam; }
384  double mBManifHere() const { return m_MBManifHere; }
385  DDName mBManifName() const { return ddname(m_MBManifName); }
386  double mBManifInnDiam() const { return m_MBManifInnDiam; }
387  double mBManifOutDiam() const { return m_MBManifOutDiam; }
389  double mBLyrHere() const { return m_MBLyrHere; }
390  const std::vector<double>& vecMBLyrThick() const { return m_vecMBLyrThick; }
391  const std::vector<std::string>& vecMBLyrName() const { return m_vecMBLyrName; }
392  const std::vector<std::string>& vecMBLyrMat() const { return m_vecMBLyrMat; }
393 
394  //----------
395 
396  double pincerRodHere() const { return m_PincerRodHere; }
399  std::vector<double> vecPincerRodAzimuth() const { return m_vecPincerRodAzimuth; }
402  double pincerEnvWidth() const { return m_PincerEnvWidth; }
403  double pincerEnvHeight() const { return m_PincerEnvHeight; }
404  double pincerEnvLength() const { return m_PincerEnvLength; }
405  std::vector<double> vecPincerEnvZOff() const { return m_vecPincerEnvZOff; }
406 
409  double pincerBlkLength() const { return m_PincerBlkLength; }
410 
412  double pincerShimHeight() const { return m_PincerShimHeight; }
415  double pincerShim1Width() const { return m_PincerShim1Width; }
416  double pincerShim2Width() const { return m_PincerShim2Width; }
417 
420  double pincerCutWidth() const { return m_PincerCutWidth; }
421  double pincerCutHeight() const { return m_PincerCutHeight; }
422 
423 protected:
424 private:
425  void web(unsigned int iWeb,
426  double bWeb,
427  double BWeb,
428  double LWeb,
429  double theta,
430  const Pt3D& corner,
431  const DDLogicalPart& logPar,
432  double& zee,
433  double side,
434  double front,
435  double delta,
436  DDCompactView& cpv);
437 
438  std::string m_idNameSpace; //Namespace of this and ALL sub-parts
439 
440  // Barrel volume
441  std::string m_BarName; // Barrel volume name
442  std::string m_BarMat; // Barrel material name
443  std::vector<double> m_vecBarZPts; // Barrel list of z pts
444  std::vector<double> m_vecBarRMin; // Barrel list of rMin pts
445  std::vector<double> m_vecBarRMax; // Barrel list of rMax pts
446  std::vector<double> m_vecBarTran; // Barrel translation
447  std::vector<double> m_vecBarRota; // Barrel rotation
448  std::vector<double> m_vecBarRota2; // 2nd Barrel rotation
449  std::vector<double> m_vecBarRota3; // 2nd Barrel rotation
450  double m_BarPhiLo; // Barrel phi lo
451  double m_BarPhiHi; // Barrel phi hi
452  double m_BarHere; // Barrel presence flag
453 
454  // Supermodule volume
455  std::string m_SpmName; // Supermodule volume name
456  std::string m_SpmMat; // Supermodule material name
457  std::vector<double> m_vecSpmZPts; // Supermodule list of z pts
458  std::vector<double> m_vecSpmRMin; // Supermodule list of rMin pts
459  std::vector<double> m_vecSpmRMax; // Supermodule list of rMax pts
460  std::vector<double> m_vecSpmTran; // Supermodule translation
461  std::vector<double> m_vecSpmRota; // Supermodule rotation
462  std::vector<double> m_vecSpmBTran; // Base Supermodule translation
463  std::vector<double> m_vecSpmBRota; // Base Supermodule rotation
464  unsigned int m_SpmNPerHalf; // # Supermodules per half detector
465  double m_SpmLowPhi; // Low phi value of base supermodule
466  double m_SpmDelPhi; // Delta phi value of base supermodule
467  double m_SpmPhiOff; // Phi offset value supermodule
468  std::vector<double> m_vecSpmHere; // Bit saying if a supermodule is present or not
469  std::string m_SpmCutName; // Name of cut box
470  double m_SpmCutThick; // Box thickness
471  int m_SpmCutShow; // Non-zero means show the box on display (testing only)
472  std::vector<double> m_vecSpmCutTM; // Translation for minus phi cut box
473  std::vector<double> m_vecSpmCutTP; // Translation for plus phi cut box
474  double m_SpmCutRM; // Rotation for minus phi cut box
475  double m_SpmCutRP; // Rotation for plus phi cut box
476  double m_SpmExpThick; // Thickness (x) of supermodule expansion box
477  double m_SpmExpWide; // Width (y) of supermodule expansion box
478  double m_SpmExpYOff; // Offset (y) of supermodule expansion box
479  std::string m_SpmSideName; // Supermodule Side Plate volume name
480  std::string m_SpmSideMat; // Supermodule Side Plate material name
481  double m_SpmSideHigh; // Side plate height
482  double m_SpmSideThick; // Side plate thickness
483  double m_SpmSideYOffM; // Side plate Y offset on minus phi side
484  double m_SpmSideYOffP; // Side plate Y offset on plus phi side
485 
486  double m_NomCryDimAF; // Nominal crystal AF
487  double m_NomCryDimLZ; // Nominal crystal LZ
488  std::vector<double> m_vecNomCryDimBF; // Nominal crystal BF
489  std::vector<double> m_vecNomCryDimCF; // Nominal crystal CF
490  std::vector<double> m_vecNomCryDimAR; // Nominal crystal AR
491  std::vector<double> m_vecNomCryDimBR; // Nominal crystal BR
492  std::vector<double> m_vecNomCryDimCR; // Nominal crystal CR
493 
494  double m_UnderAF; // undershoot of AF
495  double m_UnderLZ; // undershoot of LZ
496  double m_UnderBF; // undershoot of BF
497  double m_UnderCF; // undershoot of CF
498  double m_UnderAR; // undershoot of AR
499  double m_UnderBR; // undershoot of BR
500  double m_UnderCR; // undershoot of CR
501 
502  double m_WallThAlv; // alveoli wall thickness
503  double m_WrapThAlv; // wrapping thickness
504  double m_ClrThAlv; // clearance thickness (nominal)
505  std::vector<double> m_vecGapAlvEta; // Extra clearance after each alveoli perp to crystal axis
506 
507  double m_WallFrAlv; // alveoli wall frontage
508  double m_WrapFrAlv; // wrapping frontage
509  double m_ClrFrAlv; // clearance frontage (nominal)
510 
511  double m_WallReAlv; // alveoli wall rearage
512  double m_WrapReAlv; // wrapping rearage
513  double m_ClrReAlv; // clearance rearage (nominal)
514 
515  unsigned int m_NCryTypes; // number of crystal shapes
516  unsigned int m_NCryPerAlvEta; // number of crystals in eta per alveolus
517 
518  std::string m_CryName; // string name of crystal volume
519  std::string m_ClrName; // string name of clearance volume
520  std::string m_WrapName; // string name of wrap volume
521  std::string m_WallName; // string name of wall volume
522 
523  std::string m_CryMat; // string name of crystal material
524  std::string m_ClrMat; // string name of clearance material
525  std::string m_WrapMat; // string name of wrap material
526  std::string m_WallMat; // string name of wall material
527 
528  std::string m_capName; // Capsule
529  double m_capHere; //
531  double m_capXSize; //
532  double m_capYSize; //
533  double m_capThick; //
534 
535  std::string m_CERName; // Ceramic
537  double m_CERXSize; //
538  double m_CERYSize; //
539  double m_CERThick; //
540 
541  std::string m_BSiName; // Bulk Silicon
543  double m_BSiXSize; //
544  double m_BSiYSize; //
545  double m_BSiThick; //
546 
549  double m_APDSide; //
550  double m_APDThick; //
551  double m_APDZ; //
552  double m_APDX1; //
553  double m_APDX2; //
554 
555  std::string m_ATJName; // After-The-Junction
557  double m_ATJThick; //
558 
559  std::string m_SGLName; // APD-Silicone glue
561  double m_SGLThick; //
562 
563  std::string m_AGLName; // APD-Glue
565  double m_AGLThick; //
566 
567  std::string m_ANDName; // APD-Non-Depleted
569  double m_ANDThick; //
570 
571  double m_WebHere; // here flag
572  std::string m_WebPlName; // string name of web plate volume
573  std::string m_WebClrName; // string name of web clearance volume
574  std::string m_WebPlMat; // string name of web material
575  std::string m_WebClrMat; // string name of web clearance material
576  std::vector<double> m_vecWebPlTh; // Thickness of web plates
577  std::vector<double> m_vecWebClrTh; // Thickness of total web clearance
578  std::vector<double> m_vecWebLength; // Length of web plate
579 
580  double m_IlyHere; // here flag
581  std::string m_IlyName; // string name of inner layer volume
582  double m_IlyPhiLow; // low phi of volumes
583  double m_IlyDelPhi; // delta phi of ily
584  std::vector<std::string> m_vecIlyMat; // materials of inner layer volumes
585  std::vector<double> m_vecIlyThick; // Thicknesses of inner layer volumes
586 
587  std::string m_IlyPipeName; // Cooling pipes
588  double m_IlyPipeHere; //
590  double m_IlyPipeOD; //
591  double m_IlyPipeID; //
592  std::vector<double> m_vecIlyPipeLength; //
593  std::vector<double> m_vecIlyPipeType; //
594  std::vector<double> m_vecIlyPipePhi; //
595  std::vector<double> m_vecIlyPipeZ; //
596 
598  double m_IlyPTMHere; //
600  double m_IlyPTMWidth; //
601  double m_IlyPTMLength; //
602  double m_IlyPTMHeight; //
603  std::vector<double> m_vecIlyPTMZ; //
604  std::vector<double> m_vecIlyPTMPhi; //
605 
607  double m_IlyFanOutHere; //
609  double m_IlyFanOutWidth; //
610  double m_IlyFanOutLength; //
611  double m_IlyFanOutHeight; //
612  std::vector<double> m_vecIlyFanOutZ; //
613  std::vector<double> m_vecIlyFanOutPhi; //
616  double m_IlyDiffOff; //
617  double m_IlyDiffLength; //
618  std::string m_IlyBndlName; // Fiber bundle
620  double m_IlyBndlOff; //
621  double m_IlyBndlLength; //
624  double m_IlyFEMWidth; //
625  double m_IlyFEMLength; //
626  double m_IlyFEMHeight; //
627  std::vector<double> m_vecIlyFEMZ; //
628  std::vector<double> m_vecIlyFEMPhi; //
629 
630  std::string m_HawRName; // string name of half-alveolar wedge
631  std::string m_FawName; // string name of full-alveolar wedge
632  double m_FawHere; // here flag
633  double m_HawRHBIG; // height at big end of half alveolar wedge
634  double m_HawRhsml; // height at small end of half alveolar wedge
635  double m_HawRCutY; // x dim of hawR cut box
636  double m_HawRCutZ; // y dim of hawR cut box
637  double m_HawRCutDelY; // y offset of hawR cut box from top of HAW
638  double m_HawYOffCry; // Y offset of crystal wrt HAW at front
639  unsigned int m_NFawPerSupm; // Number of Full Alv. Wedges per supermodule
640  double m_FawPhiOff; // Phi offset for FAW placement
641  double m_FawDelPhi; // Phi delta for FAW placement
642  double m_FawPhiRot; // Phi rotation of FAW about own axis prior to placement
643  double m_FawRadOff; // Radial offset for FAW placement
644 
645  double m_GridHere; // here flag
646  std::string m_GridName; // Grid name
647  std::string m_GridMat; // Grid material
648  double m_GridThick; // Grid Thickness
649 
650  double m_BackXOff; //
651  double m_BackYOff; //
652 
653  double m_BackHere; // here flag
655  double m_BackSideHere; //
656  double m_BackSideLength; //
657  double m_BackSideHeight; //
658  double m_BackSideWidth; //
659  double m_BackSideYOff1; //
660  double m_BackSideYOff2; //
661  double m_BackSideAngle; //
664  double m_BackPlateHere; //
665  double m_BackPlateLength; //
666  double m_BackPlateThick; //
667  double m_BackPlateWidth; //
670  double m_BackPlate2Thick; //
673  double m_GrilleHere; //
674  double m_GrilleThick; //
675  double m_GrilleWidth; //
676  double m_GrilleZSpace; //
678  std::vector<double> m_vecGrilleHeight; //
679  std::vector<double> m_vecGrilleZOff; //
680 
681  std::string m_GrEdgeSlotName; // Slots in Grille
683  double m_GrEdgeSlotHere; //
685  double m_GrEdgeSlotWidth; //
686 
687  std::string m_GrMidSlotName; // Slots in Grille
689  double m_GrMidSlotHere; //
690  double m_GrMidSlotWidth; //
691  double m_GrMidSlotXOff; //
692  std::vector<double> m_vecGrMidSlotHeight; //
693 
694  double m_BackPipeHere; // here flag
696  std::vector<double> m_vecBackPipeDiam; // pipes
697  std::vector<double> m_vecBackPipeThick; // pipes
700 
701  std::vector<std::string> m_vecBackCoolName; // cooling circuits
702  double m_BackCoolHere; // here flag
703  double m_BackCoolBarHere; // here flag
710  std::string m_BackCoolBarSSName; // cooling bar tubing
713  std::string m_BackCoolBarWaName; // cooling bar water
716  double m_BackCoolVFEHere; // here flag
721  std::vector<double> m_vecBackVFELyrThick; //
722  std::vector<std::string> m_vecBackVFELyrName; //
723  std::vector<std::string> m_vecBackVFELyrMat; //
724  std::vector<double> m_vecBackCoolNSec; //
725  std::vector<double> m_vecBackCoolSecSep; //
726  std::vector<double> m_vecBackCoolNPerSec; //
727  double m_BackMiscHere; // here flag
728  std::vector<double> m_vecBackMiscThick; // misc materials
729  std::vector<std::string> m_vecBackMiscName; //
730  std::vector<std::string> m_vecBackMiscMat; //
731  double m_BackCBStdSep; //
732 
733  double m_PatchPanelHere; // here flag
735  std::vector<double> m_vecPatchPanelThick; // patch panel materials
736  std::vector<std::string> m_vecPatchPanelNames; //
737  std::vector<std::string> m_vecPatchPanelMat; //
738 
739  double m_BackCoolTankHere; // here flag
750 
751  double m_DryAirTubeHere; // here flag
752  std::string m_DryAirTubeName; // dry air tube
753  unsigned int m_MBCoolTubeNum; //
757  double m_MBCoolTubeHere; // here flag
758  std::string m_MBCoolTubeName; // mothr bd cooling tube
762  double m_MBManifHere; // here flag
763  std::string m_MBManifName; //mother bd manif
764  double m_MBManifInnDiam; //
765  double m_MBManifOutDiam; //
767  double m_MBLyrHere; // here flag
768  std::vector<double> m_vecMBLyrThick; // mother bd lyrs
769  std::vector<std::string> m_vecMBLyrName; //
770  std::vector<std::string> m_vecMBLyrMat; //
771 
772  //-------------------------------------------------------------------
773 
774  double m_PincerRodHere; // here flag
777  std::vector<double> m_vecPincerRodAzimuth; //
778 
779  std::string m_PincerEnvName; // pincer envelope
781  double m_PincerEnvWidth; //
782  double m_PincerEnvHeight; //
783  double m_PincerEnvLength; //
784  std::vector<double> m_vecPincerEnvZOff; //
785 
786  std::string m_PincerBlkName; // pincer block
788  double m_PincerBlkLength; //
789 
796 
797  std::string m_PincerCutName; // pincer block
799  double m_PincerCutWidth; //
800  double m_PincerCutHeight; //
801 };
802 
803 namespace std {}
804 using namespace std;
805 
807  : m_idNameSpace(""),
808  m_BarName(""),
809  m_BarMat(""),
810  m_vecBarZPts(),
811  m_vecBarRMin(),
812  m_vecBarRMax(),
813  m_vecBarTran(),
814  m_vecBarRota(),
815  m_vecBarRota2(),
816  m_vecBarRota3(),
817  m_BarPhiLo(0),
818  m_BarPhiHi(0),
819  m_BarHere(0),
820  m_SpmName(""),
821  m_SpmMat(""),
822  m_vecSpmZPts(),
823  m_vecSpmRMin(),
824  m_vecSpmRMax(),
825  m_vecSpmTran(),
826  m_vecSpmRota(),
827  m_vecSpmBTran(),
828  m_vecSpmBRota(),
829  m_SpmNPerHalf(0),
830  m_SpmLowPhi(0),
831  m_SpmDelPhi(0),
832  m_SpmPhiOff(0),
833  m_vecSpmHere(),
834  m_SpmCutName(""),
835  m_SpmCutThick(0),
836  m_SpmCutShow(0),
837  m_vecSpmCutTM(),
838  m_vecSpmCutTP(),
839  m_SpmCutRM(0),
840  m_SpmCutRP(0),
841  m_SpmExpThick(0),
842  m_SpmExpWide(0),
843  m_SpmExpYOff(0),
844  m_SpmSideName(""),
845  m_SpmSideMat(""),
846  m_SpmSideHigh(0),
847  m_SpmSideThick(0),
848  m_SpmSideYOffM(0),
849  m_SpmSideYOffP(0),
850  m_NomCryDimAF(0),
851  m_NomCryDimLZ(0),
852  m_vecNomCryDimBF(),
853  m_vecNomCryDimCF(),
854  m_vecNomCryDimAR(),
855  m_vecNomCryDimBR(),
856  m_vecNomCryDimCR(),
857  m_UnderAF(0),
858  m_UnderLZ(0),
859  m_UnderBF(0),
860  m_UnderCF(0),
861  m_UnderAR(0),
862  m_UnderBR(0),
863  m_UnderCR(0),
864  m_WallThAlv(0),
865  m_WrapThAlv(0),
866  m_ClrThAlv(0),
867  m_vecGapAlvEta(),
868  m_WallFrAlv(0),
869  m_WrapFrAlv(0),
870  m_ClrFrAlv(0),
871  m_WallReAlv(0),
872  m_WrapReAlv(0),
873  m_ClrReAlv(0),
874  m_NCryTypes(0),
875  m_NCryPerAlvEta(0),
876  m_CryName(""),
877  m_ClrName(""),
878  m_WrapName(""),
879  m_WallName(""),
880  m_CryMat(""),
881  m_ClrMat(""),
882  m_WrapMat(""),
883  m_WallMat(""),
884 
885  m_capName(""),
886  m_capHere(0),
887  m_capMat(""),
888  m_capXSize(0),
889  m_capYSize(0),
890  m_capThick(0),
891 
892  m_CERName(""),
893  m_CERMat(""),
894  m_CERXSize(0),
895  m_CERYSize(0),
896  m_CERThick(0),
897 
898  m_BSiName(""),
899  m_BSiMat(""),
900  m_BSiXSize(0),
901  m_BSiYSize(0),
902  m_BSiThick(0),
903 
904  m_APDName(""),
905  m_APDMat(""),
906  m_APDSide(0),
907  m_APDThick(0),
908  m_APDZ(0),
909  m_APDX1(0),
910  m_APDX2(0),
911 
912  m_ATJName(""),
913  m_ATJMat(""),
914  m_ATJThick(0),
915 
916  m_SGLName(""),
917  m_SGLMat(""),
918  m_SGLThick(0),
919 
920  m_AGLName(""),
921  m_AGLMat(""),
922  m_AGLThick(0),
923 
924  m_ANDName(""),
925  m_ANDMat(""),
926  m_ANDThick(0),
927 
928  m_WebHere(0),
929  m_WebPlName(""),
930  m_WebClrName(""),
931  m_WebPlMat(""),
932  m_WebClrMat(""),
933  m_vecWebPlTh(),
934  m_vecWebClrTh(),
935  m_vecWebLength(),
936  m_IlyHere(0),
937  m_IlyName(),
938  m_IlyPhiLow(0),
939  m_IlyDelPhi(0),
940  m_vecIlyMat(),
941  m_vecIlyThick(),
942  m_IlyPipeName(""),
943  m_IlyPipeHere(0),
944  m_IlyPipeMat(""),
945  m_IlyPipeOD(0),
946  m_IlyPipeID(0),
947  m_vecIlyPipeLength(),
948  m_vecIlyPipeType(),
949  m_vecIlyPipePhi(),
950  m_vecIlyPipeZ(),
951  m_IlyPTMName(""),
952  m_IlyPTMHere(0),
953  m_IlyPTMMat(""),
954  m_IlyPTMWidth(0),
955  m_IlyPTMLength(0),
956  m_IlyPTMHeight(0),
957  m_vecIlyPTMZ(),
958  m_vecIlyPTMPhi(),
959  m_IlyFanOutName(""),
960  m_IlyFanOutHere(0),
961  m_IlyFanOutMat(""),
962  m_IlyFanOutWidth(0),
963  m_IlyFanOutLength(0),
964  m_IlyFanOutHeight(0),
965  m_vecIlyFanOutZ(),
966  m_vecIlyFanOutPhi(),
967  m_IlyDiffName(""),
968  m_IlyDiffMat(""),
969  m_IlyDiffOff(0),
970  m_IlyDiffLength(0),
971  m_IlyBndlName(""),
972  m_IlyBndlMat(""),
973  m_IlyBndlOff(0),
974  m_IlyBndlLength(0),
975  m_IlyFEMName(""),
976  m_IlyFEMMat(""),
977  m_IlyFEMWidth(0),
978  m_IlyFEMLength(0),
979  m_IlyFEMHeight(0),
980  m_vecIlyFEMZ(),
981  m_vecIlyFEMPhi(),
982  m_HawRName(""),
983  m_FawName(""),
984  m_FawHere(0),
985  m_HawRHBIG(0),
986  m_HawRhsml(0),
987  m_HawRCutY(0),
988  m_HawRCutZ(0),
989  m_HawRCutDelY(0),
990  m_HawYOffCry(0),
991  m_NFawPerSupm(0),
992  m_FawPhiOff(0),
993  m_FawDelPhi(0),
994  m_FawPhiRot(0),
995  m_FawRadOff(0),
996  m_GridHere(0),
997  m_GridName(""),
998  m_GridMat(""),
999  m_GridThick(0),
1000  m_BackXOff(0),
1001  m_BackYOff(0),
1002  m_BackHere(0),
1003  m_BackSideName(""),
1004  m_BackSideHere(0),
1005  m_BackSideLength(0),
1006  m_BackSideHeight(0),
1007  m_BackSideWidth(0),
1008  m_BackSideYOff1(0),
1009  m_BackSideYOff2(0),
1010  m_BackSideAngle(0),
1011  m_BackSideMat(""),
1012  m_BackPlateName(""),
1013  m_BackPlateHere(0),
1014  m_BackPlateLength(0),
1015  m_BackPlateThick(0),
1016  m_BackPlateWidth(0),
1017  m_BackPlateMat(""),
1018  m_BackPlate2Name(""),
1019  m_BackPlate2Thick(0),
1020  m_BackPlate2Mat(""),
1021  m_GrilleName(""),
1022  m_GrilleHere(0),
1023  m_GrilleThick(0),
1024  m_GrilleWidth(0),
1025  m_GrilleZSpace(0),
1026  m_GrilleMat(""),
1027  m_vecGrilleHeight(),
1028  m_vecGrilleZOff(),
1029  m_GrEdgeSlotName(""),
1030  m_GrEdgeSlotMat(""),
1031  m_GrEdgeSlotHere(0),
1032  m_GrEdgeSlotHeight(0),
1033  m_GrEdgeSlotWidth(0),
1034  m_GrMidSlotName(""),
1035  m_GrMidSlotMat(""),
1036  m_GrMidSlotHere(0),
1037  m_GrMidSlotWidth(0),
1038  m_GrMidSlotXOff(0),
1039  m_vecGrMidSlotHeight(),
1040  m_BackPipeHere(0),
1041  m_BackPipeName(""),
1042  m_vecBackPipeDiam(),
1043  m_vecBackPipeThick(),
1044  m_BackPipeMat(""),
1045  m_BackPipeWaterMat(""),
1046 
1047  m_vecBackCoolName(),
1048  m_BackCoolHere(0),
1049  m_BackCoolBarHere(0),
1050  m_BackCoolBarWidth(0),
1051  m_BackCoolBarHeight(0),
1052  m_BackCoolMat(""),
1053  m_BackCoolBarName(""),
1054  m_BackCoolBarThick(0),
1055  m_BackCoolBarMat(""),
1056  m_BackCoolBarSSName(""),
1057  m_BackCoolBarSSThick(0),
1058  m_BackCoolBarSSMat(""),
1059  m_BackCoolBarWaName(""),
1060  m_BackCoolBarWaThick(0),
1061  m_BackCoolBarWaMat(""),
1062  m_BackCoolVFEHere(0),
1063  m_BackCoolVFEName(""),
1064  m_BackCoolVFEMat(""),
1065  m_BackVFEName(""),
1066  m_BackVFEMat(""),
1067  m_vecBackVFELyrThick(),
1068  m_vecBackVFELyrName(),
1069  m_vecBackVFELyrMat(),
1070  m_vecBackCoolNSec(),
1071  m_vecBackCoolSecSep(),
1072  m_vecBackCoolNPerSec(),
1073 
1074  m_BackMiscHere(0),
1075  m_vecBackMiscThick(),
1076  m_vecBackMiscName(),
1077  m_vecBackMiscMat(),
1078  m_BackCBStdSep(0),
1079  m_PatchPanelHere(0),
1080  m_PatchPanelName(""),
1081  m_vecPatchPanelThick(),
1082  m_vecPatchPanelNames(),
1083  m_vecPatchPanelMat(),
1084  m_BackCoolTankHere(0),
1085  m_BackCoolTankName(""),
1086  m_BackCoolTankWidth(0),
1087  m_BackCoolTankThick(0),
1088  m_BackCoolTankMat(""),
1089  m_BackCoolTankWaName(""),
1090  m_BackCoolTankWaWidth(0),
1091  m_BackCoolTankWaMat(""),
1092  m_BackBracketName(""),
1093  m_BackBracketHeight(0),
1094  m_BackBracketMat(""),
1095 
1096  m_DryAirTubeHere(0),
1097  m_DryAirTubeName(""),
1098  m_MBCoolTubeNum(0),
1099  m_DryAirTubeInnDiam(0),
1100  m_DryAirTubeOutDiam(0),
1101  m_DryAirTubeMat(""),
1102  m_MBCoolTubeHere(0),
1103  m_MBCoolTubeName(""),
1104  m_MBCoolTubeInnDiam(0),
1105  m_MBCoolTubeOutDiam(0),
1106  m_MBCoolTubeMat(""),
1107  m_MBManifHere(0),
1108  m_MBManifName(""),
1109  m_MBManifInnDiam(0),
1110  m_MBManifOutDiam(0),
1111  m_MBManifMat(""),
1112  m_MBLyrHere(0),
1113  m_vecMBLyrThick(0),
1114  m_vecMBLyrName(),
1115  m_vecMBLyrMat(),
1116 
1117  m_PincerRodHere(0),
1118  m_PincerRodName(""),
1119  m_PincerRodMat(""),
1120  m_vecPincerRodAzimuth(),
1121  m_PincerEnvName(""),
1122  m_PincerEnvMat(""),
1123  m_PincerEnvWidth(0),
1124  m_PincerEnvHeight(0),
1125  m_PincerEnvLength(0),
1126  m_vecPincerEnvZOff(),
1127  m_PincerBlkName(""),
1128  m_PincerBlkMat(""),
1129  m_PincerBlkLength(0),
1130  m_PincerShim1Name(""),
1131  m_PincerShimHeight(0),
1132  m_PincerShim2Name(""),
1133  m_PincerShimMat(""),
1134  m_PincerShim1Width(0),
1135  m_PincerShim2Width(0),
1136  m_PincerCutName(""),
1137  m_PincerCutMat(""),
1138  m_PincerCutWidth(0),
1139  m_PincerCutHeight(0)
1140 
1141 {
1142 #ifdef EDM_ML_DEBUG
1143  edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Creating an instance";
1144 #endif
1145 }
1146 
1148 
1150  const DDVectorArguments& vArgs,
1151  const DDMapArguments& /*mArgs*/,
1152  const DDStringArguments& sArgs,
1153  const DDStringVectorArguments& vsArgs) {
1154 #ifdef EDM_ML_DEBUG
1155  edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Initialize";
1156 #endif
1158  // TRICK!
1159  m_idNameSpace = parent().name().ns();
1160  // barrel parent volume
1161  m_BarName = sArgs["BarName"];
1162  m_BarMat = sArgs["BarMat"];
1163  m_vecBarZPts = vArgs["BarZPts"];
1164  m_vecBarRMin = vArgs["BarRMin"];
1165  m_vecBarRMax = vArgs["BarRMax"];
1166  m_vecBarTran = vArgs["BarTran"];
1167  m_vecBarRota = vArgs["BarRota"];
1168  m_vecBarRota2 = vArgs["BarRota2"];
1169  m_vecBarRota3 = vArgs["BarRota3"];
1170  m_BarPhiLo = nArgs["BarPhiLo"];
1171  m_BarPhiHi = nArgs["BarPhiHi"];
1172  m_BarHere = nArgs["BarHere"];
1173 
1174  m_SpmName = sArgs["SpmName"];
1175  m_SpmMat = sArgs["SpmMat"];
1176  m_vecSpmZPts = vArgs["SpmZPts"];
1177  m_vecSpmRMin = vArgs["SpmRMin"];
1178  m_vecSpmRMax = vArgs["SpmRMax"];
1179  m_vecSpmTran = vArgs["SpmTran"];
1180  m_vecSpmRota = vArgs["SpmRota"];
1181  m_vecSpmBTran = vArgs["SpmBTran"];
1182  m_vecSpmBRota = vArgs["SpmBRota"];
1183  m_SpmNPerHalf = static_cast<unsigned int>(nArgs["SpmNPerHalf"]);
1184  m_SpmLowPhi = nArgs["SpmLowPhi"];
1185  m_SpmDelPhi = nArgs["SpmDelPhi"];
1186  m_SpmPhiOff = nArgs["SpmPhiOff"];
1187  m_vecSpmHere = vArgs["SpmHere"];
1188  m_SpmCutName = sArgs["SpmCutName"];
1189  m_SpmCutThick = nArgs["SpmCutThick"];
1190  m_SpmCutShow = int(nArgs["SpmCutShow"]);
1191  m_vecSpmCutTM = vArgs["SpmCutTM"];
1192  m_vecSpmCutTP = vArgs["SpmCutTP"];
1193  m_SpmCutRM = nArgs["SpmCutRM"];
1194  m_SpmCutRP = nArgs["SpmCutRP"];
1195  m_SpmExpThick = nArgs["SpmExpThick"];
1196  m_SpmExpWide = nArgs["SpmExpWide"];
1197  m_SpmExpYOff = nArgs["SpmExpYOff"];
1198  m_SpmSideName = sArgs["SpmSideName"];
1199  m_SpmSideMat = sArgs["SpmSideMat"];
1200  m_SpmSideHigh = nArgs["SpmSideHigh"];
1201  m_SpmSideThick = nArgs["SpmSideThick"];
1202  m_SpmSideYOffM = nArgs["SpmSideYOffM"];
1203  m_SpmSideYOffP = nArgs["SpmSideYOffP"];
1204 
1205  m_NomCryDimAF = nArgs["NomCryDimAF"];
1206  m_NomCryDimLZ = nArgs["NomCryDimLZ"];
1207  m_vecNomCryDimBF = vArgs["NomCryDimBF"];
1208  m_vecNomCryDimCF = vArgs["NomCryDimCF"];
1209  m_vecNomCryDimAR = vArgs["NomCryDimAR"];
1210  m_vecNomCryDimBR = vArgs["NomCryDimBR"];
1211  m_vecNomCryDimCR = vArgs["NomCryDimCR"];
1212 
1213  m_UnderAF = nArgs["UnderAF"];
1214  m_UnderLZ = nArgs["UnderLZ"];
1215  m_UnderBF = nArgs["UnderBF"];
1216  m_UnderCF = nArgs["UnderCF"];
1217  m_UnderAR = nArgs["UnderAR"];
1218  m_UnderBR = nArgs["UnderBR"];
1219  m_UnderCR = nArgs["UnderCR"];
1220 
1221  m_WallThAlv = nArgs["WallThAlv"];
1222  m_WrapThAlv = nArgs["WrapThAlv"];
1223  m_ClrThAlv = nArgs["ClrThAlv"];
1224  m_vecGapAlvEta = vArgs["GapAlvEta"];
1225 
1226  m_WallFrAlv = nArgs["WallFrAlv"];
1227  m_WrapFrAlv = nArgs["WrapFrAlv"];
1228  m_ClrFrAlv = nArgs["ClrFrAlv"];
1229 
1230  m_WallReAlv = nArgs["WallReAlv"];
1231  m_WrapReAlv = nArgs["WrapReAlv"];
1232  m_ClrReAlv = nArgs["ClrReAlv"];
1233 
1234  m_NCryTypes = static_cast<unsigned int>(nArgs["NCryTypes"]);
1235  m_NCryPerAlvEta = static_cast<unsigned int>(nArgs["NCryPerAlvEta"]);
1236 
1237  m_CryName = sArgs["CryName"];
1238  m_ClrName = sArgs["ClrName"];
1239  m_WrapName = sArgs["WrapName"];
1240  m_WallName = sArgs["WallName"];
1241 
1242  m_CryMat = sArgs["CryMat"];
1243  m_ClrMat = sArgs["ClrMat"];
1244  m_WrapMat = sArgs["WrapMat"];
1245  m_WallMat = sArgs["WallMat"];
1246 
1247  m_capName = sArgs["CapName"];
1248  m_capHere = nArgs["CapHere"];
1249  m_capMat = sArgs["CapMat"];
1250  m_capXSize = nArgs["CapXSize"];
1251  m_capYSize = nArgs["CapYSize"];
1252  m_capThick = nArgs["CapThick"];
1253 
1254  m_CERName = sArgs["CerName"];
1255  m_CERMat = sArgs["CerMat"];
1256  m_CERXSize = nArgs["CerXSize"];
1257  m_CERYSize = nArgs["CerYSize"];
1258  m_CERThick = nArgs["CerThick"];
1259 
1260  m_BSiName = sArgs["BSiName"];
1261  m_BSiMat = sArgs["BSiMat"];
1262  m_BSiXSize = nArgs["BSiXSize"];
1263  m_BSiYSize = nArgs["BSiYSize"];
1264  m_BSiThick = nArgs["BSiThick"];
1265 
1266  m_APDName = sArgs["APDName"];
1267  m_APDMat = sArgs["APDMat"];
1268  m_APDSide = nArgs["APDSide"];
1269  m_APDThick = nArgs["APDThick"];
1270  m_APDZ = nArgs["APDZ"];
1271  m_APDX1 = nArgs["APDX1"];
1272  m_APDX2 = nArgs["APDX2"];
1273 
1274  m_ATJName = sArgs["ATJName"];
1275  m_ATJMat = sArgs["ATJMat"];
1276  m_ATJThick = nArgs["ATJThick"];
1277 
1278  m_SGLName = sArgs["SGLName"];
1279  m_SGLMat = sArgs["SGLMat"];
1280  m_SGLThick = nArgs["SGLThick"];
1281 
1282  m_AGLName = sArgs["AGLName"];
1283  m_AGLMat = sArgs["AGLMat"];
1284  m_AGLThick = nArgs["AGLThick"];
1285 
1286  m_ANDName = sArgs["ANDName"];
1287  m_ANDMat = sArgs["ANDMat"];
1288  m_ANDThick = nArgs["ANDThick"];
1289 
1290  m_WebHere = nArgs["WebHere"];
1291  m_WebPlName = sArgs["WebPlName"];
1292  m_WebClrName = sArgs["WebClrName"];
1293  m_WebPlMat = sArgs["WebPlMat"];
1294  m_WebClrMat = sArgs["WebClrMat"];
1295  m_vecWebPlTh = vArgs["WebPlTh"];
1296  m_vecWebClrTh = vArgs["WebClrTh"];
1297  m_vecWebLength = vArgs["WebLength"];
1298 
1299  m_IlyHere = nArgs["IlyHere"];
1300  m_IlyName = sArgs["IlyName"];
1301  m_IlyPhiLow = nArgs["IlyPhiLow"];
1302  m_IlyDelPhi = nArgs["IlyDelPhi"];
1303  m_vecIlyMat = vsArgs["IlyMat"];
1304  m_vecIlyThick = vArgs["IlyThick"];
1305 
1306  m_IlyPipeName = sArgs["IlyPipeName"];
1307  m_IlyPipeHere = nArgs["IlyPipeHere"];
1308  m_IlyPipeMat = sArgs["IlyPipeMat"];
1309  m_IlyPipeOD = nArgs["IlyPipeOD"];
1310  m_IlyPipeID = nArgs["IlyPipeID"];
1311  m_vecIlyPipeLength = vArgs["IlyPipeLength"];
1312  m_vecIlyPipeType = vArgs["IlyPipeType"];
1313  m_vecIlyPipePhi = vArgs["IlyPipePhi"];
1314  m_vecIlyPipeZ = vArgs["IlyPipeZ"];
1315 
1316  m_IlyPTMName = sArgs["IlyPTMName"];
1317  m_IlyPTMHere = nArgs["IlyPTMHere"];
1318  m_IlyPTMMat = sArgs["IlyPTMMat"];
1319  m_IlyPTMWidth = nArgs["IlyPTMWidth"];
1320  m_IlyPTMLength = nArgs["IlyPTMLength"];
1321  m_IlyPTMHeight = nArgs["IlyPTMHeight"];
1322  m_vecIlyPTMZ = vArgs["IlyPTMZ"];
1323  m_vecIlyPTMPhi = vArgs["IlyPTMPhi"];
1324 
1325  m_IlyFanOutName = sArgs["IlyFanOutName"];
1326  m_IlyFanOutHere = nArgs["IlyFanOutHere"];
1327  m_IlyFanOutMat = sArgs["IlyFanOutMat"];
1328  m_IlyFanOutWidth = nArgs["IlyFanOutWidth"];
1329  m_IlyFanOutLength = nArgs["IlyFanOutLength"];
1330  m_IlyFanOutHeight = nArgs["IlyFanOutHeight"];
1331  m_vecIlyFanOutZ = vArgs["IlyFanOutZ"];
1332  m_vecIlyFanOutPhi = vArgs["IlyFanOutPhi"];
1333  m_IlyDiffName = sArgs["IlyDiffName"];
1334  m_IlyDiffMat = sArgs["IlyDiffMat"];
1335  m_IlyDiffOff = nArgs["IlyDiffOff"];
1336  m_IlyDiffLength = nArgs["IlyDiffLength"];
1337  m_IlyBndlName = sArgs["IlyBndlName"];
1338  m_IlyBndlMat = sArgs["IlyBndlMat"];
1339  m_IlyBndlOff = nArgs["IlyBndlOff"];
1340  m_IlyBndlLength = nArgs["IlyBndlLength"];
1341  m_IlyFEMName = sArgs["IlyFEMName"];
1342  m_IlyFEMMat = sArgs["IlyFEMMat"];
1343  m_IlyFEMWidth = nArgs["IlyFEMWidth"];
1344  m_IlyFEMLength = nArgs["IlyFEMLength"];
1345  m_IlyFEMHeight = nArgs["IlyFEMHeight"];
1346  m_vecIlyFEMZ = vArgs["IlyFEMZ"];
1347  m_vecIlyFEMPhi = vArgs["IlyFEMPhi"];
1348 
1349  m_HawRName = sArgs["HawRName"];
1350  m_FawName = sArgs["FawName"];
1351  m_FawHere = nArgs["FawHere"];
1352  m_HawRHBIG = nArgs["HawRHBIG"];
1353  m_HawRhsml = nArgs["HawRhsml"];
1354  m_HawRCutY = nArgs["HawRCutY"];
1355  m_HawRCutZ = nArgs["HawRCutZ"];
1356  m_HawRCutDelY = nArgs["HawRCutDelY"];
1357  m_HawYOffCry = nArgs["HawYOffCry"];
1358 
1359  m_NFawPerSupm = static_cast<unsigned int>(nArgs["NFawPerSupm"]);
1360  m_FawPhiOff = nArgs["FawPhiOff"];
1361  m_FawDelPhi = nArgs["FawDelPhi"];
1362  m_FawPhiRot = nArgs["FawPhiRot"];
1363  m_FawRadOff = nArgs["FawRadOff"];
1364 
1365  m_GridHere = nArgs["GridHere"];
1366  m_GridName = sArgs["GridName"];
1367  m_GridMat = sArgs["GridMat"];
1368  m_GridThick = nArgs["GridThick"];
1369 
1370  m_BackHere = nArgs["BackHere"];
1371  m_BackXOff = nArgs["BackXOff"];
1372  m_BackYOff = nArgs["BackYOff"];
1373  m_BackSideName = sArgs["BackSideName"];
1374  m_BackSideHere = nArgs["BackSideHere"];
1375  m_BackSideLength = nArgs["BackSideLength"];
1376  m_BackSideHeight = nArgs["BackSideHeight"];
1377  m_BackSideWidth = nArgs["BackSideWidth"];
1378  m_BackSideYOff1 = nArgs["BackSideYOff1"];
1379  m_BackSideYOff2 = nArgs["BackSideYOff2"];
1380  m_BackSideAngle = nArgs["BackSideAngle"];
1381  m_BackSideMat = sArgs["BackSideMat"];
1382  m_BackPlateName = sArgs["BackPlateName"];
1383  m_BackPlateHere = nArgs["BackPlateHere"];
1384  m_BackPlateLength = nArgs["BackPlateLength"];
1385  m_BackPlateThick = nArgs["BackPlateThick"];
1386  m_BackPlateWidth = nArgs["BackPlateWidth"];
1387  m_BackPlateMat = sArgs["BackPlateMat"];
1388  m_BackPlate2Name = sArgs["BackPlate2Name"];
1389  m_BackPlate2Thick = nArgs["BackPlate2Thick"];
1390  m_BackPlate2Mat = sArgs["BackPlate2Mat"];
1391  m_GrilleName = sArgs["GrilleName"];
1392  m_GrilleHere = nArgs["GrilleHere"];
1393  m_GrilleThick = nArgs["GrilleThick"];
1394  m_GrilleWidth = nArgs["GrilleWidth"];
1395  m_GrilleZSpace = nArgs["GrilleZSpace"];
1396  m_GrilleMat = sArgs["GrilleMat"];
1397  m_vecGrilleHeight = vArgs["GrilleHeight"];
1398  m_vecGrilleZOff = vArgs["GrilleZOff"];
1399 
1400  m_GrEdgeSlotName = sArgs["GrEdgeSlotName"];
1401  m_GrEdgeSlotMat = sArgs["GrEdgeSlotMat"];
1402  m_GrEdgeSlotHere = nArgs["GrEdgeSlotHere"];
1403  m_GrEdgeSlotHeight = nArgs["GrEdgeSlotHeight"];
1404  m_GrEdgeSlotWidth = nArgs["GrEdgeSlotWidth"];
1405  m_GrMidSlotName = sArgs["GrMidSlotName"];
1406  m_GrMidSlotMat = sArgs["GrMidSlotMat"];
1407  m_GrMidSlotHere = nArgs["GrMidSlotHere"];
1408  m_GrMidSlotWidth = nArgs["GrMidSlotWidth"];
1409  m_GrMidSlotXOff = nArgs["GrMidSlotXOff"];
1410  m_vecGrMidSlotHeight = vArgs["GrMidSlotHeight"];
1411 
1412  m_BackPipeHere = nArgs["BackPipeHere"];
1413  m_BackPipeName = sArgs["BackPipeName"];
1414  m_vecBackPipeDiam = vArgs["BackPipeDiam"];
1415  m_vecBackPipeThick = vArgs["BackPipeThick"];
1416  m_BackPipeMat = sArgs["BackPipeMat"];
1417  m_BackPipeWaterMat = sArgs["BackPipeWaterMat"];
1418 
1419  m_BackCoolHere = nArgs["BackCoolHere"];
1420  m_vecBackCoolName = vsArgs["BackCoolName"];
1421  m_BackCoolBarHere = nArgs["BackCoolBarHere"];
1422  m_BackCoolBarWidth = nArgs["BackCoolBarWidth"];
1423  m_BackCoolBarHeight = nArgs["BackCoolBarHeight"];
1424  m_BackCoolMat = sArgs["BackCoolMat"];
1425  m_BackCoolBarName = sArgs["BackCoolBarName"];
1426  m_BackCoolBarThick = nArgs["BackCoolBarThick"];
1427  m_BackCoolBarMat = sArgs["BackCoolBarMat"];
1428  m_BackCoolBarSSName = sArgs["BackCoolBarSSName"];
1429  m_BackCoolBarSSThick = nArgs["BackCoolBarSSThick"];
1430  m_BackCoolBarSSMat = sArgs["BackCoolBarSSMat"];
1431  m_BackCoolBarWaName = sArgs["BackCoolBarWaName"];
1432  m_BackCoolBarWaThick = nArgs["BackCoolBarWaThick"];
1433  m_BackCoolBarWaMat = sArgs["BackCoolBarWaMat"];
1434  m_BackCoolVFEHere = nArgs["BackCoolVFEHere"];
1435  m_BackCoolVFEName = sArgs["BackCoolVFEName"];
1436  m_BackCoolVFEMat = sArgs["BackCoolVFEMat"];
1437  m_BackVFEName = sArgs["BackVFEName"];
1438  m_BackVFEMat = sArgs["BackVFEMat"];
1439  m_vecBackVFELyrThick = vArgs["BackVFELyrThick"];
1440  m_vecBackVFELyrName = vsArgs["BackVFELyrName"];
1441  m_vecBackVFELyrMat = vsArgs["BackVFELyrMat"];
1442  m_vecBackCoolNSec = vArgs["BackCoolNSec"];
1443  m_vecBackCoolSecSep = vArgs["BackCoolSecSep"];
1444  m_vecBackCoolNPerSec = vArgs["BackCoolNPerSec"];
1445  m_BackCBStdSep = nArgs["BackCBStdSep"];
1446 
1447  m_BackMiscHere = nArgs["BackMiscHere"];
1448  m_vecBackMiscThick = vArgs["BackMiscThick"];
1449  m_vecBackMiscName = vsArgs["BackMiscName"];
1450  m_vecBackMiscMat = vsArgs["BackMiscMat"];
1451  m_PatchPanelHere = nArgs["PatchPanelHere"];
1452  m_vecPatchPanelThick = vArgs["PatchPanelThick"];
1453  m_vecPatchPanelNames = vsArgs["PatchPanelNames"];
1454  m_vecPatchPanelMat = vsArgs["PatchPanelMat"];
1455  m_PatchPanelName = sArgs["PatchPanelName"];
1456 
1457  m_BackCoolTankHere = nArgs["BackCoolTankHere"];
1458  m_BackCoolTankName = sArgs["BackCoolTankName"];
1459  m_BackCoolTankWidth = nArgs["BackCoolTankWidth"];
1460  m_BackCoolTankThick = nArgs["BackCoolTankThick"];
1461  m_BackCoolTankMat = sArgs["BackCoolTankMat"];
1462  m_BackCoolTankWaName = sArgs["BackCoolTankWaName"];
1463  m_BackCoolTankWaWidth = nArgs["BackCoolTankWaWidth"];
1464  m_BackCoolTankWaMat = sArgs["BackCoolTankWaMat"];
1465  m_BackBracketName = sArgs["BackBracketName"];
1466  m_BackBracketHeight = nArgs["BackBracketHeight"];
1467  m_BackBracketMat = sArgs["BackBracketMat"];
1468 
1469  m_DryAirTubeHere = nArgs["DryAirTubeHere"];
1470  m_DryAirTubeName = sArgs["DryAirTubeName"];
1471  m_MBCoolTubeNum = static_cast<unsigned int>(nArgs["MBCoolTubeNum"]);
1472  m_DryAirTubeInnDiam = nArgs["DryAirTubeInnDiam"];
1473  m_DryAirTubeOutDiam = nArgs["DryAirTubeOutDiam"];
1474  m_DryAirTubeMat = sArgs["DryAirTubeMat"];
1475  m_MBCoolTubeHere = nArgs["MBCoolTubeHere"];
1476  m_MBCoolTubeName = sArgs["MBCoolTubeName"];
1477  m_MBCoolTubeInnDiam = nArgs["MBCoolTubeInnDiam"];
1478  m_MBCoolTubeOutDiam = nArgs["MBCoolTubeOutDiam"];
1479  m_MBCoolTubeMat = sArgs["MBCoolTubeMat"];
1480  m_MBManifHere = nArgs["MBManifHere"];
1481  m_MBManifName = sArgs["MBManifName"];
1482  m_MBManifInnDiam = nArgs["MBManifInnDiam"];
1483  m_MBManifOutDiam = nArgs["MBManifOutDiam"];
1484  m_MBManifMat = sArgs["MBManifMat"];
1485  m_MBLyrHere = nArgs["MBLyrHere"];
1486  m_vecMBLyrThick = vArgs["MBLyrThick"];
1487  m_vecMBLyrName = vsArgs["MBLyrName"];
1488  m_vecMBLyrMat = vsArgs["MBLyrMat"];
1489 
1490  m_PincerRodHere = nArgs["PincerRodHere"];
1491  m_PincerRodName = sArgs["PincerRodName"];
1492  m_PincerRodMat = sArgs["PincerRodMat"];
1493  m_vecPincerRodAzimuth = vArgs["PincerRodAzimuth"];
1494  m_PincerEnvName = sArgs["PincerEnvName"];
1495  m_PincerEnvMat = sArgs["PincerEnvMat"];
1496  m_PincerEnvWidth = nArgs["PincerEnvWidth"];
1497  m_PincerEnvHeight = nArgs["PincerEnvHeight"];
1498  m_PincerEnvLength = nArgs["PincerEnvLength"];
1499  m_vecPincerEnvZOff = vArgs["PincerEnvZOff"];
1500  m_PincerBlkName = sArgs["PincerBlkName"];
1501  m_PincerBlkMat = sArgs["PincerBlkMat"];
1502  m_PincerBlkLength = nArgs["PincerBlkLength"];
1503  m_PincerShim1Name = sArgs["PincerShim1Name"];
1504  m_PincerShimHeight = nArgs["PincerShimHeight"];
1505  m_PincerShim2Name = sArgs["PincerShim2Name"];
1506  m_PincerShimMat = sArgs["PincerShimMat"];
1507  m_PincerShim1Width = nArgs["PincerShim1Width"];
1508  m_PincerShim2Width = nArgs["PincerShim2Width"];
1509  m_PincerCutName = sArgs["PincerCutName"];
1510  m_PincerCutMat = sArgs["PincerCutMat"];
1511  m_PincerCutWidth = nArgs["PincerCutWidth"];
1512  m_PincerCutHeight = nArgs["PincerCutHeight"];
1513 
1514 #ifdef EDM_ML_DEBUG
1515  edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: end initialize";
1516 #endif
1517 }
1518 
1520 // DDEcalBarrelAlgo methods...
1522 
1524 #ifdef EDM_ML_DEBUG
1525  edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo execute!" << std::endl;
1526 #endif
1527  if (barHere() != 0) {
1528  const unsigned int copyOne(1);
1529  const unsigned int copyTwo(2);
1530  // Barrel parent volume----------------------------------------------------------
1531  cpv.position(
1533  barMat(),
1536  parent().name(),
1537  copyOne,
1538  DDTranslation(vecBarTran()[0], vecBarTran()[1], vecBarTran()[2]),
1539  myrot(barName().name() + "Rot",
1540  Rota(Vec3(vecBarRota3()[0], vecBarRota3()[1], vecBarRota3()[2]), vecBarRota3()[3]) *
1541  Rota(Vec3(vecBarRota2()[0], vecBarRota2()[1], vecBarRota2()[2]), vecBarRota2()[3]) *
1542  Rota(Vec3(vecBarRota()[0], vecBarRota()[1], vecBarRota()[2]), vecBarRota()[3])));
1543 #ifdef EDM_ML_DEBUG
1544  edm::LogVerbatim("EBGeom") << barName() << " PolyCone from " << barPhiLo() / CLHEP::deg << " to "
1545  << barPhiHi() / CLHEP::deg << " with " << vecBarZPts().size() << " points";
1546  for (unsigned int k = 0; k < vecBarZPts().size(); ++k)
1547  edm::LogVerbatim("EBGeom") << "[" << k << "] " << vecBarZPts()[k] << ":" << vecBarRMin()[k] << ":"
1548  << vecBarRMax()[k];
1549  edm::LogVerbatim("EBGeomX") << barName() << ":" << copyOne << " positioned in " << parent().name() << " at "
1550  << DDTranslation(vecBarTran()[0], vecBarTran()[1], vecBarTran()[2]) << " with rotation";
1551 #endif
1552  // End Barrel parent volume----------------------------------------------------------
1553 
1554  // Supermodule parent------------------------------------------------------------
1555 
1556  const DDName spmcut1ddname((0 != spmCutShow()) ? spmName() : ddname(m_SpmName + "CUT1"));
1557  const DDSolid ddspm(
1559 #ifdef EDM_ML_DEBUG
1560  edm::LogVerbatim("EBGeom") << spmcut1ddname << " PolyCone from " << spmLowPhi() / CLHEP::deg << " to "
1561  << (spmLowPhi() + spmDelPhi()) / CLHEP::deg << " with " << vecSpmZPts().size()
1562  << " points";
1563  for (unsigned int k = 0; k < vecSpmZPts().size(); ++k)
1564  edm::LogVerbatim("EBGeom") << "[" << k << "] " << vecSpmZPts()[k] << ":" << vecSpmRMin()[k] << ":"
1565  << vecSpmRMax()[k];
1566 #endif
1567 
1568  const unsigned int indx(vecSpmRMax().size() / 2);
1569 
1570  // Deal with the cut boxes first
1571  const DDSolid spmCutBox(DDSolidFactory::box(spmCutName(),
1572  1.05 * (vecSpmRMax()[indx] - vecSpmRMin()[indx]) / 2.,
1573  spmCutThick() / 2.,
1574  fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2. + 1 * mm));
1575 #ifdef EDM_ML_DEBUG
1576  edm::LogVerbatim("EBGeom") << spmCutName() << " Box " << 1.05 * (vecSpmRMax()[indx] - vecSpmRMin()[indx]) / 2.
1577  << ":" << spmCutThick() / 2. << ":"
1578  << (fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2. + 1 * mm);
1579 #endif
1580  const std::vector<double>& cutBoxParms(spmCutBox.parameters());
1581  const DDLogicalPart spmCutLog(spmCutName(), spmMat(), spmCutBox);
1582  /*
1583  // Now the expansion box
1584  const double xExp(spmExpThick() / 2.);
1585  const double yExp(spmExpWide() / 2.);
1586  const double zExp(fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2.);
1587  const DDName expName(m_SpmName + "EXP");
1588  const DDSolid spmExpBox(DDSolidFactory::box(expName, xExp, yExp, zExp));
1589 #ifdef EDM_ML_DEBUG
1590  edm::LogVerbatim("EBGeom") << expName << " Box " << xExp << ":" << yExp << ":" << zExp;
1591 #endif
1592  const DDTranslation expTra(vecSpmRMax().back() - xExp, spmExpYOff(), vecSpmZPts().front() + zExp);
1593  const DDLogicalPart expLog(expName, spmMat(), spmExpBox);
1594 
1595  const DDName unionName ( ddname( m_SpmName + "UNI" ) ) ;
1596  if( 0 != spmCutShow() )
1597  {
1598  cpv.position( expLog, spmName(), copyOne, expTra, DDRotation() ) ;
1599  }
1600  else
1601  {
1602  const DDSolid unionSolid ( DDSolidFactory::unionSolid(
1603  unionName,
1604  spmcut1ddname, expName,
1605  expTra, DDRotation() ) ) ;
1606  }
1607  */
1608 
1609  // Supermodule side platess
1610  const DDSolid sideSolid(DDSolidFactory::box(
1611  spmSideName(), spmSideHigh() / 2., spmSideThick() / 2., fabs(vecSpmZPts()[1] - vecSpmZPts()[0]) / 2.));
1612 #ifdef EDM_ML_DEBUG
1613  edm::LogVerbatim("EBGeom") << spmSideName() << " Box " << spmSideHigh() / 2. << ":" << spmSideThick() / 2. << ":"
1614  << fabs(vecSpmZPts()[1] - vecSpmZPts()[0]) / 2.;
1615 #endif
1616  const std::vector<double>& sideParms(sideSolid.parameters());
1617  const DDLogicalPart sideLog(spmSideName(), spmSideMat(), sideSolid);
1618 
1619  DDSolid temp1;
1620  DDSolid temp2;
1621  for (unsigned int icopy(1); icopy <= 2; ++icopy) {
1622  const std::vector<double>& tvec(1 == icopy ? vecSpmCutTM() : vecSpmCutTP());
1623  const double rang(1 == icopy ? spmCutRM() : spmCutRP());
1624 
1625  const Tl3D tr(tvec[0], tvec[1], tvec[2]);
1626  const RoZ3D ro(rang);
1627  const Tf3D alltrot(
1628  RoZ3D(1 == icopy ? spmLowPhi() : spmLowPhi() + spmDelPhi()) *
1629  Tl3D((vecSpmRMax()[indx] + vecSpmRMin()[indx]) / 2., 0, (vecSpmZPts().front() + vecSpmZPts().back()) / 2.) *
1630  tr * ro);
1631 
1632  const DDRotation ddrot(myrot(spmCutName().name() + std::to_string(icopy), alltrot.getRotation()));
1633  const DDTranslation ddtra(alltrot.getTranslation());
1634 
1635  const Tl3D trSide(tvec[0],
1636  tvec[1] + (1 == icopy ? 1. : -1.) * (cutBoxParms[1] + sideParms[1]) +
1637  (1 == icopy ? spmSideYOffM() : spmSideYOffP()),
1638  tvec[2]);
1639  const RoZ3D roSide(rang);
1640  const Tf3D sideRot(RoZ3D(1 == icopy ? spmLowPhi() : spmLowPhi() + spmDelPhi()) *
1641  Tl3D(vecSpmRMin().front() + sideParms[0], 0, vecSpmZPts().front() + sideParms[2]) * trSide *
1642  roSide);
1643 
1644  const DDRotation sideddrot(myrot(spmSideName().name() + std::to_string(icopy), sideRot.getRotation()));
1645  const DDTranslation sideddtra(sideRot.getTranslation());
1646 
1647  cpv.position(sideLog, spmName(), icopy, sideddtra, sideddrot);
1648 #ifdef EDM_ML_DEBUG
1649  edm::LogVerbatim("EBGeomX") << sideLog.name() << ":" << icopy << " positioned in " << spmName() << " at "
1650  << sideddtra << " with rotation";
1651 #endif
1652  if (0 != spmCutShow()) // do this if we are "showing" the boxes
1653  {
1654  cpv.position(spmCutLog, spmName(), icopy, ddtra, ddrot);
1655 #ifdef EDM_ML_DEBUG
1656  edm::LogVerbatim("EBGeomX") << spmCutLog.name() << ":" << icopy << " positioned in " << spmName() << " at "
1657  << ddtra << " with rotation";
1658 #endif
1659  } else // do this if we are subtracting the boxes
1660  {
1661  if (1 == icopy) {
1662  temp1 = DDSolidFactory::subtraction(DDName(m_SpmName + "_T1"), spmcut1ddname, spmCutBox, ddtra, ddrot);
1663 #ifdef EDM_ML_DEBUG
1664  edm::LogVerbatim("EBGeom") << DDName(m_SpmName + "_T1") << " Subtraction " << spmcut1ddname << ":"
1665  << spmCutBox.name() << " at " << ddtra;
1666 #endif
1667  } else {
1668  temp2 = DDSolidFactory::subtraction(spmName(), temp1, spmCutBox, ddtra, ddrot);
1669 #ifdef EDM_ML_DEBUG
1670  edm::LogVerbatim("EBGeom") << spmName() << " Subtraction " << temp1.name() << ":" << spmCutBox.name()
1671  << " at " << ddtra;
1672 #endif
1673  }
1674  }
1675  }
1676 
1677  const DDLogicalPart spmLog(spmName(), spmMat(), ((0 != spmCutShow()) ? ddspm : temp2));
1678 
1679  const double dphi(360. * deg / (1. * spmNPerHalf()));
1680  for (unsigned int iphi(0); iphi < 2 * spmNPerHalf(); ++iphi) {
1681  const double phi(iphi * dphi + spmPhiOff()); //- 0.000130/deg ) ;
1682 
1683  // this base rotation includes the base translation & rotation
1684  // plus flipping for the negative z hemisphere, plus
1685  // the phi rotation for this module
1686  const Tf3D rotaBase(RoZ3D(phi) * (iphi < spmNPerHalf() ? Ro3D() : RoX3D(180. * deg)) *
1687  Ro3D(vecSpmBRota()[3], Vec3(vecSpmBRota()[0], vecSpmBRota()[1], vecSpmBRota()[2])) *
1688  Tl3D(Vec3(vecSpmBTran()[0], vecSpmBTran()[1], vecSpmBTran()[2])));
1689 
1690  // here the individual rotations & translations of the supermodule
1691  // are implemented on top of the overall "base" rotation & translation
1692 
1693  const unsigned int offr(4 * iphi);
1694  const unsigned int offt(3 * iphi);
1695 
1696  const Ro3D r1(vecSpmRota()[offr + 3],
1697  Vec3(vecSpmRota()[offr + 0], vecSpmRota()[offr + 1], vecSpmRota()[offr + 2]));
1698 
1699  const Tf3D rotaExtra(r1 * Tl3D(Vec3(vecSpmTran()[offt + 0], vecSpmTran()[offt + 1], vecSpmTran()[offt + 2])));
1700 
1701  const Tf3D both(rotaExtra * rotaBase);
1702 
1703  const DDRotation rota(myrot(spmName().name() + std::to_string(phi / deg), both.getRotation()));
1704 
1705  if (vecSpmHere()[iphi] != 0) {
1706  // convert from CLHEP to DDTranslation & etc. -- Michael Case
1707  DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z());
1708  cpv.position(spmLog, barName(), iphi + 1, myTran, rota);
1709 #ifdef EDM_ML_DEBUG
1710  edm::LogVerbatim("EBGeomX") << spmLog.name() << ":" << (iphi + 1) << " positioned in " << barName() << " at "
1711  << myTran << " with rotation";
1712 #endif
1713  }
1714  }
1715  // End Supermodule parent------------------------------------------------------------
1716 
1717  // Begin Inner Layer volumes---------------------------------------------------------
1718  const double ilyLength(vecSpmZPts()[1] - vecSpmZPts()[0]);
1719  double ilyRMin(vecSpmRMin()[0]);
1720  double ilyThick(0);
1721  for (unsigned int ilyx(0); ilyx != vecIlyThick().size(); ++ilyx) {
1722  ilyThick += vecIlyThick()[ilyx];
1723  }
1724  const DDName ilyDDName(ddname(ilyName()));
1725  const DDSolid ilySolid(
1726  DDSolidFactory::tubs(ilyDDName, ilyLength / 2, ilyRMin, ilyRMin + ilyThick, ilyPhiLow(), ilyDelPhi()));
1727 #ifdef EDM_ML_DEBUG
1728  edm::LogVerbatim("EBGeom") << ilyDDName << " Tubs " << ilyLength / 2 << ":" << ilyRMin << ":" << ilyRMin + ilyThick
1729  << ":" << ilyPhiLow() / CLHEP::deg << ":" << ilyDelPhi() / CLHEP::deg;
1730 #endif
1731  const DDLogicalPart ilyLog(ilyDDName, spmMat(), ilySolid);
1732  cpv.position(ilyLog, spmLog, copyOne, DDTranslation(0, 0, ilyLength / 2), DDRotation());
1733 #ifdef EDM_ML_DEBUG
1734  edm::LogVerbatim("EBGeomX") << ilyDDName << ":" << copyOne << " positioned in " << spmLog.name() << " at "
1735  << DDTranslation(0, 0, ilyLength / 2) << " with no rotation";
1736 #endif
1737  DDLogicalPart ilyPipeLog[200];
1738 
1739  if (0 != ilyPipeHere()) {
1740  for (unsigned int iPipeType(0); iPipeType != vecIlyPipeLength().size(); ++iPipeType) {
1741  const DDName pName(ddname(ilyPipeName() + "_" + std::to_string(iPipeType + 1)));
1742 
1743  DDSolid ilyPipeSolid(
1744  DDSolidFactory::tubs(pName, vecIlyPipeLength()[iPipeType] / 2., 0, ilyPipeOD() / 2, 0 * deg, 360 * deg));
1745 #ifdef EDM_ML_DEBUG
1746  edm::LogVerbatim("EBGeom") << pName << " Tubs " << vecIlyPipeLength()[iPipeType] / 2.
1747  << ":0:" << ilyPipeOD() / 2 << ":0:360";
1748 #endif
1749  ilyPipeLog[iPipeType] = DDLogicalPart(pName, ilyPipeMat(), ilyPipeSolid);
1750 
1751  const DDName pWaName(ddname(ilyPipeName() + "Wa_" + std::to_string(iPipeType + 1)));
1752  DDSolid ilyPipeWaSolid(
1753  DDSolidFactory::tubs(pWaName, vecIlyPipeLength()[iPipeType] / 2., 0, ilyPipeID() / 2, 0 * deg, 360 * deg));
1754 #ifdef EDM_ML_DEBUG
1755  edm::LogVerbatim("EBGeom") << pWaName << " Tubs " << vecIlyPipeLength()[iPipeType] / 2.
1756  << ":0:" << ilyPipeID() / 2 << ":0:360";
1757 #endif
1758  const DDLogicalPart ilyPipeWaLog(pWaName, backPipeWaterMat(), ilyPipeWaSolid);
1759 
1760  cpv.position(ilyPipeWaLog, pName, copyOne, DDTranslation(0, 0, 0), DDRotation());
1761 #ifdef EDM_ML_DEBUG
1762  edm::LogVerbatim("EBGeomX") << pWaName << ":" << copyOne << " positioned in " << pName << " at "
1763  << DDTranslation(0, 0, 0) << " with no rotation";
1764 #endif
1765  }
1766  }
1767 
1768  DDSolid ilyPTMSolid(
1770 #ifdef EDM_ML_DEBUG
1771  edm::LogVerbatim("EBGeom") << ilyPTMName() << " Box " << ilyPTMHeight() / 2. << ":" << ilyPTMWidth() / 2. << ":"
1772  << ilyPTMLength() / 2.;
1773 #endif
1774  const DDLogicalPart ilyPTMLog(ilyPTMName(), ilyPTMMat(), ilyPTMSolid);
1775 
1776  DDSolid ilyFanOutSolid(
1778 #ifdef EDM_ML_DEBUG
1779  edm::LogVerbatim("EBGeom") << ilyFanOutName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1780  << ":" << ilyFanOutLength() / 2.;
1781 #endif
1782  const DDLogicalPart ilyFanOutLog(ilyFanOutName(), ilyFanOutMat(), ilyFanOutSolid);
1783 
1784  DDSolid ilyFEMSolid(
1786 #ifdef EDM_ML_DEBUG
1787  edm::LogVerbatim("EBGeom") << ilyFEMName() << " Box " << ilyFEMHeight() / 2. << ":" << ilyFEMWidth() / 2. << ":"
1788  << ilyFEMLength() / 2.;
1789 #endif
1790  const DDLogicalPart ilyFEMLog(ilyFEMName(), ilyFEMMat(), ilyFEMSolid);
1791 
1792  DDSolid ilyDiffSolid(
1794 #ifdef EDM_ML_DEBUG
1795  edm::LogVerbatim("EBGeom") << ilyDiffName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1796  << ":" << ilyDiffLength() / 2.;
1797 #endif
1798  const DDLogicalPart ilyDiffLog(ilyDiffName(), ilyDiffMat(), ilyDiffSolid);
1799 
1800  DDSolid ilyBndlSolid(
1802 #ifdef EDM_ML_DEBUG
1803  edm::LogVerbatim("EBGeom") << ilyBndlName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1804  << ":" << ilyBndlLength() / 2.;
1805 #endif
1806  const DDLogicalPart ilyBndlLog(ilyBndlName(), ilyBndlMat(), ilyBndlSolid);
1807  cpv.position(ilyDiffLog,
1808  ilyFanOutName(),
1809  copyOne,
1810  DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff()),
1811  DDRotation());
1812 #ifdef EDM_ML_DEBUG
1813  edm::LogVerbatim("EBGeomX") << ilyDiffName() << ":" << copyOne << " positioned in " << ilyFanOutName() << " at "
1814  << DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff())
1815  << " with no rotation";
1816 #endif
1817  cpv.position(ilyBndlLog,
1818  ilyFanOutName(),
1819  copyOne,
1820  DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff()),
1821  DDRotation());
1822 #ifdef EDM_ML_DEBUG
1823  edm::LogVerbatim("EBGeomX") << ilyBndlName() << ":" << copyOne << " positioned in " << ilyFanOutName() << " at "
1824  << DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff())
1825  << " with no rotation";
1826 #endif
1827  for (unsigned int ily(0); ily != vecIlyThick().size(); ++ily) {
1828  const double ilyRMax(ilyRMin + vecIlyThick()[ily]);
1829  const DDName xilyName(ddname(ilyName() + std::to_string(ily)));
1830  const DDSolid xilySolid(
1831  DDSolidFactory::tubs(xilyName, ilyLength / 2, ilyRMin, ilyRMax, ilyPhiLow(), ilyDelPhi()));
1832 #ifdef EDM_ML_DEBUG
1833  edm::LogVerbatim("EBGeom") << xilyName << " Tubs " << ilyLength / 2 << ":" << ilyRMin << ":" << ilyRMax << ":"
1834  << ilyPhiLow() / CLHEP::deg << ":" << ilyDelPhi() / CLHEP::deg;
1835 #endif
1836 
1837  const DDLogicalPart xilyLog(xilyName, ddmat(vecIlyMat()[ily]), xilySolid);
1838 
1839  if (0 != ilyHere()) {
1840  cpv.position(xilyLog, ilyLog, copyOne, DDTranslation(0, 0, 0), DDRotation());
1841 #ifdef EDM_ML_DEBUG
1842  edm::LogVerbatim("EBGeomX") << xilyLog.name() << ":" << copyOne << " positioned in " << ilyLog.name() << " at "
1843  << DDTranslation(0, 0, 0) << " with no rotation";
1844 #endif
1845  unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1846 
1847  if (10 * mm < vecIlyThick()[ily] && vecIlyThick().size() != (ily + 1) && 0 != ilyPipeHere()) {
1848  if (0 != ilyPTMHere()) {
1849  unsigned int ptmCopy(0);
1850  for (unsigned int ilyPTM(0); ilyPTM != vecIlyPTMZ().size(); ++ilyPTM) {
1851  const double radius(ilyRMax - 1 * mm - ilyPTMHeight() / 2.);
1852  const double phi(vecIlyPTMPhi()[ilyPTM]);
1853  const double yy(radius * sin(phi));
1854  const double xx(radius * cos(phi));
1855  ++ptmCopy;
1856  cpv.position(ilyPTMLog,
1857  xilyLog,
1858  ptmCopy,
1859  DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2),
1860  myrot(ilyPTMLog.name().name() + "_rot" + std::to_string(ptmCopy), CLHEP::HepRotationZ(phi)));
1861 #ifdef EDM_ML_DEBUG
1862  edm::LogVerbatim("EBGeomX")
1863  << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at "
1864  << DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2) << " with rotation";
1865 #endif
1866  }
1867  }
1868  if (0 != ilyFanOutHere()) {
1869  unsigned int fanOutCopy(0);
1870  for (unsigned int ilyFO(0); ilyFO != vecIlyFanOutZ().size(); ++ilyFO) {
1871  const double radius(ilyRMax - 1 * mm - ilyFanOutHeight() / 2.);
1872  const double phi(vecIlyFanOutPhi()[ilyFO]);
1873  const double yy(radius * sin(phi));
1874  const double xx(radius * cos(phi));
1875  ++fanOutCopy;
1876  cpv.position(ilyFanOutLog,
1877  xilyLog,
1878  fanOutCopy,
1879  DDTranslation(xx, yy, vecIlyFanOutZ()[ilyFO] - ilyLength / 2),
1880  myrot(ilyFanOutLog.name().name() + "_rot" + std::to_string(fanOutCopy),
1881  CLHEP::HepRotationZ(phi) * CLHEP::HepRotationY(180 * deg)));
1882 #ifdef EDM_ML_DEBUG
1883  edm::LogVerbatim("EBGeomX")
1884  << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at "
1885  << DDTranslation(xx, yy, vecIlyFanOutZ()[ilyFO] - ilyLength / 2) << " with rotation";
1886 #endif
1887  }
1888  unsigned int femCopy(0);
1889  for (unsigned int ilyFEM(0); ilyFEM != vecIlyFEMZ().size(); ++ilyFEM) {
1890  const double radius(ilyRMax - 1 * mm - ilyFEMHeight() / 2.);
1891  const double phi(vecIlyFEMPhi()[ilyFEM]);
1892  const double yy(radius * sin(phi));
1893  const double xx(radius * cos(phi));
1894  ++femCopy;
1895  cpv.position(ilyFEMLog,
1896  xilyLog,
1897  femCopy,
1898  DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2),
1899  myrot(ilyFEMLog.name().name() + "_rot" + std::to_string(femCopy), CLHEP::HepRotationZ(phi)));
1900 #ifdef EDM_ML_DEBUG
1901  edm::LogVerbatim("EBGeomX")
1902  << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at "
1903  << DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2) << " with rotation";
1904 #endif
1905  }
1906  }
1907  for (unsigned int iPipe(0); iPipe != vecIlyPipePhi().size(); ++iPipe) {
1908  const unsigned int type(static_cast<unsigned int>(round(vecIlyPipeType()[iPipe])));
1909  // edm::LogVerbatim("EcalGeom") <<" iPipe, type= " << iPipe << ", " << type;
1910  const double zz(-ilyLength / 2 + vecIlyPipeZ()[iPipe] + (9 > type ? vecIlyPipeLength()[type] / 2. : 0));
1911 
1912  for (unsigned int ly(0); ly != 2; ++ly) {
1913  const double radius(0 == ly ? ilyRMin + ilyPipeOD() / 2. + 1 * mm : ilyRMax - ilyPipeOD() / 2. - 1 * mm);
1914  const double phi(vecIlyPipePhi()[iPipe]);
1915  const double yy(radius * sin(phi));
1916  const double xx(radius * cos(phi));
1917  ++copyNum[type],
1918  cpv.position(
1919  ilyPipeLog[type],
1920  xilyLog,
1921  copyNum[type],
1922  DDTranslation(xx, yy, zz),
1923  (9 > type ? DDRotation()
1924  : myrot(ilyPipeLog[type].name().name() + "_rot" + std::to_string(copyNum[type]),
1925  Rota(Vec3(xx, yy, 0), 90 * deg))));
1926 #ifdef EDM_ML_DEBUG
1927  std::string rrr = (9 > type) ? " with no rotation" : " with rotation";
1928  edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in "
1929  << xilyLog.name() << " at" << DDTranslation(xx, yy, zz) << rrr;
1930 #endif
1931  }
1932  }
1933  }
1934  }
1935  ilyRMin = ilyRMax;
1936  }
1937  // End Inner Layer volumes---------------------------------------------------------
1938 
1939  const DDName clyrName(DDName("ECLYR"));
1940  std::vector<double> cri;
1941  std::vector<double> cro;
1942  std::vector<double> czz;
1943  czz.emplace_back(vecSpmZPts()[1]);
1944  cri.emplace_back(vecSpmRMin()[0]);
1945  cro.emplace_back(vecSpmRMin()[0] + 25 * mm);
1946  czz.emplace_back(vecSpmZPts()[2]);
1947  cri.emplace_back(vecSpmRMin()[2]);
1948  cro.emplace_back(vecSpmRMin()[2] + 10 * mm);
1949  const DDSolid clyrSolid(DDSolidFactory::polycone(clyrName, -9.5 * deg, 19 * deg, czz, cri, cro));
1950 #ifdef EDM_ML_DEBUG
1951  edm::LogVerbatim("EBGeom") << clyrName << " PolyCone from -9.5 to 9.5 with " << czz.size() << " points";
1952  for (unsigned int k = 0; k < czz.size(); ++k)
1953  edm::LogVerbatim("EBGeom") << "[" << k << "] " << czz[k] << ":" << cri[k] << ":" << cro[k];
1954 #endif
1955  const DDLogicalPart clyrLog(clyrName, ddmat(vecIlyMat()[4]), clyrSolid);
1956  cpv.position(clyrLog, spmLog, copyOne, DDTranslation(0, 0, 0), DDRotation());
1957 #ifdef EDM_ML_DEBUG
1958  edm::LogVerbatim("EBGeomX") << clyrLog.name() << ":" << copyOne << " positioned in " << spmLog.name() << " at "
1959  << DDTranslation(0, 0, 0) << " with no rotation";
1960 #endif
1961  // Begin Alveolar Wedge parent ------------------------------------------------------
1962  //----------------
1963 
1964  // the next few lines accumulate dimensions appropriate to crystal type 1
1965  // which we use to set some of the features of the half-alveolar wedge (hawR).
1966 
1967  // const double ANom1 ( vecNomCryDimAR()[0] ) ;
1968  const double BNom1(vecNomCryDimCR()[0]);
1969  const double bNom1(vecNomCryDimCF()[0]);
1970  // const double HNom1 ( vecNomCryDimBR()[0] ) ;
1971  // const double hNom1 ( vecNomCryDimBF()[0] ) ;
1972  const double sWall1(wallThAlv());
1973  const double fWall1(wallFrAlv());
1974  // const double rWall1( wallReAlv() ) ;
1975  const double sWrap1(wrapThAlv());
1976  const double fWrap1(wrapFrAlv());
1977  // const double rWrap1( wrapReAlv() ) ;
1978  const double sClr1(clrThAlv());
1979  const double fClr1(clrFrAlv());
1980  // const double rClr1 ( clrReAlv() ) ;
1981  const double LNom1(nomCryDimLZ());
1982  const double beta1(atan((BNom1 - bNom1) / LNom1));
1983  // const double cosbeta1 ( cos( beta1 ) ) ;
1984  const double sinbeta1(sin(beta1));
1985 
1986  const double tana_hawR((BNom1 - bNom1) / LNom1);
1987 
1988  const double H_hawR(hawRHBIG());
1989  const double h_hawR(hawRhsml());
1990  const double a_hawR(bNom1 + sClr1 + 2 * sWrap1 + 2 * sWall1 - sinbeta1 * (fClr1 + fWrap1 + fWall1));
1991  const double B_hawR(a_hawR + H_hawR * tana_hawR);
1992  const double b_hawR(a_hawR + h_hawR * tana_hawR);
1993  const double L_hawR(vecSpmZPts()[2]);
1994 
1995  const Trap trapHAWR(a_hawR / 2., //double aHalfLengthXNegZLoY , // bl1, A/2
1996  a_hawR / 2., //double aHalfLengthXPosZLoY , // bl2, a/2
1997  b_hawR / 2., //double aHalfLengthXPosZHiY , // tl2, b/2
1998  H_hawR / 2., //double aHalfLengthYNegZ , // h1, H/2
1999  h_hawR / 2., //double aHalfLengthYPosZ , // h2, h/2
2000  L_hawR / 2., //double aHalfLengthZ , // dz, L/2
2001  90 * deg, //double aAngleAD , // alfa1
2002  0, //double aCoord15X , // x15
2003  0 //double aCoord15Y // y15
2004  );
2005 
2006  const DDName hawRName1(ddname(hawRName().name() + "1"));
2007  const DDSolid hawRSolid1(mytrap(hawRName1.name(), trapHAWR));
2008  const DDLogicalPart hawRLog1(hawRName1, spmMat(), hawRSolid1);
2009 
2010  const double al1_fawR(atan((B_hawR - a_hawR) / H_hawR) + M_PI_2);
2011 
2012  // here is trap for Full Alveolar Wedge
2013  const Trap trapFAW(a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2
2014  a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2
2015  b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2
2016  H_hawR / 2., //double aHalfLengthYNegZ , // h1, H/2
2017  h_hawR / 2., //double aHalfLengthYPosZ , // h2, h/2
2018  L_hawR / 2., //double aHalfLengthZ , // dz, L/2
2019  al1_fawR, //double aAngleAD , // alfa1
2020  0, //double aCoord15X , // x15
2021  0 //double aCoord15Y // y15
2022  );
2023 
2024  const DDName fawName1(ddname(fawName().name() + "1"));
2025  const DDSolid fawSolid1(mytrap(fawName1.name(), trapFAW));
2026  const DDLogicalPart fawLog1(fawName1, spmMat(), fawSolid1);
2027 
2028  const Trap::VertexList vHAW(trapHAWR.vertexList());
2029  const Trap::VertexList vFAW(trapFAW.vertexList());
2030 
2031  const double hawBoxClr(1 * mm);
2032 
2033  // HAW cut box to cut off back end of wedge
2034  const DDName hawCutName(ddname(hawRName().name() + "CUTBOX"));
2035  const DDSolid hawCutBox(DDSolidFactory::box(hawCutName, b_hawR / 2 + hawBoxClr, hawRCutY() / 2, hawRCutZ() / 2));
2036 #ifdef EDM_ML_DEBUG
2037  edm::LogVerbatim("EBGeom") << hawCutName << " Box " << (b_hawR / 2 + hawBoxClr) << ":" << hawRCutY() / 2 << ":"
2038  << hawRCutZ() / 2;
2039 #endif
2040  const std::vector<double>& hawBoxParms(hawCutBox.parameters());
2041  const DDLogicalPart hawCutLog(hawCutName, spmMat(), hawCutBox);
2042 
2043  const Pt3D b1(hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
2044  const Pt3D b2(-hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
2045  const Pt3D b3(-hawBoxParms[0], hawBoxParms[1], -hawBoxParms[2]);
2046 
2047  const double zDel(sqrt(4 * hawBoxParms[2] * hawBoxParms[2] - (h_hawR - hawRCutDelY()) * (h_hawR - hawRCutDelY())));
2048 
2049  const Tf3D hawCutForm(b1,
2050  b2,
2051  b3,
2052  vHAW[2] + Pt3D(hawBoxClr, -hawRCutDelY(), 0),
2053  vHAW[1] + Pt3D(-hawBoxClr, -hawRCutDelY(), 0),
2054  Pt3D(vHAW[0].x() - hawBoxClr, vHAW[0].y(), vHAW[0].z() - zDel));
2055 
2056  const DDSolid hawRSolid(DDSolidFactory::subtraction(
2057  hawRName(),
2058  hawRSolid1,
2059  hawCutBox,
2060  DDTranslation(
2061  hawCutForm.getTranslation().x(), hawCutForm.getTranslation().y(), hawCutForm.getTranslation().z()),
2062  myrot(hawCutName.name() + "R", hawCutForm.getRotation())));
2063 #ifdef EDM_ML_DEBUG
2064  edm::LogVerbatim("EBGeom") << hawRName() << " Subtraction " << hawRSolid1.name() << ":" << hawCutBox.name()
2065  << " at "
2066  << DDTranslation(hawCutForm.getTranslation().x(),
2067  hawCutForm.getTranslation().y(),
2068  hawCutForm.getTranslation().z());
2069 #endif
2070  const DDLogicalPart hawRLog(hawRName(), spmMat(), hawRSolid);
2071 
2072  // FAW cut box to cut off back end of wedge
2073  const DDName fawCutName(ddname(fawName().name() + "CUTBOX"));
2074  const DDSolid fawCutBox(DDSolidFactory::box(fawCutName, 2 * hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]));
2075 #ifdef EDM_ML_DEBUG
2076  edm::LogVerbatim("EBGeom") << fawCutName << " Box " << 2 * hawBoxParms[0] << ":" << hawBoxParms[1] << ":"
2077  << hawBoxParms[2];
2078 #endif
2079 
2080  const std::vector<double>& fawBoxParms(fawCutBox.parameters());
2081  const DDLogicalPart fawCutLog(fawCutName, spmMat(), fawCutBox);
2082 
2083  const Pt3D bb1(fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
2084  const Pt3D bb2(-fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
2085  const Pt3D bb3(-fawBoxParms[0], fawBoxParms[1], -fawBoxParms[2]);
2086 
2087  const Tf3D fawCutForm(bb1,
2088  bb2,
2089  bb3,
2090  vFAW[2] + Pt3D(2 * hawBoxClr, -5 * mm, 0),
2091  vFAW[1] + Pt3D(-2 * hawBoxClr, -5 * mm, 0),
2092  Pt3D(vFAW[1].x() - 2 * hawBoxClr, vFAW[1].y() - trapFAW.h(), vFAW[1].z() - zDel));
2093 
2094  const DDSolid fawSolid(DDSolidFactory::subtraction(
2095  fawName(),
2096  fawSolid1,
2097  fawCutBox,
2098  DDTranslation(
2099  fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()),
2100  myrot(fawCutName.name() + "R", fawCutForm.getRotation())));
2101 #ifdef EDM_ML_DEBUG
2102  edm::LogVerbatim("EBGeom") << fawName() << " Subtraction " << fawSolid1.name() << ":" << fawCutBox.name() << " at "
2103  << DDTranslation(fawCutForm.getTranslation().x(),
2104  fawCutForm.getTranslation().y(),
2105  fawCutForm.getTranslation().z());
2106 #endif
2107  const DDLogicalPart fawLog(fawName(), spmMat(), fawSolid);
2108 
2109  const Tf3D hawRform(vHAW[3],
2110  vHAW[0],
2111  vHAW[1], // HAW inside FAW
2112  vFAW[3],
2113  0.5 * (vFAW[0] + vFAW[3]),
2114  0.5 * (vFAW[1] + vFAW[2]));
2115  cpv.position(
2116  hawRLog,
2117  fawLog,
2118  copyOne,
2119  DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()),
2120  myrot(hawRName().name() + "R", hawRform.getRotation()));
2121 #ifdef EDM_ML_DEBUG
2122  edm::LogVerbatim("EBGeomX") << hawRLog.name() << ":" << copyOne << " positioned in " << fawLog.name() << " at "
2123  << DDTranslation(hawRform.getTranslation().x(),
2124  hawRform.getTranslation().y(),
2125  hawRform.getTranslation().z())
2126  << " with rotation";
2127 #endif
2128  cpv.position(
2129  hawRLog,
2130  fawLog,
2131  copyTwo,
2132  DDTranslation(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()),
2133  myrot(hawRName().name() + "RotRefl",
2134  CLHEP::HepRotationY(180 * deg) * // rotate about Y after refl thru Z
2135  CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, -1)));
2136 #ifdef EDM_ML_DEBUG
2137  edm::LogVerbatim("EBGeomX") << hawRLog.name() << ":" << copyTwo << " positioned in " << fawLog.name() << " at "
2138  << DDTranslation(-hawRform.getTranslation().x(),
2139  -hawRform.getTranslation().y(),
2140  -hawRform.getTranslation().z())
2141  << " with rotation";
2142 #endif
2143  /* this for display of haw cut box instead of subtraction
2144  cpv.position( hawCutLog,
2145  hawRName,
2146  copyOne,
2147  hawCutForm.getTranslation(),
2148  myrot( hawCutName.name()+"R",
2149  hawCutForm.getRotation() ) ) ;
2150 */
2151 
2152  for (unsigned int iPhi(1); iPhi <= nFawPerSupm(); ++iPhi) {
2153  const double rPhi(fawPhiOff() + (iPhi - 0.5) * fawDelPhi());
2154 
2155  const Tf3D fawform(RoZ3D(rPhi) * Tl3D(fawRadOff() + (trapFAW.H() + trapFAW.h()) / 4, 0, trapFAW.L() / 2) *
2156  RoZ3D(-90 * deg + fawPhiRot()));
2157  if (fawHere())
2158  cpv.position(
2159  fawLog,
2160  spmLog,
2161  iPhi,
2162  DDTranslation(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z()),
2163  myrot(fawName().name() + "_Rot" + std::to_string(iPhi), fawform.getRotation()));
2164 #ifdef EDM_ML_DEBUG
2165  edm::LogVerbatim("EBGeomX") << fawLog.name() << ":" << iPhi << " positioned in " << spmLog.name() << " at "
2166  << DDTranslation(fawform.getTranslation().x(),
2167  fawform.getTranslation().y(),
2168  fawform.getTranslation().z())
2169  << " with rotation";
2170 #endif
2171  }
2172 
2173  // End Alveolar Wedge parent ------------------------------------------------------
2174 
2175  // Begin Grid + Tablet insertion
2176 
2177  const double h_Grid(gridThick());
2178 
2179  const Trap trapGrid((B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2, // bl1, A/2
2180  (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2, // bl2, a/2
2181  b_hawR / 2., // tl2, b/2
2182  h_Grid / 2., // h1, H/2
2183  h_Grid / 2., // h2, h/2
2184  (L_hawR - 8 * cm) / 2., // dz, L/2
2185  90 * deg, // alfa1
2186  0, // x15
2187  H_hawR - h_hawR // y15
2188  );
2189 
2190  const DDSolid gridSolid(mytrap(gridName().name(), trapGrid));
2191  const DDLogicalPart gridLog(gridName(), gridMat(), gridSolid);
2192 
2193  const Trap::VertexList vGrid(trapGrid.vertexList());
2194 
2195  const Tf3D gridForm(vGrid[4],
2196  vGrid[5],
2197  vGrid[6], // Grid inside HAW
2198  vHAW[5] - Pt3D(0, h_Grid, 0),
2199  vHAW[5],
2200  vHAW[6]);
2201 
2202  if (0 != gridHere())
2203  cpv.position(
2204  gridLog,
2205  hawRLog,
2206  copyOne,
2207  DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()),
2208  myrot(gridName().name() + "R", gridForm.getRotation()));
2209 #ifdef EDM_ML_DEBUG
2210  edm::LogVerbatim("EBGeomX") << gridLog.name() << ":" << copyOne << " positioned in " << hawRLog.name() << " at "
2211  << DDTranslation(gridForm.getTranslation().x(),
2212  gridForm.getTranslation().y(),
2213  gridForm.getTranslation().z())
2214  << " with rotation";
2215 #endif
2216  // End Grid + Tablet insertion
2217 
2218  // begin filling Wedge with crystal plus supports --------------------------
2219 
2220  const double aNom(nomCryDimAF());
2221  const double LNom(nomCryDimLZ());
2222 
2223  const double AUnd(underAR());
2224  const double aUnd(underAF());
2225  // const double BUnd ( underCR() ) ;
2226  const double bUnd(underCF());
2227  const double HUnd(underBR());
2228  const double hUnd(underBF());
2229  const double LUnd(underLZ());
2230 
2231  const double sWall(wallThAlv());
2232  const double sWrap(wrapThAlv());
2233  const double sClr(clrThAlv());
2234 
2235  const double fWall(wallFrAlv());
2236  const double fWrap(wrapFrAlv());
2237  const double fClr(clrFrAlv());
2238 
2239  const double rWall(wallReAlv());
2240  const double rWrap(wrapReAlv());
2241  const double rClr(clrReAlv());
2242 
2243  // theta is angle in yz plane between z axis & leading edge of crystal
2244  double theta(90 * deg);
2245  double zee(0 * mm);
2246  double side(0 * mm);
2247  double zeta(0 * deg); // increment in theta for last crystal
2248 
2249  for (unsigned int cryType(1); cryType <= nCryTypes(); ++cryType) {
2250  const std::string sType("_" + std::string(10 > cryType ? "0" : "") + std::to_string(cryType));
2251 
2252 #ifdef EDM_ML_DEBUG
2253  edm::LogVerbatim("EcalGeom") << "Crytype=" << cryType;
2254 #endif
2255  const double ANom(vecNomCryDimAR()[cryType - 1]);
2256  const double BNom(vecNomCryDimCR()[cryType - 1]);
2257  const double bNom(vecNomCryDimCF()[cryType - 1]);
2258  const double HNom(vecNomCryDimBR()[cryType - 1]);
2259  const double hNom(vecNomCryDimBF()[cryType - 1]);
2260 
2261  const double alfCry(90 * deg + atan((bNom - bUnd - aNom + aUnd) / (hNom - hUnd)));
2262 
2263  const Trap trapCry((ANom - AUnd) / 2., //double aHalfLengthXNegZLoY , // bl1, A/2
2264  (aNom - aUnd) / 2., //double aHalfLengthXPosZLoY , // bl2, a/2
2265  (bNom - bUnd) / 2., //double aHalfLengthXPosZHiY , // tl2, b/2
2266  (HNom - HUnd) / 2., //double aHalfLengthYNegZ , // h1, H/2
2267  (hNom - hUnd) / 2., //double aHalfLengthYPosZ , // h2, h/2
2268  (LNom - LUnd) / 2., //double aHalfLengthZ , // dz, L/2
2269  alfCry, //double aAngleAD , // alfa1
2270  aNom - aUnd - ANom + AUnd, //double aCoord15X , // x15
2271  hNom - hUnd - HNom + HUnd //double aCoord15Y // y15
2272  );
2273 
2274  const DDName cryDDName(cryName() + sType);
2275  const DDSolid crySolid(mytrap(cryDDName.name(), trapCry));
2276  const DDLogicalPart cryLog(cryDDName, cryMat(), crySolid);
2277 
2278  //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++
2279  const unsigned int copyCap(1);
2280 
2281  const DDName capDDName(capName().name() + sType);
2282 
2283  DDSolid capSolid(DDSolidFactory::box(capDDName, capXSize() / 2., capYSize() / 2., capThick() / 2.));
2284 #ifdef EDM_ML_DEBUG
2285  edm::LogVerbatim("EBGeom") << capDDName << " Box " << capXSize() / 2. << ":" << capYSize() / 2 << ":"
2286  << capThick() / 2;
2287 #endif
2288 
2289  const DDLogicalPart capLog(capDDName, capMat(), capSolid);
2290 
2291  const DDName sglDDName(sglName().name() + sType);
2292 
2293  DDSolid sglSolid(DDSolidFactory::box(sglDDName, capXSize() / 2., capYSize() / 2., sglThick() / 2.));
2294 #ifdef EDM_ML_DEBUG
2295  edm::LogVerbatim("EBGeom") << sglDDName << " Box " << capXSize() / 2. << ":" << capYSize() / 2 << ":"
2296  << sglThick() / 2;
2297 #endif
2298 
2299  const DDLogicalPart sglLog(sglDDName, sglMat(), sglSolid);
2300 
2301  const unsigned int copySGL(1);
2302 
2303  const DDName cerDDName(cerName().name() + sType);
2304 
2305  DDSolid cerSolid(DDSolidFactory::box(cerDDName, cerXSize() / 2., cerYSize() / 2., cerThick() / 2.));
2306 #ifdef EDM_ML_DEBUG
2307  edm::LogVerbatim("EBGeom") << cerDDName << " Box " << cerXSize() / 2. << ":" << cerYSize() / 2 << ":"
2308  << cerThick() / 2;
2309 #endif
2310 
2311  const DDLogicalPart cerLog(cerDDName, cerMat(), cerSolid);
2312 
2313  unsigned int copyCER(0);
2314 
2315  const DDName bsiDDName(bsiName().name() + sType);
2316 
2317  DDSolid bsiSolid(DDSolidFactory::box(bsiDDName, bsiXSize() / 2., bsiYSize() / 2., bsiThick() / 2.));
2318 #ifdef EDM_ML_DEBUG
2319  edm::LogVerbatim("EBGeom") << bsiDDName << " Box " << bsiXSize() / 2. << ":" << bsiYSize() / 2 << ":"
2320  << bsiThick() / 2;
2321 #endif
2322 
2323  const DDLogicalPart bsiLog(bsiDDName, bsiMat(), bsiSolid);
2324 
2325  const unsigned int copyBSi(1);
2326 
2327  const DDName atjDDName(atjName().name() + sType);
2328 
2329  DDSolid atjSolid(DDSolidFactory::box(atjDDName, apdSide() / 2., apdSide() / 2., atjThick() / 2.));
2330 #ifdef EDM_ML_DEBUG
2331  edm::LogVerbatim("EBGeom") << atjDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2 << ":"
2332  << atjThick() / 2;
2333 #endif
2334 
2335  const DDLogicalPart atjLog(atjDDName, atjMat(), atjSolid);
2336 
2337  const unsigned int copyATJ(1);
2338 
2339  const DDName aglDDName(aglName().name() + sType);
2340 
2341  DDSolid aglSolid(DDSolidFactory::box(aglDDName, bsiXSize() / 2., bsiYSize() / 2., aglThick() / 2.));
2342 #ifdef EDM_ML_DEBUG
2343  edm::LogVerbatim("EBGeom") << aglDDName << " Box " << bsiXSize() / 2. << ":" << bsiYSize() / 2 << ":"
2344  << aglThick() / 2;
2345 #endif
2346 
2347  const DDLogicalPart aglLog(aglDDName, aglMat(), aglSolid);
2348 
2349  const unsigned int copyAGL(1);
2350 
2351  const DDName andDDName(andName().name() + sType);
2352 
2353  DDSolid andSolid(DDSolidFactory::box(andDDName, apdSide() / 2., apdSide() / 2., andThick() / 2.));
2354 #ifdef EDM_ML_DEBUG
2355  edm::LogVerbatim("EBGeom") << andDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2 << ":"
2356  << andThick() / 2;
2357 #endif
2358 
2359  const DDLogicalPart andLog(andDDName, andMat(), andSolid);
2360 
2361  const unsigned int copyAND(1);
2362 
2363  const DDName apdDDName(apdName().name() + sType);
2364 
2365  DDSolid apdSolid(DDSolidFactory::box(apdDDName, apdSide() / 2., apdSide() / 2., apdThick() / 2.));
2366 #ifdef EDM_ML_DEBUG
2367  edm::LogVerbatim("EBGeom") << apdDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2. << ":"
2368  << apdThick() / 2;
2369 #endif
2370 
2371  const DDLogicalPart apdLog(apdDDName, apdMat(), apdSolid);
2372 
2373  const unsigned int copyAPD(1);
2374  //++++++++++++++++++++++++++++++++++ END APD ++++++++++++++++++++++++++++++++++
2375 
2376  const double delta(atan((HNom - hNom) / LNom));
2377  //unused const double cosdelta ( cos( delta ) ) ;
2378  const double sindelta(sin(delta));
2379 
2380  const double gamma(atan((ANom - aNom) / LNom));
2381  //unused const double cosgamma ( cos( gamma ) ) ;
2382  const double singamma(sin(gamma));
2383 
2384  const double beta(atan((BNom - bNom) / LNom));
2385  //unused const double cosbeta ( cos( beta ) ) ;
2386  const double sinbeta(sin(beta));
2387 
2388  // Now clearance trap
2389  const double alfClr(90 * deg + atan((bNom - aNom) / (hNom + sClr)));
2390 
2391  const Trap trapClr((ANom + sClr + rClr * singamma) / 2., //double aHalfLengthXNegZLoY , // bl1, A/2
2392  (aNom + sClr - fClr * singamma) / 2., //double aHalfLengthXPosZLoY , // bl2, a/2
2393  (bNom + sClr - fClr * sinbeta) / 2., //double aHalfLengthXPosZHiY , // tl2, b/2
2394  (HNom + sClr + rClr * sindelta) / 2., //double aHalfLengthYNegZ , // h1, H/2
2395  (hNom + sClr - fClr * sindelta) / 2., //double aHalfLengthYPosZ , // h2, h/2
2396  (LNom + fClr + rClr) / 2., // dz, L/2
2397  alfClr, //double aAngleAD , // alfa1
2398  aNom - ANom, //double aCoord15X , // x15
2399  hNom - HNom //double aCoord15Y // y15
2400  );
2401 
2402  const DDName clrDDName(clrName() + sType);
2403  const DDSolid clrSolid(mytrap(clrDDName.name(), trapClr));
2404  const DDLogicalPart clrLog(clrDDName, clrMat(), clrSolid);
2405 
2406  // Now wrap trap
2407 
2408  const double alfWrap(90 * deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap)));
2409 
2410  const Trap trapWrap((trapClr.A() + 2 * sWrap + rWrap * singamma) / 2, // bl1, A/2
2411  (trapClr.a() + 2 * sWrap - fWrap * singamma) / 2, // bl2, a/2
2412  (trapClr.b() + 2 * sWrap - fWrap * sinbeta) / 2, // tl2, b/2
2413  (trapClr.H() + 2 * sWrap + rWrap * sindelta) / 2, // h1, H/2
2414  (trapClr.h() + 2 * sWrap - fWrap * sindelta) / 2, // h2, h/2
2415  (trapClr.L() + fWrap + rWrap) / 2., // dz, L/2
2416  alfWrap, //double aAngleAD , // alfa1
2417  aNom - ANom - (cryType > 9 ? 0 : 0.020 * mm),
2418  hNom - HNom //double aCoord15Y // y15
2419  );
2420 
2421  const DDName wrapDDName(wrapName() + sType);
2422  const DDSolid wrapSolid(mytrap(wrapDDName.name(), trapWrap));
2423  const DDLogicalPart wrapLog(wrapDDName, wrapMat(), wrapSolid);
2424 
2425  // Now wall trap
2426 
2427  const double alfWall(90 * deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap + 2 * sWall)));
2428 
2429  const Trap trapWall((trapWrap.A() + 2 * sWall + rWall * singamma) / 2, // A/2
2430  (trapWrap.a() + 2 * sWall - fWall * singamma) / 2, // a/2
2431  (trapWrap.b() + 2 * sWall - fWall * sinbeta) / 2, // b/2
2432  (trapWrap.H() + 2 * sWall + rWall * sindelta) / 2, // H/2
2433  (trapWrap.h() + 2 * sWall - fWall * sindelta) / 2, // h/2
2434  (trapWrap.L() + fWall + rWall) / 2., // L/2
2435  alfWall, // alfa1
2436  aNom - ANom - (cryType < 10 ? 0.150 * mm : 0.100 * mm),
2437  hNom - HNom // y15
2438  );
2439 
2440  const DDName wallDDName(wallName() + sType);
2441  const DDSolid wallSolid(mytrap(wallDDName.name(), trapWall));
2442  const DDLogicalPart wallLog(wallDDName, wallMat(), wallSolid);
2443 
2444  /*
2445  edm::LogVerbatim("EcalGeom") << "Traps:\n a: "
2446  << trapCry.a() << ", "
2447  << trapClr.a() << ", "
2448  << trapWrap.a() << ", "
2449  << trapWall.a() << "\n b: "
2450  << trapCry.b() << ", "
2451  << trapClr.b() << ", "
2452  << trapWrap.b() << ", "
2453  << trapWall.b() << "\n A: "
2454  << trapCry.A() << ", "
2455  << trapClr.A() << ", "
2456  << trapWrap.A() << ", "
2457  << trapWall.A() << "\n B: "
2458  << trapCry.B() << ", "
2459  << trapClr.B() << ", "
2460  << trapWrap.B() << ", "
2461  << trapWall.B() << "\n h: "
2462  << trapCry.h() << ", "
2463  << trapClr.h() << ", "
2464  << trapWrap.h() << ", "
2465  << trapWall.h() << "\n H: "
2466  << trapCry.H() << ", "
2467  << trapClr.H() << ", "
2468  << trapWrap.H() << ", "
2469  << trapWall.H() << "\n a1: "
2470  << trapCry.a1()/deg << ", "
2471  << trapClr.a1()/deg << ", "
2472  << trapWrap.a1()/deg << ", "
2473  << trapWall.a1()/deg << "\n a4: "
2474  << trapCry.a4()/deg << ", "
2475  << trapClr.a4()/deg << ", "
2476  << trapWrap.a4()/deg << ", "
2477  << trapWall.a4()/deg << "\n x15: "
2478  << trapCry.x15() << ", "
2479  << trapClr.x15() << ", "
2480  << trapWrap.x15() << ", "
2481  << trapWall.x15() << "\n y15: "
2482  << trapCry.y15() << ", "
2483  << trapClr.y15() << ", "
2484  << trapWrap.y15() << ", "
2485  << trapWall.y15();
2486 */
2487  // Now for placement of cry within clr
2488  const Vec3 cryToClr(0, 0, (rClr - fClr) / 2);
2489 
2490  cpv.position(cryLog,
2491  clrLog,
2492  copyOne,
2493  DDTranslation(0, 0, (rClr - fClr) / 2), //SAME as cryToClr above.
2494  DDRotation());
2495 #ifdef EDM_ML_DEBUG
2496  edm::LogVerbatim("EBGeomX") << cryLog.name() << ":" << copyOne << " positioned in " << clrLog.name() << " at "
2497  << DDTranslation(0, 0, (rClr - fClr) / 2) << " with no rotation";
2498 #endif
2499  if (0 != capHere()) {
2500  cpv.position(aglLog, bsiLog, copyAGL, DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.), DDRotation());
2501 #ifdef EDM_ML_DEBUG
2502  edm::LogVerbatim("EBGeomX") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name() << " at "
2503  << DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.) << " with no rotation";
2504 #endif
2505 
2506  cpv.position(
2507  andLog, bsiLog, copyAND, DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.), DDRotation());
2508 #ifdef EDM_ML_DEBUG
2509  edm::LogVerbatim("EBGeomX") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name() << " at "
2510  << DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.)
2511  << " with no rotation";
2512 #endif
2513  cpv.position(apdLog,
2514  bsiLog,
2515  copyAPD,
2516  DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.),
2517  DDRotation());
2518 #ifdef EDM_ML_DEBUG
2519  edm::LogVerbatim("EBGeomX") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name() << " at "
2520  << DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.)
2521  << " with no rotation";
2522 #endif
2523  cpv.position(atjLog,
2524  bsiLog,
2525  copyATJ,
2526  DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.),
2527  DDRotation());
2528 #ifdef EDM_ML_DEBUG
2529  edm::LogVerbatim("EBGeomX")
2530  << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name() << " at "
2531  << DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.)
2532  << " with no rotation";
2533 #endif
2534  cpv.position(bsiLog, cerLog, copyBSi, DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.), DDRotation());
2535 #ifdef EDM_ML_DEBUG
2536  edm::LogVerbatim("EBGeomX") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name() << " at "
2537  << DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.) << " with no rotation";
2538 #endif
2539  cpv.position(sglLog, capLog, copySGL, DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.), DDRotation());
2540 #ifdef EDM_ML_DEBUG
2541  edm::LogVerbatim("EBGeomX") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name() << " at "
2542  << DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.) << " with no rotation";
2543 #endif
2544  for (unsigned int ijkl(0); ijkl != 2; ++ijkl) {
2545  cpv.position(cerLog,
2546  capLog,
2547  ++copyCER,
2548  DDTranslation(trapCry.bl1() - (0 == ijkl ? apdX1() : apdX2()),
2549  trapCry.h1() - apdZ(),
2550  -sglThick() - cerThick() / 2. + capThick() / 2.),
2551  DDRotation());
2552 #ifdef EDM_ML_DEBUG
2553  edm::LogVerbatim("EBGeomX") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name() << " at "
2554  << DDTranslation(trapCry.bl1() - (0 == ijkl ? apdX1() : apdX2()),
2555  (trapCry.h1() - apdZ()),
2556  (-sglThick() - cerThick() / 2. + capThick() / 2.))
2557  << " with no rotation";
2558 #endif
2559  }
2560  cpv.position(capLog,
2561  clrLog,
2562  copyCap,
2563  DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.),
2564  DDRotation());
2565 #ifdef EDM_ML_DEBUG
2566  edm::LogVerbatim("EBGeomX") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name() << " at "
2567  << DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.)
2568  << " with no rotation";
2569 #endif
2570  }
2571 
2572  const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2);
2573 
2574  cpv.position(clrLog,
2575  wrapLog,
2576  copyOne,
2577  DDTranslation(0, 0, (rWrap - fWrap) / 2), //SAME as cryToWrap
2578  DDRotation());
2579 #ifdef EDM_ML_DEBUG
2580  edm::LogVerbatim("EBGeomX") << clrLog.name() << ":" << copyOne << " positioned in " << wrapLog.name() << " at "
2581  << DDTranslation(0, 0, (rWrap - fWrap) / 2) << " with no rotation";
2582 #endif
2583 
2584  // Now for placement of clr within wall
2585  const Vec3 wrapToWall1(0, 0, (rWall - fWall) / 2);
2586  const Vec3 wrapToWall(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1);
2587 
2588  cpv.position(wrapLog,
2589  wallLog,
2590  copyOne,
2591  DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1), //SAME as wrapToWall
2592  DDRotation());
2593 #ifdef EDM_ML_DEBUG
2594  edm::LogVerbatim("EBGeomX") << wrapLog.name() << ":" << copyOne << " positioned in " << wallLog.name() << " at "
2595  << DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1)
2596  << " with no rotation";
2597 #endif
2598  const Trap::VertexList vWall(trapWall.vertexList());
2599  const Trap::VertexList vCry(trapCry.vertexList());
2600 
2601  const double sidePrime((trapWall.a() - trapCry.a()) / 2);
2602  const double frontPrime(fWall + fWrap + fClr + LUnd / 2);
2603 
2604  // define web plates with clearance ===========================================
2605 
2606  if (1 == cryType) // first web plate: inside clearance volume
2607  {
2608  web(0,
2609  trapWall.b(),
2610  trapWall.B(),
2611  trapWall.L(),
2612  theta,
2613  vHAW[4] + Pt3D(0, hawYOffCry(), 0),
2614  hawRLog,
2615  zee,
2616  sidePrime,
2617  frontPrime,
2618  delta,
2619  cpv);
2620  zee += vecGapAlvEta()[0];
2621  }
2622 
2623  for (unsigned int etaAlv(1); etaAlv <= nCryPerAlvEta(); ++etaAlv) {
2624 #ifdef EDM_ML_DEBUG
2625  edm::LogVerbatim("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime
2626  << ", frontPrime=" << frontPrime << ", zeta=" << zeta << ", delta=" << delta
2627  << ", zee=" << zee;
2628 #endif
2629  zee += 0.075 * mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta);
2630 
2631 #ifdef EDM_ML_DEBUG
2632  edm::LogVerbatim("EcalGeom") << "New zee=" << zee;
2633 #endif
2634  // make transform for placing enclosed crystal
2635 
2636  const Pt3D trap2(vCry[2] + cryToClr + clrToWrap + wrapToWall);
2637 
2638  const Pt3D trap3(trap2 + Pt3D(0, -trapCry.h(), 0));
2639  const Pt3D trap1(trap3 + Pt3D(-trapCry.a(), 0, 0));
2640 
2641  const Pt3D wedge3(vHAW[4] + Pt3D(sidePrime, hawYOffCry(), zee));
2642  const Pt3D wedge2(wedge3 + Pt3D(0, trapCry.h() * cos(theta), -trapCry.h() * sin(theta)));
2643  const Pt3D wedge1(wedge3 + Pt3D(trapCry.a(), 0, 0));
2644 
2645  const Tf3D tForm1(trap1, trap2, trap3, wedge1, wedge2, wedge3);
2646 
2647  const double xx(0.050 * mm);
2648 
2649  const Tf3D tForm(HepGeom::Translate3D(xx, 0, 0) * tForm1);
2650 
2651  cpv.position(wallLog,
2652  hawRLog,
2653  etaAlv,
2654  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
2655  myrot(wallLog.name().name() + "_" + std::to_string(etaAlv), tForm.getRotation()));
2656 #ifdef EDM_ML_DEBUG
2657  edm::LogVerbatim("EBGeomX") << wallLog.name() << ":" << etaAlv << " positioned in " << hawRLog.name() << " at "
2658  << DDTranslation(tForm.getTranslation().x(),
2659  tForm.getTranslation().y(),
2660  tForm.getTranslation().z())
2661  << " with rotation";
2662 #endif
2663  theta -= delta;
2664  side = sidePrime;
2665  zeta = delta;
2666  }
2667  if (5 == cryType || 9 == cryType || 13 == cryType || 17 == cryType) // web plates
2668  {
2669  const unsigned int webIndex(cryType / 4);
2670  zee += 0.5 * vecGapAlvEta()[cryType] / sin(theta);
2671  web(webIndex,
2672  trapWall.a(),
2673  trapWall.A(),
2674  trapWall.L(),
2675  theta,
2676  vHAW[4] + Pt3D(0, hawYOffCry(), 0),
2677  hawRLog,
2678  zee,
2679  sidePrime,
2680  frontPrime,
2681  delta,
2682  cpv);
2683  zee += 0.5 * vecGapAlvEta()[cryType] / sin(theta);
2684  } else {
2685  if (17 != cryType)
2686  zee += vecGapAlvEta()[cryType] / sin(theta);
2687  }
2688  }
2689  // END filling Wedge with crystal plus supports --------------------------
2690 
2691  //------------------------------------------------------------------------
2692  //------------------------------------------------------------------------
2693  //------------------------------------------------------------------------
2694  //------------------------------------------------------------------------
2695  //**************** Material at outer radius of supermodule ***************
2696  //------------------------------------------------------------------------
2697  //------------------------------------------------------------------------
2698  //------------------------------------------------------------------------
2699  //------------------------------------------------------------------------
2700 
2701  if (0 != backHere()) {
2707 
2708  const DDTranslation outtra(backXOff() + backSideHeight() / 2, backYOff(), backSideLength() / 2);
2709 
2710  const double realBPthick(backPlateThick() + backPlate2Thick());
2711 
2712  DDSolid backPlateSolid(
2713  DDSolidFactory::box(backPlateName(), backPlateWidth() / 2., realBPthick / 2., backPlateLength() / 2.));
2714 #ifdef EDM_ML_DEBUG
2715  edm::LogVerbatim("EBGeom") << backPlateName() << " Box " << backPlateWidth() / 2. << ":" << realBPthick / 2.
2716  << ":" << backPlateLength() / 2;
2717 #endif
2718  const std::vector<double>& backPlateParms(backPlateSolid.parameters());
2719  const DDLogicalPart backPlateLog(backPlateName(), backPlateMat(), backPlateSolid);
2720 
2721  const DDTranslation backPlateTra(
2722  backSideHeight() / 2 + backPlateParms[1], 0 * mm, backPlateParms[2] - backSideLength() / 2);
2723 
2724  DDSolid backPlate2Solid(
2726 #ifdef EDM_ML_DEBUG
2727  edm::LogVerbatim("EBGeom") << backPlate2Name() << " Box " << backPlateWidth() / 2. << ":"
2728  << backPlate2Thick() / 2. << ":" << backPlateLength() / 2;
2729 #endif
2730 
2731  const DDLogicalPart backPlate2Log(backPlate2Name(), backPlate2Mat(), backPlate2Solid);
2732 
2733  const DDTranslation backPlate2Tra(0, -backPlateParms[1] + backPlate2Thick() / 2., 0);
2734  if (0 != backPlateHere()) {
2735  cpv.position(backPlate2Log, backPlateName(), copyOne, backPlate2Tra, DDRotation());
2736 #ifdef EDM_ML_DEBUG
2737  edm::LogVerbatim("EBGeomX") << backPlate2Log.name() << ":" << copyOne << " positioned in " << backPlateName()
2738  << " at " << backPlate2Tra << " with no rotation";
2739 #endif
2740  cpv.position(backPlateLog,
2741  spmName(),
2742  copyOne,
2743  outtra + backPlateTra,
2744  myrot(backPlateName().name() + "Rot5", CLHEP::HepRotationZ(270 * deg)));
2745 #ifdef EDM_ML_DEBUG
2746  edm::LogVerbatim("EBGeomX") << backPlateLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
2747  << (outtra + backPlateTra) << " with rotation";
2748 #endif
2749  }
2755 
2761 
2762  const Trap trapBS(backSideWidth() / 2., //double aHalfLengthXNegZLoY , // bl1, A/2
2763  backSideWidth() / 2., //double aHalfLengthXPosZLoY , // bl2, a/2
2764  backSideWidth() / 4., //double aHalfLengthXPosZHiY , // tl2, b/2
2765  backSideHeight() / 2., //double aHalfLengthYNegZ , // h1, H/2
2766  backSideHeight() / 2., //double aHalfLengthYPosZ , // h2, h/2
2767  backSideLength() / 2., //double aHalfLengthZ , // dz, L/2
2768  backSideAngle(), //double aAngleAD , // alfa1
2769  0, //double aCoord15X , // x15
2770  0 //double aCoord15Y // y15
2771  );
2772 
2773  const DDSolid backSideSolid(mytrap(backSideName().name(), trapBS));
2774  const DDLogicalPart backSideLog(backSideName(), backSideMat(), backSideSolid);
2775 
2776  const DDTranslation backSideTra1(0 * mm, backPlateWidth() / 2 + backSideYOff1(), 1 * mm);
2777  if (0 != backSideHere()) {
2778  cpv.position(
2779  backSideLog,
2780  spmName(),
2781  copyOne,
2782  outtra + backSideTra1,
2783  myrot(backSideName().name() + "Rot8", CLHEP::HepRotationX(180 * deg) * CLHEP::HepRotationZ(90 * deg)));
2784 #ifdef EDM_ML_DEBUG
2785  edm::LogVerbatim("EBGeomX") << backSideLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
2786  << (outtra + backSideTra1) << " with rotation";
2787 #endif
2788  const DDTranslation backSideTra2(0 * mm, -backPlateWidth() / 2 + backSideYOff2(), 1 * mm);
2789  cpv.position(backSideLog,
2790  spmName(),
2791  copyTwo,
2792  outtra + backSideTra2,
2793  myrot(backSideName().name() + "Rot9", CLHEP::HepRotationZ(90 * deg)));
2794 #ifdef EDM_ML_DEBUG
2795  edm::LogVerbatim("EBGeomX") << backSideLog.name() << ":" << copyTwo << " positioned in " << spmName() << " at "
2796  << (outtra + backSideTra2) << " with rotation";
2797 #endif
2798  }
2804 
2805  //=====================
2806  const double backCoolWidth(backCoolBarWidth() + 2. * backCoolTankWidth());
2807 
2813 
2814  const double manifCut(2 * mm);
2815 
2816  DDSolid mBManifSolid(DDSolidFactory::tubs(
2817  mBManifName(), backCoolWidth / 2. - manifCut, 0, mBManifOutDiam() / 2, 0 * deg, 360 * deg));
2818 #ifdef EDM_ML_DEBUG
2819  edm::LogVerbatim("EBGeom") << mBManifName() << " Tubs " << backCoolWidth / 2. - manifCut
2820  << ":0:" << mBManifOutDiam() / 2 << ":0:360";
2821 #endif
2822  const DDLogicalPart mBManifLog(mBManifName(), mBManifMat(), mBManifSolid);
2823 
2824  const DDName mBManifWaName(ddname(mBManifName().name() + "Wa"));
2825  DDSolid mBManifWaSolid(DDSolidFactory::tubs(
2826  mBManifWaName, backCoolWidth / 2. - manifCut, 0, mBManifInnDiam() / 2, 0 * deg, 360 * deg));
2827 #ifdef EDM_ML_DEBUG
2828  edm::LogVerbatim("EBGeom") << mBManifWaName << " Tubs " << backCoolWidth / 2. - manifCut
2829  << ":0:" << mBManifInnDiam() / 2 << ":0:360";
2830 #endif
2831  const DDLogicalPart mBManifWaLog(mBManifWaName, backPipeWaterMat(), mBManifWaSolid);
2832  cpv.position(mBManifWaLog, mBManifName(), copyOne, DDTranslation(0, 0, 0), DDRotation());
2833 #ifdef EDM_ML_DEBUG
2834  edm::LogVerbatim("EBGeomX") << mBManifWaLog.name() << ":" << copyOne << " positioned in " << mBManifName()
2835  << " at " << DDTranslation(0, 0, 0) << " with no rotation";
2836 #endif
2837  //=====================
2843 
2849  const double deltaY(-5 * mm);
2850 
2851  DDSolid grEdgeSlotSolid(
2853 #ifdef EDM_ML_DEBUG
2854  edm::LogVerbatim("EBGeom") << grEdgeSlotName() << " Box " << grEdgeSlotHeight() / 2. << ":"
2855  << grEdgeSlotWidth() / 2 << ":" << grilleThick() / 2;
2856 #endif
2857  const DDLogicalPart grEdgeSlotLog(grEdgeSlotName(), grEdgeSlotMat(), grEdgeSlotSolid);
2858 
2859  unsigned int edgeSlotCopy(0);
2860  unsigned int midSlotCopy(0);
2861 
2862  DDLogicalPart grMidSlotLog[4];
2863 
2864  for (unsigned int iGr(0); iGr != vecGrilleHeight().size(); ++iGr) {
2865  DDName gName(ddname(grilleName() + std::to_string(iGr)));
2866  DDSolid grilleSolid(
2867  DDSolidFactory::box(gName, vecGrilleHeight()[iGr] / 2., backCoolWidth / 2., grilleThick() / 2.));
2868 #ifdef EDM_ML_DEBUG
2869  edm::LogVerbatim("EBGeom") << gName << " Box " << vecGrilleHeight()[iGr] / 2. << ":" << backCoolWidth / 2 << ":"
2870  << grilleThick() / 2;
2871 #endif
2872  const DDLogicalPart grilleLog(gName, grilleMat(), grilleSolid);
2873 
2874  const DDTranslation grilleTra(-realBPthick / 2 - vecGrilleHeight()[iGr] / 2,
2875  deltaY,
2876  vecGrilleZOff()[iGr] + grilleThick() / 2 - backSideLength() / 2);
2877  const DDTranslation gTra(outtra + backPlateTra + grilleTra);
2878 
2879  if (0 != grMidSlotHere() && 0 != iGr) {
2880  if (0 == (iGr - 1) % 2) {
2881  DDName mName(ddname(grMidSlotName() + std::to_string(iGr / 2)));
2882  DDSolid grMidSlotSolid(DDSolidFactory::box(
2883  mName, vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., grMidSlotWidth() / 2., grilleThick() / 2.));
2884 #ifdef EDM_ML_DEBUG
2885  edm::LogVerbatim("EBGeom") << mName << " Box " << vecGrMidSlotHeight()[(iGr - 1) / 2] / 2. << ":"
2886  << grMidSlotWidth() / 2 << ":" << grilleThick() / 2;
2887 #endif
2888  grMidSlotLog[(iGr - 1) / 2] = DDLogicalPart(mName, grMidSlotMat(), grMidSlotSolid);
2889  }
2890  cpv.position(grMidSlotLog[(iGr - 1) / 2],
2891  gName,
2892  ++midSlotCopy,
2893  DDTranslation(
2894  vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., +grMidSlotXOff(), 0),
2895  DDRotation());
2896 #ifdef EDM_ML_DEBUG
2897  edm::LogVerbatim("EBGeomX") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in "
2898  << gName << " at "
2899  << DDTranslation(
2900  vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2.,
2901  +grMidSlotXOff(),
2902  0)
2903  << " with no rotation";
2904 #endif
2905 
2906  cpv.position(grMidSlotLog[(iGr - 1) / 2],
2907  gName,
2908  ++midSlotCopy,
2909  DDTranslation(
2910  vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., -grMidSlotXOff(), 0),
2911  DDRotation());
2912 #ifdef EDM_ML_DEBUG
2913  edm::LogVerbatim("EBGeomX") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in "
2914  << gName << " at "
2915  << DDTranslation(
2916  vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2.,
2917  -grMidSlotXOff(),
2918  0)
2919  << " with no rotation";
2920 #endif
2921  }
2922 
2923  if (0 != grEdgeSlotHere() && 0 != iGr) {
2924  cpv.position(
2925  grEdgeSlotLog,
2926  gName,
2927  ++edgeSlotCopy,
2928  DDTranslation(
2929  vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2., backCoolWidth / 2 - grEdgeSlotWidth() / 2., 0),
2930  DDRotation());
2931 #ifdef EDM_ML_DEBUG
2932  edm::LogVerbatim("EBGeomX") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << gName
2933  << " at "
2934  << DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2935  backCoolWidth / 2 - grEdgeSlotWidth() / 2.,
2936  0)
2937  << " with no rotation";
2938 #endif
2939  cpv.position(grEdgeSlotLog,
2940  gName,
2941  ++edgeSlotCopy,
2942  DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2943  -backCoolWidth / 2 + grEdgeSlotWidth() / 2.,
2944  0),
2945  DDRotation());
2946 #ifdef EDM_ML_DEBUG
2947  edm::LogVerbatim("EBGeomX") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << gName
2948  << " at "
2949  << DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2950  -backCoolWidth / 2 + grEdgeSlotWidth() / 2.,
2951  0)
2952  << " with no rotation";
2953 #endif
2954  }
2955  if (0 != grilleHere()) {
2956  cpv.position(grilleLog, spmName(), iGr, gTra, DDRotation());
2957 #ifdef EDM_ML_DEBUG
2958  edm::LogVerbatim("EBGeomX") << grilleLog.name() << ":" << iGr << " positioned in " << spmName() << " at "
2959  << gTra << " with no rotation";
2960 #endif
2961  }
2962  if ((0 != iGr % 2) && (0 != mBManifHere())) {
2963  cpv.position(mBManifLog,
2964  spmName(),
2965  iGr,
2966  gTra - DDTranslation(-mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2967  manifCut,
2968  grilleThick() / 2. + 3 * mBManifOutDiam() / 2.),
2969  myrot(mBManifName().name() + "R1", CLHEP::HepRotationX(90 * deg)));
2970 #ifdef EDM_ML_DEBUG
2971  edm::LogVerbatim("EBGeomX") << mBManifLog.name() << ":" << iGr << " positioned in " << spmName() << " at "
2972  << (gTra - DDTranslation(-mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2973  manifCut,
2974  grilleThick() / 2. + 3 * mBManifOutDiam() / 2.))
2975  << " with rotation";
2976 #endif
2977  cpv.position(mBManifLog,
2978  spmName(),
2979  iGr - 1,
2980  gTra - DDTranslation(-3 * mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2981  manifCut,
2982  grilleThick() / 2 + 3 * mBManifOutDiam() / 2.),
2983  myrot(mBManifName().name() + "R2", CLHEP::HepRotationX(90 * deg)));
2984 #ifdef EDM_ML_DEBUG
2985  edm::LogVerbatim("EBGeomX") << mBManifLog.name() << ":" << (iGr - 1) << " positioned in " << spmName()
2986  << " at "
2987  << (gTra - DDTranslation(-3 * mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2988  manifCut,
2989  grilleThick() / 2 + 3 * mBManifOutDiam() / 2.))
2990  << " with rotation";
2991 #endif
2992  }
2993  }
2994 
3000 
3006 
3007  DDSolid backCoolBarSolid(DDSolidFactory::box(
3009 #ifdef EDM_ML_DEBUG
3010  edm::LogVerbatim("EBGeom") << backCoolBarName() << " Box " << backCoolBarHeight() / 2. << ":"
3011  << backCoolBarWidth() / 2 << ":" << backCoolBarThick() / 2;
3012 #endif
3013  const DDLogicalPart backCoolBarLog(backCoolBarName(), backCoolBarMat(), backCoolBarSolid);
3014 
3015  DDSolid backCoolBarSSSolid(DDSolidFactory::box(
3017 #ifdef EDM_ML_DEBUG
3018  edm::LogVerbatim("EBGeom") << backCoolBarSSName() << " Box " << backCoolBarHeight() / 2. << ":"
3019  << backCoolBarWidth() / 2. << ":" << backCoolBarSSThick() / 2.;
3020 #endif
3021  const DDLogicalPart backCoolBarSSLog(backCoolBarSSName(), backCoolBarSSMat(), backCoolBarSSSolid);
3022  const DDTranslation backCoolBarSSTra(0, 0, 0);
3023  cpv.position(backCoolBarSSLog, backCoolBarName(), copyOne, backCoolBarSSTra, DDRotation());
3024 #ifdef EDM_ML_DEBUG
3025  edm::LogVerbatim("EBGeomX") << backCoolBarSSLog.name() << ":" << copyOne << " positioned in " << backCoolBarName()
3026  << " at " << backCoolBarSSTra << " with no rotation";
3027 #endif
3028 
3029  DDSolid backCoolBarWaSolid(DDSolidFactory::box(
3031 #ifdef EDM_ML_DEBUG
3032  edm::LogVerbatim("EBGeom") << backCoolBarWaName() << " Box " << backCoolBarHeight() / 2. << ":"
3033  << backCoolBarWidth() / 2. << ":" << backCoolBarWaThick() / 2;
3034 #endif
3035  const DDLogicalPart backCoolBarWaLog(backCoolBarWaName(), backCoolBarWaMat(), backCoolBarWaSolid);
3036  const DDTranslation backCoolBarWaTra(0, 0, 0);
3037  cpv.position(backCoolBarWaLog, backCoolBarSSName(), copyOne, backCoolBarWaTra, DDRotation());
3038 #ifdef EDM_ML_DEBUG
3039  edm::LogVerbatim("EBGeomX") << backCoolBarWaLog.name() << ":" << copyOne << " positioned in "
3040  << backCoolBarSSName() << " at " << backCoolBarWaTra << " with no rotation";
3041 #endif
3042 
3048 
3054 
3055  double thickVFE(0);
3056  for (unsigned int iLyr(0); iLyr != vecBackVFELyrThick().size(); ++iLyr) {
3057  thickVFE += vecBackVFELyrThick()[iLyr];
3058  }
3059  DDSolid backVFESolid(
3060  DDSolidFactory::box(backVFEName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., thickVFE / 2.));
3061 #ifdef EDM_ML_DEBUG
3062  edm::LogVerbatim("EBGeom") << backVFEName() << " Box " << backCoolBarHeight() / 2. << ":"
3063  << backCoolBarWidth() / 2 << ":" << thickVFE / 2;
3064 #endif
3065  const DDLogicalPart backVFELog(backVFEName(), backVFEMat(), backVFESolid);
3066  DDTranslation offTra(0, 0, -thickVFE / 2);
3067  for (unsigned int iLyr(0); iLyr != vecBackVFELyrThick().size(); ++iLyr) {
3068  DDSolid backVFELyrSolid(DDSolidFactory::box(ddname(vecBackVFELyrName()[iLyr]),
3069  backCoolBarHeight() / 2.,
3070  backCoolBarWidth() / 2.,
3071  vecBackVFELyrThick()[iLyr] / 2.));
3072 #ifdef EDM_ML_DEBUG
3073  edm::LogVerbatim("EBGeom") << ddname(vecBackVFELyrName()[iLyr]) << " Box " << backCoolBarHeight() / 2. << ":"
3074  << backCoolBarWidth() / 2. << ":" << vecBackVFELyrThick()[iLyr] / 2;
3075 #endif
3076  const DDLogicalPart backVFELyrLog(
3077  ddname(vecBackVFELyrName()[iLyr]), ddmat(vecBackVFELyrMat()[iLyr]), backVFELyrSolid);
3078  const DDTranslation backVFELyrTra(0, 0, vecBackVFELyrThick()[iLyr] / 2);
3079  cpv.position(backVFELyrLog, backVFEName(), copyOne, backVFELyrTra + offTra, DDRotation());
3080 #ifdef EDM_ML_DEBUG
3081  edm::LogVerbatim("EBGeomX") << backVFELyrLog.name() << ":" << copyOne << " positioned in " << backVFEName()
3082  << " at " << (backVFELyrTra + offTra) << " with no rotation";
3083 #endif
3084  offTra += 2 * backVFELyrTra;
3085  }
3086 
3092 
3098 
3099  const double halfZCoolVFE(thickVFE + backCoolBarThick() / 2.);
3100  DDSolid backCoolVFESolid(
3101  DDSolidFactory::box(backCoolVFEName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., halfZCoolVFE));
3102 #ifdef EDM_ML_DEBUG
3103  edm::LogVerbatim("EBGeom") << backCoolVFEName() << " Box " << backCoolBarHeight() / 2. << ":"
3104  << backCoolBarWidth() / 2. << ":" << halfZCoolVFE;
3105 #endif
3106  const DDLogicalPart backCoolVFELog(backCoolVFEName(), backCoolVFEMat(), backCoolVFESolid);
3107  if (0 != backCoolBarHere()) {
3108  cpv.position(backCoolBarLog, backCoolVFEName(), copyOne, DDTranslation(), DDRotation());
3109 #ifdef EDM_ML_DEBUG
3110  edm::LogVerbatim("EBGeomX") << backCoolBarLog.name() << ":" << copyOne << " positioned in " << backCoolVFEName()
3111  << " at " << DDTranslation() << " with no rotation";
3112 #endif
3113  }
3114  if (0 != backCoolVFEHere()) {
3115  cpv.position(backVFELog,
3116  backCoolVFEName(),
3117  copyOne,
3118  DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.),
3119  DDRotation());
3120 #ifdef EDM_ML_DEBUG
3121  edm::LogVerbatim("EBGeomX") << backVFELog.name() << ":" << copyOne << " positioned in " << backCoolVFEName()
3122  << " at " << DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.)
3123  << " with no rotation";
3124 #endif
3125  }
3126  cpv.position(backVFELog,
3127  backCoolVFEName(),
3128  copyTwo,
3129  DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.),
3130  myrot(backVFEName().name() + "Flip", CLHEP::HepRotationX(180 * deg)));
3131 #ifdef EDM_ML_DEBUG
3132  edm::LogVerbatim("EBGeomX") << backVFELog.name() << ":" << copyTwo << " positioned in " << backCoolVFEName()
3133  << " at " << DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.)
3134  << " with rotation";
3135 #endif
3136 
3147  unsigned int iCVFECopy(1);
3148  unsigned int iSep(0);
3149  unsigned int iNSec(0);
3150  const unsigned int nMisc(vecBackMiscThick().size() / 4);
3151  for (unsigned int iMod(0); iMod != 4; ++iMod) {
3152  const double pipeLength(vecGrilleZOff()[2 * iMod + 1] - vecGrilleZOff()[2 * iMod] - grilleThick() - 3 * mm);
3153 
3154  const double pipeZPos(vecGrilleZOff()[2 * iMod + 1] - pipeLength / 2 - 1.5 * mm);
3155 
3156  // accumulate total height of parent volume
3157 
3158  double backCoolHeight(backCoolBarHeight() + mBCoolTubeOutDiam());
3159  for (unsigned int iMisc(0); iMisc != nMisc; ++iMisc) {
3160  backCoolHeight += vecBackMiscThick()[iMod * nMisc + iMisc];
3161  }
3162  double bottomThick(mBCoolTubeOutDiam());
3163  for (unsigned int iMB(0); iMB != vecMBLyrThick().size(); ++iMB) {
3164  backCoolHeight += vecMBLyrThick()[iMB];
3165  bottomThick += vecMBLyrThick()[iMB];
3166  }
3167 
3168  DDName backCName(ddname(vecBackCoolName()[iMod]));
3169  const double halfZBCool((pipeLength - 2 * mBManifOutDiam() - grilleZSpace()) / 2);
3170  DDSolid backCoolSolid(DDSolidFactory::box(backCName, backCoolHeight / 2., backCoolWidth / 2., halfZBCool));
3171 #ifdef EDM_ML_DEBUG
3172  edm::LogVerbatim("EBGeom") << backCName << " Box " << backCoolHeight / 2. << ":" << backCoolWidth / 2. << ":"
3173  << halfZBCool;
3174 #endif
3175  const DDLogicalPart backCoolLog(backCName, spmMat(), backCoolSolid);
3176 
3177  const DDTranslation bCoolTra(
3178  -realBPthick / 2 + backCoolHeight / 2 - vecGrilleHeight()[2 * iMod],
3179  deltaY,
3180  vecGrilleZOff()[2 * iMod] + grilleThick() + grilleZSpace() + halfZBCool - backSideLength() / 2);
3181  if (0 != backCoolHere()) {
3182  cpv.position(backCoolLog, spmName(), iMod + 1, outtra + backPlateTra + bCoolTra, DDRotation());
3183 #ifdef EDM_ML_DEBUG
3184  edm::LogVerbatim("EBGeomX") << backCoolLog.name() << ":" << (iMod + 1) << " positioned in " << spmName()
3185  << " at " << (outtra + backPlateTra + bCoolTra) << " with no rotation";
3186 #endif
3187  }
3188  //===
3189  const double backCoolTankHeight(backCoolBarHeight()); // - backBracketHeight() ) ;
3190 
3191  const double halfZTank(halfZBCool - 5 * cm);
3192 
3193  DDName bTankName(ddname(backCoolTankName() + std::to_string(iMod + 1)));
3194  DDSolid backCoolTankSolid(
3195  DDSolidFactory::box(bTankName, backCoolTankHeight / 2., backCoolTankWidth() / 2., halfZTank));
3196 #ifdef EDM_ML_DEBUG
3197  edm::LogVerbatim("EBGeom") << bTankName << " Box " << backCoolTankHeight / 2. << ":" << backCoolTankWidth() / 2.
3198  << ":" << halfZTank;
3199 #endif
3200  const DDLogicalPart backCoolTankLog(bTankName, backCoolTankMat(), backCoolTankSolid);
3201  if (0 != backCoolTankHere()) {
3202  cpv.position(backCoolTankLog,
3203  backCName,
3204  copyOne,
3205  DDTranslation(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick,
3206  backCoolBarWidth() / 2. + backCoolTankWidth() / 2.,
3207  0),
3208  DDRotation());
3209 #ifdef EDM_ML_DEBUG
3210  edm::LogVerbatim("EBGeomX") << backCoolTankLog.name() << ":" << copyOne << " positioned in " << backCName
3211  << " at "
3212  << DDTranslation(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick,
3213  backCoolBarWidth() / 2. + backCoolTankWidth() / 2.,
3214  0)
3215  << " with no rotation";
3216 #endif
3217  }
3218 
3219  DDName bTankWaName(ddname(backCoolTankWaName() + std::to_string(iMod + 1)));
3220  DDSolid backCoolTankWaSolid(DDSolidFactory::box(bTankWaName,
3221  backCoolTankHeight / 2. - backCoolTankThick() / 2.,
3222  backCoolTankWaWidth() / 2.,
3223  halfZTank - backCoolTankThick() / 2.));
3224 #ifdef EDM_ML_DEBUG
3225  edm::LogVerbatim("EBGeom") << bTankWaName << " Box " << (backCoolTankHeight / 2. - backCoolTankThick() / 2.)
3226  << ":" << backCoolTankWaWidth() / 2. << ":"
3227  << (halfZTank - backCoolTankThick() / 2.);
3228 #endif
3229  const DDLogicalPart backCoolTankWaLog(bTankWaName, backCoolTankWaMat(), backCoolTankWaSolid);
3230  cpv.position(backCoolTankWaLog, bTankName, copyOne, DDTranslation(0, 0, 0), DDRotation());
3231 #ifdef EDM_ML_DEBUG
3232  edm::LogVerbatim("EBGeomX") << backCoolTankWaLog.name() << ":" << copyOne << " positioned in " << bTankName
3233  << " at " << DDTranslation(0, 0, 0) << " with no rotation";
3234 #endif
3235 
3236  DDName bBracketName(ddname(backBracketName() + std::to_string(iMod + 1)));
3237  DDSolid backBracketSolid(
3238  DDSolidFactory::box(bBracketName, backBracketHeight() / 2., backCoolTankWidth() / 2., halfZTank));
3239 #ifdef EDM_ML_DEBUG
3240  edm::LogVerbatim("EBGeom") << bBracketName << " Box " << backBracketHeight() / 2. << ":"
3241  << backCoolTankWidth() / 2. << ":" << halfZTank;
3242 #endif
3243  const DDLogicalPart backBracketLog(bBracketName, backBracketMat(), backBracketSolid);
3244  if (0 != backCoolTankHere()) {
3245  cpv.position(backBracketLog,
3246  backCName,
3247  copyOne,
3248  DDTranslation(backCoolBarHeight() - backCoolHeight / 2. - backBracketHeight() / 2. + bottomThick,
3249  -backCoolBarWidth() / 2. - backCoolTankWidth() / 2.,
3250  0),
3251  DDRotation());
3252 #ifdef EDM_ML_DEBUG
3253  edm::LogVerbatim("EBGeomX") << backBracketLog.name() << ":" << copyOne << " positioned in " << backCName
3254  << " at "
3255  << DDTranslation(backCoolBarHeight() - backCoolHeight / 2. -
3256  backBracketHeight() / 2. + bottomThick,
3257  -backCoolBarWidth() / 2. - backCoolTankWidth() / 2.,
3258  0)
3259  << " with no rotation";
3260 #endif
3261  }
3262 
3263  /* cpv.position( backBracketLog,
3264  backCName,
3265  copyTwo,
3266  DDTranslation( backCoolBarHeight() - backCoolHeight/2. - backBracketHeight()/2.,
3267  backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
3268  DDRotation() ) ;*/
3269 
3270  //===
3271 
3272  DDTranslation bSumTra(backCoolBarHeight() - backCoolHeight / 2. + bottomThick, 0, 0);
3273  for (unsigned int j(0); j != nMisc; ++j) // loop over miscellaneous layers
3274  {
3275  const DDName bName(ddname(vecBackMiscName()[iMod * nMisc + j]));
3276 
3277  DDSolid bSolid(DDSolidFactory::box(bName,
3278  vecBackMiscThick()[iMod * nMisc + j] / 2,
3280  halfZBCool));
3281 #ifdef EDM_ML_DEBUG
3282  edm::LogVerbatim("EBGeom") << bName << " Box " << vecBackMiscThick()[iMod * nMisc + j] / 2 << ":"
3283  << backCoolBarWidth() / 2. + backCoolTankWidth() << ":" << halfZBCool;
3284 #endif
3285 
3286  const DDLogicalPart bLog(bName, ddmat(vecBackMiscMat()[iMod * nMisc + j]), bSolid);
3287 
3288  const DDTranslation bTra(vecBackMiscThick()[iMod * nMisc + j] / 2, 0 * mm, 0 * mm);
3289 
3290  if (0 != backMiscHere()) {
3291  cpv.position(bLog, backCName, copyOne, bSumTra + bTra, DDRotation());
3292 #ifdef EDM_ML_DEBUG
3293  edm::LogVerbatim("EBGeomX") << bLog.name() << ":" << copyOne << " positioned in " << backCName << " at "
3294  << (bSumTra + bTra) << " with no rotation";
3295 #endif
3296  }
3297  bSumTra += 2 * bTra;
3298  }
3299 
3300  const double bHalfWidth(backCoolBarWidth() / 2. + backCoolTankWidth());
3301 
3302  if (0 != mBLyrHere()) {
3303  DDTranslation mTra(-backCoolHeight / 2. + mBCoolTubeOutDiam(), 0, 0);
3304  for (unsigned int j(0); j != vecMBLyrThick().size(); ++j) // loop over MB layers
3305  {
3306  const DDName mName(ddname(vecMBLyrName()[j] + "_" + std::to_string(iMod + 1)));
3307 
3308  DDSolid mSolid(DDSolidFactory::box(mName, vecMBLyrThick()[j] / 2, bHalfWidth, halfZBCool));
3309 #ifdef EDM_ML_DEBUG
3310  edm::LogVerbatim("EBGeom") << mName << " Box " << vecMBLyrThick()[j] / 2 << ":" << bHalfWidth << ":"
3311  << halfZBCool;
3312 #endif
3313 
3314  const DDLogicalPart mLog(mName, ddmat(vecMBLyrMat()[j]), mSolid);
3315 
3316  mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm);
3317  cpv.position(mLog, backCName, copyOne, mTra, DDRotation());
3318 #ifdef EDM_ML_DEBUG
3319  edm::LogVerbatim("EBGeomX") << mLog.name() << ":" << copyOne << " positioned in " << backCName << " at "
3320  << mTra << " with no rotation";
3321 #endif
3322  mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm);
3323  }
3324  }
3325 
3326  if (0 != mBCoolTubeHere()) {
3327  const DDName mBName(ddname(mBCoolTubeName() + "_" + std::to_string(iMod + 1)));
3328 
3329  DDSolid mBCoolTubeSolid(
3330  DDSolidFactory::tubs(mBName, halfZBCool, 0, mBCoolTubeOutDiam() / 2, 0 * deg, 360 * deg));
3331 #ifdef EDM_ML_DEBUG
3332  edm::LogVerbatim("EBGeom") << mBName << " Tubs " << halfZBCool << ":0:" << mBCoolTubeOutDiam() / 2
3333  << ":0:360";
3334 #endif
3335  const DDLogicalPart mBLog(mBName, mBCoolTubeMat(), mBCoolTubeSolid);
3336 
3337  const DDName mBWaName(ddname(mBCoolTubeName() + "Wa_" + std::to_string(iMod + 1)));
3338  DDSolid mBCoolTubeWaSolid(
3339  DDSolidFactory::tubs(mBWaName, halfZBCool, 0, mBCoolTubeInnDiam() / 2, 0 * deg, 360 * deg));
3340 #ifdef EDM_ML_DEBUG
3341  edm::LogVerbatim("EBGeom") << mBWaName << " Tubs " << halfZBCool << ":0:" << mBCoolTubeInnDiam() / 2
3342  << ":0:360";
3343 #endif
3344  const DDLogicalPart mBWaLog(mBWaName, backPipeWaterMat(), mBCoolTubeWaSolid);
3345  cpv.position(mBWaLog, mBName, copyOne, DDTranslation(0, 0, 0), DDRotation());
3346 #ifdef EDM_ML_DEBUG
3347  edm::LogVerbatim("EBGeomX") << mBWaLog.name() << ":" << copyOne << " positioned in " << mBName << " at "
3348  << DDTranslation(0, 0, 0) << " with no rotation";
3349 #endif
3350  for (unsigned int j(0); j != mBCoolTubeNum(); ++j) // loop over all MB cooling circuits
3351  {
3352  cpv.position(
3353  mBLog,
3354  backCName,
3355  2 * j + 1,
3356  DDTranslation(
3357  -backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2., -bHalfWidth + (j + 1) * bHalfWidth / 5, 0),
3358  DDRotation());
3359 #ifdef EDM_ML_DEBUG
3360  edm::LogVerbatim("EBGeomX") << mBLog.name() << ":" << (2 * j + 1) << " positioned in " << backCName
3361  << " at "
3362  << DDTranslation(-backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2.,
3363  -bHalfWidth + (j + 1) * bHalfWidth / 5,
3364  0)
3365  << " with no rotation";
3366 #endif
3367  }
3368  }
3369 
3375  if (0 != backPipeHere() && 0 != iMod) {
3376  DDName bPipeName(ddname(backPipeName() + "_" + std::to_string(iMod + 1)));
3377  DDName bInnerName(ddname(backPipeName() + "_H2O_" + std::to_string(iMod + 1)));
3378 
3379  DDSolid backPipeSolid(
3380  DDSolidFactory::tubs(bPipeName, pipeLength / 2, 0 * mm, vecBackPipeDiam()[iMod] / 2, 0 * deg, 360 * deg));
3381 #ifdef EDM_ML_DEBUG
3382  edm::LogVerbatim("EBGeom") << bPipeName << " Tubs " << pipeLength / 2 << ":0:" << vecBackPipeDiam()[iMod] / 2
3383  << ":0:360";
3384 #endif
3385 
3386  DDSolid backInnerSolid(DDSolidFactory::tubs(bInnerName,
3387  pipeLength / 2,
3388  0 * mm,
3389  vecBackPipeDiam()[iMod] / 2 - vecBackPipeThick()[iMod],
3390  0 * deg,
3391  360 * deg));
3392 #ifdef EDM_ML_DEBUG
3393  edm::LogVerbatim("EBGeom") << bInnerName << " Tubs " << pipeLength / 2
3394  << ":0:" << vecBackPipeDiam()[iMod] / 2 - vecBackPipeThick()[iMod] << ":0:360";
3395 #endif
3396 
3397  const DDLogicalPart backPipeLog(bPipeName, backPipeMat(), backPipeSolid);
3398 
3399  const DDLogicalPart backInnerLog(bInnerName, backPipeWaterMat(), backInnerSolid);
3400 
3401  const DDTranslation bPipeTra1(
3402  backXOff() + backSideHeight() - 0.7 * vecBackPipeDiam()[iMod],
3403  backYOff() + backPlateWidth() / 2 - backSideWidth() - 0.7 * vecBackPipeDiam()[iMod],
3404  pipeZPos);
3405 
3406  cpv.position(backPipeLog, spmName(), copyOne, bPipeTra1, DDRotation());
3407 #ifdef EDM_ML_DEBUG
3408  edm::LogVerbatim("EBGeomX") << backPipeLog.name() << ":" << copyOne << " positioned in " << spmName()
3409  << " at " << bPipeTra1 << " with no rotation";
3410 #endif
3411 
3412  const DDTranslation bPipeTra2(bPipeTra1.x(),
3413  backYOff() - backPlateWidth() / 2 + backSideWidth() + vecBackPipeDiam()[iMod],
3414  bPipeTra1.z());
3415 
3416  cpv.position(backPipeLog, spmName(), copyTwo, bPipeTra2, DDRotation());
3417 #ifdef EDM_ML_DEBUG
3418  edm::LogVerbatim("EBGeomX") << backPipeLog.name() << ":" << copyTwo << " positioned in " << spmName()
3419  << " at " << bPipeTra2 << " with no rotation";
3420 #endif
3421  cpv.position(backInnerLog, bPipeName, copyOne, DDTranslation(), DDRotation());
3422 #ifdef EDM_ML_DEBUG
3423  edm::LogVerbatim("EBGeomX") << backInnerLog.name() << ":" << copyOne << " positioned in " << bPipeName
3424  << " at " << DDTranslation() << " with no rotation";
3425 #endif
3426  }
3432 
3433  //=================================================
3434 
3435  if (0 != dryAirTubeHere()) {
3436  DDName dryAirTubName(ddname(dryAirTubeName() + std::to_string(iMod + 1)));
3437 
3438  DDSolid dryAirTubeSolid(DDSolidFactory::tubs(
3439  dryAirTubName, pipeLength / 2, dryAirTubeInnDiam() / 2, dryAirTubeOutDiam() / 2, 0 * deg, 360 * deg));
3440 #ifdef EDM_ML_DEBUG
3441  edm::LogVerbatim("EBGeom") << dryAirTubName << " Tubs " << pipeLength / 2 << ":" << dryAirTubeInnDiam() / 2
3442  << ":" << dryAirTubeOutDiam() / 2 << ":0:360";
3443 #endif
3444 
3445  const DDLogicalPart dryAirTubeLog(dryAirTubName, dryAirTubeMat(), dryAirTubeSolid);
3446 
3447  const DDTranslation dryAirTubeTra1(
3448  backXOff() + backSideHeight() - 0.7 * dryAirTubeOutDiam() - vecBackPipeDiam()[iMod],
3449  backYOff() + backPlateWidth() / 2 - backSideWidth() - 1.2 * dryAirTubeOutDiam(),
3450  pipeZPos);
3451 
3452  cpv.position(dryAirTubeLog, spmName(), copyOne, dryAirTubeTra1, DDRotation());
3453 #ifdef EDM_ML_DEBUG
3454  edm::LogVerbatim("EBGeomX") << dryAirTubeLog.name() << ":" << copyOne << " positioned in " << spmName()
3455  << " at " << dryAirTubeTra1 << " with no rotation";
3456 #endif
3457 
3458  const DDTranslation dryAirTubeTra2(
3459  dryAirTubeTra1.x(),
3460  backYOff() - backPlateWidth() / 2 + backSideWidth() + 0.7 * dryAirTubeOutDiam(),
3461  dryAirTubeTra1.z());
3462 
3463  cpv.position(dryAirTubeLog, spmName(), copyTwo, dryAirTubeTra2, DDRotation());
3464 #ifdef EDM_ML_DEBUG
3465  edm::LogVerbatim("EBGeomX") << dryAirTubeLog.name() << ":" << copyTwo << " positioned in " << spmName()
3466  << " at " << dryAirTubeTra2 << " with no rotation";
3467 #endif
3468  }
3469  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3470 
3476 
3477  DDTranslation cTra(backCoolBarHeight() / 2. - backCoolHeight / 2. + bottomThick, 0, -halfZTank + halfZCoolVFE);
3478  const unsigned int numSec(static_cast<unsigned int>(vecBackCoolNSec()[iMod]));
3479  for (unsigned int jSec(0); jSec != numSec; ++jSec) {
3480  const unsigned int nMax(static_cast<unsigned int>(vecBackCoolNPerSec()[iNSec++]));
3481  for (unsigned int iBar(0); iBar != nMax; ++iBar) {
3482  cpv.position(backCoolVFELog, backCName, iCVFECopy++, cTra, DDRotation());
3483 #ifdef EDM_ML_DEBUG
3484  edm::LogVerbatim("EBGeomX") << backCoolVFELog.name() << ":" << iCVFECopy << " positioned in " << backCName
3485  << " at " << cTra << " with no rotation";
3486 #endif
3487  cTra += DDTranslation(0, 0, backCBStdSep());
3488  }
3489  cTra -= DDTranslation(0, 0, backCBStdSep()); // backspace to previous
3490  if (jSec != numSec - 1)
3491  cTra += DDTranslation(0, 0, vecBackCoolSecSep()[iSep++]); // now take atypical step
3492  }
3498  }
3499 
3505 
3511 
3512  double patchHeight(0);
3513  for (unsigned int iPatch(0); iPatch != vecPatchPanelThick().size(); ++iPatch) {
3514  patchHeight += vecPatchPanelThick()[iPatch];
3515  }
3516 
3518  patchHeight / 2.,
3519  backCoolBarWidth() / 2.,
3520  (vecSpmZPts().back() - vecGrilleZOff().back() - grilleThick()) / 2));
3521 #ifdef EDM_ML_DEBUG
3522  edm::LogVerbatim("EBGeom") << patchPanelName() << " Box " << patchHeight / 2. << ":" << backCoolBarWidth() / 2.
3523  << ":" << (vecSpmZPts().back() - vecGrilleZOff().back() - grilleThick()) / 2;
3524 #endif
3525 
3526  const std::vector<double>& patchParms(patchSolid.parameters());
3527 
3528  const DDLogicalPart patchLog(patchPanelName(), spmMat(), patchSolid);
3529 
3530  const DDTranslation patchTra(backXOff() + 4 * mm, 0 * mm, vecGrilleZOff().back() + grilleThick() + patchParms[2]);
3531  if (0 != patchPanelHere()) {
3532  cpv.position(patchLog, spmName(), copyOne, patchTra, DDRotation());
3533 #ifdef EDM_ML_DEBUG
3534  edm::LogVerbatim("EBGeomX") << patchLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
3535  << patchTra << " with no rotation";
3536 #endif
3537  }
3538  DDTranslation pTra(-patchParms[0], 0, 0);
3539 
3540  for (unsigned int j(0); j != vecPatchPanelNames().size(); ++j) {
3541  const DDName pName(ddname(vecPatchPanelNames()[j]));
3542 
3543  DDSolid pSolid(DDSolidFactory::box(pName, vecPatchPanelThick()[j] / 2., patchParms[1], patchParms[2]));
3544 #ifdef EDM_ML_DEBUG
3545  edm::LogVerbatim("EBGeom") << pName << " Box " << vecPatchPanelThick()[j] / 2. << ":" << patchParms[1] << ":"
3546  << patchParms[2];
3547 #endif
3548  const DDLogicalPart pLog(pName, ddmat(vecPatchPanelMat()[j]), pSolid);
3549 
3550  pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm);
3551 
3552  cpv.position(pLog, patchPanelName(), copyOne, pTra, DDRotation());
3553 #ifdef EDM_ML_DEBUG
3554  edm::LogVerbatim("EBGeomX") << pLog.name() << ":" << copyOne << " positioned in " << patchPanelName() << " at "
3555  << pTra << " with no rotation";
3556 #endif
3557  pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm);
3558  }
3564 
3570 
3571  if (0 != pincerRodHere()) {
3572  // Make hierarchy of rods, envelopes, blocks, shims, and cutouts
3573 
3574  DDSolid rodSolid(
3575  DDSolidFactory::box(pincerRodName(), pincerEnvWidth() / 2., pincerEnvHeight() / 2., ilyLength / 2));
3576 #ifdef EDM_ML_DEBUG
3577  edm::LogVerbatim("EBGeom") << pincerRodName() << " Box " << pincerEnvWidth() / 2. << ":"
3578  << pincerEnvHeight() / 2. << ":" << ilyLength / 2;
3579 #endif
3580  const DDLogicalPart rodLog(pincerRodName(), pincerRodMat(), rodSolid);
3581 
3582  DDSolid envSolid(
3584 #ifdef EDM_ML_DEBUG
3585  edm::LogVerbatim("EBGeom") << pincerEnvName() << " Box " << pincerEnvWidth() / 2. << ":"
3586  << pincerEnvHeight() / 2. << ":" << pincerEnvLength() / 2;
3587 #endif
3588  const DDLogicalPart envLog(pincerEnvName(), pincerEnvMat(), envSolid);
3589  const std::vector<double>& envParms(envSolid.parameters());
3590 
3591  DDSolid blkSolid(
3593 #ifdef EDM_ML_DEBUG
3594  edm::LogVerbatim("EBGeom") << pincerBlkName() << " Box " << pincerEnvWidth() / 2. << ":"
3595  << pincerEnvHeight() / 2. << ":" << pincerBlkLength() / 2;
3596 #endif
3597  const DDLogicalPart blkLog(pincerBlkName(), pincerBlkMat(), blkSolid);
3598  const std::vector<double>& blkParms(blkSolid.parameters());
3599  cpv.position(blkLog,
3600  pincerEnvName(),
3601  copyOne,
3602  DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2),
3603  DDRotation());
3604 #ifdef EDM_ML_DEBUG
3605  edm::LogVerbatim("EBGeomX") << blkLog.name() << ":" << copyOne << " positioned in " << pincerEnvName() << " at "
3606  << DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2)
3607  << " with no rotation";
3608 #endif
3609 
3610  DDSolid cutSolid(
3612 #ifdef EDM_ML_DEBUG
3613  edm::LogVerbatim("EBGeom") << pincerCutName() << " Box " << pincerCutWidth() / 2. << ":"
3614  << pincerCutHeight() / 2 << ":" << pincerBlkLength() / 2;
3615 #endif
3616  const DDLogicalPart cutLog(pincerCutName(), pincerCutMat(), cutSolid);
3617  const std::vector<double>& cutParms(cutSolid.parameters());
3618  cpv.position(
3619  cutLog,
3620  pincerBlkName(),
3621  copyOne,
3622  DDTranslation(
3623  +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(), -blkParms[1] + cutParms[1], 0),
3624  DDRotation());
3625 #ifdef EDM_ML_DEBUG
3626  edm::LogVerbatim("EBGeomX") << cutLog.name() << ":" << copyOne << " positioned in " << pincerBlkName() << " at "
3627  << DDTranslation(
3628  blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(),
3629  -blkParms[1] + cutParms[1],
3630  0)
3631  << " with no rotation";
3632 #endif
3633 
3634  DDSolid shim2Solid(DDSolidFactory::box(
3636 #ifdef EDM_ML_DEBUG
3637  edm::LogVerbatim("EBGeom") << pincerShim2Name() << " Box " << pincerShim2Width() / 2. << ":"
3638  << pincerShimHeight() / 2. << ":" << pincerBlkLength() / 2;
3639 #endif
3640  const DDLogicalPart shim2Log(pincerShim2Name(), pincerShimMat(), shim2Solid);
3641  const std::vector<double>& shim2Parms(shim2Solid.parameters());
3642  cpv.position(shim2Log,
3643  pincerCutName(),
3644  copyOne,
3645  DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0),
3646  DDRotation());
3647 #ifdef EDM_ML_DEBUG
3648  edm::LogVerbatim("EBGeomX") << shim2Log.name() << ":" << copyOne << " positioned in " << pincerCutName()
3649  << " at "
3650  << DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0)
3651  << " with no rotation";
3652 #endif
3653 
3655  pincerShim1Width() / 2.,
3656  pincerShimHeight() / 2.,
3657  (pincerEnvLength() - pincerBlkLength()) / 2));
3658 #ifdef EDM_ML_DEBUG
3659  edm::LogVerbatim("EBGeom") << pincerShim1Name() << " Box " << pincerShim1Width() / 2. << ":"
3660  << pincerShimHeight() / 2. << ":" << (pincerEnvLength() - pincerBlkLength()) / 2;
3661 #endif
3662 
3663  const DDLogicalPart shim1Log(pincerShim1Name(), pincerShimMat(), shim1Solid);
3664  const std::vector<double>& shim1Parms(shim1Solid.parameters());
3665  cpv.position(
3666  shim1Log,
3667  pincerEnvName(),
3668  copyOne,
3669  DDTranslation(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2]),
3670  DDRotation());
3671 #ifdef EDM_ML_DEBUG
3672  edm::LogVerbatim("EBGeomX") << shim1Log.name() << ":" << copyOne << " positioned in " << pincerEnvName()
3673  << " at "
3674  << DDTranslation(+envParms[0] - shim1Parms[0],
3675  -envParms[1] + shim1Parms[1],
3676  -envParms[2] + shim1Parms[2])
3677  << " with no rotation";
3678 #endif
3679  for (unsigned int iEnv(0); iEnv != vecPincerEnvZOff().size(); ++iEnv) {
3680  cpv.position(envLog,
3681  pincerRodName(),
3682  1 + iEnv,
3683  DDTranslation(0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.),
3684  DDRotation());
3685 #ifdef EDM_ML_DEBUG
3686  edm::LogVerbatim("EBGeomX") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << pincerRodName()
3687  << " at "
3688  << DDTranslation(
3689  0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.)
3690  << " with no rotation";
3691 #endif
3692  }
3693 
3694  // Place the rods
3695  // const double radius ( fawRadOff() - pincerEnvHeight()/2 -1*mm ) ;
3696  const double radius(ilyRMin - pincerEnvHeight() / 2 - 1 * mm);
3697 
3698  const DDName xilyName(ddname(ilyName() + std::to_string(vecIlyMat().size() - 1)));
3699 
3700  for (unsigned int iRod(0); iRod != vecPincerRodAzimuth().size(); ++iRod) {
3701  const DDTranslation rodTra(
3702  radius * cos(vecPincerRodAzimuth()[iRod]), radius * sin(vecPincerRodAzimuth()[iRod]), 0);
3703 
3704  cpv.position(rodLog,
3705  xilyName,
3706  1 + iRod,
3707  rodTra,
3708  myrot(pincerRodName().name() + std::to_string(iRod),
3709  CLHEP::HepRotationZ(90 * deg + vecPincerRodAzimuth()[iRod])));
3710 #ifdef EDM_ML_DEBUG
3711  edm::LogVerbatim("EBGeomX") << rodLog.name() << ":" << (1 + iRod) << " positioned in " << xilyName << " at "
3712  << rodTra << " with rotation";
3713 #endif
3714  }
3715  }
3721  }
3722  }
3723 
3724 #ifdef EDM_ML_DEBUG
3725  edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo test: end it...";
3726 #endif
3727 }
3728 
3730 DDRotation DDEcalBarrelNewAlgo::myrot(const std::string& s, const CLHEP::HepRotation& r) const {
3731  return DDrot(
3732  ddname(m_idNameSpace + ":" + s),
3733  std::make_unique<DDRotationMatrix>(r.xx(), r.xy(), r.xz(), r.yx(), r.yy(), r.yz(), r.zx(), r.zy(), r.zz()));
3734 }
3735 
3737 
3739  const pair<std::string, std::string> temp(DDSplit(s));
3740  if (temp.second.empty()) {
3741  return DDName(temp.first, m_idNameSpace);
3742  } else {
3743  return DDName(temp.first, temp.second);
3744  }
3745 }
3746 
3748 #ifdef EDM_ML_DEBUG
3749  edm::LogVerbatim("EBGeom") << DDName(s) << " Trap " << t.theta() / CLHEP::deg << ":" << t.phi() / CLHEP::deg << ":"
3750  << t.h1() << ":" << t.bl1() << ":" << t.tl1() << ":" << t.alp1() / CLHEP::deg << ":"
3751  << t.h2() << ":" << t.bl2() << ":" << t.tl2() << ":" << t.alp2() / CLHEP::deg;
3752 #endif
3753  return DDSolidFactory::trap(
3754  ddname(s), t.dz(), t.theta(), t.phi(), t.h1(), t.bl1(), t.tl1(), t.alp1(), t.h2(), t.bl2(), t.tl2(), t.alp2());
3755 }
3756 
3757 void DDEcalBarrelNewAlgo::web(unsigned int iWeb,
3758  double bWeb,
3759  double BWeb,
3760  double LWeb,
3761  double theta,
3762  const HepGeom::Point3D<double>& corner,
3763  const DDLogicalPart& logPar,
3764  double& zee,
3765  double side,
3766  double front,
3767  double delta,
3768  DDCompactView& cpv) {
3769  const unsigned int copyOne(1);
3770 
3771  const double LWebx(vecWebLength()[iWeb]);
3772 
3773  const double BWebx(bWeb + (BWeb - bWeb) * LWebx / LWeb);
3774 
3775  const double thick(vecWebPlTh()[iWeb] + vecWebClrTh()[iWeb]);
3776  const Trap trapWebClr(BWebx / 2, // A/2
3777  bWeb / 2, // a/2
3778  bWeb / 2, // b/2
3779  thick / 2, // H/2
3780  thick / 2, // h/2
3781  LWebx / 2, // L/2
3782  90 * deg, // alfa1
3783  bWeb - BWebx, // x15
3784  0 // y15
3785  );
3786  const DDName webClrDDName(webClrName() + std::to_string(iWeb));
3787  const DDSolid webClrSolid(mytrap(webClrDDName.name(), trapWebClr));
3788  const DDLogicalPart webClrLog(webClrDDName, webClrMat(), webClrSolid);
3789 
3790  const Trap trapWebPl(trapWebClr.A() / 2, // A/2
3791  trapWebClr.a() / 2, // a/2
3792  trapWebClr.b() / 2, // b/2
3793  vecWebPlTh()[iWeb] / 2, // H/2
3794  vecWebPlTh()[iWeb] / 2, // h/2
3795  trapWebClr.L() / 2., // L/2
3796  90 * deg, // alfa1
3797  trapWebClr.b() - trapWebClr.B(), // x15
3798  0 // y15
3799  );
3800  const DDName webPlDDName(webPlName() + std::to_string(iWeb));
3801  const DDSolid webPlSolid(mytrap(webPlDDName.fullname(), trapWebPl));
3802  const DDLogicalPart webPlLog(webPlDDName, webPlMat(), webPlSolid);
3803 
3804  cpv.position(webPlLog, // place plate inside clearance volume
3805  webClrDDName,
3806  copyOne,
3807  DDTranslation(0, 0, 0),
3808  DDRotation());
3809 #ifdef EDM_ML_DEBUG
3810  edm::LogVerbatim("EBGeomX") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrDDName << " at "
3811  << DDTranslation(0, 0, 0) << " with no rotation";
3812 #endif
3813  const Trap::VertexList vWeb(trapWebClr.vertexList());
3814 
3815  zee += trapWebClr.h() / sin(theta);
3816 
3817  const double beta(theta + delta);
3818 
3819  const double zWeb(zee - front * cos(beta) + side * sin(beta));
3820  const double yWeb(front * sin(beta) + side * cos(beta));
3821 
3822  const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb));
3823  const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta)));
3824  const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0));
3825 
3826 #ifdef EDM_ML_DEBUG
3827  edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3];
3828 
3829  edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3;
3830 #endif
3831  const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3);
3832 
3833  if (0 != webHere()) {
3834  cpv.position(webClrLog,
3835  logPar,
3836  copyOne,
3837  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
3838  myrot(webClrLog.name().name() + std::to_string(iWeb), tForm.getRotation()));
3839 #ifdef EDM_ML_DEBUG
3840  edm::LogVerbatim("EBGeomX") << webClrLog.name() << ":" << copyOne << " positioned in " << logPar.name() << " at "
3841  << DDTranslation(tForm.getTranslation().x(),
3842  tForm.getTranslation().y(),
3843  tForm.getTranslation().z())
3844  << " with rotation";
3845 #endif
3846  }
3847 }
3848 
3850 
3851 DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDEcalBarrelNewAlgo, "ecal:DDEcalBarrelNewAlgo");
DDMaterial mBCoolTubeMat() const
double dryAirTubeInnDiam() const
size
Write out results.
std::vector< double > m_vecPincerEnvZOff
std::vector< double > m_vecIlyFEMZ
std::vector< double > m_vecNomCryDimCF
HepGeom::RotateX3D RoX3D
double backCoolBarWidth() const
HepGeom::Transform3D Tf3D
Log< level::Info, true > LogVerbatim
DDMaterial webClrMat() const
const std::vector< double > & vecBackPipeThick() const
std::vector< std::string > m_vecBackVFELyrMat
std::vector< std::string > m_vecBackCoolName
weight_default_t b3[10]
Definition: b3.h:9
double backSideHeight() const
std::vector< std::string > m_vecIlyMat
DDMaterial wrapMat() const
HepGeom::Point3D< double > Pt3D
double backCoolBarSSThick() const
weight_default_t b1[25]
Definition: b1.h:9
DDName pincerShim1Name() const
std::vector< double > m_vecSpmZPts
DDMaterial cerMat() const
DDMaterial spmMat() const
DDMaterial backPlate2Mat() const
CLHEP::HepRotation Rota
double backCoolTankThick() const
const std::vector< double > & vecIlyFanOutZ() const
DDMaterial clrMat() const
DDMaterial aglMat() const
const std::string & wallName() const
double pincerEnvLength() const
DDName pincerBlkName() const
const std::vector< double > & vecBarRMax() const
double mBCoolTubeNum() const
const std::string & backCoolTankName() const
const std::vector< std::string > & vecPatchPanelNames() const
const std::vector< double > & vecBackCoolSecSep() const
double spmCutThick() const
const std::vector< std::string > & vecBackCoolName() const
DDName backCoolBarName() const
double backCoolBarWaThick() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=nullptr)
const std::vector< std::string > & vecMBLyrMat() const
std::vector< double > m_vecSpmBTran
double pincerShim2Width() const
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
DDMaterial backSideMat() const
double dryAirTubeOutDiam() const
const std::vector< double > & vecSpmCutTP() const
double backPlate2Thick() const
double backCoolTankWidth() const
const std::string & grMidSlotName() const
double pincerRodHere() const
const std::string & webClrName() const
const std::vector< double > & vecIlyPipeZ() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:45
unsigned int spmNPerHalf() const
std::vector< double > m_vecBarTran
const std::vector< double > & vecIlyPipeLength() const
const std::string & backBracketName() const
std::vector< double > m_vecBackMiscThick
const std::vector< double > & vecBackCoolNPerSec() const
const std::vector< double > & vecBarRota2() const
const std::string & wrapName() const
std::vector< double > m_vecNomCryDimAR
const std::string & cryName() const
double backCoolTankWaWidth() const
static DDSolid polycone(const DDName &name, double startPhi, double deltaPhi, const std::vector< double > &z, const std::vector< double > &rmin, const std::vector< double > &rmax)
Creates a polycone (refere to Geant3 or Geant4 documentation)
Definition: DDSolid.cc:551
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const std::vector< double > & vecBackCoolNSec() const
DDMaterial backCoolTankWaMat() const
const std::vector< double > & vecGrMidSlotHeight() const
const std::vector< double > & vecBarRMin() const
std::vector< double > m_vecIlyFanOutZ
HepGeom::RotateY3D RoY3D
double pincerCutHeight() const
const std::string & backPipeName() const
double backSideYOff1() const
const std::vector< double > & vecBackPipeDiam() const
const std::vector< double > & vecWebPlTh() const
double ilyBndlLength() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDMaterial backPipeWaterMat() const
DDMaterial backCoolMat() const
#define M_PI_2
std::string to_string(const V &value)
Definition: OMSAccess.h:71
std::vector< double > m_vecIlyFanOutPhi
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
const std::vector< double > & vecBarRota() const
std::vector< std::string > m_vecBackMiscName
static std::string & ns()
DDSolid mytrap(const std::string &s, const Trap &t) const
std::vector< double > m_vecBackCoolSecSep
DDMaterial andMat() const
std::vector< double > m_vecBarRota2
const std::vector< std::string > & vecBackMiscName() const
const std::vector< double > & vecPatchPanelThick() const
const std::vector< double > & vecIlyThick() const
std::vector< double > m_vecNomCryDimBF
DDMaterial grMidSlotMat() const
DDMaterial ilyPipeMat() const
std::vector< double > m_vecWebClrTh
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDMaterial grEdgeSlotMat() const
const std::vector< std::string > & vecBackMiscMat() const
DDMaterial backBracketMat() const
DDName pincerEnvName() const
double pincerEnvHeight() const
std::vector< double > m_vecBarRMin
const std::vector< double > & vecIlyPipePhi() const
std::vector< double > m_vecIlyPipePhi
std::vector< std::string > m_vecPatchPanelMat
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
unsigned int nCryTypes() const
const std::vector< double > & vecBackVFELyrThick() const
double ilyFanOutHere() const
std::vector< std::string > m_vecPatchPanelNames
const std::vector< std::string > & vecIlyMat() const
DDName backPlate2Name() const
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:57
double ilyDiffLength() const
double patchPanelHere() const
const std::vector< double > & vecBarRota3() const
DDMaterial pincerEnvMat() const
std::vector< std::string > m_vecMBLyrName
std::vector< double > m_vecSpmBRota
double pincerShim1Width() const
std::vector< double > m_vecSpmRMax
const std::string & mBCoolTubeName() const
const std::vector< double > & vecNomCryDimCR() const
DDMaterial ddmat(const std::string &s) const
DDMaterial dryAirTubeMat() const
std::vector< double > m_vecPincerRodAzimuth
double grMidSlotXOff() const
DDMaterial ilyFanOutMat() const
DDMaterial webPlMat() const
DDMaterial backCoolBarWaMat() const
const std::vector< double > & vecNomCryDimAR() const
double dryAirTubeHere() const
std::vector< double > m_vecWebLength
double ilyFanOutHeight() const
const std::vector< double > & vecSpmRMax() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
double mBManifInnDiam() const
std::vector< double > m_vecBarRota
EcalTrapezoidParameters Trap
const std::vector< double > & vecNomCryDimBR() const
double ilyFanOutLength() const
DDMaterial pincerRodMat() const
std::vector< std::string > m_vecBackVFELyrName
DDMaterial mBManifMat() const
DDMaterial ilyDiffMat() const
double grMidSlotWidth() const
double pincerCutWidth() const
double mBCoolTubeHere() const
CLHEP::Hep3Vector Vec3
const std::vector< double > & vecBarZPts() const
T sqrt(T t)
Definition: SSEVec.h:19
double pincerBlkLength() const
DDName backCoolVFEName() const
std::vector< double > m_vecNomCryDimCR
const std::vector< std::string > & vecBackVFELyrName() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
DDMaterial gridMat() const
DDName ddname(const std::string &s) const
DDMaterial wallMat() const
std::vector< double > m_vecNomCryDimBR
double backPlateLength() const
const std::string & backCoolTankWaName() const
std::vector< std::string > m_vecBackMiscMat
DDMaterial backCoolBarSSMat() const
DDMaterial backCoolBarMat() const
DDMaterial atjMat() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
std::vector< double > m_vecBackCoolNSec
double backBracketHeight() const
const std::vector< double > & vecWebClrTh() const
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:67
const std::vector< double > & vecMBLyrThick() const
DDMaterial cryMat() const
const std::vector< double > & vecSpmTran() const
double pincerShimHeight() const
std::vector< double > m_vecIlyPipeType
DDMaterial ilyBndlMat() const
DDName pincerRodName() const
weight_default_t b2[10]
Definition: b2.h:9
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:667
double grMidSlotHere() const
DDName pincerShim2Name() const
const std::vector< std::string > & vecMBLyrName() const
DDMaterial backPlateMat() const
static DDSolid trap(const DDName &name, double pDz, double pTheta, double pPhi, double pDy1, double pDx1, double pDx2, double pAlp1, double pDy2, double pDx3, double pDx4, double pAlp2)
Definition: DDSolid.cc:609
double mBManifOutDiam() const
void execute(DDCompactView &cpv) override
std::vector< double > m_vecPatchPanelThick
const std::string & ilyName() const
double backPlateWidth() const
static DDSolid box(const DDName &name, double xHalf, double yHalf, double zHalf)
Creates a box with side length 2*xHalf, 2*yHalf, 2*zHalf.
Definition: DDSolid.cc:547
std::vector< double > m_vecSpmCutTM
const std::vector< double > & vecIlyPipeType() const
unsigned int nCryPerAlvEta() const
std::vector< double > m_vecBarRMax
double backPlateThick() const
DDMaterial capMat() const
DDMaterial sglMat() const
DDMaterial ilyPTMMat() const
const std::string & dryAirTubeName() const
const std::vector< double > & vecNomCryDimBF() const
const std::vector< double > & vecIlyFEMPhi() const
std::vector< std::string > m_vecMBLyrMat
std::vector< double > m_vecBarRota3
const N & name() const
Definition: DDBase.h:59
CaloCellGeometry::Pt3D Pt3D
std::vector< double > m_vecIlyPTMPhi
double mBCoolTubeOutDiam() const
std::vector< double > m_vecWebPlTh
double ilyFanOutWidth() const
DDName backPlateName() const
const std::vector< double > & vecGrilleZOff() const
DDMaterial pincerCutMat() const
const std::vector< std::string > & vecPatchPanelMat() const
const std::vector< double > & vecBarTran() const
HepGeom::RotateZ3D RoZ3D
const std::string & webPlName() const
const std::vector< double > & vecGapAlvEta() const
std::vector< double > m_vecBackVFELyrThick
const std::string & grilleName() const
HepGeom::Translate3D Tl3D
const std::vector< double > & vecSpmCutTM() const
double backSideLength() const
HepGeom::Rotate3D Ro3D
DDMaterial backCoolVFEMat() const
const std::vector< double > & vecIlyFEMZ() const
std::vector< double > m_vecGrMidSlotHeight
std::vector< double > m_vecBackPipeDiam
HepGeom::ReflectZ3D RfZ3D
std::vector< double > m_vecSpmTran
const std::vector< double > & vecIlyPTMZ() const
DDMaterial pincerShimMat() const
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:599
DDMaterial backVFEMat() const
double pincerEnvWidth() const
const std::string & ilyPipeName() const
void web(unsigned int iWeb, double bWeb, double BWeb, double LWeb, double theta, const Pt3D &corner, const DDLogicalPart &logPar, double &zee, double side, double front, double delta, DDCompactView &cpv)
std::vector< double > m_vecGrilleHeight
unsigned int nFawPerSupm() const
double grEdgeSlotHeight() const
std::vector< double > vecPincerEnvZOff() const
std::vector< double > m_vecGapAlvEta
DDMaterial apdMat() const
double mBCoolTubeInnDiam() const
double backSideAngle() const
const std::string & idNameSpace() const
DDName grEdgeSlotName() const
std::vector< double > vecPincerRodAzimuth() const
const std::vector< double > & vecIlyPTMPhi() const
std::vector< double > m_vecMBLyrThick
std::vector< double > m_vecIlyPipeZ
std::vector< double > m_vecIlyThick
const std::vector< double > & vecSpmHere() const
std::vector< double > m_vecGrilleZOff
double backPlateHere() const
DDName ilyFanOutName() const
std::vector< double > m_vecIlyPTMZ
DDName pincerCutName() const
const std::vector< double > & vecNomCryDimCF() const
const std::vector< std::string > & vecBackVFELyrMat() const
std::vector< double > m_vecBarZPts
double backSideYOff2() const
DDRotation myrot(const std::string &s, const CLHEP::HepRotation &r) const
Create a DDRotation from a string converted to DDName and CLHEP::HepRotation converted to DDRotationM...
double grEdgeSlotWidth() const
const std::string & clrName() const
const std::vector< double > & vecSpmRota() const
DDMaterial ilyFEMMat() const
DDMaterial bsiMat() const
const std::vector< double > & vecSpmRMin() const
const std::vector< double > & vecWebLength() const
double backSideWidth() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
double grEdgeSlotHere() const
std::vector< double > m_vecSpmRota
DDMaterial pincerBlkMat() const
const std::vector< double > & vecSpmZPts() const
const std::vector< double > & vecGrilleHeight() const
const std::vector< double > & vecIlyFanOutPhi() const
std::vector< double > m_vecSpmCutTP
DDMaterial backCoolTankMat() const
const std::vector< double > & vecSpmBTran() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
Geom::Theta< T > theta() const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< double > m_vecIlyPipeLength
double backCoolBarThick() const
CaloCellGeometry::Pt3DVec VertexList
const std::vector< double > & vecSpmBRota() const
DDName backCoolBarSSName() const
std::vector< double > m_vecSpmRMin
std::vector< double > m_vecBackPipeThick
DDMaterial backPipeMat() const
const std::vector< double > & vecBackMiscThick() const
std::vector< double > m_vecIlyFEMPhi
DDMaterial spmSideMat() const
std::vector< double > m_vecSpmHere
double backCoolBarHeight() const
double backCoolVFEHere() const
std::vector< double > m_vecBackCoolNPerSec
DDName patchPanelName() const
DDMaterial barMat() const
DDName backCoolBarWaName() const
double backCoolTankHere() const
double backCoolBarHere() const
DDMaterial grilleMat() const