CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoMuon/CosmicMuonProducer/interface/CosmicMuonTrajectoryBuilder.h

Go to the documentation of this file.
00001 #ifndef CosmicMuonTrajectoryBuilder_H
00002 #define CosmicMuonTrajectoryBuilder_H
00003 
00010 #include "RecoMuon/TrackingTools/interface/MuonTrajectoryBuilder.h"
00011 
00012 #include "RecoMuon/TrackingTools/interface/MuonTrajectoryUpdator.h"
00013 #include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
00014 #include "DataFormats/Common/interface/Handle.h"
00015 #include "FWCore/Framework/interface/ESHandle.h"
00016 #include "FWCore/Framework/interface/EventSetup.h"
00017 #include "FWCore/Framework/interface/Event.h"
00018 #include "TrackingTools/DetLayers/interface/DetLayer.h"
00019 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00020 #include "RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h"
00021 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00022 #include "RecoMuon/CosmicMuonProducer/interface/CosmicMuonSmoother.h"
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 #include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
00025 #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
00026 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
00027 
00028 namespace edm {class Event; class EventSetup;}
00029 
00030 class Trajectory;
00031 class TrajectoryMeasurement;
00032 class CosmicMuonUtilities;
00033 class DirectMuonNavigation;
00034 class MuonBestMeasurementFinder;
00035 
00036 typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer;
00037 typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00038 
00039 class CosmicMuonTrajectoryBuilder : public MuonTrajectoryBuilder {
00040 
00041 public:
00042 
00044   CosmicMuonTrajectoryBuilder(const edm::ParameterSet&,const MuonServiceProxy* service);
00045 
00047   virtual ~CosmicMuonTrajectoryBuilder();
00048 
00050   std::vector<Trajectory*> trajectories(const TrajectorySeed&);
00051 
00053   virtual CandidateContainer trajectories(const TrackCand&) {
00054     return CandidateContainer();
00055   }
00056 
00057   virtual void setEvent(const edm::Event&);
00058 
00059   const Propagator* propagator() const {return &*theService->propagator(thePropagatorName);}
00060 
00061   //FIXME
00062   const Propagator* propagatorAlong() const {return &*theService->propagator("SteppingHelixPropagatorAlong");}
00063 
00064   const Propagator* propagatorOpposite() const {return &*theService->propagator("SteppingHelixPropagatorOpposite");}
00065 
00066   MuonTrajectoryUpdator* updator() const {return theUpdator;}
00067 
00068   MuonTrajectoryUpdator* backwardUpdator() const {return theBKUpdator;}
00069 
00070   CosmicMuonSmoother* smoother() const {return theSmoother;}
00071 
00072   CosmicMuonUtilities* utilities() const {return smoother()->utilities();}
00073 
00074   DirectMuonNavigation* navigation() const {return theNavigation;}
00075 
00076   MuonBestMeasurementFinder* bestMeasurementFinder() const {return theBestMeasurementFinder;}
00077 
00078   double t0(const DTRecSegment4D* deseg) const;
00079 
00080   PropagationDirection checkDirectionByT0(const DTRecSegment4D*, const DTRecSegment4D*) const;
00081 
00082 
00083 private:
00084 
00085   MuonTransientTrackingRecHit::MuonRecHitContainer unusedHits(const DetLayer*, const TrajectoryMeasurement&) const;
00086 
00087   void buildSecondHalf(Trajectory&);
00088 
00089   void build(const TrajectoryStateOnSurface&, const NavigationDirection&, Trajectory&);
00090 
00091   TrajectoryStateOnSurface intermediateState(const TrajectoryStateOnSurface&) const;
00092 
00093   void selectHits(MuonTransientTrackingRecHit::MuonRecHitContainer&) const;
00094 
00096   void reverseTrajectory(Trajectory&) const;
00097 
00099   void flipTrajectory(Trajectory&) const;
00100 
00102   void reverseTrajectoryPropagationDirection(Trajectory&) const;
00103 
00105   bool selfDuplicate(const Trajectory&) const;
00106 
00108   void estimateDirection(Trajectory&) const;
00109 
00111   void getDirectionByTime(Trajectory&) const;
00112 
00113   std::vector<TrajectoryMeasurement> findBestMeasurements(const DetLayer*, const TrajectoryStateOnSurface&, const Propagator*, const MeasurementEstimator*);
00114 
00115   void incrementChamberCounters(const DetLayer* layer, int& dtChambers, int& cscChambers, int& rpcChambers, int& totalChambers);
00116 
00117   DirectMuonNavigation* theNavigation;
00118   edm::ParameterSet theNavigationPSet;
00119 
00120   MuonTrajectoryUpdator* theUpdator;
00121   MuonTrajectoryUpdator* theBKUpdator;
00122   MuonDetLayerMeasurements* theLayerMeasurements;
00123 
00124   const MuonServiceProxy* theService;
00125   CosmicMuonSmoother* theSmoother;
00126 
00127   MuonBestMeasurementFinder* theBestMeasurementFinder;
00128 
00129   std::string thePropagatorName;
00130 
00131   bool theTraversingMuonFlag;
00132   bool theStrict1LegFlag;
00133 
00134   std::string category_;
00135   int theNTraversing;
00136   int theNSuccess;
00137 
00138   unsigned long long theCacheId_DG;
00139   edm::Handle<CSCRecHit2DCollection> cschits_;
00140   edm::Handle<DTRecHitCollection> dthits_;
00141  
00142 };
00143 #endif