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