00001 #ifndef MeasurementTracker_H 00002 #define MeasurementTracker_H 00003 00004 #include "TrackingTools/MeasurementDet/interface/MeasurementDetSystem.h" 00005 #include "DataFormats/DetId/interface/DetId.h" 00006 #include "RecoLocalTracker/ClusterParameterEstimator/interface/StripClusterParameterEstimator.h" 00007 #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h" 00008 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00009 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" 00010 #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h" 00011 00012 #include "FWCore/Framework/interface/EDProducer.h" 00013 #include "FWCore/Framework/interface/Event.h" 00014 #include "DataFormats/Common/interface/Handle.h" 00015 #include "FWCore/Framework/interface/EventSetup.h" 00016 #include "FWCore/Framework/interface/ESHandle.h" 00017 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00018 00019 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h" 00020 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h" 00021 #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h" 00022 00023 #include <map> 00024 #include <vector> 00025 00026 class StrictWeakOrdering{ 00027 public: 00028 bool operator() ( uint32_t p,const uint32_t& i) const {return p < i;} 00029 }; 00030 class TkStripMeasurementDet; 00031 class TkPixelMeasurementDet; 00032 class TkGluedMeasurementDet; 00033 class GeometricSearchTracker; 00034 class SiStripRecHitMatcher; 00035 class GluedGeomDet; 00036 00037 class MeasurementTracker : public MeasurementDetSystem { 00038 public: 00039 enum QualityFlags { BadModules=1, BadAPVFibers=2, BadStrips=4, MaskBad128StripBlocks=8 }; 00040 00041 MeasurementTracker(const edm::ParameterSet& conf, 00042 const PixelClusterParameterEstimator* pixelCPE, 00043 const StripClusterParameterEstimator* stripCPE, 00044 const SiStripRecHitMatcher* hitMatcher, 00045 const TrackerGeometry* trackerGeom, 00046 const GeometricSearchTracker* geometricSearchTracker, 00047 const SiStripQuality *quality, 00048 int qualityFlags, 00049 int qualityDebugFlags, 00050 bool isRegional=false); 00051 00052 virtual ~MeasurementTracker(); 00053 00054 virtual void update( const edm::Event&) const; 00055 void updatePixels( const edm::Event&) const; 00056 void updateStrips( const edm::Event&) const; 00057 00058 const TrackingGeometry* geomTracker() const { return theTrackerGeom;} 00059 00060 const GeometricSearchTracker* geometricSearchTracker() const {return theGeometricSearchTracker;} 00061 00063 virtual const MeasurementDet* idToDet(const DetId& id) const; 00064 00065 typedef std::map<DetId,MeasurementDet*> DetContainer; 00066 00068 const DetContainer& allDets() const {return theDetMap;} 00069 const std::vector<TkStripMeasurementDet*>& stripDets() const {return theStripDets;} 00070 const std::vector<TkPixelMeasurementDet*>& pixelDets() const {return thePixelDets;} 00071 const std::vector<TkGluedMeasurementDet*>& gluedDets() const {return theGluedDets;} 00072 00073 00074 protected: 00075 const edm::ParameterSet& pset_; 00076 const std::string name_; 00077 00078 mutable DetContainer theDetMap; 00079 mutable std::vector<TkStripMeasurementDet*> theStripDets; 00080 mutable std::vector<TkPixelMeasurementDet*> thePixelDets; 00081 mutable std::vector<TkGluedMeasurementDet*> theGluedDets; 00082 00083 const PixelClusterParameterEstimator* thePixelCPE; 00084 const StripClusterParameterEstimator* theStripCPE; 00085 const SiStripRecHitMatcher* theHitMatcher; 00086 const TrackerGeometry* theTrackerGeom; 00087 const GeometricSearchTracker* theGeometricSearchTracker; 00088 const SiStripQuality* theStripQuality; 00089 00090 bool isRegional_; 00091 00092 void initialize() const; 00093 00094 void addStripDet( const GeomDet* gd, 00095 const StripClusterParameterEstimator* cpe) const; 00096 void addPixelDet( const GeomDet* gd, 00097 const PixelClusterParameterEstimator* cpe) const; 00098 00099 void addGluedDet( const GluedGeomDet* gd, const SiStripRecHitMatcher* matcher) const; 00100 00101 void addPixelDets( const TrackingGeometry::DetContainer& dets) const; 00102 00103 void addStripDets( const TrackingGeometry::DetContainer& dets) const; 00104 00105 void initializeStripStatus (const SiStripQuality *stripQuality, int qualityFlags, int qualityDebugFlags) const; 00106 }; 00107 00108 #endif