diff --git a/Geometry/HGCalCommonData/interface/HGCalTypes.h b/Geometry/HGCalCommonData/interface/HGCalTypes.h index d56f9af4e545b..f483249fc42f0 100644 --- a/Geometry/HGCalCommonData/interface/HGCalTypes.h +++ b/Geometry/HGCalCommonData/interface/HGCalTypes.h @@ -122,8 +122,8 @@ class HGCalTypes { // Translate from flat file format to CMSSW format of Layer type static int32_t layerType(int type); // Get the front-back index from the layer orientation index - static int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); } - static int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); } + static constexpr int32_t layerFrontBack(int32_t layerOrient) { return ((layerOrient == WaferCenterB) ? 1 : -1); } + static constexpr int32_t waferFrontBack(int32_t index) { return ((index == 0) ? -1 : 1); } private: static constexpr int32_t facu_ = 1; diff --git a/Geometry/HGCalCommonData/test/HGCalParameterTester.cc b/Geometry/HGCalCommonData/test/HGCalParameterTester.cc index dddbfb2f78aca..85b52e86280ee 100644 --- a/Geometry/HGCalCommonData/test/HGCalParameterTester.cc +++ b/Geometry/HGCalCommonData/test/HGCalParameterTester.cc @@ -156,6 +156,7 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet myPrint("CellSize", phgp->cellSize_, 10); myPrint("radiusMixBoundary", phgp->radiusMixBoundary_, 10); myPrint("LayerCenter", phgp->layerCenter_, 20); + myPrint("LayerType", phgp->layerType_, 20); edm::LogVerbatim("HGCalGeom") << "Layer Rotation " << phgp->layerRotation_ << " with " << phgp->layerRotV_.size() << " parameters"; for (unsigned int k = 0; k < phgp->layerRotV_.size(); ++k) @@ -167,6 +168,20 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet edm::LogVerbatim("HGCalGeom") << "CalibCellRadiusHD " << phgp->calibCellRLD_; myPrint("CalibCellFullLD", phgp->calibCellFullLD_, 12); myPrint("CalibCellPartLD", phgp->calibCellPartLD_, 12); + myPrint("cassetteShift", phgp->cassetteShift_, 8); + + edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_; + if (phgp->waferMaskMode_ > 1) { + edm::LogVerbatim("HGCalGeom") << "WaferInfo with " << phgp->waferInfoMap_.size() << " elements"; + unsigned int kk(0); + std::unordered_map::const_iterator itr = phgp->waferInfoMap_.begin(); + for (; itr != phgp->waferInfoMap_.end(); ++itr, ++kk) + edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" + << HGCalWaferIndex::waferLayer(itr->first) << ", " + << HGCalWaferIndex::waferU(itr->first) << ", " + << HGCalWaferIndex::waferV(itr->first) << "] (" << (itr->second).type << ", " + << (itr->second).part << ", " << (itr->second).orient << ")"; + } myPrint("slopeMin", phgp->slopeMin_, 10); myPrint("zFrontMin", phgp->zFrontMin_, 10); @@ -219,20 +234,6 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet printTrform(phgp); myPrint("levelTop", phgp->levelT_, 10); printWaferType(phgp); - myPrint("cassetteShift", phgp->cassetteShift_, 8); - - edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_; - if (phgp->waferMaskMode_ > 1) { - edm::LogVerbatim("HGCalGeom") << "WaferInfo with " << phgp->waferInfoMap_.size() << " elements"; - unsigned int kk(0); - std::unordered_map::const_iterator itr = phgp->waferInfoMap_.begin(); - for (; itr != phgp->waferInfoMap_.end(); ++itr, ++kk) - edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" - << HGCalWaferIndex::waferLayer(itr->first) << ", " - << HGCalWaferIndex::waferU(itr->first) << ", " - << HGCalWaferIndex::waferV(itr->first) << "] (" << (itr->second).type << ", " - << (itr->second).part << ", " << (itr->second).orient << ")"; - } } else { // Tpaezoid (scintillator) type edm::LogVerbatim("HGCalGeom") << "DetectorType: " << phgp->detectorType_; @@ -260,6 +261,22 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet myPrint("radiusLayer[1]", phgp->radiusLayer_[1], 10); myPrint("iradMinBH", phgp->iradMinBH_, 20); myPrint("iradMaxBH", phgp->iradMaxBH_, 20); + edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_; + if (phgp->waferMaskMode_ > 1) { + myPrint("tileRingR", phgp->tileRingR_, 4); + myPrint("tileRingRange", phgp->tileRingRange_, 8); + edm::LogVerbatim("HGCalGeom") << "TileInfo with " << phgp->tileInfoMap_.size() << " elements"; + unsigned int kk(0); + std::unordered_map::const_iterator itr = phgp->tileInfoMap_.begin(); + for (; itr != phgp->tileInfoMap_.end(); ++itr, ++kk) + edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" << HGCalTileIndex::tileLayer(itr->first) + << ", " << HGCalTileIndex::tileRing(itr->first) << ", " + << HGCalTileIndex::tilePhi(itr->first) << "] (" << (itr->second).type << ", " + << (itr->second).sipm << std::hex << ", " << (itr->second).hex[0] << ", " + << (itr->second).hex[1] << ", " << (itr->second).hex[2] << ", " + << (itr->second).hex[3] << ")" << std::dec; + } + myPrint("slopeTop", phgp->slopeTop_, 10); myPrint("zFrontTop", phgp->zFrontTop_, 10); myPrint("rMaxFront", phgp->rMaxFront_, 10); @@ -303,22 +320,6 @@ void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSet printTrform(phgp); myPrint("levelTop", phgp->levelT_, 10); printWaferType(phgp); - - edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_; - if (phgp->waferMaskMode_ > 1) { - myPrint("tileRingR", phgp->tileRingR_, 4); - myPrint("tileRingRange", phgp->tileRingRange_, 8); - edm::LogVerbatim("HGCalGeom") << "TileInfo with " << phgp->tileInfoMap_.size() << " elements"; - unsigned int kk(0); - std::unordered_map::const_iterator itr = phgp->tileInfoMap_.begin(); - for (; itr != phgp->tileInfoMap_.end(); ++itr, ++kk) - edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" << HGCalTileIndex::tileLayer(itr->first) - << ", " << HGCalTileIndex::tileRing(itr->first) << ", " - << HGCalTileIndex::tilePhi(itr->first) << "] (" << (itr->second).type << ", " - << (itr->second).sipm << std::hex << ", " << (itr->second).hex[0] << ", " - << (itr->second).hex[1] << ", " << (itr->second).hex[2] << ", " - << (itr->second).hex[3] << ")" << std::dec; - } } auto finish = std::chrono::high_resolution_clock::now(); diff --git a/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py index 8b5cc4e0ec4c6..8d4862db80ea6 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalNumbering_cfg.py @@ -6,7 +6,7 @@ # ############################################################################### import FWCore.ParameterSet.Config as cms -import os, sys, imp, re +import os, sys, importlib, re import FWCore.ParameterSet.VarParsing as VarParsing #################################################################### diff --git a/Geometry/HGCalCommonData/test/python/testHGCalParametersDD4hep_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalParametersDD4hep_cfg.py index de50aabae72bc..3e5e81001086a 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalParametersDD4hep_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalParametersDD4hep_cfg.py @@ -6,7 +6,7 @@ # ############################################################################### import FWCore.ParameterSet.Config as cms -import os, sys, imp, re +import os, sys, importlib, re import FWCore.ParameterSet.VarParsing as VarParsing #################################################################### diff --git a/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py index 320919770548d..d6e9480c419ef 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalParametersDDD_cfg.py @@ -6,7 +6,7 @@ # ############################################################################### import FWCore.ParameterSet.Config as cms -import os, sys, imp, re +import os, sys, importlib, re import FWCore.ParameterSet.VarParsing as VarParsing #################################################################### diff --git a/Geometry/HGCalCommonData/test/python/testHGCalPartialIDTester_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalPartialIDTester_cfg.py index 9b66455486674..510c5f3a2bf3f 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalPartialIDTester_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalPartialIDTester_cfg.py @@ -7,7 +7,7 @@ # ############################################################################### import FWCore.ParameterSet.Config as cms -import os, sys, imp, re, random +import os, sys, importlib, re, random import FWCore.ParameterSet.VarParsing as VarParsing #################################################################### diff --git a/Geometry/HGCalCommonData/test/python/testHGCalPartialMissingIDTester_cfg.py b/Geometry/HGCalCommonData/test/python/testHGCalPartialMissingIDTester_cfg.py index 3743104caad08..029cc5a8d9817 100644 --- a/Geometry/HGCalCommonData/test/python/testHGCalPartialMissingIDTester_cfg.py +++ b/Geometry/HGCalCommonData/test/python/testHGCalPartialMissingIDTester_cfg.py @@ -7,7 +7,7 @@ # ############################################################################### import FWCore.ParameterSet.Config as cms -import os, sys, imp, re, random +import os, sys, importlib, re, random import FWCore.ParameterSet.VarParsing as VarParsing ####################################################################