Go to the documentation of this file.00001 #ifndef TkPixelMeasurementDet_H
00002 #define TkPixelMeasurementDet_H
00003
00004 #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h"
00005 #include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h"
00006
00007 #include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
00008 #include "DataFormats/Common/interface/Handle.h"
00009 #include "DataFormats/Common/interface/DetSetVector.h"
00010 #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
00011
00012 class TransientTrackingRecHit;
00013 class LocalTrajectoryParameters;
00014
00015 class TkPixelMeasurementDet : public MeasurementDet {
00016 public:
00017
00018 typedef edm::Ref<edmNew::DetSetVector<SiPixelCluster>, SiPixelCluster> SiPixelClusterRef;
00019
00020 typedef edmNew::DetSet<SiPixelCluster> detset;
00021 typedef detset::const_iterator const_iterator;
00022 typedef PixelClusterParameterEstimator::LocalValues LocalValues;
00023
00024 TkPixelMeasurementDet( const GeomDet* gdet,
00025 const PixelClusterParameterEstimator* cpe);
00026
00027 void update( const detset & detSet,
00028 const edm::Handle<edmNew::DetSetVector<SiPixelCluster> > h,
00029 unsigned int id ) {
00030 detSet_ = detSet;
00031 handle_ = h;
00032 id_ = id;
00033 empty = false;
00034 activeThisEvent_ = true;
00035 }
00036 void setEmpty(){empty = true; activeThisEvent_ = true; }
00037
00038 virtual ~TkPixelMeasurementDet() { }
00039
00040 virtual RecHitContainer recHits( const TrajectoryStateOnSurface& ) const;
00041
00042 virtual std::vector<TrajectoryMeasurement>
00043 fastMeasurements( const TrajectoryStateOnSurface& stateOnThisDet,
00044 const TrajectoryStateOnSurface& startingState,
00045 const Propagator&,
00046 const MeasurementEstimator&) const;
00047
00048 const PixelGeomDetUnit& specificGeomDet() const {return *thePixelGDU;}
00049
00050 TransientTrackingRecHit::RecHitPointer
00051 buildRecHit( const SiPixelClusterRef & cluster,
00052 const LocalTrajectoryParameters & ltp) const;
00053
00056 void setActive(bool active) { activeThisPeriod_ = active; activeThisEvent_ = true; if (!active) empty = true; }
00059 void setActiveThisEvent(bool active) { activeThisEvent_ = active; if (!active) empty = true; }
00061 bool isActive() const { return activeThisEvent_ && activeThisPeriod_; }
00062
00063 bool hasBadComponents( const TrajectoryStateOnSurface &tsos ) const ;
00064
00066 void setBadRocPositions(std::vector< LocalPoint > & positions) { badRocPositions_.swap(positions); }
00068 void clearBadRocPositions() { badRocPositions_.clear(); }
00069 private:
00070
00071 const PixelGeomDetUnit* thePixelGDU;
00072 const PixelClusterParameterEstimator* theCPE;
00073 detset detSet_;
00074 edm::Handle<edmNew::DetSetVector<SiPixelCluster> > handle_;
00075 unsigned int id_;
00076 bool empty;
00077 bool activeThisEvent_, activeThisPeriod_;
00078 std::vector< LocalPoint > badRocPositions_;
00079
00080 static const float theRocWidth, theRocHeight;
00081
00082 std::set<SiPixelClusterRef> skipClusters_;
00083 public:
00084
00085 inline bool accept(SiPixelClusterRefNew & r) const {
00086 return skipClusters_.find(r) == skipClusters_.end();
00087 }
00088 inline void unset(){
00089 skipClusters_.clear();
00090 }
00091 template <typename IT>
00092 void setClusterToSkip(IT begin, IT end){
00093 skipClusters_.clear();
00094 skipClusters_.insert(begin,end);
00095 }
00096 };
00097
00098 #endif