File indexing completed on 2024-04-06 12:15:08
0001 #include <array>
0002 #include <iostream>
0003 #include <sstream>
0004 #include <map>
0005
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0013
0014 #include "Geometry/HGCalCommonData/interface/HGCalParameters.h"
0015 #include "Geometry/HGCalCommonData/interface/HGCalTileIndex.h"
0016 #include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
0017 #include "Geometry/Records/interface/IdealGeometryRecord.h"
0018
0019 class HGCalParameterTester : public edm::one::EDAnalyzer<> {
0020 public:
0021 explicit HGCalParameterTester(const edm::ParameterSet&);
0022 ~HGCalParameterTester() override = default;
0023 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0024
0025 void beginJob() override {}
0026 void analyze(edm::Event const& iEvent, edm::EventSetup const&) override;
0027 void endJob() override {}
0028
0029 private:
0030 template <typename T>
0031 void myPrint(std::string const& s, std::vector<T> const& obj, int n) const;
0032 template <typename T>
0033 void myPrint(std::string const& s, std::vector<std::pair<T, T> > const& obj, int n) const;
0034 void myPrint(std::string const& s, std::vector<double> const& obj1, std::vector<double> const& obj2, int n) const;
0035 void myPrint(std::string const& s, HGCalParameters::wafer_map const& obj, int n) const;
0036 void printTrform(HGCalParameters const*) const;
0037 void printWaferType(HGCalParameters const* phgp) const;
0038
0039 const std::string name_;
0040 edm::ESGetToken<HGCalParameters, IdealGeometryRecord> token_;
0041 const int mode_;
0042 };
0043
0044 HGCalParameterTester::HGCalParameterTester(const edm::ParameterSet& ic)
0045 : name_(ic.getParameter<std::string>("Name")),
0046 token_(esConsumes<HGCalParameters, IdealGeometryRecord>(edm::ESInputTag{"", name_})),
0047 mode_(ic.getParameter<int>("Mode")) {}
0048
0049 void HGCalParameterTester::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0050 edm::ParameterSetDescription desc;
0051 desc.add<std::string>("Name", "HGCalEESensitive");
0052 desc.add<int>("Mode", 1);
0053 descriptions.add("hgcParameterTesterEE", desc);
0054 }
0055
0056 void HGCalParameterTester::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0057 edm::LogVerbatim("HGCalGeomr") << "HGCalParameter::Here I am";
0058 auto start = std::chrono::high_resolution_clock::now();
0059
0060 const auto& hgp = iSetup.getData(token_);
0061 const auto* phgp = &hgp;
0062
0063 edm::LogVerbatim("HGCalGeom") << phgp->name_;
0064 if (mode_ == 0) {
0065
0066 edm::LogVerbatim("HGCalGeom") << "DetectorType: " << phgp->detectorType_;
0067 edm::LogVerbatim("HGCalGeom") << "WaferR_: " << phgp->waferR_;
0068 edm::LogVerbatim("HGCalGeom") << "nCells_: " << phgp->nCells_;
0069 edm::LogVerbatim("HGCalGeom") << "nSectors_: " << phgp->nSectors_;
0070 edm::LogVerbatim("HGCalGeom") << "FirstLayer: " << phgp->firstLayer_;
0071 edm::LogVerbatim("HGCalGeom") << "FirstMixedLayer: " << phgp->firstMixedLayer_;
0072 edm::LogVerbatim("HGCalGeom") << "mode_: " << phgp->mode_;
0073
0074 myPrint("CellSize", phgp->cellSize_, 10);
0075 myPrint("slopeMin", phgp->slopeMin_, 10);
0076 myPrint("slopeTop", phgp->slopeTop_, 10);
0077 myPrint("zFrontTop", phgp->zFrontTop_, 10);
0078 myPrint("rMaxFront", phgp->rMaxFront_, 10);
0079 myPrint("zRanges", phgp->zRanges_, 10);
0080 myPrint("moduleBlS", phgp->moduleBlS_, 10);
0081 myPrint("moduleTlS", phgp->moduleTlS_, 10);
0082 myPrint("moduleHS", phgp->moduleHS_, 10);
0083 myPrint("moduleDzS", phgp->moduleDzS_, 10);
0084 myPrint("moduleAlphaS", phgp->moduleAlphaS_, 10);
0085 myPrint("moduleCellS", phgp->moduleCellS_, 10);
0086 myPrint("moduleBlR", phgp->moduleBlR_, 10);
0087 myPrint("moduleTlR", phgp->moduleTlR_, 10);
0088 myPrint("moduleHR", phgp->moduleHR_, 10);
0089 myPrint("moduleDzR", phgp->moduleDzR_, 10);
0090 myPrint("moduleAlphaR", phgp->moduleAlphaR_, 10);
0091 myPrint("moduleCellR", phgp->moduleCellR_, 10);
0092 myPrint("trformTranX", phgp->trformTranX_, 10);
0093 myPrint("trformTranY", phgp->trformTranY_, 10);
0094 myPrint("trformTranZ", phgp->trformTranZ_, 10);
0095 myPrint("trformRotXX", phgp->trformRotXX_, 10);
0096 myPrint("trformRotYX", phgp->trformRotYX_, 10);
0097 myPrint("trformRotZX", phgp->trformRotZX_, 10);
0098 myPrint("trformRotXY", phgp->trformRotXY_, 10);
0099 myPrint("trformRotYY", phgp->trformRotYY_, 10);
0100 myPrint("trformRotZY", phgp->trformRotZY_, 10);
0101 myPrint("trformRotXZ", phgp->trformRotXZ_, 10);
0102 myPrint("trformRotYZ", phgp->trformRotYZ_, 10);
0103 myPrint("trformRotZZ", phgp->trformRotZZ_, 10);
0104 myPrint("zLayerHex", phgp->zLayerHex_, 10);
0105 myPrint("rMinLayHex", phgp->rMinLayHex_, 10);
0106 myPrint("rMaxLayHex", phgp->rMaxLayHex_, 10);
0107 myPrint("waferPos", phgp->waferPosX_, phgp->waferPosY_, 4);
0108 myPrint("cellFine", phgp->cellFineX_, phgp->cellFineY_, 4);
0109 myPrint("cellFineHalf", phgp->cellFineHalf_, 10);
0110 myPrint("cellCoarse", phgp->cellCoarseX_, phgp->cellCoarseY_, 4);
0111 myPrint("cellCoarseHalf", phgp->cellCoarseHalf_, 10);
0112 myPrint("boundR", phgp->boundR_, 10);
0113 myPrint("moduleLayS", phgp->moduleLayS_, 10);
0114 myPrint("moduleLayR", phgp->moduleLayR_, 10);
0115 myPrint("layer", phgp->layer_, 18);
0116 myPrint("layerIndex", phgp->layerIndex_, 18);
0117 myPrint("layerGroup", phgp->layerGroup_, 18);
0118 myPrint("cellFactor", phgp->cellFactor_, 10);
0119 myPrint("depth", phgp->depth_, 18);
0120 myPrint("depthIndex", phgp->depthIndex_, 18);
0121 myPrint("depthLayerF", phgp->depthLayerF_, 18);
0122 myPrint("waferCopy", phgp->waferCopy_, 10);
0123 myPrint("waferTypeL", phgp->waferTypeL_, 25);
0124 myPrint("waferTypeT", phgp->waferTypeT_, 25);
0125 myPrint("layerGroupM", phgp->layerGroupM_, 18);
0126 myPrint("layerGroupO", phgp->layerGroupO_, 18);
0127 printTrform(phgp);
0128 myPrint("levelTop", phgp->levelT_, 10);
0129 printWaferType(phgp);
0130
0131 } else if (mode_ == 1) {
0132
0133 edm::LogVerbatim("HGCalGeom") << "DetectorType: " << phgp->detectorType_;
0134 edm::LogVerbatim("HGCalGeom") << "UseSimWt: " << phgp->useSimWt_;
0135 edm::LogVerbatim("HGCalGeom") << "Wafer Parameters: " << phgp->waferSize_ << ":" << phgp->waferR_ << ":"
0136 << phgp->waferThick_ << ":" << phgp->sensorSeparation_ << ":"
0137 << phgp->sensorSizeOffset_ << ":" << phgp->guardRingOffset_ << ":" << phgp->mouseBite_
0138 << ":" << phgp->useOffset_;
0139 myPrint("waferThickness", phgp->waferThickness_, 10);
0140 edm::LogVerbatim("HGCalGeom") << "nCells_: " << phgp->nCellsFine_ << ":" << phgp->nCellsCoarse_;
0141 edm::LogVerbatim("HGCalGeom") << "nSectors_: " << phgp->nSectors_;
0142 edm::LogVerbatim("HGCalGeom") << "FirstLayer: " << phgp->firstLayer_;
0143 edm::LogVerbatim("HGCalGeom") << "FirstMixedLayer: " << phgp->firstMixedLayer_;
0144 edm::LogVerbatim("HGCalGeom") << "LayerOffset: " << phgp->layerOffset_;
0145 edm::LogVerbatim("HGCalGeom") << "mode_: " << phgp->mode_;
0146 edm::LogVerbatim("HGCalGeom") << "cassettes_: " << phgp->cassettes_;
0147
0148 edm::LogVerbatim("HGCalGeom") << "waferUVMax: " << phgp->waferUVMax_;
0149 myPrint("waferUVMaxLayer", phgp->waferUVMaxLayer_, 20);
0150 myPrint("CellThickness", phgp->cellThickness_, 10);
0151 myPrint("radius100to200", phgp->radius100to200_, 10);
0152 myPrint("radius200to300", phgp->radius200to300_, 10);
0153 edm::LogVerbatim("HGCalGeom") << "choiceType " << phgp->choiceType_ << " nCornerCut " << phgp->nCornerCut_
0154 << " fracAreaMin " << phgp->fracAreaMin_ << " zMinForRad " << phgp->zMinForRad_;
0155
0156 myPrint("CellSize", phgp->cellSize_, 10);
0157 myPrint("radiusMixBoundary", phgp->radiusMixBoundary_, 10);
0158 myPrint("LayerCenter", phgp->layerCenter_, 20);
0159 myPrint("LayerType", phgp->layerType_, 20);
0160 edm::LogVerbatim("HGCalGeom") << "Layer Rotation " << phgp->layerRotation_ << " with " << phgp->layerRotV_.size()
0161 << " parameters";
0162 for (unsigned int k = 0; k < phgp->layerRotV_.size(); ++k)
0163 edm::LogVerbatim("HGCalGeom") << "Element[" << k << "] " << phgp->layerRotV_[k].first << ":"
0164 << phgp->layerRotV_[k].second;
0165 edm::LogVerbatim("HGCalGeom") << "CalibCellRadiusHD " << phgp->calibCellRHD_;
0166 myPrint("CalibCellFullHD", phgp->calibCellFullHD_, 12);
0167 myPrint("CalibCellPartHD", phgp->calibCellPartHD_, 12);
0168 edm::LogVerbatim("HGCalGeom") << "CalibCellRadiusHD " << phgp->calibCellRLD_;
0169 myPrint("CalibCellFullLD", phgp->calibCellFullLD_, 12);
0170 myPrint("CalibCellPartLD", phgp->calibCellPartLD_, 12);
0171 myPrint("cassetteShift", phgp->cassetteShift_, 8);
0172
0173 edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
0174 if (phgp->waferMaskMode_ > 1) {
0175 edm::LogVerbatim("HGCalGeom") << "WaferInfo with " << phgp->waferInfoMap_.size() << " elements";
0176 unsigned int kk(0);
0177 std::unordered_map<int32_t, HGCalParameters::waferInfo>::const_iterator itr = phgp->waferInfoMap_.begin();
0178 for (; itr != phgp->waferInfoMap_.end(); ++itr, ++kk)
0179 edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "["
0180 << HGCalWaferIndex::waferLayer(itr->first) << ", "
0181 << HGCalWaferIndex::waferU(itr->first) << ", "
0182 << HGCalWaferIndex::waferV(itr->first) << "] (" << (itr->second).type << ", "
0183 << (itr->second).part << ", " << (itr->second).orient << ")";
0184 }
0185
0186 myPrint("slopeMin", phgp->slopeMin_, 10);
0187 myPrint("zFrontMin", phgp->zFrontMin_, 10);
0188 myPrint("rMinFront", phgp->rMinFront_, 10);
0189 myPrint("slopeTop", phgp->slopeTop_, 10);
0190 myPrint("zFrontTop", phgp->zFrontTop_, 10);
0191 myPrint("rMaxFront", phgp->rMaxFront_, 10);
0192 myPrint("zRanges", phgp->zRanges_, 10);
0193 myPrint("moduleBlS", phgp->moduleBlS_, 10);
0194 myPrint("moduleTlS", phgp->moduleTlS_, 10);
0195 myPrint("moduleHS", phgp->moduleHS_, 10);
0196 myPrint("moduleDzS", phgp->moduleDzS_, 10);
0197 myPrint("moduleAlphaS", phgp->moduleAlphaS_, 10);
0198 myPrint("moduleCellS", phgp->moduleCellS_, 10);
0199 myPrint("moduleBlR", phgp->moduleBlR_, 10);
0200 myPrint("moduleTlR", phgp->moduleTlR_, 10);
0201 myPrint("moduleHR", phgp->moduleHR_, 10);
0202 myPrint("moduleDzR", phgp->moduleDzR_, 10);
0203 myPrint("moduleAlphaR", phgp->moduleAlphaR_, 10);
0204 myPrint("moduleCellR", phgp->moduleCellR_, 10);
0205 myPrint("trformTranX", phgp->trformTranX_, 8);
0206 myPrint("trformTranY", phgp->trformTranY_, 8);
0207 myPrint("trformTranZ", phgp->trformTranZ_, 8);
0208 myPrint("trformRotXX", phgp->trformRotXX_, 10);
0209 myPrint("trformRotYX", phgp->trformRotYX_, 10);
0210 myPrint("trformRotZX", phgp->trformRotZX_, 10);
0211 myPrint("trformRotXY", phgp->trformRotXY_, 10);
0212 myPrint("trformRotYY", phgp->trformRotYY_, 10);
0213 myPrint("trformRotZY", phgp->trformRotZY_, 10);
0214 myPrint("trformRotXZ", phgp->trformRotXZ_, 10);
0215 myPrint("trformRotYZ", phgp->trformRotYZ_, 10);
0216 myPrint("trformRotZZ", phgp->trformRotZZ_, 10);
0217 myPrint("xLayerHex", phgp->xLayerHex_, 8);
0218 myPrint("yLayerHex", phgp->yLayerHex_, 8);
0219 myPrint("zLayerHex", phgp->zLayerHex_, 8);
0220 myPrint("rMinLayHex", phgp->rMinLayHex_, 8);
0221 myPrint("rMaxLayHex", phgp->rMaxLayHex_, 8);
0222 myPrint("waferPos", phgp->waferPosX_, phgp->waferPosY_, 4);
0223 myPrint("cellFineIndex", phgp->cellFineIndex_, 8);
0224 myPrint("cellFine", phgp->cellFineX_, phgp->cellFineY_, 4);
0225 myPrint("cellCoarseIndex", phgp->cellCoarseIndex_, 8);
0226 myPrint("cellCoarse", phgp->cellCoarseX_, phgp->cellCoarseY_, 4);
0227 myPrint("layer", phgp->layer_, 18);
0228 myPrint("layerIndex", phgp->layerIndex_, 18);
0229 myPrint("depth", phgp->depth_, 18);
0230 myPrint("depthIndex", phgp->depthIndex_, 18);
0231 myPrint("depthLayerF", phgp->depthLayerF_, 18);
0232 myPrint("waferCopy", phgp->waferCopy_, 10);
0233 myPrint("waferTypeL", phgp->waferTypeL_, 25);
0234 printTrform(phgp);
0235 myPrint("levelTop", phgp->levelT_, 10);
0236 printWaferType(phgp);
0237 } else {
0238
0239 edm::LogVerbatim("HGCalGeom") << "DetectorType: " << phgp->detectorType_;
0240 edm::LogVerbatim("HGCalGeom") << "UseSimWt: " << phgp->useSimWt_;
0241 edm::LogVerbatim("HGCalGeom") << "nCells_: " << phgp->nCellsFine_ << ":" << phgp->nCellsCoarse_;
0242 edm::LogVerbatim("HGCalGeom") << "MinTileZize: " << phgp->minTileSize_;
0243 edm::LogVerbatim("HGCalGeom") << "FirstLayer: " << phgp->firstLayer_;
0244 edm::LogVerbatim("HGCalGeom") << "FirstMixedLayer: " << phgp->firstMixedLayer_;
0245 edm::LogVerbatim("HGCalGeom") << "LayerOffset: " << phgp->layerOffset_;
0246 edm::LogVerbatim("HGCalGeom") << "mode_: " << phgp->mode_;
0247 edm::LogVerbatim("HGCalGeom") << "waferUVMax: " << phgp->waferUVMax_;
0248 edm::LogVerbatim("HGCalGeom") << "nSectors_: " << phgp->nSectors_;
0249 edm::LogVerbatim("HGCalGeom") << "nCells_: " << phgp->nCellsFine_ << ":" << phgp->nCellsCoarse_;
0250
0251 myPrint("CellSize", phgp->cellSize_, 10);
0252 myPrint("radiusMixBoundary", phgp->radiusMixBoundary_, 10);
0253 myPrint("nPhiBinBH", phgp->nPhiBinBH_, 18);
0254 myPrint("layerFrontBH", phgp->layerFrontBH_, 10);
0255 myPrint("LayerCenter", phgp->layerCenter_, 20);
0256 myPrint("rMinLayerBH", phgp->rMinLayerBH_, 10);
0257 myPrint("slopeMin", phgp->slopeMin_, 10);
0258 myPrint("zFrontMin", phgp->zFrontMin_, 10);
0259 myPrint("rMinFront", phgp->rMinFront_, 10);
0260 myPrint("radiusLayer[0]", phgp->radiusLayer_[0], 10);
0261 myPrint("radiusLayer[1]", phgp->radiusLayer_[1], 10);
0262 myPrint("iradMinBH", phgp->iradMinBH_, 20);
0263 myPrint("iradMaxBH", phgp->iradMaxBH_, 20);
0264 edm::LogVerbatim("HGCalGeom") << "MaskMode: " << phgp->waferMaskMode_;
0265 if (phgp->waferMaskMode_ > 1) {
0266 myPrint("tileRingR", phgp->tileRingR_, 4);
0267 myPrint("tileRingRange", phgp->tileRingRange_, 8);
0268 edm::LogVerbatim("HGCalGeom") << "TileInfo with " << phgp->tileInfoMap_.size() << " elements";
0269 unsigned int kk(0);
0270 std::unordered_map<int32_t, HGCalParameters::tileInfo>::const_iterator itr = phgp->tileInfoMap_.begin();
0271 for (; itr != phgp->tileInfoMap_.end(); ++itr, ++kk)
0272 edm::LogVerbatim("HGCalGeom") << "[" << kk << "] " << itr->first << "[" << HGCalTileIndex::tileLayer(itr->first)
0273 << ", " << HGCalTileIndex::tileRing(itr->first) << ", "
0274 << HGCalTileIndex::tilePhi(itr->first) << "] (" << (itr->second).type << ", "
0275 << (itr->second).sipm << std::hex << ", " << (itr->second).hex[0] << ", "
0276 << (itr->second).hex[1] << ", " << (itr->second).hex[2] << ", "
0277 << (itr->second).hex[3] << ")" << std::dec;
0278 }
0279
0280 myPrint("slopeTop", phgp->slopeTop_, 10);
0281 myPrint("zFrontTop", phgp->zFrontTop_, 10);
0282 myPrint("rMaxFront", phgp->rMaxFront_, 10);
0283 myPrint("zRanges", phgp->zRanges_, 10);
0284 myPrint("firstModule", phgp->firstModule_, 10);
0285 myPrint("lastModule", phgp->lastModule_, 10);
0286 myPrint("moduleBlS", phgp->moduleBlS_, 10);
0287 myPrint("moduleTlS", phgp->moduleTlS_, 10);
0288 myPrint("moduleHS", phgp->moduleHS_, 10);
0289 myPrint("moduleDzS", phgp->moduleDzS_, 10);
0290 myPrint("moduleAlphaS", phgp->moduleAlphaS_, 10);
0291 myPrint("moduleCellS", phgp->moduleCellS_, 10);
0292 myPrint("moduleBlR", phgp->moduleBlR_, 10);
0293 myPrint("moduleTlR", phgp->moduleTlR_, 10);
0294 myPrint("moduleHR", phgp->moduleHR_, 10);
0295 myPrint("moduleDzR", phgp->moduleDzR_, 10);
0296 myPrint("moduleAlphaR", phgp->moduleAlphaR_, 10);
0297 myPrint("moduleCellR", phgp->moduleCellR_, 9);
0298 myPrint("trformTranX", phgp->trformTranY_, 9);
0299 myPrint("trformTranY", phgp->trformTranY_, 9);
0300 myPrint("trformTranZ", phgp->trformTranZ_, 9);
0301 myPrint("trformRotXX", phgp->trformRotXX_, 10);
0302 myPrint("trformRotYX", phgp->trformRotYX_, 10);
0303 myPrint("trformRotZX", phgp->trformRotZX_, 10);
0304 myPrint("trformRotXY", phgp->trformRotXY_, 10);
0305 myPrint("trformRotYY", phgp->trformRotYY_, 10);
0306 myPrint("trformRotZY", phgp->trformRotZY_, 10);
0307 myPrint("trformRotXZ", phgp->trformRotXZ_, 10);
0308 myPrint("trformRotYZ", phgp->trformRotYZ_, 10);
0309 myPrint("trformRotZZ", phgp->trformRotZZ_, 10);
0310 myPrint("xLayerHex", phgp->xLayerHex_, 10);
0311 myPrint("yLayerHex", phgp->yLayerHex_, 10);
0312 myPrint("zLayerHex", phgp->zLayerHex_, 10);
0313 myPrint("rMinLayHex", phgp->rMinLayHex_, 9);
0314 myPrint("rMaxLayHex", phgp->rMaxLayHex_, 9);
0315 myPrint("layer", phgp->layer_, 18);
0316 myPrint("layerIndex", phgp->layerIndex_, 18);
0317 myPrint("depth", phgp->depth_, 18);
0318 myPrint("depthIndex", phgp->depthIndex_, 18);
0319 myPrint("depthLayerF", phgp->depthLayerF_, 18);
0320 printTrform(phgp);
0321 myPrint("levelTop", phgp->levelT_, 10);
0322 printWaferType(phgp);
0323 }
0324
0325 auto finish = std::chrono::high_resolution_clock::now();
0326 std::chrono::duration<double> elapsed = finish - start;
0327 edm::LogVerbatim("HGCalGeom") << "Elapsed time: " << elapsed.count() << " s";
0328 }
0329
0330 template <typename T>
0331 void HGCalParameterTester::myPrint(std::string const& s, std::vector<T> const& obj, int n) const {
0332 int k(0), kk(0);
0333 edm::LogVerbatim("HGCalGeom") << s << " with " << obj.size() << " elements with n " << n << ": 1000";
0334 std::ostringstream st1[1000];
0335 for (auto const& it : obj) {
0336 st1[kk] << it << ", ";
0337 ++k;
0338 if (k == n) {
0339 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0340 ++kk;
0341 k = 0;
0342 }
0343 }
0344 if (k > 0)
0345 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0346 }
0347
0348 template <typename T>
0349 void HGCalParameterTester::myPrint(std::string const& s, std::vector<std::pair<T, T> > const& obj, int n) const {
0350 int k(0), kk(0);
0351 edm::LogVerbatim("HGCalGeom") << s << " with " << obj.size() << " elements with n " << n << ":200";
0352 std::ostringstream st1[200];
0353 for (auto const& it : obj) {
0354 st1[kk] << "(" << it.first << ", " << it.second << ") ";
0355 ++k;
0356 if (k == n) {
0357 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0358 ++kk;
0359 k = 0;
0360 }
0361 }
0362 if (k > 0)
0363 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0364 }
0365
0366 void HGCalParameterTester::myPrint(std::string const& s,
0367 std::vector<double> const& obj1,
0368 std::vector<double> const& obj2,
0369 int n) const {
0370 int k(0), kk(0);
0371 std::ostringstream st1[250];
0372 edm::LogVerbatim("HGCalGeom") << s << " with " << obj1.size() << " elements with n " << n << ": 250";
0373 for (unsigned int k1 = 0; k1 < obj1.size(); ++k1) {
0374 st1[kk] << "(" << obj1[k1] << ", " << obj2[k1] << ") ";
0375 ++k;
0376 if (k == n) {
0377 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0378 ++kk;
0379 k = 0;
0380 }
0381 }
0382 if (k > 0)
0383 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0384 }
0385
0386 void HGCalParameterTester::myPrint(std::string const& s, HGCalParameters::wafer_map const& obj, int n) const {
0387 int k(0), kk(0);
0388 std::ostringstream st1[100];
0389 edm::LogVerbatim("HGCalGeom") << s << " with " << obj.size() << " elements with n " << n << ": 100";
0390 for (auto const& it : obj) {
0391 st1[kk] << it.first << ":" << it.second << ", ";
0392 ++k;
0393 if (k == n) {
0394 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0395 ++kk;
0396 k = 0;
0397 }
0398 }
0399 if (k > 0)
0400 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0401 }
0402
0403 void HGCalParameterTester::printTrform(HGCalParameters const* phgp) const {
0404 int k(0), kk(0);
0405 std::ostringstream st1[20];
0406 edm::LogVerbatim("HGCalGeom") << "TrformIndex with " << phgp->trformIndex_.size() << " elements with n 7:20";
0407 for (unsigned int i = 0; i < phgp->trformIndex_.size(); ++i) {
0408 std::array<int, 4> id = phgp->getID(i);
0409 st1[kk] << id[0] << ":" << id[1] << ":" << id[2] << ":" << id[3] << ", ";
0410 ++k;
0411 if (k == 7) {
0412 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0413 ++kk;
0414 k = 0;
0415 }
0416 }
0417 if (k > 0)
0418 edm::LogVerbatim("HGCalGeom") << st1[kk].str();
0419 }
0420
0421 void HGCalParameterTester::printWaferType(HGCalParameters const* phgp) const {
0422 int k(0);
0423 edm::LogVerbatim("HGCalGeom") << "waferTypes with " << phgp->waferTypes_.size() << " elements";
0424 std::map<std::pair<int, int>, int> kounts;
0425 std::map<std::pair<int, int>, int>::iterator itr;
0426 for (auto const& it : phgp->waferTypes_) {
0427 std::ostringstream st1;
0428 st1 << " [" << k << "] " << HGCalWaferIndex::waferLayer(it.first);
0429 if (HGCalWaferIndex::waferFormat(it.first)) {
0430 st1 << ":" << HGCalWaferIndex::waferU(it.first) << ":" << HGCalWaferIndex::waferV(it.first);
0431 } else {
0432 st1 << ":" << HGCalWaferIndex::waferCopy(it.first);
0433 }
0434 edm::LogVerbatim("HGCalGeom") << st1.str() << " ==> (" << (it.second).first << ":" << (it.second).second << ")";
0435 itr = kounts.find(it.second);
0436 if (itr == kounts.end())
0437 kounts[it.second] = 1;
0438 else
0439 ++(itr->second);
0440 ++k;
0441 }
0442 if (!kounts.empty()) {
0443 edm::LogVerbatim("HGCalGeom") << "Summary of waferTypes ==========================";
0444 for (itr = kounts.begin(); itr != kounts.end(); ++itr)
0445 edm::LogVerbatim("HGCalGeom") << "Type (" << (itr->first).first << ":" << (itr->first).second << ") Kount "
0446 << itr->second;
0447 }
0448 }
0449
0450 DEFINE_FWK_MODULE(HGCalParameterTester);