Go to the documentation of this file.00001 #ifndef MuonAnalysis_MuonAssociators_interface_PropagateToMuon_h
00002 #define MuonAnalysis_MuonAssociators_interface_PropagateToMuon_h
00003
00004
00005
00006
00017 #include "DataFormats/Candidate/interface/Candidate.h"
00018 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
00019 #include "DataFormats/GeometrySurface/interface/BoundDisk.h"
00020 #include "DataFormats/TrackReco/interface/Track.h"
00021 #include "FWCore/Framework/interface/ESHandle.h"
00022 #include "FWCore/Framework/interface/EventSetup.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 #include "MagneticField/Engine/interface/MagneticField.h"
00025 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
00026 struct DetLayer;
00027 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00028 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00029
00030 class PropagateToMuon {
00031 public:
00032 explicit PropagateToMuon(const edm::ParameterSet & iConfig) ;
00033 ~PropagateToMuon() ;
00034
00036 void init(const edm::EventSetup &iSetup) ;
00037
00039 TrajectoryStateOnSurface extrapolate(const reco::Track &tk) const { return extrapolate(startingState(tk)); }
00040
00042 TrajectoryStateOnSurface extrapolate(const reco::Candidate &tk) const { return extrapolate(startingState(tk)); }
00043
00045 TrajectoryStateOnSurface extrapolate(const FreeTrajectoryState &state) const ;
00046
00047 private:
00048 enum WhichTrack { None, TrackerTk, MuonTk, GlobalTk };
00049 enum WhichState { AtVertex, Innermost, Outermost };
00050
00052 bool useSimpleGeometry_;
00053 WhichTrack whichTrack_;
00054 WhichState whichState_;
00055
00057 bool cosmicPropagation_;
00058
00059
00060 edm::ESHandle<MagneticField> magfield_;
00061 edm::ESHandle<Propagator> propagator_, propagatorAny_, propagatorOpposite_;
00062 edm::ESHandle<MuonDetLayerGeometry> muonGeometry_;
00063
00064 const BoundCylinder *barrelCylinder_;
00065 const BoundDisk *endcapDiskPos_, *endcapDiskNeg_;
00066 double barrelHalfLength_;
00067 std::pair<float,float> endcapRadii_;
00068
00070 FreeTrajectoryState startingState(const reco::Candidate &reco) const ;
00071
00073 FreeTrajectoryState startingState(const reco::Track &tk) const ;
00074
00076 TrajectoryStateOnSurface getBestDet(const TrajectoryStateOnSurface &tsos, const DetLayer *station) const;
00077 };
00078
00079 #endif