CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/RecoMuon/CosmicMuonProducer/interface/CosmicMuonSmoother.h

Go to the documentation of this file.
00001 #ifndef CosmicMuonProducer_CosmicMuonSmoother_H
00002 #define CosmicMuonProducer_CosmicMuonSmoother_H
00003 
00011 #include "TrackingTools/PatternTools/interface/TrajectorySmoother.h"
00012 
00013 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00014 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00015 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00016 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00017 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00018 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00019 #include "RecoMuon/CosmicMuonProducer/interface/CosmicMuonUtilities.h"
00020 
00021 class Propagator;
00022 class KFUpdator;
00023 class MuonServiceProxy;
00024 class Chi2MeasurementEstimator;
00025 
00026 namespace edm {class ParameterSet; class Event; class EventSetup;}
00027 
00028 class Trajectory;
00029 class TrajectoryMeasurement;
00030 
00031 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
00032 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00033 typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
00034 typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer;
00035 
00036 
00037 class CosmicMuonSmoother : public TrajectorySmoother {
00038 public:
00039 
00040 
00041   CosmicMuonSmoother(const edm::ParameterSet&,const MuonServiceProxy* service);
00042   virtual ~CosmicMuonSmoother();
00043 
00044   virtual std::vector<Trajectory> trajectories(const Trajectory&) const;
00045 
00046   virtual CosmicMuonSmoother* clone() const {
00047     return new CosmicMuonSmoother(*this);
00048   }
00049 
00051     virtual TrajectoryContainer trajectories(const TrajectorySeed& seed,
00052                                              const ConstRecHitContainer& hits, 
00053                                              const TrajectoryStateOnSurface& firstPredTsos) const;
00054 
00055 
00056   const Propagator* propagatorAlong() const {return &*theService->propagator(thePropagatorAlongName);}
00057 
00058   const Propagator* propagatorOpposite() const {return &*theService->propagator(thePropagatorOppositeName);}
00059 
00060   KFUpdator* updator() const {return theUpdator;}
00061 
00062   CosmicMuonUtilities* utilities() const {return theUtilities; } 
00063 
00064   Chi2MeasurementEstimator* estimator() const {return theEstimator;}
00065 
00066   std::vector<Trajectory> fit(const Trajectory&) const;
00067   std::vector<Trajectory> fit(const TrajectorySeed& seed,
00068                               const ConstRecHitContainer& hits,
00069                               const TrajectoryStateOnSurface& firstPredTsos) const;
00070 
00071 private:
00072   std::vector<Trajectory> smooth(const std::vector<Trajectory>& ) const;
00073   std::vector<Trajectory> smooth(const Trajectory&) const;
00074 
00075   TrajectoryStateOnSurface initialState(const Trajectory&) const;
00076 
00077   void sortHitsAlongMom(ConstRecHitContainer& hits, const TrajectoryStateOnSurface&) const;
00078 
00079   KFUpdator* theUpdator;
00080   Chi2MeasurementEstimator* theEstimator;
00081   CosmicMuonUtilities* theUtilities; 
00082 
00083   const MuonServiceProxy* theService;
00084 
00085   std::string thePropagatorAlongName;
00086   std::string thePropagatorOppositeName;
00087   double theErrorRescaling;
00088   std::string category_;
00089   
00090 };
00091 #endif