CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoTracker/TkNavigation/interface/StartingLayerFinder.h

Go to the documentation of this file.
00001 #ifndef TkNavigation_StartingLayerFinder_H_
00002 #define TkNavigation_StartingLayerFinder_H_
00003 
00004 
00005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00006 #include "FWCore/Framework/interface/EventSetup.h"
00007 #include "FWCore/Framework/interface/Event.h"
00008 
00009 
00010 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00011 #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h"
00012 #include "TrackingTools/DetLayers/interface/ForwardDetLayer.h"
00013 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00014 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
00015 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00016 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00017 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00018 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
00019 
00020 #include <vector>
00021 
00027 class PTrajectoryStateOnDet;
00028 
00029 class StartingLayerFinder {
00030 
00031 private:
00032 
00033   typedef FreeTrajectoryState FTS;
00034   typedef TrajectoryStateOnSurface TSOS;
00035   typedef std::pair<float, float> Range;
00036 
00037 public: 
00038 
00039   StartingLayerFinder(const Propagator* aPropagator, const MeasurementTracker*  tracker ) :
00040 
00041     thePropagator(aPropagator),
00042     theMeasurementTracker(tracker),
00043     thePixelLayersValid(false),
00044     theFirstPixelBarrelLayer(0),
00045     theFirstNegPixelFwdLayer(0),
00046     theFirstPosPixelFwdLayer(0) { }
00047 
00048   ~StartingLayerFinder() {}
00049 
00050   std::vector<const DetLayer*> startingLayers(const FTS& aFts, float dr, float dz) const;
00051   
00052 
00053   std::vector<const DetLayer*> startingLayers(const TrajectorySeed& aSeed) const;
00054 
00055   const BarrelDetLayer* firstPixelBarrelLayer() const;
00056   const std::vector<ForwardDetLayer*> firstNegPixelFwdLayer() const;
00057   const std::vector<ForwardDetLayer*> firstPosPixelFwdLayer() const;
00058 
00059   const Propagator* propagator() const {return thePropagator;}
00060 
00061 
00062 
00063 private:
00064 
00065   const Propagator* thePropagator;
00066   const MeasurementTracker*     theMeasurementTracker;
00067   mutable bool thePixelLayersValid;
00068   mutable BarrelDetLayer* theFirstPixelBarrelLayer;
00069   mutable std::vector<ForwardDetLayer*> theFirstNegPixelFwdLayer;
00070   mutable std::vector<ForwardDetLayer*> theFirstPosPixelFwdLayer;
00071 
00072 
00073   void checkPixelLayers() const;
00074   
00075   
00076   
00077   inline bool rangesIntersect( const Range& a, const Range& b) const {
00078     if ( a.first > b.second || b.first > a.second) return false;
00079     else return true;
00080   }
00081 
00082 
00083 
00084 
00085 };
00086 #endif //TR_StartingLayerFinder_H_