Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:25:42

0001 #ifndef CosmicMuonProducer_CosmicMuonSmoother_H
0002 #define CosmicMuonProducer_CosmicMuonSmoother_H
0003 
0004 /** \file CosmicMuonSmoother
0005  *
0006  *  \author Chang Liu  -  Purdue University
0007  */
0008 
0009 #include "TrackingTools/PatternTools/interface/TrajectorySmoother.h"
0010 
0011 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0012 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
0013 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0014 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0015 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0016 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
0017 #include "RecoMuon/CosmicMuonProducer/interface/CosmicMuonUtilities.h"
0018 
0019 class Propagator;
0020 class KFUpdator;
0021 class MuonServiceProxy;
0022 class Chi2MeasurementEstimator;
0023 
0024 namespace edm {
0025   class ParameterSet;
0026   class Event;
0027   class EventSetup;
0028 }  // namespace edm
0029 
0030 class Trajectory;
0031 class TrajectoryMeasurement;
0032 
0033 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
0034 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
0035 typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
0036 typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer;
0037 
0038 class CosmicMuonSmoother : public TrajectorySmoother {
0039 public:
0040   CosmicMuonSmoother(const edm::ParameterSet&, const MuonServiceProxy* service);
0041   ~CosmicMuonSmoother() override;
0042 
0043   Trajectory trajectory(const Trajectory&) const override;
0044 
0045   TrajectoryContainer trajectories(const Trajectory& traj) const override {
0046     return TrajectorySmoother::trajectories(traj);
0047   }
0048 
0049   CosmicMuonSmoother* clone() const override { return new CosmicMuonSmoother(*this); }
0050 
0051   /// refit trajectory
0052   virtual TrajectoryContainer trajectories(const TrajectorySeed& seed,
0053                                            const ConstRecHitContainer& hits,
0054                                            const TrajectoryStateOnSurface& firstPredTsos) const;
0055 
0056   const Propagator* propagatorAlong() const { return &*theService->propagator(thePropagatorAlongName); }
0057 
0058   const Propagator* propagatorOpposite() const { return &*theService->propagator(thePropagatorOppositeName); }
0059 
0060   const KFUpdator* updator() const { return theUpdator; }
0061 
0062   const CosmicMuonUtilities* utilities() const { return theUtilities; }
0063 
0064   const Chi2MeasurementEstimator* estimator() const { return theEstimator; }
0065 
0066   std::vector<Trajectory> fit(const Trajectory&) const;
0067   std::vector<Trajectory> fit(const TrajectorySeed& seed,
0068                               const ConstRecHitContainer& hits,
0069                               const TrajectoryStateOnSurface& firstPredTsos) const;
0070 
0071   void setHitCloner(TkCloner const* hc) override {}
0072 
0073 private:
0074   std::vector<Trajectory> smooth(const std::vector<Trajectory>&) const;
0075   std::vector<Trajectory> smooth(const Trajectory&) const;
0076 
0077   TrajectoryStateOnSurface initialState(const Trajectory&) const;
0078 
0079   void sortHitsAlongMom(ConstRecHitContainer& hits, const TrajectoryStateOnSurface&) const;
0080 
0081   const KFUpdator* theUpdator;
0082   const Chi2MeasurementEstimator* theEstimator;
0083   const CosmicMuonUtilities* theUtilities;
0084 
0085   const MuonServiceProxy* theService;
0086 
0087   std::string thePropagatorAlongName;
0088   std::string thePropagatorOppositeName;
0089   double theErrorRescaling;
0090   std::string category_;
0091 };
0092 #endif