00001 #ifndef RecoMuon_GlobalTrackingTools_GlobalMuonRefitter_H 00002 #define RecoMuon_GlobalTrackingTools_GlobalMuonRefitter_H 00003 00015 #include "DataFormats/Common/interface/Handle.h" 00016 00017 #include "FWCore/Framework/interface/ESHandle.h" 00018 #include "FWCore/ParameterSet/interface/InputTag.h" 00019 #include "DataFormats/TrackReco/interface/TrackFwd.h" 00020 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00021 00022 #include "RecoMuon/TrackingTools/interface/MuonTrajectoryBuilder.h" 00023 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h" 00024 #include "TrackingTools/TrackRefitter/interface/TrackTransformer.h" 00025 00026 namespace edm {class Event;} 00027 namespace reco {class TransientTrack;} 00028 00029 class TrajectoryStateOnSurface; 00030 00031 class MuonDetLayerMeasurements; 00032 class MuonServiceProxy; 00033 class Trajectory; 00034 00035 class TrackTransformer; 00036 class TrajectoryFitter; 00037 00038 class GlobalMuonRefitter : public TrackTransformer { 00039 00040 public: 00041 00042 typedef TransientTrackingRecHit::RecHitContainer RecHitContainer; 00043 typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer; 00044 typedef TransientTrackingRecHit::RecHitPointer RecHitPointer; 00045 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer; 00046 00047 typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer; 00048 typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer; 00049 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer; 00050 typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer; 00051 00052 typedef std::vector<Trajectory> TC; 00053 typedef TC::const_iterator TI; 00054 00055 public: 00056 00058 GlobalMuonRefitter(const edm::ParameterSet&, const MuonServiceProxy*); 00059 00061 virtual ~GlobalMuonRefitter(); 00062 00064 virtual void setEvent(const edm::Event&); 00065 00067 std::vector<Trajectory> refit(const reco::Track& globalTrack , const int theMuonHitsOption) const; 00068 00069 protected: 00070 00071 enum RefitDirection{inToOut,outToIn,undetermined}; 00072 00074 void checkMuonHits(const reco::Track&, ConstRecHitContainer&, 00075 ConstRecHitContainer&, 00076 std::vector<int>&) const; 00077 00079 ConstRecHitContainer selectMuonHits(const Trajectory&, 00080 const std::vector<int>&) const; 00081 00083 void printHits(const ConstRecHitContainer&) const; 00084 00085 RefitDirection checkRecHitsOrdering(const ConstRecHitContainer&) const; 00086 00087 const MuonServiceProxy* service() const { return theService; } 00088 00089 protected: 00090 std::string theCategory; 00091 bool theTkTrajsAvailableFlag; 00092 float thePtCut; 00093 00094 private: 00095 00096 MuonDetLayerMeasurements* theLayerMeasurements; 00097 const MuonServiceProxy* theService; 00098 TrackTransformer* theTrackTransformer; 00099 00100 int theMuonHitsOption; 00101 float theProbCut; 00102 int theHitThreshold; 00103 float theDTChi2Cut; 00104 float theCSCChi2Cut; 00105 float theRPCChi2Cut; 00106 00107 const edm::Event* theEvent; 00108 00109 }; 00110 #endif