38 : theLayerCache(layerCache), theOuterLayer(
outer), theInnerLayer(
inner), theMaxElement(
max) {}
46 template <
typename Algo>
49 void set(
Base const*
a) {
51 checkRZ = reinterpret_cast<Algo const*>(
a);
55 constexpr
float nSigmaRZ = 3.46410161514f;
56 for (
int i =
b;
i !=
e; ++
i) {
57 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
59 Range hitRZ(innerHitsMap.
v[
i] - vErr, innerHitsMap.
v[
i] + vErr);
61 ok[
i -
b] = !crossRange.empty();
67 template <
typename...
Args>
68 using Kernels = std::tuple<Kernel<Args>...>;
78 for (std::size_t
i = 0;
i != ds.size(); ++
i) {
83 edm::LogError(
"TooManyPairs") <<
"number of pairs exceed maximum, no pairs produced";
90 const Layer& innerLayer,
91 const Layer& outerLayer,
94 if (innerHitsMap.
empty())
98 if (outerHitsMap.
empty())
114 const unsigned int theMaxElement,
124 for (
int io = 0; io !=
int(outerHitsMap.
theHits.size()); ++io) {
125 if (!
deltaPhi.prefilter(outerHitsMap.
x[io], outerHitsMap.
y[io]))
127 Hit const& ohit = outerHitsMap.
theHits[io].hit();
131 if (phiRange.
empty())
134 std::unique_ptr<const HitRZCompatibility> checkRZ =
135 region.checkRZ(&innerHitDetLayer,
141 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
142 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]);
146 Kernels<HitZCheck, HitRCheck, HitEtaCheck> kernels;
149 LogDebug(
"HitPairGeneratorFromLayerPair")
150 <<
"preparing for combination of: " << innerRange[1] - innerRange[0] + innerRange[3] - innerRange[2]
151 <<
" inner and: " << outerHitsMap.
theHits.size() <<
" outter";
152 for (
int j = 0;
j < 3;
j += 2) {
153 auto b = innerRange[
j];
154 auto e = innerRange[
j + 1];
158 switch (checkRZ->algo()) {
160 std::get<0>(kernels).set(checkRZ.get());
161 std::get<0>(kernels)(
b,
e, innerHitsMap,
ok);
164 std::get<1>(kernels).set(checkRZ.get());
165 std::get<1>(kernels)(
b,
e, innerHitsMap,
ok);
168 std::get<2>(kernels).set(checkRZ.get());
169 std::get<2>(kernels)(
b,
e, innerHitsMap,
ok);
172 for (
int i = 0;
i !=
e -
b; ++
i) {
177 edm::LogError(
"TooManyPairs") <<
"number of pairs exceed maximum, no pairs produced";
184 LogDebug(
"HitPairGeneratorFromLayerPair") <<
" total number of pairs provided back: " <<
result.size();