CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoTracker/MeasurementDet/interface/OnDemandMeasurementTracker.h

Go to the documentation of this file.
00001 #ifndef RecoTracker_MeasurementDet_OnDemandMeasurementTracker_H
00002 #define RecoTracker_MeasurementDet_OnDemandMeasurementTracker_H
00003 
00004 #include "TrackingTools/MeasurementDet/interface/MeasurementDetSystem.h"
00005 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00006 #include "DataFormats/Common/interface/RefGetter.h" 
00007 #include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h"
00008 
00009  
00010 class OnDemandMeasurementTracker : public MeasurementTracker {
00011 public:
00013   OnDemandMeasurementTracker(const edm::ParameterSet&              conf,
00014                              const PixelClusterParameterEstimator* pixelCPE,
00015                              const StripClusterParameterEstimator* stripCPE,
00016                              const SiStripRecHitMatcher*  hitMatcher,
00017                              const TrackerGeometry*  trackerGeom,
00018                              const GeometricSearchTracker* geometricSearchTracker,
00019                              const SiStripQuality *stripQuality,
00020                              int   stripQualityFlags,
00021                              int   stripQualityDebugFlags,
00022                              const SiPixelQuality *pixelQuality,
00023                              const SiPixelFedCabling *pixelCabling,
00024                              int   pixelQualityFlags,
00025                              int   pixelQualityDebugFlags,
00026                              const SiStripRegionCabling * stripRegionCabling,
00027                              bool  isRegional=false);
00029   virtual ~OnDemandMeasurementTracker() {}
00030  
00032   void update( const edm::Event&) const;
00033   void updateStrips( const edm::Event& event) const;
00034 
00035   typedef edm::LazyGetter<SiStripCluster> LazyGetter;
00036   typedef edm::RefGetter<SiStripCluster> RefGetter;
00037 
00039   void define(const edm::Handle< edm::LazyGetter<SiStripCluster> > & ,
00040               std::auto_ptr< RefGetter > &  ) const;
00041 
00043   virtual const MeasurementDet*       idToDet(const DetId& id) const;
00044     
00045  private:
00047   std::string category_;
00049   bool StayPacked_;
00050 
00052   bool StripOnDemand_;
00054   bool PixelOnDemand_;
00055   
00057   const  SiStripRegionCabling * theStripRegionCabling;
00058   
00060   mutable edm::Handle< edm::RefGetter<SiStripCluster> > theRefGetterH;
00061   mutable edm::Handle< edm::LazyGetter<SiStripCluster> > theLazyGetterH;
00062 
00064   class DetODStatus {
00065   public:
00066     DetODStatus(MeasurementDet * m):defined(false),updated(false),mdet(m){ region_range = std::pair<unsigned int,unsigned int>(0,0);}
00067       bool defined;
00068       bool updated;
00069       std::pair<unsigned int, unsigned int> region_range;
00070       MeasurementDet * mdet;
00071   };
00072 
00073   typedef std::map<DetId, DetODStatus> DetODContainer;
00075   mutable DetODContainer theDetODMap;
00076 
00078   mutable std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::iterator> > region_mapping;
00079 
00081     void assign(const  TkStripMeasurementDet * csmdet,
00082               DetODContainer::iterator * alreadyFound=0) const;
00083 
00085   std::string dumpCluster(const std::vector<SiStripCluster> ::const_iterator & begin, const  std::vector<SiStripCluster> ::const_iterator& end)const;
00086   std::string dumpRegion(std::pair<unsigned int,unsigned int> indexes,
00087                          const RefGetter & theGetter,
00088                          bool stayUnpacked = false)const;
00089 
00090 };
00091 
00092 #endif