38 : theLayerCache(layerCache), theOuterLayer(outer), theInnerLayer(inner), theMaxElement(max) {}
46 template <
typename Algo>
49 void set(
Base const*
a) {
56 for (
int i = b;
i !=
e; ++
i) {
57 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
58 float vErr = nSigmaRZ * innerHitsMap.
dv[
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>...>;
77 auto const& ds =
doublets(region, iEvent, iSetup, layers);
78 for (std::size_t
i = 0;
i != ds.size(); ++
i) {
83 edm::LogError(
"TooManyPairs") <<
"number of pairs exceed maximum, no pairs produced";
94 if (innerHitsMap.
empty())
98 if (outerHitsMap.
empty())
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();
129 deltaPhi(outerHitsMap.
x[io], outerHitsMap.
y[io], outerHitsMap.
z[io], nSigmaPhi * outerHitsMap.
drphi[io]);
131 if (phiRange.
empty())
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);
161 std::get<0>(kernels)(
b,
e, innerHitsMap, ok);
164 std::get<1>(kernels).
set(checkRZ);
165 std::get<1>(kernels)(
b,
e, innerHitsMap, ok);
168 std::get<2>(kernels).
set(checkRZ);
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";
181 result.
add(b + i, io);
186 LogDebug(
"HitPairGeneratorFromLayerPair") <<
" total number of pairs provided back: " << result.
size();
~HitPairGeneratorFromLayerPair()
std::vector< HitWithPhi > theHits
std::vector< float > drphi
void hitPairs(const TrackingRegion ®, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
Layer innerLayer(const Layers &layers) const
DoubleRange doubleRange(float phiMin, float phiMax) const
void reserve(std::size_t s)
unsigned int size() const override
virtual HitRZCompatibility * checkRZ(const DetLayer *layer, const Hit &outerHit, const edm::EventSetup &iSetup, const DetLayer *outerlayer=0, float lr=0, float gz=0, float dr=0, float dz=0) const =0
HitDoublets doublets(const TrackingRegion ®, const edm::Event &ev, const edm::EventSetup &es, Layers layers)
const unsigned int theMaxElement
SeedingHitSet::ConstRecHitPointer Hit
BaseTrackerRecHit const * Hit
HitPairGeneratorFromLayerPair(unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int max=0)
Layer outerLayer(const Layers &layers) const
PixelRecoRange< float > Range
const DetLayer * detLayer() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
bool prefilter(float xHit, float yHit) const