diff --git a/DetectorDescription/DDCMS/interface/DDutils.h b/DetectorDescription/DDCMS/interface/DDutils.h new file mode 100644 index 0000000000000..683a77fb5e0e1 --- /dev/null +++ b/DetectorDescription/DDCMS/interface/DDutils.h @@ -0,0 +1,11 @@ +#ifndef DETECTOR_DESCRIPTION_DDCMS_DDUTILS_H +#define DETECTOR_DESCRIPTION_DDCMS_DDUTILS_H +#include "DD4hep/DD4hepUnits.h" + +namespace cms { + template + inline constexpr NumType convert2mm(NumType length) { + return (length / dd4hep::mm); + } +} // namespace cms +#endif diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc index b9484a9f7e722..8a282ba53f23e 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDAHcalModuleAlgo.cc @@ -7,10 +7,10 @@ #include "DataFormats/Math/interface/angle_units.h" #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/AHCalParameters.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -31,7 +31,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << materials.size() << " types of volumes"; for (unsigned int i = 0; i < names.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick[i]) << " filled with " << materials[i] + << cms::convert2mm(thick[i]) << " filled with " << materials[i] << " first copy number " << copyNumber[i]; #endif const auto& layers = args.value >("Layers"); // Number of layers in a section @@ -41,7 +41,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << layers.size() << " blocks"; for (unsigned int i = 0; i < layers.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << HGCalDD4HepHelper::convert2mm(layerThick[i]) + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick[i]) << " with " << layers[i] << " layers"; edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << layerType.size() << " layers"; for (unsigned int i = 0; i < layerType.size(); ++i) @@ -56,15 +56,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << widths.size() << " sizes for width " << "and height:"; for (unsigned int i = 0; i < widths.size(); ++i) - edm::LogVerbatim("HGCalGeom") << " [" << i << "] " << HGCalDD4HepHelper::convert2mm(widths[i]) << ":" - << HGCalDD4HepHelper::convert2mm(heights[i]); + edm::LogVerbatim("HGCalGeom") << " [" << i << "] " << cms::convert2mm(widths[i]) << ":" + << cms::convert2mm(heights[i]); edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << tileN.size() << " tile positioning parameters"; for (unsigned int i = 0; i < tileN.size(); ++i) - edm::LogVerbatim("HGCalGeom") << " [" << i << "] " << tileN[i] << ":" << HGCalDD4HepHelper::convert2mm(tileStep[i]); + edm::LogVerbatim("HGCalGeom") << " [" << i << "] " << tileN[i] << ":" << cms::convert2mm(tileStep[i]); #endif const auto& zMinBlock = args.value("zMinBlock"); // Starting z-value of the block #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock) + edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: zStart " << cms::convert2mm(zMinBlock) << " NameSpace " << ns.name(); #endif @@ -87,9 +87,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext std::string name = "HGCal" + names[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo test: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << " Back " - << HGCalDD4HepHelper::convert2mm(zo) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]); + << cms::convert2mm(zi) << " Back " + << cms::convert2mm(zo) << " superlayer thickness " + << cms::convert2mm(layerThick[i]); #endif dd4hep::Material matter = ns.material(materials[ii]); dd4hep::Volume glog; @@ -99,9 +99,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << solid.name() << " Box made of " << materials[ii] - << " of dimensions " << HGCalDD4HepHelper::convert2mm(0.5 * widths[0]) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * heights[0]) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]); + << " of dimensions " << cms::convert2mm(0.5 * widths[0]) << ", " + << cms::convert2mm(0.5 * heights[0]) << ", " + << cms::convert2mm(0.5 * thick[ii]); #endif } else { dd4hep::Solid solid = dd4hep::Box(0.5 * widths[1], 0.5 * heights[1], 0.5 * thick[ii]); @@ -109,9 +109,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << solid.name() << " Box made of " << materials[ii] - << " of dimensions " << HGCalDD4HepHelper::convert2mm(0.5 * widths[1]) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * heights[1]) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]); + << " of dimensions " << cms::convert2mm(0.5 * widths[1]) << ", " + << cms::convert2mm(0.5 * heights[1]) << ", " + << cms::convert2mm(0.5 * thick[ii]); #endif int ncol = tileN[0] / 2; int nrow = tileN[1] / 2; @@ -138,8 +138,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG kount++; edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << tile << " number " << copy << " positioned in " - << glog.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << ",0) with no rotation"; + << glog.name() << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << ",0) with no rotation"; #endif } } @@ -153,7 +153,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++copyNumber[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDAHcalModuleAlgo: " << glog.name() << " number " << copy << " positioned in " - << module.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += (0.5 * thick[ii]); @@ -162,12 +162,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext laymin = laymax; if (fabs(thickTot - layerThick[i]) > tol) { if (thickTot > layerThick[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " is smaller than thickness " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " is smaller than thickness " << cms::convert2mm(thickTot) << " of all its components **** ERROR ****\n"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components\n"; } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc index fc3e31aa57ba9..3b503f1dfaead 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalCell.cc @@ -1,8 +1,8 @@ #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG @@ -50,9 +50,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext << cornrCN.size(); } #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Wafer r " << HGCalDD4HepHelper::convert2mm(waferSize) << " T " - << HGCalDD4HepHelper::convert2mm(waferT) << " Cell T " - << HGCalDD4HepHelper::convert2mm(cellT) << " Cells/Wafer " << nCells << " Material " + edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: Wafer r " << cms::convert2mm(waferSize) << " T " + << cms::convert2mm(waferT) << " Cell T " + << cms::convert2mm(cellT) << " Cells/Wafer " << nCells << " Material " << material << "Sensitive Position " << posSens << " Full Cell: " << fullCN << ":" << fullSensN; for (int k = 0; k < 3; ++k) @@ -98,14 +98,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif std::vector zc = {-0.5 * cellT, 0.5 * cellT}; solid = dd4hep::ExtrudedPolygon(xw, yw, zc, zx, zy, scale); @@ -114,21 +114,21 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog2); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zc[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zc[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zc[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zc[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif dd4hep::Rotation3D rotation; glog1.placeVolume(glog2, 1, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << glog2.name() << " number 1 position in " << glog1.name() - << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) << ") with no rotation"; + << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif static const int ir0[] = {0, 1, 0}; @@ -146,14 +146,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif solid = dd4hep::ExtrudedPolygon(xw, yw, zc, zx, zy, scale); @@ -162,19 +162,19 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog2); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif glog1.placeVolume(glog2, 1, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << glog2.name() << " number 1 position in " << glog1.name() - << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) << ") with no rotation"; + << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif } @@ -192,14 +192,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif solid = dd4hep::ExtrudedPolygon(xw, yw, zc, zx, zy, scale); ns.addSolidNS(ns.prepend(extenSensN[i]), solid); @@ -207,19 +207,19 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog2); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif glog1.placeVolume(glog2, 1, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << glog2.name() << " number 1 position in " << glog1.name() - << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) << " with no rotation"; + << " at (0,0," << cms::convert2mm(zpos) << " with no rotation"; #endif } @@ -237,14 +237,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif solid = dd4hep::ExtrudedPolygon(xw, yw, zc, zx, zy, scale); ns.addSolidNS(ns.prepend(cornrSensN[i]), solid); @@ -252,19 +252,19 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog2); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xw.size() << " edges"; for (unsigned int k = 0; k < xw.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xw[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yw[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xw[k]) << ":" + << cms::convert2mm(yw[k]); #endif glog1.placeVolume(glog2, 1, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalCell: " << glog2.name() << " number 1 position in " << glog1.name() - << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) << " with no rotation"; + << " at (0,0," << cms::convert2mm(zpos) << " with no rotation"; #endif } return cms::s_executed; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc index 9628aec30ec76..70a636fa5a96a 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEAlgo.cc @@ -16,12 +16,12 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" #include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -85,7 +85,7 @@ struct HGCalEEAlgo { edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << materials_.size() << " types of volumes"; for (unsigned int i = 0; i < names_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick_[i]) << " filled with " << materials_[i] + << cms::convert2mm(thick_[i]) << " filled with " << materials_[i] << " first copy number " << copyNumber_[i]; #endif @@ -95,7 +95,7 @@ struct HGCalEEAlgo { edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks"; for (unsigned int i = 0; i < layers_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]) << " with " << layers_[i] + << cms::convert2mm(layerThick_[i]) << " with " << layers_[i] << " layers"; #endif @@ -148,12 +148,12 @@ struct HGCalEEAlgo { alpha_ = (1._pi) / sectors_; cosAlpha_ = cos(alpha_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock_) + edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " radius for wafer type separation uses " << rad100to200_.size() - << " parameters; zmin " << HGCalDD4HepHelper::convert2mm(zMinRadPar_) << " cutoff " + << " parameters; zmin " << cms::convert2mm(zMinRadPar_) << " cutoff " << choiceType_ << ":" << nCutRadPar_ << ":" << fracAreaMin_ << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferSize_) << " separations " - << HGCalDD4HepHelper::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" + << cms::convert2mm(waferSize_) << " separations " + << cms::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_; for (unsigned int k = 0; k < rad100to200_.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " << rad100to200_[k] << " 200-300 " << rad200to300_[k]; @@ -167,12 +167,12 @@ struct HGCalEEAlgo { rMaxFront_ = args.value>("RMaxFront"); #ifdef EDM_ML_DEBUG for (unsigned int i = 0; i < slopeB_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontB_[i]) - << " Rmin " << HGCalDD4HepHelper::convert2mm(rMinFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) + << " Rmin " << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i]; for (unsigned int i = 0; i < slopeT_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontT_[i]) - << " Rmax " << HGCalDD4HepHelper::convert2mm(rMaxFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) + << " Rmax " << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i]; #endif @@ -182,8 +182,8 @@ struct HGCalEEAlgo { waferType_ = std::make_unique(rad100to200_, rad200to300_, - HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)), - HGCalDD4HepHelper::convert2mm(zMinRadPar_), + cms::convert2mm((waferSize_ + waferSepar_)), + cms::convert2mm(zMinRadPar_), choiceType_, nCutRadPar_, fracAreaMin_); @@ -237,11 +237,11 @@ struct HGCalEEAlgo { std::string name = ns.prepend(names_[ii]) + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << " Back " - << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]); + << cms::convert2mm(zi) << ", " + << cms::convert2mm(routF) << " Back " + << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick_[i]); #endif std::string matName = materials_[ii]; @@ -272,12 +272,12 @@ struct HGCalEEAlgo { pgonRout); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") - << "DDHGCalEEAlgo: z " << HGCalDD4HepHelper::convert2mm((zz - hthick)) << ":" - << HGCalDD4HepHelper::convert2mm((zz + hthick)) << " with " << pgonZ.size() << " palnes"; + << "DDHGCalEEAlgo: z " << cms::convert2mm((zz - hthick)) << ":" + << cms::convert2mm((zz + hthick)) << " with " << pgonZ.size() << " palnes"; for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) - edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[isec]) - << " R " << HGCalDD4HepHelper::convert2mm(pgonRin[isec]) << ":" - << HGCalDD4HepHelper::convert2mm(pgonRout[isec]); + edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << cms::convert2mm(pgonZ[isec]) + << " R " << cms::convert2mm(pgonRin[isec]) << ":" + << cms::convert2mm(pgonRout[isec]); #endif for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) { pgonZ[isec] -= zz; @@ -298,8 +298,8 @@ struct HGCalEEAlgo { for (unsigned int k = 0; k < pgonZ.size(); ++k) edm::LogVerbatim("HGCalGeom") - << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]); #endif } else { double rins = @@ -313,11 +313,11 @@ struct HGCalEEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(rins) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ":" - << HGCalDD4HepHelper::convert2mm(routs) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0 and position " + << " of dimensions " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(rins) << ", " + << cms::convert2mm(routF) << ":" + << cms::convert2mm(routs) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif PositionSensitive( @@ -330,7 +330,7 @@ struct HGCalEEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.name() << " number " << copy << " positioned in " - << module.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += hthick; @@ -339,12 +339,12 @@ struct HGCalEEAlgo { laymin = laymax; if (std::abs(thickTot - layerThick_[i]) >= tol2) { if (thickTot > layerThick_[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } @@ -370,12 +370,12 @@ struct HGCalEEAlgo { #ifdef EDM_ML_DEBUG int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0); std::vector ntype(6, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.name() << " rout " << HGCalDD4HepHelper::convert2mm(rout) - << " N " << N << " for maximum u, v; r " << HGCalDD4HepHelper::convert2mm(r) << " R " - << HGCalDD4HepHelper::convert2mm(R) << " dy " << HGCalDD4HepHelper::convert2mm(dy) - << " Shift " << HGCalDD4HepHelper::convert2mm(xyoff.first) << ":" - << HGCalDD4HepHelper::convert2mm(xyoff.second) << " WaferSize " - << HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)); + edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.name() << " rout " << cms::convert2mm(rout) + << " N " << N << " for maximum u, v; r " << cms::convert2mm(r) << " R " + << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) + << " Shift " << cms::convert2mm(xyoff.first) << ":" + << cms::convert2mm(xyoff.second) << " WaferSize " + << cms::convert2mm((waferSize_ + waferSepar_)); #endif for (int u = -N; u <= N; ++u) { @@ -391,16 +391,16 @@ struct HGCalEEAlgo { ++ntot; if (((corner.first <= 0) && std::abs(u) < 5 && std::abs(v) < 5) || (std::abs(u) < 2 && std::abs(v) < 2)) { edm::LogVerbatim("HGCalGeom") << "DDHGCalEEAlgo: " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" - << HGCalDD4HepHelper::convert2mm(rout) << "\n Z " - << HGCalDD4HepHelper::convert2mm(zpos) << " LayerType " << layertype << " u " + << cms::convert2mm(rin) << ":" + << cms::convert2mm(rout) << "\n Z " + << cms::convert2mm(zpos) << " LayerType " << layertype << " u " << u << " v " << v << " with " << corner.first << " corners"; } #endif if (corner.first > 0) { - int type = waferType_->getType(HGCalDD4HepHelper::convert2mm(xpos), - HGCalDD4HepHelper::convert2mm(ypos), - HGCalDD4HepHelper::convert2mm(zpos)); + int type = waferType_->getType(cms::convert2mm(xpos), + cms::convert2mm(ypos), + cms::convert2mm(zpos)); int copy = HGCalTypes::packTypeUV(type, u, v); #ifdef EDM_ML_DEBUG if (iu > ium) @@ -428,7 +428,7 @@ struct HGCalEEAlgo { ++ntype[type]; edm::LogVerbatim("HGCalGeom") << " DDHGCalEEAlgo: " << wafers_[type] << " number " << copy << " positioned in " << glog.name() - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << ", " << HGCalDD4HepHelper::convert2mm(ypos) + << " at (" << cms::convert2mm(xpos) << ", " << cms::convert2mm(ypos) << ",0) with no rotation"; #endif } @@ -441,7 +441,7 @@ struct HGCalEEAlgo { << ":" << ivmAll << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ":" << ntype[3] << ":" << ntype[4] << ":" << ntype[5] << ") for " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rout); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rout); #endif } }; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc index 8ea67636aa5ab..111d3fa49d00b 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalEEFileAlgo.cc @@ -18,8 +18,8 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -51,7 +51,7 @@ struct HGCalEEFileAlgo { edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << materials_.size() << " types of volumes"; for (unsigned int i = 0; i < names_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick_[i]) << " filled with " << materials_[i] + << cms::convert2mm(thick_[i]) << " filled with " << materials_[i] << " first copy number " << copyNumber_[i]; #endif layers_ = args.value>("Layers"); @@ -60,7 +60,7 @@ struct HGCalEEFileAlgo { edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks"; for (unsigned int i = 0; i < layers_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]) << " with " << layers_[i] + << cms::convert2mm(layerThick_[i]) << " with " << layers_[i] << " layers"; #endif layerType_ = args.value>("LayerType"); @@ -105,9 +105,9 @@ struct HGCalEEFileAlgo { alpha_ = (1._pi) / sectors_; cosAlpha_ = cos(alpha_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock_) << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferSize_) << " separations " - << HGCalDD4HepHelper::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" + edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " wafer width " + << cms::convert2mm(waferSize_) << " separations " + << cms::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_; #endif waferIndex_ = args.value>("WaferIndex"); @@ -131,12 +131,12 @@ struct HGCalEEFileAlgo { rMaxFront_ = args.value>("RMaxFront"); #ifdef EDM_ML_DEBUG for (unsigned int i = 0; i < slopeB_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontB_[i]) - << " Rmin " << HGCalDD4HepHelper::convert2mm(rMinFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) + << " Rmin " << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i]; for (unsigned int i = 0; i < slopeT_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontT_[i]) - << " Rmax " << HGCalDD4HepHelper::convert2mm(rMaxFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) + << " Rmax " << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i]; edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: NameSpace " << ns.name(); #endif @@ -165,11 +165,11 @@ struct HGCalEEFileAlgo { std::string name = names_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << " Back " - << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]); + << cms::convert2mm(zi) << ", " + << cms::convert2mm(routF) << " Back " + << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick_[i]); #endif dd4hep::Material matter = ns.material(materials_[ii]); @@ -200,12 +200,12 @@ struct HGCalEEFileAlgo { pgonRout); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") - << "DDHGCalEEFileAlgo: z " << HGCalDD4HepHelper::convert2mm((zz - hthick)) << ":" - << HGCalDD4HepHelper::convert2mm((zz + hthick)) << " with " << pgonZ.size() << " palnes"; + << "DDHGCalEEFileAlgo: z " << cms::convert2mm((zz - hthick)) << ":" + << cms::convert2mm((zz + hthick)) << " with " << pgonZ.size() << " palnes"; for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) - edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[isec]) - << " R " << HGCalDD4HepHelper::convert2mm(pgonRin[isec]) << ":" - << HGCalDD4HepHelper::convert2mm(pgonRout[isec]); + edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << cms::convert2mm(pgonZ[isec]) + << " R " << cms::convert2mm(pgonRin[isec]) << ":" + << cms::convert2mm(pgonRout[isec]); #endif for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) { pgonZ[isec] -= zz; @@ -223,8 +223,8 @@ struct HGCalEEFileAlgo { << " sections and filled with " << matter.name(); for (unsigned int k = 0; k < pgonZ.size(); ++k) edm::LogVerbatim("HGCalGeom") - << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]); #endif } else { double rins = @@ -238,11 +238,11 @@ struct HGCalEEFileAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(rins) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ":" - << HGCalDD4HepHelper::convert2mm(routs) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0 and position " + << " of dimensions " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(rins) << ", " + << cms::convert2mm(routF) << ":" + << cms::convert2mm(routs) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif positionSensitive(ctxt, e, glog, rins, routs, zz, layerSense_[ly], (copy - firstLayer_)); @@ -253,7 +253,7 @@ struct HGCalEEFileAlgo { ++copyNumber_[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << glog.name() << " number " << copy << " positioned in " - << mother.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << mother.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += hthick; @@ -263,12 +263,12 @@ struct HGCalEEFileAlgo { // Make consistency check of all the partitions of the block if (std::abs(thickTot - layerThick_[i]) >= tol2) { if (thickTot > layerThick_[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } @@ -305,13 +305,13 @@ struct HGCalEEFileAlgo { int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0); std::vector ntype(6, 0); edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << glog.name() << " rin:rout " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rout) - << " zpos " << HGCalDD4HepHelper::convert2mm(zpos) << " N " << N - << " for maximum u, v; r " << HGCalDD4HepHelper::convert2mm(r) << " R " - << HGCalDD4HepHelper::convert2mm(R) << " dy " << HGCalDD4HepHelper::convert2mm(dy) - << " Shift " << HGCalDD4HepHelper::convert2mm(xyoff.first) << ":" - << HGCalDD4HepHelper::convert2mm(xyoff.second) << " WaferSize " - << HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rout) + << " zpos " << cms::convert2mm(zpos) << " N " << N + << " for maximum u, v; r " << cms::convert2mm(r) << " R " + << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) + << " Shift " << cms::convert2mm(xyoff.first) << ":" + << cms::convert2mm(xyoff.second) << " WaferSize " + << cms::convert2mm((waferSize_ + waferSepar_)); #endif for (int u = -N; u <= N; ++u) { for (int v = -N; v <= N; ++v) { @@ -328,9 +328,9 @@ struct HGCalEEFileAlgo { ++ntot; if (((corner.first <= 0) && std::abs(u) < 5 && std::abs(v) < 5) || (std::abs(u) < 2 && std::abs(v) < 2)) { edm::LogVerbatim("HGCalGeom") << "DDHGCalEEFileAlgo: " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" - << HGCalDD4HepHelper::convert2mm(rout) << "\n Z " - << HGCalDD4HepHelper::convert2mm(zpos) << " LayerType " << layertype << " u " + << cms::convert2mm(rin) << ":" + << cms::convert2mm(rout) << "\n Z " + << cms::convert2mm(zpos) << " LayerType " << layertype << " u " << u << " v " << v << " with " << corner.first << " corners"; } #endif @@ -366,8 +366,8 @@ struct HGCalEEFileAlgo { ++ntype[type]; edm::LogVerbatim("HGCalGeom") << " DDHGCalEEFileAlgo: " << wafers_[type] << " number " << copy << " type " << layertype << ":" << type - << " positioned in " << glog.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << ", " - << HGCalDD4HepHelper::convert2mm(ypos) << ", 0) with no rotation"; + << " positioned in " << glog.name() << " at (" << cms::convert2mm(xpos) << ", " + << cms::convert2mm(ypos) << ", 0) with no rotation"; #endif } } @@ -379,7 +379,7 @@ struct HGCalEEFileAlgo { << ":" << ivmAll << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ":" << ntype[3] << ":" << ntype[4] << ":" << ntype[5] << ") for " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rout); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rout); #endif } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc index c46a40efbdab4..4810e91ed4b9b 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEAlgo.cc @@ -14,12 +14,12 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" #include "Geometry/HGCalCommonData/interface/HGCalWaferType.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -49,7 +49,7 @@ struct HGCalHEAlgo { edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << materials_.size() << " types of volumes"; for (unsigned int i = 0; i < volumeNames_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << volumeNames_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thickness_[i]) << " filled with " << materials_[i] + << cms::convert2mm(thickness_[i]) << " filled with " << materials_[i] << " first copy number " << copyNumber_[i]; #endif layerNumbers_ = args.value>("Layers"); @@ -59,8 +59,8 @@ struct HGCalHEAlgo { edm::LogVerbatim("HGCalGeom") << "There are " << layerNumbers_.size() << " blocks"; for (unsigned int i = 0; i < layerNumbers_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]) << " Rmid " - << HGCalDD4HepHelper::convert2mm(rMixLayer_[i]) << " with " << layerNumbers_[i] + << cms::convert2mm(layerThick_[i]) << " Rmid " + << cms::convert2mm(rMixLayer_[i]) << " with " << layerNumbers_[i] << " layers"; #endif layerType_ = args.value>("LayerType"); @@ -105,7 +105,7 @@ struct HGCalHEAlgo { edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << materialsTop_.size() << " types of volumes in the top part"; for (unsigned int i = 0; i < materialsTop_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesTop_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThickTop_[i]) << " filled with " + << cms::convert2mm(layerThickTop_[i]) << " filled with " << materialsTop_[i] << " first copy number " << copyNumberTop_[i]; edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeTop_.size() << " layers in the top part"; for (unsigned int i = 0; i < layerTypeTop_.size(); ++i) @@ -122,7 +122,7 @@ struct HGCalHEAlgo { << " types of volumes in the bottom part"; for (unsigned int i = 0; i < materialsBot_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesBot_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThickBot_[i]) << " filled with " + << cms::convert2mm(layerThickBot_[i]) << " filled with " << materialsBot_[i] << " first copy number " << copyNumberBot_[i]; edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeBot_.size() << " layers in the bottom part"; for (unsigned int i = 0; i < layerTypeBot_.size(); ++i) @@ -142,12 +142,12 @@ struct HGCalHEAlgo { alpha_ = (1._pi) / sectors_; cosAlpha_ = cos(alpha_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock_) + edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: zStart " << cms::convert2mm(zMinBlock_) << " radius for wafer type separation uses " << rad100to200_.size() - << " parameters; zmin " << HGCalDD4HepHelper::convert2mm(zMinRadPar_) << " cutoff " + << " parameters; zmin " << cms::convert2mm(zMinRadPar_) << " cutoff " << choiceType_ << ":" << nCutRadPar_ << ":" << fracAreaMin_ << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferSize_) << " separations " - << HGCalDD4HepHelper::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" + << cms::convert2mm(waferSize_) << " separations " + << cms::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_; for (unsigned int k = 0; k < rad100to200_.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] 100-200 " << rad100to200_[k] << " 200-300 " << rad200to300_[k]; @@ -160,20 +160,20 @@ struct HGCalHEAlgo { rMaxFront_ = args.value>("RMaxFront"); #ifdef EDM_ML_DEBUG for (unsigned int i = 0; i < slopeB_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontB_[i]) - << " Rmin " << HGCalDD4HepHelper::convert2mm(rMinFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) + << " Rmin " << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i]; for (unsigned int i = 0; i < slopeT_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontT_[i]) - << " Rmax " << HGCalDD4HepHelper::convert2mm(rMaxFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) + << " Rmax " << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i]; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: NameSpace " << ns.name(); #endif waferType_ = std::make_unique(rad100to200_, rad200to300_, - HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)), - HGCalDD4HepHelper::convert2mm(zMinRadPar_), + cms::convert2mm((waferSize_ + waferSepar_)), + cms::convert2mm(zMinRadPar_), choiceType_, nCutRadPar_, fracAreaMin_); @@ -203,11 +203,11 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << " Back " - << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]); + << cms::convert2mm(zi) << ", " + << cms::convert2mm(routF) << " Back " + << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick_[i]); #endif dd4hep::Material matter = ns.material(materials_[ii]); @@ -254,8 +254,8 @@ struct HGCalHEAlgo { << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections"; for (unsigned int k = 0; k < pgonZ.size(); ++k) edm::LogVerbatim("HGCalGeom") - << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]); #endif } else { double rins = @@ -269,11 +269,11 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(rins) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ":" - << HGCalDD4HepHelper::convert2mm(routs) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) + << " of dimensions " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(rins) << ", " + << cms::convert2mm(routF) << ":" + << cms::convert2mm(routs) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0 and positioned in: " << glog.name() << " number " << copy; #endif positionMix(ctxt, e, glog, name, copy, thickness_[ii], matter, rins, rMixLayer_[i], routs, zz); @@ -284,7 +284,7 @@ struct HGCalHEAlgo { ++copyNumber_[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.name() << " number " << copy << " positioned in " - << mother.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << mother.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += hthick; @@ -293,12 +293,12 @@ struct HGCalHEAlgo { laymin = laymax; if (std::abs(thickTot - layerThick_[i]) >= tol2_) { if (thickTot > layerThick_[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } @@ -347,9 +347,9 @@ struct HGCalHEAlgo { ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(rout) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rmid) << ", " + << cms::convert2mm(rout) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0"; #endif glog.placeVolume(glog1, 1); @@ -366,8 +366,8 @@ struct HGCalHEAlgo { name = namesTop_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":" << ii << " R " - << HGCalDD4HepHelper::convert2mm(rmid) << ":" << HGCalDD4HepHelper::convert2mm(rout) - << " Thick " << HGCalDD4HepHelper::convert2mm(layerThickTop_[ii]); + << cms::convert2mm(rmid) << ":" << cms::convert2mm(rout) + << " Thick " << cms::convert2mm(layerThickTop_[ii]); #endif dd4hep::Material matter1 = ns.material(materialsTop_[ii]); @@ -379,13 +379,13 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG double eta1 = -log(tan(0.5 * atan(rmid / zz))); double eta2 = -log(tan(0.5 * atan(rout / zz))); - edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << HGCalDD4HepHelper::convert2mm(zz) << ":" - << HGCalDD4HepHelper::convert2mm(rmid) << ":" << HGCalDD4HepHelper::convert2mm(rout) + edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << cms::convert2mm(zz) << ":" + << cms::convert2mm(rmid) << ":" << cms::convert2mm(rout) << " eta " << eta1 << ":" << eta2; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name() << " Tubs made of " << matter1.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(rout) << ", " - << HGCalDD4HepHelper::convert2mm(hthickl) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rmid) << ", " + << cms::convert2mm(rout) << ", " + << cms::convert2mm(hthickl) << ", 0.0, 360.0"; #endif zpos += hthickl; @@ -394,7 +394,7 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Position " << glog2.name() << " number " << copy << " in " - << glog1.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) + << glog1.name() << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif ++copyNumberTop_[ii]; @@ -402,12 +402,12 @@ struct HGCalHEAlgo { } if (std::abs(thickTot - thick) >= tol2_) { if (thickTot > thick) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components in the top part **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " does not match with " << cms::convert2mm(thickTot) << " of the components in top part"; } } @@ -422,9 +422,9 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rin) << ", " - << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rin) << ", " + << cms::convert2mm(rmid) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0"; #endif glog.placeVolume(glog1, 1); @@ -442,8 +442,8 @@ struct HGCalHEAlgo { name = namesBot_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Layer " << ly << ":" << ii << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rmid) - << " Thick " << HGCalDD4HepHelper::convert2mm(layerThickBot_[ii]); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rmid) + << " Thick " << cms::convert2mm(layerThickBot_[ii]); #endif dd4hep::Material matter1 = ns.material(materialsBot_[ii]); @@ -455,13 +455,13 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG double eta1 = -log(tan(0.5 * atan(rin / zz))); double eta2 = -log(tan(0.5 * atan(rmid / zz))); - edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << HGCalDD4HepHelper::convert2mm(zz) << ":" - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rmid) + edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << cms::convert2mm(zz) << ":" + << cms::convert2mm(rin) << ":" << cms::convert2mm(rmid) << " eta " << eta1 << ":" << eta2; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << solid.name() << " Tubs made of " << matter1.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rin) << ", " - << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(hthickl) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rin) << ", " + << cms::convert2mm(rmid) << ", " + << cms::convert2mm(hthickl) << ", 0.0, 360.0"; #endif zpos += hthickl; @@ -469,12 +469,12 @@ struct HGCalHEAlgo { glog1.placeVolume(glog2, copy, r1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: Position " << glog2.name() << " number " << copy << " in " - << glog1.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) + << glog1.name() << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif if (layerSenseBot_[ly] != 0) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: z " << HGCalDD4HepHelper::convert2mm((zz + zpos)) << " Center " + edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: z " << cms::convert2mm((zz + zpos)) << " Center " << copy << ":" << (copy - firstLayer_) << ":" << layerCenter_[copy - firstLayer_]; #endif positionSensitive(ctxt, e, glog2, rin, rmid, zz + zpos, layerSenseBot_[ly], layerCenter_[copy - firstLayer_]); @@ -484,12 +484,12 @@ struct HGCalHEAlgo { } if (std::abs(thickTot - thick) >= tol2_) { if (thickTot > thick) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components in the top part **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " does not match with " << cms::convert2mm(thickTot) << " of the components in top part"; } } @@ -513,11 +513,11 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0); std::vector ntype(6, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.name() << " rout " << HGCalDD4HepHelper::convert2mm(rout) + edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.name() << " rout " << cms::convert2mm(rout) << " N " << N << " for maximum u, v Offset; Shift " - << HGCalDD4HepHelper::convert2mm(xyoff.first) << ":" - << HGCalDD4HepHelper::convert2mm(xyoff.second) << " WaferSize " - << HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)); + << cms::convert2mm(xyoff.first) << ":" + << cms::convert2mm(xyoff.second) << " WaferSize " + << cms::convert2mm((waferSize_ + waferSepar_)); #endif for (int u = -N; u <= N; ++u) { for (int v = -N; v <= N; ++v) { @@ -560,8 +560,8 @@ struct HGCalHEAlgo { #ifdef EDM_ML_DEBUG ++ntype[type]; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEAlgo: " << glog.name() << " number " << copy << " positioned in " - << glog.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << ",0) with no rotation"; + << glog.name() << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << ",0) with no rotation"; #endif } } @@ -572,7 +572,7 @@ struct HGCalHEAlgo { << ":" << ivmAll << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ":" << ntype[3] << ":" << ntype[4] << ":" << ntype[5] << ") for " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rout); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rout); #endif } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc index aa04aeab7bfe4..3ac8dde54d337 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalHEFileAlgo.cc @@ -18,8 +18,8 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -51,7 +51,7 @@ struct HGCalHEFileAlgo { edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << materials_.size() << " types of volumes"; for (unsigned int i = 0; i < volumeNames_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << volumeNames_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thickness_[i]) << " filled with " << materials_[i] + << cms::convert2mm(thickness_[i]) << " filled with " << materials_[i] << " first copy number " << copyNumber_[i]; #endif layerNumbers_ = args.value>("Layers"); @@ -61,8 +61,8 @@ struct HGCalHEFileAlgo { edm::LogVerbatim("HGCalGeom") << "There are " << layerNumbers_.size() << " blocks"; for (unsigned int i = 0; i < layerNumbers_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]) << " Rmid " - << HGCalDD4HepHelper::convert2mm(rMixLayer_[i]) << " with " << layerNumbers_[i] + << cms::convert2mm(layerThick_[i]) << " Rmid " + << cms::convert2mm(rMixLayer_[i]) << " with " << layerNumbers_[i] << " layers"; #endif layerType_ = args.value>("LayerType"); @@ -110,7 +110,7 @@ struct HGCalHEFileAlgo { << " types of volumes in the top part"; for (unsigned int i = 0; i < materialsTop_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesTop_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThickTop_[i]) << " filled with " + << cms::convert2mm(layerThickTop_[i]) << " filled with " << materialsTop_[i] << " first copy number " << copyNumberTop_[i]; edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeTop_.size() << " layers in the top part"; for (unsigned int i = 0; i < layerTypeTop_.size(); ++i) @@ -127,7 +127,7 @@ struct HGCalHEFileAlgo { << " types of volumes in the bottom part"; for (unsigned int i = 0; i < materialsBot_.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << namesBot_[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThickBot_[i]) << " filled with " + << cms::convert2mm(layerThickBot_[i]) << " filled with " << materialsBot_[i] << " first copy number " << copyNumberBot_[i]; edm::LogVerbatim("HGCalGeom") << "There are " << layerTypeBot_.size() << " layers in the bottom part"; for (unsigned int i = 0; i < layerTypeBot_.size(); ++i) @@ -141,9 +141,9 @@ struct HGCalHEFileAlgo { alpha_ = (1._pi) / sectors_; cosAlpha_ = cos(alpha_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock_) - << " wafer width " << HGCalDD4HepHelper::convert2mm(waferSize_) << " separations " - << HGCalDD4HepHelper::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" + edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: zStart " << cms::convert2mm(zMinBlock_) + << " wafer width " << cms::convert2mm(waferSize_) << " separations " + << cms::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_; #endif waferIndex_ = args.value>("WaferIndex"); @@ -167,12 +167,12 @@ struct HGCalHEFileAlgo { rMaxFront_ = args.value>("RMaxFront"); #ifdef EDM_ML_DEBUG for (unsigned int i = 0; i < slopeB_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontB_[i]) - << " Rmin " << HGCalDD4HepHelper::convert2mm(rMinFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) + << " Rmin " << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i]; for (unsigned int i = 0; i < slopeT_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFrontT_[i]) - << " Rmax " << HGCalDD4HepHelper::convert2mm(rMaxFront_[i]) << " Slope " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) + << " Rmax " << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i]; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: NameSpace " << ns.name(); @@ -200,11 +200,11 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << " Back " - << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick_[i]); + << cms::convert2mm(zi) << ", " + << cms::convert2mm(routF) << " Back " + << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick_[i]); #endif dd4hep::Material matter = ns.material(materials_[ii]); @@ -251,8 +251,8 @@ struct HGCalHEFileAlgo { << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections"; for (unsigned int k = 0; k < pgonZ.size(); ++k) edm::LogVerbatim("HGCalGeom") - << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" << cms::convert2mm(pgonRout[k]); #endif } else { double rins = @@ -266,11 +266,11 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(rins) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ":" - << HGCalDD4HepHelper::convert2mm(routs) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) + << " of dimensions " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(rins) << ", " + << cms::convert2mm(routF) << ":" + << cms::convert2mm(routs) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0 and positioned in: " << glog.name() << " number " << copy; #endif positionMix(ctxt, e, glog, name, copy, thickness_[ii], matter, rins, rMixLayer_[i], routs, zz); @@ -281,7 +281,7 @@ struct HGCalHEFileAlgo { ++copyNumber_[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << glog.name() << " number " << copy << " positioned in " - << mother.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << mother.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += hthick; @@ -290,12 +290,12 @@ struct HGCalHEFileAlgo { laymin = laymax; if (std::abs(thickTot - layerThick_[i]) > tol2_) { if (thickTot > layerThick_[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick_[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } @@ -344,9 +344,9 @@ struct HGCalHEFileAlgo { ns.addVolumeNS(glog1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(rout) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rmid) << ", " + << cms::convert2mm(rout) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0"; #endif glog.placeVolume(glog1, 1); @@ -363,8 +363,8 @@ struct HGCalHEFileAlgo { name = namesTop_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: Layer " << ly << ":" << ii << " R " - << HGCalDD4HepHelper::convert2mm(rmid) << ":" << HGCalDD4HepHelper::convert2mm(rout) - << " Thick " << HGCalDD4HepHelper::convert2mm(layerThickTop_[ii]); + << cms::convert2mm(rmid) << ":" << cms::convert2mm(rout) + << " Thick " << cms::convert2mm(layerThickTop_[ii]); #endif dd4hep::Material matter1 = ns.material(materialsTop_[ii]); @@ -376,13 +376,13 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG double eta1 = -log(tan(0.5 * atan(rmid / zz))); double eta2 = -log(tan(0.5 * atan(rout / zz))); - edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << HGCalDD4HepHelper::convert2mm(zz) << ":" - << HGCalDD4HepHelper::convert2mm(rmid) << ":" << HGCalDD4HepHelper::convert2mm(rout) + edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << cms::convert2mm(zz) << ":" + << cms::convert2mm(rmid) << ":" << cms::convert2mm(rout) << " eta " << eta1 << ":" << eta2; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << solid.name() << " Tubs made of " << matter1.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(rout) << ", " - << HGCalDD4HepHelper::convert2mm(hthickl) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rmid) << ", " + << cms::convert2mm(rout) << ", " + << cms::convert2mm(hthickl) << ", 0.0, 360.0"; #endif zpos += hthickl; @@ -391,7 +391,7 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: Position " << glog2.name() << " number " << copy << " in " - << glog1.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) + << glog1.name() << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif ++copyNumberTop_[ii]; @@ -399,12 +399,12 @@ struct HGCalHEFileAlgo { } if (std::abs(thickTot - thick) > tol2_) { if (thickTot > thick) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components in the top part **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " does not match with " << cms::convert2mm(thickTot) << " of the components in top part"; } } @@ -419,9 +419,9 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rin) << ", " - << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(hthick) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rin) << ", " + << cms::convert2mm(rmid) << ", " + << cms::convert2mm(hthick) << ", 0.0, 360.0"; #endif glog.placeVolume(glog1, 1); @@ -439,8 +439,8 @@ struct HGCalHEFileAlgo { name = namesBot_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: Layer " << ly << ":" << ii << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rmid) - << " Thick " << HGCalDD4HepHelper::convert2mm(layerThickBot_[ii]); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rmid) + << " Thick " << cms::convert2mm(layerThickBot_[ii]); #endif dd4hep::Material matter1 = ns.material(materialsBot_[ii]); @@ -452,13 +452,13 @@ struct HGCalHEFileAlgo { #ifdef EDM_ML_DEBUG double eta1 = -log(tan(0.5 * atan(rin / zz))); double eta2 = -log(tan(0.5 * atan(rmid / zz))); - edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << HGCalDD4HepHelper::convert2mm(zz) << ":" - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rmid) + edm::LogVerbatim("HGCalGeom") << name << " z|rin|rout " << cms::convert2mm(zz) << ":" + << cms::convert2mm(rin) << ":" << cms::convert2mm(rmid) << " eta " << eta1 << ":" << eta2; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << solid.name() << " Tubs made of " << matter1.name() - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rin) << ", " - << HGCalDD4HepHelper::convert2mm(rmid) << ", " - << HGCalDD4HepHelper::convert2mm(hthickl) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rin) << ", " + << cms::convert2mm(rmid) << ", " + << cms::convert2mm(hthickl) << ", 0.0, 360.0"; #endif zpos += hthickl; @@ -466,12 +466,12 @@ struct HGCalHEFileAlgo { glog1.placeVolume(glog2, copy, r1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: Position " << glog2.name() << " number " << copy << " in " - << glog1.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zpos) + << glog1.name() << " at (0,0," << cms::convert2mm(zpos) << ") with no rotation"; #endif if (layerSenseBot_[ly] != 0) { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: z " << HGCalDD4HepHelper::convert2mm((zz + zpos)) + edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: z " << cms::convert2mm((zz + zpos)) << " Center " << copy << ":" << (copy - firstLayer_) << ":" << layerCenter_[copy - firstLayer_]; #endif @@ -482,12 +482,12 @@ struct HGCalHEFileAlgo { } if (std::abs(thickTot - thick) > tol2_) { if (thickTot > thick) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components in the top part **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " does not match with " << cms::convert2mm(thickTot) << " of the components in top part"; } } @@ -513,10 +513,10 @@ struct HGCalHEFileAlgo { int ium(0), ivm(0), iumAll(0), ivmAll(0), kount(0), ntot(0), nin(0); std::vector ntype(6, 0); edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << glog.name() << " rout " - << HGCalDD4HepHelper::convert2mm(rout) << " N " << N - << " for maximum u, v Offset; Shift " << HGCalDD4HepHelper::convert2mm(xyoff.first) - << ":" << HGCalDD4HepHelper::convert2mm(xyoff.second) << " WaferSize " - << HGCalDD4HepHelper::convert2mm((waferSize_ + waferSepar_)); + << cms::convert2mm(rout) << " N " << N + << " for maximum u, v Offset; Shift " << cms::convert2mm(xyoff.first) + << ":" << cms::convert2mm(xyoff.second) << " WaferSize " + << cms::convert2mm((waferSize_ + waferSepar_)); #endif for (int u = -N; u <= N; ++u) { for (int v = -N; v <= N; ++v) { @@ -566,7 +566,7 @@ struct HGCalHEFileAlgo { ++ntype[type]; edm::LogVerbatim("HGCalGeom") << "DDHGCalHEFileAlgo: " << glog.name() << " number " << copy << " positioned in " << glog.name() - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << ", " << HGCalDD4HepHelper::convert2mm(ypos) + << " at (" << cms::convert2mm(xpos) << ", " << cms::convert2mm(ypos) << ", 0) with no rotation"; #endif } @@ -578,7 +578,7 @@ struct HGCalHEFileAlgo { << ":" << ivmAll << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << ntype[0] << ":" << ntype[1] << ":" << ntype[2] << ":" << ntype[3] << ":" << ntype[4] << ":" << ntype[5] << ") for " << glog.name() << " R " - << HGCalDD4HepHelper::convert2mm(rin) << ":" << HGCalDD4HepHelper::convert2mm(rout); + << cms::convert2mm(rin) << ":" << cms::convert2mm(rout); #endif } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc index 6ee5d1c6b6304..327a8b15edcfb 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModule.cc @@ -8,12 +8,12 @@ #include "DataFormats/Math/interface/angle_units.h" #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG #ifdef EDM_ML_DEBUG @@ -44,7 +44,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << materials.size() << " types of volumes"; for (unsigned int i = 0; i < names.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick[i]) << " filled with " << materials[i] + << cms::convert2mm(thick[i]) << " filled with " << materials[i] << " first copy number " << copyNumber[i]; #endif const auto& layers = args.value >("Layers"); // Number of layers in a section @@ -54,7 +54,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << layers.size() << " blocks"; for (unsigned int i = 0; i < layers.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << HGCalDD4HepHelper::convert2mm(layerThick[i]) + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick[i]) << " with " << layers[i] << " layers"; edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << layerType.size() << " layers"; for (unsigned int i = 0; i < layerType.size(); ++i) @@ -66,9 +66,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext double waferW = args.value("waferW"); // Width of the wafer int sectors = args.value("Sectors"); // Sectors #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock) - << " rFineCoarse " << HGCalDD4HepHelper::convert2mm(rMaxFine) << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferW) << " sectors " << sectors; + edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: zStart " << cms::convert2mm(zMinBlock) + << " rFineCoarse " << cms::convert2mm(rMaxFine) << " wafer width " + << cms::convert2mm(waferW) << " sectors " << sectors; #endif const auto& slopeB = args.value >("SlopeBottom"); // Slope at the lower R const auto& slopeT = args.value >("SlopeTop"); // Slopes at the larger R @@ -78,8 +78,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: Bottom slopes " << slopeB[0] << ":" << slopeB[1] << " and " << slopeT.size() << " slopes for top"; for (unsigned int i = 0; i < slopeT.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFront[i]) << " Rmax " - << HGCalDD4HepHelper::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFront[i]) << " Rmax " + << cms::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; #endif std::string idNameSpace = static_cast(ns.name()); // Namespace of this and ALL sub-parts const auto& idName = args.parentName(); // Name of the "parent" volume. @@ -109,10 +109,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext std::string name = "HGCal" + names[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " << HGCalDD4HepHelper::convert2mm(routF) - << " Back " << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]); + << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) + << " Back " << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick[i]); #endif dd4hep::Material matter = ns.material(materials[ii]); dd4hep::Volume glog; @@ -134,9 +134,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext << " sectors covering " << convertRadToDeg(-alpha) << ":" << (360.0 + convertRadToDeg(-alpha)) << " with " << pgonZ.size() << " sections"; for (unsigned int k = 0; k < pgonZ.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" - << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" + << cms::convert2mm(pgonRout[k]); #endif } else { dd4hep::Solid solid = dd4hep::Tube(0.5 * thick[ii], rinB, routF, 0.0, 2._pi); @@ -144,9 +144,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << solid.name() << " Tubs made of " << materials[ii] - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rinB) << ", " + << cms::convert2mm(routF) << ", " + << cms::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; edm::LogVerbatim("HGCalGeom") << "DDHGCalModule test position in: " << glog.name() << " number " << copy; #endif double dx = 0.5 * waferW; @@ -156,7 +156,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext int nrow = static_cast(routF / (waferW * tan(30._deg))) + 1; #ifdef EDM_ML_DEBUG int incm(0), inrm(0), kount(0), ntot(0), nin(0), nfine(0), ncoarse(0); - edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << HGCalDD4HepHelper::convert2mm(routF) << " Row " + edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << cms::convert2mm(routF) << " Row " << nrow << " Column " << ncol; #endif for (int nr = -nrow; nr <= nrow; ++nr) { @@ -194,7 +194,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++ncoarse; edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << glog1.name() << " number " << copyL << " positioned in " << glog.name() - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," << HGCalDD4HepHelper::convert2mm(ypos) + << " at (" << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with " << rotation; #endif } @@ -205,8 +205,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: # of columns " << incm << " # of rows " << inrm << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << nfine << ":" << ncoarse - << ") for " << glog.name() << " R " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(routF); + << ") for " << glog.name() << " R " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(routF); #endif } dd4hep::Position r1(0, 0, zz); @@ -215,7 +215,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++copyNumber[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << glog.name() << " number " << copy << " positioned in " - << module.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += (0.5 * thick[ii]); @@ -224,12 +224,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext laymin = laymax; if (fabs(thickTot - layerThick[i]) > tol2) { if (thickTot > layerThick[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " is smaller than thickness " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " is smaller than thickness " << cms::convert2mm(thickTot) << " of all its components **** ERROR ****\n"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components\n"; } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc index c2b5310dc74b7..dcec3bb425171 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalModuleAlgo.cc @@ -8,12 +8,12 @@ #include "DataFormats/Math/interface/angle_units.h" #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG #ifdef EDM_ML_DEBUG @@ -44,7 +44,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << materials.size() << " types of volumes"; for (unsigned int i = 0; i < names.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick[i]) << " filled with " << materials[i] + << cms::convert2mm(thick[i]) << " filled with " << materials[i] << " first copy number " << copyNumber[i]; #endif const auto& layers = args.value >("Layers"); // Number of layers in a section @@ -54,7 +54,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << layers.size() << " blocks"; for (unsigned int i = 0; i < layers.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << HGCalDD4HepHelper::convert2mm(layerThick[i]) + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick[i]) << " with " << layers[i] << " layers"; edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << layerType.size() << " layers"; for (unsigned int i = 0; i < layerType.size(); ++i) @@ -67,10 +67,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext double waferGap = args.value("waferGap"); // Gap between 2 wafers int sectors = args.value("Sectors"); // Sectors #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock) - << " rFineCoarse " << HGCalDD4HepHelper::convert2mm(rMaxFine) << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferW) << " gap among wafers " - << HGCalDD4HepHelper::convert2mm(waferGap) << " sectors " << sectors; + edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: zStart " << cms::convert2mm(zMinBlock) + << " rFineCoarse " << cms::convert2mm(rMaxFine) << " wafer width " + << cms::convert2mm(waferW) << " gap among wafers " + << cms::convert2mm(waferGap) << " sectors " << sectors; #endif const auto& slopeB = args.value >("SlopeBottom"); // Slope at the lower R const auto& slopeT = args.value >("SlopeTop"); // Slopes at the larger R @@ -80,8 +80,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: Bottom slopes " << slopeB[0] << ":" << slopeB[1] << " and " << slopeT.size() << " slopes for top"; for (unsigned int i = 0; i < slopeT.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFront[i]) << " Rmax " - << HGCalDD4HepHelper::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFront[i]) << " Rmax " + << cms::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; #endif std::string idNameSpace = static_cast(ns.name()); // Namespace of this and ALL sub-parts const auto& idName = args.parentName(); // Name of the "parent" volume. @@ -111,10 +111,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext std::string name = "HGCal" + names[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " << HGCalDD4HepHelper::convert2mm(routF) - << " Back " << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]); + << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) + << " Back " << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick[i]); #endif dd4hep::Material matter = ns.material(materials[ii]); dd4hep::Volume glog; @@ -136,9 +136,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext << " sectors covering " << convertRadToDeg(-alpha) << ":" << (360.0 + convertRadToDeg(-alpha)) << " with " << pgonZ.size() << " sections"; for (unsigned int k = 0; k < pgonZ.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << HGCalDD4HepHelper::convert2mm(pgonZ[k]) << " R " - << HGCalDD4HepHelper::convert2mm(pgonRin[k]) << ":" - << HGCalDD4HepHelper::convert2mm(pgonRout[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " + << cms::convert2mm(pgonRin[k]) << ":" + << cms::convert2mm(pgonRout[k]); #endif } else { dd4hep::Solid solid = dd4hep::Tube(0.5 * thick[ii], rinB, routF, 0.0, 2._pi); @@ -146,9 +146,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << solid.name() << " Tubs made of " << materials[ii] - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rinB) << ", " + << cms::convert2mm(routF) << ", " + << cms::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo test position in: " << glog.name() << " number " << copy; #endif double ww = (waferW + waferGap); @@ -159,7 +159,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext int nrow = static_cast(routF / (ww * tan(30._deg))) + 1; #ifdef EDM_ML_DEBUG int incm(0), inrm(0), kount(0), ntot(0), nin(0), nfine(0), ncoarse(0); - edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << HGCalDD4HepHelper::convert2mm(routF) << " Row " + edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << cms::convert2mm(routF) << " Row " << nrow << " Column " << ncol; #endif for (int nr = -nrow; nr <= nrow; ++nr) { @@ -197,8 +197,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++ncoarse; edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << glog1.name() << " number " << copyL << " positioned in " - << glog.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << ",0) with " << rotation; + << glog.name() << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << ",0) with " << rotation; #endif } } @@ -208,8 +208,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: # of columns " << incm << " # of rows " << inrm << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << nfine << ":" << ncoarse - << ") for " << glog.name() << " R " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(routF); + << ") for " << glog.name() << " R " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(routF); #endif } dd4hep::Position r1(0, 0, zz); @@ -218,7 +218,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ++copyNumber[ii]; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModuleAlgo: " << glog.name() << " number " << copy << " positioned in " - << module.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) << ") with " + << module.name() << " at (0,0," << cms::convert2mm(zz) << ") with " << rot; #endif zz += (0.5 * thick[ii]); @@ -227,12 +227,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext laymin = laymax; if (fabs(thickTot - layerThick[i]) > tol2) { if (thickTot > layerThick[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " is smaller than thickness " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " is smaller than thickness " << cms::convert2mm(thickTot) << " of all its components **** ERROR ****\n"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components\n"; } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc index 7a026d3538394..0045a61775273 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalNoTaperEndcap.cc @@ -1,9 +1,9 @@ #include "DataFormats/Math/interface/angle_units.h" #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -22,10 +22,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext auto const& m_incrCopyNo = args.value("incrCopyNo"); // Increment copy Number auto const& m_childName = args.value("ChildName"); // Children name #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "Tilt Angle " << m_tiltAngle << " R " << HGCalDD4HepHelper::convert2mm(m_rMin) << ":" - << HGCalDD4HepHelper::convert2mm(m_rMax) << " Offset " - << HGCalDD4HepHelper::convert2mm(m_zoffset) << ":" - << HGCalDD4HepHelper::convert2mm(m_xyoffset) << " Copy " << m_startCopyNo << ":" + edm::LogVerbatim("HGCalGeom") << "Tilt Angle " << m_tiltAngle << " R " << cms::convert2mm(m_rMin) << ":" + << cms::convert2mm(m_rMax) << " Offset " + << cms::convert2mm(m_zoffset) << ":" + << cms::convert2mm(m_xyoffset) << " Copy " << m_startCopyNo << ":" << m_incrCopyNo << " Child " << m_childName; edm::LogVerbatim("HGCalGeom") << "DDHGCalNoTaperEndcap: NameSpace " << ns.name() << "\tParent " << args.parentName(); @@ -75,12 +75,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext if (limit2 > m_rMin && limit1 < m_rMax) { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << m_childName << " copyNo = " << copyNo << " (" << column << "," << row - << "): offsetX,Y = " << HGCalDD4HepHelper::convert2mm(offsetX) << "," - << HGCalDD4HepHelper::convert2mm(offsetY) - << " limit=" << HGCalDD4HepHelper::convert2mm(limit1) << ":" - << HGCalDD4HepHelper::convert2mm(limit2) - << " rMin, rMax = " << HGCalDD4HepHelper::convert2mm(m_rMin) << "," - << HGCalDD4HepHelper::convert2mm(m_rMax); + << "): offsetX,Y = " << cms::convert2mm(offsetX) << "," + << cms::convert2mm(offsetY) + << " limit=" << cms::convert2mm(limit1) << ":" + << cms::convert2mm(limit2) + << " rMin, rMax = " << cms::convert2mm(m_rMin) << "," + << cms::convert2mm(m_rMax); #endif dd4hep::Rotation3D rotation = (cms::makeRotation3D(theta, phiX, theta + yphi, phiY, -yphi, phiZ) * @@ -89,22 +89,16 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext dd4hep::Position tran(offsetX, offsetY, offsetZ); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "Module " << copyNo << ": location = (" - << HGCalDD4HepHelper::convert2mm(offsetX) << "," - << HGCalDD4HepHelper::convert2mm(offsetY) << "," - << HGCalDD4HepHelper::convert2mm(offsetZ) << ") Rotation " << rotation; + << cms::convert2mm(offsetX) << "," + << cms::convert2mm(offsetY) << "," + << cms::convert2mm(offsetZ) << ") Rotation " << rotation; #endif parent.placeVolume(ns.volume(name), copyNo, dd4hep::Transform3D(rotation, tran)); copyNo += m_incrCopyNo; } else { #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << " (" << column << "," << row - << "): offsetX,Y = " << HGCalDD4HepHelper::convert2mm(offsetX) << "," - << HGCalDD4HepHelper::convert2mm(offsetY) - << " is out of limit=" << HGCalDD4HepHelper::convert2mm(limit1) << ":" - << HGCalDD4HepHelper::convert2mm(limit2) - << " rMin, rMax = " << HGCalDD4HepHelper::convert2mm(m_rMin) << "," - << HGCalDD4HepHelper::convert2mm(m_rMax); + edm::LogVerbatim("HGCalGeom") << " (" << column << "," << row << "): offsetX,Y = " << cms::convert2mm(offsetX) << "," << cms::convert2mm(offsetY) << " is out of limit=" << cms::convert2mm(limit1) << ":" << cms::convert2mm(limit2) << " rMin, rMax = " << cms::convert2mm(m_rMin) << "," << cms::convert2mm(m_rMax); #endif } yphi += yQuadrant * 2. * tiltAngle; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconModule.cc index d63621deb2e7c..31b791b10277b 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconModule.cc @@ -19,6 +19,7 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" //#define EDM_ML_DEBUG @@ -59,8 +60,8 @@ struct HGCalSiliconModule { alpha_ = (1._pi) / sectors_; cosAlpha_ = cos(alpha_); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "zStart " << (f2mm_ * zMinBlock_) << " wafer width " << (f2mm_ * waferSize_) - << " separations " << (f2mm_ * waferSepar_) << " sectors " << sectors_ << ":" + edm::LogVerbatim("HGCalGeom") << "zStart " << cms::convert2mm(zMinBlock_) << " wafer width " << cms::convert2mm(waferSize_) + << " separations " << cms::convert2mm(waferSepar_) << " sectors " << sectors_ << ":" << convertRadToDeg(alpha_) << ":" << cosAlpha_; #endif waferFull_ = args.value>("WaferNamesFull"); @@ -93,7 +94,7 @@ struct HGCalSiliconModule { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << materials_.size() << " types of volumes"; for (unsigned int i = 0; i < names_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << (f2mm_ * thick_[i]) + edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names_[i] << " of thickness " << cms::convert2mm(thick_[i]) << " filled with " << materials_[i] << " first copy number " << copyNumber_[i]; #endif layers_ = args.value>("Layers"); @@ -101,7 +102,7 @@ struct HGCalSiliconModule { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "There are " << layers_.size() << " blocks"; for (unsigned int i = 0; i < layers_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << (f2mm_ * layerThick_[i]) << " with " + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick_[i]) << " with " << layers_[i] << " layers"; #endif layerType_ = args.value>("LayerType"); @@ -139,11 +140,11 @@ struct HGCalSiliconModule { rMaxFront_ = args.value>("RMaxFront"); #ifdef EDM_ML_DEBUG for (unsigned int i = 0; i < slopeB_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << (f2mm_ * zFrontB_[i]) << " Rmin " - << (f2mm_ * rMinFront_[i]) << " Slope " << slopeB_[i]; + edm::LogVerbatim("HGCalGeom") << "Bottom Block [" << i << "] Zmin " << cms::convert2mm(zFrontB_[i]) << " Rmin " + << cms::convert2mm(rMinFront_[i]) << " Slope " << slopeB_[i]; for (unsigned int i = 0; i < slopeT_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << (f2mm_ * zFrontT_[i]) << " Rmax " - << (f2mm_ * rMaxFront_[i]) << " Slope " << slopeT_[i]; + edm::LogVerbatim("HGCalGeom") << "Top Block [" << i << "] Zmin " << cms::convert2mm(zFrontT_[i]) << " Rmax " + << cms::convert2mm(rMaxFront_[i]) << " Slope " << slopeT_[i]; #endif waferIndex_ = args.value>("WaferIndex"); waferProperty_ = args.value>("WaferProperties"); @@ -187,9 +188,9 @@ struct HGCalSiliconModule { std::string name = names_[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Layer " << ly << ":" << ii << " Front " << (f2mm_ * zi) - << ", " << (f2mm_ * routF) << " Back " << (f2mm_ * zo) << ", " << (f2mm_ * rinB) - << " superlayer thickness " << (f2mm_ * layerThick_[i]); + edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: Layer " << ly << ":" << ii << " Front " << cms::convert2mm(zi) + << ", " << cms::convert2mm(routF) << " Back " << cms::convert2mm(zo) << ", " << cms::convert2mm(rinB) + << " superlayer thickness " << cms::convert2mm(layerThick_[i]); #endif dd4hep::Material matter = ns.material(materials_[ii]); @@ -219,11 +220,11 @@ struct HGCalSiliconModule { pgonRin, pgonRout); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: z " << (f2mm_ * (zz - hthick)) << ":" - << (f2mm_ * (zz + hthick)) << " with " << pgonZ.size() << " palnes"; + edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: z " << cms::convert2mm((zz - hthick)) << ":" + << cms::convert2mm((zz + hthick)) << " with " << pgonZ.size() << " palnes"; for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) - edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << (f2mm_ * pgonZ[isec]) << " R " - << (f2mm_ * pgonRin[isec]) << ":" << (f2mm_ * pgonRout[isec]); + edm::LogVerbatim("HGCalGeom") << "[" << isec << "] z " << cms::convert2mm(pgonZ[isec]) << " R " + << cms::convert2mm(pgonRin[isec]) << ":" << cms::convert2mm(pgonRout[isec]); #endif for (unsigned int isec = 0; isec < pgonZ.size(); ++isec) { pgonZ[isec] -= zz; @@ -240,8 +241,8 @@ struct HGCalSiliconModule { << convertRadToDeg(-alpha_ + 2._pi) << " with " << pgonZ.size() << " sections and filled with " << matter.name(); for (unsigned int k = 0; k < pgonZ.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << (f2mm_ * pgonZ[k]) << " R " << (f2mm_ * pgonRin[k]) - << ":" << (f2mm_ * pgonRout[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] z " << cms::convert2mm(pgonZ[k]) << " R " << cms::convert2mm(pgonRin[k]) + << ":" << cms::convert2mm(pgonRout[k]); #endif } else { double rins = @@ -255,8 +256,8 @@ struct HGCalSiliconModule { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << solid.name() << " Tubs made of " << matter.name() - << " of dimensions " << (f2mm_ * rinB) << ":" << (f2mm_ * rins) << ", " - << (f2mm_ * routF) << ":" << (f2mm_ * routs) << ", " << (f2mm_ * hthick) + << " of dimensions " << cms::convert2mm(rinB) << ":" << cms::convert2mm(rins) << ", " + << cms::convert2mm(routF) << ":" << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick) << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" << layerCenter_[copy - firstLayer_]; #endif @@ -269,7 +270,7 @@ struct HGCalSiliconModule { copyNumber_[ii] = copy + inc; #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " number " << copy - << " positioned in " << mother.name() << " at (0,0," << (f2mm_ * zz) + << " positioned in " << mother.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif zz += hthick; @@ -279,11 +280,11 @@ struct HGCalSiliconModule { // Make consistency check of all the partitions of the block if (std::abs(thickTot - layerThick_[i]) >= tol2) { if (thickTot > layerThick_[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << (f2mm_ * layerThick_[i]) << " is smaller than " - << (f2mm_ * thickTot) << ": thickness of all its components **** ERROR ****"; + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) << " is smaller than " + << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << (f2mm_ * layerThick_[i]) - << " does not match with " << (f2mm_ * thickTot) << " of the components"; + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick_[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } } // End of loop over blocks @@ -314,9 +315,9 @@ struct HGCalSiliconModule { #ifdef EDM_ML_DEBUG int ium(0), ivm(0), kount(0); std::vector ntype(3, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " r " << (f2mm_ * r) << " R " - << (f2mm_ * R) << " dy " << (f2mm_ * dy) << " Shift " << (f2mm_ * xyoff.first) << ":" - << (f2mm_ * xyoff.second) << " WaferSize " << (f2mm_ * (waferSize_ + waferSepar_)) + edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconModule: " << glog.name() << " r " << cms::convert2mm(r) << " R " + << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) << " Shift " << cms::convert2mm(xyoff.first) << ":" + << cms::convert2mm(xyoff.second) << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index " << firstWafer << ":" << (lastWafer - 1); #endif for (int k = firstWafer; k < lastWafer; ++k) { @@ -366,8 +367,8 @@ struct HGCalSiliconModule { #ifdef EDM_ML_DEBUG ++ntype[type]; edm::LogVerbatim("HGCalGeom") << " DDHGCalSiliconModule: " << wafer << " number " << copy << " type " << layertype - << ":" << type << " positioned in " << glog.name() << " at (" << (f2mm_ * xpos) - << "," << (f2mm_ * ypos) << ",0) with no rotation"; + << ":" << type << " positioned in " << glog.name() << " at (" << cms::convert2mm(xpos) + << "," << cms::convert2mm(ypos) << ",0) with no rotation"; #endif } @@ -414,8 +415,6 @@ struct HGCalSiliconModule { std::vector waferLayerStart_; // Index of wafers in each layer std::unordered_set copies_; // List of copy #'s double alpha_, cosAlpha_; - - static constexpr double f2mm_ = (1.0 / dd4hep::mm); }; static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext& ctxt, xml_h e) { diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc index bcba4e2d8a055..88689da67f12e 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModule.cc @@ -1,12 +1,12 @@ #include "DataFormats/Math/interface/angle_units.h" #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalGeomTools.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG #ifdef EDM_ML_DEBUG @@ -44,7 +44,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: " << materials.size() << " types of volumes"; for (unsigned int i = 0; i < names.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(thick[i]) << " filled with " << materials[i] + << cms::convert2mm(thick[i]) << " filled with " << materials[i] << " first copy number " << copyNumber[i]; #endif const auto& layers = args.value >("Layers"); // Number of layers in a section @@ -52,7 +52,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: " << layers.size() << " blocks"; for (unsigned int i = 0; i < layers.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << HGCalDD4HepHelper::convert2mm(layerThick[i]) + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " << cms::convert2mm(layerThick[i]) << " with " << layers[i] << " layers"; #endif const auto& layerType = args.value >("LayerType"); // Type of the layer @@ -70,12 +70,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const auto& absorbW = args.value("absorberW"); // Width of the absorber const auto& absorbH = args.value("absorberH"); // Height of the absorber #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock) - << " rFineCoarse " << HGCalDD4HepHelper::convert2mm(rMaxFine) << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferW) << " gap among wafers " - << HGCalDD4HepHelper::convert2mm(waferGap) << " absorber width " - << HGCalDD4HepHelper::convert2mm(absorbW) << " absorber height " - << HGCalDD4HepHelper::convert2mm(absorbH); + edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: zStart " << cms::convert2mm(zMinBlock) + << " rFineCoarse " << cms::convert2mm(rMaxFine) << " wafer width " + << cms::convert2mm(waferW) << " gap among wafers " + << cms::convert2mm(waferGap) << " absorber width " + << cms::convert2mm(absorbW) << " absorber height " + << cms::convert2mm(absorbH); #endif const auto& slopeB = args.value >("SlopeBottom"); // Slope at the lower R const auto& slopeT = args.value >("SlopeTop"); // Slopes at the larger R @@ -85,8 +85,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: Bottom slopes " << slopeB[0] << ":" << slopeB[1] << " and " << slopeT.size() << " slopes for top"; for (unsigned int i = 0; i < slopeT.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << HGCalDD4HepHelper::convert2mm(zFront[i]) << " Rmax " - << HGCalDD4HepHelper::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; + edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] Zmin " << cms::convert2mm(zFront[i]) << " Rmax " + << cms::convert2mm(rMaxFront[i]) << " Slope " << slopeT[i]; #endif std::string idNameSpace = static_cast(ns.name()); // Namespace of this and ALL sub-parts const auto& idName = args.parentName(); // Name of the "parent" volume. @@ -123,10 +123,10 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext std::string name = "HGCal" + names[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: Layer " << ly << ":" << ii << " Front " - << HGCalDD4HepHelper::convert2mm(zi) << ", " << HGCalDD4HepHelper::convert2mm(routF) - << " Back " << HGCalDD4HepHelper::convert2mm(zo) << ", " - << HGCalDD4HepHelper::convert2mm(rinB) << " superlayer thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]); + << cms::convert2mm(zi) << ", " << cms::convert2mm(routF) + << " Back " << cms::convert2mm(zo) << ", " + << cms::convert2mm(rinB) << " superlayer thickness " + << cms::convert2mm(layerThick[i]); #endif dd4hep::Material matter = ns.material(materials[ii]); @@ -137,9 +137,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule test: " << solid.name() << " box of dimension " - << HGCalDD4HepHelper::convert2mm(absorbW) << ":" - << HGCalDD4HepHelper::convert2mm(absorbH) << ":" - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]); + << cms::convert2mm(absorbW) << ":" + << cms::convert2mm(absorbH) << ":" + << cms::convert2mm(0.5 * thick[ii]); #endif } else { dd4hep::Solid solid = dd4hep::Tube(rinB, routF, 0.5 * thick[ii], 0.0, 2._pi); @@ -147,15 +147,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule: " << solid.name() << " Tubs made of " << materials[ii] - << " of dimensions " << HGCalDD4HepHelper::convert2mm(rinB) << ", " - << HGCalDD4HepHelper::convert2mm(routF) << ", " - << HGCalDD4HepHelper::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; + << " of dimensions " << cms::convert2mm(rinB) << ", " + << cms::convert2mm(routF) << ", " + << cms::convert2mm(0.5 * thick[ii]) << ", 0.0, 360.0"; #endif int ncol = static_cast(2.0 * routF / ww) + 1; int nrow = static_cast(routF / (ww * tan(30._deg))) + 1; #ifdef EDM_ML_DEBUG int incm(0), inrm(0), kount(0), ntot(0), nin(0), nfine(0), ncoarse(0); - edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << HGCalDD4HepHelper::convert2mm(routF) << " Row " + edm::LogVerbatim("HGCalGeom") << glog.name() << " rout " << cms::convert2mm(routF) << " Row " << nrow << " Column " << ncol; #endif double xc[6], yc[6]; @@ -216,7 +216,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: " << glog1.name() << " number " << copyL << " positioned in " << glog.name() - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," << HGCalDD4HepHelper::convert2mm(ypos) + << " at (" << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0)"; #endif } @@ -226,8 +226,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalModule: # of columns " << incm << " # of rows " << inrm << " and " << nin << ":" << kount << ":" << ntot << " wafers (" << nfine << ":" << ncoarse - << ") for " << glog.name() << " R " << HGCalDD4HepHelper::convert2mm(rinB) << ":" - << HGCalDD4HepHelper::convert2mm(routF); + << ") for " << glog.name() << " R " << cms::convert2mm(rinB) << ":" + << cms::convert2mm(routF); #endif } dd4hep::Position r1(0, 0, zz); @@ -236,7 +236,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModule test: " << glog.name() << " number " << copy << " positioned in " << module.name() << " at (0,0," - << HGCalDD4HepHelper::convert2mm(zz) << ")"; + << cms::convert2mm(zz) << ")"; #endif zz += (0.5 * thick[ii]); } // End of loop over layers in a block @@ -244,12 +244,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext laymin = laymax; if (fabs(thickTot - layerThick[i]) > tol2) { if (thickTot > layerThick[i]) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " is smaller than thickness " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " is smaller than thickness " << cms::convert2mm(thickTot) << " of all its components **** ERROR ****\n"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(layerThick[i]) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(layerThick[i]) + << " does not match with " << cms::convert2mm(thickTot) << " of the components\n"; } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc index 4b4234f31d98b..6b84a1492dbb1 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalTBModuleX.cc @@ -11,10 +11,10 @@ #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/Core/interface/DDSplit.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -55,8 +55,8 @@ namespace DDHGCalGeom { std::string name = "HGCal" + names[ii] + std::to_string(copy); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << name << " Layer " << ly << ":" << ii << " Z " - << HGCalDD4HepHelper::convert2mm(zi) << ":" << HGCalDD4HepHelper::convert2mm(zo) - << " Thick " << HGCalDD4HepHelper::convert2mm(layerThick[ii]) << " Sense " + << cms::convert2mm(zi) << ":" << cms::convert2mm(zo) + << " Thick " << cms::convert2mm(layerThick[ii]) << " Sense " << layerSense[ly]; #endif dd4hep::Material matter = ns.material(materials[ii]); @@ -67,15 +67,15 @@ namespace DDHGCalGeom { glog = dd4hep::Volume(solid.name(), solid, matter); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << solid.name() << " box of dimension " - << HGCalDD4HepHelper::convert2mm(absorbW) << ":" - << HGCalDD4HepHelper::convert2mm(absorbH) << ":" - << HGCalDD4HepHelper::convert2mm(0.5 * layerThick[ii]); + << cms::convert2mm(absorbW) << ":" + << cms::convert2mm(absorbH) << ":" + << cms::convert2mm(0.5 * layerThick[ii]); #endif dd4hep::Position r1(0, 0, zz); module.placeVolume(glog, copy, r1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << glog.name() << " number " << copy << " positioned in " - << module.name() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; #endif } else if (layerSense[ly] > 0) { @@ -87,8 +87,8 @@ namespace DDHGCalGeom { #ifdef EDM_ML_DEBUG int incm(0), inrm(0); edm::LogVerbatim("HGCalGeom") << module.name() << " Copy " << copy << " Type " << layerSense[ly] << " rout " - << HGCalDD4HepHelper::convert2mm(rMax) << " Row " << nrow << " column " << ncol - << " ncrMax " << maxModule[ly] << " Z " << HGCalDD4HepHelper::convert2mm(zz) + << cms::convert2mm(rMax) << " Row " << nrow << " column " << ncol + << " ncrMax " << maxModule[ly] << " Z " << cms::convert2mm(zz) << " Center " << ignoreCenter << " name " << name << " matter " << matter.name(); int kount(0); #endif @@ -135,8 +135,8 @@ namespace DDHGCalGeom { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << glog1.name() << " number " << copy << " positioned in " - << module.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << "," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << "," << cms::convert2mm(zz) << ") with no rotation"; #endif dd4hep::Volume glog2 = (rpos < rMaxFine) ? ns.volume(wafers[0]) : ns.volume(wafers[1]); @@ -154,8 +154,8 @@ namespace DDHGCalGeom { #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << glog2.name() << " number " << copyx << " positioned in " - << module.name() << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << "," << HGCalDD4HepHelper::convert2mm(zz) + << module.name() << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << "," << cms::convert2mm(zz) << ") with no rotation"; #endif } @@ -181,13 +181,13 @@ namespace DDHGCalGeom { if (fabs(thickTot - totalWidth) > tolerance) { if (thickTot > totalWidth) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(totalWidth) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(totalWidth) + << " is smaller than " << cms::convert2mm(thickTot) << ": total thickness of all its components in " << module.name() << " Layers " << firstLayer << ":" << lastLayer << ":" << ignoreCenter << "**** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(totalWidth) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(totalWidth) + << " does not match with " << cms::convert2mm(thickTot) << " of the components in " << module.name() << " Layers " << firstLayer << ":" << lastLayer << ":" << ignoreCenter; } @@ -225,7 +225,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << materials.size() << " types of volumes"; for (unsigned int i = 0; i < names.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << names[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]) << " filled with " << materials[i] + << cms::convert2mm(layerThick[i]) << " filled with " << materials[i] << " first copy number " << copyNumber[i]; #endif const auto& blockThick = args.value >("BlockThick"); // Thickness of each section @@ -243,12 +243,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext for (unsigned int i = 0; i < blockThick.size(); ++i) { if (inOut > 1) edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(blockThick[i]) << " with inner layers " + << cms::convert2mm(blockThick[i]) << " with inner layers " << layerFrontIn[i] << ":" << layerBackIn[i] << " and outer layers " << layerFrontOut[i] << ":" << layerBackOut[i]; else edm::LogVerbatim("HGCalGeom") << "Block [" << i << "] of thickness " - << HGCalDD4HepHelper::convert2mm(blockThick[i]) << " with inner layers " + << cms::convert2mm(blockThick[i]) << " with inner layers " << layerFrontIn[i] << ":" << layerBackIn[i]; } #endif @@ -272,13 +272,13 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext double waferTot = waferW + waferGap; std::string idName = DDSplit(args.parentName()).first; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: zStart " << HGCalDD4HepHelper::convert2mm(zMinBlock) - << " rFineCoarse " << HGCalDD4HepHelper::convert2mm(rMaxFine) << " wafer width " - << HGCalDD4HepHelper::convert2mm(waferW) << " gap among wafers " - << HGCalDD4HepHelper::convert2mm(waferGap) << " absorber width " - << HGCalDD4HepHelper::convert2mm(absorbW) << " absorber height " - << HGCalDD4HepHelper::convert2mm(absorbH) << " rMax " - << HGCalDD4HepHelper::convert2mm(rMax) << ":" << HGCalDD4HepHelper::convert2mm(rMaxB); + edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: zStart " << cms::convert2mm(zMinBlock) + << " rFineCoarse " << cms::convert2mm(rMaxFine) << " wafer width " + << cms::convert2mm(waferW) << " gap among wafers " + << cms::convert2mm(waferGap) << " absorber width " + << cms::convert2mm(absorbW) << " absorber height " + << cms::convert2mm(absorbH) << " rMax " + << cms::convert2mm(rMax) << ":" << cms::convert2mm(rMaxB); edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: NameSpace " << ns.name() << " Parent Name " << idName; #endif std::unordered_set copies; // List of copy #'s @@ -291,9 +291,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext std::string name = idName + "Block" + std::to_string(i); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: Block " << i << ":" << name << " z " - << HGCalDD4HepHelper::convert2mm(zi) << ":" << HGCalDD4HepHelper::convert2mm(zo) - << " R " << HGCalDD4HepHelper::convert2mm(rMaxB) << " T " - << HGCalDD4HepHelper::convert2mm(blockThick[i]); + << cms::convert2mm(zi) << ":" << cms::convert2mm(zo) + << " R " << cms::convert2mm(rMaxB) << " T " + << cms::convert2mm(blockThick[i]); #endif dd4hep::Material matter = ns.material(genMat); dd4hep::Solid solid = dd4hep::Tube(0, rMaxB, 0.5 * blockThick[i], 0.0, 2._pi); @@ -304,11 +304,11 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext parent.placeVolume(glog, i, r1); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: " << glog.name() << " number " << i << " positioned in " - << args.parentName() << " at (0,0," << HGCalDD4HepHelper::convert2mm(zz) + << args.parentName() << " at (0,0," << cms::convert2mm(zz) << ") with no rotation"; edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: \t\tInside Block " << i << " Layers " << layerFrontIn[i] << ":" - << layerBackIn[i] << " zFront " << -HGCalDD4HepHelper::convert2mm(0.5 * blockThick[i]) - << " thickness " << HGCalDD4HepHelper::convert2mm(blockThick[i]) + << layerBackIn[i] << " zFront " << -cms::convert2mm(0.5 * blockThick[i]) + << " thickness " << cms::convert2mm(blockThick[i]) << " ignore Center 0"; #endif DDHGCalGeom::constructLayers(ns, @@ -337,8 +337,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: \t\tInside Block " << i << " Layers " << layerFrontOut[i] << ":" << layerBackOut[i] << " zFront " - << -HGCalDD4HepHelper::convert2mm(0.5 * blockThick[i]) << " thickness " - << HGCalDD4HepHelper::convert2mm(blockThick[i]) << " ignore Center 1"; + << -cms::convert2mm(0.5 * blockThick[i]) << " thickness " + << cms::convert2mm(blockThick[i]) << " ignore Center 1"; #endif DDHGCalGeom::constructLayers(ns, wafers, @@ -367,7 +367,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalTBModuleX: All blocks are placed in " - << HGCalDD4HepHelper::convert2mm(zMinBlock) << ":" << HGCalDD4HepHelper::convert2mm(zi) + << cms::convert2mm(zMinBlock) << ":" << cms::convert2mm(zi) << " with " << copies.size() << " different wafer copy numbers"; #endif diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc index 5a742a52a1e68..8c16a89e0da28 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer.cc @@ -1,9 +1,9 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -27,7 +27,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << childNames.size() << " children: " << childNames[0] << "; " << childNames[1] << " positioned in " << nCellsRow.size() << " rows and " << nColumns << " columns with lowest column at " << nBottomY << " in mother " << parentName - << " of size " << HGCalDD4HepHelper::convert2mm(waferSize); + << " of size " << cms::convert2mm(waferSize); for (unsigned int k = 0; k < nCellsRow.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] Ncells " << nCellsRow[k] << " Edge rotations " << angleEdges[2 * k] << ":" << angleEdges[2 * k + 1] << " Type of edge cells " << detectorType[2 * k] @@ -72,9 +72,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext mother.placeVolume(ns.volume(namx), copy, dd4hep::Transform3D(rotation, tran)); ++kount; #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: " << name << " number " << copy << " positioned in " << parentName - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << ",0) with " << rotation; + edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer: " << name << " number " << copy << " positioned in " << parentName << " at (" << cms::convert2mm(xpos) << "," << cms::convert2mm(ypos) << ",0) with " << rotation; #endif } ny += incAlongY; diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc index 9c48d39f4d32e..068bf38d9d29d 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWafer8.cc @@ -7,10 +7,10 @@ #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG @@ -27,9 +27,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const auto& cellNames = args.value>("CellNames"); #ifdef EDM_ML_DEBUG - edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Wafer 2r " << HGCalDD4HepHelper::convert2mm(waferSize) << " T " - << HGCalDD4HepHelper::convert2mm(waferT) << " Half Separation " - << HGCalDD4HepHelper::convert2mm(waferSepar) << " Cells/Wafer " << nCells + edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: Wafer 2r " << cms::convert2mm(waferSize) << " T " + << cms::convert2mm(waferT) << " Half Separation " + << cms::convert2mm(waferSepar) << " Cells/Wafer " << nCells << " Cell Type " << cellType << " Material " << material << " Names " << motherName << " NameSpace " << ns.name() << " # of cells " << cellNames.size(); for (unsigned int k = 0; k < cellNames.size(); ++k) @@ -56,14 +56,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xM.size() << " edges"; for (unsigned int k = 0; k < xM.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xM[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yM[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xM[k]) << ":" + << cms::convert2mm(yM[k]); #endif dd4hep::Rotation3D rotation; @@ -109,8 +109,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glog.placeVolume(ns.volume(cellNames[cell]), copy, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWafer8: " << cellNames[cell] << " number " << copy << " position in " - << glog.name() << " at (" << HGCalDD4HepHelper::convert2mm(xp) << ", " - << HGCalDD4HepHelper::convert2mm(yp) << ",0) with no rotation"; + << glog.name() << " at (" << cms::convert2mm(xp) << ", " + << cms::convert2mm(yp) << ",0) with no rotation"; #endif } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc index d4768f7218d94..582a7cf684fa5 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferAlgo.cc @@ -1,9 +1,9 @@ #include "DD4hep/DetFactoryHelper.h" #include "DataFormats/Math/interface/angle_units.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" //#define EDM_ML_DEBUG using namespace angle_units::operators; @@ -24,8 +24,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << childNames.size() << " children: " << childNames[0] << "; " << childNames[1] << " positioned " << positionX.size() << " times with cell size " << cellSize; for (unsigned int k = 0; k < positionX.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] x " << HGCalDD4HepHelper::convert2mm(positionX[k]) << " y " - << HGCalDD4HepHelper::convert2mm(positionY[k]) << " angle " << angles[k] + edm::LogVerbatim("HGCalGeom") << "[" << k << "] x " << cms::convert2mm(positionX[k]) << " y " + << cms::convert2mm(positionY[k]) << " angle " << angles[k] << " detector " << detectorType[k]; std::string idName = args.parentName(); // Name of the "parent" volume. @@ -55,8 +55,8 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext mother.placeVolume(ns.volume(name), copy, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferAlgo: " << name << " number " << copy << " positioned in " << idName - << " at (" << HGCalDD4HepHelper::convert2mm(xpos) << "," - << HGCalDD4HepHelper::convert2mm(ypos) << ",0) with " << rotation; + << " at (" << cms::convert2mm(xpos) << "," + << cms::convert2mm(ypos) << ",0) with " << rotation; #endif } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferF.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferF.cc index 96140b609481c..8a479ec203c88 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferF.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferF.cc @@ -6,10 +6,10 @@ #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" #include #include @@ -27,9 +27,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const auto& waferSepar = args.value("SensorSeparation"); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferF: Module " << motherName << " made of " << material << " T " - << HGCalDD4HepHelper::convert2mm(thick) << " Wafer 2r " - << HGCalDD4HepHelper::convert2mm(waferSize) << " Half Separation " - << HGCalDD4HepHelper::convert2mm(waferSepar); + << cms::convert2mm(thick) << " Wafer 2r " + << cms::convert2mm(waferSize) << " Half Separation " + << cms::convert2mm(waferSepar); #endif const auto& layerNames = args.value>("LayerNames"); const auto& materials = args.value>("LayerMaterials"); @@ -40,7 +40,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferF: " << layerNames.size() << " types of volumes"; for (unsigned int i = 0; i < layerNames.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]) << " filled with " << materials[i] + << cms::convert2mm(layerThick[i]) << " filled with " << materials[i] << " type " << layerType[i]; #endif const auto& layers = args.value>("Layers"); @@ -83,14 +83,14 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glogM); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferF: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xM.size() << " edges"; for (unsigned int k = 0; k < xM.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xM[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yM[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xM[k]) << ":" + << cms::convert2mm(yM[k]); #endif // Then the layers @@ -111,16 +111,16 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glogs[i]); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferF: " << solid.name() << " extruded polygon made of " << materials[i] - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " - << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zy[1]) << ":" << scale[1] << " and " << xM.size() + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" + << cms::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " + << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" + << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xM.size() << " edges"; for (unsigned int k = 0; k < xL.size(); ++k) - edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << HGCalDD4HepHelper::convert2mm(xL[k]) << ":" - << HGCalDD4HepHelper::convert2mm(yL[k]); + edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << cms::convert2mm(xL[k]) << ":" + << cms::convert2mm(yL[k]); #endif } dd4hep::Position tran0(0, 0, (zi + 0.5 * layerThick[i])); @@ -128,7 +128,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferF: " << glogs[i].name() << " number " << copyNumber[i] << " positioned in " << glogM.name() << " at (0,0," - << HGCalDD4HepHelper::convert2mm(zi + 0.5 * layerThick[i]) << ") with no rotation"; + << cms::convert2mm(zi + 0.5 * layerThick[i]) << ") with no rotation"; #endif ++copyNumber[i]; zi += layerThick[i]; @@ -174,9 +174,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glogs[i].placeVolume(ns.volume(cellNames[cell]), copy, dd4hep::Transform3D(rotation, tran)); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") - << "DDHGCalWaferF: " << cellNames[cell] << " number " << copy << " positioned in " << glogs[i].name() - << " at (" << HGCalDD4HepHelper::convert2mm(xp) << "," << HGCalDD4HepHelper::convert2mm(yp) - << ",0) with no rotation"; + << "DDHGCalWaferF: " << cellNames[cell] << " number " << copy << " positioned in " << glogs[i].name() << " at (" << cms::convert2mm(xp) << "," << cms::convert2mm(yp) << ",0) with no rotation"; #endif } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferP.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferP.cc index 64af35f128d38..41b24b7b8e317 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferP.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalWaferP.cc @@ -6,11 +6,11 @@ #include "DD4hep/DetFactoryHelper.h" #include "DetectorDescription/DDCMS/interface/DDPlugins.h" +#include "DetectorDescription/DDCMS/interface/DDutils.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/Utilities/interface/Exception.h" #include "Geometry/HGCalCommonData/interface/HGCalTypes.h" #include "Geometry/HGCalCommonData/interface/HGCalWaferMask.h" -#include "Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h" #include #include @@ -28,9 +28,9 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext const auto& waferSepar = args.value("SensorSeparation"); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: Module " << parentName << " made of " << material << " T " - << HGCalDD4HepHelper::convert2mm(thick) << " Wafer 2r " - << HGCalDD4HepHelper::convert2mm(waferSize) << " Half Separation " - << HGCalDD4HepHelper::convert2mm(waferSepar); + << cms::convert2mm(thick) << " Wafer 2r " + << cms::convert2mm(waferSize) << " Half Separation " + << cms::convert2mm(waferSepar); #endif const auto& tags = args.value>("Tags"); const auto& partialTypes = args.value>("PartialTypes"); @@ -49,7 +49,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << layerNames.size() << " types of volumes"; for (unsigned int i = 0; i < layerNames.size(); ++i) edm::LogVerbatim("HGCalGeom") << "Volume [" << i << "] " << layerNames[i] << " of thickness " - << HGCalDD4HepHelper::convert2mm(layerThick[i]) << " filled with " << materials[i] + << cms::convert2mm(layerThick[i]) << " filled with " << materials[i] << " type " << layerType[i]; #endif const auto& layers = args.value>("Layers"); @@ -96,15 +96,15 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glogM); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << solid.name() << " extruded polygon made of " << material - << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" << HGCalDD4HepHelper::convert2mm(zy[0]) - << ":" << scale[0] << " z|x|y|s (1) " << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) + << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" << cms::convert2mm(zy[0]) + << ":" << scale[0] << " z|x|y|s (1) " << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " partial " << partialTypes[k] << " orientation " << orientations[k] << " and " << xM.size() << " edges"; for (unsigned int j = 0; j < xM.size(); ++j) - edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << HGCalDD4HepHelper::convert2mm(xM[j]) << ":" - << HGCalDD4HepHelper::convert2mm(yM[j]); + edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << cms::convert2mm(xM[j]) << ":" + << cms::convert2mm(yM[j]); #endif // Then the layers @@ -131,16 +131,16 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glogs[i]); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << solid.name() << " extruded polygon made of " - << materials[i] << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " - << HGCalDD4HepHelper::convert2mm(zw[1]) << ": partial " << partialTypes[k] - << " orientation " << orientations[k] << HGCalDD4HepHelper::convert2mm(zx[1]) - << ":" << HGCalDD4HepHelper::convert2mm(zy[1]) << ":" << scale[1] << " and " + << materials[i] << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" + << cms::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " + << cms::convert2mm(zw[1]) << ": partial " << partialTypes[k] + << " orientation " << orientations[k] << cms::convert2mm(zx[1]) + << ":" << cms::convert2mm(zy[1]) << ":" << scale[1] << " and " << xM.size() << " edges"; for (unsigned int j = 0; j < xL.size(); ++j) - edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << HGCalDD4HepHelper::convert2mm(xL[j]) << ":" - << HGCalDD4HepHelper::convert2mm(yL[j]); + edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << cms::convert2mm(xL[j]) << ":" + << cms::convert2mm(yL[j]); #endif } if (layerType[i] > 0) { @@ -153,17 +153,17 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext ns.addVolumeNS(glog); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << solid.name() << " extruded polygon made of " - << materials[i] << " z|x|y|s (0) " << HGCalDD4HepHelper::convert2mm(zw[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[0]) << ":" - << HGCalDD4HepHelper::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " - << HGCalDD4HepHelper::convert2mm(zw[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zx[1]) << ":" - << HGCalDD4HepHelper::convert2mm(zy[1]) << ":" << scale[1] << " partial " + << materials[i] << " z|x|y|s (0) " << cms::convert2mm(zw[0]) << ":" + << cms::convert2mm(zx[0]) << ":" + << cms::convert2mm(zy[0]) << ":" << scale[0] << " z|x|y|s (1) " + << cms::convert2mm(zw[1]) << ":" + << cms::convert2mm(zx[1]) << ":" + << cms::convert2mm(zy[1]) << ":" << scale[1] << " partial " << partialTypes[k] << " orientation " << orientations[k] << " and " << xL.size() << " edges"; for (unsigned int j = 0; j < xL.size(); ++j) - edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << HGCalDD4HepHelper::convert2mm(xL[j]) << ":" - << HGCalDD4HepHelper::convert2mm(yL[j]); + edm::LogVerbatim("HGCalGeom") << "[" << j << "] " << cms::convert2mm(xL[j]) << ":" + << cms::convert2mm(yL[j]); #endif double zpos = (posSense == 0) ? -0.5 * (layerThick[i] - senseT) : 0.5 * (layerThick[i] - senseT); dd4hep::Position tran(0, 0, zpos); @@ -171,7 +171,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext glogs[i].placeVolume(glog, copy, tran); #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << glog.name() << " number " << copy << " positioned in " - << glogs[i].name() << " at (0, 0," << HGCalDD4HepHelper::convert2mm(zpos) + << glogs[i].name() << " at (0, 0," << cms::convert2mm(zpos) << ") with no rotation"; #endif } @@ -180,7 +180,7 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext #ifdef EDM_ML_DEBUG edm::LogVerbatim("HGCalGeom") << "DDHGCalWaferP: " << glogs[i].name() << " number " << copyNumber[i] << " positioned in " << glogM.name() << " at (0,0," - << HGCalDD4HepHelper::convert2mm(zi + 0.5 * layerThick[i]) << " with no rotation"; + << cms::convert2mm(zi + 0.5 * layerThick[i]) << " with no rotation"; #endif ++copyNumber[i]; zi += layerThick[i]; @@ -188,12 +188,12 @@ static long algorithm(dd4hep::Detector& /* description */, cms::DDParsingContext } if (std::abs(thickTot - thick) >= tol) { if (thickTot > thick) { - edm::LogError("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " is smaller than " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogError("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " is smaller than " << cms::convert2mm(thickTot) << ": thickness of all its components **** ERROR ****"; } else { - edm::LogWarning("HGCalGeom") << "Thickness of the partition " << HGCalDD4HepHelper::convert2mm(thick) - << " does not match with " << HGCalDD4HepHelper::convert2mm(thickTot) + edm::LogWarning("HGCalGeom") << "Thickness of the partition " << cms::convert2mm(thick) + << " does not match with " << cms::convert2mm(thickTot) << " of the components"; } } diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h b/Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h deleted file mode 100644 index 97fdce90f0a31..0000000000000 --- a/Geometry/HGCalCommonData/plugins/dd4hep/HGCalDD4HepHelper.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef Geometry_HGCalCommonData_HGCalDD4HepHelper_h -#define Geometry_HGCalCommonData_HGCalDD4HepHelper_h -#include "DD4hep/DD4hepUnits.h" - -namespace HGCalDD4HepHelper { - template - inline constexpr NumType convert2mm(NumType length) { - return (length / dd4hep::mm); - } -} // namespace HGCalDD4HepHelper -#endif