16 using namespace GeomDetEnumerators;
37 : theLayerCache(layerCache),
50 template <
typename Algo>
53 void set(
Base const*
a) {
59 constexpr
float nSigmaRZ = 3.46410161514f;
60 for (
int i = b;
i !=
e; ++
i) {
61 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
62 float vErr = nSigmaRZ * innerHitsMap.
dv[
i];
63 Range hitRZ(innerHitsMap.
v[
i] - vErr, innerHitsMap.
v[
i] + vErr);
65 ok[
i -
b] = !crossRange.
empty();
71 template <
typename...
Args>
72 using Kernels = std::tuple<Kernel<Args>...>;
81 auto const& ds =
doublets(region, iEvent, iSetup, layers);
82 for (std::size_t
i = 0;
i != ds.size(); ++
i) {
87 edm::LogError(
"TooManyPairs") <<
"number of pairs exceed maximum, no pairs produced";
94 const Layer& innerLayer,
95 const Layer& outerLayer,
98 if (innerHitsMap.
empty())
102 if (outerHitsMap.
empty())
128 const unsigned int theMaxElement,
138 for (
int io = 0; io != int(outerHitsMap.
theHits.size()); ++io) {
139 if (!deltaPhi.
prefilter(outerHitsMap.
x[io], outerHitsMap.
y[io]))
141 Hit
const& ohit = outerHitsMap.
theHits[io].hit();
143 deltaPhi(outerHitsMap.
x[io], outerHitsMap.
y[io], outerHitsMap.
z[io], nSigmaPhi * outerHitsMap.
drphi[io]);
145 if (phiRange.
empty())
148 std::unique_ptr<const HitRZCompatibility> checkRZ =
149 region.
checkRZ(&innerHitDetLayer,
154 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
155 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]);
159 Kernels<HitZCheck, HitRCheck, HitEtaCheck> kernels;
162 LogDebug(
"HitPairGeneratorFromLayerPair")
163 <<
"preparing for combination of: " << innerRange[1] - innerRange[0] + innerRange[3] - innerRange[2]
164 <<
" inner and: " << outerHitsMap.
theHits.size() <<
" outter";
165 for (
int j = 0;
j < 3;
j += 2) {
166 auto b = innerRange[
j];
167 auto e = innerRange[
j + 1];
171 switch (checkRZ->algo()) {
173 std::get<0>(kernels).set(checkRZ.get());
174 std::get<0>(kernels)(b, e, innerHitsMap, ok);
177 std::get<1>(kernels).set(checkRZ.get());
178 std::get<1>(kernels)(b, e, innerHitsMap, ok);
181 std::get<2>(kernels).set(checkRZ.get());
182 std::get<2>(kernels)(b, e, innerHitsMap, ok);
185 for (
int i = 0;
i != e -
b; ++
i) {
190 edm::LogError(
"TooManyPairs") <<
"number of pairs exceed maximum, no pairs produced";
193 result.
add(b + i, io);
197 LogDebug(
"HitPairGeneratorFromLayerPair") <<
" total number of pairs provided back: " << result.
size();
~HitPairGeneratorFromLayerPair()
std::vector< HitWithPhi > theHits
virtual std::unique_ptr< HitRZCompatibility > checkRZ(const DetLayer *layer, const Hit &outerHit, const DetLayer *outerlayer=nullptr, float lr=0, float gz=0, float dr=0, float dz=0) const =0
std::vector< float > drphi
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
HitPairGeneratorFromLayerPair(edm::ConsumesCollector iC, unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int max=0)
void hitPairs(const TrackingRegion ®, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
PixelRecoRange< float > Range
Log< level::Error, false > LogError
DoubleRange doubleRange(float phiMin, float phiMax) const
void reserve(std::size_t s)
bool getData(T &iHolder) const
constexpr double nSigmaRZ
constexpr float nSigmaPhi
HitDoublets doublets(const TrackingRegion ®, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
const unsigned int theMaxElement
unsigned int size() const override
SeedingHitSet::ConstRecHitPointer Hit
BaseTrackerRecHit const * Hit
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theFieldToken
const edm::ESGetToken< MultipleScatteringParametrisationMaker, TrackerMultipleScatteringRecord > theMSMakerToken
const DetLayer * detLayer() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
bool prefilter(float xHit, float yHit) const