00001 #ifndef RecoMuon_TrackerSeedGenerator_TSGFromPropagation_H 00002 #define RecoMuon_TrackerSeedGenerator_TSGFromPropagation_H 00003 00013 #include "RecoMuon/TrackerSeedGenerator/interface/TrackerSeedGenerator.h" 00014 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00015 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" 00016 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h" 00017 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h" 00018 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h" 00019 #include "RecoMuon/TrackingTools/interface/MuonErrorMatrix.h" 00020 00021 class LayerMeasurements; 00022 class Chi2MeasurementEstimator; 00023 class Propagator; 00024 class MeasurementTracker; 00025 class GeometricSearchTracker; 00026 class DirectTrackerNavigation; 00027 class TrajectoryStateTransform; 00028 00029 class TSGFromPropagation : public TrackerSeedGenerator { 00030 00031 public: 00033 TSGFromPropagation(const edm::ParameterSet &pset); 00034 00035 TSGFromPropagation(const edm::ParameterSet& par, const MuonServiceProxy*); 00036 00038 virtual ~TSGFromPropagation(); 00039 00041 void trackerSeeds(const TrackCand&, const TrackingRegion&, std::vector<TrajectorySeed>&); 00042 00044 void init(const MuonServiceProxy*); 00045 00047 void setEvent(const edm::Event&); 00048 00049 private: 00050 00051 TrajectoryStateOnSurface innerState(const TrackCand&) const; 00052 00053 TrajectoryStateOnSurface outerTkState(const TrackCand&) const; 00054 00055 const LayerMeasurements* tkLayerMeasurements() const { return theTkLayerMeasurements; } 00056 00057 const TrajectoryStateUpdator* updator() const {return theUpdator;} 00058 00059 const Chi2MeasurementEstimator* estimator() const { return theEstimator; } 00060 00061 edm::ESHandle<Propagator> propagator() const {return theService->propagator(thePropagatorName); } 00062 00064 TrajectorySeed createSeed(const TrajectoryStateOnSurface&, const DetId&) const; 00065 00067 TrajectorySeed createSeed(const TrajectoryStateOnSurface& tsos, const edm::OwnVector<TrackingRecHit>& container, const DetId& id) const; 00068 00070 void selectMeasurements(std::vector<TrajectoryMeasurement>&) const; 00071 00073 void validMeasurements(std::vector<TrajectoryMeasurement>&) const; 00074 00076 std::vector<TrajectoryMeasurement> findMeasurements_new(const DetLayer*, const TrajectoryStateOnSurface&) const; 00077 00079 std::vector<TrajectoryMeasurement> findMeasurements(const DetLayer*, const TrajectoryStateOnSurface&) const; 00080 00082 void findSecondMeasurements(std::vector<TrajectoryMeasurement>&, const std::vector<const DetLayer*>& ) const; 00083 00085 bool passSelection(const TrajectoryStateOnSurface&) const; 00086 00088 void adjust(FreeTrajectoryState &) const; 00089 00091 void adjust(TrajectoryStateOnSurface &) const; 00092 00093 double dxyDis(const TrajectoryStateOnSurface& tsos) const; 00094 00095 double zDis(const TrajectoryStateOnSurface& tsos) const; 00096 00097 struct increasingEstimate{ 00098 bool operator()(const TrajectoryMeasurement& lhs, 00099 const TrajectoryMeasurement& rhs) const{ 00100 return lhs.estimate() < rhs.estimate(); 00101 } 00102 }; 00103 00104 struct isInvalid { 00105 bool operator()(const TrajectoryMeasurement& measurement) { 00106 return ( ((measurement).recHit() == 0) || !((measurement).recHit()->isValid()) || !((measurement).updatedState().isValid()) ); 00107 } 00108 }; 00109 00110 unsigned long long theCacheId_MT; 00111 00112 std::string theCategory; 00113 00114 const LayerMeasurements* theTkLayerMeasurements; 00115 00116 edm::ESHandle<GeometricSearchTracker> theTracker; 00117 00118 edm::ESHandle<MeasurementTracker> theMeasTracker; 00119 00120 const DirectTrackerNavigation* theNavigation; 00121 00122 const MuonServiceProxy* theService; 00123 00124 const TrajectoryStateUpdator* theUpdator; 00125 00126 const Chi2MeasurementEstimator* theEstimator; 00127 00128 TrajectoryStateTransform* theTSTransformer; 00129 00130 edm::ParameterSet theConfig; 00131 00132 double theMaxChi2; 00133 00134 double theErrorRescaling; 00135 00136 bool theUseVertexStateFlag; 00137 00138 bool theUpdateStateFlag; 00139 00140 bool theUseSecondMeasurementsFlag; 00141 00142 bool theSelectStateFlag; 00143 00144 std::string thePropagatorName; 00145 00146 MuonErrorMatrix * theErrorMatrixAdjuster; 00147 00148 bool theAdjustAtIp; 00149 00150 }; 00151 00152 #endif