18 using namespace GeomDetEnumerators;
19 using namespace ctfseeding;
25 template<
class T>
inline T sqr(
T t) {
return t*
t;}
42 theLayerCache(*layerCache), theOuterLayer(outer), theInnerLayer(inner)
52 template<
typename Algo>
55 void set(
Base const *
a) {
56 assert( a->algo()==Algo::me);
57 checkRZ=
reinterpret_cast<Algo const *
>(
a);
62 for (
int i=b;
i!=
e; ++
i) {
63 Range allowed = checkRZ->range(innerHitsMap.
u[
i]);
64 float vErr = nSigmaRZ * innerHitsMap.
dv[
i];
65 Range hitRZ(innerHitsMap.
v[
i]-vErr, innerHitsMap.
v[
i]+vErr);
67 ok[
i-
b] = ! crossRange.
empty() ;
75 template<
typename ... Args>
using Kernels = std::tuple<Kernel<Args>...>;
85 auto const & ds =
doublets(region,iEvent,iSetup);
86 for (std::size_t
i=0;
i!=ds.size(); ++
i) {
91 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
117 for (
int io = 0; io!=int(outerHitsMap.
theHits.size()); ++io) {
118 Hit
const & ohit = outerHitsMap.
theHits[io].hit();
122 nSigmaPhi*outerHitsMap.
drphi[io]
125 if (phiRange.
empty())
continue;
128 outerHitsMap.
rv(io),outerHitsMap.
z[io],
129 outerHitsMap.
isBarrel ? outerHitsMap.
du[io] : outerHitsMap.
dv[io],
130 outerHitsMap.
isBarrel ? outerHitsMap.
dv[io] : outerHitsMap.
du[io]
132 if(!checkRZ)
continue;
134 Kernels<HitZCheck,HitRCheck,HitEtaCheck> kernels;
137 LogDebug(
"HitPairGeneratorFromLayerPair")<<
138 "preparing for combination of: "<< innerRange[1]-innerRange[0]+innerRange[3]-innerRange[2]
139 <<
" inner and: "<< outerHitsMap.
theHits.size()<<
" outter";
140 for(
int j=0;
j<3;
j+=2) {
141 auto b = innerRange[
j];
auto e=innerRange[
j+1];
143 switch (checkRZ->
algo()) {
145 std::get<0>(kernels).set(checkRZ);
146 std::get<0>(kernels)(b,e,innerHitsMap, ok);
149 std::get<1>(kernels).set(checkRZ);
150 std::get<1>(kernels)(b,e,innerHitsMap, ok);
153 std::get<2>(kernels).set(checkRZ);
154 std::get<2>(kernels)(b,e,innerHitsMap, ok);
157 for (
int i=0;
i!=e-
b; ++
i) {
158 if (!ok[
i])
continue;
161 edm::LogError(
"TooManyPairs")<<
"number of pairs exceed maximum, no pairs produced";
170 LogDebug(
"HitPairGeneratorFromLayerPair")<<
" total number of pairs provided back: "<<result.
size();
std::vector< HitWithPhi > theHits
std::vector< float > drphi
Layer const theOuterLayer
const DetLayer * detLayer() const
HitPairGeneratorFromLayerPair(const Layer &inner, const Layer &outer, LayerCacheType *layerCache, unsigned int nSize=30000, unsigned int max=0)
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
Layer const theInnerLayer
PixelRecoRange< float > Range
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