Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TkDetLayers_TBLayer_h
0002 #define TkDetLayers_TBLayer_h
0003 
0004 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0005 #include "SubLayerCrossings.h"
0006 #include <tuple>
0007 
0008 // A base class for Barrel Layers
0009 #pragma GCC visibility push(hidden)
0010 class TBLayer : public BarrelDetLayer {
0011 public:
0012   template <typename TDET>
0013   TBLayer(std::vector<const TDET*>& inner, std::vector<const TDET*>& outer, GeomDetEnumerators::SubDetector ime)
0014       : BarrelDetLayer(true),
0015         theInnerComps(inner.begin(), inner.end()),
0016         theOuterComps(outer.begin(), outer.end()),
0017         me(ime) {}
0018 
0019   ~TBLayer() override __attribute__((cold));
0020 
0021   // GeometricSearchDet interface
0022 
0023   const std::vector<const GeomDet*>& basicComponents() const final { return theBasicComps; }
0024 
0025   const std::vector<const GeometricSearchDet*>& components() const final __attribute__((cold)) { return theComps; }
0026 
0027   void groupedCompatibleDetsV(const TrajectoryStateOnSurface& tsos,
0028                               const Propagator& prop,
0029                               const MeasurementEstimator& est,
0030                               std::vector<DetGroup>& result) const override __attribute__((hot));
0031 
0032   // DetLayer interface
0033   SubDetector subDetector() const final { return GeomDetEnumerators::subDetGeom[me]; }
0034 
0035 protected:
0036   SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface& startingState, PropagationDirection propDir) const
0037       __attribute__((hot));
0038 
0039   virtual std::tuple<bool, int, int> computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const = 0;
0040 
0041   virtual float computeWindowSize(const GeomDet* det,
0042                                   const TrajectoryStateOnSurface& tsos,
0043                                   const MeasurementEstimator& est) const = 0;
0044 
0045   bool addClosest(const TrajectoryStateOnSurface& tsos,
0046                   const Propagator& prop,
0047                   const MeasurementEstimator& est,
0048                   const SubLayerCrossing& crossing,
0049                   std::vector<DetGroup>& result) const __attribute__((hot));
0050 
0051   const std::vector<const GeometricSearchDet*>& subLayer(int ind) const {
0052     return (ind == 0 ? theInnerComps : theOuterComps);
0053   }
0054 
0055   bool isTIB() const { return me == GeomDetEnumerators::TIB; }
0056   bool isTOB() const { return me == GeomDetEnumerators::TOB; }
0057   bool isPixel() const { return me == GeomDetEnumerators::PixelBarrel; }
0058   bool isPhase2OT() const { return me == GeomDetEnumerators::P2OTB; }
0059 
0060   virtual void searchNeighbors(const TrajectoryStateOnSurface& tsos,
0061                                const Propagator& prop,
0062                                const MeasurementEstimator& est,
0063                                const SubLayerCrossing& crossing,
0064                                float window,
0065                                std::vector<DetGroup>& result,
0066                                bool checkClosest) const = 0;
0067 
0068 protected:
0069   std::vector<const GeometricSearchDet*> theComps;
0070   std::vector<const GeometricSearchDet*> theInnerComps;
0071   std::vector<const GeometricSearchDet*> theOuterComps;
0072   std::vector<const GeomDet*> theBasicComps;
0073 
0074   ReferenceCountingPointer<BoundCylinder> theInnerCylinder;
0075   ReferenceCountingPointer<BoundCylinder> theOuterCylinder;
0076 
0077   GeomDetEnumerators::SubDetector me;
0078 };
0079 
0080 #pragma GCC visibility pop
0081 
0082 #endif