16 using namespace GeomDetEnumerators;
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";
118 const unsigned int theMaxElement,
129 for (
int io = 0; io!=int(outerHitsMap.
theHits.size()); ++io) {
130 if (!deltaPhi.
prefilter(outerHitsMap.
x[io],outerHitsMap.
y[io]))
continue;
131 Hit
const & ohit = outerHitsMap.
theHits[io].hit();
135 nSigmaPhi*outerHitsMap.
drphi[io]
138 if (phiRange.
empty())
continue;
141 outerHitsMap.
rv(io),outerHitsMap.
z[io],
142 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
143 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]
145 if(!checkRZ)
continue;
147 Kernels<HitZCheck,HitRCheck,HitEtaCheck> kernels;
150 LogDebug(
"HitPairGeneratorFromLayerPair")<<
151 "preparing for combination of: "<< innerRange[1]-innerRange[0]+innerRange[3]-innerRange[2]
152 <<
" inner and: "<< outerHitsMap.
theHits.size()<<
" outter";
153 for(
int j=0;
j<3;
j+=2) {
154 auto b = innerRange[
j];
auto e=innerRange[
j+1];
156 switch (checkRZ->
algo()) {
158 std::get<0>(kernels).set(checkRZ);
159 std::get<0>(kernels)(b,e,innerHitsMap, ok);
162 std::get<1>(kernels).set(checkRZ);
163 std::get<1>(kernels)(b,e,innerHitsMap, ok);
166 std::get<2>(kernels).set(checkRZ);
167 std::get<2>(kernels)(b,e,innerHitsMap, ok);
170 for (
int i=0;
i!=e-
b; ++
i) {
171 if (!ok[
i])
continue;
174 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
183 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)
PixelRecoRange< float > Range
SeedingHitSet::ConstRecHitPointer InnerRecHit
virtual unsigned int size() const
Layer innerLayer(const Layers &layers) const
DoubleRange doubleRange(float phiMin, float phiMax) const
void reserve(std::size_t s)
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
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
LayerCacheType & theLayerCache
SeedingHitSet::ConstRecHitPointer OuterRecHit