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 #include "RecoTracker/MeasurementDet/interface/TkStripMeasurementDet.h"
00010
00011
00012 class OnDemandMeasurementTracker : public MeasurementTracker {
00013 public:
00015 OnDemandMeasurementTracker(const edm::ParameterSet& conf,
00016 const PixelClusterParameterEstimator* pixelCPE,
00017 const StripClusterParameterEstimator* stripCPE,
00018 const SiStripRecHitMatcher* hitMatcher,
00019 const TrackerGeometry* trackerGeom,
00020 const GeometricSearchTracker* geometricSearchTracker,
00021 const SiStripQuality *stripQuality,
00022 int stripQualityFlags,
00023 int stripQualityDebugFlags,
00024 const SiPixelQuality *pixelQuality,
00025 const SiPixelFedCabling *pixelCabling,
00026 int pixelQualityFlags,
00027 int pixelQualityDebugFlags,
00028 const SiStripRegionCabling * stripRegionCabling,
00029 bool isRegional=false);
00031 virtual ~OnDemandMeasurementTracker() {}
00032
00034 void update( const edm::Event&) const;
00035 void updateStrips( const edm::Event& event) const;
00036
00037 typedef edm::LazyGetter<SiStripCluster> LazyGetter;
00038 typedef edm::RefGetter<SiStripCluster> RefGetter;
00039
00041 void define(const edm::Handle< edm::LazyGetter<SiStripCluster> > & ,
00042 std::auto_ptr< RefGetter > & ) const;
00043
00045 virtual const MeasurementDet* idToDet(const DetId& id) const;
00046
00047 private:
00049 std::string category_;
00051 bool StayPacked_;
00052
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< edmNew::DetSetVector<TkStripMeasurementDet::SiStripRegionalClusterRef> > theStripClusterRefs;
00067 class DetODStatus {
00068 public:
00069 DetODStatus(MeasurementDet * m):defined(false),updated(false),mdet(m){ region_range = std::pair<unsigned int,unsigned int>(0,0);}
00070 bool defined;
00071 bool updated;
00072 std::pair<unsigned int, unsigned int> region_range;
00073 MeasurementDet * mdet;
00074 };
00075
00076 typedef std::map<DetId, DetODStatus> DetODContainer;
00078 mutable DetODContainer theDetODMap;
00079
00081 mutable std::map<SiStripRegionCabling::ElementIndex, std::vector< DetODContainer::iterator> > region_mapping;
00082
00084 void assign(const TkStripMeasurementDet * csmdet,
00085 DetODContainer::iterator * alreadyFound=0) const;
00086
00088 std::string dumpCluster(const std::vector<SiStripCluster> ::const_iterator & begin, const std::vector<SiStripCluster> ::const_iterator& end)const;
00089 std::string dumpRegion(std::pair<unsigned int,unsigned int> indexes,
00090 const RefGetter & theGetter,
00091 bool stayUnpacked = false)const;
00092
00093 mutable std::vector<uint32_t> theRawInactiveStripDetIds;
00094 };
00095
00096 #endif