Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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 #include <optional>
0009 
0010 /** A concrete implementation for TIB rings 
0011  */
0012 
0013 #pragma GCC visibility push(hidden)
0014 class TIBRing final : public GeometricSearchDet {
0015 public:
0016   TIBRing(std::vector<const GeomDet*>& theGeomDets) __attribute__((cold));
0017   ~TIBRing() override __attribute__((cold));
0018 
0019   // GeometricSearchDet interface
0020   const BoundSurface& surface() const override { return *theCylinder; }
0021 
0022   const std::vector<const GeomDet*>& basicComponents() const override { return theDets; }
0023 
0024   const std::vector<const GeometricSearchDet*>& components() const override __attribute__((cold));
0025 
0026   std::pair<bool, TrajectoryStateOnSurface> compatible(const TrajectoryStateOnSurface& ts,
0027                                                        const Propagator&,
0028                                                        const MeasurementEstimator&) const override
0029       __attribute__((cold));
0030 
0031   void groupedCompatibleDetsV(const TrajectoryStateOnSurface& startingState,
0032                               const Propagator& prop,
0033                               const MeasurementEstimator& est,
0034                               std::vector<DetGroup>& result) const override __attribute__((hot));
0035 
0036   //--- Extension of the interface
0037 
0038   /// Return the ring surface as a
0039   virtual const BoundCylinder& specificSurface() const { return *theCylinder; }
0040 
0041 private:
0042   //general private methods
0043 
0044   void checkPeriodicity(std::vector<const GeomDet*>::const_iterator first,
0045                         std::vector<const GeomDet*>::const_iterator last) __attribute__((cold));
0046 
0047   void checkRadius(std::vector<const GeomDet*>::const_iterator first, std::vector<const GeomDet*>::const_iterator last)
0048       __attribute__((cold));
0049 
0050   void computeHelicity() __attribute__((cold));
0051 
0052   // methods for groupedCompatibleDets implementation
0053   struct SubRingCrossings {
0054     SubRingCrossings(int ci, int ni, float nd) : closestIndex(ci), nextIndex(ni), nextDistance(nd) {}
0055 
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   std::optional<SubRingCrossings> computeCrossings(const TrajectoryStateOnSurface& startingState,
0069                                                    PropagationDirection propDir) const __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