38 produces<RegionsSeedingHitSets>();
39 produces<edm::OwnVector<BaseTrackerRecHit> >();
56 const auto& regionDoublets = *hdoublets;
60 throw cms::Exception(
"LogicError") <<
"MultiHitFromChi2EDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 3, got " << seedingLayerHits.
numberOfLayersInSet() <<
". This is likely caused by a configuration error of this module, HitPairEDProducer, or SeedingLayersEDProducer.";
64 if(regionDoublets.empty()) {
76 std::vector<std::unique_ptr<BaseTrackerRecHit> > refittedHitStorage;
79 LogDebug(
"MultiHitFromChi2EDProducer") <<
"Creating multihits for " << regionDoublets.regionSize() <<
" regions, and " << trilayers.size() <<
" pair+3rd layers from " << regionDoublets.layerPairsSize() <<
" layer pairs";
82 for(
const auto& regionLayerPairs: regionDoublets) {
89 hitCache.
extend(regionLayerPairs.layerHitMapCache());
91 LogTrace(
"MultiHitFromChi2EDProducer") <<
" starting region";
93 for(
const auto& layerPair: regionLayerPairs) {
94 LogTrace(
"MultiHitFromChi2EDProducer") <<
" starting layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex();
97 return a.first[0].index() == layerPair.innerLayerIndex() &&
a.first[1].index() == layerPair.outerLayerIndex();
99 if(
found == trilayers.end()) {
100 auto exp =
cms::Exception(
"LogicError") <<
"Did not find the layer pair from vector<pair+third layers>. This is a sign of some internal inconsistency\n";
101 exp <<
"I was looking for layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex() <<
". Triplets have the following pairs:\n";
102 for(
const auto&
a: trilayers) {
103 exp <<
" " <<
a.first[0].index() <<
"," <<
a.first[1].index() <<
": 3rd layers";
104 for(
const auto&
b:
a.second) {
105 exp <<
" " <<
b.index();
111 const auto& thirdLayers =
found->second;
113 generator_.
hitSets(region, multihits, iEvent, iSetup, layerPair.doublets(), thirdLayers, hitCache, refittedHitStorage);
116 LogTrace(
"MultiHitFromChi2EDProducer") <<
" created " << multihits.
size() <<
" multihits for layer pair " << layerPair.innerLayerIndex() <<
"," << layerPair.outerLayerIndex() <<
" and 3rd layers";
117 for(
const auto&
l: thirdLayers) {
118 LogTrace(
"MultiHitFromChi2EDProducer") <<
" " <<
l.index();
123 seedingHitSetsFiller.emplace_back(hitSet);
130 auto storage = std::make_unique<edm::OwnVector<BaseTrackerRecHit> >();
131 storage->reserve(refittedHitStorage.size());
132 for(
auto& ptr: refittedHitStorage)
133 storage->push_back(ptr.release());
136 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)