40 hitsPutToken_{produces()},
41 generator_(iConfig, consumesCollector()) {
42 produces<RegionsSeedingHitSets>();
59 const auto& regionDoublets = *hdoublets;
64 <<
"MultiHitFromChi2EDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 3, got " 66 <<
". This is likely caused by a configuration error of this module, HitPairEDProducer, or " 67 "SeedingLayersEDProducer.";
71 if (regionDoublets.empty()) {
83 std::vector<std::unique_ptr<BaseTrackerRecHit>> refittedHitStorage;
86 LogDebug(
"MultiHitFromChi2EDProducer") <<
"Creating multihits for " << regionDoublets.regionSize() <<
" regions, and " 87 << trilayers.size() <<
" pair+3rd layers from " 88 << regionDoublets.layerPairsSize() <<
" layer pairs";
91 for (
const auto& regionLayerPairs : regionDoublets) {
98 hitCache.
extend(regionLayerPairs.layerHitMapCache());
100 LogTrace(
"MultiHitFromChi2EDProducer") <<
" starting region";
102 for (
const auto& layerPair : regionLayerPairs) {
103 LogTrace(
"MultiHitFromChi2EDProducer")
104 <<
" starting layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex();
107 return a.first[0].index() == layerPair.innerLayerIndex() &&
a.first[1].index() == layerPair.outerLayerIndex();
109 if (
found == trilayers.end()) {
110 auto exp =
cms::Exception(
"LogicError") <<
"Did not find the layer pair from vector<pair+third layers>. This " 111 "is a sign of some internal inconsistency\n";
112 exp <<
"I was looking for layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex()
113 <<
". Triplets have the following pairs:\n";
114 for (
const auto&
a : trilayers) {
115 exp <<
" " <<
a.first[0].index() <<
"," <<
a.first[1].index() <<
": 3rd layers";
116 for (
const auto&
b :
a.second) {
117 exp <<
" " <<
b.index();
123 const auto& thirdLayers =
found->second;
128 LogTrace(
"MultiHitFromChi2EDProducer")
129 <<
" created " << multihits.
size() <<
" multihits for layer pair " << layerPair.innerLayerIndex() <<
"," 130 << layerPair.outerLayerIndex() <<
" and 3rd layers";
131 for (
const auto&
l : thirdLayers) {
132 LogTrace(
"MultiHitFromChi2EDProducer") <<
" " <<
l.index();
137 seedingHitSetsFiller.emplace_back(hitSet);
145 refittedHitStorage.shrink_to_fit();
unsigned int size() const override
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDPutTokenT< std::vector< std::unique_ptr< BaseTrackerRecHit > > > hitsPutToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~MultiHitFromChi2EDProducer() override=default
static RegionFiller dummyFiller()
void initES(const edm::EventSetup &es) override
#define DEFINE_FWK_MODULE(type)
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
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)