Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TkDetLayers_TIDLayer_h
0002 #define TkDetLayers_TIDLayer_h
0003 
0004 #include "TrackingTools/DetLayers/interface/RingedForwardLayer.h"
0005 #include "TIDRing.h"
0006 #include <array>
0007 #include <atomic>
0008 
0009 /** A concrete implementation for TID layer 
0010  *  built out of TIDRings
0011  */
0012 
0013 #pragma GCC visibility push(hidden)
0014 class TIDLayer final : public RingedForwardLayer {
0015 public:
0016   TIDLayer(std::vector<const TIDRing*>& rings) __attribute__((cold));
0017   ~TIDLayer() override __attribute__((cold));
0018 
0019   //default implementations would not manage memory correctly
0020   TIDLayer(const TIDLayer&) = delete;
0021   TIDLayer& operator=(const TIDLayer&) = delete;
0022 
0023   // GeometricSearchDet interface
0024 
0025   const std::vector<const GeomDet*>& basicComponents() const override { return theBasicComps; }
0026 
0027   const std::vector<const GeometricSearchDet*>& components() const override __attribute__((cold));
0028 
0029   void groupedCompatibleDetsV(const TrajectoryStateOnSurface& tsos,
0030                               const Propagator& prop,
0031                               const MeasurementEstimator& est,
0032                               std::vector<DetGroup>& result) const override __attribute__((hot));
0033 
0034   // DetLayer interface
0035   SubDetector subDetector() const override { return GeomDetEnumerators::subDetGeom[GeomDetEnumerators::TID]; }
0036 
0037 private:
0038   // private methods for the implementation of groupedCompatibleDets()
0039   BoundDisk* computeDisk(const std::vector<const TIDRing*>& rings) const __attribute__((cold));
0040 
0041   std::array<int, 3> ringIndicesByCrossingProximity(const TrajectoryStateOnSurface& startingState,
0042                                                     const Propagator& prop) const;
0043 
0044   //  bool isCompatible( const TrajectoryStateOnSurface& ms,
0045   //         const MeasurementEstimator& est) const;
0046 
0047   int findClosest(const GlobalPoint[3]) const __attribute__((hot));
0048 
0049   int findNextIndex(const GlobalPoint[3], int) const __attribute__((hot));
0050 
0051   bool overlapInR(const TrajectoryStateOnSurface& tsos, int i, double ymax) const __attribute__((hot));
0052 
0053   float computeWindowSize(const GeomDet* det,
0054                           const TrajectoryStateOnSurface& tsos,
0055                           const MeasurementEstimator& est) const __attribute__((hot));
0056 
0057   void fillRingPars(int i) __attribute__((cold));
0058 
0059 private:
0060   std::vector<GeomDet const*> theBasicComps;
0061   mutable std::atomic<std::vector<const GeometricSearchDet*>*> theComponents;
0062   const TIDRing* theComps[3];
0063   struct RingPar {
0064     float theRingR, thetaRingMin, thetaRingMax;
0065   };
0066   RingPar ringPars[3];
0067 };
0068 
0069 #pragma GCC visibility pop
0070 #endif