00001 #ifndef TrackingTools_TrackRefitter_TrackTransformer_H 00002 #define TrackingTools_TrackRefitter_TrackTransformer_H 00003 00018 #include "FWCore/Framework/interface/ESHandle.h" 00019 00020 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h" 00021 #include "MagneticField/Engine/interface/MagneticField.h" 00022 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h" 00023 00024 #include "DataFormats/TrackReco/interface/TrackFwd.h" 00025 namespace edm {class ParameterSet; class EventSetup;} 00026 namespace reco {class TransientTrack;} 00027 00028 class TrajectoryFitter; 00029 class TrajectorySmoother; 00030 class Propagator; 00031 class TransientTrackingRecHitBuilder; 00032 class Trajectory; 00033 00034 class TrackTransformer{ 00035 00036 public: 00037 00039 TrackTransformer(const edm::ParameterSet&); 00040 00042 virtual ~TrackTransformer(); 00043 00044 // Operations 00045 00047 std::vector<Trajectory> transform(const reco::Track&) const; 00048 00050 std::vector<Trajectory> transform(const reco::TrackRef&) const; 00051 00053 std::vector<Trajectory> transform(const reco::Track&, 00054 const reco::TransientTrack, 00055 TransientTrackingRecHit::ConstRecHitContainer) const; 00056 00058 const MagneticField* magneticField() const {return &*theMGField;} 00059 00061 edm::ESHandle<GlobalTrackingGeometry> trackingGeometry() const {return theTrackingGeometry;} 00062 00064 void setServices(const edm::EventSetup&); 00065 00067 edm::ESHandle<TrajectoryFitter> refitter() const {return theFitter;} 00068 00070 edm::ESHandle<TrajectorySmoother> smoother() const {return theSmoother;} 00071 00072 TransientTrackingRecHit::ConstRecHitContainer 00073 getTransientRecHits(const reco::TransientTrack& track) const; 00074 00075 protected: 00076 00077 private: 00078 std::string thePropagatorName; 00079 edm::ESHandle<Propagator> propagator() const {return thePropagator;} 00080 edm::ESHandle<Propagator> thePropagator; 00081 00082 enum RefitDirection{insideOut,outsideIn,undetermined}; 00083 00084 unsigned long long theCacheId_TC; 00085 unsigned long long theCacheId_GTG; 00086 unsigned long long theCacheId_MG; 00087 unsigned long long theCacheId_TRH; 00088 00089 bool theRPCInTheFit; 00090 00091 RefitDirection theRefitDirection; 00092 00093 edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry; 00094 edm::ESHandle<MagneticField> theMGField; 00095 00096 std::string theFitterName; 00097 edm::ESHandle<TrajectoryFitter> theFitter; 00098 00099 std::string theSmootherName; 00100 edm::ESHandle<TrajectorySmoother> theSmoother; 00101 00102 00103 RefitDirection 00104 checkRecHitsOrdering(TransientTrackingRecHit::ConstRecHitContainer&) const; 00105 00106 std::string theTrackerRecHitBuilderName; 00107 edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder; 00108 00109 std::string theMuonRecHitBuilderName; 00110 edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder; 00111 }; 00112 #endif 00113