File indexing completed on 2024-04-06 12:27:16
0001 #ifndef RecoMuon_TrackerSeedGenerator_TSGForOIFromL2_H
0002 #define RecoMuon_TrackerSeedGenerator_TSGForOIFromL2_H
0003
0004
0005
0006
0007
0008
0009
0010 #include "DataFormats/TrackReco/interface/Track.h"
0011 #include "FWCore/Framework/interface/global/EDProducer.h"
0012 #include "FWCore/Framework/interface/Event.h"
0013 #include "FWCore/Framework/interface/EventSetup.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/Framework/interface/MakerMacros.h"
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
0019 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
0020 #include "MagneticField/Engine/interface/MagneticField.h"
0021 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
0022 #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h"
0023 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0024 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimator.h"
0025 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
0026 #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h"
0027 #include "TrackingTools/PatternTools/interface/TrajMeasLessEstim.h"
0028 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
0029 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
0030 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0031 #include "TrackingTools/GeomPropagators/interface/StateOnTrackerBound.h"
0032 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0033
0034 class TSGForOIFromL2 : public edm::global::EDProducer<> {
0035 public:
0036 explicit TSGForOIFromL2(const edm::ParameterSet& iConfig);
0037 ~TSGForOIFromL2() override;
0038 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0039 void produce(edm::StreamID sid, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
0040
0041 private:
0042
0043 const edm::EDGetTokenT<reco::TrackCollection> src_;
0044
0045
0046 const unsigned int maxSeeds_;
0047
0048
0049 const unsigned int maxHitlessSeeds_;
0050
0051
0052 const unsigned int maxHitSeeds_;
0053
0054
0055 const unsigned int numOfLayersToTry_;
0056
0057
0058 const unsigned int numOfHitsToTry_;
0059
0060
0061 const unsigned int numL2ValidHitsCutAllEta_;
0062 const unsigned int numL2ValidHitsCutAllEndcap_;
0063
0064
0065 const double fixedErrorRescalingForHits_;
0066 const double fixedErrorRescalingForHitless_;
0067
0068
0069 const bool adjustErrorsDynamicallyForHits_;
0070 const bool adjustErrorsDynamicallyForHitless_;
0071
0072
0073 const std::string estimatorName_;
0074
0075
0076 const double minEtaForTEC_;
0077
0078
0079 const double maxEtaForTOB_;
0080
0081
0082
0083 const bool useHitLessSeeds_;
0084
0085
0086 const std::unique_ptr<TrajectoryStateUpdator> updator_;
0087
0088 const edm::EDGetTokenT<MeasurementTrackerEvent> measurementTrackerTag_;
0089
0090
0091 const double pT1_, pT2_, pT3_;
0092 const double eta1_, eta2_, eta3_, eta4_, eta5_, eta6_, eta7_;
0093 const double SF1_, SF2_, SF3_, SF4_, SF5_, SF6_;
0094 const double SFHld_, SFHd_;
0095
0096
0097 const double tsosDiff1_;
0098 const double tsosDiff2_;
0099
0100
0101 const bool displacedReco_;
0102
0103
0104 const std::string propagatorName_;
0105 const std::string theCategory_;
0106 const edm::ESGetToken<Chi2MeasurementEstimatorBase, TrackingComponentsRecord> estimatorToken_;
0107 const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> magfieldToken_;
0108 const edm::ESGetToken<Propagator, TrackingComponentsRecord> propagatorToken_;
0109 const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tmpTkGeometryToken_;
0110 const edm::ESGetToken<GlobalTrackingGeometry, GlobalTrackingGeometryRecord> geometryToken_;
0111 const edm::ESGetToken<Propagator, TrackingComponentsRecord> sHPOppositeToken_;
0112
0113
0114 void makeSeedsWithoutHits(const GeometricSearchDet& layer,
0115 const TrajectoryStateOnSurface& tsos,
0116 const Propagator& propagatorAlong,
0117 const edm::ESHandle<Chi2MeasurementEstimatorBase>& estimator,
0118 double errorSF,
0119 unsigned int& hitlessSeedsMade,
0120 unsigned int& numSeedsMade,
0121 std::vector<TrajectorySeed>& out) const;
0122
0123
0124 void makeSeedsFromHits(const GeometricSearchDet& layer,
0125 const TrajectoryStateOnSurface& tsos,
0126 const Propagator& propagatorAlong,
0127 const edm::ESHandle<Chi2MeasurementEstimatorBase>& estimator,
0128 const edm::Handle<MeasurementTrackerEvent>& measurementTracker,
0129 double errorSF,
0130 unsigned int& hitSeedsMade,
0131 unsigned int& numSeedsMade,
0132 unsigned int& layerCount,
0133 std::vector<TrajectorySeed>& out) const;
0134
0135
0136 double calculateSFFromL2(const reco::TrackRef track) const;
0137
0138
0139 double match_Chi2(const TrajectoryStateOnSurface& tsos1, const TrajectoryStateOnSurface& tsos2) const;
0140 };
0141
0142 #endif