Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TkDetLayers_TIBRing_h
0002 #define TkDetLayers_TIBRing_h
0003 
0004 #include "TrackingTools/DetLayers/interface/GeometricSearchDet.h"
0005 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
0006 #include "Utilities/BinningTools/interface/PeriodicBinFinderInPhi.h"
0007 
0008 /** A concrete implementation for TIB rings 
0009  */
0010 
0011 #pragma GCC visibility push(hidden)
0012 class TIBRing final : public GeometricSearchDet {
0013 public:
0014   TIBRing(std::vector<const GeomDet*>& theGeomDets) __attribute__((cold));
0015   ~TIBRing() override __attribute__((cold));
0016 
0017   // GeometricSearchDet interface
0018   const BoundSurface& surface() const override { return *theCylinder; }
0019 
0020   const std::vector<const GeomDet*>& basicComponents() const override { return theDets; }
0021 
0022   const std::vector<const GeometricSearchDet*>& components() const override __attribute__((cold));
0023 
0024   std::pair<bool, TrajectoryStateOnSurface> compatible(const TrajectoryStateOnSurface& ts,
0025                                                        const Propagator&,
0026                                                        const MeasurementEstimator&) const override
0027       __attribute__((cold));
0028 
0029   void groupedCompatibleDetsV(const TrajectoryStateOnSurface& startingState,
0030                               const Propagator& prop,
0031                               const MeasurementEstimator& est,
0032                               std::vector<DetGroup>& result) const override __attribute__((hot));
0033 
0034   //--- Extension of the interface
0035 
0036   /// Return the ring surface as a
0037   virtual const BoundCylinder& specificSurface() const { return *theCylinder; }
0038 
0039 private:
0040   //general private methods
0041 
0042   void checkPeriodicity(std::vector<const GeomDet*>::const_iterator first,
0043                         std::vector<const GeomDet*>::const_iterator last) __attribute__((cold));
0044 
0045   void checkRadius(std::vector<const GeomDet*>::const_iterator first, std::vector<const GeomDet*>::const_iterator last)
0046       __attribute__((cold));
0047 
0048   void computeHelicity() __attribute__((cold));
0049 
0050   // methods for groupedCompatibleDets implementation
0051   struct SubRingCrossings {
0052     SubRingCrossings() : isValid_(false){};
0053     SubRingCrossings(int ci, int ni, float nd) : isValid_(true), closestIndex(ci), nextIndex(ni), nextDistance(nd) {}
0054 
0055     bool isValid_;
0056     int closestIndex;
0057     int nextIndex;
0058     float nextDistance;
0059   };
0060 
0061   void searchNeighbors(const TrajectoryStateOnSurface& tsos,
0062                        const Propagator& prop,
0063                        const MeasurementEstimator& est,
0064                        const SubRingCrossings& crossings,
0065                        float window,
0066                        std::vector<DetGroup>& result) const __attribute__((hot));
0067 
0068   SubRingCrossings computeCrossings(const TrajectoryStateOnSurface& startingState, PropagationDirection propDir) const
0069       __attribute__((hot));
0070 
0071   float computeWindowSize(const GeomDet* det,
0072                           const TrajectoryStateOnSurface& tsos,
0073                           const MeasurementEstimator& est) const __attribute__((hot));
0074 
0075 private:
0076   typedef PeriodicBinFinderInPhi<float> BinFinderType;
0077   BinFinderType theBinFinder;
0078 
0079   std::vector<const GeomDet*> theDets;
0080   ReferenceCountingPointer<BoundCylinder> theCylinder;
0081   int theHelicity;
0082 };
0083 
0084 #pragma GCC visibility pop
0085 #endif