Go to the documentation of this file.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/Utilities/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 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
00026 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
00027
00028 namespace edm {class Event;}
00029 namespace reco {class TransientTrack;}
00030
00031 class TrajectoryStateOnSurface;
00032
00033 class MuonDetLayerMeasurements;
00034 class MuonServiceProxy;
00035 class Trajectory;
00036
00037 class TrajectoryFitter;
00038
00039 class GlobalMuonRefitter {
00040
00041 public:
00042
00043 typedef TransientTrackingRecHit::RecHitContainer RecHitContainer;
00044 typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
00045 typedef TransientTrackingRecHit::RecHitPointer RecHitPointer;
00046 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00047
00048 typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer;
00049 typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer;
00050 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
00051 typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer;
00052
00053 typedef std::vector<Trajectory> TC;
00054 typedef TC::const_iterator TI;
00055
00056 enum subDetector { PXB = 1, PXF = 2, TIB = 3, TID = 4, TOB = 5, TEC = 6 };
00057
00058 public:
00059
00061 GlobalMuonRefitter(const edm::ParameterSet&, const MuonServiceProxy*);
00062
00064 virtual ~GlobalMuonRefitter();
00065
00067 virtual void setEvent(const edm::Event&);
00068
00070 void setServices(const edm::EventSetup&);
00071
00073 std::vector<Trajectory> refit(const reco::Track& globalTrack, const int theMuonHitsOption) const;
00074
00076 std::vector<Trajectory> refit(const reco::Track& globalTrack,
00077 const reco::TransientTrack track,
00078 TransientTrackingRecHit::ConstRecHitContainer allRecHitsTemp,
00079 const int theMuonHitsOption) const;
00080
00082 std::vector<Trajectory> transform(const reco::Track& newTrack,
00083 const reco::TransientTrack track,
00084 TransientTrackingRecHit::ConstRecHitContainer recHitsForReFit) const;
00085
00086
00087 ConstRecHitContainer getRidOfSelectStationHits(ConstRecHitContainer hits) const;
00088
00089
00090 protected:
00091
00092 enum RefitDirection{insideOut,outsideIn,undetermined};
00093
00095 void checkMuonHits(const reco::Track&, ConstRecHitContainer&,
00096 std::map<DetId, int> &) const;
00097
00099 void getFirstHits(const reco::Track&, ConstRecHitContainer&,
00100 ConstRecHitContainer&) const;
00101
00103 ConstRecHitContainer selectMuonHits(const Trajectory&,
00104 const std::map<DetId, int> &) const;
00105
00107 void printHits(const ConstRecHitContainer&) const;
00108
00109 RefitDirection checkRecHitsOrdering(const ConstRecHitContainer&) const;
00110
00111 const MuonServiceProxy* service() const { return theService; }
00112
00113 protected:
00114 std::string theCategory;
00115 bool theTkTrajsAvailableFlag;
00116 float thePtCut;
00117
00118 private:
00119
00120 int theMuonHitsOption;
00121 float theProbCut;
00122 int theHitThreshold;
00123 float theDTChi2Cut;
00124 float theCSCChi2Cut;
00125 float theRPCChi2Cut;
00126 bool theCosmicFlag;
00127
00128 edm::InputTag theDTRecHitLabel;
00129 edm::InputTag theCSCRecHitLabel;
00130 edm::Handle<DTRecHitCollection> theDTRecHits;
00131 edm::Handle<CSCRecHit2DCollection> theCSCRecHits;
00132
00133 int theSkipStation;
00134 int theTrackerSkipSystem;
00135 int theTrackerSkipSection;
00136
00137 unsigned long long theCacheId_TRH;
00138
00139 std::string thePropagatorName;
00140
00141 bool theRPCInTheFit;
00142
00143 double theRescaleErrorFactor;
00144
00145 RefitDirection theRefitDirection;
00146
00147 std::vector<int> theDYTthrs;
00148
00149 std::string theFitterName;
00150 edm::ESHandle<TrajectoryFitter> theFitter;
00151
00152 std::string theTrackerRecHitBuilderName;
00153 edm::ESHandle<TransientTrackingRecHitBuilder> theTrackerRecHitBuilder;
00154
00155 std::string theMuonRecHitBuilderName;
00156 edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder;
00157
00158 const MuonServiceProxy* theService;
00159 const edm::Event* theEvent;
00160 };
00161 #endif