File indexing completed on 2025-01-09 23:33:53
0001 #ifndef RecoMuon_L2MuonSeedCreator_Phase2L2MuonSeedCreator_H
0002 #define RecoMuon_L2MuonSeedCreator_Phase2L2MuonSeedCreator_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #include "DataFormats/MuonSeed/interface/L2MuonTrajectorySeed.h"
0026 #include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
0027
0028 #include "FWCore/Framework/interface/stream/EDProducer.h"
0029 #include "FWCore/Framework/interface/ESHandle.h"
0030 #include "FWCore/Framework/interface/Frameworkfwd.h"
0031 #include "FWCore/Framework/interface/ConsumesCollector.h"
0032 #include "FWCore/Framework/interface/EventSetup.h"
0033 #include "FWCore/Framework/interface/Event.h"
0034 #include "FWCore/Framework/interface/MakerMacros.h"
0035 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0036 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0037 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0038 #include "FWCore/Utilities/interface/ESGetToken.h"
0039 #include "FWCore/Utilities/interface/InputTag.h"
0040
0041 #include "DataFormats/L1TMuonPhase2/interface/MuonStub.h"
0042 #include "DataFormats/CSCRecHit/interface/CSCSegment.h"
0043 #include "DataFormats/DTRecHit/interface/DTRecSegment4D.h"
0044 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0045 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0046
0047 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0048 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0049 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0050
0051 #include "RecoMuon/TransientTrackingRecHit/interface/MuonTransientTrackingRecHit.h"
0052 #include "RecoMuon/MeasurementDet/interface/MuonDetLayerMeasurements.h"
0053 #include "RecoMuon/DetLayers/interface/MuonDetLayerGeometry.h"
0054 #include "RecoMuon/Records/interface/MuonRecoGeometryRecord.h"
0055 #include "MagneticField/Engine/interface/MagneticField.h"
0056 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0057 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
0058
0059 #include "RecoMuon/TrackingTools/interface/MuonServiceProxy.h"
0060
0061 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0062
0063 #include <map>
0064 #include <utility>
0065
0066 class RecHit;
0067 class Plane;
0068 class GeomDet;
0069 class MagneticField;
0070 class MuonTransientTrackingRecHit;
0071
0072 enum Type { barrel, overlap, endcap };
0073
0074 class Phase2L2MuonSeedCreator : public edm::stream::EDProducer<> {
0075 public:
0076 typedef MuonTransientTrackingRecHit::MuonRecHitContainer SegmentContainer;
0077
0078
0079 explicit Phase2L2MuonSeedCreator(const edm::ParameterSet& pset);
0080
0081
0082 ~Phase2L2MuonSeedCreator() override = default;
0083
0084
0085 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0086 void produce(edm::Event&, const edm::EventSetup&) override;
0087
0088 private:
0089
0090 const edm::EDGetTokenT<l1t::TrackerMuonCollection> l1TkMuCollToken_;
0091 const edm::EDGetTokenT<CSCSegmentCollection> cscSegmentCollToken_;
0092 const edm::EDGetTokenT<DTRecSegment4DCollection> dtSegmentCollToken_;
0093
0094 const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> cscGeometryToken_;
0095 const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeometryToken_;
0096 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magneticFieldToken_;
0097
0098
0099 const double minMomentum_;
0100 const double maxMomentum_;
0101
0102
0103 const double matchingPhiWindow_;
0104 const double matchingThetaWindow_;
0105
0106
0107 const double extrapolationDeltaPhiClose_;
0108 const double extrapolationDeltaPhiFar_;
0109
0110 const double maxEtaBarrel_;
0111 const double maxEtaOverlap_;
0112
0113
0114 edm::ESHandle<CSCGeometry> cscGeometry_;
0115 edm::ESHandle<DTGeometry> dtGeometry_;
0116
0117 std::unique_ptr<MuonServiceProxy> service_;
0118 std::unique_ptr<MeasurementEstimator> estimator_;
0119
0120 const std::string propagatorName_;
0121
0122
0123
0124
0125 const std::vector<DTChamberId> matchingIds(const DTChamberId& stubId) const;
0126
0127
0128 const std::vector<CSCDetId> matchingIds(const CSCDetId& stubId) const;
0129
0130
0131 const std::pair<int, int> matchingStubSegment(const DTChamberId& stubId,
0132 const l1t::MuonStubRef stub,
0133 const DTRecSegment4DCollection& segments,
0134 const float l1TkMuTheta) const;
0135
0136
0137 const std::pair<int, int> matchingStubSegment(const CSCDetId& stubId,
0138 const l1t::MuonStubRef stub,
0139 const CSCSegmentCollection& segments,
0140 const float l1TkMuTheta) const;
0141
0142
0143 const std::pair<int, int> extrapolateToNearbyStation(const int endingStation,
0144 const std::map<DTChamberId, std::pair<int, int>>& matchesInBarrel,
0145 const DTRecSegment4DCollection& segments) const;
0146
0147 const std::pair<int, int> extrapolateMatch(const int bestStartingSegIndex,
0148 const int endingStation,
0149 const DTRecSegment4DCollection& segments) const;
0150 };
0151 #endif