22 template<
class T>
inline T sqr(
T t) {
return t*
t;}
37 : theLayerCache(layerCache), theOuterLayer(outer), theInnerLayer(inner), theMaxElement(max)
47 template<
typename Algo>
50 void set(
Base const *
a) {
51 assert(
a->algo()==Algo::me);
52 checkRZ=
reinterpret_cast<Algo const *
>(
a);
57 for (
int i=b;
i!=
e; ++
i) {
58 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
59 float vErr = nSigmaRZ * innerHitsMap.
dv[
i];
60 Range hitRZ(innerHitsMap.
v[
i]-vErr, innerHitsMap.
v[
i]+vErr);
62 ok[
i-
b] = ! crossRange.
empty() ;
70 template<
typename ...
Args>
using Kernels = std::tuple<Kernel<Args>...>;
79 auto const & ds =
doublets(region, iEvent, iSetup, layers);
80 for (std::size_t
i=0;
i!=ds.size(); ++
i) {
85 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
124 for (
int io = 0; io!=
int(outerHitsMap.
theHits.size()); ++io) {
125 if (!deltaPhi.
prefilter(outerHitsMap.
x[io],outerHitsMap.
y[io]))
continue;
126 Hit
const & ohit = outerHitsMap.
theHits[io].hit();
130 nSigmaPhi*outerHitsMap.
drphi[io]
133 if (phiRange.
empty())
continue;
136 outerHitsMap.
rv(io),outerHitsMap.
z[io],
137 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
138 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]
140 if(!checkRZ)
continue;
142 Kernels<HitZCheck,HitRCheck,HitEtaCheck> kernels;
145 LogDebug(
"HitPairGeneratorFromLayerPair")<<
146 "preparing for combination of: "<< innerRange[1]-innerRange[0]+innerRange[3]-innerRange[2]
147 <<
" inner and: "<< outerHitsMap.
theHits.size()<<
" outter";
148 for(
int j=0; j<3; j+=2) {
149 auto b = innerRange[j];
auto e=innerRange[j+1];
151 switch (checkRZ->
algo()) {
153 std::get<0>(kernels).
set(checkRZ);
154 std::get<0>(kernels)(
b,
e,innerHitsMap, ok);
157 std::get<1>(kernels).
set(checkRZ);
158 std::get<1>(kernels)(
b,
e,innerHitsMap, ok);
161 std::get<2>(kernels).
set(checkRZ);
162 std::get<2>(kernels)(
b,
e,innerHitsMap, ok);
165 for (
int i=0;
i!=
e-
b; ++
i) {
166 if (!ok[
i])
continue;
169 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
178 LogDebug(
"HitPairGeneratorFromLayerPair")<<
" total number of pairs provided back: "<<result.
size();
~HitPairGeneratorFromLayerPair()
std::vector< HitWithPhi > theHits
std::vector< float > drphi
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
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