Skip to content

Commit

Permalink
Merge pull request #34824 from iarspider/patch-5
Browse files Browse the repository at this point in the history
[GCC11] Fix "this pointer is null" in class FWRecoGeometryESProducer of Fireworks/Geometry
  • Loading branch information
cmsbuild authored Aug 12, 2021
2 parents 0bfad9d + 92f2c79 commit 46ba54d
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions Fireworks/Geometry/src/FWRecoGeometryESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,36 +60,38 @@ void FWRecoGeometryESProducer::ADD_PIXEL_TOPOLOGY(unsigned int rawid,
using Phase2TrackerGeomDetUnit = PixelGeomDetUnit;
using Phase2TrackerTopology = PixelTopology;

#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit) \
const StripGeomDetUnit* det = dynamic_cast<const StripGeomDetUnit*>(detUnit); \
if (det) { \
if (const StripTopology* topo = dynamic_cast<const StripTopology*>(&det->specificTopology())) { \
fwRecoGeometry.idToName[rawid].topology[0] = 0; \
fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \
fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \
} else if (const RadialStripTopology* rtop = \
dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 1; \
fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \
fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \
fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \
fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \
} else if (dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 2; \
fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
} else if (dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 3; \
fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
} \
} else { \
const Phase2TrackerGeomDetUnit* det = dynamic_cast<const Phase2TrackerGeomDetUnit*>(detUnit); \
if (det) { \
if (const Phase2TrackerTopology* topo = \
dynamic_cast<const Phase2TrackerTopology*>(&(det->specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \
fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second; \
} \
} \
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit) \
const StripGeomDetUnit* det = dynamic_cast<const StripGeomDetUnit*>(detUnit); \
if (det) { \
if (const StripTopology* topo = dynamic_cast<const StripTopology*>(&det->specificTopology())) { \
fwRecoGeometry.idToName[rawid].topology[0] = 0; \
fwRecoGeometry.idToName[rawid].topology[1] = topo->nstrips(); \
fwRecoGeometry.idToName[rawid].topology[2] = topo->stripLength(); \
} else if (const RadialStripTopology* rtop = \
dynamic_cast<const RadialStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 1; \
fwRecoGeometry.idToName[rawid].topology[3] = rtop->yAxisOrientation(); \
fwRecoGeometry.idToName[rawid].topology[4] = rtop->originToIntersection(); \
fwRecoGeometry.idToName[rawid].topology[5] = rtop->phiOfOneEdge(); \
fwRecoGeometry.idToName[rawid].topology[6] = rtop->angularWidth(); \
} else if (const RectangularStripTopology* topo = \
dynamic_cast<const RectangularStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 2; \
fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
} else if (const TrapezoidalStripTopology* topo = \
dynamic_cast<const TrapezoidalStripTopology*>(&(det->specificType().specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = 3; \
fwRecoGeometry.idToName[rawid].topology[3] = topo->pitch(); \
} \
} else { \
const Phase2TrackerGeomDetUnit* det = dynamic_cast<const Phase2TrackerGeomDetUnit*>(detUnit); \
if (det) { \
if (const Phase2TrackerTopology* topo = \
dynamic_cast<const Phase2TrackerTopology*>(&(det->specificTopology()))) { \
fwRecoGeometry.idToName[rawid].topology[0] = topo->pitch().first; \
fwRecoGeometry.idToName[rawid].topology[1] = topo->pitch().second; \
} \
} \
}

namespace {
Expand Down

0 comments on commit 46ba54d

Please sign in to comment.