37 produces<RegionsSeedingHitSets>();
38 produces<edm::OwnVector<BaseTrackerRecHit> >();
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();
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
unsigned int size() const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~MultiHitFromChi2EDProducer() override=default
#define DEFINE_FWK_MODULE(type)
static RegionFiller dummyFiller()
void initES(const edm::EventSetup &es) override
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::pair< LayerSet, std::vector< Layer > > LayerSetAndLayers
edm::RunningAverage localRA_
MultiHitGeneratorFromChi2 generator_
void hitSets(const TrackingRegion ®ion, OrderedMultiHits &trs, const edm::Event &ev, const edm::EventSetup &es, SeedingLayerSetsHits::SeedingLayerSet pairLayers, std::vector< SeedingLayerSetsHits::SeedingLayer > thirdLayers) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static const char * fillDescriptionsLabel()
void extend(const LayerHitMapCache &other)
static void fillDescriptions(edm::ParameterSetDescription &desc)
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
void update(unsigned int q)
MultiHitFromChi2EDProducer(const edm::ParameterSet &iConfig)