Skip to content

Commit

Permalink
Do not hold refs into the extractors vector.
Browse files Browse the repository at this point in the history
The refs got invalid when the vector grows, which caused #14800.
  • Loading branch information
schneiml committed Jun 8, 2016
1 parent e5dd360 commit 5b03e23
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions DQM/SiPixelPhase1Common/src/GeometryInterface.cc
Expand Up @@ -212,7 +212,7 @@ void GeometryInterface::loadFromTopology(edm::EventSetup const& iSetup, const ed
addExtractor(intern("PXForward"), pxforward, 0, 0);

// Redefine the disk numbering to use the sign
auto& pxendcap = extractors[intern("PXEndcap")];
auto pxendcap = extractors[intern("PXEndcap")];
auto diskid = intern("PXDisk");
auto pxdisk = extractors[diskid];
extractors[diskid] = [pxdisk, pxendcap] (InterestingQuantities const& iq) {
Expand All @@ -228,8 +228,8 @@ void GeometryInterface::loadFromTopology(edm::EventSetup const& iSetup, const ed
assert(trackerGeometryHandle.isValid());

// We need to track some extra stuff here for the Shells later.
auto& pxlayer = extractors[intern("PXLayer")];
auto& pxladder = extractors[intern("PXLadder")];
auto pxlayer = extractors[intern("PXLayer")];
auto pxladder = extractors[intern("PXLadder")];
std::vector<Value> maxladders;

// Now travrse the detector and collect whatever we need.
Expand Down Expand Up @@ -260,7 +260,7 @@ void GeometryInterface::loadFromTopology(edm::EventSetup const& iSetup, const ed
// of the code, but it might work for Phase0 as well.
Value innerring = iConfig.getParameter<int>("n_inner_ring_blades");
Value outerring = max_value[intern("PXBlade")] - innerring;
auto& pxblade = extractors[intern("PXBlade")];
auto pxblade = extractors[intern("PXBlade")];
addExtractor(intern("PXRing"),
[pxblade, innerring] (InterestingQuantities const& iq) {
auto blade = pxblade(iq);
Expand All @@ -270,7 +270,7 @@ void GeometryInterface::loadFromTopology(edm::EventSetup const& iSetup, const ed
}, 1, 2
);

auto& pxmodule = extractors[intern("PXBModule")];
auto pxmodule = extractors[intern("PXBModule")];
Value maxmodule = max_value[intern("PXBModule")];
addExtractor(intern("HalfCylinder"),
[pxendcap, pxblade, innerring, outerring] (InterestingQuantities const& iq) {
Expand Down

0 comments on commit 5b03e23

Please sign in to comment.