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";
114 for (
int io = 0; io!=int(outerHitsMap.
theHits.size()); ++io) {
115 Hit
const & ohit = outerHitsMap.
theHits[io].hit();
119 nSigmaPhi*outerHitsMap.
drphi[io]
122 if (phiRange.
empty())
continue;
125 outerHitsMap.
rv(io),outerHitsMap.
z[io],
126 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
127 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]
129 if(!checkRZ)
continue;
131 Kernels<HitZCheck,HitRCheck,HitEtaCheck> kernels;
134 LogDebug(
"HitPairGeneratorFromLayerPair")<<
135 "preparing for combination of: "<< innerRange[1]-innerRange[0]+innerRange[3]-innerRange[2]
136 <<
" inner and: "<< outerHitsMap.
theHits.size()<<
" outter";
137 for(
int j=0;
j<3;
j+=2) {
138 auto b = innerRange[
j];
auto e=innerRange[
j+1];
140 switch (checkRZ->
algo()) {
142 std::get<0>(kernels).set(checkRZ);
143 std::get<0>(kernels)(b,e,innerHitsMap, ok);
146 std::get<1>(kernels).set(checkRZ);
147 std::get<1>(kernels)(b,e,innerHitsMap, ok);
150 std::get<2>(kernels).set(checkRZ);
151 std::get<2>(kernels)(b,e,innerHitsMap, ok);
154 for (
int i=0;
i!=e-
b; ++
i) {
155 if (!ok[
i])
continue;
158 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
167 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)
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
PixelRecoRange< float > Range
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)
LayerCacheType & theLayerCache
SeedingHitSet::ConstRecHitPointer OuterRecHit