CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoTracker/MeasurementDet/plugins/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 "MeasurementTrackerImpl.h"
00006 #include "DataFormats/Common/interface/RefGetter.h" 
00007 #include "CalibFormats/SiStripObjects/interface/SiStripRegionCabling.h"
00008 #include "DataFormats/Common/interface/ContainerMask.h"
00009 
00010 #include "TkStripMeasurementDet.h"
00011 #include<unordered_map>
00012  
00013 class OnDemandMeasurementTracker : public MeasurementTrackerImpl {
00014 public:
00016   OnDemandMeasurementTracker(const edm::ParameterSet&              conf,
00017                              const PixelClusterParameterEstimator* pixelCPE,
00018                              const StripClusterParameterEstimator* stripCPE,
00019                              const SiStripRecHitMatcher*  hitMatcher,
00020                              const TrackerGeometry*  trackerGeom,
00021                              const GeometricSearchTracker* geometricSearchTracker,
00022                              const SiStripQuality *stripQuality,
00023                              int   stripQualityFlags,
00024                              int   stripQualityDebugFlags,
00025                              const SiPixelQuality *pixelQuality,
00026                              const SiPixelFedCabling *pixelCabling,
00027                              int   pixelQualityFlags,
00028                              int   pixelQualityDebugFlags,
00029                              const SiStripRegionCabling * stripRegionCabling,
00030                              bool  isRegional=false);
00032   virtual ~OnDemandMeasurementTracker() {}
00033  
00035   void update( const edm::Event&) const;
00036   void updateStrips( const edm::Event& event) const;
00037 
00038   typedef edm::LazyGetter<SiStripCluster> LazyGetter;
00039   typedef edm::RefGetter<SiStripCluster> RefGetter;
00040 
00042   void define(const edm::Handle< edm::LazyGetter<SiStripCluster> > & ,
00043               std::auto_ptr< RefGetter > &  ) const;
00044 
00046   virtual const MeasurementDet*       idToDet(const DetId& id) const;
00047     
00048  private:
00050   std::string category_;
00052   bool StayPacked_;
00054   bool StripOnDemand_;
00056   bool PixelOnDemand_;
00057   
00059   const  SiStripRegionCabling * theStripRegionCabling;
00060   
00062   mutable edm::Handle< edm::RefGetter<SiStripCluster> > theRefGetterH;
00063   mutable edm::Handle< edm::LazyGetter<SiStripCluster> > theLazyGetterH;
00064   mutable bool theSkipClusterRefs;
00065   mutable edm::Handle< edm::ContainerMask<edm::LazyGetter<SiStripCluster> > > theStripClusterMask;
00066   //mutable std::vector<bool> theClustersToSkip;
00068   class DetODStatus {
00069   public:
00070     // FIXME shall surely exits a better way to distinguish glued from single!
00071     DetODStatus(MeasurementDet * m): mdet(m), region_range(0,0), defined(false),updated(false),glued(!m->fastGeomDet().components().empty()) {}
00072     MeasurementDet * mdet;
00073     std::pair<unsigned int, unsigned int> region_range;
00074     bool defined;
00075     bool updated;
00076     bool glued;
00077   };
00078   
00079   typedef std::unordered_map<unsigned int, DetODStatus> DetODContainer;
00081   mutable DetODContainer theDetODMap;
00082   
00084   typedef std::vector<std::pair<SiStripRegionCabling::ElementIndex, std::vector<DetODContainer::const_iterator> > > RegionalMap;
00085   RegionalMap region_mapping;
00086 
00088     void assign(const  TkStripMeasurementDet * csmdet,
00089               DetODContainer::iterator * alreadyFound=0) const;
00090 
00092   std::string dumpCluster(const std::vector<SiStripCluster> ::const_iterator & begin, const  std::vector<SiStripCluster> ::const_iterator& end)const;
00093   std::string dumpRegion(std::pair<unsigned int,unsigned int> indexes,
00094                          const RefGetter & theGetter,
00095                          bool stayUnpacked = false)const;
00096 
00097   mutable std::vector<uint32_t> theRawInactiveStripDetIds;
00098       
00099 };
00100 
00101 #endif