00001 #ifndef TkNavigation_LayerCollector_H_ 00002 #define TkNavigation_LayerCollector_H_ 00003 00012 #include "TrackingTools/GeomPropagators/interface/Propagator.h" 00013 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" 00014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" 00015 #include "RecoTracker/TkNavigation/interface/StartingLayerFinder.h" 00016 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" 00017 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h" 00018 00019 00020 00021 00022 class LayerCollector { 00023 00024 private: 00025 00026 typedef FreeTrajectoryState FTS; 00027 typedef TrajectoryStateOnSurface TSOS; 00028 typedef std::pair<float, float> Range; 00029 00030 public: 00031 00032 LayerCollector(const Propagator* aPropagator, 00033 const StartingLayerFinder* aFinder, 00034 float dr, 00035 float dz) : 00036 thePropagator(aPropagator), 00037 theStartingLayerFinder(aFinder), 00038 theDeltaR(dr), 00039 theDeltaZ(dz) { } 00040 00041 ~LayerCollector() {} 00042 00043 std::vector<const DetLayer*> allLayers(const FTS& aFts) const; 00044 std::vector<const BarrelDetLayer*> barrelLayers(const FTS& aFts) const; 00045 std::vector<const ForwardDetLayer*> forwardLayers(const FTS& aFts) const; 00046 00047 const Propagator* propagator() const {return thePropagator;} 00048 const StartingLayerFinder* finder() const {return theStartingLayerFinder;} 00049 float deltaR() const {return theDeltaR;} 00050 float deltaZ() const {return theDeltaZ;} 00051 00052 private: 00053 00054 const Propagator* thePropagator; 00055 const StartingLayerFinder* theStartingLayerFinder; 00056 float theDeltaR; 00057 float theDeltaZ; 00058 00059 00060 00061 inline bool rangesIntersect( const Range& a, const Range& b) const { 00062 if ( a.first > b.second || b.first > a.second) return false; 00063 else return true; 00064 } 00065 00066 00067 }; 00068 00069 #endif //TR_LayerCollector_H_