diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedLayer.cc b/Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedLayer.cc index fd1e8731131a8..cf29dc54c786e 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedLayer.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalMixRotatedLayer.cc @@ -95,7 +95,7 @@ class DDHGCalMixRotatedLayer : public DDAlgorithm { std::vector layerThickTop_; // Thickness of the top sections std::vector layerTypeTop_; // Type of the Top layer std::vector copyNumberTop_; // Initial copy numbers (top section) - std::vector layerTypes_; // Layer type of silicon layers + std::vector layerOrient_; // Layer orientation for the silicon component std::vector waferIndex_; // Wafer index for the types std::vector waferProperty_; // Wafer property std::vector waferLayerStart_; // Start index of wafers in each layer @@ -208,10 +208,10 @@ void DDHGCalMixRotatedLayer::initialize(const DDNumericArguments& nArgs, #endif layerType_ = dbl_to_int(vArgs["LayerType"]); layerSense_ = dbl_to_int(vArgs["LayerSense"]); - layerTypes_ = dbl_to_int(vArgs["LayerTypes"]); + layerOrient_ = dbl_to_int(vArgs["LayerTypes"]); #ifdef EDM_ML_DEBUG - for (unsigned int i = 0; i < layerTypes_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerTypes_[i]; + for (unsigned int i = 0; i < layerOrient_.size(); ++i) + edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i]; #endif if (firstLayer_ > 0) { for (unsigned int i = 0; i < layerType_.size(); ++i) { @@ -506,23 +506,23 @@ void DDHGCalMixRotatedLayer::positionMix(const DDLogicalPart& glog, // Make the bottom part next int layer = (copyM - firstLayer_); static const double sqrt3 = std::sqrt(3.0); - int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda) + int layercenter = (layerOrient_[layer] == HGCalTypes::CornerCenteredLambda) ? HGCalTypes::CornerCenterYp - : ((layerTypes_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm - : HGCalTypes::WaferCenter); - int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; + : ((layerOrient_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm + : HGCalTypes::WaferCenter); + int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; int firstWafer = waferLayerStart_[layer]; int lastWafer = ((layer + 1 < static_cast(waferLayerStart_.size())) ? waferLayerStart_[layer + 1] : static_cast(waferIndex_.size())); - double r = 0.5 * (waferSize_ + waferSepar_); - double R = 2.0 * r / sqrt3; - double dy = 0.75 * R; + double delx = 0.5 * (waferSize_ + waferSepar_); + double dely = 2.0 * delx / sqrt3; + double dy = 0.75 * dely; const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_)); #ifdef EDM_ML_DEBUG int ium(0), ivm(0), kount(0); std::vector ntype(3, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedLayer: " << glog.ddname() << " r " << r << " R " << R << " dy " - << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize " + edm::LogVerbatim("HGCalGeom") << "DDHGCalMixRotatedLayer: " << glog.ddname() << " r " << delx << " R " << dely + << " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize " << (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1); #endif for (int k = firstWafer; k < lastWafer; ++k) { @@ -545,7 +545,7 @@ void DDHGCalMixRotatedLayer::positionMix(const DDLogicalPart& glog, << ":" << cassette << ":" << place; #endif auto cshift = cassette_.getShift(layer + 1, 1, cassette); - double xpos = xyoff.first + cshift.first + nc * r; + double xpos = xyoff.first + cshift.first + nc * delx; double ypos = xyoff.second + cshift.second + nr * dy; std::string wafer; int i(999); diff --git a/Geometry/HGCalCommonData/plugins/DDHGCalSiliconRotatedModule.cc b/Geometry/HGCalCommonData/plugins/DDHGCalSiliconRotatedModule.cc index 9fe8026193d92..b29306b025a62 100644 --- a/Geometry/HGCalCommonData/plugins/DDHGCalSiliconRotatedModule.cc +++ b/Geometry/HGCalCommonData/plugins/DDHGCalSiliconRotatedModule.cc @@ -86,7 +86,7 @@ class DDHGCalSiliconRotatedModule : public DDAlgorithm { std::vector slopeT_; // Slopes at the larger R std::vector zFrontT_; // Starting Z values for the slopes std::vector rMaxFront_; // Corresponding rMax's - std::vector layerTypes_; // Layer type (Centering, rotations..) + std::vector layerOrient_; // Layer orientation (Centering, rotations..) std::vector waferIndex_; // Wafer index for the types std::vector waferProperty_; // Wafer property std::vector waferLayerStart_; // Index of wafers in each layer @@ -179,10 +179,10 @@ void DDHGCalSiliconRotatedModule::initialize(const DDNumericArguments& nArgs, #endif layerType_ = dbl_to_int(vArgs["LayerType"]); layerSense_ = dbl_to_int(vArgs["LayerSense"]); - layerTypes_ = dbl_to_int(vArgs["LayerTypes"]); + layerOrient_ = dbl_to_int(vArgs["LayerTypes"]); #ifdef EDM_ML_DEBUG - for (unsigned int i = 0; i < layerTypes_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerTypes_[i]; + for (unsigned int i = 0; i < layerOrient_.size(); ++i) + edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i]; #endif if (firstLayer_ > 0) { for (unsigned int i = 0; i < layerType_.size(); ++i) { @@ -347,7 +347,7 @@ void DDHGCalSiliconRotatedModule::constructLayers(const DDLogicalPart& module, D edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << solid.name() << " Tubs made of " << matName << " of dimensions " << rinB << ":" << rins << ", " << routF << ":" << routs << ", " << hthick << ", 0.0, 360.0 and position " << glog.name() << " number " - << copy << ":" << layerTypes_[copy - firstLayer_]; + << copy << ":" << layerOrient_[copy - firstLayer_]; #endif positionSensitive(glog, (copy - firstLayer_), cpv); } @@ -356,7 +356,7 @@ void DDHGCalSiliconRotatedModule::constructLayers(const DDLogicalPart& module, D #ifdef EDM_ML_DEBUG std::string rotName("Null"); #endif - if ((layerSense_[ly] > 0) && (layerTypes_[copy - firstLayer_] == HGCalTypes::WaferCenteredRotated)) { + if ((layerSense_[ly] > 0) && (layerOrient_[copy - firstLayer_] == HGCalTypes::WaferCenteredRotated)) { rot = DDRotation(DDName(DDSplit(rotstr_).first, DDSplit(rotstr_).second)); #ifdef EDM_ML_DEBUG rotName = rotstr_; @@ -389,22 +389,22 @@ void DDHGCalSiliconRotatedModule::constructLayers(const DDLogicalPart& module, D void DDHGCalSiliconRotatedModule::positionSensitive(const DDLogicalPart& glog, int layer, DDCompactView& cpv) { static const double sqrt3 = std::sqrt(3.0); - int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda) + int layercenter = (layerOrient_[layer] == HGCalTypes::CornerCenteredLambda) ? HGCalTypes::CornerCenterYp - : ((layerTypes_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm - : HGCalTypes::WaferCenter); - int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; + : ((layerOrient_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm + : HGCalTypes::WaferCenter); + int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; int firstWafer = waferLayerStart_[layer]; int lastWafer = ((layer + 1 < static_cast(waferLayerStart_.size())) ? waferLayerStart_[layer + 1] : static_cast(waferIndex_.size())); - double r = 0.5 * (waferSize_ + waferSepar_); - double R = 2.0 * r / sqrt3; - double dy = 0.75 * R; + double delx = 0.5 * (waferSize_ + waferSepar_); + double dely = 2.0 * delx / sqrt3; + double dy = 0.75 * dely; const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_)); #ifdef EDM_ML_DEBUG int ium(0), ivm(0), kount(0); std::vector ntype(3, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.ddname() << " r " << r << " R " << R + edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.ddname() << " r " << delx << " R " << dely << " dy " << dy << " Shift " << xyoff.first << ":" << xyoff.second << " WaferSize " << (waferSize_ + waferSepar_) << " index " << firstWafer << ":" << (lastWafer - 1); #endif @@ -423,7 +423,7 @@ void DDHGCalSiliconRotatedModule::positionSensitive(const DDLogicalPart& glog, i int cassette = HGCalProperty::waferCassette(waferProperty_[k]); int place = HGCalCell::cellPlacementIndex(1, layertype, orien); auto cshift = cassette_.getShift(layer, 1, cassette); - double xpos = xyoff.first + cshift.first + nc * r; + double xpos = xyoff.first + cshift.first + nc * delx; double ypos = xyoff.second + cshift.second + nr * dy; std::string wafer; int i(999); diff --git a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconRotatedModule.cc b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconRotatedModule.cc index 4ce3b0d3d9e0e..57105c1c39905 100644 --- a/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconRotatedModule.cc +++ b/Geometry/HGCalCommonData/plugins/dd4hep/DDHGCalSiliconRotatedModule.cc @@ -115,10 +115,10 @@ struct HGCalSiliconRotatedModule { #endif layerType_ = args.value>("LayerType"); layerSense_ = args.value>("LayerSense"); - layerTypes_ = args.value>("LayerTypes"); + layerOrient_ = args.value>("LayerTypes"); #ifdef EDM_ML_DEBUG - for (unsigned int i = 0; i < layerTypes_.size(); ++i) - edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerTypes_[i]; + for (unsigned int i = 0; i < layerOrient_.size(); ++i) + edm::LogVerbatim("HGCalGeom") << "LayerTypes [" << i << "] " << layerOrient_[i]; #endif if (firstLayer_ > 0) { for (unsigned int i = 0; i < layerType_.size(); ++i) { @@ -269,7 +269,7 @@ struct HGCalSiliconRotatedModule { << cms::convert2mm(rins) << ", " << cms::convert2mm(routF) << ":" << cms::convert2mm(routs) << ", " << cms::convert2mm(hthick) << ", 0.0, 360.0 and position " << glog.name() << " number " << copy << ":" - << layerTypes_[copy - firstLayer_]; + << layerOrient_[copy - firstLayer_]; #endif positionSensitive(ctxt, e, glog, (copy - firstLayer_)); } @@ -279,7 +279,7 @@ struct HGCalSiliconRotatedModule { #ifdef EDM_ML_DEBUG std::string rotName("Null"); #endif - if ((layerSense_[ly] > 0) && (layerTypes_[copy - firstLayer_] == HGCalTypes::WaferCenteredRotated)) { + if ((layerSense_[ly] > 0) && (layerOrient_[copy - firstLayer_] == HGCalTypes::WaferCenteredRotated)) { rot = ns.rotation(rotstr_); #ifdef EDM_ML_DEBUG rotName = rotstr_; @@ -325,23 +325,23 @@ struct HGCalSiliconRotatedModule { void positionSensitive(cms::DDParsingContext& ctxt, xml_h e, const dd4hep::Volume& glog, int layer) { cms::DDNamespace ns(ctxt, e, true); static const double sqrt3 = std::sqrt(3.0); - int layercenter = (layerTypes_[layer] == HGCalTypes::CornerCenteredLambda) + int layercenter = (layerOrient_[layer] == HGCalTypes::CornerCenteredLambda) ? HGCalTypes::CornerCenterYp - : ((layerTypes_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm - : HGCalTypes::WaferCenter); - int layertype = (layerTypes_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; + : ((layerOrient_[layer] == HGCalTypes::CornerCenteredY) ? HGCalTypes::CornerCenterYm + : HGCalTypes::WaferCenter); + int layertype = (layerOrient_[layer] == HGCalTypes::WaferCenteredBack) ? 1 : 0; int firstWafer = waferLayerStart_[layer]; int lastWafer = ((layer + 1 < static_cast(waferLayerStart_.size())) ? waferLayerStart_[layer + 1] : static_cast(waferIndex_.size())); - double r = 0.5 * (waferSize_ + waferSepar_); - double R = 2.0 * r / sqrt3; - double dy = 0.75 * R; + double delx = 0.5 * (waferSize_ + waferSepar_); + double dely = 2.0 * delx / sqrt3; + double dy = 0.75 * dely; const auto& xyoff = geomTools_.shiftXY(layercenter, (waferSize_ + waferSepar_)); #ifdef EDM_ML_DEBUG int ium(0), ivm(0), kount(0); std::vector ntype(3, 0); - edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " r " << cms::convert2mm(r) - << " R " << cms::convert2mm(R) << " dy " << cms::convert2mm(dy) << " Shift " + edm::LogVerbatim("HGCalGeom") << "DDHGCalSiliconRotatedModule: " << glog.name() << " r " << cms::convert2mm(delx) + << " R " << cms::convert2mm(dely) << " dy " << cms::convert2mm(dy) << " Shift " << cms::convert2mm(xyoff.first) << ":" << cms::convert2mm(xyoff.second) << " WaferSize " << cms::convert2mm((waferSize_ + waferSepar_)) << " index " << firstWafer << ":" << (lastWafer - 1); @@ -361,7 +361,7 @@ struct HGCalSiliconRotatedModule { int cassette = HGCalProperty::waferCassette(waferProperty_[k]); int place = HGCalCell::cellPlacementIndex(1, layertype, orien); auto cshift = cassette_.getShift(layer, 1, cassette); - double xpos = xyoff.first + cshift.first + nc * r; + double xpos = xyoff.first + cshift.first + nc * delx; double ypos = xyoff.second + cshift.second + nr * dy; std::string wafer; int i(999); @@ -445,7 +445,7 @@ struct HGCalSiliconRotatedModule { std::vector slopeT_; // Slopes at the larger R std::vector zFrontT_; // Starting Z values for the slopes std::vector rMaxFront_; // Corresponding rMax's - std::vector layerTypes_; // Layer type (Centering, rotations..) + std::vector layerOrient_; // Layer orientation (Centering, rotations..) std::vector waferIndex_; // Wafer index for the types std::vector waferProperty_; // Wafer property std::vector waferLayerStart_; // Index of wafers in each layer diff --git a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc index 0e284ba5d8576..13f8687fe56fc 100644 --- a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc +++ b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc @@ -8,7 +8,7 @@ #include "Geometry/HGCalCommonData/interface/HGCalGeometryMode.h" #include "Geometry/HGCalCommonData/interface/HGCalParameters.h" -#define EDM_ML_DEBUG +//#define EDM_ML_DEBUG using namespace geant_units::operators; namespace {