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