26 : trackingRegion_(nullptr),
28 measurementTracker_(nullptr),
29 measurementTrackerLabel_(cfg.getParameter<std::
string>(
"measurementTracker")),
30 measurementTrackerESToken_(consumesCollector.
esConsumes(edm::
ESInputTag(
"", measurementTrackerLabel_))),
31 trackerTopologyESToken_(consumesCollector.
esConsumes()),
33 msMakerESToken_(consumesCollector.
esConsumes()) {
34 if (cfg.
exists(
"pixelTripletGeneratorFactory")) {
40 if (cfg.
exists(
"MultiHitGeneratorFactory")) {
46 if (cfg.
exists(
"CAHitTripletGeneratorFactory")) {
48 CAHitTriplGenerator_ = std::make_unique<CAHitTripletGenerator>(tripletConfig, consumesCollector);
54 layerPairs_ = cfg.getParameter<std::vector<unsigned>>(
"layerPairs");
57 if (cfg.
exists(
"CAHitQuadrupletGeneratorFactory")) {
59 CAHitQuadGenerator_ = std::make_unique<CAHitQuadrupletGenerator>(quadrupletConfig, consumesCollector);
62 std::make_unique<SeedingLayerSetsBuilder>(
cfg, consumesCollector,
edm::InputTag(
"fastTrackerRecHits"));
63 layerPairs_ = cfg.getParameter<std::vector<unsigned>>(
"layerPairs");
69 <<
"It is forbidden to specify together 'pixelTripletGeneratorFactory', 'CAHitTripletGeneratorFactory' and "
70 "'MultiHitGeneratorFactory' in configuration of SeedFinderSelection";
75 <<
"It is forbidden to specify 'CAHitQuadrupletGeneratorFactory' together with 'pixelTripletGeneratorFactory', "
76 "'CAHitTripletGeneratorFactory' or 'MultiHitGeneratorFactory' in configuration of SeedFinderSelection";
110 throw cms::Exception(
"FastSimTracking") <<
"ERROR: event not initialized";
113 throw cms::Exception(
"FastSimTracking") <<
"ERROR: trackingRegion not set";
117 if (hits.size() < 2) {
118 throw cms::Exception(
"FastSimTracking") <<
"SeedFinderSelector::pass requires at least 2 hits";
125 std::vector<BaseTrackerRecHit const *> firstHits{hits[0]};
126 std::vector<BaseTrackerRecHit const *> secondHits{hits[1]};
135 if (result.empty()) {
141 if (hits.size() < 3) {
143 <<
"For the given configuration, SeedFinderSelector::pass requires at least 3 hits";
147 std::vector<const DetLayer *> thirdLayerDetLayer(1, thirdLayer);
148 std::vector<BaseTrackerRecHit const *> thirdHits{hits[2]};
156 return !tripletresult.empty();
160 return !tripletresult.empty();
165 throw cms::Exception(
"FastSimTracking") <<
"ERROR: SeedingLayers pointer not set for CATripletGenerator";
174 std::array<SeedingLayerSetsBuilder::SeedingLayerId, 3> hitPair;
188 std::vector<BaseTrackerRecHit const *> fHits{hits[0]};
189 std::vector<BaseTrackerRecHit const *> sHits{hits[1]};
190 std::vector<BaseTrackerRecHit const *> tHits{hits[2]};
197 pairCandidate =
ls.slice(
p,
p + 2);
200 pairCandidate1 = pairCandidate;
203 pairCandidate2 = pairCandidate;
208 auto &layerCache = filler.layerHitMapCache();
218 filler.addDoublets(pairCandidate1,
std::move(res1));
224 filler.addDoublets(pairCandidate2,
std::move(res2));
226 std::vector<OrderedHitSeeds> tripletresult;
228 for (
auto &
ntuplet : tripletresult)
232 return !tripletresult[0].empty();
237 if (hits.size() < 4) {
239 <<
"For the given configuration, SeedFinderSelector::pass requires at least 4 hits";
243 throw cms::Exception(
"FastSimTracking") <<
"ERROR: SeedingLayers pointer not set for CAHitQuadrupletGenerator";
252 std::array<SeedingLayerSetsBuilder::SeedingLayerId, 4> hitPair;
265 std::vector<BaseTrackerRecHit const *> fHits{hits[0]};
266 std::vector<BaseTrackerRecHit const *> sHits{hits[1]};
267 std::vector<BaseTrackerRecHit const *> tHits{hits[2]};
268 std::vector<BaseTrackerRecHit const *> frHits{hits[3]};
275 pairCandidate =
ls.slice(
p,
p + 2);
278 pairCandidate1 = pairCandidate;
281 pairCandidate2 = pairCandidate;
284 pairCandidate3 = pairCandidate;
289 auto &layerCache = filler.layerHitMapCache();
299 filler.addDoublets(pairCandidate1,
std::move(res1));
305 filler.addDoublets(pairCandidate2,
std::move(res2));
307 pairCandidate3[1], std::make_unique<RecHitsSortedInPhi>(frHits,
trackingRegion_->
origin(), frLayer));
311 filler.addDoublets(pairCandidate3,
std::move(res3));
313 std::vector<OrderedHitSeeds> quadrupletresult;
315 for (
auto &
ntuplet : quadrupletresult)
319 return !quadrupletresult[0].empty();
344 return std::make_tuple(subdet, side, idLayer);
SeedFinderSelector(const edm::ParameterSet &, edm::ConsumesCollector &&)
bool pass(const std::vector< const FastTrackerRecHit * > &hits) const
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
std::unique_ptr< CAHitQuadrupletGenerator > CAHitQuadGenerator_
const edm::EventSetup * eventSetup_
GlobalPoint const & origin() const
std::unique_ptr< SeedingLayerSetsHits > seedingLayer
const MagneticField * field_
unsigned int pxfDisk(const DetId &id) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
const edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > msMakerESToken_
std::unique_ptr< HitTripletGeneratorFromPairAndLayers > pixelTripletGenerator_
bool getData(T &iHolder) const
std::vector< SeedingLayerSetsBuilder::SeedingLayerId > seedingLayerIds
SeedingLayerSetsBuilder::SeedingLayerId Layer_tuple(const FastTrackerRecHit *hit) const
std::tuple< GeomDetEnumerators::SubDetector, TrackerDetSide, int > SeedingLayerId
const GeomDet * det() const
std::vector< unsigned > layerPairs_
const TrackingRegion * trackingRegion_
const DetLayer * detLayer(const DetId &id) const
obsolete method. Use idToLayer() instead.
DetId geographicalId() const
The label of this GeomDet.
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > fieldESToken_
HitDoublets doublets(const TrackingRegion ®, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
unsigned int pxbLayer(const DetId &id) const
void initEvent(const edm::Event &, const edm::EventSetup &)
T getParameter(std::string const &) const
const edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measurementTrackerESToken_
std::unique_ptr< SeedingLayerSetsBuilder > seedingLayers_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyESToken_
const MeasurementTracker * measurementTracker_
unsigned int pxfSide(const DetId &id) const
const GeometricSearchTracker * geometricSearchTracker() const
const MultipleScatteringParametrisationMaker * msmaker_
std::unique_ptr< CAHitTripletGenerator > CAHitTriplGenerator_
const TrackerTopology * trackerTopology_
std::unique_ptr< MultiHitGeneratorFromPairAndLayers > multiHitGenerator_