test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 /* const DDName unionName ( ddname( m_SpmName + "UNI" ) ) ;
745  if( 0 != spmCutShow() )
746  {
747  cpv.position( expLog, spmName(), copyOne, expTra, DDRotation() ) ;
748  }
749  else
750  {
751  const DDSolid unionSolid ( DDSolidFactory::unionSolid(
752  unionName,
753  spmcut1ddname, expName,
754  expTra, DDRotation() ) ) ;
755  }*/
756 
757 
758  // Supermodule side platess
759  const DDSolid sideSolid ( DDSolidFactory::box(
760  spmSideName(),
761  spmSideHigh()/2.,
762  spmSideThick()/2.,
763  fabs( vecSpmZPts()[1] - vecSpmZPts()[0] )/2.) ) ;
764  const std::vector<double>& sideParms ( sideSolid.parameters() ) ;
765  const DDLogicalPart sideLog ( spmSideName(), spmSideMat(), sideSolid ) ;
766 
767  DDSolid temp1 ;
768  DDSolid temp2 ;
769  for( unsigned int icopy(1); icopy <= 2; ++icopy )
770  {
771  const std::vector<double>& tvec ( 1==icopy ? vecSpmCutTM() : vecSpmCutTP() ) ;
772  const double rang ( 1==icopy ? spmCutRM() : spmCutRP() ) ;
773 
774  const Tl3D tr ( tvec[0], tvec[1], tvec[2] );
775  const RoZ3D ro ( rang ) ;
776  const Tf3D alltrot (
777  RoZ3D( 1==icopy ? spmLowPhi() : spmLowPhi()+spmDelPhi() )*
778  Tl3D( ( vecSpmRMax()[indx]+vecSpmRMin()[indx])/2.,
779  0,
780  (vecSpmZPts().front()+ vecSpmZPts().back())/2.)*
781  tr*ro) ;
782 
783  const DDRotation ddrot ( myrot(spmCutName().name() +
784  std::to_string(icopy),
785  alltrot.getRotation() ) ) ;
786  const DDTranslation ddtra ( alltrot.getTranslation() ) ;
787 
788 
789  const Tl3D trSide ( tvec[0],
790  tvec[1] + ( 1==icopy ? 1. : -1. )*( cutBoxParms[1]+sideParms[1] )
791  + ( 1==icopy ? spmSideYOffM() : spmSideYOffP() ),
792  tvec[2] );
793  const RoZ3D roSide ( rang ) ;
794  const Tf3D sideRot (
795  RoZ3D( 1==icopy ? spmLowPhi() : spmLowPhi()+spmDelPhi() )*
796  Tl3D( vecSpmRMin().front() + sideParms[0] ,
797  0,
798  vecSpmZPts().front()+ sideParms[2] )*
799  trSide*roSide) ;
800 
801  const DDRotation sideddrot ( myrot(spmSideName().name() +
802  std::to_string(icopy),
803  sideRot.getRotation() ) ) ;
804  const DDTranslation sideddtra ( sideRot.getTranslation() ) ;
805 
806  cpv.position( sideLog,
807  spmName(),
808  icopy,
809  sideddtra,
810  sideddrot ) ;
811 
812 
813  if( 0 != spmCutShow() ) // do this if we are "showing" the boxes
814  {
815  cpv.position( spmCutLog,
816  spmName(),
817  icopy,
818  ddtra,
819  ddrot ) ;
820  }
821  else // do this if we are subtracting the boxes
822  {
823  if( 1 == icopy )
824  {
825  temp1 = DDSolidFactory::subtraction( DDName( m_SpmName+"_T1" ),
826  spmcut1ddname, spmCutBox,
827  ddtra, ddrot ) ;
828  }
829  else
830  {
832  temp1, spmCutBox,
833  ddtra, ddrot ) ;
834  }
835  }
836  }
837 
838  const DDLogicalPart spmLog (spmName(), spmMat(),
839  ((0 != spmCutShow()) ? ddspm : temp2) ) ;
840 
841  const double dphi ( 360.*deg/(1.*spmNPerHalf() ) ) ;
842  for( unsigned int iphi (0); iphi<2*spmNPerHalf() ; ++iphi )
843  {
844  const double phi ( iphi*dphi + spmPhiOff() ) ; //- 0.000130/deg ) ;
845 
846  // this base rotation includes the base translation & rotation
847  // plus flipping for the negative z hemisphere, plus
848  // the phi rotation for this module
849  const Tf3D rotaBase ( RoZ3D( phi )*
850  ( iphi < spmNPerHalf() ? Ro3D() :
851  RoX3D( 180.*deg ) )*
852  Ro3D( vecSpmBRota()[3],
853  Vec3( vecSpmBRota()[0],
854  vecSpmBRota()[1],
855  vecSpmBRota()[2]))*
856  Tl3D( Vec3( vecSpmBTran()[0],
857  vecSpmBTran()[1],
858  vecSpmBTran()[2] ))) ;
859 
860  // here the individual rotations & translations of the supermodule
861  // are implemented on top of the overall "base" rotation & translation
862 
863  const unsigned int offr ( 4*iphi ) ;
864  const unsigned int offt ( 3*iphi ) ;
865 
866  const Ro3D r1 ( vecSpmRota()[ offr+3],
867  Vec3(vecSpmRota()[offr+0],
868  vecSpmRota()[offr+1],
869  vecSpmRota()[offr+2] ) ) ;
870 
871  const Tf3D rotaExtra ( r1*Tl3D( Vec3(vecSpmTran()[offt+0],
872  vecSpmTran()[offt+1],
873  vecSpmTran()[offt+2] ) ) ) ;
874 
875  const Tf3D both ( rotaExtra*rotaBase ) ;
876 
877  const DDRotation rota ( myrot( spmName().name()+std::to_string(phi/deg),
878  both.getRotation() ) );
879 
880  if( vecSpmHere()[iphi] != 0 )
881  {
882  // convert from CLHEP to DDTranslation & etc. -- Michael Case
883  DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z());
884  cpv.position( spmLog,
885  barName(),
886  iphi+1,
887  myTran,
888  rota ) ;
889  }
890  }
891  // End Supermodule parent------------------------------------------------------------
892 
893  // Begin Inner Layer volumes---------------------------------------------------------
894  const double ilyLength ( vecSpmZPts()[1] - vecSpmZPts()[0] ) ;
895  double ilyRMin ( vecSpmRMin()[0] ) ;
896  double ilyThick ( 0 ) ;
897  for( unsigned int ilyx ( 0 ) ; ilyx != vecIlyThick().size() ; ++ilyx )
898  {
899  ilyThick += vecIlyThick()[ilyx] ;
900  }
901  const DDName ilyDDName ( ddname( ilyName() ) ) ;
902  const DDSolid ilySolid ( DDSolidFactory::tubs( ilyDDName,
903  ilyLength/2,
904  ilyRMin,
905  ilyRMin + ilyThick,
906  ilyPhiLow(),
907  ilyDelPhi() ) ) ;
908  const DDLogicalPart ilyLog ( ilyDDName, spmMat(), ilySolid ) ;
909  cpv.position( ilyLog,
910  spmLog,
911  copyOne,
912  DDTranslation(0,0, ilyLength/2 ),
913  DDRotation() ) ;
914 
915  DDLogicalPart ilyPipeLog[200] ;
916 
917  if( 0 != ilyPipeHere() )
918  {
919  for( unsigned int iPipeType ( 0 ) ; iPipeType != vecIlyPipeLength().size(); ++iPipeType )
920  {
921  const DDName pName ( ddname( ilyPipeName() + "_" +
922  std::to_string(iPipeType+1) ) ) ;
923 
924  DDSolid ilyPipeSolid ( DDSolidFactory::tubs( pName ,
925  vecIlyPipeLength()[iPipeType]/2.,
926  0,
927  ilyPipeOD()/2,
928  0*deg, 360*deg ) ) ;
929  ilyPipeLog[iPipeType] = DDLogicalPart( pName, ilyPipeMat(), ilyPipeSolid ) ;
930 
931  const DDName pWaName ( ddname( ilyPipeName() + "Wa_" +
932  std::to_string(iPipeType+1) ) ) ;
933  DDSolid ilyPipeWaSolid ( DDSolidFactory::tubs( pWaName ,
934  vecIlyPipeLength()[iPipeType]/2.,
935  0,
936  ilyPipeID()/2,
937  0*deg, 360*deg ) ) ;
938  const DDLogicalPart ilyPipeWaLog ( pWaName, backPipeWaterMat(), ilyPipeWaSolid ) ;
939 
940  cpv.position( ilyPipeWaLog,
941  pName,
942  copyOne,
943  DDTranslation(0,0,0),
944  DDRotation() ) ;
945  }
946  }
947 
948  DDSolid ilyPTMSolid ( DDSolidFactory::box( ilyPTMName(),
949  ilyPTMHeight()/2.,
950  ilyPTMWidth()/2.,
951  ilyPTMLength()/2. ) ) ;
952  const DDLogicalPart ilyPTMLog ( ilyPTMName(),
953  ilyPTMMat(),
954  ilyPTMSolid ) ;
955 
956  DDSolid ilyFanOutSolid ( DDSolidFactory::box( ilyFanOutName(),
957  ilyFanOutHeight()/2.,
958  ilyFanOutWidth()/2.,
959  ilyFanOutLength()/2. ) ) ;
960  const DDLogicalPart ilyFanOutLog ( ilyFanOutName(),
961  ilyFanOutMat(),
962  ilyFanOutSolid ) ;
963 
964  DDSolid ilyFEMSolid ( DDSolidFactory::box( ilyFEMName(),
965  ilyFEMHeight()/2.,
966  ilyFEMWidth()/2.,
967  ilyFEMLength()/2. ) ) ;
968  const DDLogicalPart ilyFEMLog ( ilyFEMName(),
969  ilyFEMMat(),
970  ilyFEMSolid ) ;
971 
972  DDSolid ilyDiffSolid ( DDSolidFactory::box( ilyDiffName(),
973  ilyFanOutHeight()/2.,
974  ilyFanOutWidth()/2.,
975  ilyDiffLength()/2. ) ) ;
976  const DDLogicalPart ilyDiffLog ( ilyDiffName(),
977  ilyDiffMat(),
978  ilyDiffSolid ) ;
979 
980  DDSolid ilyBndlSolid ( DDSolidFactory::box( ilyBndlName(),
981  ilyFanOutHeight()/2.,
982  ilyFanOutWidth()/2.,
983  ilyBndlLength()/2. ) ) ;
984  const DDLogicalPart ilyBndlLog ( ilyBndlName(),
985  ilyBndlMat(),
986  ilyBndlSolid ) ;
987  cpv.position( ilyDiffLog,
988  ilyFanOutName(),
989  copyOne,
991  DDRotation() ) ;
992  cpv.position( ilyBndlLog,
993  ilyFanOutName(),
994  copyOne,
996  DDRotation() ) ;
997 
998  for( unsigned int ily ( 0 ) ; ily != vecIlyThick().size() ; ++ily )
999  {
1000  const double ilyRMax ( ilyRMin + vecIlyThick()[ily] ) ;
1001  const DDName xilyName ( ddname( ilyName() + std::to_string(ily) ) ) ;
1002  const DDSolid xilySolid ( DDSolidFactory::tubs( xilyName,
1003  ilyLength/2,
1004  ilyRMin,
1005  ilyRMax,
1006  ilyPhiLow(),
1007  ilyDelPhi() ) ) ;
1008 
1009  const DDLogicalPart xilyLog ( xilyName, ddmat(vecIlyMat()[ily]), xilySolid ) ;
1010 
1011  if( 0 != ilyHere() )
1012  {
1013  cpv.position( xilyLog,
1014  ilyLog,
1015  copyOne,
1016  DDTranslation(0,0,0),
1017  DDRotation() ) ;
1018 
1019  unsigned int copyNum[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ;
1020 
1021  if( 10*mm < vecIlyThick()[ily] &&
1022  vecIlyThick().size() != (ily+1) &&
1023  0 != ilyPipeHere() )
1024  {
1025  if( 0 != ilyPTMHere() )
1026  {
1027  unsigned int ptmCopy ( 0 ) ;
1028  for( unsigned int ilyPTM ( 0 ) ; ilyPTM != vecIlyPTMZ().size() ; ++ilyPTM )
1029  {
1030  const double radius ( ilyRMax - 1*mm - ilyPTMHeight()/2. ) ;
1031  const double phi ( vecIlyPTMPhi()[ilyPTM] ) ;
1032  const double yy ( radius*sin(phi) ) ;
1033  const double xx ( radius*cos(phi) ) ;
1034  ++ptmCopy ;
1035  cpv.position( ilyPTMLog,
1036  xilyLog,
1037  ptmCopy,
1038  DDTranslation(xx,yy, vecIlyPTMZ()[ilyPTM] -ilyLength/2 ),
1039  myrot( ilyPTMLog.name().name() + "_rot" +
1040  std::to_string( ptmCopy ) , CLHEP::HepRotationZ( phi ) )) ;
1041  }
1042  }
1043  if( 0 != ilyFanOutHere() )
1044  {
1045  unsigned int fanOutCopy ( 0 ) ;
1046  for( unsigned int ilyFO ( 0 ) ; ilyFO != vecIlyFanOutZ().size() ; ++ilyFO )
1047  {
1048  const double radius ( ilyRMax - 1*mm - ilyFanOutHeight()/2. ) ;
1049  const double phi ( vecIlyFanOutPhi()[ilyFO] ) ;
1050  const double yy ( radius*sin(phi) ) ;
1051  const double xx ( radius*cos(phi) ) ;
1052  ++fanOutCopy ;
1053  cpv.position( ilyFanOutLog,
1054  xilyLog,
1055  fanOutCopy,
1056  DDTranslation(xx,yy, vecIlyFanOutZ()[ilyFO] -ilyLength/2 ),
1057  myrot( ilyFanOutLog.name().name() + "_rot" +
1058  std::to_string( fanOutCopy ) ,
1059  CLHEP::HepRotationZ( phi )*CLHEP::HepRotationY( 180*deg ) )) ;
1060  }
1061  unsigned int femCopy ( 0 ) ;
1062  for( unsigned int ilyFEM ( 0 ) ; ilyFEM != vecIlyFEMZ().size() ; ++ilyFEM )
1063  {
1064  const double radius ( ilyRMax - 1*mm - ilyFEMHeight()/2. ) ;
1065  const double phi ( vecIlyFEMPhi()[ilyFEM] ) ;
1066  const double yy ( radius*sin(phi) ) ;
1067  const double xx ( radius*cos(phi) ) ;
1068  ++femCopy ;
1069  cpv.position( ilyFEMLog,
1070  xilyLog,
1071  femCopy,
1072  DDTranslation(xx,yy, vecIlyFEMZ()[ilyFEM] -ilyLength/2 ),
1073  myrot( ilyFEMLog.name().name() + "_rot" +
1074  std::to_string( femCopy ) , CLHEP::HepRotationZ( phi ) )) ;
1075  }
1076  }
1077  for( unsigned int iPipe ( 0 ) ; iPipe != vecIlyPipePhi().size(); ++iPipe )
1078  {
1079  const unsigned int type ( static_cast<unsigned int> ( round( vecIlyPipeType()[iPipe] ) ) ) ;
1080 // std::cout<<" iPipe, type= " << iPipe << ", " << type << std::endl ;
1081  const double zz ( -ilyLength/2 + vecIlyPipeZ()[iPipe] +
1082  ( 9>type ? vecIlyPipeLength()[type]/2. : 0 ) ) ;
1083 
1084  for( unsigned int ly ( 0 ) ; ly != 2 ; ++ly )
1085  {
1086  const double radius ( 0 == ly ? ilyRMin + ilyPipeOD()/2. + 1*mm :
1087  ilyRMax - ilyPipeOD()/2. - 1*mm ) ;
1088  const double phi ( vecIlyPipePhi()[iPipe] ) ;
1089  const double yy ( radius*sin(phi) ) ;
1090  const double xx ( radius*cos(phi) ) ;
1091  ++copyNum[type],
1092  cpv.position( ilyPipeLog[type],
1093  xilyLog,
1094  copyNum[type],
1095  DDTranslation(xx,yy,zz),
1096  ( 9 > type ? DDRotation() :
1097  myrot( ilyPipeLog[type].name().name() + "_rot" +
1098  std::to_string( copyNum[type] ) , Rota( Vec3(xx,yy,0), 90*deg) ) ) ) ;
1099  }
1100  }
1101  }
1102  }
1103  ilyRMin = ilyRMax ;
1104  }
1105  // End Inner Layer volumes---------------------------------------------------------
1106 
1107  const DDName clyrName ( DDName( "ECLYR" ) ) ;
1108  std::vector<double> cri;
1109  std::vector<double> cro;
1110  std::vector<double> czz;
1111  czz.push_back( vecSpmZPts()[1] ) ;
1112  cri.push_back( vecSpmRMin()[0] ) ;
1113  cro.push_back( vecSpmRMin()[0] + 25*mm ) ;
1114  czz.push_back( vecSpmZPts()[2] ) ;
1115  cri.push_back( vecSpmRMin()[2] ) ;
1116  cro.push_back( vecSpmRMin()[2] + 10*mm ) ;
1117  const DDSolid clyrSolid ( DDSolidFactory::polycone( clyrName, -9.5*deg, 19*deg, czz,cri,cro) ) ;
1118  const DDLogicalPart clyrLog ( clyrName, ddmat(vecIlyMat()[4]), clyrSolid ) ;
1119  cpv.position( clyrLog, spmLog, copyOne, DDTranslation(0,0,0), DDRotation() ) ;
1120 
1121  // Begin Alveolar Wedge parent ------------------------------------------------------
1122 //----------------
1123 
1124  // the next few lines accumulate dimensions appropriate to crystal type 1
1125  // which we use to set some of the features of the half-alveolar wedge (hawR).
1126 
1127 // const double ANom1 ( vecNomCryDimAR()[0] ) ;
1128  const double BNom1 ( vecNomCryDimCR()[0] ) ;
1129  const double bNom1 ( vecNomCryDimCF()[0] ) ;
1130 // const double HNom1 ( vecNomCryDimBR()[0] ) ;
1131 // const double hNom1 ( vecNomCryDimBF()[0] ) ;
1132  const double sWall1( wallThAlv() ) ;
1133  const double fWall1( wallFrAlv() ) ;
1134 // const double rWall1( wallReAlv() ) ;
1135  const double sWrap1( wrapThAlv() ) ;
1136  const double fWrap1( wrapFrAlv() ) ;
1137 // const double rWrap1( wrapReAlv() ) ;
1138  const double sClr1 ( clrThAlv() ) ;
1139  const double fClr1 ( clrFrAlv() ) ;
1140 // const double rClr1 ( clrReAlv() ) ;
1141  const double LNom1 ( nomCryDimLZ() ) ;
1142  const double beta1 ( atan( ( BNom1 - bNom1 )/LNom1 ) ) ;
1143 // const double cosbeta1 ( cos( beta1 ) ) ;
1144  const double sinbeta1 ( sin( beta1 ) ) ;
1145 
1146  const double tana_hawR ( ( BNom1 - bNom1 )/LNom1 ) ;
1147 
1148  const double H_hawR ( hawRHBIG() ) ;
1149  const double h_hawR ( hawRhsml() ) ;
1150  const double a_hawR ( bNom1 + sClr1 + 2*sWrap1 + 2*sWall1
1151  - sinbeta1*( fClr1 + fWrap1 + fWall1 ) ) ;
1152  const double B_hawR ( a_hawR + H_hawR*tana_hawR ) ;
1153  const double b_hawR ( a_hawR + h_hawR*tana_hawR ) ;
1154  const double L_hawR ( vecSpmZPts()[2] ) ;
1155 
1156  const Trap trapHAWR (
1157  a_hawR/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1158  a_hawR/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1159  b_hawR/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1160  H_hawR/2., //double aHalfLengthYNegZ , // h1, H/2
1161  h_hawR/2., //double aHalfLengthYPosZ , // h2, h/2
1162  L_hawR/2., //double aHalfLengthZ , // dz, L/2
1163  90*deg, //double aAngleAD , // alfa1
1164  0, //double aCoord15X , // x15
1165  0 //double aCoord15Y // y15
1166  ) ;
1167 
1168  const DDName hawRName1 ( ddname( hawRName().name() + "1") ) ;
1169  const DDSolid hawRSolid1 ( mytrap(hawRName1.name(), trapHAWR ) ) ;
1170  const DDLogicalPart hawRLog1 ( hawRName1, spmMat(), hawRSolid1 ) ;
1171 
1172  const double al1_fawR ( atan( ( B_hawR - a_hawR )/H_hawR ) + M_PI_2 ) ;
1173 
1174  // here is trap for Full Alveolar Wedge
1175  const Trap trapFAW (
1176  a_hawR, //double aHalfLengthXNegZLoY , // bl1, A/2
1177  a_hawR, //double aHalfLengthXPosZLoY , // bl2, a/2
1178  b_hawR, //double aHalfLengthXPosZHiY , // tl2, b/2
1179  H_hawR/2., //double aHalfLengthYNegZ , // h1, H/2
1180  h_hawR/2., //double aHalfLengthYPosZ , // h2, h/2
1181  L_hawR/2., //double aHalfLengthZ , // dz, L/2
1182  al1_fawR, //double aAngleAD , // alfa1
1183  0, //double aCoord15X , // x15
1184  0 //double aCoord15Y // y15
1185  ) ;
1186 
1187  const DDName fawName1 ( ddname( fawName().name() + "1") ) ;
1188  const DDSolid fawSolid1 ( mytrap( fawName1.name(), trapFAW ) ) ;
1189  const DDLogicalPart fawLog1 ( fawName1, spmMat(), fawSolid1 ) ;
1190 
1191  const Trap::VertexList vHAW ( trapHAWR.vertexList() ) ;
1192  const Trap::VertexList vFAW ( trapFAW.vertexList() ) ;
1193 
1194  const double hawBoxClr ( 1*mm ) ;
1195 
1196  // HAW cut box to cut off back end of wedge
1197  const DDName hawCutName ( ddname( hawRName().name() + "CUTBOX" ) ) ;
1198  const DDSolid hawCutBox ( DDSolidFactory::box(
1199  hawCutName,
1200  b_hawR/2 + hawBoxClr,
1201  hawRCutY()/2,
1202  hawRCutZ()/2 ) ) ;
1203  const std::vector<double>& hawBoxParms ( hawCutBox.parameters() ) ;
1204  const DDLogicalPart hawCutLog ( hawCutName, spmMat(), hawCutBox ) ;
1205 
1206  const Pt3D b1 ( hawBoxParms[0], hawBoxParms[1], hawBoxParms[2] ) ;
1207  const Pt3D b2 ( -hawBoxParms[0], hawBoxParms[1], hawBoxParms[2] ) ;
1208  const Pt3D b3 ( -hawBoxParms[0], hawBoxParms[1], -hawBoxParms[2] ) ;
1209 
1210  const double zDel ( sqrt( 4*hawBoxParms[2]*hawBoxParms[2]
1211  -(h_hawR-hawRCutDelY())*(h_hawR-hawRCutDelY()) ) ) ;
1212 
1213  const Tf3D hawCutForm (
1214  b1, b2, b3,
1215  vHAW[2] + Pt3D( hawBoxClr, -hawRCutDelY(), 0),
1216  vHAW[1] + Pt3D(-hawBoxClr, -hawRCutDelY(), 0),
1217  Pt3D( vHAW[0].x() -hawBoxClr, vHAW[0].y(), vHAW[0].z() - zDel ) ) ;
1218 
1219  const DDSolid hawRSolid ( DDSolidFactory::subtraction(
1220  hawRName(),
1221  hawRSolid1, hawCutBox,
1222  DDTranslation(hawCutForm.getTranslation().x(), hawCutForm.getTranslation().y(), hawCutForm.getTranslation().z()),
1223  myrot( hawCutName.name()+"R",
1224  hawCutForm.getRotation() ) ) ) ;
1225  const DDLogicalPart hawRLog ( hawRName(), spmMat(), hawRSolid ) ;
1226 
1227  // FAW cut box to cut off back end of wedge
1228  const DDName fawCutName ( ddname( fawName().name() + "CUTBOX") ) ;
1229  const DDSolid fawCutBox ( DDSolidFactory::box(
1230  fawCutName,
1231  2*hawBoxParms[0],
1232  hawBoxParms[1],
1233  hawBoxParms[2] ) ) ;
1234 
1235  const std::vector<double>& fawBoxParms ( fawCutBox.parameters() ) ;
1236  const DDLogicalPart fawCutLog ( fawCutName, spmMat(), fawCutBox ) ;
1237 
1238  const Pt3D bb1 ( fawBoxParms[0], fawBoxParms[1], fawBoxParms[2] ) ;
1239  const Pt3D bb2 ( -fawBoxParms[0], fawBoxParms[1], fawBoxParms[2] ) ;
1240  const Pt3D bb3 ( -fawBoxParms[0], fawBoxParms[1], -fawBoxParms[2] ) ;
1241 
1242  const Tf3D fawCutForm (
1243  bb1, bb2, bb3,
1244  vFAW[2] + Pt3D( 2*hawBoxClr,-5*mm,0),
1245  vFAW[1] + Pt3D(-2*hawBoxClr,-5*mm,0),
1246  Pt3D( vFAW[1].x()-2*hawBoxClr, vFAW[1].y()-trapFAW.h(), vFAW[1].z() - zDel ) ) ;
1247 
1248  const DDSolid fawSolid ( DDSolidFactory::subtraction(
1249  fawName(),
1250  fawSolid1, fawCutBox,
1251  DDTranslation(fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()) ,
1252  myrot( fawCutName.name()+"R",
1253  fawCutForm.getRotation() ) ) ) ;
1254  const DDLogicalPart fawLog ( fawName(), spmMat(), fawSolid ) ;
1255 
1256 
1257  const Tf3D hawRform ( vHAW[3], vHAW[0], vHAW[1], // HAW inside FAW
1258  vFAW[3], 0.5*(vFAW[0]+vFAW[3]), 0.5*(vFAW[1]+vFAW[2] ) ) ;
1259  cpv.position( hawRLog,
1260  fawLog,
1261  copyOne,
1262  DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()),
1263  myrot( hawRName().name()+"R",
1264  hawRform.getRotation() ) ) ;
1265 
1266  cpv.position( hawRLog,
1267  fawLog,
1268  copyTwo,
1269  DDTranslation( -hawRform.getTranslation().x(),
1270  -hawRform.getTranslation().y(),
1271  -hawRform.getTranslation().z() ),
1272  myrot( hawRName().name()+"RotRefl",
1273  CLHEP::HepRotationY(180*deg)* // rotate about Y after refl thru Z
1274  CLHEP::HepRep3x3(1,0,0, 0,1,0, 0,0,-1) ) ) ;
1275 
1276 /* this for display of haw cut box instead of subtraction
1277  cpv.position( hawCutLog,
1278  hawRName,
1279  copyOne,
1280  hawCutForm.getTranslation(),
1281  myrot( hawCutName.name()+"R",
1282  hawCutForm.getRotation() ) ) ;
1283 */
1284 
1285  for( unsigned int iPhi ( 1 ); iPhi <= nFawPerSupm() ; ++iPhi )
1286  {
1287  const double rPhi ( fawPhiOff() + ( iPhi - 0.5 )*fawDelPhi() ) ;
1288 
1289  const Tf3D fawform ( RoZ3D( rPhi )*
1290  Tl3D( fawRadOff() + ( trapFAW.H() + trapFAW.h() )/4 ,
1291  0,
1292  trapFAW.L()/2 )*
1293  RoZ3D( -90*deg + fawPhiRot() ) ) ;
1294  if( fawHere() )
1295  cpv.position( fawLog,
1296  spmLog,
1297  iPhi,
1298  DDTranslation(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z() ),
1299  myrot( fawName().name()+"_Rot" + std::to_string(iPhi),
1300  fawform.getRotation() ) ) ;
1301  }
1302 
1303  // End Alveolar Wedge parent ------------------------------------------------------
1304 
1305  // Begin Grid + Tablet insertion
1306 
1307  const double h_Grid ( gridThick() ) ;
1308 
1309  const Trap trapGrid (
1310  ( B_hawR - h_Grid*( B_hawR - a_hawR )/H_hawR )/2, // bl1, A/2
1311  ( b_hawR - h_Grid*( B_hawR - a_hawR )/H_hawR )/2, // bl2, a/2
1312  b_hawR/2., // tl2, b/2
1313  h_Grid/2., // h1, H/2
1314  h_Grid/2., // h2, h/2
1315  (L_hawR-8*cm)/2., // dz, L/2
1316  90*deg, // alfa1
1317  0, // x15
1318  H_hawR - h_hawR // y15
1319  ) ;
1320 
1321  const DDSolid gridSolid ( mytrap( gridName().name(), trapGrid ) ) ;
1322  const DDLogicalPart gridLog ( gridName(), gridMat(), gridSolid ) ;
1323 
1324  const Trap::VertexList vGrid ( trapGrid.vertexList() ) ;
1325 
1326  const Tf3D gridForm ( vGrid[4], vGrid[5], vGrid[6], // Grid inside HAW
1327  vHAW[5] - Pt3D(0,h_Grid,0), vHAW[5], vHAW[6] ) ;
1328 
1329  if( 0 != gridHere() )
1330  cpv.position( gridLog,
1331  hawRLog,
1332  copyOne,
1333  DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z() ),
1334  myrot( gridName().name()+"R",
1335  gridForm.getRotation() ) ) ;
1336 
1337  // End Grid + Tablet insertion
1338 
1339  // begin filling Wedge with crystal plus supports --------------------------
1340 
1341  const double aNom ( nomCryDimAF() ) ;
1342  const double LNom ( nomCryDimLZ() ) ;
1343 
1344  const double AUnd ( underAR() ) ;
1345  const double aUnd ( underAF() ) ;
1346 // const double BUnd ( underCR() ) ;
1347  const double bUnd ( underCF() ) ;
1348  const double HUnd ( underBR() ) ;
1349  const double hUnd ( underBF() ) ;
1350  const double LUnd ( underLZ() ) ;
1351 
1352  const double sWall ( wallThAlv() ) ;
1353  const double sWrap ( wrapThAlv() ) ;
1354  const double sClr ( clrThAlv() ) ;
1355 
1356  const double fWall ( wallFrAlv() ) ;
1357  const double fWrap ( wrapFrAlv() ) ;
1358  const double fClr ( clrFrAlv() ) ;
1359 
1360  const double rWall ( wallReAlv() ) ;
1361  const double rWrap ( wrapReAlv() ) ;
1362  const double rClr ( clrReAlv() ) ;
1363 
1364  // theta is angle in yz plane between z axis & leading edge of crystal
1365  double theta ( 90*deg ) ;
1366  double zee ( 0*mm ) ;
1367  double side ( 0*mm ) ;
1368  double zeta ( 0*deg ) ; // increment in theta for last crystal
1369 
1370  for( unsigned int cryType ( 1 ) ; cryType <= nCryTypes() ; ++cryType )
1371  {
1372  const std::string sType ( "_" +
1373  std::string( 10>cryType ? "0" : "") +
1374  std::to_string( cryType ) ) ;
1375 
1376  LogDebug("EcalGeom") << "Crytype=" << cryType ;
1377  const double ANom ( vecNomCryDimAR()[ cryType-1 ] ) ;
1378  const double BNom ( vecNomCryDimCR()[ cryType-1 ] ) ;
1379  const double bNom ( vecNomCryDimCF()[ cryType-1 ] ) ;
1380  const double HNom ( vecNomCryDimBR()[ cryType-1 ] ) ;
1381  const double hNom ( vecNomCryDimBF()[ cryType-1 ] ) ;
1382 
1383  const double alfCry ( 90*deg + atan( ( bNom - bUnd - aNom + aUnd )/
1384  ( hNom - hUnd ) ) ) ;
1385 
1386  const Trap trapCry (
1387  ( ANom - AUnd )/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1388  ( aNom - aUnd )/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1389  ( bNom - bUnd )/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1390  ( HNom - HUnd )/2., //double aHalfLengthYNegZ , // h1, H/2
1391  ( hNom - hUnd )/2., //double aHalfLengthYPosZ , // h2, h/2
1392  ( LNom - LUnd )/2., //double aHalfLengthZ , // dz, L/2
1393  alfCry, //double aAngleAD , // alfa1
1394  aNom - aUnd - ANom + AUnd, //double aCoord15X , // x15
1395  hNom - hUnd - HNom + HUnd //double aCoord15Y // y15
1396  ) ;
1397 
1398  const DDName cryDDName ( cryName() + sType ) ;
1399  const DDSolid crySolid ( mytrap( cryDDName.name(), trapCry ) ) ;
1400  const DDLogicalPart cryLog ( cryDDName, cryMat(), crySolid ) ;
1401 
1402 
1403 //++++++++++++++++++++++++++++++++++ APD ++++++++++++++++++++++++++++++++++
1404 
1405  const DDName apdDDName ( apdName().name() + sType ) ;
1406 
1407  const Trap trapAPD (
1408  apdSide()/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1409  apdSide()/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1410  apdSide()/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1411  apdSide()/2., //double aHalfLengthYNegZ , // h1, H/2
1412  apdSide()/2., //double aHalfLengthYPosZ , // h2, h/2
1413  apdThick()/2., // dz, L/2
1414  90*deg, //double aAngleAD , // alfa1
1415  0, //double aCoord15X , // x15
1416  0 //double aCoord15Y // y15
1417  ) ;
1418 
1419 // DDSolid apdSolid ( DDSolidFactory::box( apdDDName,
1420 // apdSide()/2.,
1421 // apdSide()/2.,
1422 // apdThick()/2. ) ) ;
1423  const DDSolid apdSolid ( mytrap( apdDDName.name(), trapAPD ) ) ;
1424  const DDLogicalPart apdLog ( apdDDName, apdMat(), apdSolid ) ;
1425 
1426  unsigned int copyAPD ( 0 ) ;
1427 //++++++++++++++++++++++++++++++++++ END APD ++++++++++++++++++++++++++++++++++
1428 
1429 
1430  const double delta ( atan( ( HNom - hNom )/LNom ) ) ;
1431 //unused const double cosdelta ( cos( delta ) ) ;
1432  const double sindelta ( sin( delta ) ) ;
1433 
1434  const double gamma ( atan( ( ANom - aNom )/LNom ) ) ;
1435 //unused const double cosgamma ( cos( gamma ) ) ;
1436  const double singamma ( sin( gamma ) ) ;
1437 
1438  const double beta ( atan( ( BNom - bNom )/LNom ) ) ;
1439 //unused const double cosbeta ( cos( beta ) ) ;
1440  const double sinbeta ( sin( beta ) ) ;
1441 
1442  // Now clearance trap
1443  const double alfClr ( 90*deg + atan( ( bNom - aNom )/( hNom + sClr ) ) ) ;
1444 
1445  const Trap trapClr (
1446  ( ANom + sClr + rClr*singamma )/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1447  ( aNom + sClr - fClr*singamma )/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1448  ( bNom + sClr - fClr*sinbeta )/2., //double aHalfLengthXPosZHiY , // tl2, b/2
1449  ( HNom + sClr + rClr*sindelta )/2., //double aHalfLengthYNegZ , // h1, H/2
1450  ( hNom + sClr - fClr*sindelta )/2., //double aHalfLengthYPosZ , // h2, h/2
1451  ( LNom + fClr + rClr )/2., // dz, L/2
1452  alfClr, //double aAngleAD , // alfa1
1453  aNom - ANom , //double aCoord15X , // x15
1454  hNom - HNom //double aCoord15Y // y15
1455  ) ;
1456 
1457  const DDName clrDDName ( clrName() + sType ) ;
1458  const DDSolid clrSolid ( mytrap( clrDDName.name(), trapClr ) ) ;
1459  const DDLogicalPart clrLog ( clrDDName, clrMat(), clrSolid ) ;
1460 
1461  // Now wrap trap
1462 
1463  const double alfWrap ( 90*deg + atan( ( bNom - aNom )/
1464  ( hNom + sClr + 2*sWrap ) ) ) ;
1465 
1466  const Trap trapWrap (
1467  ( trapClr.A() + 2*sWrap + rWrap*singamma )/2, // bl1, A/2
1468  ( trapClr.a() + 2*sWrap - fWrap*singamma )/2, // bl2, a/2
1469  ( trapClr.b() + 2*sWrap - fWrap*sinbeta )/2, // tl2, b/2
1470  ( trapClr.H() + 2*sWrap + rWrap*sindelta )/2, // h1, H/2
1471  ( trapClr.h() + 2*sWrap - fWrap*sindelta )/2, // h2, h/2
1472  ( trapClr.L() + fWrap + rWrap )/2., // dz, L/2
1473  alfWrap, //double aAngleAD , // alfa1
1474  aNom - ANom - (cryType>9 ? 0 : 0.020*mm) ,
1475  hNom - HNom //double aCoord15Y // y15
1476  ) ;
1477 
1478  const DDName wrapDDName ( wrapName() + sType ) ;
1479  const DDSolid wrapSolid ( mytrap( wrapDDName.name(), trapWrap ) ) ;
1480  const DDLogicalPart wrapLog ( wrapDDName, wrapMat(), wrapSolid ) ;
1481 
1482  // Now wall trap
1483 
1484  const double alfWall ( 90*deg + atan( ( bNom - aNom )/
1485  ( hNom + sClr + 2*sWrap + 2*sWall ) ) ) ;
1486 
1487  const Trap trapWall (
1488  ( trapWrap.A() + 2*sWall + rWall*singamma )/2, // A/2
1489  ( trapWrap.a() + 2*sWall - fWall*singamma )/2, // a/2
1490  ( trapWrap.b() + 2*sWall - fWall*sinbeta )/2, // b/2
1491  ( trapWrap.H() + 2*sWall + rWall*sindelta )/2, // H/2
1492  ( trapWrap.h() + 2*sWall - fWall*sindelta )/2, // h/2
1493  ( trapWrap.L() + fWall + rWall )/2., // L/2
1494  alfWall, // alfa1
1495  aNom - ANom - (cryType<10? 0.150*mm : 0.100*mm ) ,
1496  hNom - HNom // y15
1497  ) ;
1498 
1499  const DDName wallDDName ( wallName() + sType ) ;
1500  const DDSolid wallSolid ( mytrap( wallDDName.name(), trapWall ) ) ;
1501  const DDLogicalPart wallLog ( wallDDName, wallMat(), wallSolid ) ;
1502 
1503 /* std::cout << "Traps:\n a: "
1504  << trapCry.a() << ", "
1505  << trapClr.a() << ", "
1506  << trapWrap.a() << ", "
1507  << trapWall.a() << "\n b: "
1508  << trapCry.b() << ", "
1509  << trapClr.b() << ", "
1510  << trapWrap.b() << ", "
1511  << trapWall.b() << "\n A: "
1512  << trapCry.A() << ", "
1513  << trapClr.A() << ", "
1514  << trapWrap.A() << ", "
1515  << trapWall.A() << "\n B: "
1516  << trapCry.B() << ", "
1517  << trapClr.B() << ", "
1518  << trapWrap.B() << ", "
1519  << trapWall.B() << "\n h: "
1520  << trapCry.h() << ", "
1521  << trapClr.h() << ", "
1522  << trapWrap.h() << ", "
1523  << trapWall.h() << "\n H: "
1524  << trapCry.H() << ", "
1525  << trapClr.H() << ", "
1526  << trapWrap.H() << ", "
1527  << trapWall.H() << "\n a1: "
1528  << trapCry.a1()/deg << ", "
1529  << trapClr.a1()/deg << ", "
1530  << trapWrap.a1()/deg << ", "
1531  << trapWall.a1()/deg << "\n a4: "
1532  << trapCry.a4()/deg << ", "
1533  << trapClr.a4()/deg << ", "
1534  << trapWrap.a4()/deg << ", "
1535  << trapWall.a4()/deg << "\n x15: "
1536  << trapCry.x15() << ", "
1537  << trapClr.x15() << ", "
1538  << trapWrap.x15() << ", "
1539  << trapWall.x15() << "\n y15: "
1540  << trapCry.y15() << ", "
1541  << trapClr.y15() << ", "
1542  << trapWrap.y15() << ", "
1543  << trapWall.y15()
1544  << std::endl ;
1545 */
1546  // Now for placement of cry within clr
1547  const Vec3 cryToClr ( 0, 0, ( rClr - fClr )/2 ) ;
1548 
1549  cpv.position( cryLog,
1550  clrLog,
1551  copyOne,
1552  DDTranslation ( 0, 0, ( rClr - fClr )/2 ), //SAME as cryToClr above.
1553  DDRotation() ) ;
1554 
1555  if( 0 != apdHere() )
1556  {
1557  cpv.position( apdLog,
1558  clrLog,
1559  ++copyAPD,
1560  DDTranslation( +trapCry.bl1() - apdX1(),
1561  +trapCry.h1() - apdZ(),
1562  -trapCry.dz() - apdThick()/2. + (rClr - fClr)/2. ),
1563  DDRotation() ) ;
1564  cpv.position( apdLog,
1565  clrLog,
1566  ++copyAPD,
1567  DDTranslation( +trapCry.bl1() - apdX2(),
1568  +trapCry.h1() - apdZ(),
1569  -trapCry.dz() - apdThick()/2. + (rClr - fClr)/2.),
1570  DDRotation() ) ;
1571  }
1572 
1573  const Vec3 clrToWrap ( 0, 0, ( rWrap - fWrap )/2 ) ;
1574 
1575  cpv.position( clrLog,
1576  wrapLog,
1577  copyOne,
1578  DDTranslation ( 0, 0, ( rWrap - fWrap )/2 ), //SAME as cryToWrap
1579  DDRotation() ) ;
1580 
1581 
1582  // Now for placement of clr within wall
1583  const Vec3 wrapToWall1 ( 0, 0, ( rWall - fWall )/2 ) ;
1584  const Vec3 wrapToWall ( Vec3( (cryType>9?0:0.005*mm),0,0 )+wrapToWall1 ) ;
1585 
1586  cpv.position( wrapLog,
1587  wallLog,
1588  copyOne,
1589  DDTranslation ( Vec3( (cryType>9?0:0.005*mm),0,0 )+wrapToWall1 ), //SAME as wrapToWall
1590  DDRotation() ) ;
1591 
1592  const Trap::VertexList vWall ( trapWall.vertexList() ) ;
1593  const Trap::VertexList vCry ( trapCry.vertexList() ) ;
1594 
1595  const double sidePrime ( ( trapWall.a() - trapCry.a() )/2 ) ;
1596  const double frontPrime ( fWall + fWrap + fClr + LUnd/2 ) ;
1597 
1598  // define web plates with clearance ===========================================
1599 
1600  if( 1 == cryType ) // first web plate: inside clearance volume
1601  {
1602  web( 0,
1603  trapWall.b(),
1604  trapWall.B(),
1605  trapWall.L(),
1606  theta,
1607  vHAW[4] + Pt3D( 0, hawYOffCry(), 0 ),
1608  hawRLog,
1609  zee,
1610  sidePrime,
1611  frontPrime,
1612  delta, cpv ) ;
1613  zee += vecGapAlvEta()[0] ;
1614  }
1615 
1616  for( unsigned int etaAlv ( 1 ) ; etaAlv <= nCryPerAlvEta() ; ++etaAlv )
1617  {
1618  LogDebug("EcalGeom") << "theta=" << theta/deg
1619  << ", sidePrime=" << sidePrime << ", frontPrime=" << frontPrime
1620  << ", zeta="<<zeta<<", delta="<<delta<<", zee=" << zee;
1621 
1622  zee += 0.075*mm +
1623  ( side*cos(zeta) + trapWall.h() - sidePrime )/sin(theta) ;
1624 
1625  LogDebug("EcalGeom") << "New zee="<< zee ;
1626 
1627  // make transform for placing enclosed crystal
1628 
1629  const Pt3D trap2 ( vCry[2] + cryToClr + clrToWrap + wrapToWall ) ;
1630 
1631  const Pt3D trap3 ( trap2 + Pt3D( 0,
1632  -trapCry.h(),
1633  0 ) ) ;
1634  const Pt3D trap1 ( trap3 + Pt3D( -trapCry.a(),
1635  0,
1636  0 ) ) ;
1637 
1638  const Pt3D wedge3 ( vHAW[4] + Pt3D( sidePrime,
1639  hawYOffCry(),
1640  zee ) ) ;
1641  const Pt3D wedge2 ( wedge3 + Pt3D( 0,
1642  trapCry.h()*cos(theta),
1643  -trapCry.h()*sin(theta) ) ) ;
1644  const Pt3D wedge1 ( wedge3 + Pt3D( trapCry.a(),
1645  0,
1646  0 ) ) ;
1647 
1648  const Tf3D tForm1 ( trap1, trap2, trap3,
1649  wedge1, wedge2, wedge3 ) ;
1650 
1651  const double xx ( 0.050*mm ) ;
1652 
1653  const Tf3D tForm ( HepGeom::Translate3D(xx,0,0)*tForm1 ) ;
1654 
1655  cpv.position( wallLog,
1656  hawRLog,
1657  etaAlv,
1658  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z() ),
1659  myrot( wallLog.name().name() + "_" + std::to_string( etaAlv ),
1660  tForm.getRotation() ) ) ;
1661 
1662  theta -= delta ;
1663  side = sidePrime ;
1664  zeta = delta ;
1665  }
1666  if( 5 == cryType ||
1667  9 == cryType ||
1668  13 == cryType ||
1669  17 == cryType ) // web plates
1670  {
1671  const unsigned int webIndex ( cryType/4 ) ;
1672  zee += 0.5*vecGapAlvEta()[cryType]/sin(theta) ;
1673  web( webIndex,
1674  trapWall.a(),
1675  trapWall.A(),
1676  trapWall.L(),
1677  theta,
1678  vHAW[4] + Pt3D( 0, hawYOffCry(), 0 ),
1679  hawRLog,
1680  zee ,
1681  sidePrime,
1682  frontPrime,
1683  delta, cpv ) ;
1684  zee += 0.5*vecGapAlvEta()[cryType]/sin(theta) ;
1685  }
1686  else
1687  {
1688  if( 17 != cryType ) zee += vecGapAlvEta()[cryType]/sin(theta) ;
1689  }
1690  }
1691  // END filling Wedge with crystal plus supports --------------------------
1692 
1693 //------------------------------------------------------------------------
1694 //------------------------------------------------------------------------
1695 //------------------------------------------------------------------------
1696 //------------------------------------------------------------------------
1697 //**************** Material at outer radius of supermodule ***************
1698 //------------------------------------------------------------------------
1699 //------------------------------------------------------------------------
1700 //------------------------------------------------------------------------
1701 //------------------------------------------------------------------------
1702 
1703  if( 0 != backHere() )
1704  {
1705 
1711 
1712  const DDTranslation outtra ( backXOff() + backSideHeight()/2,
1713  backYOff(),
1714  backSideLength()/2 ) ;
1715 
1716  const double realBPthick ( backPlateThick() + backPlate2Thick() ) ;
1717 
1718  DDSolid backPlateSolid ( DDSolidFactory::box( backPlateName(),
1719  backPlateWidth()/2.,
1720  realBPthick/2.,
1721  backPlateLength()/2. ) ) ;
1722  const std::vector<double>& backPlateParms ( backPlateSolid.parameters() ) ;
1723  const DDLogicalPart backPlateLog ( backPlateName(),
1724  backPlateMat(),
1725  backPlateSolid ) ;
1726 
1727  const DDTranslation backPlateTra ( backSideHeight()/2 +
1728  backPlateParms[1],
1729  0*mm,
1730  backPlateParms[2] -
1731  backSideLength()/2 ) ;
1732 
1733  DDSolid backPlate2Solid ( DDSolidFactory::box( backPlate2Name(),
1734  backPlateWidth()/2.,
1735  backPlate2Thick()/2.,
1736  backPlateLength()/2. ) ) ;
1737 
1738  const DDLogicalPart backPlate2Log ( backPlate2Name(),
1739  backPlate2Mat(),
1740  backPlate2Solid ) ;
1741 
1742  const DDTranslation backPlate2Tra ( 0,
1743  -backPlateParms[1] + backPlate2Thick()/2., 0 ) ;
1744  if( 0 != backPlateHere() )
1745  {
1746  cpv.position( backPlate2Log,
1747  backPlateName(),
1748  copyOne,
1749  backPlate2Tra,
1750  DDRotation() ) ;
1751 
1752  cpv.position( backPlateLog,
1753  spmName(),
1754  copyOne,
1755  outtra + backPlateTra,
1756  myrot( backPlateName().name()+"Rot5",
1757  CLHEP::HepRotationZ(270*deg) ) ) ;
1758 
1759  }
1765 
1766 
1772 
1773  const Trap trapBS (
1774  backSideWidth()/2., //double aHalfLengthXNegZLoY , // bl1, A/2
1775  backSideWidth()/2., //double aHalfLengthXPosZLoY , // bl2, a/2
1776  backSideWidth()/4., //double aHalfLengthXPosZHiY , // tl2, b/2
1777  backSideHeight()/2., //double aHalfLengthYNegZ , // h1, H/2
1778  backSideHeight()/2., //double aHalfLengthYPosZ , // h2, h/2
1779  backSideLength()/2., //double aHalfLengthZ , // dz, L/2
1780  backSideAngle(), //double aAngleAD , // alfa1
1781  0, //double aCoord15X , // x15
1782  0 //double aCoord15Y // y15
1783  ) ;
1784 
1785  const DDSolid backSideSolid ( mytrap( backSideName().name(), trapBS ) ) ;
1786  const DDLogicalPart backSideLog ( backSideName(),
1787  backSideMat(),
1788  backSideSolid ) ;
1789 
1790  const DDTranslation backSideTra1 ( 0*mm,
1791  backPlateWidth()/2 + backSideYOff1(),
1792  1*mm ) ;
1793  if( 0 != backSideHere() )
1794  {
1795  cpv.position( backSideLog,
1796  spmName(),
1797  copyOne,
1798  outtra + backSideTra1,
1799  myrot( backSideName().name()+"Rot8",
1800  CLHEP::HepRotationX(180*deg)*CLHEP::HepRotationZ(90*deg) ) ) ;
1801 
1802  const DDTranslation backSideTra2( 0*mm,
1803  -backPlateWidth()/2 + backSideYOff2(),
1804  1*mm ) ;
1805  cpv.position( backSideLog,
1806  spmName(),
1807  copyTwo,
1808  outtra + backSideTra2,
1809  myrot( backSideName().name()+"Rot9",
1810  CLHEP::HepRotationZ(90*deg) ) ) ;
1811  }
1817 
1818 //=====================
1819  const double backCoolWidth ( backCoolBarWidth() + 2.*backCoolTankWidth() ) ;
1820 
1826 
1827  const double manifCut ( 2*mm ) ;
1828 
1829  DDSolid mBManifSolid ( DDSolidFactory::tubs( mBManifName() ,
1830  backCoolWidth/2. - manifCut,
1831  0,
1832  mBManifOutDiam()/2,
1833  0*deg, 360*deg ) ) ;
1834  const DDLogicalPart mBManifLog ( mBManifName(), mBManifMat(), mBManifSolid ) ;
1835 
1836  const DDName mBManifWaName ( ddname( mBManifName().name() + "Wa" ) ) ;
1837  DDSolid mBManifWaSolid ( DDSolidFactory::tubs( mBManifWaName ,
1838  backCoolWidth/2.-manifCut,
1839  0,
1840  mBManifInnDiam()/2,
1841  0*deg, 360*deg ) ) ;
1842  const DDLogicalPart mBManifWaLog ( mBManifWaName, backPipeWaterMat(),
1843  mBManifWaSolid ) ;
1844  cpv.position( mBManifWaLog,
1845  mBManifName(),
1846  copyOne,
1847  DDTranslation(0,0,0),
1848  DDRotation() ) ;
1849 
1855 //=====================
1856 
1857 
1858 
1864  const double deltaY ( -5*mm ) ;
1865 
1866  DDSolid grEdgeSlotSolid ( DDSolidFactory::box( grEdgeSlotName(),
1867  grEdgeSlotHeight()/2.,
1868  grEdgeSlotWidth()/2.,
1869  grilleThick()/2. ) ) ;
1870  const DDLogicalPart grEdgeSlotLog ( grEdgeSlotName(), grEdgeSlotMat(), grEdgeSlotSolid );
1871 
1872  unsigned int edgeSlotCopy ( 0 ) ;
1873  unsigned int midSlotCopy ( 0 ) ;
1874 
1875  DDLogicalPart grMidSlotLog[4] ;
1876 
1877  for( unsigned int iGr ( 0 ) ; iGr != vecGrilleHeight().size() ; ++iGr )
1878  {
1879  DDName gName ( ddname( grilleName() + std::to_string( iGr ) ) ) ;
1880  DDSolid grilleSolid ( DDSolidFactory::box( gName,
1881  vecGrilleHeight()[iGr]/2.,
1882  backCoolWidth/2.,
1883  grilleThick()/2. ) ) ;
1884  const DDLogicalPart grilleLog ( gName,
1885  grilleMat(),
1886  grilleSolid ) ;
1887 
1888  const DDTranslation grilleTra ( -realBPthick/2 -
1889  vecGrilleHeight()[iGr]/2,
1890  deltaY,
1891  vecGrilleZOff()[iGr] +
1892  grilleThick()/2 - backSideLength()/2 ) ;
1893  const DDTranslation gTra ( outtra + backPlateTra + grilleTra ) ;
1894 
1895  if( 0 != grMidSlotHere() &&
1896  0 != iGr )
1897  {
1898  if( 0 == (iGr-1)%2 )
1899  {
1900  DDName mName ( ddname( grMidSlotName() + std::to_string( iGr/2 ) ) ) ;
1901  DDSolid grMidSlotSolid ( DDSolidFactory::box(
1902  mName,
1903  vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1904  grMidSlotWidth()/2.,
1905  grilleThick()/2. ) ) ;
1906  grMidSlotLog[(iGr-1)/2] = DDLogicalPart( mName, grMidSlotMat(), grMidSlotSolid ) ;
1907  }
1908  cpv.position( grMidSlotLog[(iGr-1)/2],
1909  gName,
1910  ++midSlotCopy,
1911  DDTranslation( vecGrilleHeight()[iGr]/2. - vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1912  +grMidSlotXOff(), 0 ),
1913  DDRotation() ) ;
1914  cpv.position( grMidSlotLog[(iGr-1)/2],
1915  gName,
1916  ++midSlotCopy,
1917  DDTranslation( vecGrilleHeight()[iGr]/2. - vecGrMidSlotHeight()[(iGr-1)/2]/2.,
1918  -grMidSlotXOff(), 0 ),
1919  DDRotation() ) ;
1920  }
1921 
1922  if( 0 != grEdgeSlotHere() &&
1923  0 != iGr )
1924  {
1925  cpv.position( grEdgeSlotLog,
1926  gName,
1927  ++edgeSlotCopy,
1929  backCoolWidth/2 - grEdgeSlotWidth()/2., 0 ),
1930  DDRotation() ) ;
1931  cpv.position( grEdgeSlotLog,
1932  gName,
1933  ++edgeSlotCopy,
1935  -backCoolWidth/2 + grEdgeSlotWidth()/2., 0 ),
1936  DDRotation() ) ;
1937  }
1938  if( 0 != grilleHere() )
1939  cpv.position( grilleLog,
1940  spmName(),
1941  iGr,
1942  gTra,
1943  DDRotation() ) ;
1944 
1945  if( ( 0 != iGr%2 ) &&
1946  ( 0 != mBManifHere() ) )
1947  {
1948  cpv.position( mBManifLog,
1949  spmName(),
1950  iGr,
1951  gTra - DDTranslation( -mBManifOutDiam()/2. +
1952  vecGrilleHeight()[iGr]/2.,manifCut,
1953  grilleThick()/2.+3*mBManifOutDiam()/2.) ,
1954  myrot( mBManifName().name()+"R1",
1955  CLHEP::HepRotationX(90*deg) ) ) ;
1956  cpv.position( mBManifLog,
1957  spmName(),
1958  iGr-1,
1959  gTra - DDTranslation( -3*mBManifOutDiam()/2. +
1960  vecGrilleHeight()[iGr]/2.,manifCut,
1961  grilleThick()/2+3*mBManifOutDiam()/2.) ,
1962  myrot( mBManifName().name()+"R2",
1963  CLHEP::HepRotationX(90*deg) ) ) ;
1964  }
1965  }
1966 
1972 
1973 
1979 
1980  DDSolid backCoolBarSolid ( DDSolidFactory::box( backCoolBarName(),
1981  backCoolBarHeight()/2.,
1982  backCoolBarWidth()/2.,
1983  backCoolBarThick()/2. ) ) ;
1984  const DDLogicalPart backCoolBarLog ( backCoolBarName(),
1985  backCoolBarMat(),
1986  backCoolBarSolid ) ;
1987 
1988  DDSolid backCoolBarSSSolid ( DDSolidFactory::box( backCoolBarSSName(),
1989  backCoolBarHeight()/2.,
1990  backCoolBarWidth()/2.,
1991  backCoolBarSSThick()/2. ) ) ;
1992  const DDLogicalPart backCoolBarSSLog ( backCoolBarSSName(),
1993  backCoolBarSSMat(),
1994  backCoolBarSSSolid ) ;
1995  const DDTranslation backCoolBarSSTra (0,0,0) ;
1996  cpv.position( backCoolBarSSLog,
1997  backCoolBarName(),
1998  copyOne,
1999  backCoolBarSSTra,
2000  DDRotation() ) ;
2001 
2002  DDSolid backCoolBarWaSolid ( DDSolidFactory::box( backCoolBarWaName(),
2003  backCoolBarHeight()/2.,
2004  backCoolBarWidth()/2.,
2005  backCoolBarWaThick()/2. ) ) ;
2006  const DDLogicalPart backCoolBarWaLog ( backCoolBarWaName(),
2007  backCoolBarWaMat(),
2008  backCoolBarWaSolid ) ;
2009  const DDTranslation backCoolBarWaTra (0,0,0) ;
2010  cpv.position( backCoolBarWaLog,
2011  backCoolBarSSName(),
2012  copyOne,
2013  backCoolBarWaTra,
2014  DDRotation() ) ;
2015 
2021 
2022 
2028 
2029  double thickVFE ( 0 ) ;
2030  for( unsigned int iLyr ( 0 ) ; iLyr != vecBackVFELyrThick().size() ; ++iLyr )
2031  {
2032  thickVFE += vecBackVFELyrThick()[iLyr] ;
2033  }
2034  DDSolid backVFESolid ( DDSolidFactory::box( backVFEName(),
2035  backCoolBarHeight()/2.,
2036  backCoolBarWidth()/2.,
2037  thickVFE/2. ) ) ;
2038  const DDLogicalPart backVFELog ( backVFEName(),
2039  backVFEMat(),
2040  backVFESolid ) ;
2041  DDTranslation offTra ( 0,0,-thickVFE/2 ) ;
2042  for( unsigned int iLyr ( 0 ) ; iLyr != vecBackVFELyrThick().size() ; ++iLyr )
2043  {
2044  DDSolid backVFELyrSolid ( DDSolidFactory::box( ddname(vecBackVFELyrName()[iLyr]),
2045  backCoolBarHeight()/2.,
2046  backCoolBarWidth()/2.,
2047  vecBackVFELyrThick()[iLyr]/2. ) ) ;
2048  const DDLogicalPart backVFELyrLog ( ddname(vecBackVFELyrName()[iLyr]),
2049  ddmat(vecBackVFELyrMat()[iLyr]),
2050  backVFELyrSolid ) ;
2051  const DDTranslation backVFELyrTra (0,0, vecBackVFELyrThick()[iLyr]/2) ;
2052  cpv.position( backVFELyrLog,
2053  backVFEName(),
2054  copyOne,
2055  backVFELyrTra + offTra,
2056  DDRotation() ) ;
2057  offTra += 2*backVFELyrTra ;
2058  }
2059 
2065 
2066 
2072 
2073  const double halfZCoolVFE ( thickVFE + backCoolBarThick()/2. ) ;
2074  DDSolid backCoolVFESolid ( DDSolidFactory::box( backCoolVFEName(),
2075  backCoolBarHeight()/2.,
2076  backCoolBarWidth()/2.,
2077  halfZCoolVFE ) ) ;
2078  const DDLogicalPart backCoolVFELog ( backCoolVFEName(),
2079  backCoolVFEMat(),
2080  backCoolVFESolid ) ;
2081  if( 0 != backCoolBarHere() )
2082  cpv.position( backCoolBarLog ,
2083  backCoolVFEName() ,
2084  copyOne ,
2085  DDTranslation() ,
2086  DDRotation() ) ;
2087  if( 0 != backCoolVFEHere() )
2088  cpv.position( backVFELog ,
2089  backCoolVFEName() ,
2090  copyOne ,
2091  DDTranslation( 0,0, backCoolBarThick()/2. + thickVFE/2. ) ,
2092  DDRotation() ) ;
2093  cpv.position( backVFELog ,
2094  backCoolVFEName() ,
2095  copyTwo ,
2096  DDTranslation( 0,0, -backCoolBarThick()/2. - thickVFE/2. ) ,
2097  myrot( backVFEName().name() + "Flip",
2098  CLHEP::HepRotationX( 180*deg ) ) ) ;
2099 
2105 
2106 
2112  unsigned int iCVFECopy ( 1 ) ;
2113  unsigned int iSep ( 0 ) ;
2114  unsigned int iNSec ( 0 ) ;
2115  const unsigned int nMisc ( vecBackMiscThick().size()/4 ) ;
2116  for( unsigned int iMod ( 0 ) ; iMod != 4 ; ++iMod )
2117  {
2118  const double pipeLength ( vecGrilleZOff()[2*iMod+1] -
2119  vecGrilleZOff()[2*iMod ] -
2120  grilleThick() - 3*mm ) ;
2121 
2122  const double pipeZPos ( vecGrilleZOff()[2*iMod+1] - pipeLength/2 - 1.5*mm ) ;
2123 
2124 
2125 
2126  // accumulate total height of parent volume
2127 
2128  double backCoolHeight ( backCoolBarHeight() + mBCoolTubeOutDiam() ) ;
2129  for( unsigned int iMisc ( 0 ) ; iMisc != nMisc ; ++iMisc )
2130  {
2131  backCoolHeight += vecBackMiscThick()[ iMod*nMisc + iMisc ] ;
2132  }
2133  double bottomThick ( mBCoolTubeOutDiam() ) ;
2134  for( unsigned int iMB ( 0 ) ; iMB != vecMBLyrThick().size() ; ++iMB )
2135  {
2136  backCoolHeight += vecMBLyrThick()[iMB] ;
2137  bottomThick += vecMBLyrThick()[iMB] ;
2138  }
2139 
2140  DDName backCName ( ddname( vecBackCoolName()[iMod] ) ) ;
2141  const double halfZBCool ( ( pipeLength - 2*mBManifOutDiam() - grilleZSpace() )/2 ) ;
2142  DDSolid backCoolSolid ( DDSolidFactory::box( backCName ,
2143  backCoolHeight/2.,
2144  backCoolWidth/2.,
2145  halfZBCool ) ) ;
2146  const DDLogicalPart backCoolLog ( backCName,
2147  spmMat(),
2148  backCoolSolid ) ;
2149 
2150  const DDTranslation bCoolTra ( -realBPthick/2 +
2151  backCoolHeight/2 -
2152  vecGrilleHeight()[2*iMod],
2153  deltaY,
2154  vecGrilleZOff()[2*iMod] +
2155  grilleThick() + grilleZSpace() +
2156  halfZBCool -
2157  backSideLength()/2 ) ;
2158  if( 0 != backCoolHere() )
2159  cpv.position( backCoolLog,
2160  spmName(),
2161  iMod+1,
2162  outtra + backPlateTra + bCoolTra,
2163  DDRotation() ) ;
2164 
2165 //===
2166  const double backCoolTankHeight ( backCoolBarHeight() ) ;// - backBracketHeight() ) ;
2167 
2168  const double halfZTank ( halfZBCool - 5*cm ) ;
2169 
2170  DDName bTankName ( ddname( backCoolTankName()+std::to_string(iMod+1) ) ) ;
2171  DDSolid backCoolTankSolid ( DDSolidFactory::box( bTankName ,
2172  backCoolTankHeight/2.,
2173  backCoolTankWidth()/2.,
2174  halfZTank ) ) ;
2175  const DDLogicalPart backCoolTankLog ( bTankName,
2176  backCoolTankMat(),
2177  backCoolTankSolid ) ;
2178  if( 0 != backCoolTankHere() )
2179  cpv.position( backCoolTankLog,
2180  backCName,
2181  copyOne,
2182  DDTranslation( -backCoolHeight/2 +
2183  backCoolTankHeight/2. +
2184  bottomThick,
2185  backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
2186  DDRotation() ) ;
2187 
2188  DDName bTankWaName ( ddname( backCoolTankWaName()+std::to_string(iMod+1) ) ) ;
2189  DDSolid backCoolTankWaSolid ( DDSolidFactory::box( bTankWaName ,
2190  backCoolTankHeight/2. -
2191  backCoolTankThick()/2.,
2192  backCoolTankWaWidth()/2.,
2193  halfZTank -
2194  backCoolTankThick()/2. ) ) ;
2195  const DDLogicalPart backCoolTankWaLog ( bTankWaName,
2197  backCoolTankWaSolid ) ;
2198  cpv.position( backCoolTankWaLog,
2199  bTankName,
2200  copyOne,
2201  DDTranslation(0,0,0),
2202  DDRotation() ) ;
2203 
2204  DDName bBracketName ( ddname( backBracketName()+std::to_string(iMod+1) ) ) ;
2205  DDSolid backBracketSolid ( DDSolidFactory::box( bBracketName ,
2206  backBracketHeight()/2.,
2207  backCoolTankWidth()/2.,
2208  halfZTank ) ) ;
2209  const DDLogicalPart backBracketLog ( bBracketName,
2210  backBracketMat(),
2211  backBracketSolid ) ;
2212  if( 0 != backCoolTankHere() )
2213  cpv.position( backBracketLog,
2214  backCName,
2215  copyOne,
2217  backCoolHeight/2. -
2218  backBracketHeight()/2. +
2219  bottomThick,
2220  -backCoolBarWidth()/2. - backCoolTankWidth()/2., 0),
2221  DDRotation() ) ;
2222 
2223 /* cpv.position( backBracketLog,
2224  backCName,
2225  copyTwo,
2226  DDTranslation( backCoolBarHeight() - backCoolHeight/2. - backBracketHeight()/2.,
2227  backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
2228  DDRotation() ) ;*/
2229 
2230 //===
2231 
2232  DDTranslation bSumTra ( backCoolBarHeight() -
2233  backCoolHeight/2. +
2234  bottomThick, 0, 0 ) ;
2235  for( unsigned int j ( 0 ) ; j != nMisc ; ++j ) // loop over miscellaneous layers
2236  {
2237  const DDName bName ( ddname( vecBackMiscName()[ iMod*nMisc + j ] ) ) ;
2238 
2239  DDSolid bSolid ( DDSolidFactory::box( bName ,
2240  vecBackMiscThick()[ iMod*nMisc + j ]/2,
2242  halfZBCool ) ) ;
2243 
2244  const DDLogicalPart bLog ( bName, ddmat(vecBackMiscMat()[ iMod*nMisc + j ]), bSolid ) ;
2245 
2246  const DDTranslation bTra ( vecBackMiscThick()[ iMod*nMisc + j ]/2, 0*mm, 0*mm ) ;
2247 
2248 
2249  if( 0 != backMiscHere() )
2250  cpv.position( bLog,
2251  backCName,
2252  copyOne,
2253  bSumTra + bTra,
2254  DDRotation() ) ;
2255 
2256  bSumTra += 2*bTra ;
2257  }
2258 
2259  const double bHalfWidth ( backCoolBarWidth()/2. + backCoolTankWidth() ) ;
2260 
2261  if( 0 != mBLyrHere() )
2262  {
2263  DDTranslation mTra ( -backCoolHeight/2. + mBCoolTubeOutDiam(), 0, 0 ) ;
2264  for( unsigned int j ( 0 ) ; j != vecMBLyrThick().size() ; ++j ) // loop over MB layers
2265  {
2266  const DDName mName ( ddname( vecMBLyrName()[j] + "_" +
2267  std::to_string(iMod+1) ) ) ;
2268 
2269  DDSolid mSolid ( DDSolidFactory::box( mName ,
2270  vecMBLyrThick()[j]/2,
2271  bHalfWidth,
2272  halfZBCool ) ) ;
2273 
2274  const DDLogicalPart mLog ( mName, ddmat(vecMBLyrMat()[j]), mSolid ) ;
2275 
2276  mTra += DDTranslation( vecMBLyrThick()[j]/2.0, 0*mm, 0*mm ) ;
2277  cpv.position( mLog,
2278  backCName,
2279  copyOne,
2280  mTra,
2281  DDRotation() ) ;
2282  mTra += DDTranslation( vecMBLyrThick()[j]/2.0, 0*mm, 0*mm ) ;
2283  }
2284  }
2285 
2286  if( 0 != mBCoolTubeHere() )
2287  {
2288  const DDName mBName ( ddname( mBCoolTubeName() + "_" +
2289  std::to_string(iMod+1) ) ) ;
2290 
2291  DDSolid mBCoolTubeSolid ( DDSolidFactory::tubs( mBName ,
2292  halfZBCool,
2293  0,
2294  mBCoolTubeOutDiam()/2,
2295  0*deg, 360*deg ) ) ;
2296  const DDLogicalPart mBLog ( mBName, mBCoolTubeMat(), mBCoolTubeSolid ) ;
2297 
2298  const DDName mBWaName ( ddname( mBCoolTubeName() + "Wa_" +
2299  std::to_string(iMod+1) ) ) ;
2300  DDSolid mBCoolTubeWaSolid ( DDSolidFactory::tubs( mBWaName ,
2301  halfZBCool,
2302  0,
2303  mBCoolTubeInnDiam()/2,
2304  0*deg, 360*deg ) ) ;
2305  const DDLogicalPart mBWaLog ( mBWaName, backPipeWaterMat(),
2306  mBCoolTubeWaSolid ) ;
2307  cpv.position( mBWaLog,
2308  mBName,
2309  copyOne,
2310  DDTranslation(0,0,0),
2311  DDRotation() ) ;
2312 
2313  for( unsigned int j ( 0 ) ; j != mBCoolTubeNum() ; ++j ) // loop over all MB cooling circuits
2314  {
2315  cpv.position( mBLog,
2316  backCName,
2317  2*j + 1,
2318  DDTranslation(-backCoolHeight/2.0+mBCoolTubeOutDiam()/2.,
2319  -bHalfWidth + (j+1)*bHalfWidth/5, 0),
2320  DDRotation() ) ;
2321  }
2322  }
2323 
2324 
2330  if( 0 != backPipeHere() &&
2331  0 != iMod )
2332  {
2333  DDName bPipeName ( ddname( backPipeName() + "_" +
2334  std::to_string( iMod+1 ) ) ) ;
2335  DDName bInnerName ( ddname( backPipeName() +
2336  "_H2O_" + std::to_string( iMod+1 ) ) ) ;
2337 
2338  DDSolid backPipeSolid ( DDSolidFactory::tubs( bPipeName ,
2339  pipeLength/2,
2340  0*mm,
2341  vecBackPipeDiam()[iMod]/2,
2342  0*deg, 360*deg ) ) ;
2343 
2344  DDSolid backInnerSolid ( DDSolidFactory::tubs( bInnerName ,
2345  pipeLength/2,
2346  0*mm,
2347  vecBackPipeDiam()[iMod]/2 -
2348  vecBackPipeThick()[iMod],
2349  0*deg, 360*deg ) ) ;
2350 
2351  const DDLogicalPart backPipeLog ( bPipeName,
2352  backPipeMat(),
2353  backPipeSolid ) ;
2354 
2355  const DDLogicalPart backInnerLog ( bInnerName,
2356  backPipeWaterMat(),
2357  backInnerSolid ) ;
2358 
2359  const DDTranslation bPipeTra1 ( backXOff() +
2360  backSideHeight() -
2361  0.7*vecBackPipeDiam()[iMod],
2362  backYOff() +
2363  backPlateWidth()/2 -
2364  backSideWidth() -
2365  0.7*vecBackPipeDiam()[iMod],
2366  pipeZPos ) ;
2367 
2368  cpv.position( backPipeLog,
2369  spmName(),
2370  copyOne,
2371  bPipeTra1,
2372  DDRotation() ) ;
2373 
2374  const DDTranslation bPipeTra2 ( bPipeTra1.x(),
2375  backYOff() -
2376  backPlateWidth()/2 +
2377  backSideWidth() +
2378  vecBackPipeDiam()[iMod],
2379  bPipeTra1.z() ) ;
2380 
2381  cpv.position( backPipeLog,
2382  spmName(),
2383  copyTwo,
2384  bPipeTra2,
2385  DDRotation() ) ;
2386 
2387  cpv.position( backInnerLog,
2388  bPipeName,
2389  copyOne,
2390  DDTranslation(),
2391  DDRotation() ) ;
2392  }
2398 
2399 //=================================================
2400 
2401  if( 0 != dryAirTubeHere() )
2402  {
2403  DDName dryAirTubName ( ddname( dryAirTubeName() + std::to_string( iMod+1 ) ) ) ;
2404 
2405  DDSolid dryAirTubeSolid ( DDSolidFactory::tubs( dryAirTubName ,
2406  pipeLength/2,
2407  dryAirTubeInnDiam()/2,
2408  dryAirTubeOutDiam()/2,
2409  0*deg, 360*deg ) ) ;
2410 
2411  const DDLogicalPart dryAirTubeLog ( dryAirTubName ,
2412  dryAirTubeMat(),
2413  dryAirTubeSolid ) ;
2414 
2415  const DDTranslation dryAirTubeTra1 ( backXOff() +
2416  backSideHeight() -
2417  0.7*dryAirTubeOutDiam() -
2418  vecBackPipeDiam()[iMod],
2419  backYOff() +
2420  backPlateWidth()/2 -
2421  backSideWidth() -
2422  1.2*dryAirTubeOutDiam(),
2423  pipeZPos ) ;
2424 
2425  cpv.position( dryAirTubeLog,
2426  spmName(),
2427  copyOne,
2428  dryAirTubeTra1,
2429  DDRotation() ) ;
2430 
2431  const DDTranslation dryAirTubeTra2 ( dryAirTubeTra1.x(),
2432  backYOff() -
2433  backPlateWidth()/2 +
2434  backSideWidth() +
2435  0.7*dryAirTubeOutDiam() ,
2436  dryAirTubeTra1.z() ) ;
2437 
2438  cpv.position( dryAirTubeLog,
2439  spmName(),
2440  copyTwo,
2441  dryAirTubeTra2,
2442  DDRotation() ) ;
2443  }
2444  //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2445 
2451 
2452  DDTranslation cTra ( backCoolBarHeight()/2. -
2453  backCoolHeight/2. +
2454  bottomThick, 0 ,
2455  -halfZTank + halfZCoolVFE ) ;
2456  const unsigned int numSec ( static_cast<unsigned int> (vecBackCoolNSec()[iMod]) ) ;
2457  for( unsigned int jSec ( 0 ) ; jSec != numSec ; ++jSec )
2458  {
2459  const unsigned int nMax ( static_cast<unsigned int> (vecBackCoolNPerSec()[iNSec++]) ) ;
2460  for( unsigned int iBar ( 0 ) ; iBar != nMax ; ++iBar )
2461  {
2462  cpv.position( backCoolVFELog,
2463  backCName,
2464  iCVFECopy++,
2465  cTra,
2466  DDRotation() ) ;
2467  cTra += DDTranslation( 0, 0, backCBStdSep() ) ;
2468  }
2469  cTra -= DDTranslation( 0, 0, backCBStdSep() ) ; // backspace to previous
2470  if( jSec != numSec-1 ) cTra += DDTranslation(
2471  0, 0, vecBackCoolSecSep()[iSep++] ) ; // now take atypical step
2472  }
2478  }
2479 
2485 
2491 
2492  double patchHeight ( 0 ) ;
2493  for( unsigned int iPatch ( 0 ) ; iPatch != vecPatchPanelThick().size() ; ++iPatch )
2494  {
2495  patchHeight += vecPatchPanelThick()[iPatch] ;
2496  }
2497 
2498  DDSolid patchSolid ( DDSolidFactory::box( patchPanelName() ,
2499  patchHeight/2.,
2500  backCoolBarWidth()/2.,
2501  ( vecSpmZPts().back() -
2502  vecGrilleZOff().back() -
2503  grilleThick() )/2 ) ) ;
2504 
2505  const std::vector<double>& patchParms ( patchSolid.parameters() ) ;
2506 
2507  const DDLogicalPart patchLog ( patchPanelName(), spmMat(), patchSolid ) ;
2508 
2509  const DDTranslation patchTra ( backXOff() + 4*mm ,
2510  0*mm,
2511  vecGrilleZOff().back() +
2512  grilleThick() +
2513  patchParms[2] ) ;
2514  if( 0 != patchPanelHere() )
2515  cpv.position( patchLog,
2516  spmName(),
2517  copyOne,
2518  patchTra,
2519  DDRotation() ) ;
2520 
2521  DDTranslation pTra (-patchParms[0],0,0) ;
2522 
2523  for( unsigned int j ( 0 ) ; j != vecPatchPanelNames().size() ; ++j )
2524  {
2525  const DDName pName ( ddname( vecPatchPanelNames()[j] ) ) ;
2526 
2527  DDSolid pSolid ( DDSolidFactory::box( pName ,
2528  vecPatchPanelThick()[j]/2.,
2529  patchParms[1],
2530  patchParms[2] ) ) ;
2531 
2532  const DDLogicalPart pLog ( pName, ddmat(vecPatchPanelMat()[j]), pSolid ) ;
2533 
2534  pTra += DDTranslation( vecPatchPanelThick()[j]/2, 0*mm, 0*mm ) ;
2535 
2536  cpv.position( pLog,
2537  patchPanelName(),
2538  copyOne,
2539  pTra,
2540  DDRotation() ) ;
2541 
2542  pTra += DDTranslation( vecPatchPanelThick()[j]/2, 0*mm, 0*mm ) ;
2543  }
2549 
2555 
2556  if( 0 != pincerRodHere() )
2557  {
2558  // Make hierarchy of rods, envelopes, blocks, shims, and cutouts
2559 
2560  DDSolid rodSolid ( DDSolidFactory::box( pincerRodName() ,
2561  pincerEnvWidth()/2.,
2562  pincerEnvHeight()/2.,
2563  ilyLength/2 ) ) ;
2564  const DDLogicalPart rodLog ( pincerRodName(), pincerRodMat(), rodSolid ) ;
2565 
2566  DDSolid envSolid ( DDSolidFactory::box( pincerEnvName() ,
2567  pincerEnvWidth()/2.,
2568  pincerEnvHeight()/2.,
2569  pincerEnvLength()/2 ) ) ;
2570  const DDLogicalPart envLog ( pincerEnvName(), pincerEnvMat(), envSolid ) ;
2571  const std::vector<double>& envParms ( envSolid.parameters() ) ;
2572 
2573  DDSolid blkSolid ( DDSolidFactory::box( pincerBlkName() ,
2574  pincerEnvWidth()/2.,
2575  pincerEnvHeight()/2.,
2576  pincerBlkLength()/2 ) ) ;
2577  const DDLogicalPart blkLog ( pincerBlkName(), pincerBlkMat(), blkSolid ) ;
2578  const std::vector<double>& blkParms ( blkSolid.parameters() ) ;
2579  cpv.position( blkLog,
2580  pincerEnvName(),
2581  copyOne,
2583  DDRotation() ) ;
2584 
2585  DDSolid cutSolid ( DDSolidFactory::box( pincerCutName() ,
2586  pincerCutWidth()/2.,
2587  pincerCutHeight()/2.,
2588  pincerBlkLength()/2 ) ) ;
2589  const DDLogicalPart cutLog ( pincerCutName(), pincerCutMat(), cutSolid ) ;
2590  const std::vector<double>& cutParms ( cutSolid.parameters() ) ;
2591  cpv.position( cutLog,
2592  pincerBlkName(),
2593  copyOne,
2594  DDTranslation( +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(),
2595  -blkParms[1] + cutParms[1], 0 ),
2596  DDRotation() ) ;
2597 
2598  DDSolid shim2Solid ( DDSolidFactory::box( pincerShim2Name() ,
2599  pincerShim2Width()/2.,
2600  pincerShimHeight()/2.,
2601  pincerBlkLength()/2 ) ) ;
2602  const DDLogicalPart shim2Log ( pincerShim2Name(), pincerShimMat(), shim2Solid ) ;
2603  const std::vector<double>& shim2Parms ( shim2Solid.parameters() ) ;
2604  cpv.position( shim2Log,
2605  pincerCutName(),
2606  copyOne,
2607  DDTranslation( +cutParms[0] - shim2Parms[0],
2608  -cutParms[1] + shim2Parms[1], 0 ),
2609  DDRotation() ) ;
2610 
2611  DDSolid shim1Solid ( DDSolidFactory::box( pincerShim1Name() ,
2612  pincerShim1Width()/2.,
2613  pincerShimHeight()/2.,
2614  (pincerEnvLength()-
2615  pincerBlkLength())/2 ) ) ;
2616 
2617  const DDLogicalPart shim1Log ( pincerShim1Name(), pincerShimMat(), shim1Solid ) ;
2618  const std::vector<double>& shim1Parms ( shim1Solid.parameters() ) ;
2619  cpv.position( shim1Log,
2620  pincerEnvName(),
2621  copyOne,
2622  DDTranslation( +envParms[0] - shim1Parms[0],
2623  -envParms[1] + shim1Parms[1],
2624  -envParms[2] + shim1Parms[2] ),
2625  DDRotation() ) ;
2626 
2627  for( unsigned int iEnv ( 0 ) ; iEnv != vecPincerEnvZOff().size() ; ++iEnv )
2628  {
2629  cpv.position( envLog,
2630  pincerRodName(),
2631  1+iEnv,
2632  DDTranslation(0,0, -ilyLength/2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength()/2. ),
2633  DDRotation() ) ;
2634  }
2635 
2636  // Place the rods
2637 // const double radius ( fawRadOff() - pincerEnvHeight()/2 -1*mm ) ;
2638  const double radius ( ilyRMin - pincerEnvHeight()/2 - 1*mm ) ;
2639 
2640  const DDName xilyName ( ddname( ilyName() +
2641  std::to_string(vecIlyMat().size()-1) ) ) ;
2642 
2643  for( unsigned int iRod ( 0 ) ; iRod != vecPincerRodAzimuth().size() ; ++iRod )
2644  {
2645  const DDTranslation rodTra ( radius*cos(vecPincerRodAzimuth()[iRod]) ,
2646  radius*sin(vecPincerRodAzimuth()[iRod]) ,
2647  0 ) ;
2648 
2649  cpv.position( rodLog,
2650  xilyName,
2651  1+iRod,
2652  rodTra,
2653  myrot( pincerRodName().name() + std::to_string(iRod),
2654  CLHEP::HepRotationZ( 90*deg + vecPincerRodAzimuth()[iRod] ) ) ) ;
2655  }
2656  }
2662 
2663  }
2664  }
2665 
2666  LogDebug("EcalGeom") << "******** DDEcalBarrelAlgo test: end it..." ;
2667 }
2668 
2670 DDRotation
2672  const CLHEP::HepRotation& r ) const
2673 {
2674  return DDrot( ddname( m_idNameSpace + ":" + s ), new DDRotationMatrix( r.xx(), r.xy(), r.xz(), r.yx(), r.yy(), r.yz(), r.zx(), r.zy(), r.zz() ) ) ;
2675 }
2676 
2677 
2678 DDMaterial
2680 {
2681  return DDMaterial( ddname( s ) ) ;
2682 }
2683 
2684 DDName
2686 {
2687  const pair<std::string,std::string> temp ( DDSplit(s) ) ;
2688  if ( temp.second == "" ) {
2689  return DDName( temp.first,
2690  m_idNameSpace ) ;
2691  } else {
2692  return DDName( temp.first, temp.second );
2693  }
2694 }
2695 
2696 DDSolid
2698  const EcalTrapezoidParameters& t ) const
2699 {
2700  return DDSolidFactory::trap( ddname( s ),
2701  t.dz(),
2702  t.theta(),
2703  t.phi(),
2704  t.h1(),
2705  t.bl1(),
2706  t.tl1(),
2707  t.alp1(),
2708  t.h2(),
2709  t.bl2(),
2710  t.tl2(),
2711  t.alp2() ) ;
2712 }
2713 
2714 void
2715 DDEcalBarrelAlgo::web( unsigned int iWeb,
2716  double bWeb,
2717  double BWeb,
2718  double LWeb,
2719  double theta,
2720  const HepGeom::Point3D<double> & corner,
2721  const DDLogicalPart logPar,
2722  double& zee,
2723  double side,
2724  double front,
2725  double delta,
2726  DDCompactView& cpv )
2727 {
2728  const unsigned int copyOne (1) ;
2729 
2730  const double LWebx ( vecWebLength()[iWeb] ) ;
2731 
2732  const double BWebx ( bWeb + ( BWeb - bWeb )*LWebx/LWeb ) ;
2733 
2734  const double thick ( vecWebPlTh()[iWeb] + vecWebClrTh()[iWeb] ) ;
2735  const Trap trapWebClr (
2736  BWebx/2, // A/2
2737  bWeb/2, // a/2
2738  bWeb/2, // b/2
2739  thick/2, // H/2
2740  thick/2, // h/2
2741  LWebx/2, // L/2
2742  90*deg, // alfa1
2743  bWeb - BWebx , // x15
2744  0 // y15
2745  ) ;
2746  const DDName webClrDDName ( webClrName() + std::to_string( iWeb ) ) ;
2747  const DDSolid webClrSolid ( mytrap( webClrDDName.name(), trapWebClr ) ) ;
2748  const DDLogicalPart webClrLog ( webClrDDName, webClrMat(), webClrSolid ) ;
2749 
2750  const Trap trapWebPl (
2751  trapWebClr.A()/2, // A/2
2752  trapWebClr.a()/2, // a/2
2753  trapWebClr.b()/2, // b/2
2754  vecWebPlTh()[iWeb]/2, // H/2
2755  vecWebPlTh()[iWeb]/2, // h/2
2756  trapWebClr.L()/2., // L/2
2757  90*deg, // alfa1
2758  trapWebClr.b() - trapWebClr.B() , // x15
2759  0 // y15
2760  ) ;
2761  const DDName webPlDDName ( webPlName() + std::to_string( iWeb ) ) ;
2762  const DDSolid webPlSolid ( mytrap( webPlDDName.fullname(), trapWebPl ) ) ;
2763  const DDLogicalPart webPlLog ( webPlDDName, webPlMat(), webPlSolid ) ;
2764 
2765  cpv.position( webPlLog, // place plate inside clearance volume
2766  webClrDDName,
2767  copyOne,
2768  DDTranslation(0,0,0),
2769  DDRotation() ) ;
2770 
2771  const Trap::VertexList vWeb ( trapWebClr.vertexList() ) ;
2772 
2773  zee += trapWebClr.h()/sin(theta) ;
2774 
2775  const double beta ( theta + delta ) ;
2776 
2777  const double zWeb ( zee - front*cos(beta) + side*sin(beta) ) ;
2778  const double yWeb ( front*sin(beta) + side*cos(beta) ) ;
2779 
2780  const Pt3D wedge3 ( corner + Pt3D( 0, -yWeb, zWeb ) ) ;
2781  const Pt3D wedge2 ( wedge3 + Pt3D( 0,
2782  trapWebClr.h()*cos(theta),
2783  -trapWebClr.h()*sin(theta) ) ) ;
2784  const Pt3D wedge1 ( wedge3 + Pt3D( trapWebClr.a(), 0, 0 ) ) ;
2785 
2786  LogDebug("EcalGeom")<<"trap1="<<vWeb[0]<<", trap2="<<vWeb[2]<<", trap3="<<vWeb[3] ;
2787 
2788  LogDebug("EcalGeom")<<"wedge1="<<wedge1<<", wedge2="<<wedge2<<", wedge3="<<wedge3 ;
2789 
2790  const Tf3D tForm ( vWeb[0], vWeb[2], vWeb[3],
2791  wedge1, wedge2, wedge3 ) ;
2792 
2793  if( 0 != webHere() )
2794  cpv.position( webClrLog,
2795  logPar,
2796  copyOne,
2797  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
2798  myrot( webClrLog.name().name() + std::to_string( iWeb ),
2799  tForm.getRotation() ) ) ;
2800 }
#define LogDebug(id)
std::vector< double > m_vecSpmBRota
double grMidSlotXOff() const
const std::vector< std::string > & vecBackMiscName() const
unsigned int spmNPerHalf() const
const double beta
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:157
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
std::string m_SpmName
double apdX1() const
const N & name() const
Definition: DDBase.h:78
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:41
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:691
double hawRhsml() const
CaloCellGeometry::Pt3DVec VertexList
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
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)
Geom::Theta< T > theta() const
DDMaterial backCoolBarSSMat() const
double backCoolVFEHere() const
const std::vector< double > & vecSpmRMax() const
double backPipeHere() const
void position(const DDLogicalPart &self, const DDLogicalPart &parent, std::string copyno, const DDTranslation &trans, const DDRotation &rot, const DDDivision *div=NULL)
std::string m_PincerShim2Name
DDName barName() const
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:16
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
type of data representation of DDCompactView
Definition: DDCompactView.h:90
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:37
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:66
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
void initialize(const DDNumericArguments &nArgs, const DDVectorArguments &vArgs, const DDMapArguments &mArgs, const DDStringArguments &sArgs, const DDStringVectorArguments &vsArgs)
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
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
int j
Definition: DBlmapReader.cc:9
double webHere() const
const std::vector< double > & vecBarTran() const
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
Definition: DDLogicalPart.h:92
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:823
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:758
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:526
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
DDRotation DDrot(const DDName &name, DDRotationMatrix *rot)
Definition of a uniquely identifiable rotation matrix named by DDName name.
Definition: DDRotation.cc:90
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:740
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
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:4
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
virtual ~DDEcalBarrelAlgo()
std::string m_PatchPanelName
std::string m_DryAirTubeName
const std::vector< std::string > & vecMBLyrMat() const
double backPlateWidth() const
double spmDelPhi() const
double gridThick() const
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
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
const std::vector< double > & vecGrilleZOff() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:90
tuple size
Write out results.
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
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
void execute(DDCompactView &cpv)
std::vector< std::string > m_vecBackCoolName
std::string m_WebClrMat