CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/RecoTracker/TkTrackingRegions/interface/TrackingRegionBase.h

Go to the documentation of this file.
00001 #ifndef TrackingRegionBase_H
00002 #define TrackingRegionBase_H
00003 
00008 #include <utility>
00009 
00010 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h"
00011 #include "RecoTracker/TkMSParametrization/interface/PixelRecoRange.h"
00012 #include "FWCore/Framework/interface/EventSetup.h"
00013 #include <sstream>
00014 class BarrelDetLayer;
00015 class ForwardDetLayer; 
00016 
00017 class TrackingRegionBase : public TrackingRegion {
00018 
00019 public:
00020 
00021   TrackingRegionBase( const GlobalVector & direction,
00022                   const GlobalPoint &  originPos,
00023                   const Range        & invPtRange,
00024                   const float &        originRBound,
00025                   const float &        originZBound)
00026     : theDirection( direction), theVertexPos( originPos), 
00027       theInvPtRange( invPtRange), theVertexRBound( originRBound),
00028       theVertexZBound( originZBound) { }    
00029 
00031   TrackingRegionBase() { }
00032 
00034   virtual ~TrackingRegionBase() { }
00035 
00037   virtual GlobalVector direction() const { return theDirection; } 
00038 
00043   virtual GlobalPoint  origin() const { return theVertexPos; }
00044 
00046   virtual float originRBound() const { return theVertexRBound; }
00047 
00049   virtual float originZBound() const { return theVertexZBound; }
00050 
00052   virtual float ptMin()  const { 
00053     return 1./std::max(fabs(theInvPtRange.max()), fabs(theInvPtRange.min())); 
00054   } 
00055 
00057   virtual Range        invPtRange() const { return theInvPtRange; }
00058 
00059  
00060 
00063     virtual HitRZCompatibility * checkRZ(const DetLayer* layer,  
00064                                          const Hit & outerHit,
00065                                          const edm::EventSetup& iSetup) const = 0;
00066 
00068   virtual TrackingRegionBase* restrictedRegion( const GlobalPoint &  originPos,
00069       const float & originRBound, const float & originZBound) const {
00070       TrackingRegionBase* restr = clone();
00071       restr->theVertexPos = originPos;
00072       restr->theVertexRBound = originRBound;
00073       restr->theVertexZBound = originZBound;
00074       return restr;
00075   } 
00076 
00077   virtual TrackingRegionBase* clone() const = 0;
00078 
00079   virtual std::string print() const {
00080     std::ostringstream str;
00081     str << name() <<" dir:"<<theDirection<<" vtx:"<<theVertexPos 
00082         <<" dr:"<<theVertexRBound<<" dz:"<<theVertexZBound<<" pt:"<<1./theInvPtRange.max();
00083     return str.str();
00084   }
00085 
00086   virtual void setDirection(const GlobalVector & dir ) { theDirection = dir; }
00087 
00088 private:
00089   
00090   GlobalVector theDirection;
00091   GlobalPoint  theVertexPos;
00092   Range        theInvPtRange;
00093   float        theVertexRBound;
00094   float        theVertexZBound;
00095 
00096 };
00097 
00098 #endif