Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef TkNavigation_LayerCollector_H_
0002 #define TkNavigation_LayerCollector_H_
0003 /**
0004  *   \class LayerCollector
0005  *   Class collecting all layers of the tracker.  
0006  *   
0007  *   
0008  */
0009 
0010 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0011 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0012 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0013 #include "RecoTracker/MeasurementDet/interface/StartingLayerFinder.h"
0014 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
0015 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
0016 
0017 class NavigationSchool;
0018 
0019 class LayerCollector {
0020 private:
0021   typedef FreeTrajectoryState FTS;
0022   typedef TrajectoryStateOnSurface TSOS;
0023   typedef std::pair<float, float> Range;
0024 
0025 public:
0026   LayerCollector(NavigationSchool const* aSchool,
0027                  const Propagator* aPropagator,
0028                  const MeasurementTracker* tracker,
0029                  float dr,
0030                  float dz)
0031       : theSchool(aSchool),
0032         thePropagator(aPropagator),
0033         theStartingLayerFinder{*aPropagator, *tracker},
0034         theDeltaR(dr),
0035         theDeltaZ(dz) {}
0036 
0037   std::vector<const DetLayer*> allLayers(const FTS& aFts) const;
0038   std::vector<const BarrelDetLayer*> barrelLayers(const FTS& aFts) const;
0039   std::vector<const ForwardDetLayer*> forwardLayers(const FTS& aFts) const;
0040 
0041   const Propagator* propagator() const { return thePropagator; }
0042   float deltaR() const { return theDeltaR; }
0043   float deltaZ() const { return theDeltaZ; }
0044 
0045 private:
0046   NavigationSchool const* theSchool;
0047   const Propagator* thePropagator;
0048   const StartingLayerFinder theStartingLayerFinder;
0049   float theDeltaR;
0050   float theDeltaZ;
0051 
0052   inline bool rangesIntersect(const Range& a, const Range& b) const {
0053     if (a.first > b.second || b.first > a.second)
0054       return false;
0055     else
0056       return true;
0057   }
0058 };
0059 
0060 #endif  //TR_LayerCollector_H_