16 using namespace GeomDetEnumerators;
22 template<
class T>
inline T sqr(
T t) {
return t*
t;}
39 theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner)
49 template<
typename Algo>
52 void set(
Base const *
a) {
53 assert( a->algo()==Algo::me);
54 checkRZ=
reinterpret_cast<Algo const *
>(
a);
59 for (
int i=b;
i!=
e; ++
i) {
60 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
61 float vErr = nSigmaRZ * innerHitsMap.
dv[
i];
62 Range hitRZ(innerHitsMap.
v[
i]-vErr, innerHitsMap.
v[
i]+vErr);
64 ok[
i-
b] = ! crossRange.
empty() ;
72 template<
typename ... Args>
using Kernels = std::tuple<Kernel<Args>...>;
81 auto const & ds =
doublets(region, iEvent, iSetup);
82 for (std::size_t
i=0;
i!=ds.size(); ++
i) {
87 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
116 for (
int io = 0; io!=int(outerHitsMap.
theHits.size()); ++io) {
117 Hit
const & ohit = outerHitsMap.
theHits[io].hit();
121 nSigmaPhi*outerHitsMap.
drphi[io]
124 if (phiRange.
empty())
continue;
127 outerHitsMap.
rv(io),outerHitsMap.
z[io],
128 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
129 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]
131 if(!checkRZ)
continue;
133 Kernels<HitZCheck,HitRCheck,HitEtaCheck> kernels;
136 LogDebug(
"HitPairGeneratorFromLayerPair")<<
137 "preparing for combination of: "<< innerRange[1]-innerRange[0]+innerRange[3]-innerRange[2]
138 <<
" inner and: "<< outerHitsMap.
theHits.size()<<
" outter";
139 for(
int j=0;
j<3;
j+=2) {
140 auto b = innerRange[
j];
auto e=innerRange[
j+1];
142 switch (checkRZ->
algo()) {
144 std::get<0>(kernels).set(checkRZ);
145 std::get<0>(kernels)(b,e,innerHitsMap, ok);
148 std::get<1>(kernels).set(checkRZ);
149 std::get<1>(kernels)(b,e,innerHitsMap, ok);
152 std::get<2>(kernels).set(checkRZ);
153 std::get<2>(kernels)(b,e,innerHitsMap, ok);
156 for (
int i=0;
i!=e-
b; ++
i) {
157 if (!ok[
i])
continue;
160 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
169 LogDebug(
"HitPairGeneratorFromLayerPair")<<
" total number of pairs provided back: "<<result.
size();
std::vector< HitWithPhi > theHits
std::vector< float > drphi
virtual unsigned int size() const
virtual void hitPairs(const TrackingRegion ®, OrderedHitPairs &prs, const edm::Event &ev, const edm::EventSetup &es)
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
const T & max(const T &a, const T &b)
constexpr double nSigmaRZ
unsigned int theMaxElement
constexpr double nSigmaPhi
PixelRecoRange< float > Range
const DetLayer * detLayer() const
PixelRecoRange< T > intersection(const PixelRecoRange< T > &r) const
Square< F >::type sqr(const F &f)
TransientTrackingRecHit::ConstRecHitPointer Hit
virtual HitDoublets doublets(const TrackingRegion ®, const edm::Event &ev, const edm::EventSetup &es)
LayerCacheType & theLayerCache
HitPairGeneratorFromLayerPair(unsigned int inner, unsigned int outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)