Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-10 02:20:48

0001 //////////////////////////////////////////////////////////////////////////////
0002 // File: DDEcalBarrelNewAlgo.cc
0003 // Description: Geometry factory class for Ecal Barrel
0004 ///////////////////////////////////////////////////////////////////////////////
0005 
0006 #include <cmath>
0007 #include <algorithm>
0008 
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "DetectorDescription/Core/interface/DDLogicalPart.h"
0011 #include "DetectorDescription/Core/interface/DDSolid.h"
0012 #include "DetectorDescription/Core/interface/DDCurrentNamespace.h"
0013 #include "DetectorDescription/Core/interface/DDTranslation.h"
0014 #include <CLHEP/Units/SystemOfUnits.h>
0015 
0016 #include <CLHEP/Geometry/Point3D.h>
0017 #include <CLHEP/Geometry/Vector3D.h>
0018 #include <CLHEP/Geometry/Transform3D.h>
0019 #include <map>
0020 #include <string>
0021 #include <vector>
0022 #include "DetectorDescription/Core/interface/DDTypes.h"
0023 #include "DetectorDescription/Core/interface/DDName.h"
0024 #include "DetectorDescription/Core/interface/DDAlgorithm.h"
0025 #include "DetectorDescription/Core/interface/DDMaterial.h"
0026 #include "DetectorDescription/Core/interface/DDSplit.h"
0027 #include "DetectorDescription/Core/interface/DDTransform.h"
0028 #include "Geometry/CaloGeometry/interface/EcalTrapezoidParameters.h"
0029 #include <CLHEP/Geometry/Transform3D.h>
0030 
0031 using CLHEP::cm;
0032 using CLHEP::deg;
0033 using CLHEP::mm;
0034 //#define EDM_ML_DEBUG
0035 
0036 class DDEcalBarrelNewAlgo : public DDAlgorithm {
0037 public:
0038   typedef EcalTrapezoidParameters Trap;
0039   typedef HepGeom::Point3D<double> Pt3D;
0040   typedef HepGeom::Transform3D Tf3D;
0041   typedef HepGeom::ReflectZ3D RfZ3D;
0042   typedef HepGeom::Translate3D Tl3D;
0043   typedef HepGeom::Rotate3D Ro3D;
0044   typedef HepGeom::RotateZ3D RoZ3D;
0045   typedef HepGeom::RotateY3D RoY3D;
0046   typedef HepGeom::RotateX3D RoX3D;
0047 
0048   typedef CLHEP::Hep3Vector Vec3;
0049   typedef CLHEP::HepRotation Rota;
0050 
0051   //Constructor and Destructor
0052   DDEcalBarrelNewAlgo();
0053   ~DDEcalBarrelNewAlgo() override;
0054 
0055   void initialize(const DDNumericArguments& nArgs,
0056                   const DDVectorArguments& vArgs,
0057                   const DDMapArguments& mArgs,
0058                   const DDStringArguments& sArgs,
0059                   const DDStringVectorArguments& vsArgs) override;
0060   void execute(DDCompactView& cpv) override;
0061 
0062   DDMaterial ddmat(const std::string& s) const;
0063   DDName ddname(const std::string& s) const;
0064   DDRotation myrot(const std::string& s, const CLHEP::HepRotation& r) const;
0065   DDSolid mytrap(const std::string& s, const Trap& t) const;
0066 
0067   const std::string& idNameSpace() const { return m_idNameSpace; }
0068 
0069   // barrel parent volume
0070   DDName barName() const { return ddname(m_BarName); }
0071   DDMaterial barMat() const { return ddmat(m_BarMat); }
0072   const std::vector<double>& vecBarZPts() const { return m_vecBarZPts; }
0073   const std::vector<double>& vecBarRMin() const { return m_vecBarRMin; }
0074   const std::vector<double>& vecBarRMax() const { return m_vecBarRMax; }
0075   const std::vector<double>& vecBarTran() const { return m_vecBarTran; }
0076   const std::vector<double>& vecBarRota() const { return m_vecBarRota; }
0077   const std::vector<double>& vecBarRota2() const { return m_vecBarRota2; }
0078   const std::vector<double>& vecBarRota3() const { return m_vecBarRota3; }
0079   double barPhiLo() const { return m_BarPhiLo; }
0080   double barPhiHi() const { return m_BarPhiHi; }
0081   double barHere() const { return m_BarHere; }
0082 
0083   DDName spmName() const { return ddname(m_SpmName); }
0084   DDMaterial spmMat() const { return ddmat(m_SpmMat); }
0085   const std::vector<double>& vecSpmZPts() const { return m_vecSpmZPts; }
0086   const std::vector<double>& vecSpmRMin() const { return m_vecSpmRMin; }
0087   const std::vector<double>& vecSpmRMax() const { return m_vecSpmRMax; }
0088   const std::vector<double>& vecSpmTran() const { return m_vecSpmTran; }
0089   const std::vector<double>& vecSpmRota() const { return m_vecSpmRota; }
0090   const std::vector<double>& vecSpmBTran() const { return m_vecSpmBTran; }
0091   const std::vector<double>& vecSpmBRota() const { return m_vecSpmBRota; }
0092   unsigned int spmNPerHalf() const { return m_SpmNPerHalf; }
0093   double spmLowPhi() const { return m_SpmLowPhi; }
0094   double spmDelPhi() const { return m_SpmDelPhi; }
0095   double spmPhiOff() const { return m_SpmPhiOff; }
0096   const std::vector<double>& vecSpmHere() const { return m_vecSpmHere; }
0097   DDName spmCutName() const { return ddname(m_SpmCutName); }
0098   double spmCutThick() const { return m_SpmCutThick; }
0099   int spmCutShow() const { return m_SpmCutShow; }
0100   double spmCutRM() const { return m_SpmCutRM; }
0101   double spmCutRP() const { return m_SpmCutRP; }
0102   const std::vector<double>& vecSpmCutTM() const { return m_vecSpmCutTM; }
0103   const std::vector<double>& vecSpmCutTP() const { return m_vecSpmCutTP; }
0104   double spmExpThick() const { return m_SpmExpThick; }
0105   double spmExpWide() const { return m_SpmExpWide; }
0106   double spmExpYOff() const { return m_SpmExpYOff; }
0107   DDName spmSideName() const { return ddname(m_SpmSideName); }
0108   DDMaterial spmSideMat() const { return ddmat(m_SpmSideMat); }
0109   double spmSideHigh() const { return m_SpmSideHigh; }
0110   double spmSideThick() const { return m_SpmSideThick; }
0111   double spmSideYOffM() const { return m_SpmSideYOffM; }
0112   double spmSideYOffP() const { return m_SpmSideYOffP; }
0113 
0114   double nomCryDimAF() const { return m_NomCryDimAF; }
0115   double nomCryDimLZ() const { return m_NomCryDimLZ; }
0116   const std::vector<double>& vecNomCryDimBF() const { return m_vecNomCryDimBF; }
0117   const std::vector<double>& vecNomCryDimCF() const { return m_vecNomCryDimCF; }
0118   const std::vector<double>& vecNomCryDimAR() const { return m_vecNomCryDimAR; }
0119   const std::vector<double>& vecNomCryDimBR() const { return m_vecNomCryDimBR; }
0120   const std::vector<double>& vecNomCryDimCR() const { return m_vecNomCryDimCR; }
0121 
0122   double underAF() const { return m_UnderAF; }
0123   double underLZ() const { return m_UnderLZ; }
0124   double underBF() const { return m_UnderBF; }
0125   double underCF() const { return m_UnderCF; }
0126   double underAR() const { return m_UnderAR; }
0127   double underBR() const { return m_UnderBR; }
0128   double underCR() const { return m_UnderCR; }
0129 
0130   double wallThAlv() const { return m_WallThAlv; }
0131   double wrapThAlv() const { return m_WrapThAlv; }
0132   double clrThAlv() const { return m_ClrThAlv; }
0133   const std::vector<double>& vecGapAlvEta() const { return m_vecGapAlvEta; }
0134 
0135   double wallFrAlv() const { return m_WallFrAlv; }
0136   double wrapFrAlv() const { return m_WrapFrAlv; }
0137   double clrFrAlv() const { return m_ClrFrAlv; }
0138 
0139   double wallReAlv() const { return m_WallReAlv; }
0140   double wrapReAlv() const { return m_WrapReAlv; }
0141   double clrReAlv() const { return m_ClrReAlv; }
0142 
0143   unsigned int nCryTypes() const { return m_NCryTypes; }
0144   unsigned int nCryPerAlvEta() const { return m_NCryPerAlvEta; }
0145 
0146   const std::string& cryName() const { return m_CryName; }
0147   const std::string& clrName() const { return m_ClrName; }
0148   const std::string& wrapName() const { return m_WrapName; }
0149   const std::string& wallName() const { return m_WallName; }
0150 
0151   DDMaterial cryMat() const { return ddmat(m_CryMat); }
0152   DDMaterial clrMat() const { return ddmat(m_ClrMat); }
0153   DDMaterial wrapMat() const { return ddmat(m_WrapMat); }
0154   DDMaterial wallMat() const { return ddmat(m_WallMat); }
0155   DDName capName() const { return ddname(m_capName); }
0156   double capHere() const { return m_capHere; }
0157   DDMaterial capMat() const { return ddmat(m_capMat); }
0158   double capXSize() const { return m_capXSize; }
0159   double capYSize() const { return m_capYSize; }
0160   double capThick() const { return m_capThick; }
0161 
0162   DDName cerName() const { return ddname(m_CERName); }
0163   DDMaterial cerMat() const { return ddmat(m_CERMat); }
0164   double cerXSize() const { return m_CERXSize; }
0165   double cerYSize() const { return m_CERYSize; }
0166   double cerThick() const { return m_CERThick; }
0167 
0168   DDName bsiName() const { return ddname(m_BSiName); }
0169   DDMaterial bsiMat() const { return ddmat(m_BSiMat); }
0170   double bsiXSize() const { return m_BSiXSize; }
0171   double bsiYSize() const { return m_BSiYSize; }
0172   double bsiThick() const { return m_BSiThick; }
0173 
0174   DDName atjName() const { return ddname(m_ATJName); }
0175   DDMaterial atjMat() const { return ddmat(m_ATJMat); }
0176   double atjThick() const { return m_ATJThick; }
0177 
0178   DDName sglName() const { return ddname(m_SGLName); }
0179   DDMaterial sglMat() const { return ddmat(m_SGLMat); }
0180   double sglThick() const { return m_SGLThick; }
0181 
0182   DDName aglName() const { return ddname(m_AGLName); }
0183   DDMaterial aglMat() const { return ddmat(m_AGLMat); }
0184   double aglThick() const { return m_AGLThick; }
0185 
0186   DDName andName() const { return ddname(m_ANDName); }
0187   DDMaterial andMat() const { return ddmat(m_ANDMat); }
0188   double andThick() const { return m_ANDThick; }
0189 
0190   DDName apdName() const { return ddname(m_APDName); }
0191   DDMaterial apdMat() const { return ddmat(m_APDMat); }
0192   double apdSide() const { return m_APDSide; }
0193   double apdThick() const { return m_APDThick; }
0194   double apdZ() const { return m_APDZ; }
0195   double apdX1() const { return m_APDX1; }
0196   double apdX2() const { return m_APDX2; }
0197 
0198   double webHere() const { return m_WebHere; }
0199   const std::string& webPlName() const { return m_WebPlName; }
0200   const std::string& webClrName() const { return m_WebClrName; }
0201   DDMaterial webPlMat() const { return ddmat(m_WebPlMat); }
0202   DDMaterial webClrMat() const { return ddmat(m_WebClrMat); }
0203   const std::vector<double>& vecWebPlTh() const { return m_vecWebPlTh; }
0204   const std::vector<double>& vecWebClrTh() const { return m_vecWebClrTh; }
0205   const std::vector<double>& vecWebLength() const { return m_vecWebLength; }
0206 
0207   double ilyHere() const { return m_IlyHere; }
0208   const std::string& ilyName() const { return m_IlyName; }
0209   double ilyPhiLow() const { return m_IlyPhiLow; }
0210   double ilyDelPhi() const { return m_IlyDelPhi; }
0211   const std::vector<std::string>& vecIlyMat() const { return m_vecIlyMat; }
0212   const std::vector<double>& vecIlyThick() const { return m_vecIlyThick; }
0213 
0214   const std::string& ilyPipeName() const { return m_IlyPipeName; }
0215   double ilyPipeHere() const { return m_IlyPipeHere; }
0216   DDMaterial ilyPipeMat() const { return ddmat(m_IlyPipeMat); }
0217   double ilyPipeOD() const { return m_IlyPipeOD; }
0218   double ilyPipeID() const { return m_IlyPipeID; }
0219   const std::vector<double>& vecIlyPipeLength() const { return m_vecIlyPipeLength; }
0220   const std::vector<double>& vecIlyPipeType() const { return m_vecIlyPipeType; }
0221   const std::vector<double>& vecIlyPipePhi() const { return m_vecIlyPipePhi; }
0222   const std::vector<double>& vecIlyPipeZ() const { return m_vecIlyPipeZ; }
0223 
0224   DDName ilyPTMName() const { return ddname(m_IlyPTMName); }
0225   double ilyPTMHere() const { return m_IlyPTMHere; }
0226   DDMaterial ilyPTMMat() const { return ddmat(m_IlyPTMMat); }
0227   double ilyPTMWidth() const { return m_IlyPTMWidth; }
0228   double ilyPTMLength() const { return m_IlyPTMLength; }
0229   double ilyPTMHeight() const { return m_IlyPTMHeight; }
0230   const std::vector<double>& vecIlyPTMZ() const { return m_vecIlyPTMZ; }
0231   const std::vector<double>& vecIlyPTMPhi() const { return m_vecIlyPTMPhi; }
0232 
0233   DDName ilyFanOutName() const { return ddname(m_IlyFanOutName); }
0234   double ilyFanOutHere() const { return m_IlyFanOutHere; }
0235   DDMaterial ilyFanOutMat() const { return ddmat(m_IlyFanOutMat); }
0236   double ilyFanOutWidth() const { return m_IlyFanOutWidth; }
0237   double ilyFanOutLength() const { return m_IlyFanOutLength; }
0238   double ilyFanOutHeight() const { return m_IlyFanOutHeight; }
0239   const std::vector<double>& vecIlyFanOutZ() const { return m_vecIlyFanOutZ; }
0240   const std::vector<double>& vecIlyFanOutPhi() const { return m_vecIlyFanOutPhi; }
0241   DDName ilyDiffName() const { return ddname(m_IlyDiffName); }
0242   DDMaterial ilyDiffMat() const { return ddmat(m_IlyDiffMat); }
0243   double ilyDiffOff() const { return m_IlyDiffOff; }
0244   double ilyDiffLength() const { return m_IlyDiffLength; }
0245   DDName ilyBndlName() const { return ddname(m_IlyBndlName); }
0246   DDMaterial ilyBndlMat() const { return ddmat(m_IlyBndlMat); }
0247   double ilyBndlOff() const { return m_IlyBndlOff; }
0248   double ilyBndlLength() const { return m_IlyBndlLength; }
0249   DDName ilyFEMName() const { return ddname(m_IlyFEMName); }
0250   DDMaterial ilyFEMMat() const { return ddmat(m_IlyFEMMat); }
0251   double ilyFEMWidth() const { return m_IlyFEMWidth; }
0252   double ilyFEMLength() const { return m_IlyFEMLength; }
0253   double ilyFEMHeight() const { return m_IlyFEMHeight; }
0254   const std::vector<double>& vecIlyFEMZ() const { return m_vecIlyFEMZ; }
0255   const std::vector<double>& vecIlyFEMPhi() const { return m_vecIlyFEMPhi; }
0256 
0257   DDName hawRName() const { return ddname(m_HawRName); }
0258   DDName fawName() const { return ddname(m_FawName); }
0259   double fawHere() const { return m_FawHere; }
0260   double hawRHBIG() const { return m_HawRHBIG; }
0261   double hawRhsml() const { return m_HawRhsml; }
0262   double hawRCutY() const { return m_HawRCutY; }
0263   double hawRCutZ() const { return m_HawRCutZ; }
0264   double hawRCutDelY() const { return m_HawRCutDelY; }
0265   double hawYOffCry() const { return m_HawYOffCry; }
0266 
0267   unsigned int nFawPerSupm() const { return m_NFawPerSupm; }
0268   double fawPhiOff() const { return m_FawPhiOff; }
0269   double fawDelPhi() const { return m_FawDelPhi; }
0270   double fawPhiRot() const { return m_FawPhiRot; }
0271   double fawRadOff() const { return m_FawRadOff; }
0272 
0273   double gridHere() const { return m_GridHere; }
0274   DDName gridName() const { return ddname(m_GridName); }
0275   DDMaterial gridMat() const { return ddmat(m_GridMat); }
0276   double gridThick() const { return m_GridThick; }
0277 
0278   double backHere() const { return m_BackHere; }
0279   double backXOff() const { return m_BackXOff; }
0280   double backYOff() const { return m_BackYOff; }
0281   DDName backSideName() const { return ddname(m_BackSideName); }
0282   double backSideHere() const { return m_BackSideHere; }
0283   double backSideLength() const { return m_BackSideLength; }
0284   double backSideHeight() const { return m_BackSideHeight; }
0285   double backSideWidth() const { return m_BackSideWidth; }
0286   double backSideYOff1() const { return m_BackSideYOff1; }
0287   double backSideYOff2() const { return m_BackSideYOff2; }
0288   double backSideAngle() const { return m_BackSideAngle; }
0289   DDMaterial backSideMat() const { return ddmat(m_BackSideMat); }
0290   DDName backPlateName() const { return ddname(m_BackPlateName); }
0291   double backPlateHere() const { return m_BackPlateHere; }
0292   double backPlateLength() const { return m_BackPlateLength; }
0293   double backPlateThick() const { return m_BackPlateThick; }
0294   double backPlateWidth() const { return m_BackPlateWidth; }
0295   DDMaterial backPlateMat() const { return ddmat(m_BackPlateMat); }
0296   DDName backPlate2Name() const { return ddname(m_BackPlate2Name); }
0297   double backPlate2Thick() const { return m_BackPlate2Thick; }
0298   DDMaterial backPlate2Mat() const { return ddmat(m_BackPlate2Mat); }
0299   const std::string& grilleName() const { return m_GrilleName; }
0300   double grilleThick() const { return m_GrilleThick; }
0301   double grilleHere() const { return m_GrilleHere; }
0302   double grilleWidth() const { return m_GrilleWidth; }
0303   double grilleZSpace() const { return m_GrilleZSpace; }
0304   DDMaterial grilleMat() const { return ddmat(m_GrilleMat); }
0305   const std::vector<double>& vecGrilleHeight() const { return m_vecGrilleHeight; }
0306   const std::vector<double>& vecGrilleZOff() const { return m_vecGrilleZOff; }
0307 
0308   DDName grEdgeSlotName() const { return ddname(m_GrEdgeSlotName); }
0309   DDMaterial grEdgeSlotMat() const { return ddmat(m_GrEdgeSlotMat); }
0310   double grEdgeSlotHere() const { return m_GrEdgeSlotHere; }
0311   double grEdgeSlotHeight() const { return m_GrEdgeSlotHeight; }
0312   double grEdgeSlotWidth() const { return m_GrEdgeSlotWidth; }
0313   const std::string& grMidSlotName() const { return m_GrMidSlotName; }
0314   DDMaterial grMidSlotMat() const { return ddmat(m_GrMidSlotMat); }
0315   double grMidSlotHere() const { return m_GrMidSlotHere; }
0316   double grMidSlotWidth() const { return m_GrMidSlotWidth; }
0317   double grMidSlotXOff() const { return m_GrMidSlotXOff; }
0318   const std::vector<double>& vecGrMidSlotHeight() const { return m_vecGrMidSlotHeight; }
0319 
0320   double backPipeHere() const { return m_BackPipeHere; }
0321   const std::string& backPipeName() const { return m_BackPipeName; }
0322   const std::vector<double>& vecBackPipeDiam() const { return m_vecBackPipeDiam; }
0323   const std::vector<double>& vecBackPipeThick() const { return m_vecBackPipeThick; }
0324   DDMaterial backPipeMat() const { return ddmat(m_BackPipeMat); }
0325   DDMaterial backPipeWaterMat() const { return ddmat(m_BackPipeWaterMat); }
0326   double backMiscHere() const { return m_BackMiscHere; }
0327   const std::vector<double>& vecBackMiscThick() const { return m_vecBackMiscThick; }
0328   const std::vector<std::string>& vecBackMiscName() const { return m_vecBackMiscName; }
0329   const std::vector<std::string>& vecBackMiscMat() const { return m_vecBackMiscMat; }
0330   double patchPanelHere() const { return m_PatchPanelHere; }
0331   const std::vector<double>& vecPatchPanelThick() const { return m_vecPatchPanelThick; }
0332   const std::vector<std::string>& vecPatchPanelNames() const { return m_vecPatchPanelNames; }
0333   const std::vector<std::string>& vecPatchPanelMat() const { return m_vecPatchPanelMat; }
0334   DDName patchPanelName() const { return ddname(m_PatchPanelName); }
0335 
0336   const std::vector<std::string>& vecBackCoolName() const { return m_vecBackCoolName; }
0337   double backCoolHere() const { return m_BackCoolHere; }
0338   double backCoolBarWidth() const { return m_BackCoolBarWidth; }
0339   double backCoolBarHeight() const { return m_BackCoolBarHeight; }
0340   DDMaterial backCoolMat() const { return ddmat(m_BackCoolMat); }
0341   double backCoolBarHere() const { return m_BackCoolBarHere; }
0342   DDName backCoolBarName() const { return ddname(m_BackCoolBarName); }
0343   double backCoolBarThick() const { return m_BackCoolBarThick; }
0344   DDMaterial backCoolBarMat() const { return ddmat(m_BackCoolBarMat); }
0345   DDName backCoolBarSSName() const { return ddname(m_BackCoolBarSSName); }
0346   double backCoolBarSSThick() const { return m_BackCoolBarSSThick; }
0347   DDMaterial backCoolBarSSMat() const { return ddmat(m_BackCoolBarSSMat); }
0348   DDName backCoolBarWaName() const { return ddname(m_BackCoolBarWaName); }
0349   double backCoolBarWaThick() const { return m_BackCoolBarWaThick; }
0350   DDMaterial backCoolBarWaMat() const { return ddmat(m_BackCoolBarWaMat); }
0351   double backCoolVFEHere() const { return m_BackCoolVFEHere; }
0352   DDName backCoolVFEName() const { return ddname(m_BackCoolVFEName); }
0353   DDMaterial backCoolVFEMat() const { return ddmat(m_BackCoolVFEMat); }
0354   DDName backVFEName() const { return ddname(m_BackVFEName); }
0355   DDMaterial backVFEMat() const { return ddmat(m_BackVFEMat); }
0356   const std::vector<double>& vecBackVFELyrThick() const { return m_vecBackVFELyrThick; }
0357   const std::vector<std::string>& vecBackVFELyrName() const { return m_vecBackVFELyrName; }
0358   const std::vector<std::string>& vecBackVFELyrMat() const { return m_vecBackVFELyrMat; }
0359   const std::vector<double>& vecBackCoolNSec() const { return m_vecBackCoolNSec; }
0360   const std::vector<double>& vecBackCoolSecSep() const { return m_vecBackCoolSecSep; }
0361   const std::vector<double>& vecBackCoolNPerSec() const { return m_vecBackCoolNPerSec; }
0362   double backCBStdSep() const { return m_BackCBStdSep; }
0363 
0364   double backCoolTankHere() const { return m_BackCoolTankHere; }
0365   const std::string& backCoolTankName() const { return m_BackCoolTankName; }
0366   double backCoolTankWidth() const { return m_BackCoolTankWidth; }
0367   double backCoolTankThick() const { return m_BackCoolTankThick; }
0368   DDMaterial backCoolTankMat() const { return ddmat(m_BackCoolTankMat); }
0369   const std::string& backCoolTankWaName() const { return m_BackCoolTankWaName; }
0370   double backCoolTankWaWidth() const { return m_BackCoolTankWaWidth; }
0371   DDMaterial backCoolTankWaMat() const { return ddmat(m_BackCoolTankWaMat); }
0372   const std::string& backBracketName() const { return m_BackBracketName; }
0373   double backBracketHeight() const { return m_BackBracketHeight; }
0374   DDMaterial backBracketMat() const { return ddmat(m_BackBracketMat); }
0375 
0376   double dryAirTubeHere() const { return m_DryAirTubeHere; }
0377   const std::string& dryAirTubeName() const { return m_DryAirTubeName; }
0378   double mBCoolTubeNum() const { return m_MBCoolTubeNum; }
0379   double dryAirTubeInnDiam() const { return m_DryAirTubeInnDiam; }
0380   double dryAirTubeOutDiam() const { return m_DryAirTubeOutDiam; }
0381   DDMaterial dryAirTubeMat() const { return ddmat(m_DryAirTubeMat); }
0382   double mBCoolTubeHere() const { return m_MBCoolTubeHere; }
0383   const std::string& mBCoolTubeName() const { return m_MBCoolTubeName; }
0384   double mBCoolTubeInnDiam() const { return m_MBCoolTubeInnDiam; }
0385   double mBCoolTubeOutDiam() const { return m_MBCoolTubeOutDiam; }
0386   DDMaterial mBCoolTubeMat() const { return ddmat(m_MBCoolTubeMat); }
0387   double mBManifHere() const { return m_MBManifHere; }
0388   DDName mBManifName() const { return ddname(m_MBManifName); }
0389   double mBManifInnDiam() const { return m_MBManifInnDiam; }
0390   double mBManifOutDiam() const { return m_MBManifOutDiam; }
0391   DDMaterial mBManifMat() const { return ddmat(m_MBManifMat); }
0392   double mBLyrHere() const { return m_MBLyrHere; }
0393   const std::vector<double>& vecMBLyrThick() const { return m_vecMBLyrThick; }
0394   const std::vector<std::string>& vecMBLyrName() const { return m_vecMBLyrName; }
0395   const std::vector<std::string>& vecMBLyrMat() const { return m_vecMBLyrMat; }
0396 
0397   //----------
0398 
0399   double pincerRodHere() const { return m_PincerRodHere; }
0400   DDName pincerRodName() const { return ddname(m_PincerRodName); }
0401   DDMaterial pincerRodMat() const { return ddmat(m_PincerRodMat); }
0402   std::vector<double> vecPincerRodAzimuth() const { return m_vecPincerRodAzimuth; }
0403   DDName pincerEnvName() const { return ddname(m_PincerEnvName); }
0404   DDMaterial pincerEnvMat() const { return ddmat(m_PincerEnvMat); }
0405   double pincerEnvWidth() const { return m_PincerEnvWidth; }
0406   double pincerEnvHeight() const { return m_PincerEnvHeight; }
0407   double pincerEnvLength() const { return m_PincerEnvLength; }
0408   std::vector<double> vecPincerEnvZOff() const { return m_vecPincerEnvZOff; }
0409 
0410   DDName pincerBlkName() const { return ddname(m_PincerBlkName); }
0411   DDMaterial pincerBlkMat() const { return ddmat(m_PincerBlkMat); }
0412   double pincerBlkLength() const { return m_PincerBlkLength; }
0413 
0414   DDName pincerShim1Name() const { return ddname(m_PincerShim1Name); }
0415   double pincerShimHeight() const { return m_PincerShimHeight; }
0416   DDName pincerShim2Name() const { return ddname(m_PincerShim2Name); }
0417   DDMaterial pincerShimMat() const { return ddmat(m_PincerShimMat); }
0418   double pincerShim1Width() const { return m_PincerShim1Width; }
0419   double pincerShim2Width() const { return m_PincerShim2Width; }
0420 
0421   DDName pincerCutName() const { return ddname(m_PincerCutName); }
0422   DDMaterial pincerCutMat() const { return ddmat(m_PincerCutMat); }
0423   double pincerCutWidth() const { return m_PincerCutWidth; }
0424   double pincerCutHeight() const { return m_PincerCutHeight; }
0425 
0426 protected:
0427 private:
0428   void web(unsigned int iWeb,
0429            double bWeb,
0430            double BWeb,
0431            double LWeb,
0432            double theta,
0433            const Pt3D& corner,
0434            const DDLogicalPart& logPar,
0435            double& zee,
0436            double side,
0437            double front,
0438            double delta,
0439            DDCompactView& cpv);
0440 
0441   std::string m_idNameSpace;  //Namespace of this and ALL sub-parts
0442 
0443   // Barrel volume
0444   std::string m_BarName;              // Barrel volume name
0445   std::string m_BarMat;               // Barrel material name
0446   std::vector<double> m_vecBarZPts;   // Barrel list of z pts
0447   std::vector<double> m_vecBarRMin;   // Barrel list of rMin pts
0448   std::vector<double> m_vecBarRMax;   // Barrel list of rMax pts
0449   std::vector<double> m_vecBarTran;   // Barrel translation
0450   std::vector<double> m_vecBarRota;   // Barrel rotation
0451   std::vector<double> m_vecBarRota2;  // 2nd Barrel rotation
0452   std::vector<double> m_vecBarRota3;  // 2nd Barrel rotation
0453   double m_BarPhiLo;                  // Barrel phi lo
0454   double m_BarPhiHi;                  // Barrel phi hi
0455   double m_BarHere;                   // Barrel presence flag
0456 
0457   // Supermodule volume
0458   std::string m_SpmName;              // Supermodule volume name
0459   std::string m_SpmMat;               // Supermodule material name
0460   std::vector<double> m_vecSpmZPts;   // Supermodule list of z pts
0461   std::vector<double> m_vecSpmRMin;   // Supermodule list of rMin pts
0462   std::vector<double> m_vecSpmRMax;   // Supermodule list of rMax pts
0463   std::vector<double> m_vecSpmTran;   // Supermodule translation
0464   std::vector<double> m_vecSpmRota;   // Supermodule rotation
0465   std::vector<double> m_vecSpmBTran;  // Base Supermodule translation
0466   std::vector<double> m_vecSpmBRota;  // Base Supermodule rotation
0467   unsigned int m_SpmNPerHalf;         // # Supermodules per half detector
0468   double m_SpmLowPhi;                 // Low   phi value of base supermodule
0469   double m_SpmDelPhi;                 // Delta phi value of base supermodule
0470   double m_SpmPhiOff;                 // Phi offset value supermodule
0471   std::vector<double> m_vecSpmHere;   // Bit saying if a supermodule is present or not
0472   std::string m_SpmCutName;           // Name of cut box
0473   double m_SpmCutThick;               // Box thickness
0474   int m_SpmCutShow;                   // Non-zero means show the box on display (testing only)
0475   std::vector<double> m_vecSpmCutTM;  // Translation for minus phi cut box
0476   std::vector<double> m_vecSpmCutTP;  // Translation for plus  phi cut box
0477   double m_SpmCutRM;                  // Rotation for minus phi cut box
0478   double m_SpmCutRP;                  // Rotation for plus  phi cut box
0479   double m_SpmExpThick;               // Thickness (x) of supermodule expansion box
0480   double m_SpmExpWide;                // Width     (y) of supermodule expansion box
0481   double m_SpmExpYOff;                // Offset    (y) of supermodule expansion box
0482   std::string m_SpmSideName;          // Supermodule Side Plate volume name
0483   std::string m_SpmSideMat;           // Supermodule Side Plate material name
0484   double m_SpmSideHigh;               // Side plate height
0485   double m_SpmSideThick;              // Side plate thickness
0486   double m_SpmSideYOffM;              // Side plate Y offset on minus phi side
0487   double m_SpmSideYOffP;              // Side plate Y offset on plus  phi side
0488 
0489   double m_NomCryDimAF;                  // Nominal crystal AF
0490   double m_NomCryDimLZ;                  // Nominal crystal LZ
0491   std::vector<double> m_vecNomCryDimBF;  // Nominal crystal BF
0492   std::vector<double> m_vecNomCryDimCF;  // Nominal crystal CF
0493   std::vector<double> m_vecNomCryDimAR;  // Nominal crystal AR
0494   std::vector<double> m_vecNomCryDimBR;  // Nominal crystal BR
0495   std::vector<double> m_vecNomCryDimCR;  // Nominal crystal CR
0496 
0497   double m_UnderAF;  // undershoot of AF
0498   double m_UnderLZ;  // undershoot of LZ
0499   double m_UnderBF;  // undershoot of BF
0500   double m_UnderCF;  // undershoot of CF
0501   double m_UnderAR;  // undershoot of AR
0502   double m_UnderBR;  // undershoot of BR
0503   double m_UnderCR;  // undershoot of CR
0504 
0505   double m_WallThAlv;                  // alveoli wall thickness
0506   double m_WrapThAlv;                  // wrapping thickness
0507   double m_ClrThAlv;                   // clearance thickness (nominal)
0508   std::vector<double> m_vecGapAlvEta;  // Extra clearance after each alveoli perp to crystal axis
0509 
0510   double m_WallFrAlv;  // alveoli wall frontage
0511   double m_WrapFrAlv;  // wrapping frontage
0512   double m_ClrFrAlv;   // clearance frontage (nominal)
0513 
0514   double m_WallReAlv;  // alveoli wall rearage
0515   double m_WrapReAlv;  // wrapping rearage
0516   double m_ClrReAlv;   // clearance rearage (nominal)
0517 
0518   unsigned int m_NCryTypes;      // number of crystal shapes
0519   unsigned int m_NCryPerAlvEta;  // number of crystals in eta per alveolus
0520 
0521   std::string m_CryName;   // string name of crystal volume
0522   std::string m_ClrName;   // string name of clearance volume
0523   std::string m_WrapName;  // string name of wrap volume
0524   std::string m_WallName;  // string name of wall volume
0525 
0526   std::string m_CryMat;   // string name of crystal material
0527   std::string m_ClrMat;   // string name of clearance material
0528   std::string m_WrapMat;  // string name of wrap material
0529   std::string m_WallMat;  // string name of wall material
0530 
0531   std::string m_capName;  // Capsule
0532   double m_capHere;       //
0533   std::string m_capMat;   //
0534   double m_capXSize;      //
0535   double m_capYSize;      //
0536   double m_capThick;      //
0537 
0538   std::string m_CERName;  // Ceramic
0539   std::string m_CERMat;   //
0540   double m_CERXSize;      //
0541   double m_CERYSize;      //
0542   double m_CERThick;      //
0543 
0544   std::string m_BSiName;  // Bulk Silicon
0545   std::string m_BSiMat;   //
0546   double m_BSiXSize;      //
0547   double m_BSiYSize;      //
0548   double m_BSiThick;      //
0549 
0550   std::string m_APDName;  // APD
0551   std::string m_APDMat;   //
0552   double m_APDSide;       //
0553   double m_APDThick;      //
0554   double m_APDZ;          //
0555   double m_APDX1;         //
0556   double m_APDX2;         //
0557 
0558   std::string m_ATJName;  // After-The-Junction
0559   std::string m_ATJMat;   //
0560   double m_ATJThick;      //
0561 
0562   std::string m_SGLName;  // APD-Silicone glue
0563   std::string m_SGLMat;   //
0564   double m_SGLThick;      //
0565 
0566   std::string m_AGLName;  // APD-Glue
0567   std::string m_AGLMat;   //
0568   double m_AGLThick;      //
0569 
0570   std::string m_ANDName;  // APD-Non-Depleted
0571   std::string m_ANDMat;   //
0572   double m_ANDThick;      //
0573 
0574   double m_WebHere;                    // here flag
0575   std::string m_WebPlName;             // string name of web plate volume
0576   std::string m_WebClrName;            // string name of web clearance volume
0577   std::string m_WebPlMat;              // string name of web material
0578   std::string m_WebClrMat;             // string name of web clearance material
0579   std::vector<double> m_vecWebPlTh;    // Thickness of web plates
0580   std::vector<double> m_vecWebClrTh;   // Thickness of total web clearance
0581   std::vector<double> m_vecWebLength;  // Length of web plate
0582 
0583   double m_IlyHere;                      // here flag
0584   std::string m_IlyName;                 // string name of inner layer volume
0585   double m_IlyPhiLow;                    // low phi of volumes
0586   double m_IlyDelPhi;                    // delta phi of ily
0587   std::vector<std::string> m_vecIlyMat;  // materials of inner layer volumes
0588   std::vector<double> m_vecIlyThick;     // Thicknesses of inner layer volumes
0589 
0590   std::string m_IlyPipeName;               // Cooling pipes
0591   double m_IlyPipeHere;                    //
0592   std::string m_IlyPipeMat;                //
0593   double m_IlyPipeOD;                      //
0594   double m_IlyPipeID;                      //
0595   std::vector<double> m_vecIlyPipeLength;  //
0596   std::vector<double> m_vecIlyPipeType;    //
0597   std::vector<double> m_vecIlyPipePhi;     //
0598   std::vector<double> m_vecIlyPipeZ;       //
0599 
0600   std::string m_IlyPTMName;            // PTM
0601   double m_IlyPTMHere;                 //
0602   std::string m_IlyPTMMat;             //
0603   double m_IlyPTMWidth;                //
0604   double m_IlyPTMLength;               //
0605   double m_IlyPTMHeight;               //
0606   std::vector<double> m_vecIlyPTMZ;    //
0607   std::vector<double> m_vecIlyPTMPhi;  //
0608 
0609   std::string m_IlyFanOutName;            // FanOut
0610   double m_IlyFanOutHere;                 //
0611   std::string m_IlyFanOutMat;             //
0612   double m_IlyFanOutWidth;                //
0613   double m_IlyFanOutLength;               //
0614   double m_IlyFanOutHeight;               //
0615   std::vector<double> m_vecIlyFanOutZ;    //
0616   std::vector<double> m_vecIlyFanOutPhi;  //
0617   std::string m_IlyDiffName;              // Diffuser
0618   std::string m_IlyDiffMat;               //
0619   double m_IlyDiffOff;                    //
0620   double m_IlyDiffLength;                 //
0621   std::string m_IlyBndlName;              // Fiber bundle
0622   std::string m_IlyBndlMat;               //
0623   double m_IlyBndlOff;                    //
0624   double m_IlyBndlLength;                 //
0625   std::string m_IlyFEMName;               // FEM
0626   std::string m_IlyFEMMat;                //
0627   double m_IlyFEMWidth;                   //
0628   double m_IlyFEMLength;                  //
0629   double m_IlyFEMHeight;                  //
0630   std::vector<double> m_vecIlyFEMZ;       //
0631   std::vector<double> m_vecIlyFEMPhi;     //
0632 
0633   std::string m_HawRName;      // string name of half-alveolar wedge
0634   std::string m_FawName;       // string name of full-alveolar wedge
0635   double m_FawHere;            // here flag
0636   double m_HawRHBIG;           // height at big end of half alveolar wedge
0637   double m_HawRhsml;           // height at small end of half alveolar wedge
0638   double m_HawRCutY;           // x dim of hawR cut box
0639   double m_HawRCutZ;           // y dim of hawR cut box
0640   double m_HawRCutDelY;        // y offset of hawR cut box from top of HAW
0641   double m_HawYOffCry;         // Y offset of crystal wrt HAW at front
0642   unsigned int m_NFawPerSupm;  // Number of Full Alv. Wedges per supermodule
0643   double m_FawPhiOff;          // Phi offset for FAW placement
0644   double m_FawDelPhi;          // Phi delta for FAW placement
0645   double m_FawPhiRot;          // Phi rotation of FAW about own axis prior to placement
0646   double m_FawRadOff;          // Radial offset for FAW placement
0647 
0648   double m_GridHere;       // here flag
0649   std::string m_GridName;  // Grid name
0650   std::string m_GridMat;   // Grid material
0651   double m_GridThick;      // Grid Thickness
0652 
0653   double m_BackXOff;  //
0654   double m_BackYOff;  //
0655 
0656   double m_BackHere;                      // here flag
0657   std::string m_BackSideName;             // Back Sides
0658   double m_BackSideHere;                  //
0659   double m_BackSideLength;                //
0660   double m_BackSideHeight;                //
0661   double m_BackSideWidth;                 //
0662   double m_BackSideYOff1;                 //
0663   double m_BackSideYOff2;                 //
0664   double m_BackSideAngle;                 //
0665   std::string m_BackSideMat;              //
0666   std::string m_BackPlateName;            // back plate
0667   double m_BackPlateHere;                 //
0668   double m_BackPlateLength;               //
0669   double m_BackPlateThick;                //
0670   double m_BackPlateWidth;                //
0671   std::string m_BackPlateMat;             //
0672   std::string m_BackPlate2Name;           // back plate2
0673   double m_BackPlate2Thick;               //
0674   std::string m_BackPlate2Mat;            //
0675   std::string m_GrilleName;               // grille
0676   double m_GrilleHere;                    //
0677   double m_GrilleThick;                   //
0678   double m_GrilleWidth;                   //
0679   double m_GrilleZSpace;                  //
0680   std::string m_GrilleMat;                //
0681   std::vector<double> m_vecGrilleHeight;  //
0682   std::vector<double> m_vecGrilleZOff;    //
0683 
0684   std::string m_GrEdgeSlotName;  // Slots in Grille
0685   std::string m_GrEdgeSlotMat;   //
0686   double m_GrEdgeSlotHere;       //
0687   double m_GrEdgeSlotHeight;     //
0688   double m_GrEdgeSlotWidth;      //
0689 
0690   std::string m_GrMidSlotName;               // Slots in Grille
0691   std::string m_GrMidSlotMat;                //
0692   double m_GrMidSlotHere;                    //
0693   double m_GrMidSlotWidth;                   //
0694   double m_GrMidSlotXOff;                    //
0695   std::vector<double> m_vecGrMidSlotHeight;  //
0696 
0697   double m_BackPipeHere;                   // here flag
0698   std::string m_BackPipeName;              //
0699   std::vector<double> m_vecBackPipeDiam;   // pipes
0700   std::vector<double> m_vecBackPipeThick;  // pipes
0701   std::string m_BackPipeMat;               //
0702   std::string m_BackPipeWaterMat;          //
0703 
0704   std::vector<std::string> m_vecBackCoolName;  // cooling circuits
0705   double m_BackCoolHere;                       // here flag
0706   double m_BackCoolBarHere;                    // here flag
0707   double m_BackCoolBarWidth;                   //
0708   double m_BackCoolBarHeight;                  //
0709   std::string m_BackCoolMat;
0710   std::string m_BackCoolBarName;  // cooling bar
0711   double m_BackCoolBarThick;      //
0712   std::string m_BackCoolBarMat;
0713   std::string m_BackCoolBarSSName;  // cooling bar tubing
0714   double m_BackCoolBarSSThick;      //
0715   std::string m_BackCoolBarSSMat;
0716   std::string m_BackCoolBarWaName;  // cooling bar water
0717   double m_BackCoolBarWaThick;      //
0718   std::string m_BackCoolBarWaMat;
0719   double m_BackCoolVFEHere;  // here flag
0720   std::string m_BackCoolVFEName;
0721   std::string m_BackCoolVFEMat;
0722   std::string m_BackVFEName;
0723   std::string m_BackVFEMat;
0724   std::vector<double> m_vecBackVFELyrThick;      //
0725   std::vector<std::string> m_vecBackVFELyrName;  //
0726   std::vector<std::string> m_vecBackVFELyrMat;   //
0727   std::vector<double> m_vecBackCoolNSec;         //
0728   std::vector<double> m_vecBackCoolSecSep;       //
0729   std::vector<double> m_vecBackCoolNPerSec;      //
0730   double m_BackMiscHere;                         // here flag
0731   std::vector<double> m_vecBackMiscThick;        // misc materials
0732   std::vector<std::string> m_vecBackMiscName;    //
0733   std::vector<std::string> m_vecBackMiscMat;     //
0734   double m_BackCBStdSep;                         //
0735 
0736   double m_PatchPanelHere;                        // here flag
0737   std::string m_PatchPanelName;                   //
0738   std::vector<double> m_vecPatchPanelThick;       // patch panel materials
0739   std::vector<std::string> m_vecPatchPanelNames;  //
0740   std::vector<std::string> m_vecPatchPanelMat;    //
0741 
0742   double m_BackCoolTankHere;         // here flag
0743   std::string m_BackCoolTankName;    // service tank
0744   double m_BackCoolTankWidth;        //
0745   double m_BackCoolTankThick;        //
0746   std::string m_BackCoolTankMat;     //
0747   std::string m_BackCoolTankWaName;  //
0748   double m_BackCoolTankWaWidth;      //
0749   std::string m_BackCoolTankWaMat;   //
0750   std::string m_BackBracketName;     //
0751   double m_BackBracketHeight;        //
0752   std::string m_BackBracketMat;      //
0753 
0754   double m_DryAirTubeHere;                  // here flag
0755   std::string m_DryAirTubeName;             // dry air tube
0756   unsigned int m_MBCoolTubeNum;             //
0757   double m_DryAirTubeInnDiam;               //
0758   double m_DryAirTubeOutDiam;               //
0759   std::string m_DryAirTubeMat;              //
0760   double m_MBCoolTubeHere;                  // here flag
0761   std::string m_MBCoolTubeName;             // mothr bd cooling tube
0762   double m_MBCoolTubeInnDiam;               //
0763   double m_MBCoolTubeOutDiam;               //
0764   std::string m_MBCoolTubeMat;              //
0765   double m_MBManifHere;                     // here flag
0766   std::string m_MBManifName;                //mother bd manif
0767   double m_MBManifInnDiam;                  //
0768   double m_MBManifOutDiam;                  //
0769   std::string m_MBManifMat;                 //
0770   double m_MBLyrHere;                       // here flag
0771   std::vector<double> m_vecMBLyrThick;      // mother bd lyrs
0772   std::vector<std::string> m_vecMBLyrName;  //
0773   std::vector<std::string> m_vecMBLyrMat;   //
0774 
0775   //-------------------------------------------------------------------
0776 
0777   double m_PincerRodHere;                     // here flag
0778   std::string m_PincerRodName;                // pincer rod
0779   std::string m_PincerRodMat;                 //
0780   std::vector<double> m_vecPincerRodAzimuth;  //
0781 
0782   std::string m_PincerEnvName;             // pincer envelope
0783   std::string m_PincerEnvMat;              //
0784   double m_PincerEnvWidth;                 //
0785   double m_PincerEnvHeight;                //
0786   double m_PincerEnvLength;                //
0787   std::vector<double> m_vecPincerEnvZOff;  //
0788 
0789   std::string m_PincerBlkName;  // pincer block
0790   std::string m_PincerBlkMat;   //
0791   double m_PincerBlkLength;     //
0792 
0793   std::string m_PincerShim1Name;  // pincer shim
0794   double m_PincerShimHeight;      //
0795   std::string m_PincerShim2Name;  //
0796   std::string m_PincerShimMat;    //
0797   double m_PincerShim1Width;      //
0798   double m_PincerShim2Width;      //
0799 
0800   std::string m_PincerCutName;  // pincer block
0801   std::string m_PincerCutMat;   //
0802   double m_PincerCutWidth;      //
0803   double m_PincerCutHeight;     //
0804 };
0805 
0806 namespace std {}
0807 using namespace std;
0808 
0809 DDEcalBarrelNewAlgo::DDEcalBarrelNewAlgo()
0810     : m_idNameSpace(""),
0811       m_BarName(""),
0812       m_BarMat(""),
0813       m_vecBarZPts(),
0814       m_vecBarRMin(),
0815       m_vecBarRMax(),
0816       m_vecBarTran(),
0817       m_vecBarRota(),
0818       m_vecBarRota2(),
0819       m_vecBarRota3(),
0820       m_BarPhiLo(0),
0821       m_BarPhiHi(0),
0822       m_BarHere(0),
0823       m_SpmName(""),
0824       m_SpmMat(""),
0825       m_vecSpmZPts(),
0826       m_vecSpmRMin(),
0827       m_vecSpmRMax(),
0828       m_vecSpmTran(),
0829       m_vecSpmRota(),
0830       m_vecSpmBTran(),
0831       m_vecSpmBRota(),
0832       m_SpmNPerHalf(0),
0833       m_SpmLowPhi(0),
0834       m_SpmDelPhi(0),
0835       m_SpmPhiOff(0),
0836       m_vecSpmHere(),
0837       m_SpmCutName(""),
0838       m_SpmCutThick(0),
0839       m_SpmCutShow(0),
0840       m_vecSpmCutTM(),
0841       m_vecSpmCutTP(),
0842       m_SpmCutRM(0),
0843       m_SpmCutRP(0),
0844       m_SpmExpThick(0),
0845       m_SpmExpWide(0),
0846       m_SpmExpYOff(0),
0847       m_SpmSideName(""),
0848       m_SpmSideMat(""),
0849       m_SpmSideHigh(0),
0850       m_SpmSideThick(0),
0851       m_SpmSideYOffM(0),
0852       m_SpmSideYOffP(0),
0853       m_NomCryDimAF(0),
0854       m_NomCryDimLZ(0),
0855       m_vecNomCryDimBF(),
0856       m_vecNomCryDimCF(),
0857       m_vecNomCryDimAR(),
0858       m_vecNomCryDimBR(),
0859       m_vecNomCryDimCR(),
0860       m_UnderAF(0),
0861       m_UnderLZ(0),
0862       m_UnderBF(0),
0863       m_UnderCF(0),
0864       m_UnderAR(0),
0865       m_UnderBR(0),
0866       m_UnderCR(0),
0867       m_WallThAlv(0),
0868       m_WrapThAlv(0),
0869       m_ClrThAlv(0),
0870       m_vecGapAlvEta(),
0871       m_WallFrAlv(0),
0872       m_WrapFrAlv(0),
0873       m_ClrFrAlv(0),
0874       m_WallReAlv(0),
0875       m_WrapReAlv(0),
0876       m_ClrReAlv(0),
0877       m_NCryTypes(0),
0878       m_NCryPerAlvEta(0),
0879       m_CryName(""),
0880       m_ClrName(""),
0881       m_WrapName(""),
0882       m_WallName(""),
0883       m_CryMat(""),
0884       m_ClrMat(""),
0885       m_WrapMat(""),
0886       m_WallMat(""),
0887 
0888       m_capName(""),
0889       m_capHere(0),
0890       m_capMat(""),
0891       m_capXSize(0),
0892       m_capYSize(0),
0893       m_capThick(0),
0894 
0895       m_CERName(""),
0896       m_CERMat(""),
0897       m_CERXSize(0),
0898       m_CERYSize(0),
0899       m_CERThick(0),
0900 
0901       m_BSiName(""),
0902       m_BSiMat(""),
0903       m_BSiXSize(0),
0904       m_BSiYSize(0),
0905       m_BSiThick(0),
0906 
0907       m_APDName(""),
0908       m_APDMat(""),
0909       m_APDSide(0),
0910       m_APDThick(0),
0911       m_APDZ(0),
0912       m_APDX1(0),
0913       m_APDX2(0),
0914 
0915       m_ATJName(""),
0916       m_ATJMat(""),
0917       m_ATJThick(0),
0918 
0919       m_SGLName(""),
0920       m_SGLMat(""),
0921       m_SGLThick(0),
0922 
0923       m_AGLName(""),
0924       m_AGLMat(""),
0925       m_AGLThick(0),
0926 
0927       m_ANDName(""),
0928       m_ANDMat(""),
0929       m_ANDThick(0),
0930 
0931       m_WebHere(0),
0932       m_WebPlName(""),
0933       m_WebClrName(""),
0934       m_WebPlMat(""),
0935       m_WebClrMat(""),
0936       m_vecWebPlTh(),
0937       m_vecWebClrTh(),
0938       m_vecWebLength(),
0939       m_IlyHere(0),
0940       m_IlyName(),
0941       m_IlyPhiLow(0),
0942       m_IlyDelPhi(0),
0943       m_vecIlyMat(),
0944       m_vecIlyThick(),
0945       m_IlyPipeName(""),
0946       m_IlyPipeHere(0),
0947       m_IlyPipeMat(""),
0948       m_IlyPipeOD(0),
0949       m_IlyPipeID(0),
0950       m_vecIlyPipeLength(),
0951       m_vecIlyPipeType(),
0952       m_vecIlyPipePhi(),
0953       m_vecIlyPipeZ(),
0954       m_IlyPTMName(""),
0955       m_IlyPTMHere(0),
0956       m_IlyPTMMat(""),
0957       m_IlyPTMWidth(0),
0958       m_IlyPTMLength(0),
0959       m_IlyPTMHeight(0),
0960       m_vecIlyPTMZ(),
0961       m_vecIlyPTMPhi(),
0962       m_IlyFanOutName(""),
0963       m_IlyFanOutHere(0),
0964       m_IlyFanOutMat(""),
0965       m_IlyFanOutWidth(0),
0966       m_IlyFanOutLength(0),
0967       m_IlyFanOutHeight(0),
0968       m_vecIlyFanOutZ(),
0969       m_vecIlyFanOutPhi(),
0970       m_IlyDiffName(""),
0971       m_IlyDiffMat(""),
0972       m_IlyDiffOff(0),
0973       m_IlyDiffLength(0),
0974       m_IlyBndlName(""),
0975       m_IlyBndlMat(""),
0976       m_IlyBndlOff(0),
0977       m_IlyBndlLength(0),
0978       m_IlyFEMName(""),
0979       m_IlyFEMMat(""),
0980       m_IlyFEMWidth(0),
0981       m_IlyFEMLength(0),
0982       m_IlyFEMHeight(0),
0983       m_vecIlyFEMZ(),
0984       m_vecIlyFEMPhi(),
0985       m_HawRName(""),
0986       m_FawName(""),
0987       m_FawHere(0),
0988       m_HawRHBIG(0),
0989       m_HawRhsml(0),
0990       m_HawRCutY(0),
0991       m_HawRCutZ(0),
0992       m_HawRCutDelY(0),
0993       m_HawYOffCry(0),
0994       m_NFawPerSupm(0),
0995       m_FawPhiOff(0),
0996       m_FawDelPhi(0),
0997       m_FawPhiRot(0),
0998       m_FawRadOff(0),
0999       m_GridHere(0),
1000       m_GridName(""),
1001       m_GridMat(""),
1002       m_GridThick(0),
1003       m_BackXOff(0),
1004       m_BackYOff(0),
1005       m_BackHere(0),
1006       m_BackSideName(""),
1007       m_BackSideHere(0),
1008       m_BackSideLength(0),
1009       m_BackSideHeight(0),
1010       m_BackSideWidth(0),
1011       m_BackSideYOff1(0),
1012       m_BackSideYOff2(0),
1013       m_BackSideAngle(0),
1014       m_BackSideMat(""),
1015       m_BackPlateName(""),
1016       m_BackPlateHere(0),
1017       m_BackPlateLength(0),
1018       m_BackPlateThick(0),
1019       m_BackPlateWidth(0),
1020       m_BackPlateMat(""),
1021       m_BackPlate2Name(""),
1022       m_BackPlate2Thick(0),
1023       m_BackPlate2Mat(""),
1024       m_GrilleName(""),
1025       m_GrilleHere(0),
1026       m_GrilleThick(0),
1027       m_GrilleWidth(0),
1028       m_GrilleZSpace(0),
1029       m_GrilleMat(""),
1030       m_vecGrilleHeight(),
1031       m_vecGrilleZOff(),
1032       m_GrEdgeSlotName(""),
1033       m_GrEdgeSlotMat(""),
1034       m_GrEdgeSlotHere(0),
1035       m_GrEdgeSlotHeight(0),
1036       m_GrEdgeSlotWidth(0),
1037       m_GrMidSlotName(""),
1038       m_GrMidSlotMat(""),
1039       m_GrMidSlotHere(0),
1040       m_GrMidSlotWidth(0),
1041       m_GrMidSlotXOff(0),
1042       m_vecGrMidSlotHeight(),
1043       m_BackPipeHere(0),
1044       m_BackPipeName(""),
1045       m_vecBackPipeDiam(),
1046       m_vecBackPipeThick(),
1047       m_BackPipeMat(""),
1048       m_BackPipeWaterMat(""),
1049 
1050       m_vecBackCoolName(),
1051       m_BackCoolHere(0),
1052       m_BackCoolBarHere(0),
1053       m_BackCoolBarWidth(0),
1054       m_BackCoolBarHeight(0),
1055       m_BackCoolMat(""),
1056       m_BackCoolBarName(""),
1057       m_BackCoolBarThick(0),
1058       m_BackCoolBarMat(""),
1059       m_BackCoolBarSSName(""),
1060       m_BackCoolBarSSThick(0),
1061       m_BackCoolBarSSMat(""),
1062       m_BackCoolBarWaName(""),
1063       m_BackCoolBarWaThick(0),
1064       m_BackCoolBarWaMat(""),
1065       m_BackCoolVFEHere(0),
1066       m_BackCoolVFEName(""),
1067       m_BackCoolVFEMat(""),
1068       m_BackVFEName(""),
1069       m_BackVFEMat(""),
1070       m_vecBackVFELyrThick(),
1071       m_vecBackVFELyrName(),
1072       m_vecBackVFELyrMat(),
1073       m_vecBackCoolNSec(),
1074       m_vecBackCoolSecSep(),
1075       m_vecBackCoolNPerSec(),
1076 
1077       m_BackMiscHere(0),
1078       m_vecBackMiscThick(),
1079       m_vecBackMiscName(),
1080       m_vecBackMiscMat(),
1081       m_BackCBStdSep(0),
1082       m_PatchPanelHere(0),
1083       m_PatchPanelName(""),
1084       m_vecPatchPanelThick(),
1085       m_vecPatchPanelNames(),
1086       m_vecPatchPanelMat(),
1087       m_BackCoolTankHere(0),
1088       m_BackCoolTankName(""),
1089       m_BackCoolTankWidth(0),
1090       m_BackCoolTankThick(0),
1091       m_BackCoolTankMat(""),
1092       m_BackCoolTankWaName(""),
1093       m_BackCoolTankWaWidth(0),
1094       m_BackCoolTankWaMat(""),
1095       m_BackBracketName(""),
1096       m_BackBracketHeight(0),
1097       m_BackBracketMat(""),
1098 
1099       m_DryAirTubeHere(0),
1100       m_DryAirTubeName(""),
1101       m_MBCoolTubeNum(0),
1102       m_DryAirTubeInnDiam(0),
1103       m_DryAirTubeOutDiam(0),
1104       m_DryAirTubeMat(""),
1105       m_MBCoolTubeHere(0),
1106       m_MBCoolTubeName(""),
1107       m_MBCoolTubeInnDiam(0),
1108       m_MBCoolTubeOutDiam(0),
1109       m_MBCoolTubeMat(""),
1110       m_MBManifHere(0),
1111       m_MBManifName(""),
1112       m_MBManifInnDiam(0),
1113       m_MBManifOutDiam(0),
1114       m_MBManifMat(""),
1115       m_MBLyrHere(0),
1116       m_vecMBLyrThick(0),
1117       m_vecMBLyrName(),
1118       m_vecMBLyrMat(),
1119 
1120       m_PincerRodHere(0),
1121       m_PincerRodName(""),
1122       m_PincerRodMat(""),
1123       m_vecPincerRodAzimuth(),
1124       m_PincerEnvName(""),
1125       m_PincerEnvMat(""),
1126       m_PincerEnvWidth(0),
1127       m_PincerEnvHeight(0),
1128       m_PincerEnvLength(0),
1129       m_vecPincerEnvZOff(),
1130       m_PincerBlkName(""),
1131       m_PincerBlkMat(""),
1132       m_PincerBlkLength(0),
1133       m_PincerShim1Name(""),
1134       m_PincerShimHeight(0),
1135       m_PincerShim2Name(""),
1136       m_PincerShimMat(""),
1137       m_PincerShim1Width(0),
1138       m_PincerShim2Width(0),
1139       m_PincerCutName(""),
1140       m_PincerCutMat(""),
1141       m_PincerCutWidth(0),
1142       m_PincerCutHeight(0)
1143 
1144 {
1145 #ifdef EDM_ML_DEBUG
1146   edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Creating an instance";
1147 #endif
1148 }
1149 
1150 DDEcalBarrelNewAlgo::~DDEcalBarrelNewAlgo() {}
1151 
1152 void DDEcalBarrelNewAlgo::initialize(const DDNumericArguments& nArgs,
1153                                      const DDVectorArguments& vArgs,
1154                                      const DDMapArguments& /*mArgs*/,
1155                                      const DDStringArguments& sArgs,
1156                                      const DDStringVectorArguments& vsArgs) {
1157 #ifdef EDM_ML_DEBUG
1158   edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: Initialize";
1159 #endif
1160   m_idNameSpace = DDCurrentNamespace::ns();
1161   // TRICK!
1162   m_idNameSpace = parent().name().ns();
1163   // barrel parent volume
1164   m_BarName = sArgs["BarName"];
1165   m_BarMat = sArgs["BarMat"];
1166   m_vecBarZPts = vArgs["BarZPts"];
1167   m_vecBarRMin = vArgs["BarRMin"];
1168   m_vecBarRMax = vArgs["BarRMax"];
1169   m_vecBarTran = vArgs["BarTran"];
1170   m_vecBarRota = vArgs["BarRota"];
1171   m_vecBarRota2 = vArgs["BarRota2"];
1172   m_vecBarRota3 = vArgs["BarRota3"];
1173   m_BarPhiLo = nArgs["BarPhiLo"];
1174   m_BarPhiHi = nArgs["BarPhiHi"];
1175   m_BarHere = nArgs["BarHere"];
1176 
1177   m_SpmName = sArgs["SpmName"];
1178   m_SpmMat = sArgs["SpmMat"];
1179   m_vecSpmZPts = vArgs["SpmZPts"];
1180   m_vecSpmRMin = vArgs["SpmRMin"];
1181   m_vecSpmRMax = vArgs["SpmRMax"];
1182   m_vecSpmTran = vArgs["SpmTran"];
1183   m_vecSpmRota = vArgs["SpmRota"];
1184   m_vecSpmBTran = vArgs["SpmBTran"];
1185   m_vecSpmBRota = vArgs["SpmBRota"];
1186   m_SpmNPerHalf = static_cast<unsigned int>(nArgs["SpmNPerHalf"]);
1187   m_SpmLowPhi = nArgs["SpmLowPhi"];
1188   m_SpmDelPhi = nArgs["SpmDelPhi"];
1189   m_SpmPhiOff = nArgs["SpmPhiOff"];
1190   m_vecSpmHere = vArgs["SpmHere"];
1191   m_SpmCutName = sArgs["SpmCutName"];
1192   m_SpmCutThick = nArgs["SpmCutThick"];
1193   m_SpmCutShow = int(nArgs["SpmCutShow"]);
1194   m_vecSpmCutTM = vArgs["SpmCutTM"];
1195   m_vecSpmCutTP = vArgs["SpmCutTP"];
1196   m_SpmCutRM = nArgs["SpmCutRM"];
1197   m_SpmCutRP = nArgs["SpmCutRP"];
1198   m_SpmExpThick = nArgs["SpmExpThick"];
1199   m_SpmExpWide = nArgs["SpmExpWide"];
1200   m_SpmExpYOff = nArgs["SpmExpYOff"];
1201   m_SpmSideName = sArgs["SpmSideName"];
1202   m_SpmSideMat = sArgs["SpmSideMat"];
1203   m_SpmSideHigh = nArgs["SpmSideHigh"];
1204   m_SpmSideThick = nArgs["SpmSideThick"];
1205   m_SpmSideYOffM = nArgs["SpmSideYOffM"];
1206   m_SpmSideYOffP = nArgs["SpmSideYOffP"];
1207 
1208   m_NomCryDimAF = nArgs["NomCryDimAF"];
1209   m_NomCryDimLZ = nArgs["NomCryDimLZ"];
1210   m_vecNomCryDimBF = vArgs["NomCryDimBF"];
1211   m_vecNomCryDimCF = vArgs["NomCryDimCF"];
1212   m_vecNomCryDimAR = vArgs["NomCryDimAR"];
1213   m_vecNomCryDimBR = vArgs["NomCryDimBR"];
1214   m_vecNomCryDimCR = vArgs["NomCryDimCR"];
1215 
1216   m_UnderAF = nArgs["UnderAF"];
1217   m_UnderLZ = nArgs["UnderLZ"];
1218   m_UnderBF = nArgs["UnderBF"];
1219   m_UnderCF = nArgs["UnderCF"];
1220   m_UnderAR = nArgs["UnderAR"];
1221   m_UnderBR = nArgs["UnderBR"];
1222   m_UnderCR = nArgs["UnderCR"];
1223 
1224   m_WallThAlv = nArgs["WallThAlv"];
1225   m_WrapThAlv = nArgs["WrapThAlv"];
1226   m_ClrThAlv = nArgs["ClrThAlv"];
1227   m_vecGapAlvEta = vArgs["GapAlvEta"];
1228 
1229   m_WallFrAlv = nArgs["WallFrAlv"];
1230   m_WrapFrAlv = nArgs["WrapFrAlv"];
1231   m_ClrFrAlv = nArgs["ClrFrAlv"];
1232 
1233   m_WallReAlv = nArgs["WallReAlv"];
1234   m_WrapReAlv = nArgs["WrapReAlv"];
1235   m_ClrReAlv = nArgs["ClrReAlv"];
1236 
1237   m_NCryTypes = static_cast<unsigned int>(nArgs["NCryTypes"]);
1238   m_NCryPerAlvEta = static_cast<unsigned int>(nArgs["NCryPerAlvEta"]);
1239 
1240   m_CryName = sArgs["CryName"];
1241   m_ClrName = sArgs["ClrName"];
1242   m_WrapName = sArgs["WrapName"];
1243   m_WallName = sArgs["WallName"];
1244 
1245   m_CryMat = sArgs["CryMat"];
1246   m_ClrMat = sArgs["ClrMat"];
1247   m_WrapMat = sArgs["WrapMat"];
1248   m_WallMat = sArgs["WallMat"];
1249 
1250   m_capName = sArgs["CapName"];
1251   m_capHere = nArgs["CapHere"];
1252   m_capMat = sArgs["CapMat"];
1253   m_capXSize = nArgs["CapXSize"];
1254   m_capYSize = nArgs["CapYSize"];
1255   m_capThick = nArgs["CapThick"];
1256 
1257   m_CERName = sArgs["CerName"];
1258   m_CERMat = sArgs["CerMat"];
1259   m_CERXSize = nArgs["CerXSize"];
1260   m_CERYSize = nArgs["CerYSize"];
1261   m_CERThick = nArgs["CerThick"];
1262 
1263   m_BSiName = sArgs["BSiName"];
1264   m_BSiMat = sArgs["BSiMat"];
1265   m_BSiXSize = nArgs["BSiXSize"];
1266   m_BSiYSize = nArgs["BSiYSize"];
1267   m_BSiThick = nArgs["BSiThick"];
1268 
1269   m_APDName = sArgs["APDName"];
1270   m_APDMat = sArgs["APDMat"];
1271   m_APDSide = nArgs["APDSide"];
1272   m_APDThick = nArgs["APDThick"];
1273   m_APDZ = nArgs["APDZ"];
1274   m_APDX1 = nArgs["APDX1"];
1275   m_APDX2 = nArgs["APDX2"];
1276 
1277   m_ATJName = sArgs["ATJName"];
1278   m_ATJMat = sArgs["ATJMat"];
1279   m_ATJThick = nArgs["ATJThick"];
1280 
1281   m_SGLName = sArgs["SGLName"];
1282   m_SGLMat = sArgs["SGLMat"];
1283   m_SGLThick = nArgs["SGLThick"];
1284 
1285   m_AGLName = sArgs["AGLName"];
1286   m_AGLMat = sArgs["AGLMat"];
1287   m_AGLThick = nArgs["AGLThick"];
1288 
1289   m_ANDName = sArgs["ANDName"];
1290   m_ANDMat = sArgs["ANDMat"];
1291   m_ANDThick = nArgs["ANDThick"];
1292 
1293   m_WebHere = nArgs["WebHere"];
1294   m_WebPlName = sArgs["WebPlName"];
1295   m_WebClrName = sArgs["WebClrName"];
1296   m_WebPlMat = sArgs["WebPlMat"];
1297   m_WebClrMat = sArgs["WebClrMat"];
1298   m_vecWebPlTh = vArgs["WebPlTh"];
1299   m_vecWebClrTh = vArgs["WebClrTh"];
1300   m_vecWebLength = vArgs["WebLength"];
1301 
1302   m_IlyHere = nArgs["IlyHere"];
1303   m_IlyName = sArgs["IlyName"];
1304   m_IlyPhiLow = nArgs["IlyPhiLow"];
1305   m_IlyDelPhi = nArgs["IlyDelPhi"];
1306   m_vecIlyMat = vsArgs["IlyMat"];
1307   m_vecIlyThick = vArgs["IlyThick"];
1308 
1309   m_IlyPipeName = sArgs["IlyPipeName"];
1310   m_IlyPipeHere = nArgs["IlyPipeHere"];
1311   m_IlyPipeMat = sArgs["IlyPipeMat"];
1312   m_IlyPipeOD = nArgs["IlyPipeOD"];
1313   m_IlyPipeID = nArgs["IlyPipeID"];
1314   m_vecIlyPipeLength = vArgs["IlyPipeLength"];
1315   m_vecIlyPipeType = vArgs["IlyPipeType"];
1316   m_vecIlyPipePhi = vArgs["IlyPipePhi"];
1317   m_vecIlyPipeZ = vArgs["IlyPipeZ"];
1318 
1319   m_IlyPTMName = sArgs["IlyPTMName"];
1320   m_IlyPTMHere = nArgs["IlyPTMHere"];
1321   m_IlyPTMMat = sArgs["IlyPTMMat"];
1322   m_IlyPTMWidth = nArgs["IlyPTMWidth"];
1323   m_IlyPTMLength = nArgs["IlyPTMLength"];
1324   m_IlyPTMHeight = nArgs["IlyPTMHeight"];
1325   m_vecIlyPTMZ = vArgs["IlyPTMZ"];
1326   m_vecIlyPTMPhi = vArgs["IlyPTMPhi"];
1327 
1328   m_IlyFanOutName = sArgs["IlyFanOutName"];
1329   m_IlyFanOutHere = nArgs["IlyFanOutHere"];
1330   m_IlyFanOutMat = sArgs["IlyFanOutMat"];
1331   m_IlyFanOutWidth = nArgs["IlyFanOutWidth"];
1332   m_IlyFanOutLength = nArgs["IlyFanOutLength"];
1333   m_IlyFanOutHeight = nArgs["IlyFanOutHeight"];
1334   m_vecIlyFanOutZ = vArgs["IlyFanOutZ"];
1335   m_vecIlyFanOutPhi = vArgs["IlyFanOutPhi"];
1336   m_IlyDiffName = sArgs["IlyDiffName"];
1337   m_IlyDiffMat = sArgs["IlyDiffMat"];
1338   m_IlyDiffOff = nArgs["IlyDiffOff"];
1339   m_IlyDiffLength = nArgs["IlyDiffLength"];
1340   m_IlyBndlName = sArgs["IlyBndlName"];
1341   m_IlyBndlMat = sArgs["IlyBndlMat"];
1342   m_IlyBndlOff = nArgs["IlyBndlOff"];
1343   m_IlyBndlLength = nArgs["IlyBndlLength"];
1344   m_IlyFEMName = sArgs["IlyFEMName"];
1345   m_IlyFEMMat = sArgs["IlyFEMMat"];
1346   m_IlyFEMWidth = nArgs["IlyFEMWidth"];
1347   m_IlyFEMLength = nArgs["IlyFEMLength"];
1348   m_IlyFEMHeight = nArgs["IlyFEMHeight"];
1349   m_vecIlyFEMZ = vArgs["IlyFEMZ"];
1350   m_vecIlyFEMPhi = vArgs["IlyFEMPhi"];
1351 
1352   m_HawRName = sArgs["HawRName"];
1353   m_FawName = sArgs["FawName"];
1354   m_FawHere = nArgs["FawHere"];
1355   m_HawRHBIG = nArgs["HawRHBIG"];
1356   m_HawRhsml = nArgs["HawRhsml"];
1357   m_HawRCutY = nArgs["HawRCutY"];
1358   m_HawRCutZ = nArgs["HawRCutZ"];
1359   m_HawRCutDelY = nArgs["HawRCutDelY"];
1360   m_HawYOffCry = nArgs["HawYOffCry"];
1361 
1362   m_NFawPerSupm = static_cast<unsigned int>(nArgs["NFawPerSupm"]);
1363   m_FawPhiOff = nArgs["FawPhiOff"];
1364   m_FawDelPhi = nArgs["FawDelPhi"];
1365   m_FawPhiRot = nArgs["FawPhiRot"];
1366   m_FawRadOff = nArgs["FawRadOff"];
1367 
1368   m_GridHere = nArgs["GridHere"];
1369   m_GridName = sArgs["GridName"];
1370   m_GridMat = sArgs["GridMat"];
1371   m_GridThick = nArgs["GridThick"];
1372 
1373   m_BackHere = nArgs["BackHere"];
1374   m_BackXOff = nArgs["BackXOff"];
1375   m_BackYOff = nArgs["BackYOff"];
1376   m_BackSideName = sArgs["BackSideName"];
1377   m_BackSideHere = nArgs["BackSideHere"];
1378   m_BackSideLength = nArgs["BackSideLength"];
1379   m_BackSideHeight = nArgs["BackSideHeight"];
1380   m_BackSideWidth = nArgs["BackSideWidth"];
1381   m_BackSideYOff1 = nArgs["BackSideYOff1"];
1382   m_BackSideYOff2 = nArgs["BackSideYOff2"];
1383   m_BackSideAngle = nArgs["BackSideAngle"];
1384   m_BackSideMat = sArgs["BackSideMat"];
1385   m_BackPlateName = sArgs["BackPlateName"];
1386   m_BackPlateHere = nArgs["BackPlateHere"];
1387   m_BackPlateLength = nArgs["BackPlateLength"];
1388   m_BackPlateThick = nArgs["BackPlateThick"];
1389   m_BackPlateWidth = nArgs["BackPlateWidth"];
1390   m_BackPlateMat = sArgs["BackPlateMat"];
1391   m_BackPlate2Name = sArgs["BackPlate2Name"];
1392   m_BackPlate2Thick = nArgs["BackPlate2Thick"];
1393   m_BackPlate2Mat = sArgs["BackPlate2Mat"];
1394   m_GrilleName = sArgs["GrilleName"];
1395   m_GrilleHere = nArgs["GrilleHere"];
1396   m_GrilleThick = nArgs["GrilleThick"];
1397   m_GrilleWidth = nArgs["GrilleWidth"];
1398   m_GrilleZSpace = nArgs["GrilleZSpace"];
1399   m_GrilleMat = sArgs["GrilleMat"];
1400   m_vecGrilleHeight = vArgs["GrilleHeight"];
1401   m_vecGrilleZOff = vArgs["GrilleZOff"];
1402 
1403   m_GrEdgeSlotName = sArgs["GrEdgeSlotName"];
1404   m_GrEdgeSlotMat = sArgs["GrEdgeSlotMat"];
1405   m_GrEdgeSlotHere = nArgs["GrEdgeSlotHere"];
1406   m_GrEdgeSlotHeight = nArgs["GrEdgeSlotHeight"];
1407   m_GrEdgeSlotWidth = nArgs["GrEdgeSlotWidth"];
1408   m_GrMidSlotName = sArgs["GrMidSlotName"];
1409   m_GrMidSlotMat = sArgs["GrMidSlotMat"];
1410   m_GrMidSlotHere = nArgs["GrMidSlotHere"];
1411   m_GrMidSlotWidth = nArgs["GrMidSlotWidth"];
1412   m_GrMidSlotXOff = nArgs["GrMidSlotXOff"];
1413   m_vecGrMidSlotHeight = vArgs["GrMidSlotHeight"];
1414 
1415   m_BackPipeHere = nArgs["BackPipeHere"];
1416   m_BackPipeName = sArgs["BackPipeName"];
1417   m_vecBackPipeDiam = vArgs["BackPipeDiam"];
1418   m_vecBackPipeThick = vArgs["BackPipeThick"];
1419   m_BackPipeMat = sArgs["BackPipeMat"];
1420   m_BackPipeWaterMat = sArgs["BackPipeWaterMat"];
1421 
1422   m_BackCoolHere = nArgs["BackCoolHere"];
1423   m_vecBackCoolName = vsArgs["BackCoolName"];
1424   m_BackCoolBarHere = nArgs["BackCoolBarHere"];
1425   m_BackCoolBarWidth = nArgs["BackCoolBarWidth"];
1426   m_BackCoolBarHeight = nArgs["BackCoolBarHeight"];
1427   m_BackCoolMat = sArgs["BackCoolMat"];
1428   m_BackCoolBarName = sArgs["BackCoolBarName"];
1429   m_BackCoolBarThick = nArgs["BackCoolBarThick"];
1430   m_BackCoolBarMat = sArgs["BackCoolBarMat"];
1431   m_BackCoolBarSSName = sArgs["BackCoolBarSSName"];
1432   m_BackCoolBarSSThick = nArgs["BackCoolBarSSThick"];
1433   m_BackCoolBarSSMat = sArgs["BackCoolBarSSMat"];
1434   m_BackCoolBarWaName = sArgs["BackCoolBarWaName"];
1435   m_BackCoolBarWaThick = nArgs["BackCoolBarWaThick"];
1436   m_BackCoolBarWaMat = sArgs["BackCoolBarWaMat"];
1437   m_BackCoolVFEHere = nArgs["BackCoolVFEHere"];
1438   m_BackCoolVFEName = sArgs["BackCoolVFEName"];
1439   m_BackCoolVFEMat = sArgs["BackCoolVFEMat"];
1440   m_BackVFEName = sArgs["BackVFEName"];
1441   m_BackVFEMat = sArgs["BackVFEMat"];
1442   m_vecBackVFELyrThick = vArgs["BackVFELyrThick"];
1443   m_vecBackVFELyrName = vsArgs["BackVFELyrName"];
1444   m_vecBackVFELyrMat = vsArgs["BackVFELyrMat"];
1445   m_vecBackCoolNSec = vArgs["BackCoolNSec"];
1446   m_vecBackCoolSecSep = vArgs["BackCoolSecSep"];
1447   m_vecBackCoolNPerSec = vArgs["BackCoolNPerSec"];
1448   m_BackCBStdSep = nArgs["BackCBStdSep"];
1449 
1450   m_BackMiscHere = nArgs["BackMiscHere"];
1451   m_vecBackMiscThick = vArgs["BackMiscThick"];
1452   m_vecBackMiscName = vsArgs["BackMiscName"];
1453   m_vecBackMiscMat = vsArgs["BackMiscMat"];
1454   m_PatchPanelHere = nArgs["PatchPanelHere"];
1455   m_vecPatchPanelThick = vArgs["PatchPanelThick"];
1456   m_vecPatchPanelNames = vsArgs["PatchPanelNames"];
1457   m_vecPatchPanelMat = vsArgs["PatchPanelMat"];
1458   m_PatchPanelName = sArgs["PatchPanelName"];
1459 
1460   m_BackCoolTankHere = nArgs["BackCoolTankHere"];
1461   m_BackCoolTankName = sArgs["BackCoolTankName"];
1462   m_BackCoolTankWidth = nArgs["BackCoolTankWidth"];
1463   m_BackCoolTankThick = nArgs["BackCoolTankThick"];
1464   m_BackCoolTankMat = sArgs["BackCoolTankMat"];
1465   m_BackCoolTankWaName = sArgs["BackCoolTankWaName"];
1466   m_BackCoolTankWaWidth = nArgs["BackCoolTankWaWidth"];
1467   m_BackCoolTankWaMat = sArgs["BackCoolTankWaMat"];
1468   m_BackBracketName = sArgs["BackBracketName"];
1469   m_BackBracketHeight = nArgs["BackBracketHeight"];
1470   m_BackBracketMat = sArgs["BackBracketMat"];
1471 
1472   m_DryAirTubeHere = nArgs["DryAirTubeHere"];
1473   m_DryAirTubeName = sArgs["DryAirTubeName"];
1474   m_MBCoolTubeNum = static_cast<unsigned int>(nArgs["MBCoolTubeNum"]);
1475   m_DryAirTubeInnDiam = nArgs["DryAirTubeInnDiam"];
1476   m_DryAirTubeOutDiam = nArgs["DryAirTubeOutDiam"];
1477   m_DryAirTubeMat = sArgs["DryAirTubeMat"];
1478   m_MBCoolTubeHere = nArgs["MBCoolTubeHere"];
1479   m_MBCoolTubeName = sArgs["MBCoolTubeName"];
1480   m_MBCoolTubeInnDiam = nArgs["MBCoolTubeInnDiam"];
1481   m_MBCoolTubeOutDiam = nArgs["MBCoolTubeOutDiam"];
1482   m_MBCoolTubeMat = sArgs["MBCoolTubeMat"];
1483   m_MBManifHere = nArgs["MBManifHere"];
1484   m_MBManifName = sArgs["MBManifName"];
1485   m_MBManifInnDiam = nArgs["MBManifInnDiam"];
1486   m_MBManifOutDiam = nArgs["MBManifOutDiam"];
1487   m_MBManifMat = sArgs["MBManifMat"];
1488   m_MBLyrHere = nArgs["MBLyrHere"];
1489   m_vecMBLyrThick = vArgs["MBLyrThick"];
1490   m_vecMBLyrName = vsArgs["MBLyrName"];
1491   m_vecMBLyrMat = vsArgs["MBLyrMat"];
1492 
1493   m_PincerRodHere = nArgs["PincerRodHere"];
1494   m_PincerRodName = sArgs["PincerRodName"];
1495   m_PincerRodMat = sArgs["PincerRodMat"];
1496   m_vecPincerRodAzimuth = vArgs["PincerRodAzimuth"];
1497   m_PincerEnvName = sArgs["PincerEnvName"];
1498   m_PincerEnvMat = sArgs["PincerEnvMat"];
1499   m_PincerEnvWidth = nArgs["PincerEnvWidth"];
1500   m_PincerEnvHeight = nArgs["PincerEnvHeight"];
1501   m_PincerEnvLength = nArgs["PincerEnvLength"];
1502   m_vecPincerEnvZOff = vArgs["PincerEnvZOff"];
1503   m_PincerBlkName = sArgs["PincerBlkName"];
1504   m_PincerBlkMat = sArgs["PincerBlkMat"];
1505   m_PincerBlkLength = nArgs["PincerBlkLength"];
1506   m_PincerShim1Name = sArgs["PincerShim1Name"];
1507   m_PincerShimHeight = nArgs["PincerShimHeight"];
1508   m_PincerShim2Name = sArgs["PincerShim2Name"];
1509   m_PincerShimMat = sArgs["PincerShimMat"];
1510   m_PincerShim1Width = nArgs["PincerShim1Width"];
1511   m_PincerShim2Width = nArgs["PincerShim2Width"];
1512   m_PincerCutName = sArgs["PincerCutName"];
1513   m_PincerCutMat = sArgs["PincerCutMat"];
1514   m_PincerCutWidth = nArgs["PincerCutWidth"];
1515   m_PincerCutHeight = nArgs["PincerCutHeight"];
1516 
1517 #ifdef EDM_ML_DEBUG
1518   edm::LogVerbatim("EcalGeom") << "DDEcalBarrelAlgo info: end initialize";
1519 #endif
1520 }
1521 
1522 ////////////////////////////////////////////////////////////////////
1523 // DDEcalBarrelAlgo methods...
1524 ////////////////////////////////////////////////////////////////////
1525 
1526 void DDEcalBarrelNewAlgo::execute(DDCompactView& cpv) {
1527 #ifdef EDM_ML_DEBUG
1528   edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo execute!" << std::endl;
1529 #endif
1530   if (barHere() != 0) {
1531     const unsigned int copyOne(1);
1532     const unsigned int copyTwo(2);
1533     // Barrel parent volume----------------------------------------------------------
1534     cpv.position(
1535         DDLogicalPart(barName(),
1536                       barMat(),
1537                       DDSolidFactory::polycone(
1538                           barName(), barPhiLo(), (barPhiHi() - barPhiLo()), vecBarZPts(), vecBarRMin(), vecBarRMax())),
1539         parent().name(),
1540         copyOne,
1541         DDTranslation(vecBarTran()[0], vecBarTran()[1], vecBarTran()[2]),
1542         myrot(barName().name() + "Rot",
1543               Rota(Vec3(vecBarRota3()[0], vecBarRota3()[1], vecBarRota3()[2]), vecBarRota3()[3]) *
1544                   Rota(Vec3(vecBarRota2()[0], vecBarRota2()[1], vecBarRota2()[2]), vecBarRota2()[3]) *
1545                   Rota(Vec3(vecBarRota()[0], vecBarRota()[1], vecBarRota()[2]), vecBarRota()[3])));
1546 #ifdef EDM_ML_DEBUG
1547     edm::LogVerbatim("EBGeom") << barName() << " PolyCone from " << barPhiLo() / CLHEP::deg << " to "
1548                                << barPhiHi() / CLHEP::deg << " with " << vecBarZPts().size() << " points";
1549     for (unsigned int k = 0; k < vecBarZPts().size(); ++k)
1550       edm::LogVerbatim("EBGeom") << "[" << k << "] " << vecBarZPts()[k] << ":" << vecBarRMin()[k] << ":"
1551                                  << vecBarRMax()[k];
1552     edm::LogVerbatim("EBGeomX") << barName() << ":" << copyOne << " positioned in " << parent().name() << " at "
1553                                 << DDTranslation(vecBarTran()[0], vecBarTran()[1], vecBarTran()[2]) << " with rotation";
1554 #endif
1555     // End Barrel parent volume----------------------------------------------------------
1556 
1557     // Supermodule parent------------------------------------------------------------
1558 
1559     const DDName spmcut1ddname((0 != spmCutShow()) ? spmName() : ddname(m_SpmName + "CUT1"));
1560     const DDSolid ddspm(
1561         DDSolidFactory::polycone(spmcut1ddname, spmLowPhi(), spmDelPhi(), vecSpmZPts(), vecSpmRMin(), vecSpmRMax()));
1562 #ifdef EDM_ML_DEBUG
1563     edm::LogVerbatim("EBGeom") << spmcut1ddname << " PolyCone from " << spmLowPhi() / CLHEP::deg << " to "
1564                                << (spmLowPhi() + spmDelPhi()) / CLHEP::deg << " with " << vecSpmZPts().size()
1565                                << " points";
1566     for (unsigned int k = 0; k < vecSpmZPts().size(); ++k)
1567       edm::LogVerbatim("EBGeom") << "[" << k << "] " << vecSpmZPts()[k] << ":" << vecSpmRMin()[k] << ":"
1568                                  << vecSpmRMax()[k];
1569 #endif
1570 
1571     const unsigned int indx(vecSpmRMax().size() / 2);
1572 
1573     // Deal with the cut boxes first
1574     const DDSolid spmCutBox(DDSolidFactory::box(spmCutName(),
1575                                                 1.05 * (vecSpmRMax()[indx] - vecSpmRMin()[indx]) / 2.,
1576                                                 spmCutThick() / 2.,
1577                                                 fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2. + 1 * mm));
1578 #ifdef EDM_ML_DEBUG
1579     edm::LogVerbatim("EBGeom") << spmCutName() << " Box " << 1.05 * (vecSpmRMax()[indx] - vecSpmRMin()[indx]) / 2.
1580                                << ":" << spmCutThick() / 2. << ":"
1581                                << (fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2. + 1 * mm);
1582 #endif
1583     const std::vector<double>& cutBoxParms(spmCutBox.parameters());
1584     const DDLogicalPart spmCutLog(spmCutName(), spmMat(), spmCutBox);
1585     /*
1586     // Now the expansion box
1587     const double xExp(spmExpThick() / 2.);
1588     const double yExp(spmExpWide() / 2.);
1589     const double zExp(fabs(vecSpmZPts().back() - vecSpmZPts().front()) / 2.);
1590     const DDName expName(m_SpmName + "EXP");
1591     const DDSolid spmExpBox(DDSolidFactory::box(expName, xExp, yExp, zExp));
1592 #ifdef EDM_ML_DEBUG
1593     edm::LogVerbatim("EBGeom") << expName << " Box " << xExp << ":" << yExp << ":" << zExp;
1594 #endif
1595     const DDTranslation expTra(vecSpmRMax().back() - xExp, spmExpYOff(), vecSpmZPts().front() + zExp);
1596     const DDLogicalPart expLog(expName, spmMat(), spmExpBox);
1597 
1598     const DDName unionName ( ddname( m_SpmName + "UNI" ) ) ;
1599       if( 0 != spmCutShow() )
1600       {
1601      cpv.position( expLog, spmName(), copyOne, expTra, DDRotation() ) ;
1602       }
1603       else
1604       {
1605      const DDSolid unionSolid ( DDSolidFactory::unionSolid(
1606                        unionName,
1607                        spmcut1ddname, expName,
1608                        expTra, DDRotation() ) ) ;
1609                        }
1610     */
1611 
1612     // Supermodule side platess
1613     const DDSolid sideSolid(DDSolidFactory::box(
1614         spmSideName(), spmSideHigh() / 2., spmSideThick() / 2., fabs(vecSpmZPts()[1] - vecSpmZPts()[0]) / 2.));
1615 #ifdef EDM_ML_DEBUG
1616     edm::LogVerbatim("EBGeom") << spmSideName() << " Box " << spmSideHigh() / 2. << ":" << spmSideThick() / 2. << ":"
1617                                << fabs(vecSpmZPts()[1] - vecSpmZPts()[0]) / 2.;
1618 #endif
1619     const std::vector<double>& sideParms(sideSolid.parameters());
1620     const DDLogicalPart sideLog(spmSideName(), spmSideMat(), sideSolid);
1621 
1622     DDSolid temp1;
1623     DDSolid temp2;
1624     for (unsigned int icopy(1); icopy <= 2; ++icopy) {
1625       const std::vector<double>& tvec(1 == icopy ? vecSpmCutTM() : vecSpmCutTP());
1626       const double rang(1 == icopy ? spmCutRM() : spmCutRP());
1627 
1628       const Tl3D tr(tvec[0], tvec[1], tvec[2]);
1629       const RoZ3D ro(rang);
1630       const Tf3D alltrot(
1631           RoZ3D(1 == icopy ? spmLowPhi() : spmLowPhi() + spmDelPhi()) *
1632           Tl3D((vecSpmRMax()[indx] + vecSpmRMin()[indx]) / 2., 0, (vecSpmZPts().front() + vecSpmZPts().back()) / 2.) *
1633           tr * ro);
1634 
1635       const DDRotation ddrot(myrot(spmCutName().name() + std::to_string(icopy), alltrot.getRotation()));
1636       const DDTranslation ddtra(alltrot.getTranslation());
1637 
1638       const Tl3D trSide(tvec[0],
1639                         tvec[1] + (1 == icopy ? 1. : -1.) * (cutBoxParms[1] + sideParms[1]) +
1640                             (1 == icopy ? spmSideYOffM() : spmSideYOffP()),
1641                         tvec[2]);
1642       const RoZ3D roSide(rang);
1643       const Tf3D sideRot(RoZ3D(1 == icopy ? spmLowPhi() : spmLowPhi() + spmDelPhi()) *
1644                          Tl3D(vecSpmRMin().front() + sideParms[0], 0, vecSpmZPts().front() + sideParms[2]) * trSide *
1645                          roSide);
1646 
1647       const DDRotation sideddrot(myrot(spmSideName().name() + std::to_string(icopy), sideRot.getRotation()));
1648       const DDTranslation sideddtra(sideRot.getTranslation());
1649 
1650       cpv.position(sideLog, spmName(), icopy, sideddtra, sideddrot);
1651 #ifdef EDM_ML_DEBUG
1652       edm::LogVerbatim("EBGeomX") << sideLog.name() << ":" << icopy << " positioned in " << spmName() << " at "
1653                                   << sideddtra << " with rotation";
1654 #endif
1655       if (0 != spmCutShow())  // do this if we are "showing" the boxes
1656       {
1657         cpv.position(spmCutLog, spmName(), icopy, ddtra, ddrot);
1658 #ifdef EDM_ML_DEBUG
1659         edm::LogVerbatim("EBGeomX") << spmCutLog.name() << ":" << icopy << " positioned in " << spmName() << " at "
1660                                     << ddtra << " with rotation";
1661 #endif
1662       } else  // do this if we are subtracting the boxes
1663       {
1664         if (1 == icopy) {
1665           temp1 = DDSolidFactory::subtraction(DDName(m_SpmName + "_T1"), spmcut1ddname, spmCutBox, ddtra, ddrot);
1666 #ifdef EDM_ML_DEBUG
1667           edm::LogVerbatim("EBGeom") << DDName(m_SpmName + "_T1") << " Subtraction " << spmcut1ddname << ":"
1668                                      << spmCutBox.name() << " at " << ddtra;
1669 #endif
1670         } else {
1671           temp2 = DDSolidFactory::subtraction(spmName(), temp1, spmCutBox, ddtra, ddrot);
1672 #ifdef EDM_ML_DEBUG
1673           edm::LogVerbatim("EBGeom") << spmName() << " Subtraction " << temp1.name() << ":" << spmCutBox.name()
1674                                      << " at " << ddtra;
1675 #endif
1676         }
1677       }
1678     }
1679 
1680     const DDLogicalPart spmLog(spmName(), spmMat(), ((0 != spmCutShow()) ? ddspm : temp2));
1681 
1682     const double dphi(360. * deg / (1. * spmNPerHalf()));
1683     for (unsigned int iphi(0); iphi < 2 * spmNPerHalf(); ++iphi) {
1684       const double phi(iphi * dphi + spmPhiOff());  //- 0.000130/deg ) ;
1685 
1686       // this base rotation includes the base translation & rotation
1687       // plus flipping for the negative z hemisphere, plus
1688       // the phi rotation for this module
1689       const Tf3D rotaBase(RoZ3D(phi) * (iphi < spmNPerHalf() ? Ro3D() : RoX3D(180. * deg)) *
1690                           Ro3D(vecSpmBRota()[3], Vec3(vecSpmBRota()[0], vecSpmBRota()[1], vecSpmBRota()[2])) *
1691                           Tl3D(Vec3(vecSpmBTran()[0], vecSpmBTran()[1], vecSpmBTran()[2])));
1692 
1693       // here the individual rotations & translations of the supermodule
1694       // are implemented on top of the overall "base" rotation & translation
1695 
1696       const unsigned int offr(4 * iphi);
1697       const unsigned int offt(3 * iphi);
1698 
1699       const Ro3D r1(vecSpmRota()[offr + 3],
1700                     Vec3(vecSpmRota()[offr + 0], vecSpmRota()[offr + 1], vecSpmRota()[offr + 2]));
1701 
1702       const Tf3D rotaExtra(r1 * Tl3D(Vec3(vecSpmTran()[offt + 0], vecSpmTran()[offt + 1], vecSpmTran()[offt + 2])));
1703 
1704       const Tf3D both(rotaExtra * rotaBase);
1705 
1706       const DDRotation rota(myrot(spmName().name() + std::to_string(phi / deg), both.getRotation()));
1707 
1708       if (vecSpmHere()[iphi] != 0) {
1709         // convert from CLHEP to DDTranslation & etc. -- Michael Case
1710         DDTranslation myTran(both.getTranslation().x(), both.getTranslation().y(), both.getTranslation().z());
1711         cpv.position(spmLog, barName(), iphi + 1, myTran, rota);
1712 #ifdef EDM_ML_DEBUG
1713         edm::LogVerbatim("EBGeomX") << spmLog.name() << ":" << (iphi + 1) << " positioned in " << barName() << " at "
1714                                     << myTran << " with rotation";
1715 #endif
1716       }
1717     }
1718     // End Supermodule parent------------------------------------------------------------
1719 
1720     // Begin Inner Layer volumes---------------------------------------------------------
1721     const double ilyLength(vecSpmZPts()[1] - vecSpmZPts()[0]);
1722     double ilyRMin(vecSpmRMin()[0]);
1723     double ilyThick(0);
1724     for (unsigned int ilyx(0); ilyx != vecIlyThick().size(); ++ilyx) {
1725       ilyThick += vecIlyThick()[ilyx];
1726     }
1727     const DDName ilyDDName(ddname(ilyName()));
1728     const DDSolid ilySolid(
1729         DDSolidFactory::tubs(ilyDDName, ilyLength / 2, ilyRMin, ilyRMin + ilyThick, ilyPhiLow(), ilyDelPhi()));
1730 #ifdef EDM_ML_DEBUG
1731     edm::LogVerbatim("EBGeom") << ilyDDName << " Tubs " << ilyLength / 2 << ":" << ilyRMin << ":" << ilyRMin + ilyThick
1732                                << ":" << ilyPhiLow() / CLHEP::deg << ":" << ilyDelPhi() / CLHEP::deg;
1733 #endif
1734     const DDLogicalPart ilyLog(ilyDDName, spmMat(), ilySolid);
1735     cpv.position(ilyLog, spmLog, copyOne, DDTranslation(0, 0, ilyLength / 2), DDRotation());
1736 #ifdef EDM_ML_DEBUG
1737     edm::LogVerbatim("EBGeomX") << ilyDDName << ":" << copyOne << " positioned in " << spmLog.name() << " at "
1738                                 << DDTranslation(0, 0, ilyLength / 2) << " with no rotation";
1739 #endif
1740     DDLogicalPart ilyPipeLog[200];
1741 
1742     if (0 != ilyPipeHere()) {
1743       for (unsigned int iPipeType(0); iPipeType != vecIlyPipeLength().size(); ++iPipeType) {
1744         const DDName pName(ddname(ilyPipeName() + "_" + std::to_string(iPipeType + 1)));
1745 
1746         DDSolid ilyPipeSolid(
1747             DDSolidFactory::tubs(pName, vecIlyPipeLength()[iPipeType] / 2., 0, ilyPipeOD() / 2, 0 * deg, 360 * deg));
1748 #ifdef EDM_ML_DEBUG
1749         edm::LogVerbatim("EBGeom") << pName << " Tubs " << vecIlyPipeLength()[iPipeType] / 2.
1750                                    << ":0:" << ilyPipeOD() / 2 << ":0:360";
1751 #endif
1752         ilyPipeLog[iPipeType] = DDLogicalPart(pName, ilyPipeMat(), ilyPipeSolid);
1753 
1754         const DDName pWaName(ddname(ilyPipeName() + "Wa_" + std::to_string(iPipeType + 1)));
1755         DDSolid ilyPipeWaSolid(
1756             DDSolidFactory::tubs(pWaName, vecIlyPipeLength()[iPipeType] / 2., 0, ilyPipeID() / 2, 0 * deg, 360 * deg));
1757 #ifdef EDM_ML_DEBUG
1758         edm::LogVerbatim("EBGeom") << pWaName << " Tubs " << vecIlyPipeLength()[iPipeType] / 2.
1759                                    << ":0:" << ilyPipeID() / 2 << ":0:360";
1760 #endif
1761         const DDLogicalPart ilyPipeWaLog(pWaName, backPipeWaterMat(), ilyPipeWaSolid);
1762 
1763         cpv.position(ilyPipeWaLog, pName, copyOne, DDTranslation(0, 0, 0), DDRotation());
1764 #ifdef EDM_ML_DEBUG
1765         edm::LogVerbatim("EBGeomX") << pWaName << ":" << copyOne << " positioned in " << pName << " at "
1766                                     << DDTranslation(0, 0, 0) << " with no rotation";
1767 #endif
1768       }
1769     }
1770 
1771     DDSolid ilyPTMSolid(
1772         DDSolidFactory::box(ilyPTMName(), ilyPTMHeight() / 2., ilyPTMWidth() / 2., ilyPTMLength() / 2.));
1773 #ifdef EDM_ML_DEBUG
1774     edm::LogVerbatim("EBGeom") << ilyPTMName() << " Box " << ilyPTMHeight() / 2. << ":" << ilyPTMWidth() / 2. << ":"
1775                                << ilyPTMLength() / 2.;
1776 #endif
1777     const DDLogicalPart ilyPTMLog(ilyPTMName(), ilyPTMMat(), ilyPTMSolid);
1778 
1779     DDSolid ilyFanOutSolid(
1780         DDSolidFactory::box(ilyFanOutName(), ilyFanOutHeight() / 2., ilyFanOutWidth() / 2., ilyFanOutLength() / 2.));
1781 #ifdef EDM_ML_DEBUG
1782     edm::LogVerbatim("EBGeom") << ilyFanOutName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1783                                << ":" << ilyFanOutLength() / 2.;
1784 #endif
1785     const DDLogicalPart ilyFanOutLog(ilyFanOutName(), ilyFanOutMat(), ilyFanOutSolid);
1786 
1787     DDSolid ilyFEMSolid(
1788         DDSolidFactory::box(ilyFEMName(), ilyFEMHeight() / 2., ilyFEMWidth() / 2., ilyFEMLength() / 2.));
1789 #ifdef EDM_ML_DEBUG
1790     edm::LogVerbatim("EBGeom") << ilyFEMName() << " Box " << ilyFEMHeight() / 2. << ":" << ilyFEMWidth() / 2. << ":"
1791                                << ilyFEMLength() / 2.;
1792 #endif
1793     const DDLogicalPart ilyFEMLog(ilyFEMName(), ilyFEMMat(), ilyFEMSolid);
1794 
1795     DDSolid ilyDiffSolid(
1796         DDSolidFactory::box(ilyDiffName(), ilyFanOutHeight() / 2., ilyFanOutWidth() / 2., ilyDiffLength() / 2.));
1797 #ifdef EDM_ML_DEBUG
1798     edm::LogVerbatim("EBGeom") << ilyDiffName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1799                                << ":" << ilyDiffLength() / 2.;
1800 #endif
1801     const DDLogicalPart ilyDiffLog(ilyDiffName(), ilyDiffMat(), ilyDiffSolid);
1802 
1803     DDSolid ilyBndlSolid(
1804         DDSolidFactory::box(ilyBndlName(), ilyFanOutHeight() / 2., ilyFanOutWidth() / 2., ilyBndlLength() / 2.));
1805 #ifdef EDM_ML_DEBUG
1806     edm::LogVerbatim("EBGeom") << ilyBndlName() << " Box " << ilyFanOutHeight() / 2. << ":" << ilyFanOutWidth() / 2.
1807                                << ":" << ilyBndlLength() / 2.;
1808 #endif
1809     const DDLogicalPart ilyBndlLog(ilyBndlName(), ilyBndlMat(), ilyBndlSolid);
1810     cpv.position(ilyDiffLog,
1811                  ilyFanOutName(),
1812                  copyOne,
1813                  DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff()),
1814                  DDRotation());
1815 #ifdef EDM_ML_DEBUG
1816     edm::LogVerbatim("EBGeomX") << ilyDiffName() << ":" << copyOne << " positioned in " << ilyFanOutName() << " at "
1817                                 << DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyDiffLength() / 2 + ilyDiffOff())
1818                                 << " with no rotation";
1819 #endif
1820     cpv.position(ilyBndlLog,
1821                  ilyFanOutName(),
1822                  copyOne,
1823                  DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff()),
1824                  DDRotation());
1825 #ifdef EDM_ML_DEBUG
1826     edm::LogVerbatim("EBGeomX") << ilyBndlName() << ":" << copyOne << " positioned in " << ilyFanOutName() << " at "
1827                                 << DDTranslation(0, 0, -ilyFanOutLength() / 2 + ilyBndlLength() / 2 + ilyBndlOff())
1828                                 << " with no rotation";
1829 #endif
1830     for (unsigned int ily(0); ily != vecIlyThick().size(); ++ily) {
1831       const double ilyRMax(ilyRMin + vecIlyThick()[ily]);
1832       const DDName xilyName(ddname(ilyName() + std::to_string(ily)));
1833       const DDSolid xilySolid(
1834           DDSolidFactory::tubs(xilyName, ilyLength / 2, ilyRMin, ilyRMax, ilyPhiLow(), ilyDelPhi()));
1835 #ifdef EDM_ML_DEBUG
1836       edm::LogVerbatim("EBGeom") << xilyName << " Tubs " << ilyLength / 2 << ":" << ilyRMin << ":" << ilyRMax << ":"
1837                                  << ilyPhiLow() / CLHEP::deg << ":" << ilyDelPhi() / CLHEP::deg;
1838 #endif
1839 
1840       const DDLogicalPart xilyLog(xilyName, ddmat(vecIlyMat()[ily]), xilySolid);
1841 
1842       if (0 != ilyHere()) {
1843         cpv.position(xilyLog, ilyLog, copyOne, DDTranslation(0, 0, 0), DDRotation());
1844 #ifdef EDM_ML_DEBUG
1845         edm::LogVerbatim("EBGeomX") << xilyLog.name() << ":" << copyOne << " positioned in " << ilyLog.name() << " at "
1846                                     << DDTranslation(0, 0, 0) << " with no rotation";
1847 #endif
1848         unsigned int copyNum[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
1849 
1850         if (10 * mm < vecIlyThick()[ily] && vecIlyThick().size() != (ily + 1) && 0 != ilyPipeHere()) {
1851           if (0 != ilyPTMHere()) {
1852             unsigned int ptmCopy(0);
1853             for (unsigned int ilyPTM(0); ilyPTM != vecIlyPTMZ().size(); ++ilyPTM) {
1854               const double radius(ilyRMax - 1 * mm - ilyPTMHeight() / 2.);
1855               const double phi(vecIlyPTMPhi()[ilyPTM]);
1856               const double yy(radius * sin(phi));
1857               const double xx(radius * cos(phi));
1858               ++ptmCopy;
1859               cpv.position(ilyPTMLog,
1860                            xilyLog,
1861                            ptmCopy,
1862                            DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2),
1863                            myrot(ilyPTMLog.name().name() + "_rot" + std::to_string(ptmCopy), CLHEP::HepRotationZ(phi)));
1864 #ifdef EDM_ML_DEBUG
1865               edm::LogVerbatim("EBGeomX")
1866                   << ilyPTMLog.name() << ":" << ptmCopy << " positioned in " << xilyLog.name() << " at "
1867                   << DDTranslation(xx, yy, vecIlyPTMZ()[ilyPTM] - ilyLength / 2) << " with rotation";
1868 #endif
1869             }
1870           }
1871           if (0 != ilyFanOutHere()) {
1872             unsigned int fanOutCopy(0);
1873             for (unsigned int ilyFO(0); ilyFO != vecIlyFanOutZ().size(); ++ilyFO) {
1874               const double radius(ilyRMax - 1 * mm - ilyFanOutHeight() / 2.);
1875               const double phi(vecIlyFanOutPhi()[ilyFO]);
1876               const double yy(radius * sin(phi));
1877               const double xx(radius * cos(phi));
1878               ++fanOutCopy;
1879               cpv.position(ilyFanOutLog,
1880                            xilyLog,
1881                            fanOutCopy,
1882                            DDTranslation(xx, yy, vecIlyFanOutZ()[ilyFO] - ilyLength / 2),
1883                            myrot(ilyFanOutLog.name().name() + "_rot" + std::to_string(fanOutCopy),
1884                                  CLHEP::HepRotationZ(phi) * CLHEP::HepRotationY(180 * deg)));
1885 #ifdef EDM_ML_DEBUG
1886               edm::LogVerbatim("EBGeomX")
1887                   << ilyFanOutLog.name() << ":" << fanOutCopy << " positioned in " << xilyLog.name() << " at "
1888                   << DDTranslation(xx, yy, vecIlyFanOutZ()[ilyFO] - ilyLength / 2) << " with rotation";
1889 #endif
1890             }
1891             unsigned int femCopy(0);
1892             for (unsigned int ilyFEM(0); ilyFEM != vecIlyFEMZ().size(); ++ilyFEM) {
1893               const double radius(ilyRMax - 1 * mm - ilyFEMHeight() / 2.);
1894               const double phi(vecIlyFEMPhi()[ilyFEM]);
1895               const double yy(radius * sin(phi));
1896               const double xx(radius * cos(phi));
1897               ++femCopy;
1898               cpv.position(ilyFEMLog,
1899                            xilyLog,
1900                            femCopy,
1901                            DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2),
1902                            myrot(ilyFEMLog.name().name() + "_rot" + std::to_string(femCopy), CLHEP::HepRotationZ(phi)));
1903 #ifdef EDM_ML_DEBUG
1904               edm::LogVerbatim("EBGeomX")
1905                   << ilyFEMLog.name() << ":" << femCopy << " positioned in " << xilyLog.name() << " at "
1906                   << DDTranslation(xx, yy, vecIlyFEMZ()[ilyFEM] - ilyLength / 2) << " with rotation";
1907 #endif
1908             }
1909           }
1910           for (unsigned int iPipe(0); iPipe != vecIlyPipePhi().size(); ++iPipe) {
1911             const unsigned int type(static_cast<unsigned int>(round(vecIlyPipeType()[iPipe])));
1912             //        edm::LogVerbatim("EcalGeom") <<" iPipe, type= " << iPipe << ", " << type;
1913             const double zz(-ilyLength / 2 + vecIlyPipeZ()[iPipe] + (9 > type ? vecIlyPipeLength()[type] / 2. : 0));
1914 
1915             for (unsigned int ly(0); ly != 2; ++ly) {
1916               const double radius(0 == ly ? ilyRMin + ilyPipeOD() / 2. + 1 * mm : ilyRMax - ilyPipeOD() / 2. - 1 * mm);
1917               const double phi(vecIlyPipePhi()[iPipe]);
1918               const double yy(radius * sin(phi));
1919               const double xx(radius * cos(phi));
1920               ++copyNum[type],
1921                   cpv.position(
1922                       ilyPipeLog[type],
1923                       xilyLog,
1924                       copyNum[type],
1925                       DDTranslation(xx, yy, zz),
1926                       (9 > type ? DDRotation()
1927                                 : myrot(ilyPipeLog[type].name().name() + "_rot" + std::to_string(copyNum[type]),
1928                                         Rota(Vec3(xx, yy, 0), 90 * deg))));
1929 #ifdef EDM_ML_DEBUG
1930               std::string rrr = (9 > type) ? " with no rotation" : " with rotation";
1931               edm::LogVerbatim("EBGeomX") << ilyPipeLog[type].name() << ":" << copyNum[type] << " positioned in "
1932                                           << xilyLog.name() << " at" << DDTranslation(xx, yy, zz) << rrr;
1933 #endif
1934             }
1935           }
1936         }
1937       }
1938       ilyRMin = ilyRMax;
1939     }
1940     // End Inner Layer volumes---------------------------------------------------------
1941 
1942     const DDName clyrName(DDName("ECLYR"));
1943     std::vector<double> cri;
1944     std::vector<double> cro;
1945     std::vector<double> czz;
1946     czz.emplace_back(vecSpmZPts()[1]);
1947     cri.emplace_back(vecSpmRMin()[0]);
1948     cro.emplace_back(vecSpmRMin()[0] + 25 * mm);
1949     czz.emplace_back(vecSpmZPts()[2]);
1950     cri.emplace_back(vecSpmRMin()[2]);
1951     cro.emplace_back(vecSpmRMin()[2] + 10 * mm);
1952     const DDSolid clyrSolid(DDSolidFactory::polycone(clyrName, -9.5 * deg, 19 * deg, czz, cri, cro));
1953 #ifdef EDM_ML_DEBUG
1954     edm::LogVerbatim("EBGeom") << clyrName << " PolyCone from -9.5 to 9.5 with " << czz.size() << " points";
1955     for (unsigned int k = 0; k < czz.size(); ++k)
1956       edm::LogVerbatim("EBGeom") << "[" << k << "] " << czz[k] << ":" << cri[k] << ":" << cro[k];
1957 #endif
1958     const DDLogicalPart clyrLog(clyrName, ddmat(vecIlyMat()[4]), clyrSolid);
1959     cpv.position(clyrLog, spmLog, copyOne, DDTranslation(0, 0, 0), DDRotation());
1960 #ifdef EDM_ML_DEBUG
1961     edm::LogVerbatim("EBGeomX") << clyrLog.name() << ":" << copyOne << " positioned in " << spmLog.name() << " at "
1962                                 << DDTranslation(0, 0, 0) << " with no rotation";
1963 #endif
1964     // Begin Alveolar Wedge parent ------------------------------------------------------
1965     //----------------
1966 
1967     // the next few lines accumulate dimensions appropriate to crystal type 1
1968     // which we use to set some of the features of the half-alveolar wedge (hawR).
1969 
1970     //      const double ANom1 ( vecNomCryDimAR()[0] ) ;
1971     const double BNom1(vecNomCryDimCR()[0]);
1972     const double bNom1(vecNomCryDimCF()[0]);
1973     //      const double HNom1 ( vecNomCryDimBR()[0] ) ;
1974     //      const double hNom1 ( vecNomCryDimBF()[0] ) ;
1975     const double sWall1(wallThAlv());
1976     const double fWall1(wallFrAlv());
1977     //      const double rWall1( wallReAlv() ) ;
1978     const double sWrap1(wrapThAlv());
1979     const double fWrap1(wrapFrAlv());
1980     //      const double rWrap1( wrapReAlv() ) ;
1981     const double sClr1(clrThAlv());
1982     const double fClr1(clrFrAlv());
1983     //      const double rClr1 ( clrReAlv() ) ;
1984     const double LNom1(nomCryDimLZ());
1985     const double beta1(atan((BNom1 - bNom1) / LNom1));
1986     //      const double cosbeta1   ( cos( beta1 ) ) ;
1987     const double sinbeta1(sin(beta1));
1988 
1989     const double tana_hawR((BNom1 - bNom1) / LNom1);
1990 
1991     const double H_hawR(hawRHBIG());
1992     const double h_hawR(hawRhsml());
1993     const double a_hawR(bNom1 + sClr1 + 2 * sWrap1 + 2 * sWall1 - sinbeta1 * (fClr1 + fWrap1 + fWall1));
1994     const double B_hawR(a_hawR + H_hawR * tana_hawR);
1995     const double b_hawR(a_hawR + h_hawR * tana_hawR);
1996     const double L_hawR(vecSpmZPts()[2]);
1997 
1998     const Trap trapHAWR(a_hawR / 2.,  //double aHalfLengthXNegZLoY , // bl1, A/2
1999                         a_hawR / 2.,  //double aHalfLengthXPosZLoY , // bl2, a/2
2000                         b_hawR / 2.,  //double aHalfLengthXPosZHiY , // tl2, b/2
2001                         H_hawR / 2.,  //double aHalfLengthYNegZ    , // h1, H/2
2002                         h_hawR / 2.,  //double aHalfLengthYPosZ    , // h2, h/2
2003                         L_hawR / 2.,  //double aHalfLengthZ        , // dz,  L/2
2004                         90 * deg,     //double aAngleAD            , // alfa1
2005                         0,            //double aCoord15X           , // x15
2006                         0             //double aCoord15Y             // y15
2007     );
2008 
2009     const DDName hawRName1(ddname(hawRName().name() + "1"));
2010     const DDSolid hawRSolid1(mytrap(hawRName1.name(), trapHAWR));
2011     const DDLogicalPart hawRLog1(hawRName1, spmMat(), hawRSolid1);
2012 
2013     const double al1_fawR(atan((B_hawR - a_hawR) / H_hawR) + M_PI_2);
2014 
2015     // here is trap for Full Alveolar Wedge
2016     const Trap trapFAW(a_hawR,       //double aHalfLengthXNegZLoY , // bl1, A/2
2017                        a_hawR,       //double aHalfLengthXPosZLoY , // bl2, a/2
2018                        b_hawR,       //double aHalfLengthXPosZHiY , // tl2, b/2
2019                        H_hawR / 2.,  //double aHalfLengthYNegZ    , // h1, H/2
2020                        h_hawR / 2.,  //double aHalfLengthYPosZ    , // h2, h/2
2021                        L_hawR / 2.,  //double aHalfLengthZ        , // dz,  L/2
2022                        al1_fawR,     //double aAngleAD            , // alfa1
2023                        0,            //double aCoord15X           , // x15
2024                        0             //double aCoord15Y             // y15
2025     );
2026 
2027     const DDName fawName1(ddname(fawName().name() + "1"));
2028     const DDSolid fawSolid1(mytrap(fawName1.name(), trapFAW));
2029     const DDLogicalPart fawLog1(fawName1, spmMat(), fawSolid1);
2030 
2031     const Trap::VertexList vHAW(trapHAWR.vertexList());
2032     const Trap::VertexList vFAW(trapFAW.vertexList());
2033 
2034     const double hawBoxClr(1 * mm);
2035 
2036     // HAW cut box to cut off back end of wedge
2037     const DDName hawCutName(ddname(hawRName().name() + "CUTBOX"));
2038     const DDSolid hawCutBox(DDSolidFactory::box(hawCutName, b_hawR / 2 + hawBoxClr, hawRCutY() / 2, hawRCutZ() / 2));
2039 #ifdef EDM_ML_DEBUG
2040     edm::LogVerbatim("EBGeom") << hawCutName << " Box " << (b_hawR / 2 + hawBoxClr) << ":" << hawRCutY() / 2 << ":"
2041                                << hawRCutZ() / 2;
2042 #endif
2043     const std::vector<double>& hawBoxParms(hawCutBox.parameters());
2044     const DDLogicalPart hawCutLog(hawCutName, spmMat(), hawCutBox);
2045 
2046     const Pt3D b1(hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
2047     const Pt3D b2(-hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]);
2048     const Pt3D b3(-hawBoxParms[0], hawBoxParms[1], -hawBoxParms[2]);
2049 
2050     const double zDel(sqrt(4 * hawBoxParms[2] * hawBoxParms[2] - (h_hawR - hawRCutDelY()) * (h_hawR - hawRCutDelY())));
2051 
2052     const Tf3D hawCutForm(b1,
2053                           b2,
2054                           b3,
2055                           vHAW[2] + Pt3D(hawBoxClr, -hawRCutDelY(), 0),
2056                           vHAW[1] + Pt3D(-hawBoxClr, -hawRCutDelY(), 0),
2057                           Pt3D(vHAW[0].x() - hawBoxClr, vHAW[0].y(), vHAW[0].z() - zDel));
2058 
2059     const DDSolid hawRSolid(DDSolidFactory::subtraction(
2060         hawRName(),
2061         hawRSolid1,
2062         hawCutBox,
2063         DDTranslation(
2064             hawCutForm.getTranslation().x(), hawCutForm.getTranslation().y(), hawCutForm.getTranslation().z()),
2065         myrot(hawCutName.name() + "R", hawCutForm.getRotation())));
2066 #ifdef EDM_ML_DEBUG
2067     edm::LogVerbatim("EBGeom") << hawRName() << " Subtraction " << hawRSolid1.name() << ":" << hawCutBox.name()
2068                                << " at "
2069                                << DDTranslation(hawCutForm.getTranslation().x(),
2070                                                 hawCutForm.getTranslation().y(),
2071                                                 hawCutForm.getTranslation().z());
2072 #endif
2073     const DDLogicalPart hawRLog(hawRName(), spmMat(), hawRSolid);
2074 
2075     // FAW cut box to cut off back end of wedge
2076     const DDName fawCutName(ddname(fawName().name() + "CUTBOX"));
2077     const DDSolid fawCutBox(DDSolidFactory::box(fawCutName, 2 * hawBoxParms[0], hawBoxParms[1], hawBoxParms[2]));
2078 #ifdef EDM_ML_DEBUG
2079     edm::LogVerbatim("EBGeom") << fawCutName << " Box " << 2 * hawBoxParms[0] << ":" << hawBoxParms[1] << ":"
2080                                << hawBoxParms[2];
2081 #endif
2082 
2083     const std::vector<double>& fawBoxParms(fawCutBox.parameters());
2084     const DDLogicalPart fawCutLog(fawCutName, spmMat(), fawCutBox);
2085 
2086     const Pt3D bb1(fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
2087     const Pt3D bb2(-fawBoxParms[0], fawBoxParms[1], fawBoxParms[2]);
2088     const Pt3D bb3(-fawBoxParms[0], fawBoxParms[1], -fawBoxParms[2]);
2089 
2090     const Tf3D fawCutForm(bb1,
2091                           bb2,
2092                           bb3,
2093                           vFAW[2] + Pt3D(2 * hawBoxClr, -5 * mm, 0),
2094                           vFAW[1] + Pt3D(-2 * hawBoxClr, -5 * mm, 0),
2095                           Pt3D(vFAW[1].x() - 2 * hawBoxClr, vFAW[1].y() - trapFAW.h(), vFAW[1].z() - zDel));
2096 
2097     const DDSolid fawSolid(DDSolidFactory::subtraction(
2098         fawName(),
2099         fawSolid1,
2100         fawCutBox,
2101         DDTranslation(
2102             fawCutForm.getTranslation().x(), fawCutForm.getTranslation().y(), fawCutForm.getTranslation().z()),
2103         myrot(fawCutName.name() + "R", fawCutForm.getRotation())));
2104 #ifdef EDM_ML_DEBUG
2105     edm::LogVerbatim("EBGeom") << fawName() << " Subtraction " << fawSolid1.name() << ":" << fawCutBox.name() << " at "
2106                                << DDTranslation(fawCutForm.getTranslation().x(),
2107                                                 fawCutForm.getTranslation().y(),
2108                                                 fawCutForm.getTranslation().z());
2109 #endif
2110     const DDLogicalPart fawLog(fawName(), spmMat(), fawSolid);
2111 
2112     const Tf3D hawRform(vHAW[3],
2113                         vHAW[0],
2114                         vHAW[1],  // HAW inside FAW
2115                         vFAW[3],
2116                         0.5 * (vFAW[0] + vFAW[3]),
2117                         0.5 * (vFAW[1] + vFAW[2]));
2118     cpv.position(
2119         hawRLog,
2120         fawLog,
2121         copyOne,
2122         DDTranslation(hawRform.getTranslation().x(), hawRform.getTranslation().y(), hawRform.getTranslation().z()),
2123         myrot(hawRName().name() + "R", hawRform.getRotation()));
2124 #ifdef EDM_ML_DEBUG
2125     edm::LogVerbatim("EBGeomX") << hawRLog.name() << ":" << copyOne << " positioned in " << fawLog.name() << " at "
2126                                 << DDTranslation(hawRform.getTranslation().x(),
2127                                                  hawRform.getTranslation().y(),
2128                                                  hawRform.getTranslation().z())
2129                                 << " with rotation";
2130 #endif
2131     cpv.position(
2132         hawRLog,
2133         fawLog,
2134         copyTwo,
2135         DDTranslation(-hawRform.getTranslation().x(), -hawRform.getTranslation().y(), -hawRform.getTranslation().z()),
2136         myrot(hawRName().name() + "RotRefl",
2137               CLHEP::HepRotationY(180 * deg) *  // rotate about Y after refl thru Z
2138                   CLHEP::HepRep3x3(1, 0, 0, 0, 1, 0, 0, 0, -1)));
2139 #ifdef EDM_ML_DEBUG
2140     edm::LogVerbatim("EBGeomX") << hawRLog.name() << ":" << copyTwo << " positioned in " << fawLog.name() << " at "
2141                                 << DDTranslation(-hawRform.getTranslation().x(),
2142                                                  -hawRform.getTranslation().y(),
2143                                                  -hawRform.getTranslation().z())
2144                                 << " with rotation";
2145 #endif
2146     /* this for display of haw cut box instead of subtraction
2147       cpv.position( hawCutLog,
2148          hawRName, 
2149          copyOne, 
2150          hawCutForm.getTranslation(),
2151          myrot( hawCutName.name()+"R", 
2152             hawCutForm.getRotation() )   ) ;
2153 */
2154 
2155     for (unsigned int iPhi(1); iPhi <= nFawPerSupm(); ++iPhi) {
2156       const double rPhi(fawPhiOff() + (iPhi - 0.5) * fawDelPhi());
2157 
2158       const Tf3D fawform(RoZ3D(rPhi) * Tl3D(fawRadOff() + (trapFAW.H() + trapFAW.h()) / 4, 0, trapFAW.L() / 2) *
2159                          RoZ3D(-90 * deg + fawPhiRot()));
2160       if (fawHere())
2161         cpv.position(
2162             fawLog,
2163             spmLog,
2164             iPhi,
2165             DDTranslation(fawform.getTranslation().x(), fawform.getTranslation().y(), fawform.getTranslation().z()),
2166             myrot(fawName().name() + "_Rot" + std::to_string(iPhi), fawform.getRotation()));
2167 #ifdef EDM_ML_DEBUG
2168       edm::LogVerbatim("EBGeomX") << fawLog.name() << ":" << iPhi << " positioned in " << spmLog.name() << " at "
2169                                   << DDTranslation(fawform.getTranslation().x(),
2170                                                    fawform.getTranslation().y(),
2171                                                    fawform.getTranslation().z())
2172                                   << " with rotation";
2173 #endif
2174     }
2175 
2176     // End Alveolar Wedge parent ------------------------------------------------------
2177 
2178     // Begin Grid + Tablet insertion
2179 
2180     const double h_Grid(gridThick());
2181 
2182     const Trap trapGrid((B_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2,  // bl1, A/2
2183                         (b_hawR - h_Grid * (B_hawR - a_hawR) / H_hawR) / 2,  // bl2, a/2
2184                         b_hawR / 2.,                                         // tl2, b/2
2185                         h_Grid / 2.,                                         // h1, H/2
2186                         h_Grid / 2.,                                         // h2, h/2
2187                         (L_hawR - 8 * cm) / 2.,                              // dz,  L/2
2188                         90 * deg,                                            // alfa1
2189                         0,                                                   // x15
2190                         H_hawR - h_hawR                                      // y15
2191     );
2192 
2193     const DDSolid gridSolid(mytrap(gridName().name(), trapGrid));
2194     const DDLogicalPart gridLog(gridName(), gridMat(), gridSolid);
2195 
2196     const Trap::VertexList vGrid(trapGrid.vertexList());
2197 
2198     const Tf3D gridForm(vGrid[4],
2199                         vGrid[5],
2200                         vGrid[6],  // Grid inside HAW
2201                         vHAW[5] - Pt3D(0, h_Grid, 0),
2202                         vHAW[5],
2203                         vHAW[6]);
2204 
2205     if (0 != gridHere())
2206       cpv.position(
2207           gridLog,
2208           hawRLog,
2209           copyOne,
2210           DDTranslation(gridForm.getTranslation().x(), gridForm.getTranslation().y(), gridForm.getTranslation().z()),
2211           myrot(gridName().name() + "R", gridForm.getRotation()));
2212 #ifdef EDM_ML_DEBUG
2213     edm::LogVerbatim("EBGeomX") << gridLog.name() << ":" << copyOne << " positioned in " << hawRLog.name() << " at "
2214                                 << DDTranslation(gridForm.getTranslation().x(),
2215                                                  gridForm.getTranslation().y(),
2216                                                  gridForm.getTranslation().z())
2217                                 << " with rotation";
2218 #endif
2219     // End Grid + Tablet insertion
2220 
2221     // begin filling Wedge with crystal plus supports --------------------------
2222 
2223     const double aNom(nomCryDimAF());
2224     const double LNom(nomCryDimLZ());
2225 
2226     const double AUnd(underAR());
2227     const double aUnd(underAF());
2228     //      const double BUnd ( underCR() ) ;
2229     const double bUnd(underCF());
2230     const double HUnd(underBR());
2231     const double hUnd(underBF());
2232     const double LUnd(underLZ());
2233 
2234     const double sWall(wallThAlv());
2235     const double sWrap(wrapThAlv());
2236     const double sClr(clrThAlv());
2237 
2238     const double fWall(wallFrAlv());
2239     const double fWrap(wrapFrAlv());
2240     const double fClr(clrFrAlv());
2241 
2242     const double rWall(wallReAlv());
2243     const double rWrap(wrapReAlv());
2244     const double rClr(clrReAlv());
2245 
2246     // theta is angle in yz plane between z axis & leading edge of crystal
2247     double theta(90 * deg);
2248     double zee(0 * mm);
2249     double side(0 * mm);
2250     double zeta(0 * deg);  // increment in theta for last crystal
2251 
2252     for (unsigned int cryType(1); cryType <= nCryTypes(); ++cryType) {
2253       const std::string sType("_" + std::string(10 > cryType ? "0" : "") + std::to_string(cryType));
2254 
2255 #ifdef EDM_ML_DEBUG
2256       edm::LogVerbatim("EcalGeom") << "Crytype=" << cryType;
2257 #endif
2258       const double ANom(vecNomCryDimAR()[cryType - 1]);
2259       const double BNom(vecNomCryDimCR()[cryType - 1]);
2260       const double bNom(vecNomCryDimCF()[cryType - 1]);
2261       const double HNom(vecNomCryDimBR()[cryType - 1]);
2262       const double hNom(vecNomCryDimBF()[cryType - 1]);
2263 
2264       const double alfCry(90 * deg + atan((bNom - bUnd - aNom + aUnd) / (hNom - hUnd)));
2265 
2266       const Trap trapCry((ANom - AUnd) / 2.,         //double aHalfLengthXNegZLoY , // bl1, A/2
2267                          (aNom - aUnd) / 2.,         //double aHalfLengthXPosZLoY , // bl2, a/2
2268                          (bNom - bUnd) / 2.,         //double aHalfLengthXPosZHiY , // tl2, b/2
2269                          (HNom - HUnd) / 2.,         //double aHalfLengthYNegZ    , // h1, H/2
2270                          (hNom - hUnd) / 2.,         //double aHalfLengthYPosZ    , // h2, h/2
2271                          (LNom - LUnd) / 2.,         //double aHalfLengthZ        , // dz,  L/2
2272                          alfCry,                     //double aAngleAD            , // alfa1
2273                          aNom - aUnd - ANom + AUnd,  //double aCoord15X           , // x15
2274                          hNom - hUnd - HNom + HUnd   //double aCoord15Y             // y15
2275       );
2276 
2277       const DDName cryDDName(cryName() + sType);
2278       const DDSolid crySolid(mytrap(cryDDName.name(), trapCry));
2279       const DDLogicalPart cryLog(cryDDName, cryMat(), crySolid);
2280 
2281       //++++++++++++++++++++++++++++++++++  APD ++++++++++++++++++++++++++++++++++
2282       const unsigned int copyCap(1);
2283 
2284       const DDName capDDName(capName().name() + sType);
2285 
2286       DDSolid capSolid(DDSolidFactory::box(capDDName, capXSize() / 2., capYSize() / 2., capThick() / 2.));
2287 #ifdef EDM_ML_DEBUG
2288       edm::LogVerbatim("EBGeom") << capDDName << " Box " << capXSize() / 2. << ":" << capYSize() / 2 << ":"
2289                                  << capThick() / 2;
2290 #endif
2291 
2292       const DDLogicalPart capLog(capDDName, capMat(), capSolid);
2293 
2294       const DDName sglDDName(sglName().name() + sType);
2295 
2296       DDSolid sglSolid(DDSolidFactory::box(sglDDName, capXSize() / 2., capYSize() / 2., sglThick() / 2.));
2297 #ifdef EDM_ML_DEBUG
2298       edm::LogVerbatim("EBGeom") << sglDDName << " Box " << capXSize() / 2. << ":" << capYSize() / 2 << ":"
2299                                  << sglThick() / 2;
2300 #endif
2301 
2302       const DDLogicalPart sglLog(sglDDName, sglMat(), sglSolid);
2303 
2304       const unsigned int copySGL(1);
2305 
2306       const DDName cerDDName(cerName().name() + sType);
2307 
2308       DDSolid cerSolid(DDSolidFactory::box(cerDDName, cerXSize() / 2., cerYSize() / 2., cerThick() / 2.));
2309 #ifdef EDM_ML_DEBUG
2310       edm::LogVerbatim("EBGeom") << cerDDName << " Box " << cerXSize() / 2. << ":" << cerYSize() / 2 << ":"
2311                                  << cerThick() / 2;
2312 #endif
2313 
2314       const DDLogicalPart cerLog(cerDDName, cerMat(), cerSolid);
2315 
2316       unsigned int copyCER(0);
2317 
2318       const DDName bsiDDName(bsiName().name() + sType);
2319 
2320       DDSolid bsiSolid(DDSolidFactory::box(bsiDDName, bsiXSize() / 2., bsiYSize() / 2., bsiThick() / 2.));
2321 #ifdef EDM_ML_DEBUG
2322       edm::LogVerbatim("EBGeom") << bsiDDName << " Box " << bsiXSize() / 2. << ":" << bsiYSize() / 2 << ":"
2323                                  << bsiThick() / 2;
2324 #endif
2325 
2326       const DDLogicalPart bsiLog(bsiDDName, bsiMat(), bsiSolid);
2327 
2328       const unsigned int copyBSi(1);
2329 
2330       const DDName atjDDName(atjName().name() + sType);
2331 
2332       DDSolid atjSolid(DDSolidFactory::box(atjDDName, apdSide() / 2., apdSide() / 2., atjThick() / 2.));
2333 #ifdef EDM_ML_DEBUG
2334       edm::LogVerbatim("EBGeom") << atjDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2 << ":"
2335                                  << atjThick() / 2;
2336 #endif
2337 
2338       const DDLogicalPart atjLog(atjDDName, atjMat(), atjSolid);
2339 
2340       const unsigned int copyATJ(1);
2341 
2342       const DDName aglDDName(aglName().name() + sType);
2343 
2344       DDSolid aglSolid(DDSolidFactory::box(aglDDName, bsiXSize() / 2., bsiYSize() / 2., aglThick() / 2.));
2345 #ifdef EDM_ML_DEBUG
2346       edm::LogVerbatim("EBGeom") << aglDDName << " Box " << bsiXSize() / 2. << ":" << bsiYSize() / 2 << ":"
2347                                  << aglThick() / 2;
2348 #endif
2349 
2350       const DDLogicalPart aglLog(aglDDName, aglMat(), aglSolid);
2351 
2352       const unsigned int copyAGL(1);
2353 
2354       const DDName andDDName(andName().name() + sType);
2355 
2356       DDSolid andSolid(DDSolidFactory::box(andDDName, apdSide() / 2., apdSide() / 2., andThick() / 2.));
2357 #ifdef EDM_ML_DEBUG
2358       edm::LogVerbatim("EBGeom") << andDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2 << ":"
2359                                  << andThick() / 2;
2360 #endif
2361 
2362       const DDLogicalPart andLog(andDDName, andMat(), andSolid);
2363 
2364       const unsigned int copyAND(1);
2365 
2366       const DDName apdDDName(apdName().name() + sType);
2367 
2368       DDSolid apdSolid(DDSolidFactory::box(apdDDName, apdSide() / 2., apdSide() / 2., apdThick() / 2.));
2369 #ifdef EDM_ML_DEBUG
2370       edm::LogVerbatim("EBGeom") << apdDDName << " Box " << apdSide() / 2. << ":" << apdSide() / 2. << ":"
2371                                  << apdThick() / 2;
2372 #endif
2373 
2374       const DDLogicalPart apdLog(apdDDName, apdMat(), apdSolid);
2375 
2376       const unsigned int copyAPD(1);
2377       //++++++++++++++++++++++++++++++++++ END APD ++++++++++++++++++++++++++++++++++
2378 
2379       const double delta(atan((HNom - hNom) / LNom));
2380       //unused   const double cosdelta  ( cos( delta ) ) ;
2381       const double sindelta(sin(delta));
2382 
2383       const double gamma(atan((ANom - aNom) / LNom));
2384       //unused   const double cosgamma  ( cos( gamma ) ) ;
2385       const double singamma(sin(gamma));
2386 
2387       const double beta(atan((BNom - bNom) / LNom));
2388       //unused   const double cosbeta   ( cos( beta ) ) ;
2389       const double sinbeta(sin(beta));
2390 
2391       // Now clearance trap
2392       const double alfClr(90 * deg + atan((bNom - aNom) / (hNom + sClr)));
2393 
2394       const Trap trapClr((ANom + sClr + rClr * singamma) / 2.,  //double aHalfLengthXNegZLoY , // bl1, A/2
2395                          (aNom + sClr - fClr * singamma) / 2.,  //double aHalfLengthXPosZLoY , // bl2, a/2
2396                          (bNom + sClr - fClr * sinbeta) / 2.,   //double aHalfLengthXPosZHiY , // tl2, b/2
2397                          (HNom + sClr + rClr * sindelta) / 2.,  //double aHalfLengthYNegZ    , // h1,  H/2
2398                          (hNom + sClr - fClr * sindelta) / 2.,  //double aHalfLengthYPosZ    , // h2,  h/2
2399                          (LNom + fClr + rClr) / 2.,             // dz,  L/2
2400                          alfClr,                                //double aAngleAD            , // alfa1
2401                          aNom - ANom,                           //double aCoord15X           , // x15
2402                          hNom - HNom                            //double aCoord15Y             // y15
2403       );
2404 
2405       const DDName clrDDName(clrName() + sType);
2406       const DDSolid clrSolid(mytrap(clrDDName.name(), trapClr));
2407       const DDLogicalPart clrLog(clrDDName, clrMat(), clrSolid);
2408 
2409       // Now wrap trap
2410 
2411       const double alfWrap(90 * deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap)));
2412 
2413       const Trap trapWrap((trapClr.A() + 2 * sWrap + rWrap * singamma) / 2,  // bl1, A/2
2414                           (trapClr.a() + 2 * sWrap - fWrap * singamma) / 2,  // bl2, a/2
2415                           (trapClr.b() + 2 * sWrap - fWrap * sinbeta) / 2,   // tl2, b/2
2416                           (trapClr.H() + 2 * sWrap + rWrap * sindelta) / 2,  // h1,  H/2
2417                           (trapClr.h() + 2 * sWrap - fWrap * sindelta) / 2,  // h2,  h/2
2418                           (trapClr.L() + fWrap + rWrap) / 2.,                // dz,  L/2
2419                           alfWrap,                                           //double aAngleAD            , // alfa1
2420                           aNom - ANom - (cryType > 9 ? 0 : 0.020 * mm),
2421                           hNom - HNom  //double aCoord15Y             // y15
2422       );
2423 
2424       const DDName wrapDDName(wrapName() + sType);
2425       const DDSolid wrapSolid(mytrap(wrapDDName.name(), trapWrap));
2426       const DDLogicalPart wrapLog(wrapDDName, wrapMat(), wrapSolid);
2427 
2428       // Now wall trap
2429 
2430       const double alfWall(90 * deg + atan((bNom - aNom) / (hNom + sClr + 2 * sWrap + 2 * sWall)));
2431 
2432       const Trap trapWall((trapWrap.A() + 2 * sWall + rWall * singamma) / 2,  // A/2
2433                           (trapWrap.a() + 2 * sWall - fWall * singamma) / 2,  // a/2
2434                           (trapWrap.b() + 2 * sWall - fWall * sinbeta) / 2,   // b/2
2435                           (trapWrap.H() + 2 * sWall + rWall * sindelta) / 2,  // H/2
2436                           (trapWrap.h() + 2 * sWall - fWall * sindelta) / 2,  // h/2
2437                           (trapWrap.L() + fWall + rWall) / 2.,                // L/2
2438                           alfWall,                                            // alfa1
2439                           aNom - ANom - (cryType < 10 ? 0.150 * mm : 0.100 * mm),
2440                           hNom - HNom  // y15
2441       );
2442 
2443       const DDName wallDDName(wallName() + sType);
2444       const DDSolid wallSolid(mytrap(wallDDName.name(), trapWall));
2445       const DDLogicalPart wallLog(wallDDName, wallMat(), wallSolid);
2446 
2447       /*     
2448          edm::LogVerbatim("EcalGeom") << "Traps:\n a: " 
2449         << trapCry.a() << ", " 
2450         << trapClr.a() << ", " 
2451         << trapWrap.a() << ", " 
2452         << trapWall.a() << "\n b: " 
2453         << trapCry.b() << ", " 
2454         << trapClr.b() << ", " 
2455         << trapWrap.b() << ", " 
2456         << trapWall.b() << "\n A: " 
2457         << trapCry.A() << ", " 
2458         << trapClr.A() << ", " 
2459         << trapWrap.A() << ", " 
2460         << trapWall.A() << "\n B: " 
2461         << trapCry.B() << ", " 
2462         << trapClr.B() << ", " 
2463         << trapWrap.B() << ", " 
2464         << trapWall.B() << "\n h: " 
2465         << trapCry.h() << ", " 
2466         << trapClr.h() << ", " 
2467         << trapWrap.h() << ", " 
2468         << trapWall.h() << "\n H: " 
2469         << trapCry.H() << ", " 
2470         << trapClr.H() << ", " 
2471         << trapWrap.H() << ", " 
2472         << trapWall.H() << "\n a1: " 
2473         << trapCry.a1()/deg << ", " 
2474         << trapClr.a1()/deg << ", " 
2475         << trapWrap.a1()/deg << ", " 
2476         << trapWall.a1()/deg << "\n a4: " 
2477         << trapCry.a4()/deg << ", " 
2478         << trapClr.a4()/deg << ", " 
2479         << trapWrap.a4()/deg << ", " 
2480         << trapWall.a4()/deg << "\n x15: " 
2481         << trapCry.x15() << ", " 
2482         << trapClr.x15() << ", " 
2483         << trapWrap.x15() << ", " 
2484         << trapWall.x15() << "\n y15: " 
2485         << trapCry.y15() << ", " 
2486         << trapClr.y15() << ", " 
2487         << trapWrap.y15() << ", " 
2488         << trapWall.y15();
2489 */
2490       // Now for placement of cry within clr
2491       const Vec3 cryToClr(0, 0, (rClr - fClr) / 2);
2492 
2493       cpv.position(cryLog,
2494                    clrLog,
2495                    copyOne,
2496                    DDTranslation(0, 0, (rClr - fClr) / 2),  //SAME as cryToClr above.
2497                    DDRotation());
2498 #ifdef EDM_ML_DEBUG
2499       edm::LogVerbatim("EBGeomX") << cryLog.name() << ":" << copyOne << " positioned in " << clrLog.name() << " at "
2500                                   << DDTranslation(0, 0, (rClr - fClr) / 2) << " with no rotation";
2501 #endif
2502       if (0 != capHere()) {
2503         cpv.position(aglLog, bsiLog, copyAGL, DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.), DDRotation());
2504 #ifdef EDM_ML_DEBUG
2505         edm::LogVerbatim("EBGeomX") << aglLog.name() << ":" << copyAGL << " positioned in " << bsiLog.name() << " at "
2506                                     << DDTranslation(0, 0, -aglThick() / 2. + bsiThick() / 2.) << " with no rotation";
2507 #endif
2508 
2509         cpv.position(
2510             andLog, bsiLog, copyAND, DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.), DDRotation());
2511 #ifdef EDM_ML_DEBUG
2512         edm::LogVerbatim("EBGeomX") << andLog.name() << ":" << copyAND << " positioned in " << bsiLog.name() << " at "
2513                                     << DDTranslation(0, 0, -andThick() / 2. - aglThick() + bsiThick() / 2.)
2514                                     << " with no rotation";
2515 #endif
2516         cpv.position(apdLog,
2517                      bsiLog,
2518                      copyAPD,
2519                      DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.),
2520                      DDRotation());
2521 #ifdef EDM_ML_DEBUG
2522         edm::LogVerbatim("EBGeomX") << apdLog.name() << ":" << copyAPD << " positioned in " << bsiLog.name() << " at "
2523                                     << DDTranslation(0, 0, -apdThick() / 2. - andThick() - aglThick() + bsiThick() / 2.)
2524                                     << " with no rotation";
2525 #endif
2526         cpv.position(atjLog,
2527                      bsiLog,
2528                      copyATJ,
2529                      DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.),
2530                      DDRotation());
2531 #ifdef EDM_ML_DEBUG
2532         edm::LogVerbatim("EBGeomX")
2533             << atjLog.name() << ":" << copyATJ << " positioned in " << bsiLog.name() << " at "
2534             << DDTranslation(0, 0, -atjThick() / 2. - apdThick() - andThick() - aglThick() + bsiThick() / 2.)
2535             << " with no rotation";
2536 #endif
2537         cpv.position(bsiLog, cerLog, copyBSi, DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.), DDRotation());
2538 #ifdef EDM_ML_DEBUG
2539         edm::LogVerbatim("EBGeomX") << bsiLog.name() << ":" << copyBSi << " positioned in " << cerLog.name() << " at "
2540                                     << DDTranslation(0, 0, -bsiThick() / 2. + cerThick() / 2.) << " with no rotation";
2541 #endif
2542         cpv.position(sglLog, capLog, copySGL, DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.), DDRotation());
2543 #ifdef EDM_ML_DEBUG
2544         edm::LogVerbatim("EBGeomX") << sglLog.name() << ":" << copySGL << " positioned in " << capLog.name() << " at "
2545                                     << DDTranslation(0, 0, -sglThick() / 2. + capThick() / 2.) << " with no rotation";
2546 #endif
2547         for (unsigned int ijkl(0); ijkl != 2; ++ijkl) {
2548           cpv.position(cerLog,
2549                        capLog,
2550                        ++copyCER,
2551                        DDTranslation(trapCry.bl1() - (0 == ijkl ? apdX1() : apdX2()),
2552                                      trapCry.h1() - apdZ(),
2553                                      -sglThick() - cerThick() / 2. + capThick() / 2.),
2554                        DDRotation());
2555 #ifdef EDM_ML_DEBUG
2556           edm::LogVerbatim("EBGeomX") << cerLog.name() << ":" << copyCER << " positioned in " << capLog.name() << " at "
2557                                       << DDTranslation(trapCry.bl1() - (0 == ijkl ? apdX1() : apdX2()),
2558                                                        (trapCry.h1() - apdZ()),
2559                                                        (-sglThick() - cerThick() / 2. + capThick() / 2.))
2560                                       << " with no rotation";
2561 #endif
2562         }
2563         cpv.position(capLog,
2564                      clrLog,
2565                      copyCap,
2566                      DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.),
2567                      DDRotation());
2568 #ifdef EDM_ML_DEBUG
2569         edm::LogVerbatim("EBGeomX") << capLog.name() << ":" << copyCap << " positioned in " << clrLog.name() << " at "
2570                                     << DDTranslation(0, 0, -trapCry.dz() - capThick() / 2. + (rClr - fClr) / 2.)
2571                                     << " with no rotation";
2572 #endif
2573       }
2574 
2575       const Vec3 clrToWrap(0, 0, (rWrap - fWrap) / 2);
2576 
2577       cpv.position(clrLog,
2578                    wrapLog,
2579                    copyOne,
2580                    DDTranslation(0, 0, (rWrap - fWrap) / 2),  //SAME as cryToWrap
2581                    DDRotation());
2582 #ifdef EDM_ML_DEBUG
2583       edm::LogVerbatim("EBGeomX") << clrLog.name() << ":" << copyOne << " positioned in " << wrapLog.name() << " at "
2584                                   << DDTranslation(0, 0, (rWrap - fWrap) / 2) << " with no rotation";
2585 #endif
2586 
2587       // Now for placement of clr within wall
2588       const Vec3 wrapToWall1(0, 0, (rWall - fWall) / 2);
2589       const Vec3 wrapToWall(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1);
2590 
2591       cpv.position(wrapLog,
2592                    wallLog,
2593                    copyOne,
2594                    DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1),  //SAME as wrapToWall
2595                    DDRotation());
2596 #ifdef EDM_ML_DEBUG
2597       edm::LogVerbatim("EBGeomX") << wrapLog.name() << ":" << copyOne << " positioned in " << wallLog.name() << " at "
2598                                   << DDTranslation(Vec3((cryType > 9 ? 0 : 0.005 * mm), 0, 0) + wrapToWall1)
2599                                   << " with no rotation";
2600 #endif
2601       const Trap::VertexList vWall(trapWall.vertexList());
2602       const Trap::VertexList vCry(trapCry.vertexList());
2603 
2604       const double sidePrime((trapWall.a() - trapCry.a()) / 2);
2605       const double frontPrime(fWall + fWrap + fClr + LUnd / 2);
2606 
2607       // define web plates with clearance ===========================================
2608 
2609       if (1 == cryType)  // first web plate: inside clearance volume
2610       {
2611         web(0,
2612             trapWall.b(),
2613             trapWall.B(),
2614             trapWall.L(),
2615             theta,
2616             vHAW[4] + Pt3D(0, hawYOffCry(), 0),
2617             hawRLog,
2618             zee,
2619             sidePrime,
2620             frontPrime,
2621             delta,
2622             cpv);
2623         zee += vecGapAlvEta()[0];
2624       }
2625 
2626       for (unsigned int etaAlv(1); etaAlv <= nCryPerAlvEta(); ++etaAlv) {
2627 #ifdef EDM_ML_DEBUG
2628         edm::LogVerbatim("EcalGeom") << "theta=" << theta / deg << ", sidePrime=" << sidePrime
2629                                      << ", frontPrime=" << frontPrime << ",  zeta=" << zeta << ", delta=" << delta
2630                                      << ",  zee=" << zee;
2631 #endif
2632         zee += 0.075 * mm + (side * cos(zeta) + trapWall.h() - sidePrime) / sin(theta);
2633 
2634 #ifdef EDM_ML_DEBUG
2635         edm::LogVerbatim("EcalGeom") << "New zee=" << zee;
2636 #endif
2637         // make transform for placing enclosed crystal
2638 
2639         const Pt3D trap2(vCry[2] + cryToClr + clrToWrap + wrapToWall);
2640 
2641         const Pt3D trap3(trap2 + Pt3D(0, -trapCry.h(), 0));
2642         const Pt3D trap1(trap3 + Pt3D(-trapCry.a(), 0, 0));
2643 
2644         const Pt3D wedge3(vHAW[4] + Pt3D(sidePrime, hawYOffCry(), zee));
2645         const Pt3D wedge2(wedge3 + Pt3D(0, trapCry.h() * cos(theta), -trapCry.h() * sin(theta)));
2646         const Pt3D wedge1(wedge3 + Pt3D(trapCry.a(), 0, 0));
2647 
2648         const Tf3D tForm1(trap1, trap2, trap3, wedge1, wedge2, wedge3);
2649 
2650         const double xx(0.050 * mm);
2651 
2652         const Tf3D tForm(HepGeom::Translate3D(xx, 0, 0) * tForm1);
2653 
2654         cpv.position(wallLog,
2655                      hawRLog,
2656                      etaAlv,
2657                      DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
2658                      myrot(wallLog.name().name() + "_" + std::to_string(etaAlv), tForm.getRotation()));
2659 #ifdef EDM_ML_DEBUG
2660         edm::LogVerbatim("EBGeomX") << wallLog.name() << ":" << etaAlv << " positioned in " << hawRLog.name() << " at "
2661                                     << DDTranslation(tForm.getTranslation().x(),
2662                                                      tForm.getTranslation().y(),
2663                                                      tForm.getTranslation().z())
2664                                     << " with rotation";
2665 #endif
2666         theta -= delta;
2667         side = sidePrime;
2668         zeta = delta;
2669       }
2670       if (5 == cryType || 9 == cryType || 13 == cryType || 17 == cryType)  // web plates
2671       {
2672         const unsigned int webIndex(cryType / 4);
2673         zee += 0.5 * vecGapAlvEta()[cryType] / sin(theta);
2674         web(webIndex,
2675             trapWall.a(),
2676             trapWall.A(),
2677             trapWall.L(),
2678             theta,
2679             vHAW[4] + Pt3D(0, hawYOffCry(), 0),
2680             hawRLog,
2681             zee,
2682             sidePrime,
2683             frontPrime,
2684             delta,
2685             cpv);
2686         zee += 0.5 * vecGapAlvEta()[cryType] / sin(theta);
2687       } else {
2688         if (17 != cryType)
2689           zee += vecGapAlvEta()[cryType] / sin(theta);
2690       }
2691     }
2692     // END   filling Wedge with crystal plus supports --------------------------
2693 
2694     //------------------------------------------------------------------------
2695     //------------------------------------------------------------------------
2696     //------------------------------------------------------------------------
2697     //------------------------------------------------------------------------
2698     //**************** Material at outer radius of supermodule ***************
2699     //------------------------------------------------------------------------
2700     //------------------------------------------------------------------------
2701     //------------------------------------------------------------------------
2702     //------------------------------------------------------------------------
2703 
2704     if (0 != backHere()) {
2705       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2706       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2707       //!!!!!!!!!!!!!!     Begin Back Cover Plate     !!!!!!!!!!!!!!!!!!!!!!!
2708       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2709       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2710 
2711       const DDTranslation outtra(backXOff() + backSideHeight() / 2, backYOff(), backSideLength() / 2);
2712 
2713       const double realBPthick(backPlateThick() + backPlate2Thick());
2714 
2715       DDSolid backPlateSolid(
2716           DDSolidFactory::box(backPlateName(), backPlateWidth() / 2., realBPthick / 2., backPlateLength() / 2.));
2717 #ifdef EDM_ML_DEBUG
2718       edm::LogVerbatim("EBGeom") << backPlateName() << " Box " << backPlateWidth() / 2. << ":" << realBPthick / 2.
2719                                  << ":" << backPlateLength() / 2;
2720 #endif
2721       const std::vector<double>& backPlateParms(backPlateSolid.parameters());
2722       const DDLogicalPart backPlateLog(backPlateName(), backPlateMat(), backPlateSolid);
2723 
2724       const DDTranslation backPlateTra(
2725           backSideHeight() / 2 + backPlateParms[1], 0 * mm, backPlateParms[2] - backSideLength() / 2);
2726 
2727       DDSolid backPlate2Solid(
2728           DDSolidFactory::box(backPlate2Name(), backPlateWidth() / 2., backPlate2Thick() / 2., backPlateLength() / 2.));
2729 #ifdef EDM_ML_DEBUG
2730       edm::LogVerbatim("EBGeom") << backPlate2Name() << " Box " << backPlateWidth() / 2. << ":"
2731                                  << backPlate2Thick() / 2. << ":" << backPlateLength() / 2;
2732 #endif
2733 
2734       const DDLogicalPart backPlate2Log(backPlate2Name(), backPlate2Mat(), backPlate2Solid);
2735 
2736       const DDTranslation backPlate2Tra(0, -backPlateParms[1] + backPlate2Thick() / 2., 0);
2737       if (0 != backPlateHere()) {
2738         cpv.position(backPlate2Log, backPlateName(), copyOne, backPlate2Tra, DDRotation());
2739 #ifdef EDM_ML_DEBUG
2740         edm::LogVerbatim("EBGeomX") << backPlate2Log.name() << ":" << copyOne << " positioned in " << backPlateName()
2741                                     << " at " << backPlate2Tra << " with no rotation";
2742 #endif
2743         cpv.position(backPlateLog,
2744                      spmName(),
2745                      copyOne,
2746                      outtra + backPlateTra,
2747                      myrot(backPlateName().name() + "Rot5", CLHEP::HepRotationZ(270 * deg)));
2748 #ifdef EDM_ML_DEBUG
2749         edm::LogVerbatim("EBGeomX") << backPlateLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
2750                                     << (outtra + backPlateTra) << " with rotation";
2751 #endif
2752       }
2753       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2754       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2755       //!!!!!!!!!!!!!!     End Back Cover Plate       !!!!!!!!!!!!!!!!!!!!!!!
2756       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2757       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2758 
2759       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2760       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2761       //!!!!!!!!!!!!!!     Begin Back Side Plates    !!!!!!!!!!!!!!!!!!!!!!!
2762       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2763       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2764 
2765       const Trap trapBS(backSideWidth() / 2.,   //double aHalfLengthXNegZLoY , // bl1, A/2
2766                         backSideWidth() / 2.,   //double aHalfLengthXPosZLoY , // bl2, a/2
2767                         backSideWidth() / 4.,   //double aHalfLengthXPosZHiY , // tl2, b/2
2768                         backSideHeight() / 2.,  //double aHalfLengthYNegZ    , // h1, H/2
2769                         backSideHeight() / 2.,  //double aHalfLengthYPosZ    , // h2, h/2
2770                         backSideLength() / 2.,  //double aHalfLengthZ        , // dz,  L/2
2771                         backSideAngle(),        //double aAngleAD            , // alfa1
2772                         0,                      //double aCoord15X           , // x15
2773                         0                       //double aCoord15Y             // y15
2774       );
2775 
2776       const DDSolid backSideSolid(mytrap(backSideName().name(), trapBS));
2777       const DDLogicalPart backSideLog(backSideName(), backSideMat(), backSideSolid);
2778 
2779       const DDTranslation backSideTra1(0 * mm, backPlateWidth() / 2 + backSideYOff1(), 1 * mm);
2780       if (0 != backSideHere()) {
2781         cpv.position(
2782             backSideLog,
2783             spmName(),
2784             copyOne,
2785             outtra + backSideTra1,
2786             myrot(backSideName().name() + "Rot8", CLHEP::HepRotationX(180 * deg) * CLHEP::HepRotationZ(90 * deg)));
2787 #ifdef EDM_ML_DEBUG
2788         edm::LogVerbatim("EBGeomX") << backSideLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
2789                                     << (outtra + backSideTra1) << " with rotation";
2790 #endif
2791         const DDTranslation backSideTra2(0 * mm, -backPlateWidth() / 2 + backSideYOff2(), 1 * mm);
2792         cpv.position(backSideLog,
2793                      spmName(),
2794                      copyTwo,
2795                      outtra + backSideTra2,
2796                      myrot(backSideName().name() + "Rot9", CLHEP::HepRotationZ(90 * deg)));
2797 #ifdef EDM_ML_DEBUG
2798         edm::LogVerbatim("EBGeomX") << backSideLog.name() << ":" << copyTwo << " positioned in " << spmName() << " at "
2799                                     << (outtra + backSideTra2) << " with rotation";
2800 #endif
2801       }
2802       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2803       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2804       //!!!!!!!!!!!!!!     End Back Side Plates       !!!!!!!!!!!!!!!!!!!!!!!
2805       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2806       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2807 
2808       //=====================
2809       const double backCoolWidth(backCoolBarWidth() + 2. * backCoolTankWidth());
2810 
2811       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2812       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2813       //!!!!!!!!!!!!!!     Begin Mother Board Cooling Manifold Setup !!!!!!!!
2814       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2815       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2816 
2817       const double manifCut(2 * mm);
2818 
2819       DDSolid mBManifSolid(DDSolidFactory::tubs(
2820           mBManifName(), backCoolWidth / 2. - manifCut, 0, mBManifOutDiam() / 2, 0 * deg, 360 * deg));
2821 #ifdef EDM_ML_DEBUG
2822       edm::LogVerbatim("EBGeom") << mBManifName() << " Tubs " << backCoolWidth / 2. - manifCut
2823                                  << ":0:" << mBManifOutDiam() / 2 << ":0:360";
2824 #endif
2825       const DDLogicalPart mBManifLog(mBManifName(), mBManifMat(), mBManifSolid);
2826 
2827       const DDName mBManifWaName(ddname(mBManifName().name() + "Wa"));
2828       DDSolid mBManifWaSolid(DDSolidFactory::tubs(
2829           mBManifWaName, backCoolWidth / 2. - manifCut, 0, mBManifInnDiam() / 2, 0 * deg, 360 * deg));
2830 #ifdef EDM_ML_DEBUG
2831       edm::LogVerbatim("EBGeom") << mBManifWaName << " Tubs " << backCoolWidth / 2. - manifCut
2832                                  << ":0:" << mBManifInnDiam() / 2 << ":0:360";
2833 #endif
2834       const DDLogicalPart mBManifWaLog(mBManifWaName, backPipeWaterMat(), mBManifWaSolid);
2835       cpv.position(mBManifWaLog, mBManifName(), copyOne, DDTranslation(0, 0, 0), DDRotation());
2836 #ifdef EDM_ML_DEBUG
2837       edm::LogVerbatim("EBGeomX") << mBManifWaLog.name() << ":" << copyOne << " positioned in " << mBManifName()
2838                                   << " at " << DDTranslation(0, 0, 0) << " with no rotation";
2839 #endif
2840       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2841       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2842       //!!!!!!!!!!!!!!     End Mother Board Cooling Manifold Setup   !!!!!!!!
2843       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2844       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2845       //=====================
2846 
2847       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2848       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2849       //!!!!!!!!!!!!!!     Begin Loop over Grilles & MB Cooling Manifold !!!!
2850       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2851       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2852       const double deltaY(-5 * mm);
2853 
2854       DDSolid grEdgeSlotSolid(
2855           DDSolidFactory::box(grEdgeSlotName(), grEdgeSlotHeight() / 2., grEdgeSlotWidth() / 2., grilleThick() / 2.));
2856 #ifdef EDM_ML_DEBUG
2857       edm::LogVerbatim("EBGeom") << grEdgeSlotName() << " Box " << grEdgeSlotHeight() / 2. << ":"
2858                                  << grEdgeSlotWidth() / 2 << ":" << grilleThick() / 2;
2859 #endif
2860       const DDLogicalPart grEdgeSlotLog(grEdgeSlotName(), grEdgeSlotMat(), grEdgeSlotSolid);
2861 
2862       unsigned int edgeSlotCopy(0);
2863       unsigned int midSlotCopy(0);
2864 
2865       DDLogicalPart grMidSlotLog[4];
2866 
2867       for (unsigned int iGr(0); iGr != vecGrilleHeight().size(); ++iGr) {
2868         DDName gName(ddname(grilleName() + std::to_string(iGr)));
2869         DDSolid grilleSolid(
2870             DDSolidFactory::box(gName, vecGrilleHeight()[iGr] / 2., backCoolWidth / 2., grilleThick() / 2.));
2871 #ifdef EDM_ML_DEBUG
2872         edm::LogVerbatim("EBGeom") << gName << " Box " << vecGrilleHeight()[iGr] / 2. << ":" << backCoolWidth / 2 << ":"
2873                                    << grilleThick() / 2;
2874 #endif
2875         const DDLogicalPart grilleLog(gName, grilleMat(), grilleSolid);
2876 
2877         const DDTranslation grilleTra(-realBPthick / 2 - vecGrilleHeight()[iGr] / 2,
2878                                       deltaY,
2879                                       vecGrilleZOff()[iGr] + grilleThick() / 2 - backSideLength() / 2);
2880         const DDTranslation gTra(outtra + backPlateTra + grilleTra);
2881 
2882         if (0 != grMidSlotHere() && 0 != iGr) {
2883           if (0 == (iGr - 1) % 2) {
2884             DDName mName(ddname(grMidSlotName() + std::to_string(iGr / 2)));
2885             DDSolid grMidSlotSolid(DDSolidFactory::box(
2886                 mName, vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., grMidSlotWidth() / 2., grilleThick() / 2.));
2887 #ifdef EDM_ML_DEBUG
2888             edm::LogVerbatim("EBGeom") << mName << " Box " << vecGrMidSlotHeight()[(iGr - 1) / 2] / 2. << ":"
2889                                        << grMidSlotWidth() / 2 << ":" << grilleThick() / 2;
2890 #endif
2891             grMidSlotLog[(iGr - 1) / 2] = DDLogicalPart(mName, grMidSlotMat(), grMidSlotSolid);
2892           }
2893           cpv.position(grMidSlotLog[(iGr - 1) / 2],
2894                        gName,
2895                        ++midSlotCopy,
2896                        DDTranslation(
2897                            vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., +grMidSlotXOff(), 0),
2898                        DDRotation());
2899 #ifdef EDM_ML_DEBUG
2900           edm::LogVerbatim("EBGeomX") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in "
2901                                       << gName << " at "
2902                                       << DDTranslation(
2903                                              vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2.,
2904                                              +grMidSlotXOff(),
2905                                              0)
2906                                       << " with no rotation";
2907 #endif
2908 
2909           cpv.position(grMidSlotLog[(iGr - 1) / 2],
2910                        gName,
2911                        ++midSlotCopy,
2912                        DDTranslation(
2913                            vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2., -grMidSlotXOff(), 0),
2914                        DDRotation());
2915 #ifdef EDM_ML_DEBUG
2916           edm::LogVerbatim("EBGeomX") << grMidSlotLog[(iGr - 1) / 2].name() << ":" << midSlotCopy << " positioned in "
2917                                       << gName << " at "
2918                                       << DDTranslation(
2919                                              vecGrilleHeight()[iGr] / 2. - vecGrMidSlotHeight()[(iGr - 1) / 2] / 2.,
2920                                              -grMidSlotXOff(),
2921                                              0)
2922                                       << " with no rotation";
2923 #endif
2924         }
2925 
2926         if (0 != grEdgeSlotHere() && 0 != iGr) {
2927           cpv.position(
2928               grEdgeSlotLog,
2929               gName,
2930               ++edgeSlotCopy,
2931               DDTranslation(
2932                   vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2., backCoolWidth / 2 - grEdgeSlotWidth() / 2., 0),
2933               DDRotation());
2934 #ifdef EDM_ML_DEBUG
2935           edm::LogVerbatim("EBGeomX") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << gName
2936                                       << " at "
2937                                       << DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2938                                                        backCoolWidth / 2 - grEdgeSlotWidth() / 2.,
2939                                                        0)
2940                                       << " with no rotation";
2941 #endif
2942           cpv.position(grEdgeSlotLog,
2943                        gName,
2944                        ++edgeSlotCopy,
2945                        DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2946                                      -backCoolWidth / 2 + grEdgeSlotWidth() / 2.,
2947                                      0),
2948                        DDRotation());
2949 #ifdef EDM_ML_DEBUG
2950           edm::LogVerbatim("EBGeomX") << grEdgeSlotLog.name() << ":" << edgeSlotCopy << " positioned in " << gName
2951                                       << " at "
2952                                       << DDTranslation(vecGrilleHeight()[iGr] / 2. - grEdgeSlotHeight() / 2.,
2953                                                        -backCoolWidth / 2 + grEdgeSlotWidth() / 2.,
2954                                                        0)
2955                                       << " with no rotation";
2956 #endif
2957         }
2958         if (0 != grilleHere()) {
2959           cpv.position(grilleLog, spmName(), iGr, gTra, DDRotation());
2960 #ifdef EDM_ML_DEBUG
2961           edm::LogVerbatim("EBGeomX") << grilleLog.name() << ":" << iGr << " positioned in " << spmName() << " at "
2962                                       << gTra << " with no rotation";
2963 #endif
2964         }
2965         if ((0 != iGr % 2) && (0 != mBManifHere())) {
2966           cpv.position(mBManifLog,
2967                        spmName(),
2968                        iGr,
2969                        gTra - DDTranslation(-mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2970                                             manifCut,
2971                                             grilleThick() / 2. + 3 * mBManifOutDiam() / 2.),
2972                        myrot(mBManifName().name() + "R1", CLHEP::HepRotationX(90 * deg)));
2973 #ifdef EDM_ML_DEBUG
2974           edm::LogVerbatim("EBGeomX") << mBManifLog.name() << ":" << iGr << " positioned in " << spmName() << " at "
2975                                       << (gTra - DDTranslation(-mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2976                                                                manifCut,
2977                                                                grilleThick() / 2. + 3 * mBManifOutDiam() / 2.))
2978                                       << " with rotation";
2979 #endif
2980           cpv.position(mBManifLog,
2981                        spmName(),
2982                        iGr - 1,
2983                        gTra - DDTranslation(-3 * mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2984                                             manifCut,
2985                                             grilleThick() / 2 + 3 * mBManifOutDiam() / 2.),
2986                        myrot(mBManifName().name() + "R2", CLHEP::HepRotationX(90 * deg)));
2987 #ifdef EDM_ML_DEBUG
2988           edm::LogVerbatim("EBGeomX") << mBManifLog.name() << ":" << (iGr - 1) << " positioned in " << spmName()
2989                                       << " at "
2990                                       << (gTra - DDTranslation(-3 * mBManifOutDiam() / 2. + vecGrilleHeight()[iGr] / 2.,
2991                                                                manifCut,
2992                                                                grilleThick() / 2 + 3 * mBManifOutDiam() / 2.))
2993                                       << " with rotation";
2994 #endif
2995         }
2996       }
2997 
2998       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2999       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3000       //!!!!!!!!!!!!!!     End Loop over Grilles & MB Cooling Manifold   !!!!
3001       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3002       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3003 
3004       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3005       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3006       //!!!!!!!!!!!!!!     Begin Cooling Bar Setup    !!!!!!!!!!!!!!!!!!!!!!!
3007       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3008       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3009 
3010       DDSolid backCoolBarSolid(DDSolidFactory::box(
3011           backCoolBarName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., backCoolBarThick() / 2.));
3012 #ifdef EDM_ML_DEBUG
3013       edm::LogVerbatim("EBGeom") << backCoolBarName() << " Box " << backCoolBarHeight() / 2. << ":"
3014                                  << backCoolBarWidth() / 2 << ":" << backCoolBarThick() / 2;
3015 #endif
3016       const DDLogicalPart backCoolBarLog(backCoolBarName(), backCoolBarMat(), backCoolBarSolid);
3017 
3018       DDSolid backCoolBarSSSolid(DDSolidFactory::box(
3019           backCoolBarSSName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., backCoolBarSSThick() / 2.));
3020 #ifdef EDM_ML_DEBUG
3021       edm::LogVerbatim("EBGeom") << backCoolBarSSName() << " Box " << backCoolBarHeight() / 2. << ":"
3022                                  << backCoolBarWidth() / 2. << ":" << backCoolBarSSThick() / 2.;
3023 #endif
3024       const DDLogicalPart backCoolBarSSLog(backCoolBarSSName(), backCoolBarSSMat(), backCoolBarSSSolid);
3025       const DDTranslation backCoolBarSSTra(0, 0, 0);
3026       cpv.position(backCoolBarSSLog, backCoolBarName(), copyOne, backCoolBarSSTra, DDRotation());
3027 #ifdef EDM_ML_DEBUG
3028       edm::LogVerbatim("EBGeomX") << backCoolBarSSLog.name() << ":" << copyOne << " positioned in " << backCoolBarName()
3029                                   << " at " << backCoolBarSSTra << " with no rotation";
3030 #endif
3031 
3032       DDSolid backCoolBarWaSolid(DDSolidFactory::box(
3033           backCoolBarWaName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., backCoolBarWaThick() / 2.));
3034 #ifdef EDM_ML_DEBUG
3035       edm::LogVerbatim("EBGeom") << backCoolBarWaName() << " Box " << backCoolBarHeight() / 2. << ":"
3036                                  << backCoolBarWidth() / 2. << ":" << backCoolBarWaThick() / 2;
3037 #endif
3038       const DDLogicalPart backCoolBarWaLog(backCoolBarWaName(), backCoolBarWaMat(), backCoolBarWaSolid);
3039       const DDTranslation backCoolBarWaTra(0, 0, 0);
3040       cpv.position(backCoolBarWaLog, backCoolBarSSName(), copyOne, backCoolBarWaTra, DDRotation());
3041 #ifdef EDM_ML_DEBUG
3042       edm::LogVerbatim("EBGeomX") << backCoolBarWaLog.name() << ":" << copyOne << " positioned in "
3043                                   << backCoolBarSSName() << " at " << backCoolBarWaTra << " with no rotation";
3044 #endif
3045 
3046       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3047       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3048       //!!!!!!!!!!!!!!     End Cooling Bar Setup      !!!!!!!!!!!!!!!!!!!!!!!
3049       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3050       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3051 
3052       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3053       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3054       //!!!!!!!!!!!!!!     Begin VFE Card Setup       !!!!!!!!!!!!!!!!!!!!!!!
3055       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3056       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3057 
3058       double thickVFE(0);
3059       for (unsigned int iLyr(0); iLyr != vecBackVFELyrThick().size(); ++iLyr) {
3060         thickVFE += vecBackVFELyrThick()[iLyr];
3061       }
3062       DDSolid backVFESolid(
3063           DDSolidFactory::box(backVFEName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., thickVFE / 2.));
3064 #ifdef EDM_ML_DEBUG
3065       edm::LogVerbatim("EBGeom") << backVFEName() << " Box " << backCoolBarHeight() / 2. << ":"
3066                                  << backCoolBarWidth() / 2 << ":" << thickVFE / 2;
3067 #endif
3068       const DDLogicalPart backVFELog(backVFEName(), backVFEMat(), backVFESolid);
3069       DDTranslation offTra(0, 0, -thickVFE / 2);
3070       for (unsigned int iLyr(0); iLyr != vecBackVFELyrThick().size(); ++iLyr) {
3071         DDSolid backVFELyrSolid(DDSolidFactory::box(ddname(vecBackVFELyrName()[iLyr]),
3072                                                     backCoolBarHeight() / 2.,
3073                                                     backCoolBarWidth() / 2.,
3074                                                     vecBackVFELyrThick()[iLyr] / 2.));
3075 #ifdef EDM_ML_DEBUG
3076         edm::LogVerbatim("EBGeom") << ddname(vecBackVFELyrName()[iLyr]) << " Box " << backCoolBarHeight() / 2. << ":"
3077                                    << backCoolBarWidth() / 2. << ":" << vecBackVFELyrThick()[iLyr] / 2;
3078 #endif
3079         const DDLogicalPart backVFELyrLog(
3080             ddname(vecBackVFELyrName()[iLyr]), ddmat(vecBackVFELyrMat()[iLyr]), backVFELyrSolid);
3081         const DDTranslation backVFELyrTra(0, 0, vecBackVFELyrThick()[iLyr] / 2);
3082         cpv.position(backVFELyrLog, backVFEName(), copyOne, backVFELyrTra + offTra, DDRotation());
3083 #ifdef EDM_ML_DEBUG
3084         edm::LogVerbatim("EBGeomX") << backVFELyrLog.name() << ":" << copyOne << " positioned in " << backVFEName()
3085                                     << " at " << (backVFELyrTra + offTra) << " with no rotation";
3086 #endif
3087         offTra += 2 * backVFELyrTra;
3088       }
3089 
3090       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3091       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3092       //!!!!!!!!!!!!!!     End VFE Card Setup         !!!!!!!!!!!!!!!!!!!!!!!
3093       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3094       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3095 
3096       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3097       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3098       //!!!!!!!!!!!!!!     Begin Cooling Bar + VFE Setup  !!!!!!!!!!!!!!!!!!!
3099       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3100       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3101 
3102       const double halfZCoolVFE(thickVFE + backCoolBarThick() / 2.);
3103       DDSolid backCoolVFESolid(
3104           DDSolidFactory::box(backCoolVFEName(), backCoolBarHeight() / 2., backCoolBarWidth() / 2., halfZCoolVFE));
3105 #ifdef EDM_ML_DEBUG
3106       edm::LogVerbatim("EBGeom") << backCoolVFEName() << " Box " << backCoolBarHeight() / 2. << ":"
3107                                  << backCoolBarWidth() / 2. << ":" << halfZCoolVFE;
3108 #endif
3109       const DDLogicalPart backCoolVFELog(backCoolVFEName(), backCoolVFEMat(), backCoolVFESolid);
3110       if (0 != backCoolBarHere()) {
3111         cpv.position(backCoolBarLog, backCoolVFEName(), copyOne, DDTranslation(), DDRotation());
3112 #ifdef EDM_ML_DEBUG
3113         edm::LogVerbatim("EBGeomX") << backCoolBarLog.name() << ":" << copyOne << " positioned in " << backCoolVFEName()
3114                                     << " at " << DDTranslation() << " with no rotation";
3115 #endif
3116       }
3117       if (0 != backCoolVFEHere()) {
3118         cpv.position(backVFELog,
3119                      backCoolVFEName(),
3120                      copyOne,
3121                      DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.),
3122                      DDRotation());
3123 #ifdef EDM_ML_DEBUG
3124         edm::LogVerbatim("EBGeomX") << backVFELog.name() << ":" << copyOne << " positioned in " << backCoolVFEName()
3125                                     << " at " << DDTranslation(0, 0, backCoolBarThick() / 2. + thickVFE / 2.)
3126                                     << " with no rotation";
3127 #endif
3128       }
3129       cpv.position(backVFELog,
3130                    backCoolVFEName(),
3131                    copyTwo,
3132                    DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.),
3133                    myrot(backVFEName().name() + "Flip", CLHEP::HepRotationX(180 * deg)));
3134 #ifdef EDM_ML_DEBUG
3135       edm::LogVerbatim("EBGeomX") << backVFELog.name() << ":" << copyTwo << " positioned in " << backCoolVFEName()
3136                                   << " at " << DDTranslation(0, 0, -backCoolBarThick() / 2. - thickVFE / 2.)
3137                                   << " with rotation";
3138 #endif
3139       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3140       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3141       //!!!!!!!!!!!!!!     End Cooling Bar + VFE Setup    !!!!!!!!!!!!!!!!!!!
3142       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3143       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3144 
3145       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3146       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3147       //!!!!!!!!!!!!!! Begin Placement of Readout & Cooling by Module  !!!!!!
3148       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3149       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3150       unsigned int iCVFECopy(1);
3151       unsigned int iSep(0);
3152       unsigned int iNSec(0);
3153       const unsigned int nMisc(vecBackMiscThick().size() / 4);
3154       for (unsigned int iMod(0); iMod != 4; ++iMod) {
3155         const double pipeLength(vecGrilleZOff()[2 * iMod + 1] - vecGrilleZOff()[2 * iMod] - grilleThick() - 3 * mm);
3156 
3157         const double pipeZPos(vecGrilleZOff()[2 * iMod + 1] - pipeLength / 2 - 1.5 * mm);
3158 
3159         // accumulate total height of parent volume
3160 
3161         double backCoolHeight(backCoolBarHeight() + mBCoolTubeOutDiam());
3162         for (unsigned int iMisc(0); iMisc != nMisc; ++iMisc) {
3163           backCoolHeight += vecBackMiscThick()[iMod * nMisc + iMisc];
3164         }
3165         double bottomThick(mBCoolTubeOutDiam());
3166         for (unsigned int iMB(0); iMB != vecMBLyrThick().size(); ++iMB) {
3167           backCoolHeight += vecMBLyrThick()[iMB];
3168           bottomThick += vecMBLyrThick()[iMB];
3169         }
3170 
3171         DDName backCName(ddname(vecBackCoolName()[iMod]));
3172         const double halfZBCool((pipeLength - 2 * mBManifOutDiam() - grilleZSpace()) / 2);
3173         DDSolid backCoolSolid(DDSolidFactory::box(backCName, backCoolHeight / 2., backCoolWidth / 2., halfZBCool));
3174 #ifdef EDM_ML_DEBUG
3175         edm::LogVerbatim("EBGeom") << backCName << " Box " << backCoolHeight / 2. << ":" << backCoolWidth / 2. << ":"
3176                                    << halfZBCool;
3177 #endif
3178         const DDLogicalPart backCoolLog(backCName, spmMat(), backCoolSolid);
3179 
3180         const DDTranslation bCoolTra(
3181             -realBPthick / 2 + backCoolHeight / 2 - vecGrilleHeight()[2 * iMod],
3182             deltaY,
3183             vecGrilleZOff()[2 * iMod] + grilleThick() + grilleZSpace() + halfZBCool - backSideLength() / 2);
3184         if (0 != backCoolHere()) {
3185           cpv.position(backCoolLog, spmName(), iMod + 1, outtra + backPlateTra + bCoolTra, DDRotation());
3186 #ifdef EDM_ML_DEBUG
3187           edm::LogVerbatim("EBGeomX") << backCoolLog.name() << ":" << (iMod + 1) << " positioned in " << spmName()
3188                                       << " at " << (outtra + backPlateTra + bCoolTra) << " with no rotation";
3189 #endif
3190         }
3191         //===
3192         const double backCoolTankHeight(backCoolBarHeight());  // - backBracketHeight() ) ;
3193 
3194         const double halfZTank(halfZBCool - 5 * cm);
3195 
3196         DDName bTankName(ddname(backCoolTankName() + std::to_string(iMod + 1)));
3197         DDSolid backCoolTankSolid(
3198             DDSolidFactory::box(bTankName, backCoolTankHeight / 2., backCoolTankWidth() / 2., halfZTank));
3199 #ifdef EDM_ML_DEBUG
3200         edm::LogVerbatim("EBGeom") << bTankName << " Box " << backCoolTankHeight / 2. << ":" << backCoolTankWidth() / 2.
3201                                    << ":" << halfZTank;
3202 #endif
3203         const DDLogicalPart backCoolTankLog(bTankName, backCoolTankMat(), backCoolTankSolid);
3204         if (0 != backCoolTankHere()) {
3205           cpv.position(backCoolTankLog,
3206                        backCName,
3207                        copyOne,
3208                        DDTranslation(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick,
3209                                      backCoolBarWidth() / 2. + backCoolTankWidth() / 2.,
3210                                      0),
3211                        DDRotation());
3212 #ifdef EDM_ML_DEBUG
3213           edm::LogVerbatim("EBGeomX") << backCoolTankLog.name() << ":" << copyOne << " positioned in " << backCName
3214                                       << " at "
3215                                       << DDTranslation(-backCoolHeight / 2 + backCoolTankHeight / 2. + bottomThick,
3216                                                        backCoolBarWidth() / 2. + backCoolTankWidth() / 2.,
3217                                                        0)
3218                                       << " with no rotation";
3219 #endif
3220         }
3221 
3222         DDName bTankWaName(ddname(backCoolTankWaName() + std::to_string(iMod + 1)));
3223         DDSolid backCoolTankWaSolid(DDSolidFactory::box(bTankWaName,
3224                                                         backCoolTankHeight / 2. - backCoolTankThick() / 2.,
3225                                                         backCoolTankWaWidth() / 2.,
3226                                                         halfZTank - backCoolTankThick() / 2.));
3227 #ifdef EDM_ML_DEBUG
3228         edm::LogVerbatim("EBGeom") << bTankWaName << " Box " << (backCoolTankHeight / 2. - backCoolTankThick() / 2.)
3229                                    << ":" << backCoolTankWaWidth() / 2. << ":"
3230                                    << (halfZTank - backCoolTankThick() / 2.);
3231 #endif
3232         const DDLogicalPart backCoolTankWaLog(bTankWaName, backCoolTankWaMat(), backCoolTankWaSolid);
3233         cpv.position(backCoolTankWaLog, bTankName, copyOne, DDTranslation(0, 0, 0), DDRotation());
3234 #ifdef EDM_ML_DEBUG
3235         edm::LogVerbatim("EBGeomX") << backCoolTankWaLog.name() << ":" << copyOne << " positioned in " << bTankName
3236                                     << " at " << DDTranslation(0, 0, 0) << " with no rotation";
3237 #endif
3238 
3239         DDName bBracketName(ddname(backBracketName() + std::to_string(iMod + 1)));
3240         DDSolid backBracketSolid(
3241             DDSolidFactory::box(bBracketName, backBracketHeight() / 2., backCoolTankWidth() / 2., halfZTank));
3242 #ifdef EDM_ML_DEBUG
3243         edm::LogVerbatim("EBGeom") << bBracketName << " Box " << backBracketHeight() / 2. << ":"
3244                                    << backCoolTankWidth() / 2. << ":" << halfZTank;
3245 #endif
3246         const DDLogicalPart backBracketLog(bBracketName, backBracketMat(), backBracketSolid);
3247         if (0 != backCoolTankHere()) {
3248           cpv.position(backBracketLog,
3249                        backCName,
3250                        copyOne,
3251                        DDTranslation(backCoolBarHeight() - backCoolHeight / 2. - backBracketHeight() / 2. + bottomThick,
3252                                      -backCoolBarWidth() / 2. - backCoolTankWidth() / 2.,
3253                                      0),
3254                        DDRotation());
3255 #ifdef EDM_ML_DEBUG
3256           edm::LogVerbatim("EBGeomX") << backBracketLog.name() << ":" << copyOne << " positioned in " << backCName
3257                                       << " at "
3258                                       << DDTranslation(backCoolBarHeight() - backCoolHeight / 2. -
3259                                                            backBracketHeight() / 2. + bottomThick,
3260                                                        -backCoolBarWidth() / 2. - backCoolTankWidth() / 2.,
3261                                                        0)
3262                                       << " with no rotation";
3263 #endif
3264         }
3265 
3266         /*   cpv.position( backBracketLog,
3267         backCName, 
3268         copyTwo, 
3269         DDTranslation( backCoolBarHeight() - backCoolHeight/2. - backBracketHeight()/2.,
3270                    backCoolBarWidth()/2. + backCoolTankWidth()/2., 0),
3271                    DDRotation() ) ;*/
3272 
3273         //===
3274 
3275         DDTranslation bSumTra(backCoolBarHeight() - backCoolHeight / 2. + bottomThick, 0, 0);
3276         for (unsigned int j(0); j != nMisc; ++j)  // loop over miscellaneous layers
3277         {
3278           const DDName bName(ddname(vecBackMiscName()[iMod * nMisc + j]));
3279 
3280           DDSolid bSolid(DDSolidFactory::box(bName,
3281                                              vecBackMiscThick()[iMod * nMisc + j] / 2,
3282                                              backCoolBarWidth() / 2. + backCoolTankWidth(),
3283                                              halfZBCool));
3284 #ifdef EDM_ML_DEBUG
3285           edm::LogVerbatim("EBGeom") << bName << " Box " << vecBackMiscThick()[iMod * nMisc + j] / 2 << ":"
3286                                      << backCoolBarWidth() / 2. + backCoolTankWidth() << ":" << halfZBCool;
3287 #endif
3288 
3289           const DDLogicalPart bLog(bName, ddmat(vecBackMiscMat()[iMod * nMisc + j]), bSolid);
3290 
3291           const DDTranslation bTra(vecBackMiscThick()[iMod * nMisc + j] / 2, 0 * mm, 0 * mm);
3292 
3293           if (0 != backMiscHere()) {
3294             cpv.position(bLog, backCName, copyOne, bSumTra + bTra, DDRotation());
3295 #ifdef EDM_ML_DEBUG
3296             edm::LogVerbatim("EBGeomX") << bLog.name() << ":" << copyOne << " positioned in " << backCName << " at "
3297                                         << (bSumTra + bTra) << " with no rotation";
3298 #endif
3299           }
3300           bSumTra += 2 * bTra;
3301         }
3302 
3303         const double bHalfWidth(backCoolBarWidth() / 2. + backCoolTankWidth());
3304 
3305         if (0 != mBLyrHere()) {
3306           DDTranslation mTra(-backCoolHeight / 2. + mBCoolTubeOutDiam(), 0, 0);
3307           for (unsigned int j(0); j != vecMBLyrThick().size(); ++j)  // loop over MB layers
3308           {
3309             const DDName mName(ddname(vecMBLyrName()[j] + "_" + std::to_string(iMod + 1)));
3310 
3311             DDSolid mSolid(DDSolidFactory::box(mName, vecMBLyrThick()[j] / 2, bHalfWidth, halfZBCool));
3312 #ifdef EDM_ML_DEBUG
3313             edm::LogVerbatim("EBGeom") << mName << " Box " << vecMBLyrThick()[j] / 2 << ":" << bHalfWidth << ":"
3314                                        << halfZBCool;
3315 #endif
3316 
3317             const DDLogicalPart mLog(mName, ddmat(vecMBLyrMat()[j]), mSolid);
3318 
3319             mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm);
3320             cpv.position(mLog, backCName, copyOne, mTra, DDRotation());
3321 #ifdef EDM_ML_DEBUG
3322             edm::LogVerbatim("EBGeomX") << mLog.name() << ":" << copyOne << " positioned in " << backCName << " at "
3323                                         << mTra << " with no rotation";
3324 #endif
3325             mTra += DDTranslation(vecMBLyrThick()[j] / 2.0, 0 * mm, 0 * mm);
3326           }
3327         }
3328 
3329         if (0 != mBCoolTubeHere()) {
3330           const DDName mBName(ddname(mBCoolTubeName() + "_" + std::to_string(iMod + 1)));
3331 
3332           DDSolid mBCoolTubeSolid(
3333               DDSolidFactory::tubs(mBName, halfZBCool, 0, mBCoolTubeOutDiam() / 2, 0 * deg, 360 * deg));
3334 #ifdef EDM_ML_DEBUG
3335           edm::LogVerbatim("EBGeom") << mBName << " Tubs " << halfZBCool << ":0:" << mBCoolTubeOutDiam() / 2
3336                                      << ":0:360";
3337 #endif
3338           const DDLogicalPart mBLog(mBName, mBCoolTubeMat(), mBCoolTubeSolid);
3339 
3340           const DDName mBWaName(ddname(mBCoolTubeName() + "Wa_" + std::to_string(iMod + 1)));
3341           DDSolid mBCoolTubeWaSolid(
3342               DDSolidFactory::tubs(mBWaName, halfZBCool, 0, mBCoolTubeInnDiam() / 2, 0 * deg, 360 * deg));
3343 #ifdef EDM_ML_DEBUG
3344           edm::LogVerbatim("EBGeom") << mBWaName << " Tubs " << halfZBCool << ":0:" << mBCoolTubeInnDiam() / 2
3345                                      << ":0:360";
3346 #endif
3347           const DDLogicalPart mBWaLog(mBWaName, backPipeWaterMat(), mBCoolTubeWaSolid);
3348           cpv.position(mBWaLog, mBName, copyOne, DDTranslation(0, 0, 0), DDRotation());
3349 #ifdef EDM_ML_DEBUG
3350           edm::LogVerbatim("EBGeomX") << mBWaLog.name() << ":" << copyOne << " positioned in " << mBName << " at "
3351                                       << DDTranslation(0, 0, 0) << " with no rotation";
3352 #endif
3353           for (unsigned int j(0); j != mBCoolTubeNum(); ++j)  // loop over all MB cooling circuits
3354           {
3355             cpv.position(
3356                 mBLog,
3357                 backCName,
3358                 2 * j + 1,
3359                 DDTranslation(
3360                     -backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2., -bHalfWidth + (j + 1) * bHalfWidth / 5, 0),
3361                 DDRotation());
3362 #ifdef EDM_ML_DEBUG
3363             edm::LogVerbatim("EBGeomX") << mBLog.name() << ":" << (2 * j + 1) << " positioned in " << backCName
3364                                         << " at "
3365                                         << DDTranslation(-backCoolHeight / 2.0 + mBCoolTubeOutDiam() / 2.,
3366                                                          -bHalfWidth + (j + 1) * bHalfWidth / 5,
3367                                                          0)
3368                                         << " with no rotation";
3369 #endif
3370           }
3371         }
3372 
3373         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3374         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3375         //!!!!!!!!!!!!!! Begin Back Water Pipes   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3376         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3377         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3378         if (0 != backPipeHere() && 0 != iMod) {
3379           DDName bPipeName(ddname(backPipeName() + "_" + std::to_string(iMod + 1)));
3380           DDName bInnerName(ddname(backPipeName() + "_H2O_" + std::to_string(iMod + 1)));
3381 
3382           DDSolid backPipeSolid(
3383               DDSolidFactory::tubs(bPipeName, pipeLength / 2, 0 * mm, vecBackPipeDiam()[iMod] / 2, 0 * deg, 360 * deg));
3384 #ifdef EDM_ML_DEBUG
3385           edm::LogVerbatim("EBGeom") << bPipeName << " Tubs " << pipeLength / 2 << ":0:" << vecBackPipeDiam()[iMod] / 2
3386                                      << ":0:360";
3387 #endif
3388 
3389           DDSolid backInnerSolid(DDSolidFactory::tubs(bInnerName,
3390                                                       pipeLength / 2,
3391                                                       0 * mm,
3392                                                       vecBackPipeDiam()[iMod] / 2 - vecBackPipeThick()[iMod],
3393                                                       0 * deg,
3394                                                       360 * deg));
3395 #ifdef EDM_ML_DEBUG
3396           edm::LogVerbatim("EBGeom") << bInnerName << " Tubs " << pipeLength / 2
3397                                      << ":0:" << vecBackPipeDiam()[iMod] / 2 - vecBackPipeThick()[iMod] << ":0:360";
3398 #endif
3399 
3400           const DDLogicalPart backPipeLog(bPipeName, backPipeMat(), backPipeSolid);
3401 
3402           const DDLogicalPart backInnerLog(bInnerName, backPipeWaterMat(), backInnerSolid);
3403 
3404           const DDTranslation bPipeTra1(
3405               backXOff() + backSideHeight() - 0.7 * vecBackPipeDiam()[iMod],
3406               backYOff() + backPlateWidth() / 2 - backSideWidth() - 0.7 * vecBackPipeDiam()[iMod],
3407               pipeZPos);
3408 
3409           cpv.position(backPipeLog, spmName(), copyOne, bPipeTra1, DDRotation());
3410 #ifdef EDM_ML_DEBUG
3411           edm::LogVerbatim("EBGeomX") << backPipeLog.name() << ":" << copyOne << " positioned in " << spmName()
3412                                       << " at " << bPipeTra1 << " with no rotation";
3413 #endif
3414 
3415           const DDTranslation bPipeTra2(bPipeTra1.x(),
3416                                         backYOff() - backPlateWidth() / 2 + backSideWidth() + vecBackPipeDiam()[iMod],
3417                                         bPipeTra1.z());
3418 
3419           cpv.position(backPipeLog, spmName(), copyTwo, bPipeTra2, DDRotation());
3420 #ifdef EDM_ML_DEBUG
3421           edm::LogVerbatim("EBGeomX") << backPipeLog.name() << ":" << copyTwo << " positioned in " << spmName()
3422                                       << " at " << bPipeTra2 << " with no rotation";
3423 #endif
3424           cpv.position(backInnerLog, bPipeName, copyOne, DDTranslation(), DDRotation());
3425 #ifdef EDM_ML_DEBUG
3426           edm::LogVerbatim("EBGeomX") << backInnerLog.name() << ":" << copyOne << " positioned in " << bPipeName
3427                                       << " at " << DDTranslation() << " with no rotation";
3428 #endif
3429         }
3430         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3431         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3432         //!!!!!!!!!!!!!! End Back Water Pipes   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3433         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3434         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3435 
3436         //=================================================
3437 
3438         if (0 != dryAirTubeHere()) {
3439           DDName dryAirTubName(ddname(dryAirTubeName() + std::to_string(iMod + 1)));
3440 
3441           DDSolid dryAirTubeSolid(DDSolidFactory::tubs(
3442               dryAirTubName, pipeLength / 2, dryAirTubeInnDiam() / 2, dryAirTubeOutDiam() / 2, 0 * deg, 360 * deg));
3443 #ifdef EDM_ML_DEBUG
3444           edm::LogVerbatim("EBGeom") << dryAirTubName << " Tubs " << pipeLength / 2 << ":" << dryAirTubeInnDiam() / 2
3445                                      << ":" << dryAirTubeOutDiam() / 2 << ":0:360";
3446 #endif
3447 
3448           const DDLogicalPart dryAirTubeLog(dryAirTubName, dryAirTubeMat(), dryAirTubeSolid);
3449 
3450           const DDTranslation dryAirTubeTra1(
3451               backXOff() + backSideHeight() - 0.7 * dryAirTubeOutDiam() - vecBackPipeDiam()[iMod],
3452               backYOff() + backPlateWidth() / 2 - backSideWidth() - 1.2 * dryAirTubeOutDiam(),
3453               pipeZPos);
3454 
3455           cpv.position(dryAirTubeLog, spmName(), copyOne, dryAirTubeTra1, DDRotation());
3456 #ifdef EDM_ML_DEBUG
3457           edm::LogVerbatim("EBGeomX") << dryAirTubeLog.name() << ":" << copyOne << " positioned in " << spmName()
3458                                       << " at " << dryAirTubeTra1 << " with no rotation";
3459 #endif
3460 
3461           const DDTranslation dryAirTubeTra2(
3462               dryAirTubeTra1.x(),
3463               backYOff() - backPlateWidth() / 2 + backSideWidth() + 0.7 * dryAirTubeOutDiam(),
3464               dryAirTubeTra1.z());
3465 
3466           cpv.position(dryAirTubeLog, spmName(), copyTwo, dryAirTubeTra2, DDRotation());
3467 #ifdef EDM_ML_DEBUG
3468           edm::LogVerbatim("EBGeomX") << dryAirTubeLog.name() << ":" << copyTwo << " positioned in " << spmName()
3469                                       << " at " << dryAirTubeTra2 << " with no rotation";
3470 #endif
3471         }
3472         //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3473 
3474         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3475         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3476         //!!!!!!!!!!!!!! Begin Placement of Cooling + VFE Cards          !!!!!!
3477         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3478         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3479 
3480         DDTranslation cTra(backCoolBarHeight() / 2. - backCoolHeight / 2. + bottomThick, 0, -halfZTank + halfZCoolVFE);
3481         const unsigned int numSec(static_cast<unsigned int>(vecBackCoolNSec()[iMod]));
3482         for (unsigned int jSec(0); jSec != numSec; ++jSec) {
3483           const unsigned int nMax(static_cast<unsigned int>(vecBackCoolNPerSec()[iNSec++]));
3484           for (unsigned int iBar(0); iBar != nMax; ++iBar) {
3485             cpv.position(backCoolVFELog, backCName, iCVFECopy++, cTra, DDRotation());
3486 #ifdef EDM_ML_DEBUG
3487             edm::LogVerbatim("EBGeomX") << backCoolVFELog.name() << ":" << iCVFECopy << " positioned in " << backCName
3488                                         << " at " << cTra << " with no rotation";
3489 #endif
3490             cTra += DDTranslation(0, 0, backCBStdSep());
3491           }
3492           cTra -= DDTranslation(0, 0, backCBStdSep());  // backspace to previous
3493           if (jSec != numSec - 1)
3494             cTra += DDTranslation(0, 0, vecBackCoolSecSep()[iSep++]);  // now take atypical step
3495         }
3496         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3497         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3498         //!!!!!!!!!!!!!! End Placement of Cooling + VFE Cards            !!!!!!
3499         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3500         //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3501       }
3502 
3503       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3504       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3505       //!!!!!!!!!!!!!! End Placement of Readout & Cooling by Module    !!!!!!
3506       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3507       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3508 
3509       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3510       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3511       //!!!!!!!!!!!!!! Begin Patch Panel   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3512       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3513       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3514 
3515       double patchHeight(0);
3516       for (unsigned int iPatch(0); iPatch != vecPatchPanelThick().size(); ++iPatch) {
3517         patchHeight += vecPatchPanelThick()[iPatch];
3518       }
3519 
3520       DDSolid patchSolid(DDSolidFactory::box(patchPanelName(),
3521                                              patchHeight / 2.,
3522                                              backCoolBarWidth() / 2.,
3523                                              (vecSpmZPts().back() - vecGrilleZOff().back() - grilleThick()) / 2));
3524 #ifdef EDM_ML_DEBUG
3525       edm::LogVerbatim("EBGeom") << patchPanelName() << " Box " << patchHeight / 2. << ":" << backCoolBarWidth() / 2.
3526                                  << ":" << (vecSpmZPts().back() - vecGrilleZOff().back() - grilleThick()) / 2;
3527 #endif
3528 
3529       const std::vector<double>& patchParms(patchSolid.parameters());
3530 
3531       const DDLogicalPart patchLog(patchPanelName(), spmMat(), patchSolid);
3532 
3533       const DDTranslation patchTra(backXOff() + 4 * mm, 0 * mm, vecGrilleZOff().back() + grilleThick() + patchParms[2]);
3534       if (0 != patchPanelHere()) {
3535         cpv.position(patchLog, spmName(), copyOne, patchTra, DDRotation());
3536 #ifdef EDM_ML_DEBUG
3537         edm::LogVerbatim("EBGeomX") << patchLog.name() << ":" << copyOne << " positioned in " << spmName() << " at "
3538                                     << patchTra << " with no rotation";
3539 #endif
3540       }
3541       DDTranslation pTra(-patchParms[0], 0, 0);
3542 
3543       for (unsigned int j(0); j != vecPatchPanelNames().size(); ++j) {
3544         const DDName pName(ddname(vecPatchPanelNames()[j]));
3545 
3546         DDSolid pSolid(DDSolidFactory::box(pName, vecPatchPanelThick()[j] / 2., patchParms[1], patchParms[2]));
3547 #ifdef EDM_ML_DEBUG
3548         edm::LogVerbatim("EBGeom") << pName << " Box " << vecPatchPanelThick()[j] / 2. << ":" << patchParms[1] << ":"
3549                                    << patchParms[2];
3550 #endif
3551         const DDLogicalPart pLog(pName, ddmat(vecPatchPanelMat()[j]), pSolid);
3552 
3553         pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm);
3554 
3555         cpv.position(pLog, patchPanelName(), copyOne, pTra, DDRotation());
3556 #ifdef EDM_ML_DEBUG
3557         edm::LogVerbatim("EBGeomX") << pLog.name() << ":" << copyOne << " positioned in " << patchPanelName() << " at "
3558                                     << pTra << " with no rotation";
3559 #endif
3560         pTra += DDTranslation(vecPatchPanelThick()[j] / 2, 0 * mm, 0 * mm);
3561       }
3562       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3563       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3564       //!!!!!!!!!!!!!! End Patch Panel     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3565       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3566       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3567 
3568       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3569       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3570       //!!!!!!!!!!!!!! Begin Pincers       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3571       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3572       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3573 
3574       if (0 != pincerRodHere()) {
3575         // Make hierarchy of rods, envelopes, blocks, shims, and cutouts
3576 
3577         DDSolid rodSolid(
3578             DDSolidFactory::box(pincerRodName(), pincerEnvWidth() / 2., pincerEnvHeight() / 2., ilyLength / 2));
3579 #ifdef EDM_ML_DEBUG
3580         edm::LogVerbatim("EBGeom") << pincerRodName() << " Box " << pincerEnvWidth() / 2. << ":"
3581                                    << pincerEnvHeight() / 2. << ":" << ilyLength / 2;
3582 #endif
3583         const DDLogicalPart rodLog(pincerRodName(), pincerRodMat(), rodSolid);
3584 
3585         DDSolid envSolid(
3586             DDSolidFactory::box(pincerEnvName(), pincerEnvWidth() / 2., pincerEnvHeight() / 2., pincerEnvLength() / 2));
3587 #ifdef EDM_ML_DEBUG
3588         edm::LogVerbatim("EBGeom") << pincerEnvName() << " Box " << pincerEnvWidth() / 2. << ":"
3589                                    << pincerEnvHeight() / 2. << ":" << pincerEnvLength() / 2;
3590 #endif
3591         const DDLogicalPart envLog(pincerEnvName(), pincerEnvMat(), envSolid);
3592         const std::vector<double>& envParms(envSolid.parameters());
3593 
3594         DDSolid blkSolid(
3595             DDSolidFactory::box(pincerBlkName(), pincerEnvWidth() / 2., pincerEnvHeight() / 2., pincerBlkLength() / 2));
3596 #ifdef EDM_ML_DEBUG
3597         edm::LogVerbatim("EBGeom") << pincerBlkName() << " Box " << pincerEnvWidth() / 2. << ":"
3598                                    << pincerEnvHeight() / 2. << ":" << pincerBlkLength() / 2;
3599 #endif
3600         const DDLogicalPart blkLog(pincerBlkName(), pincerBlkMat(), blkSolid);
3601         const std::vector<double>& blkParms(blkSolid.parameters());
3602         cpv.position(blkLog,
3603                      pincerEnvName(),
3604                      copyOne,
3605                      DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2),
3606                      DDRotation());
3607 #ifdef EDM_ML_DEBUG
3608         edm::LogVerbatim("EBGeomX") << blkLog.name() << ":" << copyOne << " positioned in " << pincerEnvName() << " at "
3609                                     << DDTranslation(0, 0, pincerEnvLength() / 2 - pincerBlkLength() / 2)
3610                                     << " with no rotation";
3611 #endif
3612 
3613         DDSolid cutSolid(
3614             DDSolidFactory::box(pincerCutName(), pincerCutWidth() / 2., pincerCutHeight() / 2., pincerBlkLength() / 2));
3615 #ifdef EDM_ML_DEBUG
3616         edm::LogVerbatim("EBGeom") << pincerCutName() << " Box " << pincerCutWidth() / 2. << ":"
3617                                    << pincerCutHeight() / 2 << ":" << pincerBlkLength() / 2;
3618 #endif
3619         const DDLogicalPart cutLog(pincerCutName(), pincerCutMat(), cutSolid);
3620         const std::vector<double>& cutParms(cutSolid.parameters());
3621         cpv.position(
3622             cutLog,
3623             pincerBlkName(),
3624             copyOne,
3625             DDTranslation(
3626                 +blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(), -blkParms[1] + cutParms[1], 0),
3627             DDRotation());
3628 #ifdef EDM_ML_DEBUG
3629         edm::LogVerbatim("EBGeomX") << cutLog.name() << ":" << copyOne << " positioned in " << pincerBlkName() << " at "
3630                                     << DDTranslation(
3631                                            blkParms[0] - cutParms[0] - pincerShim1Width() + pincerShim2Width(),
3632                                            -blkParms[1] + cutParms[1],
3633                                            0)
3634                                     << " with no rotation";
3635 #endif
3636 
3637         DDSolid shim2Solid(DDSolidFactory::box(
3638             pincerShim2Name(), pincerShim2Width() / 2., pincerShimHeight() / 2., pincerBlkLength() / 2));
3639 #ifdef EDM_ML_DEBUG
3640         edm::LogVerbatim("EBGeom") << pincerShim2Name() << " Box " << pincerShim2Width() / 2. << ":"
3641                                    << pincerShimHeight() / 2. << ":" << pincerBlkLength() / 2;
3642 #endif
3643         const DDLogicalPart shim2Log(pincerShim2Name(), pincerShimMat(), shim2Solid);
3644         const std::vector<double>& shim2Parms(shim2Solid.parameters());
3645         cpv.position(shim2Log,
3646                      pincerCutName(),
3647                      copyOne,
3648                      DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0),
3649                      DDRotation());
3650 #ifdef EDM_ML_DEBUG
3651         edm::LogVerbatim("EBGeomX") << shim2Log.name() << ":" << copyOne << " positioned in " << pincerCutName()
3652                                     << " at "
3653                                     << DDTranslation(+cutParms[0] - shim2Parms[0], -cutParms[1] + shim2Parms[1], 0)
3654                                     << " with no rotation";
3655 #endif
3656 
3657         DDSolid shim1Solid(DDSolidFactory::box(pincerShim1Name(),
3658                                                pincerShim1Width() / 2.,
3659                                                pincerShimHeight() / 2.,
3660                                                (pincerEnvLength() - pincerBlkLength()) / 2));
3661 #ifdef EDM_ML_DEBUG
3662         edm::LogVerbatim("EBGeom") << pincerShim1Name() << " Box " << pincerShim1Width() / 2. << ":"
3663                                    << pincerShimHeight() / 2. << ":" << (pincerEnvLength() - pincerBlkLength()) / 2;
3664 #endif
3665 
3666         const DDLogicalPart shim1Log(pincerShim1Name(), pincerShimMat(), shim1Solid);
3667         const std::vector<double>& shim1Parms(shim1Solid.parameters());
3668         cpv.position(
3669             shim1Log,
3670             pincerEnvName(),
3671             copyOne,
3672             DDTranslation(+envParms[0] - shim1Parms[0], -envParms[1] + shim1Parms[1], -envParms[2] + shim1Parms[2]),
3673             DDRotation());
3674 #ifdef EDM_ML_DEBUG
3675         edm::LogVerbatim("EBGeomX") << shim1Log.name() << ":" << copyOne << " positioned in " << pincerEnvName()
3676                                     << " at "
3677                                     << DDTranslation(+envParms[0] - shim1Parms[0],
3678                                                      -envParms[1] + shim1Parms[1],
3679                                                      -envParms[2] + shim1Parms[2])
3680                                     << " with no rotation";
3681 #endif
3682         for (unsigned int iEnv(0); iEnv != vecPincerEnvZOff().size(); ++iEnv) {
3683           cpv.position(envLog,
3684                        pincerRodName(),
3685                        1 + iEnv,
3686                        DDTranslation(0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.),
3687                        DDRotation());
3688 #ifdef EDM_ML_DEBUG
3689           edm::LogVerbatim("EBGeomX") << envLog.name() << ":" << (1 + iEnv) << " positioned in " << pincerRodName()
3690                                       << " at "
3691                                       << DDTranslation(
3692                                              0, 0, -ilyLength / 2. + vecPincerEnvZOff()[iEnv] - pincerEnvLength() / 2.)
3693                                       << " with no rotation";
3694 #endif
3695         }
3696 
3697         // Place the rods
3698         //   const double radius ( fawRadOff() - pincerEnvHeight()/2 -1*mm ) ;
3699         const double radius(ilyRMin - pincerEnvHeight() / 2 - 1 * mm);
3700 
3701         const DDName xilyName(ddname(ilyName() + std::to_string(vecIlyMat().size() - 1)));
3702 
3703         for (unsigned int iRod(0); iRod != vecPincerRodAzimuth().size(); ++iRod) {
3704           const DDTranslation rodTra(
3705               radius * cos(vecPincerRodAzimuth()[iRod]), radius * sin(vecPincerRodAzimuth()[iRod]), 0);
3706 
3707           cpv.position(rodLog,
3708                        xilyName,
3709                        1 + iRod,
3710                        rodTra,
3711                        myrot(pincerRodName().name() + std::to_string(iRod),
3712                              CLHEP::HepRotationZ(90 * deg + vecPincerRodAzimuth()[iRod])));
3713 #ifdef EDM_ML_DEBUG
3714           edm::LogVerbatim("EBGeomX") << rodLog.name() << ":" << (1 + iRod) << " positioned in " << xilyName << " at "
3715                                       << rodTra << " with rotation";
3716 #endif
3717         }
3718       }
3719       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3720       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3721       //!!!!!!!!!!!!!! End   Pincers       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3722       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3723       //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3724     }
3725   }
3726 
3727 #ifdef EDM_ML_DEBUG
3728   edm::LogVerbatim("EcalGeom") << "******** DDEcalBarrelAlgo test: end it...";
3729 #endif
3730 }
3731 
3732 ///Create a DDRotation from a string converted to DDName and CLHEP::HepRotation converted to DDRotationMatrix. -- Michael Case
3733 DDRotation DDEcalBarrelNewAlgo::myrot(const std::string& s, const CLHEP::HepRotation& r) const {
3734   return DDrot(
3735       ddname(m_idNameSpace + ":" + s),
3736       std::make_unique<DDRotationMatrix>(r.xx(), r.xy(), r.xz(), r.yx(), r.yy(), r.yz(), r.zx(), r.zy(), r.zz()));
3737 }
3738 
3739 DDMaterial DDEcalBarrelNewAlgo::ddmat(const std::string& s) const { return DDMaterial(ddname(s)); }
3740 
3741 DDName DDEcalBarrelNewAlgo::ddname(const std::string& s) const {
3742   const pair<std::string, std::string> temp(DDSplit(s));
3743   if (temp.second.empty()) {
3744     return DDName(temp.first, m_idNameSpace);
3745   } else {
3746     return DDName(temp.first, temp.second);
3747   }
3748 }
3749 
3750 DDSolid DDEcalBarrelNewAlgo::mytrap(const std::string& s, const EcalTrapezoidParameters& t) const {
3751 #ifdef EDM_ML_DEBUG
3752   edm::LogVerbatim("EBGeom") << DDName(s) << " Trap " << t.theta() / CLHEP::deg << ":" << t.phi() / CLHEP::deg << ":"
3753                              << t.h1() << ":" << t.bl1() << ":" << t.tl1() << ":" << t.alp1() / CLHEP::deg << ":"
3754                              << t.h2() << ":" << t.bl2() << ":" << t.tl2() << ":" << t.alp2() / CLHEP::deg;
3755 #endif
3756   return DDSolidFactory::trap(
3757       ddname(s), t.dz(), t.theta(), t.phi(), t.h1(), t.bl1(), t.tl1(), t.alp1(), t.h2(), t.bl2(), t.tl2(), t.alp2());
3758 }
3759 
3760 void DDEcalBarrelNewAlgo::web(unsigned int iWeb,
3761                               double bWeb,
3762                               double BWeb,
3763                               double LWeb,
3764                               double theta,
3765                               const HepGeom::Point3D<double>& corner,
3766                               const DDLogicalPart& logPar,
3767                               double& zee,
3768                               double side,
3769                               double front,
3770                               double delta,
3771                               DDCompactView& cpv) {
3772   const unsigned int copyOne(1);
3773 
3774   const double LWebx(vecWebLength()[iWeb]);
3775 
3776   const double BWebx(bWeb + (BWeb - bWeb) * LWebx / LWeb);
3777 
3778   const double thick(vecWebPlTh()[iWeb] + vecWebClrTh()[iWeb]);
3779   const Trap trapWebClr(BWebx / 2,     // A/2
3780                         bWeb / 2,      // a/2
3781                         bWeb / 2,      // b/2
3782                         thick / 2,     // H/2
3783                         thick / 2,     // h/2
3784                         LWebx / 2,     // L/2
3785                         90 * deg,      // alfa1
3786                         bWeb - BWebx,  // x15
3787                         0              // y15
3788   );
3789   const DDName webClrDDName(webClrName() + std::to_string(iWeb));
3790   const DDSolid webClrSolid(mytrap(webClrDDName.name(), trapWebClr));
3791   const DDLogicalPart webClrLog(webClrDDName, webClrMat(), webClrSolid);
3792 
3793   const Trap trapWebPl(trapWebClr.A() / 2,               // A/2
3794                        trapWebClr.a() / 2,               // a/2
3795                        trapWebClr.b() / 2,               // b/2
3796                        vecWebPlTh()[iWeb] / 2,           // H/2
3797                        vecWebPlTh()[iWeb] / 2,           // h/2
3798                        trapWebClr.L() / 2.,              // L/2
3799                        90 * deg,                         // alfa1
3800                        trapWebClr.b() - trapWebClr.B(),  // x15
3801                        0                                 // y15
3802   );
3803   const DDName webPlDDName(webPlName() + std::to_string(iWeb));
3804   const DDSolid webPlSolid(mytrap(webPlDDName.fullname(), trapWebPl));
3805   const DDLogicalPart webPlLog(webPlDDName, webPlMat(), webPlSolid);
3806 
3807   cpv.position(webPlLog,  // place plate inside clearance volume
3808                webClrDDName,
3809                copyOne,
3810                DDTranslation(0, 0, 0),
3811                DDRotation());
3812 #ifdef EDM_ML_DEBUG
3813   edm::LogVerbatim("EBGeomX") << webPlLog.name() << ":" << copyOne << " positioned in " << webClrDDName << " at "
3814                               << DDTranslation(0, 0, 0) << " with no rotation";
3815 #endif
3816   const Trap::VertexList vWeb(trapWebClr.vertexList());
3817 
3818   zee += trapWebClr.h() / sin(theta);
3819 
3820   const double beta(theta + delta);
3821 
3822   const double zWeb(zee - front * cos(beta) + side * sin(beta));
3823   const double yWeb(front * sin(beta) + side * cos(beta));
3824 
3825   const Pt3D wedge3(corner + Pt3D(0, -yWeb, zWeb));
3826   const Pt3D wedge2(wedge3 + Pt3D(0, trapWebClr.h() * cos(theta), -trapWebClr.h() * sin(theta)));
3827   const Pt3D wedge1(wedge3 + Pt3D(trapWebClr.a(), 0, 0));
3828 
3829 #ifdef EDM_ML_DEBUG
3830   edm::LogVerbatim("EcalGeom") << "trap1=" << vWeb[0] << ", trap2=" << vWeb[2] << ", trap3=" << vWeb[3];
3831 
3832   edm::LogVerbatim("EcalGeom") << "wedge1=" << wedge1 << ", wedge2=" << wedge2 << ", wedge3=" << wedge3;
3833 #endif
3834   const Tf3D tForm(vWeb[0], vWeb[2], vWeb[3], wedge1, wedge2, wedge3);
3835 
3836   if (0 != webHere()) {
3837     cpv.position(webClrLog,
3838                  logPar,
3839                  copyOne,
3840                  DDTranslation(tForm.getTranslation().x(), tForm.getTranslation().y(), tForm.getTranslation().z()),
3841                  myrot(webClrLog.name().name() + std::to_string(iWeb), tForm.getRotation()));
3842 #ifdef EDM_ML_DEBUG
3843     edm::LogVerbatim("EBGeomX") << webClrLog.name() << ":" << copyOne << " positioned in " << logPar.name() << " at "
3844                                 << DDTranslation(tForm.getTranslation().x(),
3845                                                  tForm.getTranslation().y(),
3846                                                  tForm.getTranslation().z())
3847                                 << " with rotation";
3848 #endif
3849   }
3850 }
3851 
3852 #include "DetectorDescription/Core/interface/DDAlgorithmFactory.h"
3853 
3854 DEFINE_EDM_PLUGIN(DDAlgorithmFactory, DDEcalBarrelNewAlgo, "ecal:DDEcalBarrelNewAlgo");