00001 #ifndef TransientTrackingRecHit_H 00002 #define TransientTrackingRecHit_H 00003 00004 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" 00005 #include "Geometry/CommonDetUnit/interface/GeomDet.h" 00006 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" 00007 #include "DataFormats/GeometrySurface/interface/Surface.h" 00008 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h" 00009 #include "DataFormats/GeometrySurface/interface/BlockWipedAllocator.h" 00010 00011 #include "FWCore/Utilities/interface/GCC11Compatibility.h" 00012 00013 class GeomDetUnit; 00014 00015 #ifdef COUNT_HITS 00016 void countTTRH( TrackingRecHit::Type); 00017 #else 00018 inline void countTTRH( TrackingRecHit::Type){} 00019 #endif 00020 00021 00022 class TransientTrackingRecHit : public TrackingRecHit, 00023 public ReferenceCountedInEvent { 00024 public: 00025 00026 typedef ReferenceCountingPointer< TransientTrackingRecHit> RecHitPointer; 00027 typedef ConstReferenceCountingPointer< TransientTrackingRecHit> ConstRecHitPointer; 00028 typedef std::vector<ConstRecHitPointer> RecHitContainer; 00029 typedef std::vector<ConstRecHitPointer> ConstRecHitContainer; 00030 00031 00032 TransientTrackingRecHit(){} 00033 explicit TransientTrackingRecHit(TrackingRecHit::id_type id, Type type=valid) : 00034 TrackingRecHit(id, type) 00035 {countTTRH(type);} 00036 00037 explicit TransientTrackingRecHit(TrackingRecHit const & rh) : 00038 TrackingRecHit(rh.geographicalId(), rh.type()) 00039 {countTTRH(type());} 00040 00041 virtual ~TransientTrackingRecHit(){} 00042 00043 00044 // Extension of the TrackingRecHit interface 00045 00047 00048 virtual const GeomDet * det() const =0; 00049 virtual const Surface * surface() const {return &(det()->surface());} 00050 00054 virtual const GeomDetUnit * detUnit() const; 00055 00056 virtual GlobalPoint globalPosition() const =0; 00057 virtual GlobalError globalPositionError() const =0; 00058 00059 virtual float errorGlobalR() const=0; 00060 virtual float errorGlobalZ() const=0; 00061 virtual float errorGlobalRPhi() const=0; 00062 00067 virtual RecHitPointer clone (const TrajectoryStateOnSurface&) const; 00068 00073 virtual bool canImproveWithTrack() const {return false;} 00074 00075 virtual const TrackingRecHit * hit() const = 0; 00076 00077 // clone the corresponding Persistent Hit 00078 virtual TrackingRecHit * cloneHit() const = 0; 00079 00081 virtual ConstRecHitContainer transientHits() const; 00082 00083 00085 virtual float clusterProbability() const { return 1.f; } 00086 00087 private: 00088 00089 // hide the clone method for ReferenceCounted. Warning: this method is still 00090 // accessible via the bas class TrackingRecHit interface! 00091 virtual TransientTrackingRecHit * clone() const = 0; 00092 00093 }; 00094 00095 #endif 00096