2323#include < sstream>
2424#include < string>
2525#include < vector>
26+ #include < cmath>
2627
2728// user include files
2829#include " FWCore/Framework/interface/Frameworkfwd.h"
4344#include " Geometry/Records/interface/IdealGeometryRecord.h"
4445#include " Geometry/HGCalCommonData/interface/HGCalCell.h"
4546#include " Geometry/HGCalCommonData/interface/HGCalWaferIndex.h"
46- #include " Geometry/HGCalGeometry/interface/HGCalGeometry.h"
4747
4848class HGCalTestDDDCons : public edm ::one::EDAnalyzer<edm::one::WatchRuns> {
4949public:
@@ -60,28 +60,21 @@ class HGCalTestDDDCons : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
6060private:
6161 const std::vector<std::string> nameDetectors_;
6262 const std::string fileName_;
63- // const edm::ESGetToken<HGCalGeometry, IdealGeometryRecord> geomToken_;
6463 const std::vector<edm::ESGetToken<HGCalDDDConstants, IdealGeometryRecord>> tok_hgcal_;
65- const std::vector<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>> geomToken_;
6664 int size;
6765 std::vector<const HGCalDDDConstants *> hgcCons_;
68- std::vector<const HGCalGeometry *> hgcGeo_;
6966 std::vector<std::pair<DetId, uint32_t >> detIds_;
7067 std::vector<double > xwafer_, ywafer_, xcell_, ycell_, xcellOff_, ycellOff_;
7168};
7269
7370HGCalTestDDDCons::HGCalTestDDDCons (const edm::ParameterSet &iC)
7471 : nameDetectors_(iC.getParameter<std::vector<std::string>>(" nameDetectors" )),
7572 fileName_(iC.getParameter<std::string>(" fileName" )),
76- // geomToken_{esConsumes<HGCalGeometry, IdealGeometryRecord>(edm::ESInputTag{"", "HGCalEESensitive"})},
7773 tok_hgcal_{
7874 edm::vector_transform (nameDetectors_,
7975 [this ](const std::string &name) {
8076 return esConsumes<HGCalDDDConstants, IdealGeometryRecord, edm::Transition::BeginRun>(
8177 edm::ESInputTag{" " , name});
82- })},
83- geomToken_{edm::vector_transform (nameDetectors_, [this ](const std::string &name) {
84- return esConsumes<HGCalGeometry, IdealGeometryRecord, edm::Transition::BeginRun>(edm::ESInputTag{" " , name});
8578 })} {
8679 std::ostringstream st1;
8780 for (const auto &name : nameDetectors_)
@@ -150,13 +143,11 @@ void HGCalTestDDDCons::beginRun(edm::Run const &iRun, edm::EventSetup const &iSe
150143 edm::LogVerbatim (" HGCGeom" ) << " Tries to initialize HGCalGeometry and HGCalDDDConstants for " << i << " :"
151144 << nameDetectors_[i];
152145 const edm::ESHandle<HGCalDDDConstants> &hgcCons = iSetup.getHandle (tok_hgcal_[i]);
153- const HGCalGeometry &hgcGeo = iSetup.getData (geomToken_[i]);
154146 if (hgcCons.isValid ()) {
155147 hgcCons_.push_back (hgcCons.product ());
156148 } else {
157149 edm::LogWarning (" HGCGeom" ) << " Cannot initiate HGCalDDDConstants for " << nameDetectors_[i] << std::endl;
158150 }
159- hgcGeo_.push_back (&hgcGeo);
160151 auto ii = std::find (names.begin (), names.end (), nameDetectors_[i]);
161152 if (ii != names.end ()) {
162153 uint32_t k = static_cast <uint32_t >(ii - names.begin ());
@@ -197,15 +188,15 @@ void HGCalTestDDDCons::beginRun(edm::Run const &iRun, edm::EventSetup const &iSe
197188 << " :" << cellxy_ncog.first << " ," << cellxy_ncog.second << " :" << cellxy_cog.first
198189 << " ," << cellxy_cog.second << " CellType:CellPosition " << cellType.second << " :"
199190 << cellType.first ;
200- if (sqrt (pow (waferxy.first + scale * xwafer_[k], 2 ) + pow (waferxy.second - scale * ywafer_[k], 2 )) > 0.01 ) {
191+ if (std:: sqrt (std:: pow (waferxy.first + scale * xwafer_[k], 2 ) + std:: pow (waferxy.second - scale * ywafer_[k], 2 )) > 0.01 ) {
201192 edm::LogVerbatim (" HGCGeom" ) << " Error wafer mismatch actual:observed (" << xwafer_[k] << " ," << ywafer_[k]
202193 << " ):(" << waferxy.first << " ," << waferxy.second << " ) " ;
203194 }
204- if (sqrt (pow (cellxy_ncog.first + scale * xcell_[k], 2 ) + pow (cellxy_ncog.second - scale * ycell_[k], 2 )) > 0.01 ) {
195+ if (std:: sqrt (std:: pow (cellxy_ncog.first + scale * xcell_[k], 2 ) + std:: pow (cellxy_ncog.second - scale * ycell_[k], 2 )) > 0.01 ) {
205196 edm::LogVerbatim (" HGCGeom" ) << " Error cell COG mismatch actual:observed (" << xcell_[k] << " ," << ycell_[k]
206197 << " ):(" << cellxy_ncog.first << " ," << cellxy_ncog.second << " ) " ;
207198 }
208- if (sqrt (pow (cellxy_cog.first + scale * xcellOff_[k], 2 ) + pow (cellxy_cog.second - scale * ycellOff_[k], 2 )) >
199+ if (std:: sqrt (std:: pow (cellxy_cog.first + scale * xcellOff_[k], 2 ) + std:: pow (cellxy_cog.second - scale * ycellOff_[k], 2 )) >
209200 0.01 ) {
210201 edm::LogVerbatim (" HGCGeom" ) << " Error cell center mismatch actual:observed (" << xcellOff_[k] << " ,"
211202 << ycellOff_[k] << " ):(" << cellxy_cog.first << " ," << cellxy_cog.second << " ) " ;
0 commit comments