Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:50

0001 #include "RecoTracker/TkTrackingRegions/interface/HitRZCompatibility.h"
0002 #include "RecoTracker/TkTrackingRegions/interface/HitEtaCheck.h"
0003 #include "RecoTracker/TkTrackingRegions/interface/HitRCheck.h"
0004 #include "RecoTracker/TkTrackingRegions/interface/HitZCheck.h"
0005 
0006 #include "RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h"
0007 
0008 typedef PixelRecoRange<float> Range;
0009 
0010 // devirtualizer
0011 #include <tuple>
0012 namespace {
0013 
0014   template <typename Algo>
0015   struct Kernel {
0016     using Base = HitRZCompatibility;
0017     void set(Base const *a) {
0018       assert(a->algo() == Algo::me);
0019       checkRZ = reinterpret_cast<Algo const *>(a);
0020     }
0021 
0022     void operator()(int b, int e, const RecHitsSortedInPhi &innerHitsMap, bool *ok) const {
0023       constexpr float nSigmaRZ = 3.46410161514;  // std::sqrt(12.f);
0024       for (int i = b; i != e; ++i) {
0025         Range allowed = checkRZ->range(innerHitsMap.u[i]);
0026         float vErr = nSigmaRZ * innerHitsMap.dv[i];
0027         Range hitRZ(innerHitsMap.v[i] - vErr, innerHitsMap.v[i] + vErr);
0028         Range crossRange = allowed.intersection(hitRZ);
0029         ok[i - b] = !crossRange.empty();
0030       }
0031     }
0032     Algo const *checkRZ;
0033   };
0034 
0035   template <typename... Args>
0036   using Kernels = std::tuple<Kernel<Args>...>;
0037 
0038 }  // namespace
0039 
0040 void testR(HitRZCompatibility const *algo, int b, int e, const RecHitsSortedInPhi &innerHitsMap, bool *ok) {
0041   Kernel<HitRCheck> k;
0042   k.set(algo);
0043   k(b, e, innerHitsMap, ok);
0044 }
0045 
0046 void testZ(HitRZCompatibility const *algo, int b, int e, const RecHitsSortedInPhi &innerHitsMap, bool *ok) {
0047   Kernel<HitZCheck> k;
0048   k.set(algo);
0049   k(b, e, innerHitsMap, ok);
0050 }