Skip to content

Commit 2d878df

Browse files
authored
Merge pull request #48166 from bsunanda/Phase2-hgx364A
Phase2-hgx364A Update some of the tests in Geometry/HGCalGeometry/test to estimate the errors correctly
2 parents 9cbc5f7 + 56755fb commit 2d878df

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

DataFormats/ForwardDetId/interface/HGCScintillatorDetId.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class HGCScintillatorDetId : public DetId {
163163
static constexpr int kHGCalTypeOffset = 26;
164164
static constexpr int kHGCalTypeMask = 0x3;
165165
static constexpr int kHGCalTypeMask0 = 0xF3FFFFFF;
166-
static constexpr int kHGCalPositionMask = 0xF2FFFFFF;
166+
static constexpr uint32_t kHGCalPositionMask = 0xF13FFFFF;
167167

168168
constexpr int iradiusTriggerAbs() const {
169169
if (trigger())

Geometry/HGCalGeometry/test/HGCalGeometryTester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ void HGCalGeometryTester::doTestScint(const HGCalGeometry* geom, DetId::Detector
193193
GlobalPoint global1 = geom->getPosition(id1);
194194
DetId idc1 = geom->getClosestCell(global1);
195195
GlobalPoint global2 = geom->getPosition(idc1);
196-
std::string cherr = (id1.rawId() != idc1.rawId()) ? " ***** ERROR *****" : "";
196+
std::string cherr = (detId.position() != HGCScintillatorDetId(idc1).position()) ? " ***** ERROR *****" : "";
197197
edm::LogVerbatim("HGCalGeomX")
198198
<< "DetId (" << det << ":" << zside << ":" << type << ":" << layer << ":" << ieta << ":" << iphi
199199
<< ") Geom " << icell1 << " position (" << global1.x() << ", " << global1.y() << ", " << global1.z()

Geometry/HGCalGeometry/test/HGCalSizeTester.cc

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,15 @@ void HGCalSizeTester::doTestScint(const HGCalGeometry* geom, DetId::Detector det
129129
auto icell1 = geom->getGeometry(id1);
130130
GlobalPoint global1 = geom->getPosition(id1);
131131
DetId idc1 = geom->getClosestCell(global1);
132-
std::pair<int, int> typm = geom->topology().dddConstants().tileType(layer, ieta, iphi);
133-
if (typm.first >= 0) {
134-
HGCScintillatorDetId detId(id1);
135-
detId.setType(typm.first);
136-
detId.setSiPM(typm.second);
137-
id1 = static_cast<DetId>(detId);
138-
}
139132
HGCScintillatorDetId detId(idc1);
140-
typm = geom->topology().dddConstants().tileType(detId.layer(), detId.ring(), detId.iphi());
141-
if (typm.first >= 0) {
142-
detId.setType(typm.first);
143-
detId.setSiPM(typm.second);
144-
idc1 = static_cast<DetId>(detId);
145-
}
146-
std::string cherr = (id1.rawId() != idc1.rawId()) ? "***** ERROR *****" : "";
133+
std::string cherr = ((detId.position() != HGCScintillatorDetId(id1).position())) ? "***** ERROR *****" : "";
147134
edm::LogVerbatim("HGCalGeomX")
148135
<< "DetId (" << det << ":" << zside << ":" << type << ":" << layer << ":" << ieta << ":" << iphi
149136
<< ") Geom " << icell1 << " position (" << global1.x() << ", " << global1.y() << ", " << global1.z()
150137
<< ") ids " << std::hex << id1.rawId() << ":" << idc1.rawId() << std::dec << ":"
151138
<< HGCScintillatorDetId(id1) << ":" << HGCScintillatorDetId(idc1)
152-
<< " parameter[11] = " << icell1->param()[10] << ":" << icell1->param()[10] << cherr;
139+
<< " parameter[11] = " << icell1->param()[10] << ":" << icell1->param()[10] << cherr << " " << std::hex
140+
<< detId.position() << " " << HGCScintillatorDetId(id1).position() << std::dec;
153141
std::vector<GlobalPoint> corners = geom->getNewCorners(idc1);
154142
std::ostringstream st1;
155143
st1 << corners.size() << " corners";

0 commit comments

Comments
 (0)