CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/RecoMuon/GlobalTrackingTools/interface/DynamicTruncation.h

Go to the documentation of this file.
00001 #ifndef RecoMuon_GlobalTrackingTools_DynamicTruncation_h
00002 #define RecoMuon_GlobalTrackingTools_DynamicTruncation_h
00003 
00020 #include <memory>
00021 #include "RecoMuon/GlobalTrackingTools/interface/DirectTrackerNavigation.h"
00022 #include "FWCore/Framework/interface/Frameworkfwd.h"
00023 #include "FWCore/Framework/interface/EDAnalyzer.h"
00024 #include "FWCore/Framework/interface/Event.h"
00025 #include "FWCore/Framework/interface/MakerMacros.h"
00026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00027 #include "DataFormats/TrackReco/interface/Track.h"
00028 #include "DataFormats/TrackReco/interface/TrackFwd.h"
00029 #include "SimTracker/Records/interface/TrackAssociatorRecord.h"
00030 #include "SimTracker/TrackAssociation/interface/TrackAssociatorByChi2.h"
00031 #include "SimTracker/TrackAssociation/interface/TrackAssociatorByHits.h"
00032 #include "TrackingTools/PatternTools/interface/Trajectory.h"
00033 #include "RecoMuon/GlobalTrackingTools/interface/StateSegmentMatcher.h"
00034 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
00035 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00036 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00037 #include "RecoMuon/Navigation/interface/MuonNavigableLayer.h"
00038 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00039 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
00040 #include "RecoTracker/Record/interface/NavigationSchoolRecord.h"
00041 #include "TrackingTools/DetLayers/interface/NavigationSetter.h"
00042 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
00043 #include "RecoMuon/Navigation/interface/DirectMuonNavigation.h"
00044 #include "Alignment/MuonAlignment/interface/MuonAlignment.h"
00045 
00046 
00047 class DynamicTruncation {
00048   
00049  public:
00050 
00051   typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer;
00052   typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer;
00053 
00054   DynamicTruncation(const edm::Event&, const MuonServiceProxy&);
00055 
00056   ~DynamicTruncation();
00057 
00058   // Just one thr for DT and one for CSC
00059   void setThr(int, int);
00060   
00061   // Return the vector with the tracker plus the selected muon hits
00062   TransientTrackingRecHit::ConstRecHitContainer filter(const Trajectory&);
00063 
00064   // Return the vector with the estimator values 
00065   std::vector<double> getEstimators() {return estimators;};
00066  
00067  private:
00068 
00069   void                 compatibleDets(TrajectoryStateOnSurface&, std::map<int, std::vector<DetId> >&);
00070   void                 filteringAlgo(std::map<int, std::vector<DetId> >&);
00071   double               getBest(std::vector<CSCSegment>&, TrajectoryStateOnSurface&, CSCSegment&); 
00072   double               getBest(std::vector<DTRecSegment4D>&, TrajectoryStateOnSurface&, DTRecSegment4D&); 
00073   void                 update(TrajectoryStateOnSurface&, ConstRecHitPointer);
00074   void                 updateWithDThits(ConstRecHitContainer&);
00075   void                 updateWithCSChits(ConstRecHitContainer&);
00076   ConstRecHitContainer sort(ConstRecHitContainer&);
00077   
00078   ConstRecHitContainer result;
00079   
00080   int DTThr;
00081   int CSCThr;
00082 
00083   edm::ESHandle<Propagator> propagator;
00084   edm::ESHandle<Propagator> propagatorCompatibleDet;
00085   edm::ESHandle<GlobalTrackingGeometry> theG;
00086   edm::ESHandle<CSCGeometry> cscGeom;
00087   edm::ESHandle<TransientTrackingRecHitBuilder> theMuonRecHitBuilder;
00088   edm::ESHandle<TrajectoryStateUpdator> updatorHandle;
00089   edm::ESHandle<MuonDetLayerGeometry> navMuon;
00090   DirectMuonNavigation *navigation;
00091   edm::ESHandle<MagneticField> magfield;
00092   const edm::Event* theEvent;
00093   const edm::EventSetup* theSetup;
00094   std::vector<double> estimators;
00095   TrajectoryStateOnSurface currentState;
00096   
00097   std::map<DTChamberId, GlobalError> dtApeMap;
00098   std::map<CSCDetId, GlobalError> cscApeMap; 
00099 };
00100 
00101 #endif
00102 
00103