CMS 3D CMS Logo

DDEcalBarrelAlgo.cc
Go to the documentation of this file.
1 
3 // File: DDEcalBarrelAlgo.cc
4 // Description: Geometry factory class for Ecal Barrel
6 
7 #include <cmath>
8 #include <algorithm>
9 
16 #include "CLHEP/Units/GlobalSystemOfUnits.h"
17 
18 #include <CLHEP/Geometry/Point3D.h>
19 #include <CLHEP/Geometry/Vector3D.h>
20 #include <CLHEP/Geometry/Transform3D.h>
21 
22 namespace std{} using namespace std;
23 
25  m_idNameSpace ( "" ),
26  m_BarName ( "" ),
27  m_BarMat ( "" ),
28  m_vecBarZPts ( ),
29  m_vecBarRMin ( ),
30  m_vecBarRMax ( ),
31  m_vecBarTran ( ),
32  m_vecBarRota ( ),
33  m_vecBarRota2 ( ),
34  m_vecBarRota3 ( ),
35  m_BarPhiLo (0),
36  m_BarPhiHi (0),
37  m_BarHere (0),
38  m_SpmName (""),
39  m_SpmMat (""),
40  m_vecSpmZPts (),
41  m_vecSpmRMin (),
42  m_vecSpmRMax (),
43  m_vecSpmTran (),
44  m_vecSpmRota (),
45  m_vecSpmBTran (),
46  m_vecSpmBRota (),
47  m_SpmNPerHalf (0),
48  m_SpmLowPhi (0),
49  m_SpmDelPhi (0),
50  m_SpmPhiOff (0),
51  m_vecSpmHere (),
52  m_SpmCutName (""),
53  m_SpmCutThick (0),
54  m_SpmCutShow (0),
55  m_vecSpmCutTM (),
56  m_vecSpmCutTP (),
57  m_SpmCutRM (0),
58  m_SpmCutRP (0),
59  m_SpmExpThick (0),
60  m_SpmExpWide (0),
61  m_SpmExpYOff (0),
62  m_SpmSideName (""),
63  m_SpmSideMat (""),
64  m_SpmSideHigh (0),
65  m_SpmSideThick (0),
66  m_SpmSideYOffM (0),
67  m_SpmSideYOffP (0),
68  m_NomCryDimAF (0),
69  m_NomCryDimLZ (0),
70  m_vecNomCryDimBF (),
71  m_vecNomCryDimCF (),
72  m_vecNomCryDimAR (),
73  m_vecNomCryDimBR (),
74  m_vecNomCryDimCR (),
75  m_UnderAF (0),
76  m_UnderLZ (0),
77  m_UnderBF (0),
78  m_UnderCF (0),
79  m_UnderAR (0),
80  m_UnderBR (0),
81  m_UnderCR (0),
82  m_WallThAlv (0),
83  m_WrapThAlv (0),
84  m_ClrThAlv (0),
85  m_vecGapAlvEta (),
86  m_WallFrAlv (0),
87  m_WrapFrAlv (0),
88  m_ClrFrAlv (0),
89  m_WallReAlv (0),
90  m_WrapReAlv (0),
91  m_ClrReAlv (0),
92  m_NCryTypes (0),
93  m_NCryPerAlvEta (0),
94  m_CryName (""),
95  m_ClrName (""),
96  m_WrapName (""),
97  m_WallName (""),
98  m_CryMat (""),
99  m_ClrMat (""),
100  m_WrapMat (""),
101  m_WallMat (""),
102 
103  m_APDName (""),
104  m_APDHere (0),
105  m_APDMat (""),
106  m_APDSide (0),
107  m_APDThick (0),
108  m_APDZ (0),
109  m_APDX1 (0),
110  m_APDX2 (0),
111 
112  m_WebHere (0),
113  m_WebPlName (""),
114  m_WebClrName (""),
115  m_WebPlMat (""),
116  m_WebClrMat (""),
117  m_vecWebPlTh (),
118  m_vecWebClrTh (),
119  m_vecWebLength (),
120  m_IlyHere (0),
121  m_IlyName (),
122  m_IlyPhiLow (0),
123  m_IlyDelPhi (0),
124  m_vecIlyMat (),
125  m_vecIlyThick (),
126  m_IlyPipeName (""),
127  m_IlyPipeHere (0),
128  m_IlyPipeMat (""),
129  m_IlyPipeOD (0),
130  m_IlyPipeID (0),
131  m_vecIlyPipeLength (),
132  m_vecIlyPipeType (),
133  m_vecIlyPipePhi (),
134  m_vecIlyPipeZ (),
135  m_IlyPTMName (""),
136  m_IlyPTMHere (0),
137  m_IlyPTMMat (""),
138  m_IlyPTMWidth (0),
139  m_IlyPTMLength (0),
140  m_IlyPTMHeight (0),
141  m_vecIlyPTMZ (),
142  m_vecIlyPTMPhi (),
143  m_IlyFanOutName (""),
144  m_IlyFanOutHere (0),
145  m_IlyFanOutMat (""),
146  m_IlyFanOutWidth (0),
147  m_IlyFanOutLength(0),
148  m_IlyFanOutHeight(0),
149  m_vecIlyFanOutZ (),
150  m_vecIlyFanOutPhi(),
151  m_IlyDiffName (""),
152  m_IlyDiffMat (""),
153  m_IlyDiffOff (0),
154  m_IlyDiffLength (0),
155  m_IlyBndlName (""),
156  m_IlyBndlMat (""),
157  m_IlyBndlOff (0),
158  m_IlyBndlLength (0),
159  m_IlyFEMName (""),
160  m_IlyFEMMat (""),
161  m_IlyFEMWidth (0),
162  m_IlyFEMLength (0),
163  m_IlyFEMHeight (0),
164  m_vecIlyFEMZ (),
165  m_vecIlyFEMPhi (),
166  m_HawRName (""),
167  m_FawName (""),
168  m_FawHere (0),
169  m_HawRHBIG (0),
170  m_HawRhsml (0),
171  m_HawRCutY (0),
172  m_HawRCutZ (0),
173  m_HawRCutDelY (0),
174  m_HawYOffCry (0),
175  m_NFawPerSupm (0),
176  m_FawPhiOff (0),
177  m_FawDelPhi (0),
178  m_FawPhiRot (0),
179  m_FawRadOff (0),
180  m_GridHere (0),
181  m_GridName (""),
182  m_GridMat (""),
183  m_GridThick (0),
184  m_BackXOff (0),
185  m_BackYOff (0),
186  m_BackHere (0),
187  m_BackSideName (""),
188  m_BackSideHere (0),
189  m_BackSideLength (0),
190  m_BackSideHeight (0),
191  m_BackSideWidth (0),
192  m_BackSideYOff1 (0),
193  m_BackSideYOff2 (0),
194  m_BackSideAngle (0),
195  m_BackSideMat (""),
196  m_BackPlateName (""),
197  m_BackPlateHere (0),
198  m_BackPlateLength (0),
199  m_BackPlateThick (0),
200  m_BackPlateWidth (0),
201  m_BackPlateMat (""),
202  m_BackPlate2Name (""),
203  m_BackPlate2Thick (0),
204  m_BackPlate2Mat (""),
205  m_GrilleName (""),
206  m_GrilleHere (0),
207  m_GrilleThick (0),
208  m_GrilleWidth (0),
209  m_GrilleZSpace (0),
210  m_GrilleMat (""),
211  m_vecGrilleHeight (),
212  m_vecGrilleZOff (),
213  m_GrEdgeSlotName (""),
214  m_GrEdgeSlotMat (""),
215  m_GrEdgeSlotHere (0),
216  m_GrEdgeSlotHeight (0),
217  m_GrEdgeSlotWidth (0),
218  m_GrMidSlotName (""),
219  m_GrMidSlotMat (""),
220  m_GrMidSlotHere (0),
221  m_GrMidSlotWidth (0),
222  m_GrMidSlotXOff (0),
223  m_vecGrMidSlotHeight (),
224  m_BackPipeHere (0),
225  m_BackPipeName (""),
226  m_vecBackPipeDiam (),
227  m_vecBackPipeThick (),
228  m_BackPipeMat (""),
229  m_BackPipeWaterMat (""),
230 
231  m_vecBackCoolName (),
232  m_BackCoolHere (0),
233  m_BackCoolBarHere (0),
234  m_BackCoolBarWidth (0),
235  m_BackCoolBarHeight (0),
236  m_BackCoolMat (""),
237  m_BackCoolBarName (""),
238  m_BackCoolBarThick (0),
239  m_BackCoolBarMat (""),
240  m_BackCoolBarSSName (""),
241  m_BackCoolBarSSThick (0),
242  m_BackCoolBarSSMat (""),
243  m_BackCoolBarWaName (""),
244  m_BackCoolBarWaThick (0),
245  m_BackCoolBarWaMat (""),
246  m_BackCoolVFEHere (0),
247  m_BackCoolVFEName (""),
248  m_BackCoolVFEMat (""),
249  m_BackVFEName (""),
250  m_BackVFEMat (""),
251  m_vecBackVFELyrThick (),
252  m_vecBackVFELyrName (),
253  m_vecBackVFELyrMat (),
254  m_vecBackCoolNSec (),
255  m_vecBackCoolSecSep (),
256  m_vecBackCoolNPerSec (),
257 
258  m_BackMiscHere (0),
259  m_vecBackMiscThick (),
260  m_vecBackMiscName (),
261  m_vecBackMiscMat (),
262  m_BackCBStdSep (0),
263  m_PatchPanelHere (0),
264  m_PatchPanelName (""),
265  m_vecPatchPanelThick (),
266  m_vecPatchPanelNames (),
267  m_vecPatchPanelMat (),
268  m_BackCoolTankHere (0),
269  m_BackCoolTankName (""),
270  m_BackCoolTankWidth (0),
271  m_BackCoolTankThick (0),
272  m_BackCoolTankMat (""),
273  m_BackCoolTankWaName (""),
274  m_BackCoolTankWaWidth (0),
275  m_BackCoolTankWaMat (""),
276  m_BackBracketName (""),
277  m_BackBracketHeight (0),
278  m_BackBracketMat (""),
279 
280  m_DryAirTubeHere (0),
281  m_DryAirTubeName (""),
282  m_MBCoolTubeNum (0),
283  m_DryAirTubeInnDiam (0),
284  m_DryAirTubeOutDiam (0),
285  m_DryAirTubeMat (""),
286  m_MBCoolTubeHere (0),
287  m_MBCoolTubeName (""),
288  m_MBCoolTubeInnDiam (0),
289  m_MBCoolTubeOutDiam (0),
290  m_MBCoolTubeMat (""),
291  m_MBManifHere (0),
292  m_MBManifName (""),
293  m_MBManifInnDiam (0),
294  m_MBManifOutDiam (0),
295  m_MBManifMat (""),
296  m_MBLyrHere (0),
297  m_vecMBLyrThick (0),
298  m_vecMBLyrName (),
299  m_vecMBLyrMat (),
300 
301 
302  m_PincerRodHere (0),
303  m_PincerRodName (""),
304  m_PincerRodMat (""),
305  m_vecPincerRodAzimuth(),
306  m_PincerEnvName (""),
307  m_PincerEnvMat (""),
308  m_PincerEnvWidth (0),
309  m_PincerEnvHeight (0),
310  m_PincerEnvLength (0),
311  m_vecPincerEnvZOff (),
312  m_PincerBlkName (""),
313  m_PincerBlkMat (""),
314  m_PincerBlkLength (0),
315  m_PincerShim1Name (""),
316  m_PincerShimHeight (0),
317  m_PincerShim2Name (""),
318  m_PincerShimMat (""),
319  m_PincerShim1Width (0),
320  m_PincerShim2Width (0),
321  m_PincerCutName (""),
322  m_PincerCutMat (""),
323  m_PincerCutWidth (0),
324  m_PincerCutHeight (0)
325 
326 {
327  LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: Creating an instance" ;
328 }
329 
331 
332 
333 
334 
336  const DDVectorArguments & vArgs,
337  const DDMapArguments & /*mArgs*/,
338  const DDStringArguments & sArgs,
339  const DDStringVectorArguments & vsArgs) {
340 
341  LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: Initialize" ;
343  // TRICK!
344  m_idNameSpace = parent().name().ns();
345  // barrel parent volume
346  m_BarName = sArgs["BarName" ] ;
347  m_BarMat = sArgs["BarMat" ] ;
348  m_vecBarZPts = vArgs["BarZPts" ] ;
349  m_vecBarRMin = vArgs["BarRMin" ] ;
350  m_vecBarRMax = vArgs["BarRMax" ] ;
351  m_vecBarTran = vArgs["BarTran" ] ;
352  m_vecBarRota = vArgs["BarRota" ] ;
353  m_vecBarRota2 = vArgs["BarRota2" ] ;
354  m_vecBarRota3 = vArgs["BarRota3" ] ;
355  m_BarPhiLo = nArgs["BarPhiLo" ] ;
356  m_BarPhiHi = nArgs["BarPhiHi" ] ;
357  m_BarHere = nArgs["BarHere" ] ;
358 
359  m_SpmName = sArgs["SpmName"] ;
360  m_SpmMat = sArgs["SpmMat" ] ;
361  m_vecSpmZPts = vArgs["SpmZPts"] ;
362  m_vecSpmRMin = vArgs["SpmRMin"] ;
363  m_vecSpmRMax = vArgs["SpmRMax"] ;
364  m_vecSpmTran = vArgs["SpmTran"] ;
365  m_vecSpmRota = vArgs["SpmRota"] ;
366  m_vecSpmBTran = vArgs["SpmBTran"] ;
367  m_vecSpmBRota = vArgs["SpmBRota"] ;
368  m_SpmNPerHalf = static_cast<unsigned int> (nArgs["SpmNPerHalf"]) ;
369  m_SpmLowPhi = nArgs["SpmLowPhi"] ;
370  m_SpmDelPhi = nArgs["SpmDelPhi"] ;
371  m_SpmPhiOff = nArgs["SpmPhiOff"] ;
372  m_vecSpmHere = vArgs["SpmHere"] ;
373  m_SpmCutName = sArgs["SpmCutName"] ;
374  m_SpmCutThick = nArgs["SpmCutThick"] ;
375  m_SpmCutShow = int(nArgs["SpmCutShow"]) ;
376  m_vecSpmCutTM = vArgs["SpmCutTM"] ;
377  m_vecSpmCutTP = vArgs["SpmCutTP"] ;
378  m_SpmCutRM = nArgs["SpmCutRM"] ;
379  m_SpmCutRP = nArgs["SpmCutRP"] ;
380  m_SpmExpThick = nArgs["SpmExpThick"] ;
381  m_SpmExpWide = nArgs["SpmExpWide"] ;
382  m_SpmExpYOff = nArgs["SpmExpYOff"] ;
383  m_SpmSideName = sArgs["SpmSideName"] ;
384  m_SpmSideMat = sArgs["SpmSideMat" ] ;
385  m_SpmSideHigh = nArgs["SpmSideHigh"] ;
386  m_SpmSideThick= nArgs["SpmSideThick"] ;
387  m_SpmSideYOffM= nArgs["SpmSideYOffM"] ;
388  m_SpmSideYOffP= nArgs["SpmSideYOffP"] ;
389 
390  m_NomCryDimAF = nArgs["NomCryDimAF"] ;
391  m_NomCryDimLZ = nArgs["NomCryDimLZ"] ;
392  m_vecNomCryDimBF = vArgs["NomCryDimBF"] ;
393  m_vecNomCryDimCF = vArgs["NomCryDimCF"] ;
394  m_vecNomCryDimAR = vArgs["NomCryDimAR"] ;
395  m_vecNomCryDimBR = vArgs["NomCryDimBR"] ;
396  m_vecNomCryDimCR = vArgs["NomCryDimCR"] ;
397 
398  m_UnderAF = nArgs["UnderAF"] ;
399  m_UnderLZ = nArgs["UnderLZ"] ;
400  m_UnderBF = nArgs["UnderBF"] ;
401  m_UnderCF = nArgs["UnderCF"] ;
402  m_UnderAR = nArgs["UnderAR"] ;
403  m_UnderBR = nArgs["UnderBR"] ;
404  m_UnderCR = nArgs["UnderCR"] ;
405 
406  m_WallThAlv = nArgs["WallThAlv"] ;
407  m_WrapThAlv = nArgs["WrapThAlv"] ;
408  m_ClrThAlv = nArgs["ClrThAlv"] ;
409  m_vecGapAlvEta = vArgs["GapAlvEta"] ;
410 
411  m_WallFrAlv = nArgs["WallFrAlv"] ;
412  m_WrapFrAlv = nArgs["WrapFrAlv"] ;
413  m_ClrFrAlv = nArgs["ClrFrAlv"] ;
414 
415  m_WallReAlv = nArgs["WallReAlv"] ;
416  m_WrapReAlv = nArgs["WrapReAlv"] ;
417  m_ClrReAlv = nArgs["ClrReAlv"] ;
418 
419  m_NCryTypes = static_cast<unsigned int> ( nArgs["NCryTypes"] ) ;
420  m_NCryPerAlvEta = static_cast<unsigned int> ( nArgs["NCryPerAlvEta"] ) ;
421 
422  m_CryName = sArgs["CryName"] ;
423  m_ClrName = sArgs["ClrName"] ;
424  m_WrapName = sArgs["WrapName"] ;
425  m_WallName = sArgs["WallName"] ;
426 
427  m_CryMat = sArgs["CryMat"] ;
428  m_ClrMat = sArgs["ClrMat"] ;
429  m_WrapMat = sArgs["WrapMat"] ;
430  m_WallMat = sArgs["WallMat"] ;
431 
432  m_APDName = sArgs["APDName"] ;
433  m_APDHere = nArgs["APDHere"] ;
434  m_APDMat = sArgs["APDMat"] ;
435  m_APDSide = nArgs["APDSide"] ;
436  m_APDThick = nArgs["APDThick"] ;
437  m_APDZ = nArgs["APDZ"] ;
438  m_APDX1 = nArgs["APDX1"] ;
439  m_APDX2 = nArgs["APDX2"] ;
440 
441  m_WebHere = nArgs["WebHere"] ;
442  m_WebPlName = sArgs["WebPlName"] ;
443  m_WebClrName = sArgs["WebClrName"] ;
444  m_WebPlMat = sArgs["WebPlMat"] ;
445  m_WebClrMat = sArgs["WebClrMat"] ;
446  m_vecWebPlTh = vArgs["WebPlTh"] ;
447  m_vecWebClrTh = vArgs["WebClrTh"] ;
448  m_vecWebLength= vArgs["WebLength"] ;
449 
450  m_IlyHere = nArgs["IlyHere"] ;
451  m_IlyName = sArgs["IlyName"] ;
452  m_IlyPhiLow = nArgs["IlyPhiLow"] ;
453  m_IlyDelPhi = nArgs["IlyDelPhi"] ;
454  m_vecIlyMat = vsArgs["IlyMat"] ;
455  m_vecIlyThick = vArgs["IlyThick"] ;
456 
457  m_IlyPipeName = sArgs["IlyPipeName"] ;
458  m_IlyPipeHere = nArgs["IlyPipeHere"] ;
459  m_IlyPipeMat = sArgs["IlyPipeMat"] ;
460  m_IlyPipeOD = nArgs["IlyPipeOD"] ;
461  m_IlyPipeID = nArgs["IlyPipeID"] ;
462  m_vecIlyPipeLength = vArgs["IlyPipeLength"] ;
463  m_vecIlyPipeType = vArgs["IlyPipeType"] ;
464  m_vecIlyPipePhi = vArgs["IlyPipePhi"] ;
465  m_vecIlyPipeZ = vArgs["IlyPipeZ"] ;
466 
467  m_IlyPTMName = sArgs["IlyPTMName"] ;
468  m_IlyPTMHere = nArgs["IlyPTMHere"] ;
469  m_IlyPTMMat = sArgs["IlyPTMMat"] ;
470  m_IlyPTMWidth = nArgs["IlyPTMWidth"] ;
471  m_IlyPTMLength = nArgs["IlyPTMLength"] ;
472  m_IlyPTMHeight = nArgs["IlyPTMHeight"] ;
473  m_vecIlyPTMZ = vArgs["IlyPTMZ"] ;
474  m_vecIlyPTMPhi = vArgs["IlyPTMPhi"] ;
475 
476  m_IlyFanOutName = sArgs["IlyFanOutName"] ;
477  m_IlyFanOutHere = nArgs["IlyFanOutHere"] ;
478  m_IlyFanOutMat = sArgs["IlyFanOutMat"] ;
479  m_IlyFanOutWidth = nArgs["IlyFanOutWidth"] ;
480  m_IlyFanOutLength = nArgs["IlyFanOutLength"] ;
481  m_IlyFanOutHeight = nArgs["IlyFanOutHeight"] ;
482  m_vecIlyFanOutZ = vArgs["IlyFanOutZ"] ;
483  m_vecIlyFanOutPhi = vArgs["IlyFanOutPhi"] ;
484  m_IlyDiffName = sArgs["IlyDiffName"] ;
485  m_IlyDiffMat = sArgs["IlyDiffMat"] ;
486  m_IlyDiffOff = nArgs["IlyDiffOff"] ;
487  m_IlyDiffLength = nArgs["IlyDiffLength"] ;
488  m_IlyBndlName = sArgs["IlyBndlName"] ;
489  m_IlyBndlMat = sArgs["IlyBndlMat"] ;
490  m_IlyBndlOff = nArgs["IlyBndlOff"] ;
491  m_IlyBndlLength = nArgs["IlyBndlLength"] ;
492  m_IlyFEMName = sArgs["IlyFEMName"] ;
493  m_IlyFEMMat = sArgs["IlyFEMMat"] ;
494  m_IlyFEMWidth = nArgs["IlyFEMWidth"] ;
495  m_IlyFEMLength = nArgs["IlyFEMLength"] ;
496  m_IlyFEMHeight = nArgs["IlyFEMHeight"] ;
497  m_vecIlyFEMZ = vArgs["IlyFEMZ"] ;
498  m_vecIlyFEMPhi = vArgs["IlyFEMPhi"];
499 
500  m_HawRName = sArgs["HawRName"] ;
501  m_FawName = sArgs["FawName"] ;
502  m_FawHere = nArgs["FawHere"] ;
503  m_HawRHBIG = nArgs["HawRHBIG"] ;
504  m_HawRhsml = nArgs["HawRhsml"] ;
505  m_HawRCutY = nArgs["HawRCutY"] ;
506  m_HawRCutZ = nArgs["HawRCutZ"] ;
507  m_HawRCutDelY= nArgs["HawRCutDelY"] ;
508  m_HawYOffCry = nArgs["HawYOffCry"] ;
509 
510  m_NFawPerSupm= static_cast<unsigned int> ( nArgs["NFawPerSupm"] ) ;
511  m_FawPhiOff = nArgs["FawPhiOff"] ;
512  m_FawDelPhi = nArgs["FawDelPhi"] ;
513  m_FawPhiRot = nArgs["FawPhiRot"] ;
514  m_FawRadOff = nArgs["FawRadOff"] ;
515 
516  m_GridHere = nArgs["GridHere"] ;
517  m_GridName = sArgs["GridName"] ;
518  m_GridMat = sArgs["GridMat"] ;
519  m_GridThick = nArgs["GridThick"] ;
520 
521  m_BackHere = nArgs["BackHere"] ;
522  m_BackXOff = nArgs["BackXOff"] ;
523  m_BackYOff = nArgs["BackYOff"] ;
524  m_BackSideName = sArgs["BackSideName"] ;
525  m_BackSideHere = nArgs["BackSideHere"] ;
526  m_BackSideLength = nArgs["BackSideLength"] ;
527  m_BackSideHeight = nArgs["BackSideHeight"] ;
528  m_BackSideWidth = nArgs["BackSideWidth"] ;
529  m_BackSideYOff1 = nArgs["BackSideYOff1"] ;
530  m_BackSideYOff2 = nArgs["BackSideYOff2"] ;
531  m_BackSideAngle = nArgs["BackSideAngle"] ;
532  m_BackSideMat = sArgs["BackSideMat"] ;
533  m_BackPlateName = sArgs["BackPlateName"] ;
534  m_BackPlateHere = nArgs["BackPlateHere"] ;
535  m_BackPlateLength = nArgs["BackPlateLength"] ;
536  m_BackPlateThick = nArgs["BackPlateThick"] ;
537  m_BackPlateWidth = nArgs["BackPlateWidth"] ;
538  m_BackPlateMat = sArgs["BackPlateMat"] ;
539  m_BackPlate2Name = sArgs["BackPlate2Name"] ;
540  m_BackPlate2Thick = nArgs["BackPlate2Thick"] ;
541  m_BackPlate2Mat = sArgs["BackPlate2Mat"] ;
542  m_GrilleName = sArgs["GrilleName"] ;
543  m_GrilleHere = nArgs["GrilleHere"] ;
544  m_GrilleThick = nArgs["GrilleThick"] ;
545  m_GrilleWidth = nArgs["GrilleWidth"] ;
546  m_GrilleZSpace = nArgs["GrilleZSpace"] ;
547  m_GrilleMat = sArgs["GrilleMat"] ;
548  m_vecGrilleHeight = vArgs["GrilleHeight"] ;
549  m_vecGrilleZOff = vArgs["GrilleZOff"] ;
550 
551  m_GrEdgeSlotName = sArgs["GrEdgeSlotName"] ;
552  m_GrEdgeSlotMat = sArgs["GrEdgeSlotMat"] ;
553  m_GrEdgeSlotHere = nArgs["GrEdgeSlotHere"] ;
554  m_GrEdgeSlotHeight = nArgs["GrEdgeSlotHeight"] ;
555  m_GrEdgeSlotWidth = nArgs["GrEdgeSlotWidth"] ;
556  m_GrMidSlotName = sArgs["GrMidSlotName"] ;
557  m_GrMidSlotMat = sArgs["GrMidSlotMat"] ;
558  m_GrMidSlotHere = nArgs["GrMidSlotHere"] ;
559  m_GrMidSlotWidth = nArgs["GrMidSlotWidth"] ;
560  m_GrMidSlotXOff = nArgs["GrMidSlotXOff"] ;
561  m_vecGrMidSlotHeight = vArgs["GrMidSlotHeight"] ;
562 
563  m_BackPipeHere = nArgs["BackPipeHere"] ;
564  m_BackPipeName = sArgs["BackPipeName"] ;
565  m_vecBackPipeDiam = vArgs["BackPipeDiam"] ;
566  m_vecBackPipeThick = vArgs["BackPipeThick"] ;
567  m_BackPipeMat = sArgs["BackPipeMat"] ;
568  m_BackPipeWaterMat = sArgs["BackPipeWaterMat"] ;
569 
570 
571  m_BackCoolHere = nArgs["BackCoolHere"] ;
572  m_vecBackCoolName = vsArgs["BackCoolName"] ;
573  m_BackCoolBarHere = nArgs["BackCoolBarHere"] ;
574  m_BackCoolBarWidth = nArgs["BackCoolBarWidth"] ;
575  m_BackCoolBarHeight = nArgs["BackCoolBarHeight"] ;
576  m_BackCoolMat = sArgs["BackCoolMat"] ;
577  m_BackCoolBarName = sArgs["BackCoolBarName"] ;
578  m_BackCoolBarThick = nArgs["BackCoolBarThick"] ;
579  m_BackCoolBarMat = sArgs["BackCoolBarMat"] ;
580  m_BackCoolBarSSName = sArgs["BackCoolBarSSName"] ;
581  m_BackCoolBarSSThick = nArgs["BackCoolBarSSThick"] ;
582  m_BackCoolBarSSMat = sArgs["BackCoolBarSSMat"] ;
583  m_BackCoolBarWaName = sArgs["BackCoolBarWaName"] ;
584  m_BackCoolBarWaThick = nArgs["BackCoolBarWaThick"] ;
585  m_BackCoolBarWaMat = sArgs["BackCoolBarWaMat"] ;
586  m_BackCoolVFEHere = nArgs["BackCoolVFEHere"] ;
587  m_BackCoolVFEName = sArgs["BackCoolVFEName"] ;
588  m_BackCoolVFEMat = sArgs["BackCoolVFEMat"] ;
589  m_BackVFEName = sArgs["BackVFEName"] ;
590  m_BackVFEMat = sArgs["BackVFEMat"] ;
591  m_vecBackVFELyrThick = vArgs["BackVFELyrThick"] ;
592  m_vecBackVFELyrName = vsArgs["BackVFELyrName"] ;
593  m_vecBackVFELyrMat = vsArgs["BackVFELyrMat"] ;
594  m_vecBackCoolNSec = vArgs["BackCoolNSec"] ;
595  m_vecBackCoolSecSep = vArgs["BackCoolSecSep"] ;
596  m_vecBackCoolNPerSec = vArgs["BackCoolNPerSec"] ;
597  m_BackCBStdSep = nArgs["BackCBStdSep"] ;
598 
599  m_BackMiscHere = nArgs["BackMiscHere"] ;
600  m_vecBackMiscThick = vArgs["BackMiscThick"] ;
601  m_vecBackMiscName = vsArgs["BackMiscName"] ;
602  m_vecBackMiscMat = vsArgs["BackMiscMat"] ;
603  m_PatchPanelHere = nArgs["PatchPanelHere"] ;
604  m_vecPatchPanelThick = vArgs["PatchPanelThick"] ;
605  m_vecPatchPanelNames = vsArgs["PatchPanelNames"] ;
606  m_vecPatchPanelMat = vsArgs["PatchPanelMat"] ;
607  m_PatchPanelName = sArgs["PatchPanelName"] ;
608 
609  m_BackCoolTankHere = nArgs["BackCoolTankHere"] ;
610  m_BackCoolTankName = sArgs["BackCoolTankName"] ;
611  m_BackCoolTankWidth = nArgs["BackCoolTankWidth"] ;
612  m_BackCoolTankThick = nArgs["BackCoolTankThick"] ;
613  m_BackCoolTankMat = sArgs["BackCoolTankMat"] ;
614  m_BackCoolTankWaName = sArgs["BackCoolTankWaName"] ;
615  m_BackCoolTankWaWidth = nArgs["BackCoolTankWaWidth"] ;
616  m_BackCoolTankWaMat = sArgs["BackCoolTankWaMat"] ;
617  m_BackBracketName = sArgs["BackBracketName"] ;
618  m_BackBracketHeight = nArgs["BackBracketHeight"] ;
619  m_BackBracketMat = sArgs["BackBracketMat"] ;
620 
621  m_DryAirTubeHere = nArgs["DryAirTubeHere"] ;
622  m_DryAirTubeName = sArgs["DryAirTubeName"];
623  m_MBCoolTubeNum = static_cast<unsigned int> ( nArgs["MBCoolTubeNum"] ) ;
624  m_DryAirTubeInnDiam = nArgs["DryAirTubeInnDiam"];
625  m_DryAirTubeOutDiam = nArgs["DryAirTubeOutDiam"];
626  m_DryAirTubeMat = sArgs["DryAirTubeMat"];
627  m_MBCoolTubeHere = nArgs["MBCoolTubeHere"] ;
628  m_MBCoolTubeName = sArgs["MBCoolTubeName"];
629  m_MBCoolTubeInnDiam = nArgs["MBCoolTubeInnDiam"];
630  m_MBCoolTubeOutDiam = nArgs["MBCoolTubeOutDiam"];
631  m_MBCoolTubeMat = sArgs["MBCoolTubeMat"];
632  m_MBManifHere = nArgs["MBManifHere"] ;
633  m_MBManifName = sArgs["MBManifName"];
634  m_MBManifInnDiam = nArgs["MBManifInnDiam"];
635  m_MBManifOutDiam = nArgs["MBManifOutDiam"];
636  m_MBManifMat = sArgs["MBManifMat"];
637  m_MBLyrHere = nArgs["MBLyrHere"] ;
638  m_vecMBLyrThick = vArgs["MBLyrThick"];
639  m_vecMBLyrName = vsArgs["MBLyrName"];
640  m_vecMBLyrMat = vsArgs["MBLyrMat"];
641 
642  m_PincerRodHere = nArgs["PincerRodHere"];
643  m_PincerRodName = sArgs["PincerRodName"];
644  m_PincerRodMat = sArgs["PincerRodMat"];
645  m_vecPincerRodAzimuth= vArgs["PincerRodAzimuth"];
646  m_PincerEnvName = sArgs["PincerEnvName"];
647  m_PincerEnvMat = sArgs["PincerEnvMat"];
648  m_PincerEnvWidth = nArgs["PincerEnvWidth"];
649  m_PincerEnvHeight = nArgs["PincerEnvHeight"];
650  m_PincerEnvLength = nArgs["PincerEnvLength"];
651  m_vecPincerEnvZOff = vArgs["PincerEnvZOff"];
652  m_PincerBlkName = sArgs["PincerBlkName"];
653  m_PincerBlkMat = sArgs["PincerBlkMat"];
654  m_PincerBlkLength = nArgs["PincerBlkLength"];
655  m_PincerShim1Name = sArgs["PincerShim1Name"];
656  m_PincerShimHeight = nArgs["PincerShimHeight"];
657  m_PincerShim2Name = sArgs["PincerShim2Name"];
658  m_PincerShimMat = sArgs["PincerShimMat"];
659  m_PincerShim1Width = nArgs["PincerShim1Width"];
660  m_PincerShim2Width = nArgs["PincerShim2Width"];
661  m_PincerCutName = sArgs["PincerCutName"];
662  m_PincerCutMat = sArgs["PincerCutMat"];
663  m_PincerCutWidth = nArgs["PincerCutWidth"];
664  m_PincerCutHeight = nArgs["PincerCutHeight"];
665 
666 
667  LogDebug("EcalGeom") << "DDEcalBarrelAlgo info: end initialize" ;
668 }
669 
671 // DDEcalBarrelAlgo methods...
673 
675 {
676  LogDebug("EcalGeom") << "******** DDEcalBarrelAlgo execute!" << std::endl ;
677 
678  if( barHere() != 0 )
679  {
680  const unsigned int copyOne (1) ;
681  const unsigned int copyTwo (2) ;
682  // Barrel parent volume----------------------------------------------------------
683  cpv.position( DDLogicalPart( barName(), barMat(),
685  barName(), barPhiLo(), ( barPhiHi() - barPhiLo() ),
686  vecBarZPts(), vecBarRMin(), vecBarRMax())),
687  parent().name() ,
688  copyOne,
690  vecBarTran()[1],
691  vecBarTran()[2]),
692  myrot(barName().name()+"Rot",
693  Rota(Vec3(vecBarRota3()[0],
694  vecBarRota3()[1],
695  vecBarRota3()[2]),
696  vecBarRota3()[3])*
697  Rota(Vec3(vecBarRota2()[0],
698  vecBarRota2()[1],
699  vecBarRota2()[2]),
700  vecBarRota2()[3])*
701  Rota(Vec3(vecBarRota()[0],
702  vecBarRota()[1],
703  vecBarRota()[2]),
704  vecBarRota()[3]) ) ) ;
705  // End Barrel parent volume----------------------------------------------------------
706 
707 
708  // Supermodule parent------------------------------------------------------------
709 
710  const DDName spmcut1ddname ( ( 0 != spmCutShow() ) ?
711  spmName() : ddname( m_SpmName + "CUT1" ) ) ;
712  const DDSolid ddspm ( DDSolidFactory::polycone(
713  spmcut1ddname,
714  spmLowPhi(), spmDelPhi(),
715  vecSpmZPts(), vecSpmRMin(), vecSpmRMax())) ;
716 
717  const unsigned int indx ( vecSpmRMax().size()/2 ) ;
718 
719 
720  // Deal with the cut boxes first
721  const DDSolid spmCutBox ( DDSolidFactory::box(
722  spmCutName(),
723  1.05*(vecSpmRMax()[indx] - vecSpmRMin()[indx])/2.,
724  spmCutThick()/2.,
725  fabs( vecSpmZPts().back() - vecSpmZPts().front() )/2.+1*mm) ) ;
726  const std::vector<double>& cutBoxParms ( spmCutBox.parameters() ) ;
727  const DDLogicalPart spmCutLog ( spmCutName(), spmMat(), spmCutBox ) ;
728 
729  // Now the expansion box
730  const double xExp ( spmExpThick()/2. ) ;
731  const double yExp ( spmExpWide()/2. ) ;
732  const double zExp ( fabs( vecSpmZPts().back() -
733  vecSpmZPts().front() )/2.) ;
734  const DDName expName ( m_SpmName + "EXP" ) ;
735  const DDSolid spmExpBox ( DDSolidFactory::box(
736  expName ,
737  xExp ,
738  yExp ,
739  zExp )) ;
740  const DDTranslation expTra ( vecSpmRMax().back() - xExp, spmExpYOff(),
741  vecSpmZPts().front() + zExp ) ;
742  const DDLogicalPart expLog ( expName, spmMat(), spmExpBox ) ;
743 
744  // Supermodule side platess
745  const DDSolid sideSolid ( DDSolidFactory::box(
746  spmSideName(),
747  spmSideHigh()/2.,
748  spmSideThick()/2.,
749  fabs( vecSpmZPts()[1] - vecSpmZPts()[0] )/2.) ) ;
750  const std::vector<double>& sideParms ( sideSolid.parameters() ) ;
751  const DDLogicalPart sideLog ( spmSideName(), spmSideMat(), sideSolid ) ;
752 
753  DDSolid temp1 ;
754  DDSolid temp2 ;
755  for( unsigned int icopy(1); icopy <= 2; ++icopy )
756  {
757  const std::vector<double>& tvec ( 1==icopy ? vecSpmCutTM() : vecSpmCutTP() ) ;
758  const double rang ( 1==icopy ? spmCutRM() : spmCutRP() ) ;
759 
760  const Tl3D tr ( tvec[0], tvec[1], tvec[2] );
761  const RoZ3D ro ( rang ) ;
762  const Tf3D alltrot (
763  RoZ3D( 1==icopy ? spmLowPhi() : spmLowPhi()+spmDelPhi() )*
764  Tl3D( ( vecSpmRMax()[indx]+vecSpmRMin()[indx])/2.,
765  0,
766  (vecSpmZPts().front()+ vecSpmZPts().back())/2.)*
767  tr*ro) ;
768 
769  const DDRotation ddrot ( myrot(spmCutName().name() +
770  std::to_string(icopy),
771  alltrot.getRotation() ) ) ;
772  const DDTranslation ddtra ( alltrot.getTranslation() ) ;
773 
774 
775  const Tl3D trSide ( tvec[0],
776  tvec[1] + ( 1==icopy ? 1. : -1. )*( cutBoxParms[1]+sideParms[1] )
777  + ( 1==icopy ? spmSideYOffM() : spmSideYOffP() ),
778  tvec[2] );
779  const RoZ3D roSide ( rang ) ;
780  const Tf3D sideRot (
781  RoZ3D( 1==icopy ? spmLowPhi() : spmLowPhi()+spmDelPhi() )*
782  Tl3D( vecSpmRMin().front() + sideParms[0] ,
783  0,
784  vecSpmZPts().front()+ sideParms[2] )*
785  trSide*roSide) ;
786 
787  const DDRotation sideddrot ( myrot(spmSideName().name() +
788  std::to_string(icopy),
789  sideRot.getRotation() ) ) ;
790  const DDTranslation sideddtra ( sideRot.getTranslation() ) ;
791 
792  cpv.position( sideLog,
793  spmName(),
794  icopy,
795  sideddtra,
796  sideddrot ) ;
797 
798 
799  if( 0 != spmCutShow() ) // do this if we are "showing" the boxes
800  {
801  cpv.position( spmCutLog,
802  spmName(),
803  icopy,
804  ddtra,
805  ddrot ) ;
806  }
807  else // do this if we are subtracting the boxes
808  {
809  if( 1 == icopy )
810  {
811  temp1 = DDSolidFactory::subtraction( DDName( m_SpmName+"_T1" ),
812  spmcut1ddname, spmCutBox,
813  ddtra, ddrot ) ;
814  }
815  else
816  {
818  temp1, spmCutBox,
819  ddtra, ddrot ) ;
820  }
821  }
822  }
823 
824  const DDLogicalPart spmLog (spmName(), spmMat(),
825  ((0 != spmCutShow()) ? ddspm : temp2) ) ;
826 
827  const double dphi ( 360.*deg/(1.*spmNPerHalf() ) ) ;
828  for( unsigned int iphi (0); iphi<2*spmNPerHalf() ; ++iphi )
829  {
830  const double phi ( iphi*dphi + spmPhiOff() ) ; //- 0.000130/deg ) ;
831 
832  // this base rotation includes the base translation & rotation
833  // plus flipping for the negative z hemisphere, plus
834  // the phi rotation for this module
835  const Tf3D rotaBase ( RoZ3D( phi )*
836  ( iphi < spmNPerHalf() ? Ro3D() :
837  RoX3D( 180.*deg ) )*
838  Ro3D( vecSpmBRota()[3],
839  Vec3( vecSpmBRota()[0],
840  vecSpmBRota()[1],
841  vecSpmBRota()[2]))*
842  Tl3D( Vec3( vecSpmBTran()[0],
843  vecSpmBTran()[1],
844  vecSpmBTran()[2] ))) ;
845 
846  // here the individual rotations & translations of the supermodule
847  // are implemented on top of the overall "base" rotation & translation
848 
849  const unsigned int offr ( 4*iphi ) ;
850  const unsigned int offt ( 3*iphi ) ;
851 
852  const Ro3D r1 ( vecSpmRota()[ offr+3],
853  Vec3(vecSpmRota()[offr+0],
854  vecSpmRota()[offr+1],
855  vecSpmRota()[offr+2] ) ) ;
856 
857  const Tf3D rotaExtra ( r1*Tl3D( Vec3(vecSpmTran()[offt+0],
858  vecSpmTran()[offt+1],
859  vecSpmTran()[offt+2] ) ) ) ;
860 
861  const Tf3D both ( rotaExtra*rotaBase ) ;
862 
863  const DDRotation rota ( myrot( spmName().name()+std::to_string(phi/deg),
864  both.getRotation() ) );
865 
866  if( vecSpmHere()[iphi] != 0 )
867  {
868  // convert from CLHEP to DDTranslation & etc. -- Michael Case
869  DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z());
870  cpv.position( spmLog,
871  barName(),
872  iphi+1,
873  myTran,
874  rota ) ;
875  }
876  }
877  // End Supermodule parent------------------------------------------------------------
878 
879  // Begin Inner Layer volumes---------------------------------------------------------
880  const double ilyLength ( vecSpmZPts()[1] - vecSpmZPts()[0] ) ;
881  double ilyRMin ( vecSpmRMin()[0] ) ;
882  double ilyThick ( 0 ) ;
883  for( unsigned int ilyx ( 0 ) ; ilyx != vecIlyThick().size() ; ++ilyx )
884  {
885  ilyThick += vecIlyThick()[ilyx] ;
886  }
887  const DDName ilyDDName ( ddname( ilyName() ) ) ;
888  const DDSolid ilySolid ( DDSolidFactory::tubs( ilyDDName,
889  ilyLength/2,
890  ilyRMin,
891  ilyRMin + ilyThick,
892  ilyPhiLow(),
893  ilyDelPhi() ) ) ;
894  const DDLogicalPart ilyLog ( ilyDDName, spmMat(), ilySolid ) ;
895  cpv.position( ilyLog,
896  spmLog,
897  copyOne,
898  DDTranslation(0,0, ilyLength/2 ),
899  DDRotation() ) ;
900 
901  DDLogicalPart ilyPipeLog[200] ;
902 
903  if( 0 != ilyPipeHere() )
904  {
905  for( unsigned int iPipeType ( 0 ) ; iPipeType != vecIlyPipeLength().size(); ++iPipeType )
906  {
907  const DDName pName ( ddname( ilyPipeName() + "_" +
908  std::to_string(iPipeType+1) ) ) ;
909 
910  DDSolid ilyPipeSolid ( DDSolidFactory::tubs( pName ,
911  vecIlyPipeLength()[iPipeType]/2.,
912  0,
913  ilyPipeOD()/2,
914  0*deg, 360*deg ) ) ;
915  ilyPipeLog[iPipeType] = DDLogicalPart( pName, ilyPipeMat(), ilyPipeSolid ) ;
916 
917  const DDName pWaName ( ddname( ilyPipeName() + "Wa_" +
918  std::to_string(iPipeType+1) ) ) ;
919  DDSolid ilyPipeWaSolid ( DDSolidFactory::tubs( pWaName ,
920  vecIlyPipeLength()[iPipeType]/2.,
921  0,
922  ilyPipeID()/2,
923  0*deg, 360*deg ) ) ;
924  const DDLogicalPart ilyPipeWaLog ( pWaName, backPipeWaterMat(), ilyPipeWaSolid ) ;
925 
926  cpv.position( ilyPipeWaLog,
927  pName,
928  copyOne,
929  DDTranslation(0,0,0),
930  DDRotation() ) ;
931  }
932  }
933 
934  DDSolid ilyPTMSolid ( DDSolidFactory::box( ilyPTMName(),
935  ilyPTMHeight()/2.,
936  ilyPTMWidth()/2.,
937  ilyPTMLength()/2. ) ) ;
938  const DDLogicalPart ilyPTMLog ( ilyPTMName(),
939  ilyPTMMat(),
940  ilyPTMSolid ) ;
941 
942  DDSolid ilyFanOutSolid ( DDSolidFactory::box( ilyFanOutName(),
943  ilyFanOutHeight()/2.,
944  ilyFanOutWidth()/2.,
945  ilyFanOutLength()/2. ) ) ;
946  const DDLogicalPart ilyFanOutLog ( ilyFanOutName(),
947  ilyFanOutMat(),
948  ilyFanOutSolid ) ;
949 
950  DDSolid ilyFEMSolid ( DDSolidFactory::box( ilyFEMName(),
951  ilyFEMHeight()/2.,
952  ilyFEMWidth()/2.,
953  ilyFEMLength()/2. ) ) ;
954  const DDLogicalPart ilyFEMLog ( ilyFEMName(),
955  ilyFEMMat(),
956  ilyFEMSolid ) ;
957 
958  DDSolid ilyDiffSolid ( DDSolidFactory::box( ilyDiffName(),
959  ilyFanOutHeight()/2.,
960  ilyFanOutWidth()/2.,
961  ilyDiffLength()/2. ) ) ;
962  const DDLogicalPart ilyDiffLog ( ilyDiffName(),
963  ilyDiffMat(),
964  ilyDiffSolid ) ;
965 
966  DDSolid ilyBndlSolid ( DDSolidFactory::box( ilyBndlName(),
967  ilyFanOutHeight()/2.,
968  ilyFanOutWidth()/2.,
969  ilyBndlLength()/2. ) ) ;
970  const DDLogicalPart ilyBndlLog ( ilyBndlName(),
971  ilyBndlMat(),
972  ilyBndlSolid ) ;
973  cpv.position( ilyDiffLog,
974  ilyFanOutName(),
975  copyOne,
977  DDRotation() ) ;
978  cpv.position( ilyBndlLog,
979  ilyFanOutName(),
980  copyOne,
982  DDRotation() ) ;
983 
984  for( unsigned int ily ( 0 ) ; ily != vecIlyThick().size() ; ++ily )
985  {
986  const double ilyRMax ( ilyRMin + vecIlyThick()[ily] ) ;
987  const DDName xilyName ( ddname( ilyName() + std::to_string(ily) ) ) ;
988  const DDSolid xilySolid ( DDSolidFactory::tubs( xilyName,
989  ilyLength/2,
990  ilyRMin,
991  ilyRMax,
992  ilyPhiLow(),
993  ilyDelPhi() ) ) ;
994 
995  const DDLogicalPart xilyLog ( xilyName, ddmat(vecIlyMat()[ily]), xilySolid ) ;
996 
997  if( 0 != ilyHere() )
998  {
999  cpv.position( xilyLog,
1000  ilyLog,
1001  copyOne,
1002  DDTranslation(0,0,0),
1003  DDRotation() ) ;
1004 
1005  unsigned int copyNum[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ;
1006 
1007  if( 10*mm < vecIlyThick()[ily] &&
1008  vecIlyThick().size() != (ily+1) &&
1009  0 != ilyPipeHere() )
1010  {
1011  if( 0 != ilyPTMHere() )
1012  {
1013  unsigned int ptmCopy ( 0 ) ;
1014  for( unsigned int ilyPTM ( 0 ) ; ilyPTM != vecIlyPTMZ().size() ; ++ilyPTM )
1015  {
1016  const double radius ( ilyRMax - 1*mm - ilyPTMHeight()/2. ) ;
1017  const double phi ( vecIlyPTMPhi()[ilyPTM] ) ;
1018  const double yy ( radius*sin(phi) ) ;
1019  const double xx ( radius*cos(phi) ) ;
1020  ++ptmCopy ;
1021  cpv.position( ilyPTMLog,
1022  xilyLog,
1023  ptmCopy,
1024  DDTranslation(xx,yy, vecIlyPTMZ()[ilyPTM] -ilyLength/2 ),
1025  myrot( ilyPTMLog.name().name() + "_rot" +
1026  std::to_string( ptmCopy ) , CLHEP::HepRotationZ( phi ) )) ;
1027  }
1028  }
1029  if( 0 != ilyFanOutHere() )
1030  {
1031  unsigned int fanOutCopy ( 0 ) ;
1032  for( unsigned int ilyFO ( 0 ) ; ilyFO != vecIlyFanOutZ().size() ; ++ilyFO )
1033  {
1034  const double radius ( ilyRMax - 1*mm - ilyFanOutHeight()/2. ) ;
1035  const double phi ( vecIlyFanOutPhi()[ilyFO] ) ;
1036  const double yy ( radius*sin(phi) ) ;
1037  const double xx ( radius*cos(phi) ) ;
1038  ++fanOutCopy ;
1039  cpv.position( ilyFanOutLog,
1040  xilyLog,
1041  fanOutCopy,
1042  DDTranslation(xx,yy, vecIlyFanOutZ()[ilyFO] -ilyLength/2 ),
1043  myrot( ilyFanOutLog.name().name() + "_rot" +
1044  std::to_string( fanOutCopy ) ,
1045  CLHEP::HepRotationZ( phi )*CLHEP::HepRotationY( 180*deg ) )) ;
1046  }
1047  unsigned int femCopy ( 0 ) ;
1048  for( unsigned int ilyFEM ( 0 ) ; ilyFEM != vecIlyFEMZ().size() ; ++ilyFEM )
1049  {
1050  const double radius ( ilyRMax - 1*mm - ilyFEMHeight()/2. ) ;
1051  const double phi ( vecIlyFEMPhi()[ilyFEM] ) ;
1052  const double yy ( radius*sin(phi) ) ;
1053  const double xx ( radius*cos(phi) ) ;
1054  ++femCopy ;
1055  cpv.position( ilyFEMLog,
1056  xilyLog,
1057  femCopy,
1058  DDTranslation(xx,yy, vecIlyFEMZ()[ilyFEM] -ilyLength/2 ),
1059  myrot( ilyFEMLog.name().name() + "_rot" +
1060  std::to_string( femCopy ) , CLHEP::HepRotationZ( phi ) )) ;
1061  }
1062  }
1063  for( unsigned int iPipe ( 0 ) ; iPipe != vecIlyPipePhi().size(); ++iPipe )
1064  {
1065  const unsigned int type ( static_cast<unsigned int> ( round( vecIlyPipeType()[iPipe] ) ) ) ;
1066 // std::cout<<" iPipe, type= " << iPipe << ", " << type << std::endl ;
1067  const double zz ( -ilyLength/2 + vecIlyPipeZ()[iPipe] +
1068  ( 9>type ? vecIlyPipeLength()[type]/2. : 0 ) ) ;
1069 
1070  for( unsigned int ly ( 0 ) ; ly != 2 ; ++ly )
1071  {
1072  const double radius ( 0 == ly ? ilyRMin + ilyPipeOD()/2. + 1*mm :
1073  ilyRMax - ilyPipeOD()/2. - 1*mm ) ;
1074  const double phi ( vecIlyPipePhi()[iPipe] ) ;
1075  const double yy ( radius*sin(phi) ) ;
1076  const double xx ( radius*cos(phi) ) ;
1077  ++copyNum[type],
1078  cpv.position( ilyPipeLog[type],
1079  xilyLog,
1080  copyNum[type],
1081  DDTranslation(xx,yy,zz),
1082  ( 9 > type ? DDRotation() :
1083  myrot( ilyPipeLog[type].name().name() + "_rot" +
1084  std::to_string( copyNum[type] ) , Rota( Vec3(xx,yy,0), 90*deg) ) ) ) ;
1085  }
1086  }
1087  }
1088  }
1089  ilyRMin = ilyRMax ;
1090  }
1091  // End Inner Layer volumes---------------------------------------------------------
1092 
1093  const DDName clyrName ( DDName( "ECLYR" ) ) ;
1094  std::vector<double> cri;
1095  std::vector<double> cro;
1096  std::vector<double> czz;
1097  czz.emplace_back( vecSpmZPts()[1] ) ;
1098  cri.emplace_back( vecSpmRMin()[0] ) ;
1099  cro.emplace_back( vecSpmRMin()[0] + 25*mm ) ;
1100  czz.emplace_back( vecSpmZPts()[2] ) ;
1101  cri.emplace_back( vecSpmRMin()[2] ) ;
1102  cro.emplace_back( vecSpmRMin()[2] + 10*mm ) ;
1103  const DDSolid clyrSolid ( DDSolidFactory::polycone( clyrName, -9.5*deg, 19*deg, czz,cri,cro) ) ;
1104  const DDLogicalPart clyrLog ( clyrName, ddmat(vecIlyMat()[4]), clyrSolid ) ;
1105  cpv.position( clyrLog, spmLog, copyOne, DDTranslation(0,0,0), DDRotation() ) ;
1106 
1107  // Begin Alveolar Wedge parent ------------------------------------------------------
1108 //----------------
1109 
1110  // the next few lines accumulate dimensions appropriate to crystal type 1
1111  // which we use to set some of the features of the half-alveolar wedge (hawR).
1112 
1113 // const double ANom1 ( vecNomCryDimAR()[0] ) ;
1114  const double BNom1 ( vecNomCryDimCR()[0] ) ;
1115  const double bNom1 ( vecNomCryDimCF()[0] ) ;
1116 // const double HNom1 ( vecNomCryDimBR()[0] ) ;
1117 // const double hNom1 ( vecNomCryDimBF()[0] ) ;
1118  const double sWall1( wallThAlv() ) ;
1119  const double fWall1( wallFrAlv() ) ;
1120 // const double rWall1( wallReAlv() ) ;
1121  const double sWrap1( wrapThAlv() ) ;
1122  const double fWrap1( wrapFrAlv() ) ;
1123 // const double rWrap1( wrapReAlv() ) ;
1124  const double sClr1 ( clrThAlv() ) ;
1125  const double fClr1 ( clrFrAlv() ) ;
1126 // const double rClr1 ( clrReAlv() ) ;
1127  const double LNom1 ( nomCryDimLZ() ) ;
1128  const double beta1 ( atan( ( BNom1 - bNom1 )/LNom1 ) ) ;
1129 // const double cosbeta1 ( cos( beta1 ) ) ;
1130  const double sinbeta1 ( sin( beta1 ) ) ;
1131 
1132  const double tana_hawR ( ( BNom1 - bNom1 )/LNom1 ) ;
1133 
1134  const double H_hawR ( hawRHBIG() ) ;
1135  const double h_hawR ( hawRhsml() ) ;
1136  const double a_hawR ( bNom1 + sClr1 + 2*sWrap1 + 2*sWall1
1137  - sinbeta1*( fClr1 + fWrap1 + fWall1 ) ) ;
1138  const double B_hawR ( a_hawR + H_hawR*tana_hawR ) ;
1139  const double b_hawR ( a_hawR + h_hawR*tana_hawR ) ;
1140  const double L_hawR ( vecSpmZPts()[2] ) ;
1141 
1142  const Trap trapHAWR (
1143  a_hawR/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1144  a_hawR/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1145  b_hawR/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1146  H_hawR/2., //double aHalfLengthYNegZ , // h1, H/2
1147  h_hawR/2., //double aHalfLengthYPosZ , // h2, h/2
1148  L_hawR/2., //double aHalfLengthZ , // dz, L/2
1149  90*deg, //double aAngleAD , // alfa1
1150  0, //double aCoord15X , // x15
1151  0 //double aCoord15Y // y15
1152  ) ;
1153 
1154  const DDName hawRName1 ( ddname( hawRName().name() + "1") ) ;
1155  const DDSolid hawRSolid1 ( mytrap(hawRName1.name(), trapHAWR ) ) ;
1156  const DDLogicalPart hawRLog1 ( hawRName1, spmMat(), hawRSolid1 ) ;
1157 
1158  const double al1_fawR ( atan( ( B_hawR - a_hawR )/H_hawR ) + M_PI_2 ) ;
1159 
1160  // here is trap for Full Alveolar Wedge
1161  const Trap trapFAW (
1162  a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2
1163  a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2
1164  b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2
1165  H_hawR/2., //double aHalfLengthYNegZ , // h1, H/2
1166  h_hawR/2., //double aHalfLengthYPosZ , // h2, h/2
1167  L_hawR/2., //double aHalfLengthZ , // dz, L/2
1168  al1_fawR, //double aAngleAD , // alfa1
1169  0, //double aCoord15X , // x15
1170  0 //double aCoord15Y // y15
1171  ) ;
1172 
1173  const DDName fawName1 ( ddname( fawName().name() + "1") ) ;
1174  const DDSolid fawSolid1 ( mytrap( fawName1.name(), trapFAW ) ) ;
1175  const DDLogicalPart fawLog1 ( fawName1, spmMat(), fawSolid1 ) ;
1176 
1177  const Trap::VertexList vHAW ( trapHAWR.vertexList() ) ;
1178  const Trap::VertexList vFAW ( trapFAW.vertexList() ) ;
1179 
1180  const double hawBoxClr ( 1*mm ) ;
1181 
1182  // HAW cut box to cut off back end of wedge
1183  const DDName hawCutName ( ddname( hawRName().name() + "CUTBOX" ) ) ;
1184  const DDSolid hawCutBox ( DDSolidFactory::box(
1185  hawCutName,
1186  b_hawR/2 + hawBoxClr,
1187  hawRCutY()/2,
1188  hawRCutZ()/2 ) ) ;
1189  const std::vector<double>& hawBoxParms ( hawCutBox.parameters() ) ;
1190  const DDLogicalPart hawCutLog ( hawCutName, spmMat(), hawCutBox ) ;
1191 
1192  const Pt3D b1 ( hawBoxParms[0], hawBoxParms[1], hawBoxParms[2] ) ;
1193  const Pt3D b2 ( -hawBoxParms[0], hawBoxParms[1], hawBoxParms[2] ) ;
1194  const Pt3D b3 ( -hawBoxParms[0], hawBoxParms[1], -hawBoxParms[2] ) ;
1195 
1196  const double zDel ( sqrt( 4*hawBoxParms[2]*hawBoxParms[2]
1197  -(h_hawR-hawRCutDelY())*(h_hawR-hawRCutDelY()) ) ) ;
1198 
1199  const Tf3D hawCutForm (
1200  b1, b2, b3,
1201  vHAW[2] + Pt3D( hawBoxClr, -hawRCutDelY(), 0),
1202  vHAW[1] + Pt3D(-hawBoxClr, -hawRCutDelY(), 0),
1203  Pt3D( vHAW[0].x() -hawBoxClr, vHAW[0].y(), vHAW[0].z() - zDel ) ) ;
1204 
1205  const DDSolid hawRSolid ( DDSolidFactory::subtraction(
1206  hawRName(),
1207  hawRSolid1, hawCutBox,
1208  DDTranslation(hawCutForm.getTranslation().x(), hawCutForm.getTranslation().y(), hawCutForm.getTranslation().z()),
1209  myrot( hawCutName.name()+"R",
1210  hawCutForm.getRotation() ) ) ) ;
1211  const DDLogicalPart hawRLog ( hawRName(), spmMat(), hawRSolid ) ;
1212 
1213  // FAW cut box to cut off back end of wedge
1214  const DDName fawCutName ( ddname( fawName().name() + "CUTBOX") ) ;
1215  const DDSolid fawCutBox ( DDSolidFactory::box(
1216  fawCutName,
1217  2*hawBoxParms[0],
1218  hawBoxParms[1],
1219  hawBoxParms[2] ) ) ;
1220 
1221  const std::vector<double>& fawBoxParms ( fawCutBox.parameters() ) ;
1222  const DDLogicalPart fawCutLog ( fawCutName, spmMat(), fawCutBox ) ;
1223 
1224  const Pt3D bb1 ( fawBoxParms[0], fawBoxParms[1], fawBoxParms[2] ) ;
1225  const Pt3D bb2 ( -fawBoxParms[0], fawBoxParms[1], fawBoxParms[2] ) ;
1226  const Pt3D bb3 ( -fawBoxParms[0], fawBoxParms[1], -fawBoxParms[2] ) ;
1227 
1228  const Tf3D fawCutForm (
1229  bb1, bb2, bb3,
1230  vFAW[2] + Pt3D( 2*hawBoxClr,-5*mm,0),
1231  vFAW[1] + Pt3D(-2*hawBoxClr,-5*mm,0),
1232  Pt3D( vFAW[1].x()-2*hawBoxClr, vFAW[1].y()-trapFAW.h(), vFAW[1].z() - zDel ) ) ;
1233 
1234  const DDSolid fawSolid ( DDSolidFactory::subtraction(
1235  fawName(),
1236  fawSolid1, fawCutBox,
1237  DDTranslation(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()) ,
1238  myrot( fawCutName.name()+"R",
1239  fawCutForm.getRotation() ) ) ) ;
1240  const DDLogicalPart fawLog ( fawName(), spmMat(), fawSolid ) ;
1241 
1242 
1243  const Tf3D hawRform ( vHAW[3], vHAW[0], vHAW[1], // HAW inside FAW
1244  vFAW[3], 0.5*(vFAW[0]+vFAW[3]), 0.5*(vFAW[1]+vFAW[2] ) ) ;
1245  cpv.position( hawRLog,
1246  fawLog,
1247  copyOne,
1248  DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()),
1249  myrot( hawRName().name()+"R",
1250  hawRform.getRotation() ) ) ;
1251 
1252  cpv.position( hawRLog,
1253  fawLog,
1254  copyTwo,
1255  DDTranslation( -hawRform.getTranslation().x(),
1256  -hawRform.getTranslation().y(),
1257  -hawRform.getTranslation().z() ),
1258  myrot( hawRName().name()+"RotRefl",
1259  CLHEP::HepRotationY(180*deg)* // rotate about Y after refl thru Z
1260  CLHEP::HepRep3x3(1,0,0, 0,1,0, 0,0,-1) ) ) ;
1261 
1262 /* this for display of haw cut box instead of subtraction
1263  cpv.position( hawCutLog,
1264  hawRName,
1265  copyOne,
1266  hawCutForm.getTranslation(),
1267  myrot( hawCutName.name()+"R",
1268  hawCutForm.getRotation() ) ) ;
1269 */
1270 
1271  for( unsigned int iPhi ( 1 ); iPhi <= nFawPerSupm() ; ++iPhi )
1272  {
1273  const double rPhi ( fawPhiOff() + ( iPhi - 0.5 )*fawDelPhi() ) ;
1274 
1275  const Tf3D fawform ( RoZ3D( rPhi )*
1276  Tl3D( fawRadOff() + ( trapFAW.H() + trapFAW.h() )/4 ,
1277  0,
1278  trapFAW.L()/2 )*
1279  RoZ3D( -90*deg + fawPhiRot() ) ) ;
1280  if( fawHere() )
1281  cpv.position( fawLog,
1282  spmLog,
1283  iPhi,
1284  DDTranslation(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z() ),
1285  myrot( fawName().name()+"_Rot" + std::to_string(iPhi),
1286  fawform.getRotation() ) ) ;
1287  }
1288 
1289  // End Alveolar Wedge parent ------------------------------------------------------
1290 
1291  // Begin Grid + Tablet insertion
1292 
1293  const double h_Grid ( gridThick() ) ;
1294 
1295  const Trap trapGrid (
1296  ( B_hawR - h_Grid*( B_hawR - a_hawR )/H_hawR )/2, // bl1, A/2
1297  ( b_hawR - h_Grid*( B_hawR - a_hawR )/H_hawR )/2, // bl2, a/2
1298  b_hawR/2., // tl2, b/2
1299  h_Grid/2., // h1, H/2
1300  h_Grid/2., // h2, h/2
1301  (L_hawR-8*cm)/2., // dz, L/2
1302  90*deg, // alfa1
1303  0, // x15
1304  H_hawR - h_hawR // y15
1305  ) ;
1306 
1307  const DDSolid gridSolid ( mytrap( gridName().name(), trapGrid ) ) ;
1308  const DDLogicalPart gridLog ( gridName(), gridMat(), gridSolid ) ;
1309 
1310  const Trap::VertexList vGrid ( trapGrid.vertexList() ) ;
1311 
1312  const Tf3D gridForm ( vGrid[4], vGrid[5], vGrid[6], // Grid inside HAW
1313  vHAW[5] - Pt3D(0,h_Grid,0), vHAW[5], vHAW[6] ) ;
1314 
1315  if( 0 != gridHere() )
1316  cpv.position( gridLog,
1317  hawRLog,
1318  copyOne,
1319  DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z() ),
1320  myrot( gridName().name()+"R",
1321  gridForm.getRotation() ) ) ;
1322 
1323  // End Grid + Tablet insertion
1324 
1325  // begin filling Wedge with crystal plus supports --------------------------
1326 
1327  const double aNom ( nomCryDimAF() ) ;
1328  const double LNom ( nomCryDimLZ() ) ;
1329 
1330  const double AUnd ( underAR() ) ;
1331  const double aUnd ( underAF() ) ;
1332 // const double BUnd ( underCR() ) ;
1333  const double bUnd ( underCF() ) ;
1334  const double HUnd ( underBR() ) ;
1335  const double hUnd ( underBF() ) ;
1336  const double LUnd ( underLZ() ) ;
1337 
1338  const double sWall ( wallThAlv() ) ;
1339  const double sWrap ( wrapThAlv() ) ;
1340  const double sClr ( clrThAlv() ) ;
1341 
1342  const double fWall ( wallFrAlv() ) ;
1343  const double fWrap ( wrapFrAlv() ) ;
1344  const double fClr ( clrFrAlv() ) ;
1345 
1346  const double rWall ( wallReAlv() ) ;
1347  const double rWrap ( wrapReAlv() ) ;
1348  const double rClr ( clrReAlv() ) ;
1349 
1350  // theta is angle in yz plane between z axis & leading edge of crystal
1351  double theta ( 90*deg ) ;
1352  double zee ( 0*mm ) ;
1353  double side ( 0*mm ) ;
1354  double zeta ( 0*deg ) ; // increment in theta for last crystal
1355 
1356  for( unsigned int cryType ( 1 ) ; cryType <= nCryTypes() ; ++cryType )
1357  {
1358  const std::string sType ( "_" +
1359  std::string( 10>cryType ? "0" : "") +
1360  std::to_string( cryType ) ) ;
1361 
1362  LogDebug("EcalGeom") << "Crytype=" << cryType ;
1363  const double ANom ( vecNomCryDimAR()[ cryType-1 ] ) ;
1364  const double BNom ( vecNomCryDimCR()[ cryType-1 ] ) ;
1365  const double bNom ( vecNomCryDimCF()[ cryType-1 ] ) ;
1366  const double HNom ( vecNomCryDimBR()[ cryType-1 ] ) ;
1367  const double hNom ( vecNomCryDimBF()[ cryType-1 ] ) ;
1368 
1369  const double alfCry ( 90*deg + atan( ( bNom - bUnd - aNom + aUnd )/
1370  ( hNom - hUnd ) ) ) ;
1371 
1372  const Trap trapCry (
1373  ( ANom - AUnd )/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1374  ( aNom - aUnd )/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1375  ( bNom - bUnd )/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1376  ( HNom - HUnd )/2., //double aHalfLengthYNegZ , // h1, H/2
1377  ( hNom - hUnd )/2., //double aHalfLengthYPosZ , // h2, h/2
1378  ( LNom - LUnd )/2., //double aHalfLengthZ , // dz, L/2
1379  alfCry, //double aAngleAD , // alfa1
1380  aNom - aUnd - ANom + AUnd, //double aCoord15X , // x15
1381  hNom - hUnd - HNom + HUnd //double aCoord15Y // y15
1382  ) ;
1383 
1384  const DDName cryDDName ( cryName() + sType ) ;
1385  const DDSolid crySolid ( mytrap( cryDDName.name(), trapCry ) ) ;
1386  const DDLogicalPart cryLog ( cryDDName, cryMat(), crySolid ) ;
1387 
1388 
1389 //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++
1390 
1391  const DDName apdDDName ( apdName().name() + sType ) ;
1392 
1393  const Trap trapAPD (
1394  apdSide()/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1395  apdSide()/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1396  apdSide()/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1397  apdSide()/2., //double aHalfLengthYNegZ , // h1, H/2
1398  apdSide()/2., //double aHalfLengthYPosZ , // h2, h/2
1399  apdThick()/2., // dz, L/2
1400  90*deg, //double aAngleAD , // alfa1
1401  0, //double aCoord15X , // x15
1402  0 //double aCoord15Y // y15
1403  ) ;
1404 
1405 // DDSolid apdSolid ( DDSolidFactory::box( apdDDName,
1406 // apdSide()/2.,
1407 // apdSide()/2.,
1408 // apdThick()/2. ) ) ;
1409  const DDSolid apdSolid ( mytrap( apdDDName.name(), trapAPD ) ) ;
1410  const DDLogicalPart apdLog ( apdDDName, apdMat(), apdSolid ) ;
1411 
1412  unsigned int copyAPD ( 0 ) ;
1413 //++++++++++++++++++++++++++++++++++ END APD ++++++++++++++++++++++++++++++++++
1414 
1415 
1416  const double delta ( atan( ( HNom - hNom )/LNom ) ) ;
1417 //unused const double cosdelta ( cos( delta ) ) ;
1418  const double sindelta ( sin( delta ) ) ;
1419 
1420  const double gamma ( atan( ( ANom - aNom )/LNom ) ) ;
1421 //unused const double cosgamma ( cos( gamma ) ) ;
1422  const double singamma ( sin( gamma ) ) ;
1423 
1424  const double beta ( atan( ( BNom - bNom )/LNom ) ) ;
1425 //unused const double cosbeta ( cos( beta ) ) ;
1426  const double sinbeta ( sin( beta ) ) ;
1427 
1428  // Now clearance trap
1429  const double alfClr ( 90*deg + atan( ( bNom - aNom )/( hNom + sClr ) ) ) ;
1430 
1431  const Trap trapClr (
1432  ( ANom + sClr + rClr*singamma )/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1433  ( aNom + sClr - fClr*singamma )/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1434  ( bNom + sClr - fClr*sinbeta )/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1435  ( HNom + sClr + rClr*sindelta )/2., //double aHalfLengthYNegZ , // h1, H/2
1436  ( hNom + sClr - fClr*sindelta )/2., //double aHalfLengthYPosZ , // h2, h/2
1437  ( LNom + fClr + rClr )/2., // dz, L/2
1438  alfClr, //double aAngleAD , // alfa1
1439  aNom - ANom , //double aCoord15X , // x15
1440  hNom - HNom //double aCoord15Y // y15
1441  ) ;
1442 
1443  const DDName clrDDName ( clrName() + sType ) ;
1444  const DDSolid clrSolid ( mytrap( clrDDName.name(), trapClr ) ) ;
1445  const DDLogicalPart clrLog ( clrDDName, clrMat(), clrSolid ) ;
1446 
1447  // Now wrap trap
1448 
1449  const double alfWrap ( 90*deg + atan( ( bNom - aNom )/
1450  ( hNom + sClr + 2*sWrap ) ) ) ;
1451 
1452  const Trap trapWrap (
1453  ( trapClr.A() + 2*sWrap + rWrap*singamma )/2, // bl1, A/2
1454  ( trapClr.a() + 2*sWrap - fWrap*singamma )/2, // bl2, a/2
1455  ( trapClr.b() + 2*sWrap - fWrap*sinbeta )/2, // tl2, b/2
1456  ( trapClr.H() + 2*sWrap + rWrap*sindelta )/2, // h1, H/2
1457  ( trapClr.h() + 2*sWrap - fWrap*sindelta )/2, // h2, h/2
1458  ( trapClr.L() + fWrap + rWrap )/2., // dz, L/2
1459  alfWrap, //double aAngleAD , // alfa1
1460  aNom - ANom - (cryType>9 ? 0 : 0.020*mm) ,
1461  hNom - HNom //double aCoord15Y // y15
1462  ) ;
1463 
1464  const DDName wrapDDName ( wrapName() + sType ) ;
1465  const DDSolid wrapSolid ( mytrap( wrapDDName.name(), trapWrap ) ) ;
1466  const DDLogicalPart wrapLog ( wrapDDName, wrapMat(), wrapSolid ) ;
1467 
1468  // Now wall trap
1469 
1470  const double alfWall ( 90*deg + atan( ( bNom - aNom )/
1471  ( hNom + sClr + 2*sWrap + 2*sWall ) ) ) ;
1472 
1473  const Trap trapWall (
1474  ( trapWrap.A() + 2*sWall + rWall*singamma )/2, // A/2
1475  ( trapWrap.a() + 2*sWall - fWall*singamma )/2, // a/2
1476  ( trapWrap.b() + 2*sWall - fWall*sinbeta )/2, // b/2
1477  ( trapWrap.H() + 2*sWall + rWall*sindelta )/2, // H/2
1478  ( trapWrap.h() + 2*sWall - fWall*sindelta )/2, // h/2
1479  ( trapWrap.L() + fWall + rWall )/2., // L/2
1480  alfWall, // alfa1
1481  aNom - ANom - (cryType<10? 0.150*mm : 0.100*mm ) ,
1482  hNom - HNom // y15
1483  ) ;
1484 
1485  const DDName wallDDName ( wallName() + sType ) ;
1486  const DDSolid wallSolid ( mytrap( wallDDName.name(), trapWall ) ) ;
1487  const DDLogicalPart wallLog ( wallDDName, wallMat(), wallSolid ) ;
1488 
1489 /* std::cout << "Traps:\n a: "
1490  << trapCry.a() << ", "
1491  << trapClr.a() << ", "
1492  << trapWrap.a() << ", "
1493  << trapWall.a() << "\n b: "
1494  << trapCry.b() << ", "
1495  << trapClr.b() << ", "
1496  << trapWrap.b() << ", "
1497  << trapWall.b() << "\n A: "
1498  << trapCry.A() << ", "
1499  << trapClr.A() << ", "
1500  << trapWrap.A() << ", "
1501  << trapWall.A() << "\n B: "
1502  << trapCry.B() << ", "
1503  << trapClr.B() << ", "
1504  << trapWrap.B() << ", "
1505  << trapWall.B() << "\n h: "
1506  << trapCry.h() << ", "
1507  << trapClr.h() << ", "
1508  << trapWrap.h() << ", "
1509  << trapWall.h() << "\n H: "
1510  << trapCry.H() << ", "
1511  << trapClr.H() << ", "
1512  << trapWrap.H() << ", "
1513  << trapWall.H() << "\n a1: "
1514  << trapCry.a1()/deg << ", "
1515  << trapClr.a1()/deg << ", "
1516  << trapWrap.a1()/deg << ", "
1517  << trapWall.a1()/deg << "\n a4: "
1518  << trapCry.a4()/deg << ", "
1519  << trapClr.a4()/deg << ", "
1520  << trapWrap.a4()/deg << ", "
1521  << trapWall.a4()/deg << "\n x15: "
1522  << trapCry.x15() << ", "
1523  << trapClr.x15() << ", "
1524  << trapWrap.x15() << ", "
1525  << trapWall.x15() << "\n y15: "
1526  << trapCry.y15() << ", "
1527  << trapClr.y15() << ", "
1528  << trapWrap.y15() << ", "
1529  << trapWall.y15()
1530  << std::endl ;
1531 */
1532  // Now for placement of cry within clr
1533  const Vec3 cryToClr ( 0, 0, ( rClr - fClr )/2 ) ;
1534 
1535  cpv.position( cryLog,
1536  clrLog,
1537  copyOne,
1538  DDTranslation ( 0, 0, ( rClr - fClr )/2 ), //SAME as cryToClr above.
1539  DDRotation() ) ;
1540 
1541  if( 0 != apdHere() )
1542  {
1543  cpv.position( apdLog,
1544  clrLog,
1545  ++copyAPD,
1546  DDTranslation( +trapCry.bl1() - apdX1(),
1547  +trapCry.h1() - apdZ(),
1548  -trapCry.dz() - apdThick()/2. + (rClr - fClr)/2. ),
1549  DDRotation() ) ;
1550  cpv.position( apdLog,
1551  clrLog,
1552  ++copyAPD,
1553  DDTranslation( +trapCry.bl1() - apdX2(),
1554  +trapCry.h1() - apdZ(),
1555  -trapCry.dz() - apdThick()/2. + (rClr - fClr)/2.),
1556  DDRotation() ) ;
1557  }
1558 
1559  const Vec3 clrToWrap ( 0, 0, ( rWrap - fWrap )/2 ) ;
1560 
1561  cpv.position( clrLog,
1562  wrapLog,
1563  copyOne,
1564  DDTranslation ( 0, 0, ( rWrap - fWrap )/2 ), //SAME as cryToWrap
1565  DDRotation() ) ;
1566 
1567 
1568  // Now for placement of clr within wall
1569  const Vec3 wrapToWall1 ( 0, 0, ( rWall - fWall )/2 ) ;
1570  const Vec3 wrapToWall ( Vec3( (cryType>9?0:0.005*mm),0,0 )+wrapToWall1 ) ;
1571 
1572  cpv.position( wrapLog,
1573  wallLog,
1574  copyOne,
1575  DDTranslation ( Vec3( (cryType>9?0:0.005*mm),0,0 )+wrapToWall1 ), //SAME as wrapToWall
1576  DDRotation() ) ;
1577 
1578  const Trap::VertexList vWall ( trapWall.vertexList() ) ;
1579  const Trap::VertexList vCry ( trapCry.vertexList() ) ;
1580 
1581  const double sidePrime ( ( trapWall.a() - trapCry.a() )/2 ) ;
1582  const double frontPrime ( fWall + fWrap + fClr + LUnd/2 ) ;
1583 
1584  // define web plates with clearance ===========================================
1585 
1586  if( 1 == cryType ) // first web plate: inside clearance volume
1587  {
1588  web( 0,
1589  trapWall.b(),
1590  trapWall.B(),
1591  trapWall.L(),
1592  theta,
1593  vHAW[4] + Pt3D( 0, hawYOffCry(), 0 ),
1594  hawRLog,
1595  zee,
1596  sidePrime,
1597  frontPrime,
1598  delta, cpv ) ;
1599  zee += vecGapAlvEta()[0] ;
1600  }
1601 
1602  for( unsigned int etaAlv ( 1 ) ; etaAlv <= nCryPerAlvEta() ; ++etaAlv )
1603  {
1604  LogDebug("EcalGeom") << "theta=" << theta/deg
1605  << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime
1606  << ", zeta="<<zeta<<", delta="<<delta<<", zee=" << zee;
1607 
1608  zee += 0.075*mm +
1609  ( side*cos(zeta) + trapWall.h() - sidePrime )/sin(theta) ;
1610 
1611  LogDebug("EcalGeom") << "New zee="<< zee ;
1612 
1613  // make transform for placing enclosed crystal
1614 
1615  const Pt3D trap2 ( vCry[2] + cryToClr + clrToWrap + wrapToWall ) ;
1616 
1617  const Pt3D trap3 ( trap2 + Pt3D( 0,
1618  -trapCry.h(),
1619  0 ) ) ;
1620  const Pt3D trap1 ( trap3 + Pt3D( -trapCry.a(),
1621  0,
1622  0 ) ) ;
1623 
1624  const Pt3D wedge3 ( vHAW[4] + Pt3D( sidePrime,
1625  hawYOffCry(),
1626  zee ) ) ;
1627  const Pt3D wedge2 ( wedge3 + Pt3D( 0,
1628  trapCry.h()*cos(theta),
1629  -trapCry.h()*sin(theta) ) ) ;
1630  const Pt3D wedge1 ( wedge3 + Pt3D( trapCry.a(),
1631  0,
1632  0 ) ) ;
1633 
1634  const Tf3D tForm1 ( trap1, trap2, trap3,
1635  wedge1, wedge2, wedge3 ) ;
1636 
1637  const double xx ( 0.050*mm ) ;
1638 
1639  const Tf3D tForm ( HepGeom::Translate3D(xx,0,0)*tForm1 ) ;
1640 
1641  cpv.position( wallLog,
1642  hawRLog,
1643  etaAlv,
1644  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z() ),
1645  myrot( wallLog.name().name() + "_" + std::to_string( etaAlv ),
1646  tForm.getRotation() ) ) ;
1647 
1648  theta -= delta ;
1649  side = sidePrime ;
1650  zeta = delta ;
1651  }
1652  if( 5 == cryType ||
1653  9 == cryType ||
1654  13 == cryType ||
1655  17 == cryType ) // web plates
1656  {
1657  const unsigned int webIndex ( cryType/4 ) ;
1658  zee += 0.5*vecGapAlvEta()[cryType]/sin(theta) ;
1659  web( webIndex,
1660  trapWall.a(),
1661  trapWall.A(),
1662  trapWall.L(),
1663  theta,
1664  vHAW[4] + Pt3D( 0, hawYOffCry(), 0 ),
1665  hawRLog,
1666  zee ,
1667  sidePrime,
1668  frontPrime,
1669  delta, cpv ) ;
1670  zee += 0.5*vecGapAlvEta()[cryType]/sin(theta) ;
1671  }
1672  else
1673  {
1674  if( 17 != cryType ) zee += vecGapAlvEta()[cryType]/sin(theta) ;
1675  }
1676  }
1677  // END filling Wedge with crystal plus supports --------------------------
1678 
1679 //------------------------------------------------------------------------
1680 //------------------------------------------------------------------------
1681 //------------------------------------------------------------------------
1682 //------------------------------------------------------------------------
1683 //**************** Material at outer radius of supermodule ***************
1684 //------------------------------------------------------------------------
1685 //------------------------------------------------------------------------
1686 //------------------------------------------------------------------------
1687 //------------------------------------------------------------------------
1688 
1689  if( 0 != backHere() )
1690  {
1691 
1697 
1698  const DDTranslation outtra ( backXOff() + backSideHeight()/2,
1699  backYOff(),
1700  backSideLength()/2 ) ;
1701 
1702  const double realBPthick ( backPlateThick() + backPlate2Thick() ) ;
1703 
1704  DDSolid backPlateSolid ( DDSolidFactory::box( backPlateName(),
1705  backPlateWidth()/2.,
1706  realBPthick/2.,
1707  backPlateLength()/2. ) ) ;
1708  const std::vector<double>& backPlateParms ( backPlateSolid.parameters() ) ;
1709  const DDLogicalPart backPlateLog ( backPlateName(),
1710  backPlateMat(),
1711  backPlateSolid ) ;
1712 
1713  const DDTranslation backPlateTra ( backSideHeight()/2 +
1714  backPlateParms[1],
1715  0*mm,
1716  backPlateParms[2] -
1717  backSideLength()/2 ) ;
1718 
1719  DDSolid backPlate2Solid ( DDSolidFactory::box( backPlate2Name(),
1720  backPlateWidth()/2.,
1721  backPlate2Thick()/2.,
1722  backPlateLength()/2. ) ) ;
1723 
1724  const DDLogicalPart backPlate2Log ( backPlate2Name(),
1725  backPlate2Mat(),
1726  backPlate2Solid ) ;
1727 
1728  const DDTranslation backPlate2Tra ( 0,
1729  -backPlateParms[1] + backPlate2Thick()/2., 0 ) ;
1730  if( 0 != backPlateHere() )
1731  {
1732  cpv.position( backPlate2Log,
1733  backPlateName(),
1734  copyOne,
1735  backPlate2Tra,
1736  DDRotation() ) ;
1737 
1738  cpv.position( backPlateLog,
1739  spmName(),
1740  copyOne,
1741  outtra + backPlateTra,
1742  myrot( backPlateName().name()+"Rot5",
1743  CLHEP::HepRotationZ(270*deg) ) ) ;
1744 
1745  }
1751 
1752 
1758 
1759  const Trap trapBS (
1760  backSideWidth()/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1761  backSideWidth()/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1762  backSideWidth()/4., //double aHalfLengthXPosZHiY , // tl2, b/2
1763  backSideHeight()/2., //double aHalfLengthYNegZ , // h1, H/2
1764  backSideHeight()/2., //double aHalfLengthYPosZ , // h2, h/2
1765  backSideLength()/2., //double aHalfLengthZ , // dz, L/2
1766  backSideAngle(), //double aAngleAD , // alfa1
1767  0, //double aCoord15X , // x15
1768  0 //double aCoord15Y // y15
1769  ) ;
1770 
1771  const DDSolid backSideSolid ( mytrap( backSideName().name(), trapBS ) ) ;
1772  const DDLogicalPart backSideLog ( backSideName(),
1773  backSideMat(),
1774  backSideSolid ) ;
1775 
1776  const DDTranslation backSideTra1 ( 0*mm,
1777  backPlateWidth()/2 + backSideYOff1(),
1778  1*mm ) ;
1779  if( 0 != backSideHere() )
1780  {
1781  cpv.position( backSideLog,
1782  spmName(),
1783  copyOne,
1784  outtra + backSideTra1,
1785  myrot( backSideName().name()+"Rot8",
1786  CLHEP::HepRotationX(180*deg)*CLHEP::HepRotationZ(90*deg) ) ) ;
1787 
1788  const DDTranslation backSideTra2( 0*mm,
1789  -backPlateWidth()/2 + backSideYOff2(),
1790  1*mm ) ;
1791  cpv.position( backSideLog,
1792  spmName(),
1793  copyTwo,
1794  outtra + backSideTra2,
1795  myrot( backSideName().name()+"Rot9",
1796  CLHEP::HepRotationZ(90*deg) ) ) ;
1797  }
1803 
1804 //=====================
1805  const double backCoolWidth ( backCoolBarWidth() + 2.*backCoolTankWidth() ) ;
1806 
1812 
1813  const double manifCut ( 2*mm ) ;
1814 
1815  DDSolid mBManifSolid ( DDSolidFactory::tubs( mBManifName() ,
1816  backCoolWidth/2. - manifCut,
1817  0,
1818  mBManifOutDiam()/2,
1819  0*deg, 360*deg ) ) ;
1820  const DDLogicalPart mBManifLog ( mBManifName(), mBManifMat(), mBManifSolid ) ;
1821 
1822  const DDName mBManifWaName ( ddname( mBManifName().name() + "Wa" ) ) ;
1823  DDSolid mBManifWaSolid ( DDSolidFactory::tubs( mBManifWaName ,
1824  backCoolWidth/2.-manifCut,
1825  0,
1826  mBManifInnDiam()/2,
1827  0*deg, 360*deg ) ) ;
1828  const DDLogicalPart mBManifWaLog ( mBManifWaName, backPipeWaterMat(),
1829  mBManifWaSolid ) ;
1830  cpv.position( mBManifWaLog,
1831  mBManifName(),
1832  copyOne,
1833  DDTranslation(0,0,0),
1834  DDRotation() ) ;
1835 
1841 //=====================
1842 
1843 
1844 
1850  const double deltaY ( -5*mm ) ;
1851 
1852  DDSolid grEdgeSlotSolid ( DDSolidFactory::box( grEdgeSlotName(),
1853  grEdgeSlotHeight()/2.,
1854  grEdgeSlotWidth()/2.,
1855  grilleThick()/2. ) ) ;
1856  const DDLogicalPart grEdgeSlotLog ( grEdgeSlotName(), grEdgeSlotMat(), grEdgeSlotSolid );
1857 
1858  unsigned int edgeSlotCopy ( 0 ) ;
1859  unsigned int midSlotCopy ( 0 ) ;
1860 
1861  DDLogicalPart grMidSlotLog[4] ;
1862 
1863  for( unsigned int iGr ( 0 ) ; iGr != vecGrilleHeight().size() ; ++iGr )
1864  {
1865  DDName gName ( ddname( grilleName() + std::to_string( iGr ) ) ) ;
1866  DDSolid grilleSolid ( DDSolidFactory::box( gName,
1867  vecGrilleHeight()[iGr]/2.,
1868  backCoolWidth/2.,
1869  grilleThick()/2. ) ) ;
1870  const DDLogicalPart grilleLog ( gName,
1871  grilleMat(),
1872  grilleSolid ) ;
1873 
1874  const DDTranslation grilleTra ( -realBPthick/2 -
1875  vecGrilleHeight()[iGr]/2,
1876  deltaY,
1877  vecGrilleZOff()[iGr] +
1878  grilleThick()/2 - backSideLength()/2 ) ;
1879  const DDTranslation gTra ( outtra + backPlateTra + grilleTra ) ;
1880 
1881  if( 0 != grMidSlotHere() &&
1882  0 != iGr )
1883  {
1884  if( 0 == (iGr-1)%2 )
1885  {
1886  DDName mName ( ddname( grMidSlotName() + std::to_string( iGr/2 ) ) ) ;
1887  DDSolid grMidSlotSolid ( DDSolidFactory::box(
1888  mName,
1889  vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1890  grMidSlotWidth()/2.,
1891  grilleThick()/2. ) ) ;
1892  grMidSlotLog[(iGr-1)/2] = DDLogicalPart( mName, grMidSlotMat(), grMidSlotSolid ) ;
1893  }
1894  cpv.position( grMidSlotLog[(iGr-1)/2],
1895  gName,
1896  ++midSlotCopy,
1897  DDTranslation( vecGrilleHeight()[iGr]/2. - vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1898  +grMidSlotXOff(), 0 ),
1899  DDRotation() ) ;
1900  cpv.position( grMidSlotLog[(iGr-1)/2],
1901  gName,
1902  ++midSlotCopy,
1903  DDTranslation( vecGrilleHeight()[iGr]/2. - vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1904  -grMidSlotXOff(), 0 ),
1905  DDRotation() ) ;
1906  }
1907 
1908  if( 0 != grEdgeSlotHere() &&
1909  0 != iGr )
1910  {
1911  cpv.position( grEdgeSlotLog,
1912  gName,
1913  ++edgeSlotCopy,
1915  backCoolWidth/2 - grEdgeSlotWidth()/2., 0 ),
1916  DDRotation() ) ;
1917  cpv.position( grEdgeSlotLog,
1918  gName,
1919  ++edgeSlotCopy,
1921  -backCoolWidth/2 + grEdgeSlotWidth()/2., 0 ),
1922  DDRotation() ) ;
1923  }
1924  if( 0 != grilleHere() )
1925  cpv.position( grilleLog,
1926  spmName(),
1927  iGr,
1928  gTra,
1929  DDRotation() ) ;
1930 
1931  if( ( 0 != iGr%2 ) &&
1932  ( 0 != mBManifHere() ) )
1933  {
1934  cpv.position( mBManifLog,
1935  spmName(),
1936  iGr,
1937  gTra - DDTranslation( -mBManifOutDiam()/2. +
1938  vecGrilleHeight()[iGr]/2.,manifCut,
1939  grilleThick()/2.+3*mBManifOutDiam()/2.) ,
1940  myrot( mBManifName().name()+"R1",
1941  CLHEP::HepRotationX(90*deg) ) ) ;
1942  cpv.position( mBManifLog,
1943  spmName(),
1944  iGr-1,
1945  gTra - DDTranslation( -3*mBManifOutDiam()/2. +
1946  vecGrilleHeight()[iGr]/2.,manifCut,
1947  grilleThick()/2+3*mBManifOutDiam()/2.) ,
1948  myrot( mBManifName().name()+"R2",
1949  CLHEP::HepRotationX(90*deg) ) ) ;
1950  }
1951  }
1952 
1958 
1959 
1965 
1966  DDSolid backCoolBarSolid ( DDSolidFactory::box( backCoolBarName(),
1967  backCoolBarHeight()/2.,
1968  backCoolBarWidth()/2.,
1969  backCoolBarThick()/2. ) ) ;
1970  const DDLogicalPart backCoolBarLog ( backCoolBarName(),
1971  backCoolBarMat(),
1972  backCoolBarSolid ) ;
1973 
1974  DDSolid backCoolBarSSSolid ( DDSolidFactory::box( backCoolBarSSName(),
1975  backCoolBarHeight()/2.,
1976  backCoolBarWidth()/2.,
1977  backCoolBarSSThick()/2. ) ) ;
1978  const DDLogicalPart backCoolBarSSLog ( backCoolBarSSName(),
1979  backCoolBarSSMat(),
1980  backCoolBarSSSolid ) ;
1981  const DDTranslation backCoolBarSSTra (0,0,0) ;
1982  cpv.position( backCoolBarSSLog,
1983  backCoolBarName(),
1984  copyOne,
1985  backCoolBarSSTra,
1986  DDRotation() ) ;
1987 
1988  DDSolid backCoolBarWaSolid ( DDSolidFactory::box( backCoolBarWaName(),
1989  backCoolBarHeight()/2.,
1990  backCoolBarWidth()/2.,
1991  backCoolBarWaThick()/2. ) ) ;
1992  const DDLogicalPart backCoolBarWaLog ( backCoolBarWaName(),
1993  backCoolBarWaMat(),
1994  backCoolBarWaSolid ) ;
1995  const DDTranslation backCoolBarWaTra (0,0,0) ;
1996  cpv.position( backCoolBarWaLog,
1997  backCoolBarSSName(),
1998  copyOne,
1999  backCoolBarWaTra,
2000  DDRotation() ) ;
2001 
2007 
2008 
2014 
2015  double thickVFE ( 0 ) ;
2016  for( unsigned int iLyr ( 0 ) ; iLyr != vecBackVFELyrThick().size() ; ++iLyr )
2017  {
2018  thickVFE += vecBackVFELyrThick()[iLyr] ;
2019  }
2020  DDSolid backVFESolid ( DDSolidFactory::box( backVFEName(),
2021  backCoolBarHeight()/2.,
2022  backCoolBarWidth()/2.,
2023  thickVFE/2. ) ) ;
2024  const DDLogicalPart backVFELog ( backVFEName(),
2025  backVFEMat(),
2026  backVFESolid ) ;
2027  DDTranslation offTra ( 0,0,-thickVFE/2 ) ;
2028  for( unsigned int iLyr ( 0 ) ; iLyr != vecBackVFELyrThick().size() ; ++iLyr )
2029  {
2030  DDSolid backVFELyrSolid ( DDSolidFactory::box( ddname(vecBackVFELyrName()[iLyr]),
2031  backCoolBarHeight()/2.,
2032  backCoolBarWidth()/2.,
2033  vecBackVFELyrThick()[iLyr]/2. ) ) ;
2034  const DDLogicalPart backVFELyrLog ( ddname(vecBackVFELyrName()[iLyr]),
2035  ddmat(vecBackVFELyrMat()[iLyr]),
2036  backVFELyrSolid ) ;
2037  const DDTranslation backVFELyrTra (0,0, vecBackVFELyrThick()[iLyr]/2) ;
2038  cpv.position( backVFELyrLog,
2039  backVFEName(),
2040  copyOne,
2041  backVFELyrTra + offTra,
2042  DDRotation() ) ;
2043  offTra += 2*backVFELyrTra ;
2044  }
2045 
2051 
2052 
2058 
2059  const double halfZCoolVFE ( thickVFE + backCoolBarThick()/2. ) ;
2060  DDSolid backCoolVFESolid ( DDSolidFactory::box( backCoolVFEName(),
2061  backCoolBarHeight()/2.,
2062  backCoolBarWidth()/2.,
2063  halfZCoolVFE ) ) ;
2064  const DDLogicalPart backCoolVFELog ( backCoolVFEName(),
2065  backCoolVFEMat(),
2066  backCoolVFESolid ) ;
2067  if( 0 != backCoolBarHere() )
2068  cpv.position( backCoolBarLog ,
2069  backCoolVFEName() ,
2070  copyOne ,
2071  DDTranslation() ,
2072  DDRotation() ) ;
2073  if( 0 != backCoolVFEHere() )
2074  cpv.position( backVFELog ,
2075  backCoolVFEName() ,
2076  copyOne ,
2077  DDTranslation( 0,0, backCoolBarThick()/2. + thickVFE/2. ) ,
2078  DDRotation() ) ;
2079  cpv.position( backVFELog ,
2080  backCoolVFEName() ,
2081  copyTwo ,
2082  DDTranslation( 0,0, -backCoolBarThick()/2. - thickVFE/2. ) ,
2083  myrot( backVFEName().name() + "Flip",
2084  CLHEP::HepRotationX( 180*deg ) ) ) ;
2085 
2091 
2092 
2098  unsigned int iCVFECopy ( 1 ) ;
2099  unsigned int iSep ( 0 ) ;
2100  unsigned int iNSec ( 0 ) ;
2101  const unsigned int nMisc ( vecBackMiscThick().size()/4 ) ;
2102  for( unsigned int iMod ( 0 ) ; iMod != 4 ; ++iMod )
2103  {
2104  const double pipeLength ( vecGrilleZOff()[2*iMod+1] -
2105  vecGrilleZOff()[2*iMod ] -
2106  grilleThick() - 3*mm ) ;
2107 
2108  const double pipeZPos ( vecGrilleZOff()[2*iMod+1] - pipeLength/2 - 1.5*mm ) ;
2109 
2110 
2111 
2112  // accumulate total height of parent volume
2113 
2114  double backCoolHeight ( backCoolBarHeight() + mBCoolTubeOutDiam() ) ;
2115  for( unsigned int iMisc ( 0 ) ; iMisc != nMisc ; ++iMisc )
2116  {
2117  backCoolHeight += vecBackMiscThick()[ iMod*nMisc + iMisc ] ;
2118  }
2119  double bottomThick ( mBCoolTubeOutDiam() ) ;
2120  for( unsigned int iMB ( 0 ) ; iMB != vecMBLyrThick().size() ; ++iMB )
2121  {
2122  backCoolHeight += vecMBLyrThick()[iMB] ;
2123  bottomThick += vecMBLyrThick()[iMB] ;
2124  }
2125 
2126  DDName backCName ( ddname( vecBackCoolName()[iMod] ) ) ;
2127  const double halfZBCool ( ( pipeLength - 2*mBManifOutDiam() - grilleZSpace() )/2 ) ;
2128  DDSolid backCoolSolid ( DDSolidFactory::box( backCName ,
2129  backCoolHeight/2.,
2130  backCoolWidth/2.,
2131  halfZBCool ) ) ;
2132  const DDLogicalPart backCoolLog ( backCName,
2133  spmMat(),
2134  backCoolSolid ) ;
2135 
2136  const DDTranslation bCoolTra ( -realBPthick/2 +
2137  backCoolHeight/2 -
2138  vecGrilleHeight()[2*iMod],
2139  deltaY,
2140  vecGrilleZOff()[2*iMod] +
2141  grilleThick() + grilleZSpace() +
2142  halfZBCool -
2143  backSideLength()/2 ) ;
2144  if( 0 != backCoolHere() )
2145  cpv.position( backCoolLog,
2146  spmName(),
2147  iMod+1,
2148  outtra + backPlateTra + bCoolTra,
2149  DDRotation() ) ;
2150 
2151 //===
2152  const double backCoolTankHeight ( backCoolBarHeight() ) ;// - backBracketHeight() ) ;
2153 
2154  const double halfZTank ( halfZBCool - 5*cm ) ;
2155 
2156  DDName bTankName ( ddname( backCoolTankName()+std::to_string(iMod+1) ) ) ;
2157  DDSolid backCoolTankSolid ( DDSolidFactory::box( bTankName ,
2158  backCoolTankHeight/2.,
2159  backCoolTankWidth()/2.,
2160  halfZTank ) ) ;
2161  const DDLogicalPart backCoolTankLog ( bTankName,
2162  backCoolTankMat(),
2163  backCoolTankSolid ) ;
2164  if( 0 != backCoolTankHere() )
2165  cpv.position( backCoolTankLog,
2166  backCName,
2167  copyOne,
2168  DDTranslation( -backCoolHeight/2 +
2169  backCoolTankHeight/2. +
2170  bottomThick,
2171  backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
2172  DDRotation() ) ;
2173 
2174  DDName bTankWaName ( ddname( backCoolTankWaName()+std::to_string(iMod+1) ) ) ;
2175  DDSolid backCoolTankWaSolid ( DDSolidFactory::box( bTankWaName ,
2176  backCoolTankHeight/2. -
2177  backCoolTankThick()/2.,
2178  backCoolTankWaWidth()/2.,
2179  halfZTank -
2180  backCoolTankThick()/2. ) ) ;
2181  const DDLogicalPart backCoolTankWaLog ( bTankWaName,
2183  backCoolTankWaSolid ) ;
2184  cpv.position( backCoolTankWaLog,
2185  bTankName,
2186  copyOne,
2187  DDTranslation(0,0,0),
2188  DDRotation() ) ;
2189 
2190  DDName bBracketName ( ddname( backBracketName()+std::to_string(iMod+1) ) ) ;
2191  DDSolid backBracketSolid ( DDSolidFactory::box( bBracketName ,
2192  backBracketHeight()/2.,
2193  backCoolTankWidth()/2.,
2194  halfZTank ) ) ;
2195  const DDLogicalPart backBracketLog ( bBracketName,
2196  backBracketMat(),
2197  backBracketSolid ) ;
2198  if( 0 != backCoolTankHere() )
2199  cpv.position( backBracketLog,
2200  backCName,
2201  copyOne,
2203  backCoolHeight/2. -
2204  backBracketHeight()/2. +
2205  bottomThick,
2206  -backCoolBarWidth()/2. - backCoolTankWidth()/2., 0),
2207  DDRotation() ) ;
2208 
2209 /* cpv.position( backBracketLog,
2210  backCName,
2211  copyTwo,
2212  DDTranslation( backCoolBarHeight() - backCoolHeight/2. - backBracketHeight()/2.,
2213  backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
2214  DDRotation() ) ;*/
2215 
2216 //===
2217 
2218  DDTranslation bSumTra ( backCoolBarHeight() -
2219  backCoolHeight/2. +
2220  bottomThick, 0, 0 ) ;
2221  for( unsigned int j ( 0 ) ; j != nMisc ; ++j ) // loop over miscellaneous layers
2222  {
2223  const DDName bName ( ddname( vecBackMiscName()[ iMod*nMisc + j ] ) ) ;
2224 
2225  DDSolid bSolid ( DDSolidFactory::box( bName ,
2226  vecBackMiscThick()[ iMod*nMisc + j ]/2,
2228  halfZBCool ) ) ;
2229 
2230  const DDLogicalPart bLog ( bName, ddmat(vecBackMiscMat()[ iMod*nMisc + j ]), bSolid ) ;
2231 
2232  const DDTranslation bTra ( vecBackMiscThick()[ iMod*nMisc + j ]/2, 0*mm, 0*mm ) ;
2233 
2234 
2235  if( 0 != backMiscHere() )
2236  cpv.position( bLog,
2237  backCName,
2238  copyOne,
2239  bSumTra + bTra,
2240  DDRotation() ) ;
2241 
2242  bSumTra += 2*bTra ;
2243  }
2244 
2245  const double bHalfWidth ( backCoolBarWidth()/2. + backCoolTankWidth() ) ;
2246 
2247  if( 0 != mBLyrHere() )
2248  {
2249  DDTranslation mTra ( -backCoolHeight/2. + mBCoolTubeOutDiam(), 0, 0 ) ;
2250  for( unsigned int j ( 0 ) ; j != vecMBLyrThick().size() ; ++j ) // loop over MB layers
2251  {
2252  const DDName mName ( ddname( vecMBLyrName()[j] + "_" +
2253  std::to_string(iMod+1) ) ) ;
2254 
2255  DDSolid mSolid ( DDSolidFactory::box( mName ,
2256  vecMBLyrThick()[j]/2,
2257  bHalfWidth,
2258  halfZBCool ) ) ;
2259 
2260  const DDLogicalPart mLog ( mName, ddmat(vecMBLyrMat()[j]), mSolid ) ;
2261 
2262  mTra += DDTranslation( vecMBLyrThick()[j]/2.0, 0*mm, 0*mm ) ;
2263  cpv.position( mLog,
2264  backCName,
2265  copyOne,
2266  mTra,
2267  DDRotation() ) ;
2268  mTra += DDTranslation( vecMBLyrThick()[j]/2.0, 0*mm, 0*mm ) ;
2269  }
2270  }
2271 
2272  if( 0 != mBCoolTubeHere() )
2273  {
2274  const DDName mBName ( ddname( mBCoolTubeName() + "_" +
2275  std::to_string(iMod+1) ) ) ;
2276 
2277  DDSolid mBCoolTubeSolid ( DDSolidFactory::tubs( mBName ,
2278  halfZBCool,
2279  0,
2280  mBCoolTubeOutDiam()/2,
2281  0*deg, 360*deg ) ) ;
2282  const DDLogicalPart mBLog ( mBName, mBCoolTubeMat(), mBCoolTubeSolid ) ;
2283 
2284  const DDName mBWaName ( ddname( mBCoolTubeName() + "Wa_" +
2285  std::to_string(iMod+1) ) ) ;
2286  DDSolid mBCoolTubeWaSolid ( DDSolidFactory::tubs( mBWaName ,
2287  halfZBCool,
2288  0,
2289  mBCoolTubeInnDiam()/2,
2290  0*deg, 360*deg ) ) ;
2291  const DDLogicalPart mBWaLog ( mBWaName, backPipeWaterMat(),
2292  mBCoolTubeWaSolid ) ;
2293  cpv.position( mBWaLog,
2294  mBName,
2295  copyOne,
2296  DDTranslation(0,0,0),
2297  DDRotation() ) ;
2298 
2299  for( unsigned int j ( 0 ) ; j != mBCoolTubeNum() ; ++j ) // loop over all MB cooling circuits
2300  {
2301  cpv.position( mBLog,
2302  backCName,
2303  2*j + 1,
2304  DDTranslation(-backCoolHeight/2.0+mBCoolTubeOutDiam()/2.,
2305  -bHalfWidth + (j+1)*bHalfWidth/5, 0),
2306  DDRotation() ) ;
2307  }
2308  }
2309 
2310 
2316  if( 0 != backPipeHere() &&
2317  0 != iMod )
2318  {
2319  DDName bPipeName ( ddname( backPipeName() + "_" +
2320  std::to_string( iMod+1 ) ) ) ;
2321  DDName bInnerName ( ddname( backPipeName() +
2322  "_H2O_" + std::to_string( iMod+1 ) ) ) ;
2323 
2324  DDSolid backPipeSolid ( DDSolidFactory::tubs( bPipeName ,
2325  pipeLength/2,
2326  0*mm,
2327  vecBackPipeDiam()[iMod]/2,
2328  0*deg, 360*deg ) ) ;
2329 
2330  DDSolid backInnerSolid ( DDSolidFactory::tubs( bInnerName ,
2331  pipeLength/2,
2332  0*mm,
2333  vecBackPipeDiam()[iMod]/2 -
2334  vecBackPipeThick()[iMod],
2335  0*deg, 360*deg ) ) ;
2336 
2337  const DDLogicalPart backPipeLog ( bPipeName,
2338  backPipeMat(),
2339  backPipeSolid ) ;
2340 
2341  const DDLogicalPart backInnerLog ( bInnerName,
2342  backPipeWaterMat(),
2343  backInnerSolid ) ;
2344 
2345  const DDTranslation bPipeTra1 ( backXOff() +
2346  backSideHeight() -
2347  0.7*vecBackPipeDiam()[iMod],
2348  backYOff() +
2349  backPlateWidth()/2 -
2350  backSideWidth() -
2351  0.7*vecBackPipeDiam()[iMod],
2352  pipeZPos ) ;
2353 
2354  cpv.position( backPipeLog,
2355  spmName(),
2356  copyOne,
2357  bPipeTra1,
2358  DDRotation() ) ;
2359 
2360  const DDTranslation bPipeTra2 ( bPipeTra1.x(),
2361  backYOff() -
2362  backPlateWidth()/2 +
2363  backSideWidth() +
2364  vecBackPipeDiam()[iMod],
2365  bPipeTra1.z() ) ;
2366 
2367  cpv.position( backPipeLog,
2368  spmName(),
2369  copyTwo,
2370  bPipeTra2,
2371  DDRotation() ) ;
2372 
2373  cpv.position( backInnerLog,
2374  bPipeName,
2375  copyOne,
2376  DDTranslation(),
2377  DDRotation() ) ;
2378  }
2384 
2385 //=================================================
2386 
2387  if( 0 != dryAirTubeHere() )
2388  {
2389  DDName dryAirTubName ( ddname( dryAirTubeName() + std::to_string( iMod+1 ) ) ) ;
2390 
2391  DDSolid dryAirTubeSolid ( DDSolidFactory::tubs( dryAirTubName ,
2392  pipeLength/2,
2393  dryAirTubeInnDiam()/2,
2394  dryAirTubeOutDiam()/2,
2395  0*deg, 360*deg ) ) ;
2396 
2397  const DDLogicalPart dryAirTubeLog ( dryAirTubName ,
2398  dryAirTubeMat(),
2399  dryAirTubeSolid ) ;
2400 
2401  const DDTranslation dryAirTubeTra1 ( backXOff() +
2402  backSideHeight() -
2403  0.7*dryAirTubeOutDiam() -
2404  vecBackPipeDiam()[iMod],
2405  backYOff() +
2406  backPlateWidth()/2 -
2407  backSideWidth() -
2408  1.2*dryAirTubeOutDiam(),
2409  pipeZPos ) ;
2410 
2411  cpv.position( dryAirTubeLog,
2412  spmName(),
2413  copyOne,
2414  dryAirTubeTra1,
2415  DDRotation() ) ;
2416 
2417  const DDTranslation dryAirTubeTra2 ( dryAirTubeTra1.x(),
2418  backYOff() -
2419  backPlateWidth()/2 +
2420  backSideWidth() +
2421  0.7*dryAirTubeOutDiam() ,
2422  dryAirTubeTra1.z() ) ;
2423 
2424  cpv.position( dryAirTubeLog,
2425  spmName(),
2426  copyTwo,
2427  dryAirTubeTra2,
2428  DDRotation() ) ;
2429  }
2430  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2431 
2437 
2438  DDTranslation cTra ( backCoolBarHeight()/2. -
2439  backCoolHeight/2. +
2440  bottomThick, 0 ,
2441  -halfZTank + halfZCoolVFE ) ;
2442  const unsigned int numSec ( static_cast<unsigned int> (vecBackCoolNSec()[iMod]) ) ;
2443  for( unsigned int jSec ( 0 ) ; jSec != numSec ; ++jSec )
2444  {
2445  const unsigned int nMax ( static_cast<unsigned int> (vecBackCoolNPerSec()[iNSec++]) ) ;
2446  for( unsigned int iBar ( 0 ) ; iBar != nMax ; ++iBar )
2447  {
2448  cpv.position( backCoolVFELog,
2449  backCName,
2450  iCVFECopy++,
2451  cTra,
2452  DDRotation() ) ;
2453  cTra += DDTranslation( 0, 0, backCBStdSep() ) ;
2454  }
2455  cTra -= DDTranslation( 0, 0, backCBStdSep() ) ; // backspace to previous
2456  if( jSec != numSec-1 ) cTra += DDTranslation(
2457  0, 0, vecBackCoolSecSep()[iSep++] ) ; // now take atypical step
2458  }
2464  }
2465 
2471 
2477 
2478  double patchHeight ( 0 ) ;
2479  for( unsigned int iPatch ( 0 ) ; iPatch != vecPatchPanelThick().size() ; ++iPatch )
2480  {
2481  patchHeight += vecPatchPanelThick()[iPatch] ;
2482  }
2483 
2484  DDSolid patchSolid ( DDSolidFactory::box( patchPanelName() ,
2485  patchHeight/2.,
2486  backCoolBarWidth()/2.,
2487  ( vecSpmZPts().back() -
2488  vecGrilleZOff().back() -
2489  grilleThick() )/2 ) ) ;
2490 
2491  const std::vector<double>& patchParms ( patchSolid.parameters() ) ;
2492 
2493  const DDLogicalPart patchLog ( patchPanelName(), spmMat(), patchSolid ) ;
2494 
2495  const DDTranslation patchTra ( backXOff() + 4*mm ,
2496  0*mm,
2497  vecGrilleZOff().back() +
2498  grilleThick() +
2499  patchParms[2] ) ;
2500  if( 0 != patchPanelHere() )
2501  cpv.position( patchLog,
2502  spmName(),
2503  copyOne,
2504  patchTra,
2505  DDRotation() ) ;
2506 
2507  DDTranslation pTra (-patchParms[0],0,0) ;
2508 
2509  for( unsigned int j ( 0 ) ; j != vecPatchPanelNames().size() ; ++j )
2510  {
2511  const DDName pName ( ddname( vecPatchPanelNames()[j] ) ) ;
2512 
2513  DDSolid pSolid ( DDSolidFactory::box( pName ,
2514  vecPatchPanelThick()[j]/2.,
2515  patchParms[1],
2516  patchParms[2] ) ) ;
2517 
2518  const DDLogicalPart pLog ( pName, ddmat(vecPatchPanelMat()[j]), pSolid ) ;
2519 
2520  pTra += DDTranslation( vecPatchPanelThick()[j]/2, 0*mm, 0*mm ) ;
2521 
2522  cpv.position( pLog,
2523  patchPanelName(),
2524  copyOne,
2525  pTra,
2526  DDRotation() ) ;
2527 
2528  pTra += DDTranslation( vecPatchPanelThick()[j]/2, 0*mm, 0*mm ) ;
2529  }
2535 
2541 
2542  if( 0 != pincerRodHere() )
2543  {
2544  // Make hierarchy of rods, envelopes, blocks, shims, and cutouts
2545 
2546  DDSolid rodSolid ( DDSolidFactory::box( pincerRodName() ,
2547  pincerEnvWidth()/2.,
2548  pincerEnvHeight()/2.,
2549  ilyLength/2 ) ) ;
2550  const DDLogicalPart rodLog ( pincerRodName(), pincerRodMat(), rodSolid ) ;
2551 
2552  DDSolid envSolid ( DDSolidFactory::box( pincerEnvName() ,
2553  pincerEnvWidth()/2.,
2554  pincerEnvHeight()/2.,
2555  pincerEnvLength()/2 ) ) ;
2556  const DDLogicalPart envLog ( pincerEnvName(), pincerEnvMat(), envSolid ) ;
2557  const std::vector<double>& envParms ( envSolid.parameters() ) ;
2558 
2559  DDSolid blkSolid ( DDSolidFactory::box( pincerBlkName() ,
2560  pincerEnvWidth()/2.,
2561  pincerEnvHeight()/2.,
2562  pincerBlkLength()/2 ) ) ;
2563  const DDLogicalPart blkLog ( pincerBlkName(), pincerBlkMat(), blkSolid ) ;
2564  const std::vector<double>& blkParms ( blkSolid.parameters() ) ;
2565  cpv.position( blkLog,
2566  pincerEnvName(),
2567  copyOne,
2569  DDRotation() ) ;
2570 
2571  DDSolid cutSolid ( DDSolidFactory::box( pincerCutName() ,
2572  pincerCutWidth()/2.,
2573  pincerCutHeight()/2.,
2574  pincerBlkLength()/2 ) ) ;
2575  const DDLogicalPart cutLog ( pincerCutName(), pincerCutMat(), cutSolid ) ;
2576  const std::vector<double>& cutParms ( cutSolid.parameters() ) ;
2577  cpv.position( cutLog,
2578  pincerBlkName(),
2579  copyOne,
2580  DDTranslation( +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(),
2581  -blkParms[1] + cutParms[1], 0 ),
2582  DDRotation() ) ;
2583 
2584  DDSolid shim2Solid ( DDSolidFactory::box( pincerShim2Name() ,
2585  pincerShim2Width()/2.,
2586  pincerShimHeight()/2.,
2587  pincerBlkLength()/2 ) ) ;
2588  const DDLogicalPart shim2Log ( pincerShim2Name(), pincerShimMat(), shim2Solid ) ;
2589  const std::vector<double>& shim2Parms ( shim2Solid.parameters() ) ;
2590  cpv.position( shim2Log,
2591  pincerCutName(),
2592  copyOne,
2593  DDTranslation( +cutParms[0] - shim2Parms[0],
2594  -cutParms[1] + shim2Parms[1], 0 ),
2595  DDRotation() ) ;
2596 
2597  DDSolid shim1Solid ( DDSolidFactory::box( pincerShim1Name() ,
2598  pincerShim1Width()/2.,
2599  pincerShimHeight()/2.,
2600  (pincerEnvLength()-
2601  pincerBlkLength())/2 ) ) ;
2602 
2603  const DDLogicalPart shim1Log ( pincerShim1Name(), pincerShimMat(), shim1Solid ) ;
2604  const std::vector<double>& shim1Parms ( shim1Solid.parameters() ) ;
2605  cpv.position( shim1Log,
2606  pincerEnvName(),
2607  copyOne,
2608  DDTranslation( +envParms[0] - shim1Parms[0],
2609  -envParms[1] + shim1Parms[1],
2610  -envParms[2] + shim1Parms[2] ),
2611  DDRotation() ) ;
2612 
2613  for( unsigned int iEnv ( 0 ) ; iEnv != vecPincerEnvZOff().size() ; ++iEnv )
2614  {
2615  cpv.position( envLog,
2616  pincerRodName(),
2617  1+iEnv,
2618  DDTranslation(0,0, -ilyLength/2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength()/2. ),
2619  DDRotation() ) ;
2620  }
2621 
2622  // Place the rods
2623 // const double radius ( fawRadOff() - pincerEnvHeight()/2 -1*mm ) ;
2624  const double radius ( ilyRMin - pincerEnvHeight()/2 - 1*mm ) ;
2625 
2626  const DDName xilyName ( ddname( ilyName() +
2627  std::to_string(vecIlyMat().size()-1) ) ) ;
2628 
2629  for( unsigned int iRod ( 0 ) ; iRod != vecPincerRodAzimuth().size() ; ++iRod )
2630  {
2631  const DDTranslation rodTra ( radius*cos(vecPincerRodAzimuth()[iRod]) ,
2632  radius*sin(vecPincerRodAzimuth()[iRod]) ,
2633  0 ) ;
2634 
2635  cpv.position( rodLog,
2636  xilyName,
2637  1+iRod,
2638  rodTra,
2639  myrot( pincerRodName().name() + std::to_string(iRod),
2640  CLHEP::HepRotationZ( 90*deg + vecPincerRodAzimuth()[iRod] ) ) ) ;
2641  }
2642  }
2648 
2649  }
2650  }
2651 
2652  LogDebug("EcalGeom") << "******** DDEcalBarrelAlgo test: end it..." ;
2653 }
2654 
2656 DDRotation
2658  const CLHEP::HepRotation& r ) const
2659 {
2660  return DDrot( ddname( m_idNameSpace + ":" + s ), std::make_unique<DDRotationMatrix>( r.xx(), r.xy(), r.xz(), r.yx(), r.yy(), r.yz(), r.zx(), r.zy(), r.zz() ) ) ;
2661 }
2662 
2663 
2664 DDMaterial
2666 {
2667  return DDMaterial( ddname( s ) ) ;
2668 }
2669 
2670 DDName
2672 {
2673  const pair<std::string,std::string> temp ( DDSplit(s) ) ;
2674  if ( temp.second.empty() ) {
2675  return DDName( temp.first,
2676  m_idNameSpace ) ;
2677  } else {
2678  return DDName( temp.first, temp.second );
2679  }
2680 }
2681 
2682 DDSolid
2684  const EcalTrapezoidParameters& t ) const
2685 {
2686  return DDSolidFactory::trap( ddname( s ),
2687  t.dz(),
2688  t.theta(),
2689  t.phi(),
2690  t.h1(),
2691  t.bl1(),
2692  t.tl1(),
2693  t.alp1(),
2694  t.h2(),
2695  t.bl2(),
2696  t.tl2(),
2697  t.alp2() ) ;
2698 }
2699 
2700 void
2701 DDEcalBarrelAlgo::web( unsigned int iWeb,
2702  double bWeb,
2703  double BWeb,
2704  double LWeb,
2705  double theta,
2706  const HepGeom::Point3D<double> & corner,
2707  const DDLogicalPart& logPar,
2708  double& zee,
2709  double side,
2710  double front,
2711  double delta,
2712  DDCompactView& cpv )
2713 {
2714  const unsigned int copyOne (1) ;
2715 
2716  const double LWebx ( vecWebLength()[iWeb] ) ;
2717 
2718  const double BWebx ( bWeb + ( BWeb - bWeb )*LWebx/LWeb ) ;
2719 
2720  const double thick ( vecWebPlTh()[iWeb] + vecWebClrTh()[iWeb] ) ;
2721  const Trap trapWebClr (
2722  BWebx/2, // A/2
2723  bWeb/2, // a/2
2724  bWeb/2, // b/2
2725  thick/2, // H/2
2726  thick/2, // h/2
2727  LWebx/2, // L/2
2728  90*deg, // alfa1
2729  bWeb - BWebx , // x15
2730  0 // y15
2731  ) ;
2732  const DDName webClrDDName ( webClrName() + std::to_string( iWeb ) ) ;
2733  const DDSolid webClrSolid ( mytrap( webClrDDName.name(), trapWebClr ) ) ;
2734  const DDLogicalPart webClrLog ( webClrDDName, webClrMat(), webClrSolid ) ;
2735 
2736  const Trap trapWebPl (
2737  trapWebClr.A()/2, // A/2
2738  trapWebClr.a()/2, // a/2
2739  trapWebClr.b()/2, // b/2
2740  vecWebPlTh()[iWeb]/2, // H/2
2741  vecWebPlTh()[iWeb]/2, // h/2
2742  trapWebClr.L()/2., // L/2
2743  90*deg, // alfa1
2744  trapWebClr.b() - trapWebClr.B() , // x15
2745  0 // y15
2746  ) ;
2747  const DDName webPlDDName ( webPlName() + std::to_string( iWeb ) ) ;
2748  const DDSolid webPlSolid ( mytrap( webPlDDName.fullname(), trapWebPl ) ) ;
2749  const DDLogicalPart webPlLog ( webPlDDName, webPlMat(), webPlSolid ) ;
2750 
2751  cpv.position( webPlLog, // place plate inside clearance volume
2752  webClrDDName,
2753  copyOne,
2754  DDTranslation(0,0,0),
2755  DDRotation() ) ;
2756 
2757  const Trap::VertexList vWeb ( trapWebClr.vertexList() ) ;
2758 
2759  zee += trapWebClr.h()/sin(theta) ;
2760 
2761  const double beta ( theta + delta ) ;
2762 
2763  const double zWeb ( zee - front*cos(beta) + side*sin(beta) ) ;
2764  const double yWeb ( front*sin(beta) + side*cos(beta) ) ;
2765 
2766  const Pt3D wedge3 ( corner + Pt3D( 0, -yWeb, zWeb ) ) ;
2767  const Pt3D wedge2 ( wedge3 + Pt3D( 0,
2768  trapWebClr.h()*cos(theta),
2769  -trapWebClr.h()*sin(theta) ) ) ;
2770  const Pt3D wedge1 ( wedge3 + Pt3D( trapWebClr.a(), 0, 0 ) ) ;
2771 
2772  LogDebug("EcalGeom")<<"trap1="<<vWeb[0]<<", trap2="<<vWeb[2]<<", trap3="<<vWeb[3] ;
2773 
2774  LogDebug("EcalGeom")<<"wedge1="<<wedge1<<", wedge2="<<wedge2<<", wedge3="<<wedge3 ;
2775 
2776  const Tf3D tForm ( vWeb[0], vWeb[2], vWeb[3],
2777  wedge1, wedge2, wedge3 ) ;
2778 
2779  if( 0 != webHere() )
2780  cpv.position( webClrLog,
2781  logPar,
2782  copyOne,
2783  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
2784  myrot( webClrLog.name().name() + std::to_string( iWeb ),
2785  tForm.getRotation() ) ) ;
2786 }
#define LogDebug(id)
std::vector< double > m_vecSpmBRota
double grMidSlotXOff() const
size
Write out results.
const std::vector< std::string > & vecBackMiscName() const
unsigned int spmNPerHalf() const
dbl * delta
Definition: mlp_gen.cc:36
double patchPanelHere() const
std::string m_IlyBndlMat
const std::string & backCoolTankName() const
double backCoolTankWaWidth() const
type
Definition: HCALResponse.h:21
DDMaterial ilyBndlMat() const
unsigned int m_MBCoolTubeNum
std::string m_BackCoolTankMat
const std::vector< double > & vecSpmTran() const
const std::vector< std::string > & vecMBLyrName() const
std::string m_GridName
std::string m_SpmSideMat
unsigned int m_SpmNPerHalf
HepGeom::Transform3D Tf3D
const std::vector< double > & vecSpmRMin() const
const std::string & clrName() const
double ilyFEMWidth() const
double backHere() const
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:144
~DDEcalBarrelAlgo() override
const std::vector< double > & vecBackCoolNSec() const
DDMaterial ilyDiffMat() const
DDMaterial backSideMat() const
DDName fawName() const
std::string m_WebPlName
double backPlate2Thick() const
DDMaterial mBManifMat() const
const std::string & backPipeName() const
const std::vector< double > & vecIlyPipeLength() const
double pincerEnvLength() const
double grilleZSpace() const
std::string m_BackVFEName
DDMaterial ilyFEMMat() const
double ilyDelPhi() const
double backPlateThick() const
void execute(DDCompactView &cpv) override
std::string m_SpmName
double apdX1() const
const N & name() const
Definition: DDBase.h:74
DDName mBManifName() const
CLHEP::HepRotation Rota
std::string m_BackCoolTankWaName
std::vector< double > m_vecIlyPipeLength
double backPlateHere() const
std::string m_APDName
std::string m_BackPipeMat
std::vector< double > m_vecIlyFanOutPhi
const std::vector< double > & vecBackCoolSecSep() const
double grEdgeSlotHere() const
double hawRCutDelY() const
double pincerBlkLength() const
const std::vector< double > & vecNomCryDimBR() const
double apdX2() const
double fawPhiRot() const
double wallThAlv() const
std::string m_IlyDiffName
double spmCutThick() const
std::string m_IlyFanOutName
DDName pincerRodName() const
std::vector< double > m_vecWebLength
double ilyDiffLength() const
std::string m_DryAirTubeMat
DDMaterial webPlMat() const
double spmCutRM() const
double wrapReAlv() const
unsigned int nCryPerAlvEta() const
double fawRadOff() const
DDMaterial spmSideMat() const
double backMiscHere() const
std::string m_BarName
double underCF() const
DDMaterial is used to define and access material information.
Definition: DDMaterial.h:43
DDMaterial grEdgeSlotMat() const
DDMaterial backCoolTankMat() const
double wrapFrAlv() const
double apdHere() const
const std::vector< std::string > & vecBackVFELyrName() const
const std::string & mBCoolTubeName() const
double underLZ() const
std::string m_BackCoolBarSSName
const std::string & backCoolTankWaName() const
std::vector< double > m_vecSpmZPts
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 backSideYOff2() const
double grilleHere() const
double ilyPhiLow() 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:713
double hawRhsml() const
std::vector< std::string > m_vecPatchPanelMat
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
DDMaterial ddmat(const std::string &s) const
std::vector< double > m_vecBarZPts
double backCoolBarHeight() const
std::vector< double > m_vecBackMiscThick
double backSideHere() const
double ilyBndlLength() const
double wallFrAlv() const
DDMaterial grilleMat() const
Geom::Theta< T > theta() const
DDMaterial backCoolBarSSMat() const
double backCoolVFEHere() const
const std::vector< double > & vecSpmRMax() const
double backPipeHere() const
std::string m_PincerShim2Name
DDName barName() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:15
std::vector< double > m_vecSpmRMin
const std::vector< double > & vecBarRota3() const
#define M_PI_2
std::vector< double > m_vecGrilleZOff
std::string m_CryName
double hawRCutZ() const
double wrapThAlv() const
std::string m_BackPipeWaterMat
std::string m_BarMat
std::string m_PincerShim1Name
DDMaterial backCoolTankWaMat() const
std::vector< double > m_vecGrilleHeight
std::string m_SpmSideName
std::vector< std::string > m_vecBackVFELyrMat
std::vector< double > m_vecIlyFEMPhi
static std::string & ns()
DDName backCoolBarSSName() const
std::string m_BackSideName
double backYOff() const
DDName gridName() const
std::string m_WrapName
double backSideLength() const
DDMaterial barMat() const
DDMaterial apdMat() const
DDName pincerEnvName() const
std::string m_WallName
DDMaterial backVFEMat() const
double pincerRodHere() const
DDName backVFEName() const
std::string m_WebPlMat
double mBManifOutDiam() const
double ilyFanOutHere() const
const std::vector< double > & vecNomCryDimBF() const
std::string m_IlyFEMMat
const std::vector< std::string > & vecPatchPanelNames() const
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:80
std::string m_FawName
DDName backPlate2Name() const
DDName grEdgeSlotName() const
std::string m_PincerRodMat
std::vector< double > m_vecBarRMax
std::string m_WallMat
std::string m_PincerCutMat
DDMaterial mBCoolTubeMat() const
std::string m_ClrMat
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
std::string m_GrEdgeSlotMat
DDName backSideName() const
double mBCoolTubeNum() const
double backPlateLength() const
std::vector< double > m_vecSpmTran
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
HepGeom::Point3D< double > Pt3D
double apdZ() const
const std::string & grilleName() const
std::vector< double > m_vecIlyPTMZ
const std::vector< double > & vecIlyPTMZ() const
std::string m_BackPlate2Name
unsigned int m_NFawPerSupm
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:68
std::vector< double > m_vecBarRota2
std::string m_BackPipeName
double nomCryDimLZ() const
const std::vector< double > & vecSpmBTran() const
std::string m_idNameSpace
DDName ilyFEMName() const
double ilyPTMHere() const
std::string m_IlyFanOutMat
std::string m_PincerShimMat
std::vector< double > m_vecBackCoolNPerSec
double fawPhiOff() const
std::vector< double > m_vecSpmCutTM
const std::vector< double > & vecMBLyrThick() const
DDSolid mytrap(const std::string &s, const Trap &t) const
std::vector< double > m_vecWebClrTh
DDMaterial backPipeMat() const
double pincerShim2Width() const
double backSideAngle() const
std::string m_ClrName
double ilyPipeHere() const
std::string m_GrMidSlotMat
double mBManifInnDiam() const
unsigned int m_NCryPerAlvEta
std::vector< double > m_vecBarRota
std::vector< double > m_vecBackCoolNSec
double ilyDiffOff() const
double backCoolBarWaThick() const
std::vector< double > m_vecNomCryDimCR
double backSideWidth() const
double spmSideYOffM() const
double ilyFanOutHeight() const
double hawYOffCry() const
unsigned int nCryTypes() const
std::string m_IlyName
std::vector< double > m_vecPatchPanelThick
std::string m_BackPlate2Mat
const std::string & webClrName() const
double grilleThick() const
std::string m_IlyDiffMat
DDMaterial pincerCutMat() const
std::vector< double > m_vecNomCryDimAR
HepGeom::RotateZ3D RoZ3D
const std::vector< std::string > & vecBackCoolName() const
unsigned int m_NCryTypes
std::vector< std::string > m_vecIlyMat
DDMaterial webClrMat() const
std::string m_IlyPTMMat
std::vector< double > m_vecBackPipeThick
double pincerCutWidth() const
std::string m_IlyPipeName
DDMaterial backCoolBarWaMat() const
DDName ilyBndlName() const
const std::string & backBracketName() const
const std::vector< double > & vecBackCoolNPerSec() const
const std::string & ilyPipeName() const
T sqrt(T t)
Definition: SSEVec.h:18
double grMidSlotHere() const
double mBCoolTubeInnDiam() const
double underBR() const
double spmExpYOff() const
double mBCoolTubeHere() const
double backCoolTankHere() const
DDMaterial backPlateMat() const
DDName pincerShim1Name() const
double backSideYOff1() const
std::string m_MBCoolTubeMat
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::string m_IlyPTMName
std::vector< double > m_vecPincerRodAzimuth
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs) override
const std::vector< double > & vecBackPipeDiam() const
double hawRCutY() const
CLHEP::Hep3Vector Vec3
std::string m_IlyFEMName
const std::vector< std::string > & vecBackVFELyrMat() const
double pincerEnvWidth() const
double mBCoolTubeOutDiam() const
const std::vector< double > & vecIlyFanOutPhi() const
std::vector< std::string > m_vecMBLyrMat
double webHere() const
const std::vector< double > & vecBarTran() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:93
DDRotation DDrot(const DDName &name, std::unique_ptr< DDRotationMatrix > rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:80
const std::vector< double > & vecSpmCutTM() const
double ilyPipeOD() const
static DDSolid tubs(const DDName &name, double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
Definition: DDSolid.cc:865
double underBF() const
const std::vector< double > & vecNomCryDimCR() const
double grMidSlotWidth() const
double ilyFEMHeight() const
DDMaterial ilyFanOutMat() const
double backXOff() const
std::vector< double > m_vecIlyThick
const std::vector< double > & vecIlyPTMPhi() const
unsigned int nFawPerSupm() const
DDMaterial backBracketMat() const
double nomCryDimAF() const
std::vector< double > m_vecIlyPipePhi
double spmExpWide() const
double dryAirTubeInnDiam() const
const std::vector< double > & vecBarRota() const
DDName ilyPTMName() const
double fawDelPhi() 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:792
double spmExpThick() const
double apdSide() const
std::string m_BackPlateMat
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:704
std::string m_PincerCutName
const std::vector< double > & vecBackPipeThick() const
DDMaterial pincerEnvMat() const
HepGeom::RotateX3D RoX3D
std::string m_MBCoolTubeName
double ilyFanOutLength() const
std::string m_BackCoolVFEName
std::vector< std::string > m_vecBackVFELyrName
double hawRHBIG() const
double grEdgeSlotWidth() const
std::vector< double > m_vecPincerEnvZOff
const std::string & webPlName() const
double barPhiHi() const
const std::vector< double > & vecSpmHere() const
std::string m_PincerEnvName
double fawHere() const
const std::vector< double > & vecNomCryDimCF() const
std::vector< double > m_vecBackVFELyrThick
std::string m_BackCoolTankWaMat
std::vector< double > m_vecBackCoolSecSep
const std::string & wrapName() const
double grEdgeSlotHeight() const
const std::vector< double > & vecBarRMax() const
std::vector< double > m_vecNomCryDimBF
const std::string & wallName() const
std::string m_BackBracketName
std::string m_BackCoolMat
DDName backCoolBarWaName() const
double barPhiLo() const
std::string m_PincerRodName
std::string m_GrilleMat
double backSideHeight() const
double ilyFEMLength() const
std::string m_BackCoolTankName
const std::vector< double > & vecBarRota2() const
DDMaterial ilyPTMMat() const
const std::string & grMidSlotName() const
DDMaterial backCoolBarMat() const
const std::vector< std::string > & vecIlyMat() const
std::string m_BackCoolBarSSMat
double mBManifHere() const
std::string m_BackCoolBarName
std::vector< double > m_vecBarRMin
double ilyHere() const
std::string m_GrilleName
DDMaterial wrapMat() const
std::vector< double > m_vecNomCryDimBR
const std::vector< double > & vecIlyPipeZ() const
DDName hawRName() const
std::vector< double > m_vecNomCryDimCF
std::vector< std::string > m_vecBackMiscMat
std::vector< std::string > m_vecMBLyrName
DDName apdName() const
std::vector< double > m_vecIlyFanOutZ
const std::vector< double > & vecBarRMin() const
const std::string & dryAirTubeName() const
DDMaterial wallMat() const
std::vector< double > m_vecIlyPipeZ
const std::vector< double > & vecBackMiscThick() const
double backCoolBarHere() const
static DDSolid subtraction(const DDName &name, const DDSolid &a, const DDSolid &b, const DDTranslation &t, const DDRotation &r)
Definition: DDSolid.cc:774
const std::vector< double > & vecSpmZPts() const
const std::vector< double > & vecIlyFEMZ() const
std::vector< double > m_vecSpmCutTP
DDMaterial gridMat() const
const std::vector< double > & vecSpmCutTP() const
const std::string & ilyName() const
double spmLowPhi() const
DDMaterial grMidSlotMat() const
std::string m_PincerBlkMat
const std::vector< double > & vecSpmRota() const
std::vector< std::string > m_vecPatchPanelNames
void position(const DDLogicalPart &self, const DDLogicalPart &parent, const std::string &copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=0)
const std::string & cryName() const
double ilyPTMHeight() const
const std::vector< double > & vecNomCryDimAR() const
std::vector< double > m_vecSpmRMax
double pincerShimHeight() const
double clrFrAlv() const
std::vector< double > m_vecSpmBTran
double underAF() const
double spmSideYOffP() const
std::string m_SpmCutName
DDName backPlateName() const
std::vector< double > m_vecIlyPTMPhi
double spmCutRP() const
std::string m_GrEdgeSlotName
double barHere() const
const std::vector< std::string > & vecPatchPanelMat() const
DDName backCoolVFEName() const
DDName spmSideName() const
std::string m_PincerBlkName
std::string m_BackCoolBarWaMat
DDMaterial backPlate2Mat() const
double gridHere() const
std::string m_IlyBndlName
std::string m_CryMat
std::string m_BackPlateName
double backCoolBarSSThick() const
std::vector< double > m_vecIlyPipeType
double wallReAlv() const
const std::vector< std::string > & vecBackMiscMat() const
std::vector< double > m_vecGapAlvEta
std::string m_HawRName
DDMaterial dryAirTubeMat() const
double ilyPipeID() const
std::string m_PincerEnvMat
DDMaterial spmMat() const
std::vector< double > m_vecWebPlTh
DDName ddname(const std::string &s) const
double backCBStdSep() const
std::string m_GridMat
double clrReAlv() const
double dryAirTubeHere() const
std::string m_BackCoolVFEMat
std::string m_WebClrName
const std::vector< double > & vecIlyPipeType() const
std::vector< double > m_vecMBLyrThick
DDMaterial pincerShimMat() const
std::string m_MBManifMat
std::vector< double > m_vecGrMidSlotHeight
std::string m_BackVFEMat
std::string m_BackCoolBarMat
std::string m_BackSideMat
const std::vector< double > & vecWebClrTh() const
double underAR() const
std::vector< double > vecPincerRodAzimuth() const
DDMaterial pincerBlkMat() const
std::vector< double > m_vecIlyFEMZ
std::string m_APDMat
double backBracketHeight() const
std::pair< std::string, std::string > DDSplit(const std::string &n)
split into (name,namespace), separator = &#39;:&#39;
Definition: DDSplit.cc:3
std::string m_MBManifName
const std::vector< double > & vecBackVFELyrThick() const
std::string m_GrMidSlotName
double backCoolTankWidth() const
const std::vector< double > & vecGapAlvEta() const
const std::vector< double > & vecSpmBRota() const
const std::vector< double > & vecWebLength() const
double backCoolTankThick() const
double backCoolHere() const
DDMaterial cryMat() const
DDName pincerCutName() const
double ilyBndlOff() const
DDName pincerBlkName() const
const std::vector< double > & vecIlyFanOutZ() const
const std::vector< double > & vecGrilleHeight() const
const std::vector< double > & vecGrMidSlotHeight() const
double spmSideHigh() const
double pincerShim1Width() const
std::vector< double > vecPincerEnvZOff() const
DDMaterial backCoolVFEMat() const
std::vector< std::string > m_vecBackMiscName
std::string m_PatchPanelName
std::string m_DryAirTubeName
const std::vector< std::string > & vecMBLyrMat() const
double backPlateWidth() const
double spmDelPhi() const
double gridThick() const
DDName spmName() const
DDMaterial clrMat() const
std::string m_BackCoolBarWaName
DDMaterial ilyPipeMat() const
double backCoolBarWidth() const
int spmCutShow() const
const std::vector< double > & vecBarZPts() const
const std::vector< double > & vecIlyThick() const
HepGeom::Rotate3D Ro3D
DDName spmCutName() const
std::vector< double > m_vecSpmRota
DDName backCoolBarName() const
double dryAirTubeOutDiam() const
double pincerCutHeight() const
std::vector< double > m_vecBackPipeDiam
CaloCellGeometry::Pt3DVec VertexList
const std::vector< double > & vecGrilleZOff() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:53
double apdThick() const
const std::vector< double > & vecIlyPipePhi() const
double ilyPTMLength() const
double backCoolBarThick() const
DDName ilyDiffName() const
std::vector< double > m_vecSpmHere
double spmPhiOff() const
HepGeom::Translate3D Tl3D
DDName ilyFanOutName() 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)
double pincerEnvHeight() const
double clrThAlv() const
double ilyFanOutWidth() const
std::string m_BackBracketMat
std::vector< double > m_vecBarRota3
DDName pincerShim2Name() const
std::vector< double > m_vecBarTran
DDName patchPanelName() const
const std::vector< double > & vecPatchPanelThick() const
double ilyPTMWidth() const
double mBLyrHere() const
const std::vector< double > & vecWebPlTh() const
DDMaterial backPipeWaterMat() const
double spmSideThick() const
const std::vector< double > & vecIlyFEMPhi() const
DDMaterial pincerRodMat() const
std::string m_SpmMat
std::string m_IlyPipeMat
std::string m_WrapMat
std::vector< std::string > m_vecBackCoolName
std::string m_WebClrMat