CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/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   Trajectory trajectory(const Trajectory&) const;
00045 
00046   virtual TrajectoryContainer trajectories(const Trajectory& traj) const {
00047      return TrajectorySmoother::trajectories(traj);
00048   }
00049 
00050   virtual CosmicMuonSmoother* clone() const {
00051     return new CosmicMuonSmoother(*this);
00052   }
00053 
00055     virtual TrajectoryContainer trajectories(const TrajectorySeed& seed,
00056                                              const ConstRecHitContainer& hits, 
00057                                              const TrajectoryStateOnSurface& firstPredTsos) const;
00058 
00059 
00060   const Propagator* propagatorAlong() const {return &*theService->propagator(thePropagatorAlongName);}
00061 
00062   const Propagator* propagatorOpposite() const {return &*theService->propagator(thePropagatorOppositeName);}
00063 
00064   KFUpdator* updator() const {return theUpdator;}
00065 
00066   CosmicMuonUtilities* utilities() const {return theUtilities; } 
00067 
00068   Chi2MeasurementEstimator* estimator() const {return theEstimator;}
00069 
00070   std::vector<Trajectory> fit(const Trajectory&) const;
00071   std::vector<Trajectory> fit(const TrajectorySeed& seed,
00072                               const ConstRecHitContainer& hits,
00073                               const TrajectoryStateOnSurface& firstPredTsos) const;
00074 
00075 private:
00076   std::vector<Trajectory> smooth(const std::vector<Trajectory>& ) const;
00077   std::vector<Trajectory> smooth(const Trajectory&) const;
00078 
00079   TrajectoryStateOnSurface initialState(const Trajectory&) const;
00080 
00081   void sortHitsAlongMom(ConstRecHitContainer& hits, const TrajectoryStateOnSurface&) const;
00082 
00083   KFUpdator* theUpdator;
00084   Chi2MeasurementEstimator* theEstimator;
00085   CosmicMuonUtilities* theUtilities; 
00086 
00087   const MuonServiceProxy* theService;
00088 
00089   std::string thePropagatorAlongName;
00090   std::string thePropagatorOppositeName;
00091   double theErrorRescaling;
00092   std::string category_;
00093   
00094 };
00095 #endif