diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc index a576d20e22aa0..a8fce63123f6a 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileCheck.cc @@ -27,11 +27,10 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" @@ -58,7 +57,7 @@ HGCalWaferInFileCheck::HGCalWaferInFileCheck(const edm::ParameterSet& iC) : nameSense_(iC.getParameter("NameSense")), nameDetector_(iC.getParameter("NameDevice")), geomToken_(esConsumes(edm::ESInputTag{"", nameSense_})) { - std::cout << "Test numbering for " << nameDetector_ << " using constants of " << nameSense_ << std::endl; + edm::LogVerbatim("HGCalGeom") << "Test numbering for " << nameDetector_ << " using constants of " << nameSense_; } void HGCalWaferInFileCheck::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -74,7 +73,8 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe const HGCalGeometry* geom = &geomR; const auto& hgdc = geom->topology().dddConstants(); - std::cout << nameDetector_ << "\nCheck Wafers in file are all valid for " << nameDetector_ << "\n\n"; + edm::LogVerbatim("HGCalGeom") << nameDetector_ << "\nCheck Wafers in file are all valid for " << nameDetector_ + << "\n"; if (hgdc.waferHexagon8()) { DetId::Detector det = (nameSense_ == "HGCalHESiliconSensitive") ? DetId::HGCalHSi : DetId::HGCalEE; static std::vector types = {"F", "b", "g", "gm", "a", "d", "dm", "c", "am", "bm", "X"}; @@ -91,20 +91,21 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe int part = std::get<1>(hgdc.waferFileInfoFromIndex(indx)); std::string typex = (part < static_cast(types.size())) ? types[part] : "X"; const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " - << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") not valid" << std::endl; + edm::LogVerbatim("HGCalGeom") << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU + << ", " << waferV << ", " << typex << ") at (" << std::setprecision(4) << xy.first + << ", " << xy.second << ", " << hgdc.waferZ(layer, true) << ") not valid"; ++bad1; } } - std::cout << "\n\nFinds " << bad1 << " invalid wafers among " << hgdc.waferFileSize() << " wafers in the list\n\n"; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << bad1 << " invalid wafers among " << hgdc.waferFileSize() + << " wafers in the list\n"; // See if some of the valid wafers are missing auto const& ids = geom->getValidGeomDetIds(); int all(0), bad2(0), xtra(0); for (unsigned int k = 0; k < ids.size(); ++k) { HGCSiliconDetId id(ids[k]); - if (id.zside() == 1) { + if ((ids[k].rawId() != 0) && (id.zside() == 1)) { ++all; int indx = HGCalWaferIndex::waferIndex(id.layer(), id.waferU(), id.waferV()); if (!hgdc.waferFileInfoExist(indx)) { @@ -112,9 +113,10 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe if (part != HGCalTypes::WaferOut) { std::string typex = (part < static_cast(types.size())) ? types[part] : "X"; const auto& xy = hgdc.waferPosition(id.layer(), id.waferU(), id.waferV(), true, false); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + id.layer()) << ", " << id.waferU() << ", " - << id.waferV() << ", " << typex << ") at (" << std::setprecision(4) << xy.first << ", " - << xy.second << ", " << hgdc.waferZ(id.layer(), true) << ") not in wafer-list" << std::endl; + edm::LogVerbatim("HGCalGeom") + << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + id.layer()) << ", " << id.waferU() << ", " + << id.waferV() << ", " << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second + << ", " << hgdc.waferZ(id.layer(), true) << ") not in wafer-list"; ++bad2; } else { ++xtra; @@ -122,8 +124,8 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe } } } - std::cout << "\n\nFinds " << bad2 << " missing wafers among " << all << " valid wafers and " << xtra - << " extra ones\n\n"; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << bad2 << " missing wafers among " << all << " valid wafers and " + << xtra << " extra ones\n"; // Now cross check the content int allG(0), badT(0), badP(0), badP2(0), badR(0), badG(0), badT1(0), badT2(0); @@ -162,16 +164,18 @@ void HGCalWaferInFileCheck::analyze(const edm::Event& iEvent, const edm::EventSe std::string partx1 = (part1 < static_cast(types.size())) ? types[part1] : "X"; std::string partx2 = (part2 < static_cast(types.size())) ? types[part2] : "X"; const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV - << ", " << type1 << ":" << type2 << ", " << partx1 << ":" << partx2 << ", " << rotn1 << ":" << rotn2 - << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") failure flag " << typeOK << ":" << partOK << ":" << rotnOK << ":" - << (part1 >= part2) << std::endl; + edm::LogVerbatim("HGCalGeom") << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU + << ", " << waferV << ", " << type1 << ":" << type2 << ", " << partx1 << ":" + << partx2 << ", " << rotn1 << ":" << rotn2 << ") at (" << std::setprecision(4) + << xy.first << ", " << xy.second << ", " << hgdc.waferZ(layer, true) + << ") failure flag " << typeOK << ":" << partOK << ":" << rotnOK << ":" + << (part1 >= part2); } } } - std::cout << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 << "]:" << badP << ":" << badP2 - << ":" << badR << ") mismatch among " << allG << " wafers with the same indices\n\n"; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << badG << " (" << badT << "[" << badT1 << ":" << badT2 + << "]:" << badP << ":" << badP2 << ":" << badR << ") mismatch among " << allG + << " wafers with the same indices"; } } diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileOrientation.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileOrientation.cc new file mode 100644 index 0000000000000..4e19b0aad3cad --- /dev/null +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileOrientation.cc @@ -0,0 +1,132 @@ +// -*- C++ -*- +// +// Package: HGCalWaferInFileOrientation +// Class: HGCalWaferInFileOrientation +// +/**\class HGCalWaferInFileOrientation HGCalWaferInFileOrientation.cc + test/HGCalWaferInFileOrientation.cc + + Description: + + Implementation: + +*/ +// +// Original Author: Sunanda Banerjee +// Created: Mon 2021/10/07 +// +// + +// system include files +#include +#include +#include +#include +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/one/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" +#include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h" +#include "Geometry/HGCalCommonData/interface/HGCalWaferIndex.h" +#include "Geometry/Records/interface/IdealGeometryRecord.h" + +class HGCalWaferInFileOrientation : public edm::one::EDAnalyzer { +public: + explicit HGCalWaferInFileOrientation(const edm::ParameterSet&); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + void beginRun(edm::Run const&, edm::EventSetup const&) override; + void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {} + void endRun(edm::Run const&, edm::EventSetup const&) override {} + +private: + const std::string nameDetector_; + const edm::ESGetToken geomToken_; + const std::vector layers_; + const std::vector waferU_, waferV_, types_; +}; + +HGCalWaferInFileOrientation::HGCalWaferInFileOrientation(const edm::ParameterSet& iC) + : nameDetector_(iC.getParameter("detectorName")), + geomToken_(esConsumes( + edm::ESInputTag{"", nameDetector_})), + layers_(iC.getParameter>("layers")), + waferU_(iC.getParameter>("waferUs")), + waferV_(iC.getParameter>("waferVs")), + types_(iC.getParameter>("types")) { + edm::LogVerbatim("HGCalGeom") << "Test Orientation for " << layers_.size() << " ID's in " << nameDetector_; +} + +void HGCalWaferInFileOrientation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + std::vector layer = {33, 33, 33, 33, 33, 33}; + std::vector waferU = {12, 12, -3, -3, -9, -9}; + std::vector waferV = {3, 9, 9, -12, 3, -12}; + std::vector type = {2, 2, 2, 2, 2, 2}; + desc.add("detectorName", "HGCalHESiliconSensitive"); + desc.add>("layers", layer); + desc.add>("waferUs", waferU); + desc.add>("waferVs", waferV); + desc.add>("types", type); + descriptions.add("hgcalWaferInFileOrientation", desc); +} + +void HGCalWaferInFileOrientation::beginRun(edm::Run const&, edm::EventSetup const& iSetup) { + const auto& geomR = iSetup.getData(geomToken_); + const HGCalGeometry* geom = &geomR; + const auto& hgdc = geom->topology().dddConstants(); + + edm::LogVerbatim("HGCalGeom") << "Check Wafer orientations in file for " << nameDetector_ << "\n"; + if (hgdc.waferHexagon8()) { + DetId::Detector det = (nameDetector_ == "HGCalHESiliconSensitive") ? DetId::HGCalHSi : DetId::HGCalEE; + static std::vector types = {"F", "b", "g", "gm", "a", "d", "dm", "c", "am", "bm", "X"}; + int allG(0), badP(0), badR(0), badG(0); + int layerOff = hgdc.getLayerOffset(); + for (unsigned int k = 0; k < layers_.size(); ++k) { + int layer = layers_[k] - layerOff; + int indx = HGCalWaferIndex::waferIndex(layer, waferU_[k], waferV_[k]); + int part1 = std::get<1>(hgdc.waferFileInfoFromIndex(indx)); + int rotn1 = std::get<2>(hgdc.waferFileInfoFromIndex(indx)); + HGCSiliconDetId id(det, 1, types_[k], layer, waferU_[k], waferV_[k], 0, 0); + if (geom->topology().validModule(id, 3)) { + ++allG; + int part2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).first; + int rotn2 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), false, false).second; + int part3 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), true, false).first; + int rotn3 = hgdc.waferTypeRotation(id.layer(), id.waferU(), id.waferV(), true, false).second; + bool partOK = (part1 == part2); + bool rotnOK = (rotn1 == rotn2); + if (!partOK) + ++badP; + if (!rotnOK) + ++badR; + if ((!partOK) || (!rotnOK)) { + ++badG; + std::string partx1 = (part1 < static_cast(types.size())) ? types[part1] : "X"; + std::string partx2 = (part2 < static_cast(types.size())) ? types[part2] : "X"; + std::string partx3 = (part3 < static_cast(types.size())) ? types[part3] : "X"; + const auto& xy = hgdc.waferPosition(layer, waferU_[k], waferV_[k], true, false); + edm::LogVerbatim("HGCalGeom") << "ID[" << k << "]: " << id << " (" << partx1 << ":" << partx2 << ":" << partx3 + << ", " << rotn1 << ":" << rotn2 << ":" << rotn3 << ") at (" + << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << hgdc.waferZ(layer, true) << ") failure flag " << partOK << ":" << rotnOK; + } + } + } + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << badG << " (" << badP << ":" << badR << ") mismatch among " << allG + << ":" << layers_.size() << " wafers\n"; + } +} + +// define this as a plug-in +DEFINE_FWK_MODULE(HGCalWaferInFileOrientation); diff --git a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc index 110269b9b7e51..4977f0e41ab18 100644 --- a/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc +++ b/Geometry/HGCalGeometry/test/HGCalWaferInFileTest.cc @@ -18,20 +18,17 @@ // // system include files -#include -#include -#include +#include #include #include // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/one/EDAnalyzer.h" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" - +#include "FWCore/MessageLogger/interface/MessageLogger.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" @@ -76,8 +73,8 @@ HGCalWaferInFileTest::HGCalWaferInFileTest(const edm::ParameterSet& iC) nameDetector_(iC.getParameter("NameDevice")), verbosity_(iC.getParameter("Verbosity")), geomToken_(esConsumes(edm::ESInputTag{"", nameSense_})) { - std::cout << "Test wafer characteristics for " << nameDetector_ << " using constants of " << nameSense_ - << " with verbosity " << verbosity_ << std::endl; + edm::LogVerbatim("HGCalGeom") << "Test wafer characteristics for " << nameDetector_ << " using constants of " + << nameSense_ << " with verbosity " << verbosity_; } void HGCalWaferInFileTest::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { @@ -96,7 +93,8 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet double delX = 0.5 * hgdc.getParameter()->waferSize_; double delY = 2.0 * delX / std::sqrt(3.0); - std::cout << nameDetector_ << "\nCheck Wafers in file are all valid for " << nameDetector_ << std::endl << std::endl; + edm::LogVerbatim("HGCalGeom") << nameDetector_ << "\nCheck Wafers in file are all valid for " << nameDetector_ + << std::endl; if (hgdc.waferHexagon8()) { DetId::Detector det = (nameSense_ == "HGCalHESiliconSensitive") ? DetId::HGCalHSi : DetId::HGCalEE; static std::vector types = {"F", "b", "g", "gm", "a", "d", "dm", "c", "am", "bm", "X"}; @@ -119,26 +117,28 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet const auto& rr = hgdc.rangeRLayer(layer, true); auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); auto rpos = getCorners(xy.first, xy.second, delX, delY); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " - << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " - << hgdc.waferZ(layer, true) << ") not present with " << points.size() << " points:"; + std::ostringstream st1; + st1 << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << ", " + << typex << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << hgdc.waferZ(layer, true) << ") not present with " << points.size() << " points:"; for (auto point : points) - std::cout << " " << point; - std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; + st1 << " " << point; + st1 << " in the region " << rr.first << ":" << rr.second << " Corners"; for (auto point : rpos) - std::cout << " " << point; - std::cout << std::endl; + st1 << " " << point; + edm::LogVerbatim("HGCalGeom") << st1.str(); ++bad1; if ((layer - layerf) < layers) ++miss[layer - layerf]; } } - std::cout << "\n\nFinds " << bad1 << " invalid wafers among " << hgdc.waferFileSize() << " wafers in the list\n"; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << bad1 << " invalid wafers among " << hgdc.waferFileSize() + << " wafers in the list"; for (unsigned int k = 0; k < miss.size(); ++k) { if (miss[k] > 0) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << miss[k] << std::endl; + edm::LogVerbatim("HGCalGeom") << "Layer[" << k << ":" << (layerf + k) << "] " << miss[k]; } - std::cout << std::endl; + edm::LogVerbatim("HGCalGeom") << std::endl; // Now cross check the content (first type only) int allG(0), badT(0), badT1(0), badT2(0); @@ -160,14 +160,15 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet else if (type2 == 0) ++badT2; const auto& xy = hgdc.waferPosition(layer, waferU, waferV, true, false); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV - << ", " << type1 << ":" << type2 << ") at (" << std::setprecision(4) << xy.first << ", " - << xy.second << ", " << hgdc.waferZ(layer, true) << ") failure flag " << typeOK << std::endl; + edm::LogVerbatim("HGCalGeom") << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU + << ", " << waferV << ", " << type1 << ":" << type2 << ") at (" + << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << hgdc.waferZ(layer, true) << ") failure flag " << typeOK; } } } - std::cout << "\n\nFinds " << badT << "[" << badT1 << ":" << badT2 << "] mismatch in type among " << allG - << " wafers with the same indices\n\n"; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << badT << "[" << badT1 << ":" << badT2 << "] mismatch in type among " + << allG << " wafers with the same indices\n"; // Now cross check the content (partial and orientation) int allX(0), badG(0), badP(0), badP2(0), badR(0), badR2(0); @@ -224,30 +225,31 @@ void HGCalWaferInFileTest::analyze(const edm::Event& iEvent, const edm::EventSet std::string partx2 = (part2 < static_cast(types.size())) ? types[part2] : "X"; auto points = getPoints(xy.first, xy.second, delX, delY, rr.first, rr.second, layer, waferU, waferV); auto rpos = getCorners(xy.first, xy.second, delX, delY); - std::cout << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV - << "," << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " - << rotn1 << ":" << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second - << ", " << hgdc.waferZ(layer, true) << ") failure flags (part = " << partOK << ":" << partOK2 - << " rotn " << rotnOK << ":" << rotnOK2 << " at " << miss << " with " << points.size() - << " points:"; + std::ostringstream st1; + st1 << "ID[" << k << "]: (" << (hgdc.getLayerOffset() + layer) << ", " << waferU << ", " << waferV << "," + << type2 << ", " << partx1 << ":" << partx2 << ":" << part1 << ":" << part2 << ", " << rotn1 << ":" + << rotn2 << ") at (" << std::setprecision(4) << xy.first << ", " << xy.second << ", " + << hgdc.waferZ(layer, true) << ") failure flags (part = " << partOK << ":" << partOK2 << " rotn " + << rotnOK << ":" << rotnOK2 << " at " << miss << " with " << points.size() << " points:"; for (auto point : points) - std::cout << " " << point; - std::cout << " in the region " << rr.first << ":" << rr.second << " Corners"; + st1 << " " << point; + st1 << " in the region " << rr.first << ":" << rr.second << " Corners"; for (auto point : rpos) - std::cout << " " << point; - std::cout << std::endl; + st1 << " " << point; + edm::LogVerbatim("HGCalGeom") << st1.str(); } } } } - std::cout << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ":" << badR2 - << ") mismatch in partial|orientation among " << allX << " wafers with the same indices" << std::endl; + edm::LogVerbatim("HGCalGeom") << "\n\nFinds " << badG << " (" << badP << ":" << badP2 << ":" << badR << ":" << badR2 + << ") mismatch in partial|orientation among " << allX + << " wafers with the same indices"; for (int k = 0; k < layers; ++k) { if ((wrongP[k] > 0) || (wrongR[k] > 0)) - std::cout << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] << ":" << wrongR[k] - << ":" << wrongR2[k] << std::endl; + edm::LogVerbatim("HGCalGeom") << "Layer[" << k << ":" << (layerf + k) << "] " << wrongP[k] << ":" << wrongP2[k] + << ":" << wrongR[k] << ":" << wrongR2[k]; } - std::cout << std::endl; + edm::LogVerbatim("HGCalGeom") << std::endl; } } @@ -280,8 +282,9 @@ std::vector HGCalWaferInFileTest::getPoints( } } if (verbosity_ > 1) - std::cout << "I/p " << layer << ":" << waferU << ":" << waferV << ":" << xpos << ":" << ypos << ":" << delX << ":" - << delY << ":" << rin << ":" << rout << " Corners " << ncor << " iok " << iok << std::endl; + edm::LogVerbatim("HGCalGeom") << "I/p " << layer << ":" << waferU << ":" << waferV << ":" << xpos << ":" << ypos + << ":" << delX << ":" << delY << ":" << rin << ":" << rout << " Corners " << ncor + << " iok " << iok; static const int parts = 3; static const std::string c1[parts] = {"A1", "A2", "A3"}; @@ -719,8 +722,9 @@ std::pair HGCalWaferInFileTest::getPoints(double xpos, } } if (verbosity_ > 1) - std::cout << "I/p " << layer << ":" << waferU << ":" << waferV << ":" << xpos << ":" << ypos << ":" << delX << ":" - << delY << ":" << rin << ":" << rout << " Results " << ok << " point " << point << std::endl; + edm::LogVerbatim("HGCalGeom") << "I/p " << layer << ":" << waferU << ":" << waferV << ":" << xpos << ":" << ypos + << ":" << delX << ":" << delY << ":" << rin << ":" << rout << " Results " << ok + << " point " << point; return std::make_pair(ok, point); } diff --git a/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileCheck_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileCheck_cfg.py index bac9bf4576522..603fcab1063f5 100644 --- a/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileCheck_cfg.py +++ b/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileCheck_cfg.py @@ -3,9 +3,15 @@ process = cms.Process("PROD",Phase2C11) process.load("SimGeneral.HepPDTESSource.pdt_cfi") -process.load("Geometry.HGCalCommonData.testHGCalV14XML_cfi") -process.load("Geometry.HGCalCommonData.hgcalParametersInitialization_cfi") +process.load("Geometry.HGCalCommonData.testHGCalV16XML_cfi") +process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cff") +process.load("Geometry.EcalCommonData.ecalSimulationParameters_cff") +process.load("Geometry.HcalCommonData.hcalDDDSimConstants_cff") +process.load("Geometry.HGCalCommonData.hgcalV15ParametersInitialization_cfi") process.load("Geometry.HGCalCommonData.hgcalNumberingInitialization_cfi") +process.load("Geometry.MuonNumbering.muonGeometryConstants_cff") +process.load("Geometry.MuonNumbering.muonOffsetESProducer_cff") +process.load("Geometry.MTDNumberingBuilder.mtdNumberingGeometry_cff") process.load("Geometry.CaloEventSetup.HGCalV9Topology_cfi") process.load("Geometry.HGCalGeometry.HGCalGeometryESProducer_cfi") process.load("Geometry.HGCalGeometry.hgcalEEWaferInFileCheck_cfi") diff --git a/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileOrientation_cfg.py b/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileOrientation_cfg.py new file mode 100644 index 0000000000000..bfee2b3dba713 --- /dev/null +++ b/Geometry/HGCalGeometry/test/python/testHGCalWaferInFileOrientation_cfg.py @@ -0,0 +1,37 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Phase2C11I13M9_cff import Phase2C11I13M9 +process = cms.Process('PROD',Phase2C11I13M9) +process.load('Configuration.Geometry.GeometryExtended2026D86Reco_cff') +process.load("SimGeneral.HepPDTESSource.pdt_cfi") +process.load('Geometry.HGCalGeometry.hgcalWaferInFileOrientation_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') + +if hasattr(process,'MessageLogger'): + process.MessageLogger.HGCalGeom=dict() + +process.load("IOMC.RandomEngine.IOMC_cff") +process.RandomNumberGeneratorService.generator.initialSeed = 456789 + +process.source = cms.Source("EmptySource") + +process.generator = cms.EDProducer("FlatRandomEGunProducer", + PGunParameters = cms.PSet( + PartID = cms.vint32(14), + MinEta = cms.double(-3.5), + MaxEta = cms.double(3.5), + MinPhi = cms.double(-3.14159265359), + MaxPhi = cms.double(3.14159265359), + MinE = cms.double(9.99), + MaxE = cms.double(10.01) + ), + AddAntiParticle = cms.bool(False), + Verbosity = cms.untracked.int32(0), + firstRun = cms.untracked.uint32(1) +) + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(1) +) + +process.p1 = cms.Path(process.generator*process.hgcalWaferInFileOrientation)