Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:27:45

0001 #ifndef TkDetLayers_PixelForwardLayerPhase1_h
0002 #define TkDetLayers_PixelForwardLayerPhase1_h
0003 
0004 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
0005 #include "Phase1PixelBlade.h"
0006 #include "Utilities/BinningTools/interface/PeriodicBinFinderInPhi.h"
0007 
0008 /** A concrete implementation for PixelForward layer
0009  *  built out of ForwardPhase1PixelBlade
0010  */
0011 
0012 #pragma GCC visibility push(hidden)
0013 
0014 class PixelForwardLayerPhase1 final : public ForwardDetLayer {
0015 public:
0016   PixelForwardLayerPhase1(std::vector<const Phase1PixelBlade*>& blades);
0017   ~PixelForwardLayerPhase1() override;
0018 
0019   // GeometricSearchDet interface
0020 
0021   const std::vector<const GeomDet*>& basicComponents() const override { return theBasicComps; }
0022 
0023   const std::vector<const GeometricSearchDet*>& components() const override __attribute__((cold)) { return theComps; }
0024 
0025   void groupedCompatibleDetsV(const TrajectoryStateOnSurface& tsos,
0026                               const Propagator& prop,
0027                               const MeasurementEstimator& est,
0028                               std::vector<DetGroup>& result) const override __attribute__((hot));
0029 
0030   // DetLayer interface
0031   SubDetector subDetector() const override { return GeomDetEnumerators::subDetGeom[GeomDetEnumerators::P1PXEC]; }
0032 
0033 private:
0034   // methods for groupedCompatibleDets implementation
0035   static int computeHelicity(const GeometricSearchDet* firstBlade, const GeometricSearchDet* secondBlade);
0036 
0037   struct SubTurbineCrossings {
0038     SubTurbineCrossings() : isValid(false), closestIndex(0), nextIndex(0), nextDistance(0.0f) {}
0039     SubTurbineCrossings(int ci, int ni, float nd) : isValid(true), closestIndex(ci), nextIndex(ni), nextDistance(nd) {}
0040 
0041     bool isValid;
0042     int closestIndex;
0043     int nextIndex;
0044     float nextDistance;
0045   };
0046 
0047   void searchNeighbors(const TrajectoryStateOnSurface& tsos,
0048                        const Propagator& prop,
0049                        const MeasurementEstimator& est,
0050                        const SubTurbineCrossings& crossings,
0051                        float window,
0052                        std::vector<DetGroup>& result,
0053                        bool innerDisk) const __attribute__((hot));
0054 
0055   SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface& startingState,
0056                                        PropagationDirection propDir,
0057                                        bool innerDisk) const __attribute__((hot));
0058 
0059   static float computeWindowSize(const GeomDet* det,
0060                                  const TrajectoryStateOnSurface& tsos,
0061                                  const MeasurementEstimator& est);
0062 
0063 private:
0064   typedef PeriodicBinFinderInPhi<float> BinFinderType;
0065   // need separate objects for inner and outer disk
0066   // or a smarter bin finder class
0067   BinFinderType theBinFinder_inner;
0068   BinFinderType theBinFinder_outer;
0069   unsigned int _num_innerpanels;
0070   unsigned int _num_outerpanels;
0071 
0072   std::vector<float> theBinFinder_byR;
0073   std::vector<unsigned int> theBinFinder_byR_index;
0074   std::vector<unsigned int> theBinFinder_byR_nextindex;
0075   // bool useR;
0076   std::vector<const GeometricSearchDet*> theComps;
0077   std::vector<const GeomDet*> theBasicComps;
0078 };
0079 
0080 #pragma GCC visibility pop
0081 #endif