Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Apr 24, 2023
1 parent a007cdb commit 3fd9b6a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
3 changes: 2 additions & 1 deletion Geometry/HGCalCommonData/interface/HGCalDDDConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
38 changes: 23 additions & 15 deletions Geometry/HGCalCommonData/src/HGCalGeomParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)) {
Expand All @@ -1354,7 +1356,8 @@ void HGCalGeomParameters::loadSpecParsHexagon8(const cms::DDFilteredView& fv,
const std::string& sdTag1) {
php.cellThickness_ = fv.get<std::vector<double> >(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<std::vector<double> >(sdTag1, "WaferThickness");
rescale(php.waferThickness_, HGCalParameters::k_ScaleFromDD4hep);
} else {
Expand Down Expand Up @@ -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));
}
}

Expand Down Expand Up @@ -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")) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]),
Expand Down Expand Up @@ -2036,12 +2042,14 @@ void HGCalGeomParameters::loadWaferHexagon8(HGCalParameters& php) {
std::pair<int, int> 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);
Expand Down
15 changes: 10 additions & 5 deletions Geometry/HGCalCommonData/src/HGCalParametersFromDD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ bool HGCalParametersFromDD::build(const DDCompactView* cpv,
php.minTileSize_ = 0;
php.waferMaskMode_ = static_cast<int>(getDDDValue("WaferMaskMode", sv));
php.waferZSide_ = static_cast<int>(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<int>(getDDDValue("UseSimWt", sv));
php.layerRotation_ = getDDDValue("LayerRotation", sv);
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -307,7 +310,8 @@ bool HGCalParametersFromDD::build(const cms::DDCompactView* cpv,
php.waferMaskMode_ = static_cast<int>(tempD[0]);
tempD = fv.get<std::vector<double> >(name, "WaferZside");
php.waferZSide_ = static_cast<int>(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<std::vector<double> >(name, "LayerRotation");
php.layerRotation_ = tempD[0];
tempD = fv.get<std::vector<double> >(name, "UseSimWt");
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3fd9b6a

Please sign in to comment.