55 const auto& regionDoublets = *hdoublets;
60 <<
"MultiHitFromChi2EDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 3, got "
62 <<
". This is likely caused by a configuration error of this module, HitPairEDProducer, or "
63 "SeedingLayersEDProducer.";
67 if (regionDoublets.empty()) {
79 std::vector<std::unique_ptr<BaseTrackerRecHit> > refittedHitStorage;
82 LogDebug(
"MultiHitFromChi2EDProducer") <<
"Creating multihits for " << regionDoublets.regionSize() <<
" regions, and "
83 << trilayers.size() <<
" pair+3rd layers from "
84 << regionDoublets.layerPairsSize() <<
" layer pairs";
87 for (
const auto& regionLayerPairs : regionDoublets) {
94 hitCache.
extend(regionLayerPairs.layerHitMapCache());
96 LogTrace(
"MultiHitFromChi2EDProducer") <<
" starting region";
98 for (
const auto& layerPair : regionLayerPairs) {
99 LogTrace(
"MultiHitFromChi2EDProducer")
100 <<
" starting layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex();
103 return a.first[0].index() == layerPair.innerLayerIndex() &&
a.first[1].index() == layerPair.outerLayerIndex();
105 if (
found == trilayers.end()) {
106 auto exp =
cms::Exception(
"LogicError") <<
"Did not find the layer pair from vector<pair+third layers>. This "
107 "is a sign of some internal inconsistency\n";
108 exp <<
"I was looking for layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex()
109 <<
". Triplets have the following pairs:\n";
110 for (
const auto&
a : trilayers) {
111 exp <<
" " <<
a.first[0].index() <<
"," <<
a.first[1].index() <<
": 3rd layers";
112 for (
const auto&
b :
a.second) {
113 exp <<
" " <<
b.index();
119 const auto& thirdLayers =
found->second;
122 region, multihits,
iEvent, iSetup, layerPair.doublets(), thirdLayers, hitCache, refittedHitStorage);
125 LogTrace(
"MultiHitFromChi2EDProducer")
126 <<
" created " << multihits.
size() <<
" multihits for layer pair " << layerPair.innerLayerIndex() <<
","
127 << layerPair.outerLayerIndex() <<
" and 3rd layers";
128 for (
const auto&
l : thirdLayers) {
129 LogTrace(
"MultiHitFromChi2EDProducer") <<
" " <<
l.index();
134 seedingHitSetsFiller.emplace_back(hitSet);
141 auto storage = std::make_unique<edm::OwnVector<BaseTrackerRecHit> >();
142 storage->reserve(refittedHitStorage.size());
143 for (
auto& ptr : refittedHitStorage)
144 storage->push_back(ptr.release());
147 storage->shrink_to_fit();