From 3fd9b6ac6055aa6fa842454d9ce345f9286214e7 Mon Sep 17 00:00:00 2001 From: Sunanda Date: Mon, 24 Apr 2023 09:38:50 +0200 Subject: [PATCH] Code check --- .../interface/HGCalDDDConstants.h | 3 +- .../src/HGCalGeomParameters.cc | 38 +++++++++++-------- .../src/HGCalParametersFromDD.cc | 15 +++++--- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/Geometry/HGCalCommonData/interface/HGCalDDDConstants.h b/Geometry/HGCalCommonData/interface/HGCalDDDConstants.h index f9617cc75114a..1fb9a00d9a8ed 100644 --- a/Geometry/HGCalCommonData/interface/HGCalDDDConstants.h +++ b/Geometry/HGCalCommonData/interface/HGCalDDDConstants.h @@ -172,7 +172,8 @@ class HGCalDDDConstants { (mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell)); } inline bool waferHexagon8Module() const { - return ((mode_ == HGCalGeometryMode::Hexagon8Module) || (mode_ == HGCalGeometryMode::Hexagon8Cassette) || (mode_ == HGCalGeometryMode::Hexagon8CalibCell)); + return ((mode_ == HGCalGeometryMode::Hexagon8Module) || (mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (mode_ == HGCalGeometryMode::Hexagon8CalibCell)); } bool waferInLayer(int wafer, int lay, bool reco) const; bool waferFullInLayer(int wafer, int lay, bool reco) const; diff --git a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc index dbff4340ea276..9645a8be4acb1 100644 --- a/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc +++ b/Geometry/HGCalCommonData/src/HGCalGeomParameters.cc @@ -1264,7 +1264,8 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const DDFilteredView& fv, HGCalPa DDsvalues_type sv(fv.mergedSpecifics()); php.cellThickness_ = getDDDArray("CellThickness", sv, 3); rescale(php.cellThickness_, HGCalParameters::k_ScaleFromDDD); - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { php.waferThickness_ = getDDDArray("WaferThickness", sv, 3); rescale(php.waferThickness_, HGCalParameters::k_ScaleFromDDD); } else { @@ -1334,7 +1335,8 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const DDFilteredView& fv, HGCalPa waferProperties = dbl_to_int(fv.vector("WaferPropertiesHE")); cassetteShift = fv.vector("CassetteShiftHE"); } - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { if ((php.waferMaskMode_ == siliconFileEE) || (php.waferMaskMode_ == siliconCassetteEE)) { layerType = dbl_to_int(fv.vector("LayerTypesEE")); } else if ((php.waferMaskMode_ == siliconFileHE) || (php.waferMaskMode_ == siliconCassetteHE)) { @@ -1354,7 +1356,8 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv, const std::string& sdTag1) { php.cellThickness_ = fv.get >(sdTag1, "CellThickness"); rescale(php.cellThickness_, HGCalParameters::k_ScaleFromDD4hep); - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { php.waferThickness_ = fv.get >(sdTag1, "WaferThickness"); rescale(php.waferThickness_, HGCalParameters::k_ScaleFromDD4hep); } else { @@ -1412,16 +1415,16 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv, php.calibCellRLD_ = HGCalParameters::k_ScaleFromDDD * it.second[1]; } else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "CalibCellFullHD")) { for (const auto& i : it.second) - php.calibCellFullHD_.emplace_back(std::round(i)); + php.calibCellFullHD_.emplace_back(std::round(i)); } else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "CalibCellPartHD")) { for (const auto& i : it.second) - php.calibCellPartHD_.emplace_back(std::round(i)); + php.calibCellPartHD_.emplace_back(std::round(i)); } else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "CalibCellFullLD")) { for (const auto& i : it.second) - php.calibCellFullLD_.emplace_back(std::round(i)); + php.calibCellFullLD_.emplace_back(std::round(i)); } else if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "CalibCellPartLD")) { for (const auto& i : it.second) - php.calibCellPartLD_.emplace_back(std::round(i)); + php.calibCellPartLD_.emplace_back(std::round(i)); } } @@ -1468,7 +1471,8 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv, } } } - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { if ((php.waferMaskMode_ == siliconFileEE) || (php.waferMaskMode_ == siliconFileHE)) { for (auto const& it : vmap) { if (dd4hep::dd::compareEqual(dd4hep::dd::noNamespace(it.first), "LayerTypesEE")) { @@ -1525,12 +1529,14 @@ void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php) { << php.layerCenter_.size(); for (unsigned int k = 0; k < php.layerCenter_.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.layerCenter_[k]; - edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Calibration cells in HD having radius " << php.calibCellRHD_ << " in arrays of size " - << php.calibCellFullHD_.size() << ":" << php.calibCellPartHD_.size(); + edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Calibration cells in HD having radius " << php.calibCellRHD_ + << " in arrays of size " << php.calibCellFullHD_.size() << ":" + << php.calibCellPartHD_.size(); for (unsigned int k = 0; k < php.calibCellFullHD_.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.calibCellFullHD_[k] << ":" << php.calibCellPartHD_[k]; - edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Calibration cells in LD having radius " << php.calibCellRLD_ << " in arrays of size " - << php.calibCellFullLD_.size() << ":" << php.calibCellPartLD_.size(); + edm::LogVerbatim("HGCalGeom") << "HGCalGeomParameters: Calibration cells in LD having radius " << php.calibCellRLD_ + << " in arrays of size " << php.calibCellFullLD_.size() << ":" + << php.calibCellPartLD_.size(); for (unsigned int k = 0; k < php.calibCellFullLD_.size(); ++k) edm::LogVerbatim("HGCalGeom") << "[" << k << "] " << php.calibCellFullLD_[k] << ":" << php.calibCellPartLD_[k]; #endif @@ -1559,7 +1565,7 @@ void HGCalGeomParameters::loadSpecParsHexagon8(HGCalParameters& php, for (unsigned int k = 0; k < waferIndex.size(); ++k) { int partial = HGCalProperty::waferPartial(waferProperties[k]); int orient = - ((php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) + ((php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) ? HGCalProperty::waferOrient(waferProperties[k]) : HGCalWaferMask::getRotation(php.waferZSide_, partial, HGCalProperty::waferOrient(waferProperties[k])); php.waferInfoMap_[waferIndex[k]] = HGCalParameters::waferInfo(HGCalProperty::waferThick(waferProperties[k]), @@ -2036,12 +2042,14 @@ void HGCalGeomParameters::loadWaferHexagon8(HGCalParameters& php) { std::pair corner0 = HGCalWaferMask::getTypeMode( xpos0, ypos0, r1, R1, php.rMinLayHex_[i], php.rMaxLayHex_[i], type, php.waferMaskMode_); if ((php.mode_ == HGCalGeometryMode::Hexagon8File) || (php.mode_ == HGCalGeometryMode::Hexagon8Module) || - (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { auto itr = php.waferInfoMap_.find(wl); if (itr != php.waferInfoMap_.end()) { int part = (itr->second).part; int orient = (itr->second).orient; - bool ok = ((php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) + bool ok = ((php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) ? true : HGCalWaferMask::goodTypeMode( xpos0, ypos0, r1, R1, php.rMinLayHex_[i], php.rMaxLayHex_[i], part, orient, false); diff --git a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc index 1200678855f3c..98ca5129c55dc 100644 --- a/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc +++ b/Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc @@ -86,7 +86,8 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv, php.minTileSize_ = 0; php.waferMaskMode_ = static_cast(getDDDValue("WaferMaskMode", sv)); php.waferZSide_ = static_cast(getDDDValue("WaferZside", sv)); - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { php.useSimWt_ = static_cast(getDDDValue("UseSimWt", sv)); php.layerRotation_ = getDDDValue("LayerRotation", sv); } @@ -175,7 +176,8 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv, php.defineFull_ = true; // Load wafer positions geom->loadWaferHexagon8(php); - } else if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + } else if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { // Load the SpecPars geom->loadSpecParsHexagon8(fv, php); // Load Geometry parameters @@ -269,7 +271,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, << HGCalGeometryMode::Hexagon8File << ":" << HGCalGeometryMode::Hexagon8Module << ":" << HGCalGeometryMode::Trapezoid << ":" << HGCalGeometryMode::TrapezoidFile << ":" << HGCalGeometryMode::TrapezoidModule << ":" << HGCalGeometryMode::Hexagon8Cassette - << ":" << HGCalGeometryMode::TrapezoidCassette << ":" << HGCalGeometryMode::Hexagon8CalibCell; + << ":" << HGCalGeometryMode::TrapezoidCassette << ":" + << HGCalGeometryMode::Hexagon8CalibCell; #endif php.levelZSide_ = 3; // Default level for ZSide php.detectorType_ = 0; // These two parameters are @@ -307,7 +310,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, php.waferMaskMode_ = static_cast(tempD[0]); tempD = fv.get >(name, "WaferZside"); php.waferZSide_ = static_cast(tempD[0]); - if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { tempD = fv.get >(name, "LayerRotation"); php.layerRotation_ = tempD[0]; tempD = fv.get >(name, "UseSimWt"); @@ -403,7 +407,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv, php.defineFull_ = true; // Load wafer positions geom->loadWaferHexagon8(php); - } else if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { + } else if ((php.mode_ == HGCalGeometryMode::Hexagon8Module) || (php.mode_ == HGCalGeometryMode::Hexagon8Cassette) || + (php.mode_ == HGCalGeometryMode::Hexagon8CalibCell)) { // Load the SpecPars geom->loadSpecParsHexagon8(fv, vmap, php, name); // Load Geometry parameters