00001 #ifndef TrackReco_TransientTrack_h 00002 #define TrackReco_TransientTrack_h 00003 00004 00012 #include "TrackingTools/TransientTrack/interface/BasicTransientTrack.h" 00013 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" 00014 00015 #include "DataFormats/TrackReco/interface/Track.h" 00016 #include "DataFormats/TrackReco/interface/TrackFwd.h" 00017 #include "DataFormats/Common/interface/RefToBase.h" 00018 00019 namespace reco { 00020 00021 class TransientTrack : private BasicTransientTrack::Proxy { 00022 00023 typedef BasicTransientTrack::Proxy Base; 00024 00025 public: 00026 00027 TransientTrack() {} 00028 00029 explicit TransientTrack( BasicTransientTrack * btt ) : Base(btt) {} 00030 00031 ~TransientTrack() {} 00032 00033 00034 #if defined( __GXX_EXPERIMENTAL_CXX0X__) 00035 00036 TransientTrack(TransientTrack const & rh) : 00037 Base(rh){} 00038 00039 00040 TransientTrack(TransientTrack && rh) : 00041 Base(std::move(rh)){} 00042 00043 TransientTrack & operator=(TransientTrack && rh) { 00044 this->Base::operator=(std::move(rh)); 00045 // Base::swap(rh); 00046 return *this; 00047 } 00048 00049 TransientTrack & operator=(TransientTrack const & rh) { 00050 this->Base::operator=(rh); 00051 return *this; 00052 } 00053 00054 00055 #else 00056 00057 void swap(TransientTrack & rh) { 00058 Base::swap(rh); 00059 } 00060 #endif 00061 00062 TransientTrack( const Track & tk , const MagneticField* field); 00063 TransientTrack( const TrackRef & tk , const MagneticField* field); 00064 00065 TransientTrack( const TrackRef & tk , const MagneticField* field, const edm::ESHandle<GlobalTrackingGeometry>& trackingGeometry); 00066 00067 TransientTrack( const Track & tk , const MagneticField* field, const edm::ESHandle<GlobalTrackingGeometry>& trackingGeometry); 00068 00069 00070 00071 void setES(const edm::EventSetup& es) {sharedData().setES(es);} 00072 00073 void setTrackingGeometry(const edm::ESHandle<GlobalTrackingGeometry>& tg) 00074 {sharedData().setTrackingGeometry(tg);} 00075 00076 void setBeamSpot(const reco::BeamSpot& beamSpot) 00077 {sharedData().setBeamSpot(beamSpot);} 00078 00079 FreeTrajectoryState initialFreeState() const {return data().initialFreeState();} 00080 00081 TrajectoryStateOnSurface outermostMeasurementState() const 00082 {return data().outermostMeasurementState();} 00083 00084 TrajectoryStateOnSurface innermostMeasurementState() const 00085 {return data().innermostMeasurementState();} 00086 00087 TrajectoryStateClosestToPoint 00088 trajectoryStateClosestToPoint( const GlobalPoint & point ) const 00089 {return data().trajectoryStateClosestToPoint(point);} 00090 00091 TrajectoryStateOnSurface stateOnSurface(const GlobalPoint & point) const 00092 {return data().stateOnSurface(point);} 00093 00094 TrajectoryStateClosestToPoint impactPointTSCP() const 00095 {return data().impactPointTSCP();} 00096 00097 TrajectoryStateOnSurface impactPointState() const 00098 {return data().impactPointState();} 00099 00100 bool impactPointStateAvailable() const 00101 {return data().impactPointStateAvailable();} 00102 00103 TrackCharge charge() const {return data().charge();} 00104 00105 bool operator== (const TransientTrack & other) const 00106 {return &(data()) == &(other.data());} 00107 // {return (a.persistentTrackRef()==tkr_);} 00108 00109 bool operator< (const TransientTrack & other) const 00110 {return &(data()) < &(other.data());} 00111 // {return (initialFTS.momentum().z()<a.initialFreeState().momentum().z());} 00112 00113 const MagneticField* field() const {return data().field();} 00114 00115 const BasicTransientTrack* basicTransientTrack() const {return &(data());} 00116 00117 const Track & track() const {return data().track();} 00118 00119 TrackBaseRef trackBaseRef() const {return data().trackBaseRef();} 00120 00121 TrajectoryStateClosestToBeamLine stateAtBeamLine() const 00122 {return data().stateAtBeamLine();} 00123 00124 // Methods forwarded to original track. 00125 00127 trackingRecHit_iterator recHitsBegin() const { return track().recHitsBegin(); } 00129 trackingRecHit_iterator recHitsEnd() const { return track().recHitsEnd(); } 00131 TrackingRecHitRef recHit( size_t i ) const { return track().recHit( i ); } 00133 size_t recHitsSize() const { return track().recHitsSize(); } 00134 // hit pattern 00135 const HitPattern & hitPattern() const { return track().hitPattern(); } 00137 unsigned short numberOfValidHits() const { return track().hitPattern().numberOfValidHits(); } 00139 unsigned short numberOfLostHits() const { return track().hitPattern().numberOfLostHits(); } 00141 double chi2() const { return track().chi2(); } 00143 double ndof() const { return track().ndof(); } 00145 double normalizedChi2() const { return track().chi2() / track().ndof(); } 00146 00148 bool isValid() const {return Base::isValid() ;} 00149 00150 }; 00151 00152 } 00153 00154 #endif